Merge branch 'master' of /home/wd/git/u-boot/lwmon5
authorWolfgang Denk <wd@denx.de>
Fri, 25 Apr 2008 09:32:01 +0000 (11:32 +0200)
committerWolfgang Denk <wd@denx.de>
Fri, 25 Apr 2008 09:32:01 +0000 (11:32 +0200)
Conflicts:

common/cmd_bootm.c
common/cmd_log.c
include/common.h
post/board/lwmon5/Makefile
post/board/lwmon5/dsp.c
post/board/lwmon5/dspic.c
post/board/lwmon5/fpga.c
post/board/lwmon5/gdc.c
post/board/lwmon5/sysmon.c
post/board/lwmon5/watchdog.c

Signed-off-by: Wolfgang Denk <wd@denx.de>
1066 files changed:
.gitignore
CHANGELOG
CREDITS
MAINTAINERS
MAKEALL
Makefile
README
api/api.c
blackfin_config.mk
board/BuS/EB+MCF-EV123/u-boot.lds
board/LEOX/elpt860/u-boot.lds
board/LEOX/elpt860/u-boot.lds.debug
board/MAI/AmigaOneG3SE/u-boot.lds
board/Marvell/db64360/u-boot.lds
board/Marvell/db64460/u-boot.lds
board/MigoR/Makefile [new file with mode: 0644]
board/MigoR/config.mk [new file with mode: 0644]
board/MigoR/lowlevel_init.S [new file with mode: 0644]
board/MigoR/migo_r.c [new file with mode: 0644]
board/MigoR/u-boot.lds [new file with mode: 0644]
board/RPXClassic/u-boot.lds
board/RPXClassic/u-boot.lds.debug
board/RPXlite/u-boot.lds
board/RPXlite/u-boot.lds.debug
board/RPXlite_dw/u-boot.lds
board/RPXlite_dw/u-boot.lds.debug
board/RRvision/u-boot.lds
board/adder/adder.c
board/amcc/acadia/u-boot-nand.lds
board/amcc/acadia/u-boot.lds
board/amcc/bamboo/u-boot-nand.lds
board/amcc/bamboo/u-boot.lds
board/amcc/bubinga/u-boot.lds
board/amcc/canyonlands/bootstrap.c
board/amcc/canyonlands/canyonlands.c
board/amcc/canyonlands/init.S
board/amcc/canyonlands/u-boot-nand.lds
board/amcc/canyonlands/u-boot.lds
board/amcc/ebony/u-boot.lds
board/amcc/katmai/u-boot.lds
board/amcc/kilauea/u-boot-nand.lds
board/amcc/kilauea/u-boot.lds
board/amcc/luan/u-boot.lds
board/amcc/makalu/u-boot.lds
board/amcc/ocotea/u-boot.lds
board/amcc/sequoia/u-boot-nand.lds
board/amcc/sequoia/u-boot.lds
board/amcc/taihu/u-boot.lds
board/amcc/taishan/u-boot.lds
board/amcc/walnut/u-boot.lds
board/amcc/yosemite/u-boot.lds
board/amcc/yucca/u-boot.lds
board/amirix/ap1000/u-boot.lds
board/atmel/at91cap9adk/Makefile
board/atmel/at91cap9adk/at91cap9adk.c
board/atmel/at91cap9adk/led.c
board/atmel/at91cap9adk/nand.c
board/atmel/at91cap9adk/partition.c [new file with mode: 0644]
board/atmel/at91rm9200dk/Makefile
board/atmel/at91rm9200dk/partition.c [new file with mode: 0644]
board/atmel/at91sam9260ek/Makefile [new file with mode: 0644]
board/atmel/at91sam9260ek/at91sam9260ek.c [new file with mode: 0644]
board/atmel/at91sam9260ek/config.mk [new file with mode: 0644]
board/atmel/at91sam9260ek/led.c [new file with mode: 0644]
board/atmel/at91sam9260ek/nand.c [new file with mode: 0644]
board/atmel/at91sam9260ek/partition.c [new file with mode: 0644]
board/atmel/at91sam9260ek/u-boot.lds [new file with mode: 0644]
board/atum8548/tlb.c
board/atum8548/u-boot.lds
board/bf533-ezkit/Makefile
board/bf533-ezkit/bf533-ezkit.c
board/bf533-ezkit/config.mk
board/bf533-ezkit/u-boot.lds.S
board/bf533-stamp/Makefile
board/bf533-stamp/bf533-stamp.c
board/bf533-stamp/config.mk
board/bf533-stamp/spi.c [deleted file]
board/bf533-stamp/spi_flash.c [new file with mode: 0644]
board/bf533-stamp/u-boot.lds.S
board/bf537-stamp/Makefile
board/bf537-stamp/bf537-stamp.c
board/bf537-stamp/config.mk
board/bf537-stamp/flash-defines.h [deleted file]
board/bf537-stamp/flash.c [deleted file]
board/bf537-stamp/spi_flash.c [new file with mode: 0644]
board/bf537-stamp/stm_m25p64.c [deleted file]
board/bf537-stamp/u-boot.lds.S
board/bf561-ezkit/Makefile
board/bf561-ezkit/config.mk
board/bf561-ezkit/u-boot.lds.S
board/bmw/m48t59y.c
board/c2mon/u-boot.lds
board/c2mon/u-boot.lds.debug
board/cm5200/u-boot.lds
board/cobra5272/u-boot.lds
board/cogent/u-boot.lds
board/cogent/u-boot.lds.debug
board/cray/L1/L1.c
board/cray/L1/u-boot.lds
board/cray/L1/u-boot.lds.debug
board/csb272/u-boot.lds
board/csb472/u-boot.lds
board/dave/PPChameleonEVB/u-boot.lds
board/dbau1x00/lowlevel_init.S
board/eltec/bab7xx/u-boot.lds
board/eltec/elppc/u-boot.lds
board/eltec/mhpc/u-boot.lds
board/eltec/mhpc/u-boot.lds.debug
board/emk/top860/u-boot.lds
board/emk/top860/u-boot.lds.debug
board/eric/u-boot.lds
board/esd/adciop/u-boot.lds
board/esd/apc405/Makefile
board/esd/apc405/apc405.c
board/esd/apc405/fpgadata.c
board/esd/apc405/logo_640_480_24bpp.c
board/esd/apc405/strataflash.c [deleted file]
board/esd/apc405/u-boot.lds
board/esd/ar405/u-boot.lds
board/esd/ash405/u-boot.lds
board/esd/canbt/u-boot.lds
board/esd/cms700/u-boot.lds
board/esd/common/auto_update.c
board/esd/common/auto_update.h
board/esd/common/lcd.c
board/esd/common/s1d13505_640_480_16bpp.h [new file with mode: 0644]
board/esd/cpci2dp/u-boot.lds
board/esd/cpci405/u-boot.lds
board/esd/cpci750/u-boot.lds
board/esd/cpciiser4/u-boot.lds
board/esd/dasa_sim/u-boot.lds
board/esd/dp405/u-boot.lds
board/esd/du405/u-boot.lds
board/esd/du440/du440.c
board/esd/du440/du440.h
board/esd/du440/u-boot.lds
board/esd/hh405/u-boot.lds
board/esd/hub405/u-boot.lds
board/esd/ocrtc/u-boot.lds
board/esd/pci405/u-boot.lds
board/esd/plu405/u-boot.lds
board/esd/pmc405/u-boot.lds
board/esd/pmc440/cmd_pmc440.c
board/esd/pmc440/pmc440.c
board/esd/pmc440/u-boot-nand.lds
board/esd/pmc440/u-boot.lds
board/esd/tasreg/u-boot.lds
board/esd/voh405/u-boot.lds
board/esd/vom405/u-boot.lds
board/esd/wuh405/u-boot.lds
board/esteem192e/u-boot.lds
board/etin/debris/phantom.c
board/etx094/u-boot.lds
board/etx094/u-boot.lds.debug
board/evb64260/u-boot.lds
board/exbitgen/u-boot.lds
board/fads/fads.h
board/fads/u-boot.lds.debug
board/flagadm/u-boot.lds
board/flagadm/u-boot.lds.debug
board/freescale/common/Makefile
board/freescale/common/cds_eeprom.c [moved from board/freescale/common/eeprom.c with 100% similarity]
board/freescale/common/cds_pci_ft.c [moved from board/freescale/common/ft_board.c with 100% similarity]
board/freescale/common/cds_via.c [moved from board/freescale/common/via.c with 100% similarity]
board/freescale/m52277evb/u-boot.lds
board/freescale/m5235evb/u-boot.16
board/freescale/m5235evb/u-boot.32
board/freescale/m5235evb/u-boot.lds
board/freescale/m5249evb/u-boot.lds
board/freescale/m5253evbe/u-boot.lds
board/freescale/m5275evb/Makefile [new file with mode: 0644]
board/freescale/m5275evb/config.mk [moved from board/r5200/config.mk with 97% similarity]
board/freescale/m5275evb/m5275evb.c [new file with mode: 0644]
board/freescale/m5275evb/mii.c [moved from board/r5200/mii.c with 92% similarity]
board/freescale/m5275evb/u-boot.lds [new file with mode: 0644]
board/freescale/m5329evb/u-boot.lds
board/freescale/m5373evb/u-boot.lds
board/freescale/m54455evb/flash.c
board/freescale/m54455evb/u-boot.atm
board/freescale/m54455evb/u-boot.int
board/freescale/m54455evb/u-boot.lds
board/freescale/m547xevb/m547xevb.c
board/freescale/m547xevb/u-boot.lds
board/freescale/m548xevb/u-boot.lds
board/freescale/mpc7448hpc2/Makefile [moved from board/mpc7448hpc2/Makefile with 100% similarity]
board/freescale/mpc7448hpc2/asm_init.S [moved from board/mpc7448hpc2/asm_init.S with 100% similarity]
board/freescale/mpc7448hpc2/config.mk [moved from board/mpc7448hpc2/config.mk with 100% similarity]
board/freescale/mpc7448hpc2/mpc7448hpc2.c [moved from board/mpc7448hpc2/mpc7448hpc2.c with 100% similarity]
board/freescale/mpc7448hpc2/tsi108_init.c [moved from board/mpc7448hpc2/tsi108_init.c with 100% similarity]
board/freescale/mpc7448hpc2/u-boot.lds [moved from board/mpc7448hpc2/u-boot.lds with 96% similarity]
board/freescale/mpc8260ads/Makefile [moved from board/mpc8260ads/Makefile with 100% similarity]
board/freescale/mpc8260ads/config.mk [moved from board/mpc8260ads/config.mk with 100% similarity]
board/freescale/mpc8260ads/flash.c [moved from board/mpc8260ads/flash.c with 100% similarity]
board/freescale/mpc8260ads/mpc8260ads.c [moved from board/mpc8260ads/mpc8260ads.c with 100% similarity]
board/freescale/mpc8266ads/Makefile [moved from board/mpc8266ads/Makefile with 100% similarity]
board/freescale/mpc8266ads/config.mk [moved from board/mpc8266ads/config.mk with 100% similarity]
board/freescale/mpc8266ads/flash.c [moved from board/mpc8266ads/flash.c with 100% similarity]
board/freescale/mpc8266ads/mpc8266ads.c [moved from board/mpc8266ads/mpc8266ads.c with 100% similarity]
board/freescale/mpc8313erdb/mpc8313erdb.c
board/freescale/mpc8323erdb/mpc8323erdb.c
board/freescale/mpc8349itx/mpc8349itx.c
board/freescale/mpc8360emds/mpc8360emds.c
board/freescale/mpc8360erdk/Makefile
board/freescale/mpc8360erdk/mpc8360erdk.c
board/freescale/mpc8360erdk/nand.c [new file with mode: 0644]
board/freescale/mpc837xemds/mpc837xemds.c
board/freescale/mpc837xerdb/mpc837xerdb.c
board/freescale/mpc8540ads/tlb.c
board/freescale/mpc8540ads/u-boot.lds
board/freescale/mpc8541cds/Makefile
board/freescale/mpc8541cds/tlb.c
board/freescale/mpc8541cds/u-boot.lds
board/freescale/mpc8544ds/tlb.c
board/freescale/mpc8544ds/u-boot.lds
board/freescale/mpc8548cds/Makefile
board/freescale/mpc8548cds/tlb.c
board/freescale/mpc8548cds/u-boot.lds
board/freescale/mpc8555cds/Makefile
board/freescale/mpc8555cds/tlb.c
board/freescale/mpc8555cds/u-boot.lds
board/freescale/mpc8560ads/tlb.c
board/freescale/mpc8560ads/u-boot.lds
board/freescale/mpc8568mds/Makefile
board/freescale/mpc8568mds/tlb.c
board/freescale/mpc8568mds/u-boot.lds
board/freescale/mpc8610hpcd/Makefile
board/g2000/u-boot.lds
board/gaisler/gr_cpci_ax2000/Makefile [new file with mode: 0644]
board/gaisler/gr_cpci_ax2000/config.mk [new file with mode: 0644]
board/gaisler/gr_cpci_ax2000/gr_cpci_ax2000.c [new file with mode: 0644]
board/gaisler/gr_cpci_ax2000/u-boot.lds [new file with mode: 0644]
board/gaisler/gr_ep2s60/Makefile [new file with mode: 0644]
board/gaisler/gr_ep2s60/config.mk [new file with mode: 0644]
board/gaisler/gr_ep2s60/gr_ep2s60.c [new file with mode: 0644]
board/gaisler/gr_ep2s60/u-boot.lds [new file with mode: 0644]
board/gaisler/gr_xc3s_1500/Makefile [new file with mode: 0644]
board/gaisler/gr_xc3s_1500/config.mk [new file with mode: 0644]
board/gaisler/gr_xc3s_1500/gr_xc3s_1500.c [new file with mode: 0644]
board/gaisler/gr_xc3s_1500/u-boot.lds [new file with mode: 0644]
board/gaisler/grsim/Makefile [moved from board/r5200/Makefile with 90% similarity]
board/gaisler/grsim/config.mk [new file with mode: 0644]
board/gaisler/grsim/grsim.c [new file with mode: 0644]
board/gaisler/grsim/u-boot.lds [new file with mode: 0644]
board/gaisler/grsim_leon2/Makefile [new file with mode: 0644]
board/gaisler/grsim_leon2/config.mk [new file with mode: 0644]
board/gaisler/grsim_leon2/grsim_leon2.c [new file with mode: 0644]
board/gaisler/grsim_leon2/u-boot.lds [new file with mode: 0644]
board/gen860t/u-boot-flashenv.lds
board/gen860t/u-boot.lds
board/genietv/u-boot.lds
board/genietv/u-boot.lds.debug
board/gth/u-boot.lds
board/gth2/lowlevel_init.S
board/hermes/u-boot.lds
board/hermes/u-boot.lds.debug
board/hymod/u-boot.lds
board/hymod/u-boot.lds.debug
board/icu862/u-boot.lds
board/icu862/u-boot.lds.debug
board/idmr/u-boot.lds
board/imx31_litekit/Makefile [new file with mode: 0644]
board/imx31_litekit/config.mk [new file with mode: 0644]
board/imx31_litekit/imx31_litekit.c [new file with mode: 0644]
board/imx31_litekit/lowlevel_init.S [new file with mode: 0644]
board/imx31_litekit/u-boot.lds [new file with mode: 0644]
board/imx31_phycore/Makefile [new file with mode: 0644]
board/imx31_phycore/config.mk [new file with mode: 0644]
board/imx31_phycore/imx31_phycore.c [new file with mode: 0644]
board/imx31_phycore/lowlevel_init.S [new file with mode: 0644]
board/imx31_phycore/u-boot.lds [new file with mode: 0644]
board/incaip/incaip.c
board/incaip/lowlevel_init.S
board/ip860/u-boot.lds
board/ip860/u-boot.lds.debug
board/ivm/u-boot.lds
board/ivm/u-boot.lds.debug
board/jse/u-boot.lds
board/korat/config.mk
board/korat/init.S
board/korat/korat.c
board/korat/u-boot-F7FC.lds [moved from board/r5200/u-boot.lds with 87% similarity]
board/korat/u-boot.lds
board/kup/kup4k/u-boot.lds
board/kup/kup4k/u-boot.lds.debug
board/kup/kup4x/u-boot.lds
board/kup/kup4x/u-boot.lds.debug
board/lantec/u-boot.lds
board/lantec/u-boot.lds.debug
board/linkstation/Makefile [new file with mode: 0644]
board/linkstation/avr.c [new file with mode: 0644]
board/linkstation/config.mk [new file with mode: 0644]
board/linkstation/hwctl.c [new file with mode: 0644]
board/linkstation/ide.c [new file with mode: 0644]
board/linkstation/linkstation.c [new file with mode: 0644]
board/lwmon/u-boot.lds
board/lwmon/u-boot.lds.debug
board/lwmon5/sdram.c
board/lwmon5/u-boot.lds
board/m501sk/memsetup.S
board/m5271evb/u-boot.lds
board/m5272c3/u-boot.lds
board/m5282evb/u-boot.lds
board/mbx8xx/u-boot.lds
board/mbx8xx/u-boot.lds.debug
board/mcc200/auto_update.c
board/mgsuvd/u-boot.lds
board/ml2/u-boot.lds
board/ml2/u-boot.lds.debug
board/mousse/m48t59y.c
board/mousse/u-boot.lds
board/mousse/u-boot.lds.ram
board/mousse/u-boot.lds.rom
board/mpc8540eval/tlb.c
board/mpc8540eval/u-boot.lds
board/mpl/common/common_util.c
board/mpl/mip405/u-boot.lds
board/mpl/pip405/u-boot.lds
board/mpl/pip405/u-boot.lds.debug
board/mpr2/Makefile [new file with mode: 0644]
board/mpr2/config.mk [new file with mode: 0644]
board/mpr2/lowlevel_init.S [new file with mode: 0644]
board/mpr2/mpr2.c [new file with mode: 0644]
board/mpr2/u-boot.lds [new file with mode: 0644]
board/munices/u-boot.lds
board/mvs1/u-boot.lds
board/mvs1/u-boot.lds.debug
board/mx31ads/Makefile [new file with mode: 0644]
board/mx31ads/config.mk [new file with mode: 0644]
board/mx31ads/lowlevel_init.S [new file with mode: 0644]
board/mx31ads/mx31ads.c [new file with mode: 0644]
board/mx31ads/u-boot.lds [new file with mode: 0644]
board/nc650/u-boot.lds
board/nc650/u-boot.lds.debug
board/netphone/u-boot.lds
board/netphone/u-boot.lds.debug
board/netstal/hcu4/u-boot.lds
board/netstal/hcu5/u-boot.lds
board/netstal/mcu25/u-boot.lds
board/netta/u-boot.lds
board/netta/u-boot.lds.debug
board/netta2/u-boot.lds
board/netta2/u-boot.lds.debug
board/netvia/u-boot.lds
board/netvia/u-boot.lds.debug
board/nx823/u-boot.lds
board/nx823/u-boot.lds.debug
board/pb1x00/lowlevel_init.S
board/pcippc2/u-boot.lds
board/pcs440ep/u-boot.lds
board/pm854/tlb.c
board/pm854/u-boot.lds
board/pm856/tlb.c
board/pm856/u-boot.lds
board/pn62/cmd_pn62.c
board/ppmc7xx/u-boot.lds
board/prodrive/alpr/alpr.c
board/prodrive/alpr/init.S
board/prodrive/alpr/u-boot.lds
board/prodrive/p3mx/u-boot.lds
board/prodrive/p3p440/u-boot.lds
board/purple/lowlevel_init.S
board/purple/purple.c
board/qemu-mips/lowlevel_init.S
board/quantum/u-boot.lds
board/quantum/u-boot.lds.debug
board/r2dplus/Makefile [new file with mode: 0644]
board/r2dplus/config.mk [new file with mode: 0644]
board/r2dplus/lowlevel_init.S [new file with mode: 0644]
board/r2dplus/r2dplus.c [new file with mode: 0644]
board/r2dplus/u-boot.lds [new file with mode: 0644]
board/r360mpi/u-boot.lds
board/r5200/r5200.c [deleted file]
board/r7780mp/Makefile [new file with mode: 0644]
board/r7780mp/config.mk [new file with mode: 0644]
board/r7780mp/lowlevel_init.S [new file with mode: 0644]
board/r7780mp/r7780mp.c [new file with mode: 0644]
board/r7780mp/r7780mp.h [new file with mode: 0644]
board/r7780mp/u-boot.lds [new file with mode: 0644]
board/rbc823/u-boot.lds
board/rmu/u-boot.lds
board/rmu/u-boot.lds.debug
board/rsdproto/u-boot.lds
board/sandburst/karef/u-boot.lds
board/sandburst/karef/u-boot.lds.debug
board/sandburst/metrobox/u-boot.lds
board/sandburst/metrobox/u-boot.lds.debug
board/sbc405/u-boot.lds
board/sbc8548/tlb.c
board/sbc8548/u-boot.lds
board/sbc8560/tlb.c
board/sbc8560/u-boot.lds
board/sc3/u-boot.lds
board/siemens/CCM/u-boot.lds
board/siemens/CCM/u-boot.lds.debug
board/siemens/IAD210/u-boot.lds
board/siemens/common/fpga.c
board/siemens/pcu_e/u-boot.lds
board/siemens/pcu_e/u-boot.lds.debug
board/sixnet/u-boot.lds
board/snmc/qs850/u-boot.lds
board/snmc/qs860t/u-boot.lds
board/spc1920/u-boot.lds
board/spd8xx/u-boot.lds
board/spd8xx/u-boot.lds.debug
board/stxgp3/tlb.c
board/stxgp3/u-boot.lds
board/stxssa/tlb.c
board/stxssa/u-boot.lds
board/stxxtc/u-boot.lds
board/stxxtc/u-boot.lds.debug
board/svm_sc8xx/u-boot.lds
board/svm_sc8xx/u-boot.lds.debug
board/tb0229/tb0229.c
board/tqm5200/tqm5200.c
board/tqm85xx/tlb.c
board/tqm85xx/u-boot.lds
board/tqm8xx/u-boot.lds
board/tqm8xx/u-boot.lds.debug
board/trab/auto_update.c
board/uc100/u-boot.lds
board/uc100/u-boot.lds.debug
board/v37/u-boot.lds
board/w7o/u-boot.lds
board/w7o/u-boot.lds.debug
board/westel/amx860/u-boot.lds
board/westel/amx860/u-boot.lds.debug
board/xilinx/ml300/u-boot.lds
board/xilinx/ml300/u-boot.lds.debug
board/xilinx/ml401/Makefile
board/xilinx/ml401/xparameters.h
board/xilinx/xupv2p/Makefile
board/xilinx/xupv2p/xparameters.h
board/xpedite1k/u-boot.lds
board/xpedite1k/u-boot.lds.debug
board/zeus/u-boot.lds
common/Makefile
common/altera.c
common/cmd_ambapp.c [new file with mode: 0644]
common/cmd_autoscript.c
common/cmd_bdinfo.c
common/cmd_boot.c
common/cmd_bootldr.c [new file with mode: 0644]
common/cmd_bootm.c
common/cmd_cplbinfo.c [new file with mode: 0644]
common/cmd_doc.c
common/cmd_elf.c
common/cmd_fdc.c
common/cmd_fdt.c
common/cmd_flash.c
common/cmd_fpga.c
common/cmd_ide.c
common/cmd_load.c
common/cmd_log.c
common/cmd_mem.c
common/cmd_mii.c
common/cmd_mp.c [new file with mode: 0644]
common/cmd_nand.c
common/cmd_net.c
common/cmd_nvedit.c
common/cmd_onenand.c
common/cmd_sata.c
common/cmd_scsi.c
common/cmd_setexpr.c [new file with mode: 0644]
common/cmd_usb.c
common/cmd_ximg.c
common/env_common.c
common/env_eeprom.c
common/env_nvram.c
common/env_onenand.c
common/fdt_support.c
common/fpga.c
common/ft_build.c
common/gunzip.c [new file with mode: 0644]
common/image.c [new file with mode: 0644]
common/lynxkdi.c
common/stratixII.c [new file with mode: 0644]
common/usb_storage.c
cpu/arm1136/Makefile
cpu/arm1136/cpu.c
cpu/arm1136/mx31/Makefile [new file with mode: 0644]
cpu/arm1136/mx31/generic.c [new file with mode: 0644]
cpu/arm1136/mx31/interrupts.c [new file with mode: 0644]
cpu/arm1136/mx31/serial.c [new file with mode: 0644]
cpu/arm1136/omap24xx/Makefile [new file with mode: 0644]
cpu/arm1136/omap24xx/interrupts.c [moved from cpu/arm1136/interrupts.c with 92% similarity]
cpu/arm1136/omap24xx/start.S [new file with mode: 0644]
cpu/arm1136/start.S
cpu/arm920t/at91rm9200/lowlevel_init.S
cpu/arm920t/start.S
cpu/arm926ejs/at91cap9/spi.c [deleted file]
cpu/arm926ejs/at91sam9/Makefile [moved from cpu/arm926ejs/at91cap9/Makefile with 87% similarity]
cpu/arm926ejs/at91sam9/config.mk [moved from cpu/arm926ejs/at91cap9/config.mk with 100% similarity]
cpu/arm926ejs/at91sam9/ether.c [moved from cpu/arm926ejs/at91cap9/ether.c with 89% similarity]
cpu/arm926ejs/at91sam9/lowlevel_init.S [moved from cpu/arm926ejs/at91cap9/lowlevel_init.S with 97% similarity]
cpu/arm926ejs/at91sam9/spi.c [new file with mode: 0644]
cpu/arm926ejs/at91sam9/timer.c [moved from cpu/arm926ejs/at91cap9/timer.c with 84% similarity]
cpu/arm926ejs/at91sam9/usb.c [moved from cpu/arm926ejs/at91cap9/usb.c with 83% similarity]
cpu/arm926ejs/davinci/timer.c
cpu/arm926ejs/interrupts.c
cpu/bf533/Makefile [deleted file]
cpu/bf533/bf533_serial.h [deleted file]
cpu/bf533/cache.S [deleted file]
cpu/bf533/cpu.c [deleted file]
cpu/bf533/cpu.h [deleted file]
cpu/bf533/flush.S [deleted file]
cpu/bf533/init_sdram.S [deleted file]
cpu/bf533/init_sdram_bootrom_initblock.S [deleted file]
cpu/bf533/interrupt.S [deleted file]
cpu/bf533/interrupts.c [deleted file]
cpu/bf533/ints.c [deleted file]
cpu/bf533/serial.c [deleted file]
cpu/bf533/start.S [deleted file]
cpu/bf533/traps.c [deleted file]
cpu/bf533/video.c [deleted file]
cpu/bf533/video.h [deleted file]
cpu/bf537/cache.S [deleted file]
cpu/bf537/cpu.c [deleted file]
cpu/bf537/cpu.h [deleted file]
cpu/bf537/flush.S [deleted file]
cpu/bf537/init_sdram.S [deleted file]
cpu/bf537/init_sdram_bootrom_initblock.S [deleted file]
cpu/bf537/interrupt.S [deleted file]
cpu/bf537/interrupts.c [deleted file]
cpu/bf537/ints.c [deleted file]
cpu/bf537/serial.c [deleted file]
cpu/bf537/serial.h [deleted file]
cpu/bf537/start.S [deleted file]
cpu/bf537/traps.c [deleted file]
cpu/bf537/video.c [deleted file]
cpu/bf537/video.h [deleted file]
cpu/bf561/cache.S [deleted file]
cpu/bf561/config.mk [deleted file]
cpu/bf561/cpu.c [deleted file]
cpu/bf561/cpu.h [deleted file]
cpu/bf561/flush.S [deleted file]
cpu/bf561/init_sdram.S [deleted file]
cpu/bf561/init_sdram_bootrom_initblock.S [deleted file]
cpu/bf561/interrupt.S [deleted file]
cpu/bf561/ints.c [deleted file]
cpu/bf561/serial.c [deleted file]
cpu/bf561/serial.h [deleted file]
cpu/bf561/start.S [deleted file]
cpu/bf561/traps.c [deleted file]
cpu/bf561/video.c [deleted file]
cpu/bf561/video.h [deleted file]
cpu/blackfin/.gitignore [new file with mode: 0644]
cpu/blackfin/Makefile [new file with mode: 0644]
cpu/blackfin/bootrom-asm-offsets.awk [new file with mode: 0755]
cpu/blackfin/bootrom-asm-offsets.c.in [new file with mode: 0644]
cpu/blackfin/cache.S [new file with mode: 0644]
cpu/blackfin/cpu.c [new file with mode: 0644]
cpu/blackfin/cpu.h [moved from cpu/bf533/start1.S with 68% similarity]
cpu/blackfin/flush.S [new file with mode: 0644]
cpu/blackfin/i2c.c [moved from cpu/bf537/i2c.c with 75% similarity]
cpu/blackfin/initcode.c [new file with mode: 0644]
cpu/blackfin/interrupt.S [new file with mode: 0644]
cpu/blackfin/interrupts.c [moved from cpu/bf561/interrupts.c with 68% similarity]
cpu/blackfin/reset.c [new file with mode: 0644]
cpu/blackfin/serial.c [new file with mode: 0644]
cpu/blackfin/serial.h [new file with mode: 0644]
cpu/blackfin/start.S [new file with mode: 0644]
cpu/blackfin/system_map.S [new file with mode: 0644]
cpu/blackfin/traps.c [new file with mode: 0644]
cpu/blackfin/watchdog.c [new file with mode: 0644]
cpu/leon2/Makefile [moved from cpu/bf537/Makefile with 64% similarity]
cpu/leon2/config.mk [moved from cpu/bf533/config.mk with 78% similarity]
cpu/leon2/cpu.c [new file with mode: 0644]
cpu/leon2/cpu_init.c [new file with mode: 0644]
cpu/leon2/interrupts.c [new file with mode: 0644]
cpu/leon2/prom.c [new file with mode: 0644]
cpu/leon2/serial.c [new file with mode: 0644]
cpu/leon2/start.S [new file with mode: 0644]
cpu/leon3/Makefile [moved from cpu/bf561/Makefile with 64% similarity]
cpu/leon3/ambapp.c [new file with mode: 0644]
cpu/leon3/config.mk [moved from cpu/bf537/config.mk with 78% similarity]
cpu/leon3/cpu.c [new file with mode: 0644]
cpu/leon3/cpu_init.c [new file with mode: 0644]
cpu/leon3/interrupts.c [new file with mode: 0644]
cpu/leon3/prom.c [new file with mode: 0644]
cpu/leon3/serial.c [new file with mode: 0644]
cpu/leon3/start.S [new file with mode: 0644]
cpu/leon3/usb_uhci.c [new file with mode: 0644]
cpu/leon3/usb_uhci.h [new file with mode: 0644]
cpu/mcf5227x/start.S
cpu/mcf523x/start.S
cpu/mcf52x2/config.mk
cpu/mcf52x2/cpu.c
cpu/mcf52x2/cpu_init.c
cpu/mcf52x2/interrupts.c
cpu/mcf52x2/speed.c
cpu/mcf52x2/start.S
cpu/mcf532x/start.S
cpu/mcf5445x/Makefile
cpu/mcf5445x/dspi.c [new file with mode: 0644]
cpu/mcf5445x/start.S
cpu/mcf547x_8x/start.S
cpu/mips/cache.S
cpu/mips/cpu.c
cpu/mips/incaip_wdt.S
cpu/mips/start.S
cpu/mpc5xx/u-boot.lds
cpu/mpc5xxx/cpu.c
cpu/mpc5xxx/u-boot-customlayout.lds
cpu/mpc5xxx/u-boot.lds
cpu/mpc8220/u-boot.lds
cpu/mpc824x/u-boot.lds
cpu/mpc8260/cpu.c
cpu/mpc8260/u-boot.lds
cpu/mpc83xx/Makefile
cpu/mpc83xx/cpu.c
cpu/mpc83xx/cpu_init.c
cpu/mpc83xx/fdt.c
cpu/mpc83xx/pci.c
cpu/mpc83xx/qe_io.c
cpu/mpc83xx/serdes.c [new file with mode: 0644]
cpu/mpc83xx/spd_sdram.c
cpu/mpc83xx/speed.c
cpu/mpc85xx/Makefile
cpu/mpc85xx/cpu.c
cpu/mpc85xx/cpu_init.c
cpu/mpc85xx/fdt.c
cpu/mpc85xx/mp.c [new file with mode: 0644]
cpu/mpc85xx/mp.h [new file with mode: 0644]
cpu/mpc85xx/release.S [new file with mode: 0644]
cpu/mpc85xx/spd_sdram.c
cpu/mpc85xx/speed.c
cpu/mpc86xx/cpu.c
cpu/mpc8xx/Makefile
cpu/mpc8xx/cpu.c
cpu/mpc8xx/fdt.c [new file with mode: 0644]
cpu/mpc8xx/speed.c
cpu/ppc4xx/4xx_enet.c
cpu/ppc4xx/cache.S
cpu/ppc4xx/cpu_init.c
cpu/ppc4xx/denali_spd_ddr2.c
cpu/ppc4xx/interrupts.c
cpu/ppc4xx/speed.c
cpu/ppc4xx/tlb.c
cpu/s3c44b0/cpu.c
cpu/sh4/cpu.c
disk/part.c
disk/part_dos.c
disk/part_iso.c
disk/part_mac.c
doc/README.korat [new file with mode: 0644]
doc/README.mips [new file with mode: 0644]
doc/README.sata [new file with mode: 0644]
doc/README.sh
doc/uImage.FIT/command_syntax_extensions.txt [new file with mode: 0644]
doc/uImage.FIT/howto.txt [new file with mode: 0644]
doc/uImage.FIT/kernel.its [new file with mode: 0644]
doc/uImage.FIT/kernel_fdt.its [new file with mode: 0644]
doc/uImage.FIT/multi.its [new file with mode: 0644]
doc/uImage.FIT/source_file_format.txt [new file with mode: 0644]
drivers/block/Makefile
drivers/block/ata_piix.c
drivers/block/ata_piix.h [new file with mode: 0644]
drivers/block/fsl_sata.c [new file with mode: 0644]
drivers/block/fsl_sata.h [new file with mode: 0644]
drivers/block/libata.c [new file with mode: 0644]
drivers/hwmon/lm73.c
drivers/i2c/Makefile
drivers/i2c/fsl_i2c.c
drivers/i2c/mxc_i2c.c [new file with mode: 0644]
drivers/mtd/Makefile
drivers/mtd/cfi_flash.c
drivers/mtd/dataflash.c
drivers/mtd/jedec_flash.c
drivers/mtd/nand/nand_base.c
drivers/mtd/nand/nand_ids.c
drivers/mtd/onenand/onenand_base.c
drivers/net/Makefile
drivers/net/ax88796.h [new file with mode: 0644]
drivers/net/bfin_mac.c [moved from board/bf537-stamp/ether_bf537.c with 77% similarity]
drivers/net/bfin_mac.h [moved from board/bf537-stamp/ether_bf537.h with 70% similarity]
drivers/net/e1000.c
drivers/net/e1000.h
drivers/net/greth.c [new file with mode: 0644]
drivers/net/greth.h [new file with mode: 0644]
drivers/net/macb.c
drivers/net/mcffec.c
drivers/net/ne2000.c
drivers/net/ne2000.h
drivers/net/ne2000_base.h [new file with mode: 0644]
drivers/net/pcnet.c
drivers/net/s3c4510b_eth.h
drivers/net/smc91111.h
drivers/net/smc911x.c [new file with mode: 0644]
drivers/net/tsec.c
drivers/net/tsec.h
drivers/net/vsc7385.c [new file with mode: 0644]
drivers/net/xilinx_emac.c [new file with mode: 0644]
drivers/net/xilinx_emaclite.c [new file with mode: 0644]
drivers/pci/Makefile
drivers/pci/fsl_pci_init.c
drivers/pci/pci.c
drivers/pci/pci_auto.c
drivers/pci/pci_sh4.c [new file with mode: 0644]
drivers/pci/pci_sh7751.c [new file with mode: 0644]
drivers/pci/pci_sh7780.c [new file with mode: 0644]
drivers/qe/uec.c
drivers/qe/uec.h
drivers/qe/uec_phy.c
drivers/qe/uec_phy.h
drivers/rtc/Makefile
drivers/rtc/bfin_rtc.c
drivers/rtc/ds12887.c
drivers/rtc/ds1302.c
drivers/rtc/ds1306.c
drivers/rtc/ds1307.c
drivers/rtc/ds1337.c
drivers/rtc/ds1374.c
drivers/rtc/ds1556.c
drivers/rtc/ds164x.c
drivers/rtc/ds174x.c
drivers/rtc/ds3231.c
drivers/rtc/isl1208.c
drivers/rtc/m41t11.c
drivers/rtc/m41t60.c
drivers/rtc/m41t62.c
drivers/rtc/m48t35ax.c
drivers/rtc/max6900.c
drivers/rtc/mc13783-rtc.c [new file with mode: 0644]
drivers/rtc/mc146818.c
drivers/rtc/mcfrtc.c
drivers/rtc/mk48t59.c
drivers/rtc/mpc5xxx.c
drivers/rtc/mpc8xx.c
drivers/rtc/pcf8563.c
drivers/rtc/rs5c372.c
drivers/rtc/rx8025.c
drivers/rtc/s3c24x0_rtc.c
drivers/rtc/x1205.c
drivers/serial/serial_sh.c
drivers/spi/Makefile
drivers/spi/mxc_spi.c [new file with mode: 0644]
drivers/usb/usb_ohci.c
drivers/video/cfb_console.c
drivers/video/mb862xx.c
examples/Makefile
examples/eepro100_eeprom.c
examples/sparc.lds [moved from lib_nios2/nios_linux.c with 67% similarity]
examples/stubs.c
fs/cramfs/uncompress.c
include/altera.h
include/ambapp.h [new file with mode: 0644]
include/asm-arm/arch-at91cap9/AT91CAP9.h [deleted file]
include/asm-arm/arch-at91cap9/hardware.h [deleted file]
include/asm-arm/arch-at91sam9/at91_pio.h [new file with mode: 0644]
include/asm-arm/arch-at91sam9/at91_pit.h [new file with mode: 0644]
include/asm-arm/arch-at91sam9/at91_pmc.h [new file with mode: 0644]
include/asm-arm/arch-at91sam9/at91_rstc.h [new file with mode: 0644]
include/asm-arm/arch-at91sam9/at91_spi.h [new file with mode: 0644]
include/asm-arm/arch-at91sam9/at91cap9.h [new file with mode: 0644]
include/asm-arm/arch-at91sam9/at91cap9_matrix.h [new file with mode: 0644]
include/asm-arm/arch-at91sam9/at91sam9260.h [new file with mode: 0644]
include/asm-arm/arch-at91sam9/at91sam9260_matrix.h [new file with mode: 0644]
include/asm-arm/arch-at91sam9/at91sam926x_mc.h [new file with mode: 0644]
include/asm-arm/arch-at91sam9/clk.h [moved from include/asm-arm/arch-at91cap9/clk.h with 95% similarity]
include/asm-arm/arch-at91sam9/gpio.h [new file with mode: 0644]
include/asm-arm/arch-at91sam9/hardware.h [new file with mode: 0644]
include/asm-arm/arch-at91sam9/io.h [new file with mode: 0644]
include/asm-arm/arch-at91sam9/memory-map.h [moved from include/asm-arm/arch-at91cap9/memory-map.h with 85% similarity]
include/asm-arm/arch-mx31/mx31-regs.h [new file with mode: 0644]
include/asm-arm/arch-mx31/mx31.h [moved from cpu/bf561/start1.S with 65% similarity]
include/asm-arm/arch-omap24xx/bits.h [moved from include/asm-arm/arch-arm1136/bits.h with 100% similarity]
include/asm-arm/arch-omap24xx/clocks.h [moved from include/asm-arm/arch-arm1136/clocks.h with 100% similarity]
include/asm-arm/arch-omap24xx/i2c.h [moved from include/asm-arm/arch-arm1136/i2c.h with 100% similarity]
include/asm-arm/arch-omap24xx/mem.h [moved from include/asm-arm/arch-arm1136/mem.h with 100% similarity]
include/asm-arm/arch-omap24xx/mux.h [moved from include/asm-arm/arch-arm1136/mux.h with 100% similarity]
include/asm-arm/arch-omap24xx/omap2420.h [moved from include/asm-arm/arch-arm1136/omap2420.h with 100% similarity]
include/asm-arm/arch-omap24xx/sizes.h [moved from include/asm-arm/arch-arm1136/sizes.h with 100% similarity]
include/asm-arm/arch-omap24xx/sys_info.h [moved from include/asm-arm/arch-arm1136/sys_info.h with 100% similarity]
include/asm-arm/arch-omap24xx/sys_proto.h [moved from include/asm-arm/arch-arm1136/sys_proto.h with 100% similarity]
include/asm-arm/io.h
include/asm-arm/types.h
include/asm-avr32/io.h
include/asm-avr32/types.h
include/asm-blackfin/blackfin-config-post.h
include/asm-blackfin/io.h
include/asm-blackfin/types.h
include/asm-i386/io.h
include/asm-i386/types.h
include/asm-i386/zimage.h
include/asm-m68k/coldfire/dspi.h
include/asm-m68k/immap.h
include/asm-m68k/immap_5275.h [new file with mode: 0644]
include/asm-m68k/io.h
include/asm-m68k/m5275.h [new file with mode: 0644]
include/asm-m68k/types.h
include/asm-microblaze/io.h
include/asm-microblaze/types.h
include/asm-mips/asm.h [new file with mode: 0644]
include/asm-mips/byteorder.h
include/asm-mips/cachectl.h
include/asm-mips/cacheops.h
include/asm-mips/io.h
include/asm-mips/isadep.h
include/asm-mips/processor.h
include/asm-mips/ptrace.h
include/asm-mips/reboot.h [new file with mode: 0644]
include/asm-mips/reg.h
include/asm-mips/regdef.h
include/asm-mips/types.h
include/asm-nios/io.h
include/asm-nios/types.h
include/asm-nios2/io.h
include/asm-ppc/fsl_serdes.h [new file with mode: 0644]
include/asm-ppc/global_data.h
include/asm-ppc/immap_85xx.h
include/asm-ppc/io.h
include/asm-ppc/processor.h
include/asm-ppc/types.h
include/asm-sh/cache.h [new file with mode: 0644]
include/asm-sh/cpu_sh4.h
include/asm-sh/cpu_sh7720.h
include/asm-sh/cpu_sh7750.h
include/asm-sh/cpu_sh7780.h [new file with mode: 0644]
include/asm-sh/io.h
include/asm-sh/pci.h [new file with mode: 0644]
include/asm-sh/processor.h
include/asm-sh/types.h
include/asm-sparc/arch-leon2/asi.h [new file with mode: 0644]
include/asm-sparc/arch-leon3/asi.h [new file with mode: 0644]
include/asm-sparc/asi.h [new file with mode: 0644]
include/asm-sparc/asmmacro.h [new file with mode: 0644]
include/asm-sparc/atomic.h [new file with mode: 0644]
include/asm-sparc/bitops.h [new file with mode: 0644]
include/asm-sparc/byteorder.h [new file with mode: 0644]
include/asm-sparc/cache.h [moved from cpu/bf537/start1.S with 68% similarity]
include/asm-sparc/errno.h [new file with mode: 0644]
include/asm-sparc/global_data.h [new file with mode: 0644]
include/asm-sparc/io.h [new file with mode: 0644]
include/asm-sparc/irq.h [new file with mode: 0644]
include/asm-sparc/leon.h [new file with mode: 0644]
include/asm-sparc/leon2.h [new file with mode: 0644]
include/asm-sparc/leon3.h [new file with mode: 0644]
include/asm-sparc/machines.h [new file with mode: 0644]
include/asm-sparc/page.h [new file with mode: 0644]
include/asm-sparc/posix_types.h [new file with mode: 0644]
include/asm-sparc/processor.h [new file with mode: 0644]
include/asm-sparc/prom.h [new file with mode: 0644]
include/asm-sparc/psr.h [new file with mode: 0644]
include/asm-sparc/ptrace.h [new file with mode: 0644]
include/asm-sparc/srmmu.h [new file with mode: 0644]
include/asm-sparc/stack.h [new file with mode: 0644]
include/asm-sparc/string.h [new file with mode: 0644]
include/asm-sparc/types.h [new file with mode: 0644]
include/asm-sparc/u-boot.h [new file with mode: 0644]
include/asm-sparc/winmacro.h [new file with mode: 0644]
include/common.h
include/config_cmd_all.h
include/configs/APC405.h
include/configs/ATUM8548.h
include/configs/Adder.h
include/configs/BC3450.h
include/configs/DU440.h
include/configs/EB+MCF-EV123.h
include/configs/EP88x.h
include/configs/FADS823.h
include/configs/FADS850SAR.h
include/configs/GEN860T.h
include/configs/GENIETV.h
include/configs/IceCube.h
include/configs/M52277EVB.h
include/configs/M5235EVB.h
include/configs/M5271EVB.h
include/configs/M5275EVB.h [moved from include/configs/r5200.h with 55% similarity]
include/configs/M5282EVB.h
include/configs/M5329EVB.h
include/configs/M5373EVB.h
include/configs/M54455EVB.h
include/configs/M5475EVB.h
include/configs/M5485EVB.h
include/configs/MBX860T.h
include/configs/MPC8313ERDB.h
include/configs/MPC8315ERDB.h
include/configs/MPC8323ERDB.h
include/configs/MPC832XEMDS.h
include/configs/MPC8349ITX.h
include/configs/MPC8360EMDS.h
include/configs/MPC8360ERDK.h
include/configs/MPC837XEMDS.h
include/configs/MPC837XERDB.h
include/configs/MPC8540ADS.h
include/configs/MPC8540EVAL.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/MigoR.h [new file with mode: 0644]
include/configs/NETPHONE.h
include/configs/NETTA.h
include/configs/NETTA2.h
include/configs/PM520.h
include/configs/PM854.h
include/configs/PM856.h
include/configs/SBC8540.h
include/configs/TK885D.h
include/configs/TOP5200.h
include/configs/TOP860.h
include/configs/TQM5200.h
include/configs/TQM85xx.h
include/configs/TQM885D.h
include/configs/Total5200.h
include/configs/ads5121.h
include/configs/aev.h
include/configs/alpr.h
include/configs/apollon.h
include/configs/at91cap9adk.h
include/configs/at91rm9200dk.h
include/configs/at91sam9260ek.h [new file with mode: 0644]
include/configs/bf533-ezkit.h
include/configs/bf533-stamp.h
include/configs/bf537-stamp.h
include/configs/bf561-ezkit.h
include/configs/canyonlands.h
include/configs/cmc_pu2.h
include/configs/cobra5272.h
include/configs/cpci5200.h
include/configs/csb637.h
include/configs/gr_cpci_ax2000.h [new file with mode: 0644]
include/configs/gr_ep2s60.h [new file with mode: 0644]
include/configs/gr_xc3s_1500.h [new file with mode: 0644]
include/configs/grsim.h [new file with mode: 0644]
include/configs/grsim_leon2.h [new file with mode: 0644]
include/configs/hmi1001.h
include/configs/idmr.h
include/configs/imx31_litekit.h [new file with mode: 0644]
include/configs/imx31_phycore.h [new file with mode: 0644]
include/configs/inka4x0.h
include/configs/jupiter.h
include/configs/kilauea.h
include/configs/korat.h
include/configs/linkstation.h [new file with mode: 0644]
include/configs/lwmon5.h
include/configs/mcc200.h
include/configs/mgcoge.h
include/configs/mgsuvd.h
include/configs/ml401.h
include/configs/mp2usb.h
include/configs/mpr2.h [new file with mode: 0644]
include/configs/mx31ads.h [new file with mode: 0644]
include/configs/o2dnt.h
include/configs/pcs440ep.h
include/configs/pdnb3.h
include/configs/pf5200.h
include/configs/qemu-mips.h
include/configs/r2dplus.h [new file with mode: 0644]
include/configs/r7780mp.h [new file with mode: 0644]
include/configs/sbc8349.h
include/configs/sbc8548.h
include/configs/sbc8560.h
include/configs/sc520_cdp.h
include/configs/sequoia.h
include/configs/spc1920.h
include/configs/spieval.h
include/configs/stxgp3.h
include/configs/stxssa.h
include/configs/stxxtc.h
include/configs/uc100.h
include/configs/xupv2p.h
include/dataflash.h
include/environment.h
include/fdt_support.h
include/fis.h [new file with mode: 0644]
include/image.h
include/libata.h [new file with mode: 0644]
include/libfdt.h
include/libfdt_env.h
include/linux/stat.h
include/lmb.h [new file with mode: 0644]
include/mpc83xx.h
include/part.h
include/pci_ids.h
include/ppc440.h
include/ppc4xx_enet.h
include/rtc.h
include/sata.h
include/sha1.h
include/spi.h
include/stratixII.h [new file with mode: 0644]
include/u-boot/md5.h [new file with mode: 0644]
include/usb.h
include/vsc7385.h [new file with mode: 0644]
lib_arm/Makefile
lib_arm/bootm.c [moved from lib_arm/armlinux.c with 68% similarity]
lib_avr32/Makefile
lib_avr32/bootm.c [moved from lib_avr32/avr32_linux.c with 65% similarity]
lib_blackfin/Makefile
lib_blackfin/bf533_linux.c [deleted file]
lib_blackfin/bf533_string.c [deleted file]
lib_blackfin/blackfin_board.h [deleted file]
lib_blackfin/board.c
lib_blackfin/bootm.c [new file with mode: 0644]
lib_blackfin/cache.c
lib_blackfin/cache.h [deleted file]
lib_blackfin/memcmp.S
lib_blackfin/memcpy.S
lib_blackfin/memmove.S
lib_blackfin/memset.S
lib_blackfin/string.c [new file with mode: 0644]
lib_generic/Makefile
lib_generic/bzlib.c
lib_generic/crc32.c
lib_generic/lmb.c [new file with mode: 0644]
lib_generic/md5.c [new file with mode: 0644]
lib_generic/sha1.c
lib_i386/Makefile
lib_i386/board.c
lib_i386/bootm.c [new file with mode: 0644]
lib_i386/i386_linux.c [deleted file]
lib_i386/zimage.c
lib_m68k/Makefile
lib_m68k/bootm.c [new file with mode: 0644]
lib_m68k/m68k_linux.c [deleted file]
lib_microblaze/Makefile
lib_microblaze/bootm.c [new file with mode: 0644]
lib_microblaze/microblaze_linux.c [deleted file]
lib_mips/Makefile
lib_mips/bootm.c [moved from lib_mips/mips_linux.c with 61% similarity]
lib_nios/Makefile
lib_nios/board.c
lib_nios/bootm.c [moved from lib_nios/nios_linux.c with 96% similarity]
lib_nios2/Makefile
lib_nios2/bootm.c [new file with mode: 0644]
lib_ppc/Makefile
lib_ppc/board.c
lib_ppc/bootm.c [new file with mode: 0644]
lib_sh/Makefile
lib_sh/board.c
lib_sh/bootm.c [moved from lib_sh/sh_linux.c with 69% similarity]
lib_sparc/Makefile [new file with mode: 0644]
lib_sparc/board.c [new file with mode: 0644]
lib_sparc/bootm.c [new file with mode: 0644]
lib_sparc/cache.c [new file with mode: 0644]
lib_sparc/interrupts.c [new file with mode: 0644]
lib_sparc/time.c [new file with mode: 0644]
libfdt/fdt.c
libfdt/fdt_ro.c
libfdt/fdt_rw.c
libfdt/fdt_strerror.c
libfdt/fdt_wip.c
libfdt/libfdt_internal.h
microblaze_config.mk
nand_spl/board/amcc/canyonlands/config.mk
nand_spl/board/amcc/canyonlands/ddr2_fixed.c
nand_spl/nand_boot.c
net/bootp.c
net/eth.c
onenand_ipl/board/apollon/Makefile
onenand_ipl/onenand_boot.c
onenand_ipl/onenand_ipl.h
onenand_ipl/onenand_read.c
post/board/lwmon5/watchdog.c
post/drivers/rtc.c
sparc_config.mk [new file with mode: 0644]
tools/.gitignore
tools/Makefile
tools/envcrc.c
tools/fdt_host.h [new file with mode: 0644]
tools/mkimage.c
tools/mkimage.h [new file with mode: 0644]
tools/setlocalversion

index 7c56594..89e96f5 100644 (file)
@@ -11,6 +11,7 @@
 *.a
 *.o
 *~
+*.patch
 
 #
 # Top-level generic files
@@ -37,6 +38,7 @@
 
 # stgit generated dirs
 patches-*
+.stgit-edit.txt
 
 # quilt's files
 patches
index c0c7af6..143f061 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
+commit 92bad20ad74b70adf3839df9a0a47cce000ac3d7
+Author: Mike Frysinger <vapier@gentoo.org>
+Date:  Tue Apr 8 14:00:57 2008 -0400
+
+    Add support for u-boot in svn and localversion-* files
+
+    Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+
+commit d23ff6827decf121461fbc5622612fd7effe207e
+Author: Guennadi Liakhovetski <lg@denx.de>
+Date:  Thu Apr 3 17:04:22 2008 +0200
+
+    MX31ADS network and flash updates
+
+    This patch allows U-Boot to use buffered writes to the Spansion NOR
+    flash installed on this board, and eliminates long delays in network
+    transfers after the board startup.
+
+    Also modify flash layout to embed main and redundant environment
+    blocks in the U-Boot image.
+
+    Signed-off-by: Guennadi Liakhovetski <lg@denx.de>
+
+commit b5dc9b304d289831f291843ff88a45cbdf1a6290
+Author: Guennadi Liakhovetski <lg@denx.de>
+Date:  Mon Apr 14 10:53:12 2008 +0200
+
+    Support for the MX31ADS evaluation board from Freescale
+
+    This patch adds support for the MX31ADS evaluation board from Freescale,
+    initialization code is copied from RedBoot sources, also provided by
+    Freescale.
+
+    Signed-off-by: Guennadi Liakhovetski <lg@denx.de>
+
+commit 5e3dca577b7c1bf58bd2b48449b18b7e7dcd8e04
+Author: Anatolij Gustschin <agust@denx.de>
+Date:  Thu Apr 17 18:18:00 2008 +0200
+
+    Fix crash on sequoia in ppc_4xx_eth_init
+
+    Currently U-Boot crashes in ppc_4xx_eth_init on sequoia
+    with cache enabled (TLB Parity exeption). This patch
+    fixes the problem.
+
+    Signed-off-by: Anatolij Gustschin <agust@denx.de>
+
+commit accf7355767dc7f6b85d88bb1c75c9d95e84ba5b
+Author: Anatolij Gustschin <agust@denx.de>
+Date:  Thu Apr 17 18:15:27 2008 +0200
+
+    ppc4xx: Fix crash on sequoia with cache enabled
+
+    Currently U-Boot crashes on sequoia board in CPU POST if
+    cache is enabled (CONFIG_4xx_DCACHE defined). The cache
+    won't be disabled by change_tlb before CPU POST because
+    there is an insufficient adress range check since
+    CFG_MEM_TOP_HIDE was introduced. This patch tries to fix
+    this problem.
+
+    Signed-off-by: Anatolij Gustschin <agust@denx.de>
+
+commit 43c509254fab375c49936498da944658117ed07c
+Author: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
+Date:  Thu Apr 17 23:35:13 2008 +0900
+
+    Use jr as register jump instruction
+
+    Current assembler codes are inconsistent in the way of register jump
+    instruction usage; some use jr, some use j. Of course GNU as allows both
+    usages, but as can be expected from `Jump Register' the mnemonic `jr' is
+    more intuitive than `j'. For example, Linux doesn't have `j <reg>' usage
+    at all.
+
+    Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
+
+commit 7ce63709828d37b08866e537339a169bd0db2bd3
+Author: Guennadi Liakhovetski <lg@denx.de>
+Date:  Tue Apr 15 14:15:30 2008 +0200
+
+    RTC driver for MC13783
+
+    MC13783 is a multifunction IS with an SPI interface to the host. This
+    driver handles the RTC controller in this chip.
+
+    Signed-off-by: Guennadi Liakhovetski <lg@denx.de>
+
+commit 38254f45b0b412332726c90d3184ad47479fcffb
+Author: Guennadi Liakhovetski <lg@denx.de>
+Date:  Tue Apr 15 14:14:25 2008 +0200
+
+    New i.MX31 SPI driver
+
+    This is an SPI driver for i.MX and MXC based SoCs from Freescale. So far
+    only implemented and tested on i.MX31, can with a modified register layout
+    and definitions be used for i.MX27, I think, MXC CPUs have similar SPI
+    controllers too.
+
+    Signed-off-by: Guennadi Liakhovetski <lg@denx.de>
+
+commit 7064122c2eef92f02a03ef37a1a1c07e70cd4e38
+Author: Magnus Lilja <lilja.magnus@gmail.com>
+Date:  Tue Apr 15 19:09:10 2008 +0200
+
+    Fix name of i.MX31 boards in config file header
+
+    Correct the name of the i.MX31 Litekit and phyCORE boards in config files.
+
+    Signed-off-by: Magnus Lilja <lilja.magnus@gmail.com>
+
+commit a49864593e083a5d0779fb9ca98e5a0f2053183d
+Author: Mike Frysinger <vapier@gentoo.org>
+Date:  Sun Apr 13 19:42:19 2008 -0400
+
+    allow ports to override go behavior
+
+    Split the arch-specific logic out of the common go code and into a dedicated
+    weak function called do_go_exec() that lives in cpu directories.  This will
+    need review from i386/nios people to make sure I didn't break them.
+
+commit 017e9b7925f74878d0e9475388cca9bda5ef9482
+Author: Mike Frysinger <vapier@gentoo.org>
+Date:  Sun Apr 13 19:42:18 2008 -0400
+
+    allow ports to override bootelf behavior
+
+    Change the bootelf setup function into a dedicated weak function called
+    do_bootelf_exec.  This way ports can control the behavior however they
+    like before/after calling the ELF entry point.
+
+commit a4b46ed6b3502335c3f3a5d672abe0bcb44f20b7
+Author: Ulf Samuelsson <ulf@atmel.com>
+Date:  Sat Apr 12 20:56:03 2008 +0200
+
+    Reorder ARM boards in Makefile
+
+    Rearrange ARM boards in Makefile so that ARM926EJ-S boards
+    are no longer under ARM92xT header.
+
+    Signed-off-by: Ulf Samuelsson <ulf@atmel.com>
+    Ack-By Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+
+commit c3a60cb3bd67e120fc99b6ba88d9295c3c07f688
+Author: Ulf Samuelsson <ulf@atmel.com>
+Date:  Sat Apr 12 20:29:44 2008 +0200
+
+    Clean up dataflash partitioning
+
+    This patch removes the board dependent parts from
+    "drivers/mtd/dataflash.c".
+    Each board relying on this, will have the appropriate
+    code in a new file, "partition.c" in the board directory.
+    board Makefiles updated to use the file.
+
+    The dataflash partitions are aligned on sector/page boundaries.
+
+    The CONFIG_NEW_DF_PARTITION was used to create named partitions
+    This is now the default operation, and the CONFIG variable is removed.
+
+    Signed-off-by: Ulf Samuelsson <ulf@atmel.com>
+
+commit 51ecde946fec511a16346e498204ca10ad71080d
+Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+Date:  Sat Apr 12 14:08:45 2008 +0200
+
+    gitignore: udpate stgit generated and .patch file
+
+    Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+
+commit 66e39818e95f51ee1c1dd2094407a8929543fa6d
+Author: Wolfgang Denk <wd@denx.de>
+Date:  Fri Apr 18 00:15:36 2008 -0700
+
+    Get rid of redundant copy of renamed header file.
+
+    Signed-off-by: Wolfgang Denk <wd@denx.de>
+
+commit c3aafd8cf814e33a77de81c2f22b8c772216a3cc
+Author: Vlad Lungu <vlad@comsys.ro>
+Date:  Fri Apr 11 21:20:14 2008 +0300
+
+    Fix dependency generation for older gcc versions
+
+     With gcc 3.3.3 at least, compilation fails with
+
+    Generating include/autoconf.mk
+    gcc: compilation of header file requested
+    make: *** [include/autoconf.mk] Error 1
+
+    since commit 16fe77752eee099b9fb61ed73460e51cc94b37ba.
+
+    Signed-off-by: Vlad Lungu <vlad@comsys.ro>
+
+commit cb1c4896905ab22fcd982e6a8a539f0031942e71
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Fri Apr 11 11:07:49 2008 +0200
+
+    Restore the ability to continue booting after legacy image overwrite
+
+    Before new uImage code was merged, bootm code allowed for the kernel image to
+    get overwritten during decompresion. new uImage introduced a check for image
+    overwrites and refused to boot the image that got overwritten. This patch
+    restores the old behavior. It also adds a warning when the image overwriten is
+    a multi-image file, because in such case accessing componentes other than the
+    first one will fail.
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit de2b3216e6b4f3b2fe93759c05b17504f9dfe036
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Fri Apr 11 11:07:43 2008 +0200
+
+    ppc: Fix ftd_blob variable init when processing raw blob
+
+    Set fdt_blob variable before its value is printed out.
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit 3d36be030043cd841a2551d00a395135e363a64b
+Author: Jason Wessel <jason.wessel@windriver.com>
+Date:  Thu Apr 10 14:30:16 2008 -0500
+
+    Remove all the search paths from the .lds files.
+
+    The cross compiler is responsible for providing the correct libraries
+    and the logic to find the linking libraries.
+
+    Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
+
+commit 7d721e34ae6be7d7db63e8d060a246278bb7ae58
+Author: Bartlomiej Sieka <tur@semihalf.com>
+Date:  Mon Apr 14 15:44:16 2008 +0200
+
+    Boot-related documentation update
+
+    - document 'bootm_low' and 'bootm_size' environment variables
+    - update inaccurate CFG_BOOTMAPSZ entry
+
+    Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>
+
+commit a6f0bd9f2b1971e2a61ac0fd1fc2c96cb7a4b67a
+Author: Guennadi Liakhovetski <lg@denx.de>
+Date:  Wed Apr 9 17:34:08 2008 +0200
+
+    Fix regression introduced by a typo in "Tidied other cpu/arm920t/start.S code"
+
+    Restore logic reverted by commit
+
+    commit 80767a6cead9990d9e77e62be947843c2c72f469
+    Author: Peter Pearse <peter.pearse@arm.com>
+    Date:   Wed Sep 5 16:04:41 2007 +0100
+
+       Changed API name to coloured_led.h
+       Removed code using deprecated ifdef CONFIG_BOOTBINFUNC
+       Tidied other cpu/arm920t/start.S code
+
+    Signed-off-by: Guennadi Liakhovetski <lg@denx.de>
+
+commit e25cb8d3f4fcc265a9cdf8e9d577b59bdb64bbaf
+Author: Mike Frysinger <vapier@gentoo.org>
+Date:  Tue Apr 8 10:24:24 2008 -0400
+
+    Remove conflicting NAND ID
+
+    There are two NAND entries with ID 0xDC and this obviously causes problems.
+    In the kernel, they punted the first entry, so we should do the same.
+
+    See this upstream e-mail for more info:
+    http://lists.infradead.org/pipermail/linux-mtd/2007-July/018795.html
+
+    Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
+    Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+
+commit 188e94c370621708d13547d58dbc6ed3c5602aa8
+Author: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
+Date:  Tue Apr 8 16:20:35 2008 +0900
+
+    cpu/mips/cpu.c: Fix flush_cache bug
+
+    Cache operations have to take line address (addr), not start_addr.
+    I noticed this bug when debugging ping failure.
+
+    Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
+
+commit 8f2a68a07c058fca1d413e54f71c2e7e78a74ed4
+Author: Martin Krause <martin.krause@tqs.de>
+Date:  Thu Apr 3 14:29:01 2008 +0200
+
+    TQM5200: fix default IDE reset level
+
+    Before the first call of ide_reset(), the level of the IDE reset
+    signal on the TQM5200 is low (reset asserted). This patch sets the
+    default value to high (reset not asserted).
+
+    Currently this patch fixes no real problem, but it is cleaner to
+    assert the reset signal only on demand, and not permanently.
+
+    Signed-off-by: Martin Krause <martin.krause@tqs.de>
+
+commit c61e033d6e8abb7b4060ee36060961e1399f6079
+Author: Detlev Zundel <dzu@denx.de>
+Date:  Thu Apr 3 14:18:48 2008 +0200
+
+    mgcoge, mgsuv: realign CONFIG_EXTRA_ENV_SETTING
+
+    Signed-off-by: Detlev Zundel <dzu@denx.de>
+
+commit f308572e19eb7fe63aa3d41f214cde4c23c9800f
+Author: Detlev Zundel <dzu@denx.de>
+Date:  Thu Apr 3 14:18:47 2008 +0200
+
+    mgcoge, mgsuv: rename 'addcon' to 'addcons'
+
+    The latter name with 13 users is already established, so we will use
+    that.
+
+    Signed-off-by: Detlev Zundel <dzu@denx.de>
+
+commit e175eacc87c3a9e4dad0799fee0e95732520afc7
+Author: Martin Krause <martin.krause@tqs.de>
+Date:  Thu Apr 3 13:37:56 2008 +0200
+
+    IDE: fix bug in reset sequence
+
+    According to the ata (ata5) specification the RESET- signal
+    shall be asserted for at least 25 us. Without this patch,
+    the RESET- signal is asserted on some boards for only < 1 us
+    (e. g. on the TQM5200). This patch adds a general delay of
+    25 us to the RESET- signal.
+
+    Without this patch a Platinum 4 GiB CF card is not recognised
+    properly on boards with a TQM5200 (STK52xx, TB5200).
+
+    Signed-off-by: Martin Krause <martin.krause@tqs.de>
+
+commit 813bea96a960916c72b4a3a7df840151529c26ce
+Author: Sascha Laue <Sascha.Laue@gmx.biz>
+Date:  Thu Apr 3 14:43:11 2008 +0200
+
+    lwmon5: disable CONFIG_ZERO_BOOTDELAY
+
+    Signed-off-by: Sascha Laue <sascha.laue@liebherr.com>
+
+commit 53eec6f1d25932e76d63ccb14082792b0b96bf41
+Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+Date:  Wed Apr 2 08:03:58 2008 +0200
+
+    ds174x: Fix warning on return in rtc_get and rtc_set functions
+
+    Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+
+commit a253b38bf50c85227c33ca0febc870ee49d1588e
+Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+Date:  Wed Apr 2 08:03:57 2008 +0200
+
+    cmd_log.c: Fix assignment differ in signedness
+
+    In function 'logbuff_init_ptrs':
+    cmd_log.c:79: warning: pointer targets in assignment differ in signedness
+
+    Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+
+commit 6c0e9a8f1cc090fbfbc6f86b6b4fd17a1628f3df
+Author: Gururaja Hebbar K R <gururajakr@sanyo.co.in>
+Date:  Wed Apr 2 11:04:43 2008 +0530
+
+    Remove duplicate #undef SHOW_INFO in drivers/usb/usb_ohci.c
+
+    Signed-off-by: gururaja hebbar <gururajakr@sanyo.co.in>
+
+commit 478d5ec9ae3cbcc6040241d2d73dbbc61fe9b49d
+Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+Date:  Tue Apr 1 14:07:10 2008 +0200
+
+    s3c4510b_eth: fix 'packed' attribute ignored for fields of MACFrame
+
+    Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+
+commit c08fb3ea36d19b1640b7906264581e9105534399
+Author: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
+Date:  Tue Apr 15 10:24:14 2008 +0200
+
+    Additional PCI IDs for IDE and network controllers
+
+    These PCI IDs are required by the Linkstation platforms.
+
+    Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
+
+commit c0559be371b2a64b1a817088c3308688e2182f93
+Author: Joakim Tjernlund <joakim.tjernlund@transmode.se>
+Date:  Mon Apr 14 23:01:50 2008 +0200
+
+    Change env_get_char from a global function ptr to a function.
+
+    This avoids an early global data reference.
+
+    Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
+
+commit 3e0f331c05d72f140715c1e9fca991927e44d422
+Author: Guennadi Liakhovetski <lg@denx.de>
+Date:  Tue Apr 29 12:35:08 2008 +0000
+
+    Clean up smsc911x driver
+
+    Replace direct register address derefencing with accessor functions.
+    Restrict explicitly 32-bit bus-width, extend affected configurations
+    respectively.
+
+    Signed-off-by: Guennadi Liakhovetski <lg@denx.de>
+    Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
+
+commit de1b686b763aa8b87a86f6748ce9169e7fc0e4cd
+Author: Sascha Hauer <s.hauer@pengutronix.de>
+Date:  Tue Apr 15 00:08:20 2008 -0400
+
+    This patch adds a driver for the following smsc network controllers:
+    LAN9115
+    LAN9116
+    LAN9117
+    LAN9215
+    LAN9216
+    LAN9217
+
+    Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
+    Signed-off-by: Guennadi Liakhovetski<lg@denx.de>
+    Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
+
+commit 3dfd4aab929cccddb63d9ea509967861e1333b52
+Author: Sascha Laue <Sascha.Laue@gmx.biz>
+Date:  Tue Apr 1 15:13:03 2008 +0200
+
+    Fix watchdog POST for lwmon5
+
+    If the hardware watchdog detects a voltage error, the watchdog sets
+    GPIO62 to low. The watchdog POST has to detect this low level.
+
+    Signed-off-by: Sascha Laue <leglas0@legpc180.leg.liebherr.i>
+
+commit 24b448448a917e52806f82660a5c9d47608894fb
+Author: Dave Liu <r63238@freescale.com>
+Date:  Tue Apr 1 15:22:11 2008 +0800
+
+    ata: update the libata.h from ata.h of linux kernel
+
+    Current libata.h of u-boot is out of sync from linux kernel,
+    this patch make it be consistent with linux kernel.
+
+    Signed-off-by: Dave Liu <daveliu@freescale.com>
+    Signed-off-by: Tor Krill <tor@excito.com>
+
+commit f8f9dc98883f66f59eb0601da65808e6b139c87c
+Author: Kumar Gala <galak@kernel.crashing.org>
+Date:  Mon Mar 31 11:59:27 2008 -0500
+
+    Allow use of ARCH=powerpc when building
+
+    The linux kernel is now mostly ARCH=powerpc, so to make life easier
+    allow use to use ARCH=powerpc and convert it to ARCH=ppc.
+
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+
+commit 8af657d2c6d1ca4f2f76973531394d4578ba2ef0
+Author: Kyungmin Park <kmpark@infradead.org>
+Date:  Mon Mar 31 10:40:54 2008 +0900
+
+    Add apollon board MAINTAINERS entry
+
+    Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
+
+commit 77e475cc0ed1832160017d364be32a0be9ff02a9
+Author: Kyungmin Park <kmpark@infradead.org>
+Date:  Mon Mar 31 10:40:36 2008 +0900
+
+    Fix OneNAND read
+
+    It should access with 16-bit instead of 8-bit
+
+    Now it uses the generic memcpy with 8-bit access. It means it reads wrong data from OneNAND.
+
+    Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
+
+commit a9da2b41079d230db3a5641625311983f85ce1fb
+Author: Kyungmin Park <kmpark@infradead.org>
+Date:  Mon Mar 31 10:40:19 2008 +0900
+
+    Fix OneNAND erase command
+
+    It mis-calculates the block address.
+    Also fix DECLARE_GLOBAL_DATA_PTR in env_onenand.
+
+    Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
+
+commit 61525f2ffa156665a66908fda47dbf29d65ea579
+Author: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
+Date:  Mon Mar 31 01:32:15 2008 +0200
+
+    Support for LinkStation / KuroBox HD and HG PPC models
+
+    This patch is based on the port by Mihai Georgian (see linkstation.c for
+    Copyright information) and implements support for LinkStation / KuroBox HD
+    and HG PPC models from Buffalo Technology, whereby HD is deactivated at
+    the moment, pending network driver fixing.
+
+    Notice to users: this is pretty much a barebone port. Support for network
+    on HG models is already in the U-Boot mainline, but you might also want
+    patches to switch fan / phy modes depending on the negotiated ethernet
+    parameters. This patch also doesn't support console switching, booting EM
+    mode, Buffalo specific ext2 magic number. So, if you want to use any of
+    those, you need additional patches. Otherwise this patche provides a fully
+    functional u-boot with a network console on your system.
+
+    Signed-off-by: Guennadi Liakhovetski <lg@denx.de>
+
+commit 0f3ba7e9783f352318f197a3148f6d5cc3d75bea
+Author: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
+Date:  Sun Mar 30 01:22:13 2008 -0500
+
+    Add CONFIG_MII_INIT support to related boards
+
+    Replace CONFIG_8xx and CONFIG_MCF532x to CONFIG_MII_INIT in
+    cmd_init.c. Add CONFIG_MII_INIT to board configuration files
+    that use mii_init() in cmd_init.c.
+
+    Signed-off-by: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
+    Acked-by: Ben Warren <biggerbadderben@gmail.com>
+
+commit f33fca22e76f20e4e4793810ca7a06a4805a6cf4
+Author: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
+Date:  Sun Mar 30 01:19:06 2008 -0500
+
+    Update CONFIG_PCIAUTO_SKIP_HOST_BRIDGE to related boards
+
+    Remove test for CONFIG_MPC5200 in drivers/pci/pci_auto.c and define
+    CONFIG_PCIAUTO_SKIP_HOST_BRIDGE in related board configuration files.
+
+    Signed-off-by: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
+
+commit e99ccb488181d012248c6be30b2093e950319fc5
+Author: Kumar Gala <galak@kernel.crashing.org>
+Date:  Thu Mar 27 11:46:38 2008 -0500
+
+    Introduce phys_size_t and move phys_addr_t into asm/types.h
+
+    Also add CONFIG_PHYS_64BIT on powerpc to deal with 32-bit ppc's
+    that have larger physical addresses like 44x, 85xx, and 86xx.
+
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+
+commit 20a14a42a25f72e379f38460b8a8484667536795
+Author: Andy Fleming <afleming@freescale.com>
+Date:  Wed Apr 2 16:19:07 2008 -0500
+
+    Rename include/md5.h to include/u-boot/md5.h
+
+    Some systems have md5.h installed in /usr/include/. This isn't the
+    desired file (we want the one in include/md5.h). This will avoid the
+    conflict. This fixes the host tools building problem by creating a new
+    directory for U-Boot specific header files.
+
+    [Patch by Andy Fleming, modified to use separate directory by Wolfgang
+    Denk]
+
+    Signed-off-by: Wolfgang Denk <wd@denx.de>
+    Signed-off-by: Andy Fleming <afleming@freescale.com>
+    Acked-by: Timur Tabi <timur@freescale.com>
+
+commit f297b7a1ec87433f66320d89d993e1bc738c66b8
+Author: Dave Liu <r63238@freescale.com>
+Date:  Thu Mar 27 18:51:17 2008 +0800
+
+    drivers: code clean up
+
+    Signed-off-by: Dave Liu <daveliu@freescale.com>
+
+commit 0ff7cba4a2e51c90827f6d21a0b28b4d67109597
+Author: Dave Liu <r63238@freescale.com>
+Date:  Thu Mar 27 18:50:41 2008 +0800
+
+    drivers: clean up the ata_piix.h
+
+    Signed-off-by: Dave Liu <daveliu@freescale.com>
+
+commit e8f7ba404f1409606962815ecc955a06984b08b3
+Author: Dave Liu <r63238@freescale.com>
+Date:  Thu Mar 27 18:49:56 2008 +0800
+
+    doc: english polishing for README.sata
+
+    according to gvb's suggestion, polishing for the doc.
+
+    Signed-off-by: Jerry Van Baren <gerald.vanbaren@ge.com>
+    Signed-off-by: Dave Liu <daveliu@freescale.com>
+
+commit 3e3f766a5274d204780460e1879723b565296d34
+Author: Kumar Gala <galak@kernel.crashing.org>
+Date:  Wed Mar 26 18:53:28 2008 -0500
+
+    Fix warnings introduced by I2C bus speed setting patch
+
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+
+commit 3c735e7437150e8615f26930c7819db85634276d
+Author: eran liberty <eran.liberty@gmail.com>
+Date:  Thu Mar 27 00:50:49 2008 +0100
+
+    Altera Stratix II support
+
+    Adds Support for Altera's Stratix II.
+
+    Within your board specific init file you will have to call
+
+    1. fpga_init (/* relocated code offset. usually => */ gd->reloc_off);
+    2. fpga_add (fpga_altera, (Altera_desc*)&altera_desc);
+
+    Altera_desc* contines (for example):
+       {
+        Altera_StratixII,      /* part type */
+        passive_serial,        /* interface type */
+        1,                     /* bytes of data part can accept */
+        (void *)(&funcs),      /* interface function table */
+        0L,                    /* base interface address */
+        0                      /* implementation specific cookie */
+        }
+
+    funcs is the interface. It is of type altera_board_specific_func.
+    It looks like this:
+    altera_board_specific_func func = {
+       pre_fn,
+       config_fn,
+       status_fn,
+       done_fn,
+       clk_fn,
+       data_fn,
+       abort_fn,
+       post_fn,
+    };
+
+    you will have to implement these functions, which is usually bit
+    banging some gpio.
+
+    Signed-off-by: Eran Liberty <liberty@extricom.com>
+
+commit 5ece9ec9f6cd52950ab848e2fe422dacf1d3a335
+Author: Wolfgang Denk <wd@denx.de>
+Date:  Sun Apr 13 14:32:54 2008 -0700
+
+    Update CHANGELOG
+
+    Signed-off-by: Wolfgang Denk <wd@denx.de>
+
+commit 5ad862166aa24d62a69aa9c708f6b2f5c0d28fb7
+Author: Sascha Hauer <s.hauer@pengutronix.de>
+Date:  Wed Mar 26 20:41:17 2008 +0100
+
+    Phytec Phycore-i.MX31 support
+
+    This patch adds support for the Phytec Phycore-i.MX31 board
+
+    Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
+    Signed-off-by: Guennadi Liakhovetski <lg@denx.de>
+
+commit caebc95be3b42e5147b5fac7672ac4b2693ef7e1
+Author: Sascha Hauer <s.hauer@pengutronix.de>
+Date:  Wed Mar 26 20:41:09 2008 +0100
+
+    mx31 litekit support
+
+    This patch adds support for the mx31 litekit board
+
+    Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
+    Signed-off-by: Guennadi Liakhovetski <lg@denx.de>
+
+commit cdace0661208754a53019ea0dc7b803a040e0939
+Author: Sascha Hauer <s.hauer@pengutronix.de>
+Date:  Wed Mar 26 20:40:49 2008 +0100
+
+    add an i2c driver for mx31
+
+    This patch adds an i2c driver for Freescale i.MX processors
+
+    Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
+    Signed-off-by: Guennadi Liakhovetski <lg@denx.de>
+
+commit 9b56f4f0306f3940b0aafd823ed6ecfc2d75d6c6
+Author: Sascha Hauer <s.hauer@pengutronix.de>
+Date:  Wed Mar 26 20:40:42 2008 +0100
+
+    core support for Freescale mx31
+
+    This patch adds the core support for Freescale mx31
+
+    Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
+    Signed-off-by: Guennadi Liakhovetski <lg@denx.de>
+
+commit 7ec68862a27c8f6f6d566228de8f6724d964a939
+Author: Wolfgang Denk <wd@denx.de>
+Date:  Sun Apr 13 14:19:23 2008 -0700
+
+    Fix compile error
+
+    ...as suggested by Peter Pearse
+
+    Signed-off-by: Wolfgang Denk <wd@denx.de>
+
+commit 5252ed95204bdf55bec5a90ea69860bf2f78c643
+Author: Sascha Hauer <s.hauer@pengutronix.de>
+Date:  Wed Mar 26 20:40:36 2008 +0100
+
+    Separate omap24xx specific code from arm1136
+
+    Move omap24xx code to cpu/arm1136/omap24xx, rename include/asm-arm/arch-arm1136
+    to cpu/arm1136/omap24xx.
+
+    Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
+    Signed-off-by: Guennadi Liakhovetski <lg@denx.de>
+
+commit 1f1d88dd40815332df32982e739f2ddd2da6fe1a
+Author: Mike Frysinger <vapier@gentoo.org>
+Date:  Tue Jan 29 18:21:05 2008 -0500
+
+    disable caches before booting an app for Blackfin apps
+
+    It isn't generally save to execute applications outside of U-Boot with caches
+    enabled due to the way the Blackfin processor handles caches (requires
+    software assistance).  This patch disables caches before booting an ELF or
+    just booting raw code.  The previous discussion on the patch was that we
+    wanted to use weaks instead, but that proved to not be feasible when multiple
+    symbols are involved, which puts us back at the ifdef solution.  I've
+    minimized the ugliness by moving the setup step outside of the main function.
+
+    Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+
+commit e6dfed705efa44ebf00d21bb1588c6ccc8f3ad32
+Author: Wolfgang Denk <wd@denx.de>
+Date:  Sun Apr 13 10:03:54 2008 -0700
+
+    ppc: Get rid of unused machine type definitions
+
+    Signed-off-by: Wolfgang Denk <wd@denx.de>
+
+commit 1aeed8d71acb3290cf2446f316d6ba437e7881c4
+Author: Wolfgang Denk <wd@denx.de>
+Date:  Sun Apr 13 09:59:26 2008 -0700
+
+    Coding Style cleanup; update CHANGELOG
+
+    Signed-off-by: Wolfgang Denk <wd@denx.de>
+
+commit 7754f33c6fb7a2c050388d20bf3847038558bdcf
+Author: Larry Johnson <lrj@acm.org>
+Date:  Thu Feb 21 13:58:11 2008 -0500
+
+    LM73 bug fix for negative temperatures and cleanup
+
+    When the LM73 temperature sensor measures a temperature below 0 C, the
+    current driver does not perform sign extension, so the result returned is
+    512 C too high.  This patch fixes the problem, and does general cleanup
+    of the code.
+
+    Signed-off-by: Larry Johnson <lrj@acm.org>
+
+commit 96ef831f713289afba19da0c8f905e99da2b23e0
+Author: Guennadi Liakhovetski <lg@denx.de>
+Date:  Thu Apr 3 13:36:02 2008 +0200
+
+    cfi_flash: Support buffered writes on non-standard Spansion NOR flash
+
+    Some NOR flash chip from Spansion, for example, the s29ws-n MirrorBit
+    series require different addresses for buffered write commands. Define a
+    configuration option to support buffered writes on those chips. A more
+    elegant solution would be to automatically detect those chips by parsing
+    their CFI records, but that would require introduction of a fixup table
+    into the cfi_flash driver.
+
+    Signed-off-by: Guennadi Liakhovetski <lg@denx.de>
+
+commit 3f9c542d3d69b1a10a5e193e779133a0454d1f44
+Author: Lee Nipper <lee.nipper@freescale.com>
+Date:  Thu Apr 10 09:35:06 2008 -0500
+
+    mpc83xx: Update DIMM data bus width test to support 40-bit width
+
+    32-bit wide ECC memory modules report 40-bit width.
+    Changed the DIMM data bus width test to 'less than 64' instead of 'equal 32'.
+
+    Signed-off-by: Lee Nipper <lee.nipper@freescale.com>
+    Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
+
+commit 5fb5a689d822ca61e814bd523fc930af335242fa
+Author: Dave Liu <r63238@freescale.com>
+Date:  Mon Mar 31 17:05:12 2008 +0800
+
+    mpc83xx: Fix the bug of serdes initialization
+
+    Currently the serdes will not be initializated due to the
+    partid's error.
+
+    Signed-off-by: Dave Liu <daveliu@freescale.com>
+    Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
+
+commit 2000784818f043db7ca60e2846a72d097766b894
+Author: Dave Liu <r63238@freescale.com>
+Date:  Thu Apr 3 16:28:29 2008 +0800
+
+    mpc83xx: Fix the SATA clock setting of 837x targets
+
+    Currently the SATA controller clock is configured as CSB clock,
+    usually the CSB clock is 400/333/266MHz.
+
+    However, The SATA IP block is only guaranteed to operate up to
+    200 MHz as stated in the HW spec.
+
+    The bug is reported by Joe D'Abbraccio <ljd015@freescale.com>
+
+    This patch makes the SATA clock as half of CSB clock.
+
+    Signed-off-by: Dave Liu <daveliu@freescale.com>
+    Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
+
+commit 1ac4f320bf0b593aa0a741f2d649a8ece8838672
+Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+Date:  Wed Apr 2 13:41:21 2008 +0200
+
+    mpc837xerdb: Fix warning: implicit declaration of function 'fdt_fixup_dr_usb'
+
+    Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+    Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
+
+commit 97b3ecb575a92fa34c1765229dbc06f2b662f139
+Author: Kumar Gala <galak@kernel.crashing.org>
+Date:  Wed Apr 9 04:20:57 2008 -0500
+
+    85xx: Fix detection of MP cpu spin up
+
+    We were looking at the wrong memory offset to determine of a secondary
+    cpu had been spun up or not.  Also added a warning message if the
+    all the secondary cpus we expect don't spin up.
+
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+
+commit f3e04bdc3f360c66801a9048956e61e41a16edba
+Author: Kumar Gala <galak@kernel.crashing.org>
+Date:  Tue Apr 8 10:45:50 2008 -0500
+
+    85xx: Use SVR_SOC_VER instead of SVR_VER
+
+    The recent change introduced by 'Update SVR numbers to expand support'
+    now requires that we use SVR_SOC_VER instead of SVR_VER if we want
+    to compare against a particular processor id.
+
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+
+commit 5b2052e5f5fcce5dbd4d2750a29c0e45bce806e7
+Author: Eugene O'Brien <eugene.obrien@advantechamt.com>
+Date:  Fri Apr 11 10:00:35 2008 -0400
+
+    ppc4xx: Fix power mgt definitions for PPC440
+
+    Corrected DCR addresses of PPC440EP power management registers.
+
+    Signed-off-by: Eugene O'Brien <eugene.obrien@advantechamt.com>
+
+commit 950a392464e616b4590bc4501be46e2d7d162dea
+Author: Wolfgang Denk <wd@denx.de>
+Date:  Fri Apr 11 15:11:26 2008 +0200
+
+    Revert merge of git://www.denx.de/git/u-boot-arm, commit 62479b18:
+
+    Reverting became necessary after it turned out that the patches in
+    the u-boot-arm repo were modified, and in some cases corrupted.
+
+    This reverts the following commits:
+
+       066bebd6353e33af3adefc3404560871699e9961
+       7a837b7310166ae8fc8b8d66d7ef01b60a80f9d6
+       c88ae20580b2b01487b4cdcc8b2a113f551aee36
+       a147e56f03871bba4f05058d5e04ce7deb010b04
+       d6674e0e2a6a1f033945f78838566210d3f28c95
+       8c8463cce44d849e37744749b32d38e1dfb12e50
+       c98b47ad24b2d91f41c09a3d62d7f70ad84f4b7d
+       8bf69d81782619187933a605f1a95ee1d069478d
+       8c16cb0d3b971f46fbe77c072664c0f2dcd4471d
+       a574a73852a527779234e73e17e7597fd8128882
+       1377b5583a48021d983e1fd565f7d40c89e84d63
+       1704dc20917b4f71e373e2c888497ee666d40380
+
+    Signed-off-by: Wolfgang Denk <wd@denx.de>
+
+commit 64e541f4c1b413dd84c7e409f5c2bf328db2ac13
+Author: Stefan Roese <sr@denx.de>
+Date:  Fri Apr 11 07:02:29 2008 +0200
+
+    ppc4xx: Update Kilauea defconfig to use device-tree booting as default
+
+    This patch reworks the default environment on Kilauea/Haleakala. Now
+    "net_nfs" for exmaple uses the device-tree style booting formerly know
+    as "net_nfs_fdt". Also the addresses in RAM were changed because of the
+    new image booting support, which check for image overwriting. So the
+    addresses needed togeet adjusted.
+
+    Signed-off-by: Stefan Roese <sr@denx.de>
+
+commit 756f5dacda3810b094b94bcceffd3ce6c7ff9a28
+Author: Stefan Roese <sr@denx.de>
+Date:  Wed Apr 9 11:58:02 2008 +0200
+
+    ppc4xx: Fix Canyonlands default environment to work with new image support
+
+    Since the new image support checks for image overwriting, the default
+    environment needs to get adjusted to use correct addresses.
+
+    Signed-off-by: Stefan Roese <sr@denx.de>
+
+commit dfc6c7b647dba7ab86749616f0e9e5740deed422
+Author: Stefan Roese <sr@denx.de>
+Date:  Wed Apr 9 11:54:11 2008 +0200
+
+    ppc: Revert patch 70431e8a that used _start instead of CFG_MONITOR_BASE
+
+    The patch 70431e8a7393b6b793f77957f95b999fc9a269b8 (Make MPC83xx one step
+    closer to full relocation.) doesn't use CFG_MONITOR_BASE anymore. But
+    on 4xx systems _start currently cannot be used for this calculation.
+    So revert back to the original version for now.
+
+    Signed-off-by: Stefan Roese <sr@denx.de>
+
+commit f91374f65eae8b42cac329e06ba1c54728278efb
+Author: Michal Simek <monstr@monstr.eu>
+Date:  Fri Mar 28 12:49:52 2008 +0100
+
+    microblaze: Sort microblaze boards in MAKEALL script
+
+commit 62032deb7214c6d9b4396297e2aaa559bc2f8495
+Author: Michal Simek <monstr@monstr.eu>
+Date:  Fri Mar 28 11:58:45 2008 +0100
+
+    microblaze: clean microblaze_config.mk
+
+    FLAGS are generated by U-BOOT generator.
+    Board specific FLAGS are in board directory
+
+    Signed-off-by: Michal Simek <monstr@monstr.eu>
+
+commit cf5c679ca04a6b54bf53a55b8b9c29335b387287
+Author: Michal Simek <monstr@monstr.eu>
+Date:  Fri Mar 28 12:47:19 2008 +0100
+
+    microblaze: xupv2p fix config file for supporting FDT
+
+commit 188dc16b189143573b1ed90e584bf866d75cdd12
+Author: Michal Simek <monstr@monstr.eu>
+Date:  Fri Mar 28 11:53:02 2008 +0100
+
+    microblaze: ml401 fix config file for supporting FDT
+
+    Signed-off-by: Michal Simek <monstr@monstr.eu>
+
+commit 4c6a6f02e239236261333759997eeaf86b30b54c
+Author: Michal Simek <monstr@monstr.eu>
+Date:  Fri Mar 28 11:22:48 2008 +0100
+
+    microblaze: ml401 - add ifdef for GPIO
+
+    Signed-off-by: Michal Simek <monstr@monstr.eu>
+
+commit af7ae1a411c67ee9d17a66d17ce50b374f3dd4e7
+Author: Michal Simek <monstr@monstr.eu>
+Date:  Fri Mar 28 12:13:03 2008 +0100
+
+    microblaze: clean uart16550 and uartlite handling
+
+    Signed-off-by: Michal Simek <monstr@monstr.eu>
+
+commit 0b20f250877441460fb79d72192954abe8498834
+Author: Michal Simek <monstr@monstr.eu>
+Date:  Fri Mar 28 11:08:31 2008 +0100
+
+    microblaze: Add Emaclite driver to Makefile
+
+    Signed-off-by: Michal Simek <monstr@monstr.eu>
+
+commit 868cde5310f88234b774878e4f06e79df10a88b3
+Author: Michal Simek <monstr@monstr.eu>
+Date:  Fri Mar 28 11:08:01 2008 +0100
+
+    microblaze: Add Emac driver to Makefile
+
+    Signed-off-by: Michal Simek <monstr@monstr.eu>
+
+commit 6f961b4f461f6cbb83a467d468a02e6078c2b327
+Author: Michal Simek <monstr@monstr.eu>
+Date:  Fri Mar 28 12:42:29 2008 +0100
+
+    microblaze: add Emac ethernet driver
+
+commit 89c53891b18cbafd29ab8931b40e27ad231b6085
+Author: Michal Simek <monstr@monstr.eu>
+Date:  Fri Mar 28 12:41:56 2008 +0100
+
+    microblaze: add Emaclite ethernet driver
+
+commit e5845e21224dbe2fe47b11f1cdf95de7f84be7cb
+Author: Michal Simek <monstr@monstr.eu>
+Date:  Fri Mar 28 11:04:01 2008 +0100
+
+    microblaze: ML401 and XUPV2P remove emac and emaclite reference
+
+    Signed-off-by: Michal Simek <monstr@monstr.eu>
+
+commit 6bf3e982aefdb1daf9f5462d482c8f9d1cc90a57
+Author: Michal Simek <monstr@monstr.eu>
+Date:  Fri Mar 28 10:59:32 2008 +0100
+
+    microblaze: remove old setting for emac driver
+
+    Signed-off-by: Michal Simek <monstr@monstr.eu>
+
+commit cd2b75efb9cc037c74ecee9b3586f9bf9e1d4e57
+Author: Michal Simek <monstr@monstr.eu>
+Date:  Fri Mar 28 10:58:15 2008 +0100
+
+    microblaze: Clean Makefile from ancient emac driver
+
+    Signed-off-by: Michal Simek <monstr@monstr.eu>
+
+commit ab68f921d9c741830f721c3d879c13a0c5597183
+Author: Daniel Hellstrom <daniel@gaisler.com>
+Date:  Fri Mar 28 10:20:43 2008 +0100
+
+    SPARC/LEON2: added support for Gaisler simulator GRSIM/TSIM for SPARC/LEON2 targets. See www.gaisler.com for information.
+
+    Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
+
+commit 6ed8a43a19bb0275501bc286007daafa923552cf
+Author: Daniel Hellstrom <daniel@gaisler.com>
+Date:  Wed Mar 26 23:38:48 2008 +0100
+
+    SPARC/LEON3: added support for GR-CPCI-AX2000 FPGA AX board. The FPGA is exchangeable but a standard LEON3 design is assumed. See www.gaisler.com for information.
+
+    Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
+
+commit 6940383d9ec1bfe2f13e339e6f723e8d34af2b12
+Author: Daniel Hellstrom <daniel@gaisler.com>
+Date:  Wed Mar 26 23:34:47 2008 +0100
+
+    SPARC/LEON3: added support for Altera NIOS Development kit (STRATIX II Edition) with GRLIB template design. See www.gaisler.com for information.
+
+    Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
+
+commit 823edd8a66ed50af5aaba0c79567f67061e4d79a
+Author: Daniel Hellstrom <daniel@gaisler.com>
+Date:  Fri Mar 28 10:06:52 2008 +0100
+
+    SPARC/LEON3: added support for Gaisler GRSIM/TSIM2 SPARC/LEON3 simulatorn. See www.gaisler.com for information.
+
+    Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
+
+commit 71d7e4c0489e5ed8fc69382236aaa2a1e510c135
+Author: Daniel Hellstrom <daniel@gaisler.com>
+Date:  Wed Mar 26 23:26:48 2008 +0100
+
+    SPARC/LEON3: added support for GR-XC3S-1500 board with GRLIB template design. See www.gaisler.com for board information.
+
+    Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
+
+commit b330990c2f36ee4a8bb318360e1c8ba965269ab6
+Author: Daniel Hellstrom <daniel@gaisler.com>
+Date:  Fri Mar 28 10:00:33 2008 +0100
+
+    SPARC: Added support for SPARC LEON2 SOC Processor.
+
+    Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
+
+commit 2a2fa797e63b1e3cd4d570318ca5fbf8723ef53a
+Author: Daniel Hellstrom <daniel@gaisler.com>
+Date:  Wed Mar 26 23:00:38 2008 +0100
+
+    SPARC/LEON3: Added AMBA Bus Plug&Play information print command (ambapp). It can print available cores (type: AHB Master, AHB Slave, APB Slave), their address ranges, IRQ number and version.
+
+    Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
+
+commit 1e9a164e22976933002c5e4b0b79b09fcede9cd4
+Author: Daniel Hellstrom <daniel@gaisler.com>
+Date:  Wed Mar 26 22:51:29 2008 +0100
+
+    SPARC: Added support for SPARC LEON3 SOC processor.
+
+    Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
+
+commit bf3d8b31169546fcddb4737391e1893fb12d033a
+Author: Daniel Hellstrom <daniel@gaisler.com>
+Date:  Fri Mar 28 08:29:26 2008 +0100
+
+    SPARC: added SPARC support for new uimage in common code.
+
+    Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
+
+commit 00ab32c85405a4fe65fd4128243086210fc90a21
+Author: Daniel Hellstrom <daniel@gaisler.com>
+Date:  Wed Mar 26 22:36:03 2008 +0100
+
+    SPARC: added SPARC board information to the command bdinfo.
+
+    Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
+
+commit c2f02da21a3f37f0878554eebc785e04fdc4e128
+Author: Daniel Hellstrom <daniel@gaisler.com>
+Date:  Fri Mar 28 09:47:00 2008 +0100
+
+    SPARC: Added generic support for SPARC architecture.
+
+    Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
+
+commit e54ec0f016803e4d9524ff71f7971bda0c51b287
+Author: Stefan Roese <sr@denx.de>
+Date:  Thu Apr 3 14:50:34 2008 +0200
+
+    ppc4xx: Fix 4xx enet driver to support 460GT EMAC2+3
+
+    This patch fixes a problem with the RGMII setup of the 460GT. The 460GT
+    has 2 RGMII instances and we need to configure the 2nd RGMII instance
+    for the EMAC2+3 channels.
+
+    Signed-off-by: Stefan Roese <sr@denx.de>
+
+commit c2a545ce33b26d80337f80b533828839249fb1c9
+Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+Date:  Wed Apr 2 08:03:56 2008 +0200
+
+    MPC8xx: Fix libfdt support introduced in commit 77ff7b74
+
+    fdt.c: In function 'ft_cpu_setup':
+    fdt.c:33: warning: implicit declaration of function 'do_fixup_by_prop_u32'
+    fdt.c:39: warning: implicit declaration of function 'do_fixup_by_compat_u32'
+    fdt.c:43: warning: implicit declaration of function 'fdt_fixup_ethernet'
+    fdt.c:45: warning: implicit declaration of function 'fdt_fixup_memory'
+
+    Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+
+commit 4abd844d8eb108736e1cf8fbf3dbf61f2d5fc11b
+Author: Andy Fleming <afleming@freescale.com>
+Date:  Mon Mar 31 20:45:56 2008 -0500
+
+    Fix fdt set command to conform to dts spec
+
+    The fdt set command was treating properties specified as <00> and <0011>
+    as byte streams, rather than as an array of cells. As we already have
+    syntax for expressing the desire for a stream of bytes ([ xx xx ...]),
+    we should use the <> syntax to describe arrays of cells, which are always
+    32-bits per element.  If we imagine this likely (IMHO) scenario:
+
+    > fdt set /ethernet-phy@1 reg <1>
+
+    With the old code, this would create a bad fdt, since the reg cell would be
+    made to be one byte in length.  But the cell must be 4 bytes, so this would
+    break mysteriously.
+
+    Also, the dts spec calls for constants inside the angle brackets (<>)
+    to conform to C constant standards as they pertain to base.
+    Take this scenario:
+
+    > fdt set /ethernet@f00 reg <0xe250000\ 0x1000>
+
+    The old fdt command would complain that it couldn't parse that.  Or, if you
+    wanted to specify that a certain clock ran at 33 MHz, you'd be required to
+    do this:
+
+    > fdt set /mydev clock <1f78a40>
+
+    Whereas the new code will accept decimal numbers.
+
+    While I was in there, I extended the fdt command parser to handle property
+    strings which are split across multiple arguments:
+
+    > fdt set /ethernet@f00 interrupts < 33 2 34 2 36 2 >
+    > fdt p /ethernet@f00
+    ethernet@f00 {
+       interrupts = <0x21 0x2 0x22 0x2 0x24 0x2>;
+    };
+
+    Lastly, the fdt print code was rearranged slightly to print arrays of cells
+    if the length of the property is a multiple of 4 bytes, and to not print
+    leading zeros.
+
+    Signed-off-by: Andy Fleming <afleming@freescale.com>
+
+commit 1c2926abdd7db89296a8cc7f224dd9d5d4e37a56
+Author: Stefan Roese <sr@denx.de>
+Date:  Wed Apr 2 08:39:33 2008 +0200
+
+    ppc4xx: Canyonlands: Init SATA/PCIe port correctly
+
+    Canyonlands (460EX) shares the first PCIe interface with the SoC SATA
+    interface. This usage can be configured with the jumper J6. This patch
+    correctly configures the SATA/PCIe PHY for SATA usage when this jumper
+    is installed.
+
+    Signed-off-by: Stefan Roese <sr@denx.de>
+
+commit 6fe2946f198481254a6ee9600d7456b8316a4083
+Author: Kim Phillips <kim.phillips@freescale.com>
+Date:  Fri Mar 28 17:37:49 2008 -0500
+
+    remove remaining CONFIG_OF_HAS_{UBOOT_ENV,BD_T} code
+
+    finish off what commit 43ddd9c820fec44816188f53346b464e20b3142d,
+    "Remove deprecated CONFIG_OF_HAS_UBOOT_ENV and CONFIG_OF_HAS_BD_T"
+    started.
+
+    Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
+
+commit b5873f1732b92a25690e1513b90dfb0d644f6697
+Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+Date:  Tue Apr 1 07:30:51 2008 +0200
+
+    dataflash: Move CONFIG_HAS_DATAFLASH to Makefile
+
+    Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+
+commit 2d934ea51f276522b532f870a820e844ff480b5b
+Author: Tor Krill <tor@excito.com>
+Date:  Fri Mar 28 15:29:45 2008 +0100
+
+    Add Vitesse 8601 support to TSEC driver
+
+    Add phy_info for Vitesse VSC8601.
+    Add config option, CFG_VSC8601_SKEWFIX, to enable RGMII skew timing compensation.
+
+    Signed-off-by: Tor Krill <tor@excito.com>
+    Reviewed-by: Kim Phillips <kim.phillips@freescale.com>
+    Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
+
+commit 3eac6402a508b0f68a21cc9cbc2cc49347de0c31
+Author: Daniel Hellstrom <daniel@gaisler.com>
+Date:  Mon Mar 31 14:25:00 2008 +0000
+
+    SPARC: added SMC91111 driver in and out macros for LEON processors.
+
+    This patch makes SPARC/LEON processors able to read and write
+    to the SMC91111 chip using the chip external I/O bus of the memory
+    controller. This patchs defines the standard in and out macros
+    expected by the SMC9111 driver.
+
+    To access that I/O bus one must set up the memory controller
+    (MCTRL or FTMCTRL) correctly. It is assumed that the user sets
+    up this correctly when the other MCTRL parameters are set up. It
+    can be set up from the board configuration header file.
+
+    Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
+    Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
+
+commit 3ca7c558eba36332556bc470d45e2f5d42bd0ca6
+Author: Stelian Pop <stelian@popies.net>
+Date:  Wed Mar 26 18:52:34 2008 +0100
+
+    Add maintainership information for AT91CAP9ADK and AT91SAM9260EK boards
+
+    Signed-off-by: Stelian Pop <stelian@popies.net>
+
+commit 4e03dde84dd2c91e327cdc23ae119d432559a7a3
+Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+Date:  Mon Mar 31 21:31:04 2008 +0200
+
+    AT91SAM9260EK: Move CONFIG_CMD_NAND to Makefile
+
+    Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+
+commit 0176d43e759a6e00cacc85eff26fd60f74b4f6b7
+Author: Stelian Pop <stelian@popies.net>
+Date:  Wed Mar 26 18:52:33 2008 +0100
+
+    Add support for AT91SAM9260EK
+
+    Support for booting from internal DataFlash, external DataFlash card
+    or NAND flash is available.
+
+    Signed-off-by: Stelian Pop <stelian@popies.net>
+
+commit 1762f13b4aab88b685b1722f17dada247945624b
+Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+Date:  Mon Mar 31 21:20:49 2008 +0200
+
+    AT91SAM9: Move CONFIG_HAS_DATAFLASH to Makefile
+
+    Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+
+commit 761712188b353494defb2b644491ff73d0daaa6f
+Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+Date:  Mon Mar 31 21:12:17 2008 +0200
+
+    AT91CAP9ADK: Move CONFIG_CMD_NAND to Makefile
+
+    Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+
+commit 983c1db04c1dd0f92e02f06d29f0c65a3d9a2687
+Author: Stelian Pop <stelian@popies.net>
+Date:  Wed Mar 26 20:52:32 2008 +0100
+
+    Port AT91CAP9 to the new headers
+
+    Adapt the existing AT91CAP9 code to the new headers and APIs.
+
+    Signed-off-by: Stelian Pop <stelian@popies.net>
+
+commit 177e8a5ac81bbc531a1d54abdb47f2860266c3aa
+Author: Stelian Pop <stelian@popies.net>
+Date:  Wed Mar 26 19:52:31 2008 +0100
+
+    Finish header files reworking
+
+    Replace AT91CAP9.h file with several splitted header files coming
+    from the Linux kernel.
+
+    This is part 2 of the replacement: more header imports and edits.
+
+    Signed-off-by: Stelian Pop <stelian@popies.net>
+
+commit 6d1dbbbf9fdf727384002e553e615c15d8b967f4
+Author: Stelian Pop <stelian@popies.net>
+Date:  Wed Mar 26 19:52:30 2008 +0100
+
+    Import several header files from Linux
+
+    Replace AT91CAP9.h file with several splitted header files coming
+    from the Linux kernel.
+
+    This is part 1 of the replacement: pristine header files import.
+
+    Signed-off-by: Stelian Pop <stelian@popies.net>
+
+commit a8a78f2d99dc1bd30dc3595da118539b506c6118
+Author: Stelian Pop <stelian@popies.net>
+Date:  Wed Mar 26 20:52:28 2008 +0100
+
+    Move at91cap9 specific files to at91sam9 directory
+
+    AT91CAP9 and AT91SAM9 SoCs are very close hardware wise, so a
+    common infrastructure can be used. Let this infrastructure be
+    named after the AT91SAM9 family, and move the existing AT91CAP9
+    files to the new place.
+
+    Signed-off-by: Stelian Pop <stelian@popies.net>
+
+commit 61106a565870ff503f92b251b94bd7afef889a04
+Author: Stelian Pop <stelian@popies.net>
+Date:  Wed Mar 26 21:52:27 2008 +0100
+
+    Use timer_init() instead of board supplied interrupt_init()
+
+    The timer on AT91CAP9/AT91SAM9 is supplied by the SoC, and not by
+    the board, so use timer_init() instead of interrupt_init().
+
+    Signed-off-by: Stelian Pop <stelian@popies.net>
+
+commit 5604e2178c5218fbfdba2e4293ca7652e829ac25
+Author: Stelian Pop <stelian@popies.net>
+Date:  Wed Mar 26 21:52:36 2008 +0100
+
+    Cleanup DataFlash partition handling
+
+    DataFlash partition information has become a mess. This patch
+    defines a single partition scheme for Atmel DataFlashes. This partition
+    scheme will be used by all AT91CAP9 and AT91SAM9 boards.
+
+    Signed-off-by: Stelian Pop <stelian@popies.net>
+
+commit 9b46432fc65ce0f0826b32e4f15c15b33ccb8d42
+Author: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
+Date:  Fri Mar 28 08:47:45 2008 -0500
+
+    ColdFire: Fix alignment issue after CONFIG_IDENT_STRING in start.S
+
+    When the version_string function in start.S is not 4-byte align,
+    it will cause the compiler generates "unaligned opcodes detected
+    in executable segment". This issue affects all ColdFire CPUs.
+    By adding .align 4 after CONFIG_IDENT_STRING, it will pad 0's if
+    it is not aligned.
+
+    Signed-off-by: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
+    Acked-by: John Rigby <jrigby@freescale.com>
+
+commit bae61eefe15b4d454060a7140e49ae58322be803
+Author: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
+Date:  Tue Mar 25 15:41:15 2008 -0500
+
+    ColdFire: Add dspi and serial flash support for MCF5445x
+
+    Signed-off-by: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
+    Acked-by: John Rigby <jrigby@freescale.com>
+
+commit 48ead7a7a922fceaf494e352abfab8216a41b417
+Author: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
+Date:  Tue Mar 18 17:37:01 2008 -0500
+
+    ColdFire: Remove R5200 board
+
+    This board never went into production
+
+    Signed-off-by: Zachary P. Landau <zachary.landau@labxtechnologies.com>
+    Acked-by: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
+    Acked-by: John Rigby <jrigby@freescale.com>
+
+commit 545c8e0a7cd3ca9d3846668f69b0d201250abea8
+Author: Matthew Fettke <[matthew.fettke@gmail.com]>
+Date:  Thu Jan 24 14:02:32 2008 -0600
+
+    ColdFire: Added M5275EVB support.
+
+    Signed-off-by: Matthew Fettke <mfettke@videon-central.com>
+    Signed-off-by: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
+    Acked-by: John Rigby <jrigby@freescale.com>
+
+commit f71d9d91a2cd9c30b2b6369f15c1a46c11537c2b
+Author: Matthew Fettke <[matthew.fettke@gmail.com]>
+Date:  Mon Feb 4 15:38:20 2008 -0600
+
+    ColdFire: Added MCF5275 cpu support.
+
+    Signed-off-by: Matthew Fettke <mfettke@videon-central.com>
+    Signed-off-by: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
+    Acked-by: John Rigby <jrigby@freescale.com>
+
+commit 44e5b9edab077aba6e9b849afa4b7fbd8fd7b02b
+Author: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
+Date:  Mon Mar 17 12:14:11 2008 -0500
+
+    ColdFire: Define bootdelay in configuration file for M52277EVB
+
+    Signed-off-by: Matt Wadel <Matt.Waddel@freescale.com>
+    Acked-by: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
+    Acked-by: John Rigby <jrigby@freescale.com>
+
+commit 77878f16cedee17161ff2336990970fffc6cea35
+Author: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
+Date:  Mon Mar 17 12:09:07 2008 -0500
+
+    ColdFire: Fix second memory Chipselect for M5475EVB
+
+    Signed-off-by: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
+    Acked-by: John Rigby <jrigby@freescale.com>
+
+commit 43d60642395a550956cb21d287c8cfa563913d28
+Author: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
+Date:  Thu Mar 13 14:26:32 2008 -0500
+
+    ColdFire: Update correct FLASHBAR and RAMBAR1 for MCF5282
+
+    Signed-off-by: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
+    Acked-by: John Rigby <jrigby@freescale.com>
+
+commit eb14ebe813a0cb5d47905228da446a5ad692473b
+Author: Larry Johnson <lrj@acm.org>
+Date:  Sun Mar 30 20:33:04 2008 -0500
+
+    ppc4xx: Add CFG_MEM_TOP_HIDE to Denali SPD-based SDRAM setup
+
+    Signed-off-by: Larry Johnson <lrj@acm.org>
+
+commit 02e3892021112f21067d9ed1d04ae4182725ba52
+Author: Stefan Roese <sr@denx.de>
+Date:  Mon Mar 31 12:20:48 2008 +0200
+
+    ppc4xx: Small whitespace fix of esd patches
+
+    Signed-off-by: Stefan Roese <sr@denx.de>
+
+commit 034394abb524785047c815f00dde8cdbdc1593c5
+Author: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
+Date:  Sun Mar 30 18:52:44 2008 +0200
+
+    ppc4xx: Cleanup PMC440 board support
+
+    Signed-off-by: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
+
+commit a6cc6c37188d85c25d167a4515da86f48d9a583e
+Author: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
+Date:  Sun Mar 30 18:52:06 2008 +0200
+
+    ppc4xx: Add ptm configuration variables for PMC440
+
+    Add support for the ptm1la, ptm1ms, ptm2la and ptm2ms
+    environment variables.
+
+    Cleanup pci_target_init.
+
+    Signed-off-by: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
+
+commit 7c91f51a2fe296909147f1646a1412729dd10b1d
+Author: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
+Date:  Sun Mar 30 18:01:15 2008 +0200
+
+    ppc4xx: Minor updates for DU440 boards
+
+    Signed-off-by: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
+
+commit d5bffeb868d6b4d462f558dac43011027b6644b7
+Author: Mike Frysinger <vapier@gentoo.org>
+Date:  Tue Feb 19 00:54:20 2008 -0500
+
+    Blackfin: cleanup and overhaul common board init functions
+
+    Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+
+commit b86b3416f874358acaf07519e7620cdb2145f75b
+Author: Mike Frysinger <vapier@gentoo.org>
+Date:  Tue Feb 19 00:50:58 2008 -0500
+
+    Blackfin: cleanup lib_blackfin/cache.c
+
+    Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+
+commit 9171fc81722c20fdb5a829a58b17c9eaadd5fb44
+Author: Mike Frysinger <vapier@gentoo.org>
+Date:  Sun Mar 30 15:46:13 2008 -0400
+
+    Blackfin: unify cpu and boot modes
+
+    All of the duplicated code for Blackfin processors and boot modes have been
+    unified.  After all, the core is the same for all processors, just the
+    peripheral set differs (which gets handled in the drivers).
+
+    Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+
+commit 880cc4381ea8360248cddcdf87a64566745a5724
+Author: Stelian Pop <stelian@popies.net>
+Date:  Wed Mar 26 22:52:35 2008 +0100
+
+    Fix CFG_NO_FLASH compilation.
+
+    Many Atmel boards have no "real" (NOR) flash on board, and rely only
+    on DataFlash and NAND memories. This patch enables CFG_NO_FLASH to
+    be present in a board configuration file, while still enabling flash
+    commands like 'flinfo', 'protect', etc.
+
+    Signed-off-by: Stelian Pop <stelian@popies.net>
+
+commit 9ce7e53abd039decea1af67aec81bbd5df7a2593
+Author: Mike Frysinger <vapier@gentoo.org>
+Date:  Tue Feb 19 00:58:13 2008 -0500
+
+    Blackfin: BF537-stamp: cleanup spi flash driver
+
+    This punts the old spi flash driver for a new/generalized one until the
+    common one can be integrated.
+
+    Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+
+commit bb8e3cf25bc0b04936c0c1a075985dd8700a244b
+Author: Ben Warren <biggerbadderben@gmail.com>
+Date:  Sun Mar 30 11:34:34 2008 -0400
+
+    Fix macro typo in common/cmd_mii.c
+
+    This typo was introduced in commit 233a8bcd94997f3f345833a3b82e836222f2a206.  I
+    actually applied the wrong patch.
+
+    Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
+
+commit f1b985f2d724ccaa4d3def07917f0caaf18fa77d
+Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+Date:  Sun Mar 30 16:39:53 2008 +0200
+
+    use correct at91rm9200 register name in m501sk board
+
+    This fixes a naming bug for at91rm9200 lowlevel init code:
+    NOR boot flash is on chipselect 0, not chipselect 2.  This
+    makes code use the register name from chip datasheets.
+
+    Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+
+commit 480ed1dea103a1c8f4591afc77d2de3c7868d983
+Author: David Brownell <david-b@pacbell.net>
+Date:  Fri Jan 18 12:55:00 2008 -0800
+
+    use correct at91rm9200 register name
+
+    This fixes a naming bug for at91rm9200 lowlevel init code:
+    NOR boot flash is on chipselect 0, not chipselect 2.  This
+    makes code use the register name from chip datasheets.
+
+    Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
+
+commit a3543d6dc52b0ba9c64016687cf32d600b31a476
+Author: David Brownell <david-b@pacbell.net>
+Date:  Fri Jan 18 12:45:45 2008 -0800
+
+    add missing ARM boards to MAKEALL
+
+    Add some missing ARM boards to MAKEALL.  These build correctly,
+    unlike several of the boards already listed.
+
+    Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
+
+commit 066bebd6353e33af3adefc3404560871699e9961
+Author: Peter Pearse <peter.pearse@arm.com>
+Date:  Sun Mar 30 11:34:09 2008 +0100
+
+    Bracket READ_TIMER macro in cpu/arm1136/omap24xx/interrupts.c
+    to prevent compilation error.
+
+    Signed-off-by: Peter Pearse <peter.pearse@arm.com>
+
+commit 7a837b7310166ae8fc8b8d66d7ef01b60a80f9d6
+Author: Guennadi Liakhovetski <[lg@denx.de]>
+Date:  Sun Mar 30 11:32:30 2008 +0100
+
+    Support for the MX31ADS evaluation board from Freescale
+
+    This patch adds support for the MX31ADS evaluation board from Freescale,
+    initialization code is copied from RedBoot sources, also provided by Freescale.
+
+    Signed-off-by: Guennadi Liakhovetski <lg@denx.de>
+
+commit c88ae20580b2b01487b4cdcc8b2a113f551aee36
+Author: Sascha Hauer <s.hauer@pengutronix.de>
+Date:  Sun Mar 30 11:32:27 2008 +0100
+
+    Phytec Phycore-i.MX31 support
+
+    This patch adds support for the Phytec Phycore-i.MX31 board
+
+    Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
+    Signed-off-by: Guennadi Liakhovetski <lg@denx.de>
+
+commit a147e56f03871bba4f05058d5e04ce7deb010b04
+Author: Sascha Hauer <s.hauer@pengutronix.de>
+Date:  Sun Mar 30 11:32:24 2008 +0100
+
+    mx31 litekit support
+
+    This patch adds support for the mx31 litekit board
+
+    Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
+    Signed-off-by: Guennadi Liakhovetski <lg@denx.de>
+
+commit d6674e0e2a6a1f033945f78838566210d3f28c95
+Author: Sascha Hauer <s.hauer@pengutronix.de>
+Date:  Sun Mar 30 11:32:21 2008 +0100
+
+    add SMSC LAN9x1x Network driver
+
+    This patch adds a driver for the following smsc network controllers:
+    LAN9115
+    LAN9116
+    LAN9117
+    LAN9215
+    LAN9216
+    LAN9217
+
+    Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
+    Signed-off-by: Guennadi Liakhovetski <lg@denx.de>
+
+commit 8c8463cce44d849e37744749b32d38e1dfb12e50
+Author: Sascha Hauer <s.hauer@pengutronix.de>
+Date:  Sun Mar 30 11:32:16 2008 +0100
+
+    add an i2c driver for mx31
+
+    This patch adds an i2c driver for Freescale i.MX processors
+
+    Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
+    Signed-off-by: Guennadi Liakhovetski <lg@denx.de>
+
+commit c98b47ad24b2d91f41c09a3d62d7f70ad84f4b7d
+Author: Sascha Hauer <s.hauer@pengutronix.de>
+Date:  Sun Mar 30 11:30:43 2008 +0100
+
+    core support for Freescale mx31
+
+    This patch adds the core support for Freescale mx31
+
+    Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
+    Signed-off-by: Guennadi Liakhovetski <lg@denx.de>
+
+commit 8bf69d81782619187933a605f1a95ee1d069478d
+Author: Sascha Hauer <s.hauer@pengutronix.de>
+Date:  Sun Mar 30 11:28:46 2008 +0100
+
+    Separate omap24xx specific code from arm1136
+
+    Move omap24xx code to cpu/arm1136/omap24xx, rename include/asm-arm/arch-arm1136 to cpu/arm1136/omap24xx.
+
+    Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
+    Signed-off-by: Guennadi Liakhovetski <lg@denx.de>
+
+commit 8c16cb0d3b971f46fbe77c072664c0f2dcd4471d
+Author: Peter Pearse <peter.pearse@arm.com>
+Date:  Sun Mar 30 11:23:05 2008 +0100
+
+    Add pmdra into MAKEALL
+
+    Signed-off-by: Peter Pearse <peter.pearse@arm.com>
+
+commit a574a73852a527779234e73e17e7597fd8128882
+Author: Pieter Voorthuijsen <[pieter.voorthuijsen@Prodrive.nl]>
+Date:  Sun Mar 30 11:21:58 2008 +0100
+
+    Adds support for the Prodrive PMDRA board, based on a DM6441
+
+    Signed-off-by: Pieter Voorthuijsen <pv@prodrive.nl>
+
+commit 1377b5583a48021d983e1fd565f7d40c89e84d63
+Author: Pieter Voorthuijsen <[pieter.voorthuijsen@Prodrive.nl]>
+Date:  Sun Mar 30 11:11:34 2008 +0100
+
+    Removes all board specific code from the arch. part for DM644x (DaVinci) boards
+
+    Signed-off-by: Pieter Voorthuijsen <pv@prodrive.nl>
+
+commit 1704dc20917b4f71e373e2c888497ee666d40380
+Author: Dirk Behme <dirk.behme@gmail.com>
+Date:  Sun Mar 30 11:09:01 2008 +0100
+
+    - Remove *_masked() functions as noted by Wolfgang
+    - Adapt register naming to recent TI spec (sprue26, March 2007)
+    - Fix reset_timer() handling
+    - As reported by Pieter [1] the overflow fix introduced a
+    delay of factor 16 (e.g 2 seconds became 32). While the
+    overflow fix is basically okay, it missed to divide udelay by
+    16, too. Fix this.
+    [1] http://article.gmane.org/gmane.comp.boot-loaders.u-boot/38179
+    - Remove software division of timer count value (DIV(x)
+    macro) and do it in hardware (TIM_CLK_DIV).
+    Many thanks to Troy Kisky <troy.kisky@boundarydevices.com>
+    and Pieter Voorthuijsen <pieter.voorthuijsen@Prodrive.nl> for
+    the hints & testing!
+
+    Signed-off-by: Dirk Behme <dirk.behme@gmail.com>
+
+    Acked-by: Pieter Voorthuijsen <pieter.voorthuijsen@Prodrive.nl>
+
+commit ac3315c26e143c31680750c9c13f027efbcc887e
+Author: Andre Schwarz <andre.schwarz@matrix-vision.de>
+Date:  Thu Mar 6 16:45:44 2008 +0100
+
+    new PHY @ e1000 - 2nd try
+
+    Add 82541ER device with latest integrated IGP2 PHY.
+    Introduced CONFIG_E1000_FALLBACK_MAC for NIC bring-up with empty eeprom.
+
+    Signed-off-by: Andre Schwarz <andre.schwarz@matrix-vision.de>
+    Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
+
+commit c2b7da552293b50c9c9e46ed71267b02c2de9ea8
+Author: Daniel Hellstrom <daniel@gaisler.com>
+Date:  Fri Mar 28 20:22:53 2008 +0100
+
+    SPARC/LEON3: Added GRETH Ethernet 10/100/1000 driver.
+
+    GRETH is an Ethernet 10/100 or 10/100/1000 MAC with out without
+    a debug link (EDCL). The GRETH core is documented in GRIP.pdf
+    available at www.gaisler.com.
+
+    If the GRETH has GigaBit support (GBIT, Scatter gather, checksum
+    offloading etc.) can be determined by a bit in the control register.
+    The GBIT MAC is supported by operating in GRTEH 10/100 legacy mode.
+
+    Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
+    Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
+
+commit 233a8bcd94997f3f345833a3b82e836222f2a206
+Author: Tsi-Chung Liew <Tsi-Chung.Liew@freescale.com>
+Date:  Mon Mar 17 17:08:22 2008 -0500
+
+    Add CONFIG_MII_INIT in cmd_mii.c
+
+    Provide common configuration in do_mii() to execute mii_init()
+    for all cpu architectures
+
+    Signed-off-by: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
+    Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
+
+commit f605479de2deb11e834f31dfdb0af107c86aced6
+Author: Tsi-Chung Liew <Tsi-Chung.Liew@freescale.com>
+Date:  Mon Mar 17 17:08:16 2008 -0500
+
+    ColdFire: Fix FEC transmit issue for MCF5275
+
+    Signed-off-by: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
+    Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
+
+commit d9a2f416d6ac6058cd7845033ae4dc32ef1c0746
+Author: Aras Vaichas <arasv@magtech.com.au>
+Date:  Wed Mar 26 09:43:57 2008 +1100
+
+    DHCP request fix for Windows Server 2003
+
+    Added option CONFIG_BOOTP_DHCP_REQUEST_DELAY. This provides an optional
+    delay before sending "DHCP Request" in net/bootp.c. Required to overcome
+    interoperability problems with Windows Server 200x DHCP server when U-Boot
+    client responds too fast for server to handle.
+
+    Signed-off-by: Aras Vaichas <arasv@magtech.com.au>
+    Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
+
+commit 97bf85d784fbed485e652eb907589ad0d5cb7262
+Author: Daniel Hellstrom <daniel@gaisler.com>
+Date:  Fri Mar 28 20:40:19 2008 +0100
+
+    MTD/CFI: flash_read64 is defined a weak function (for SPARC)
+
+    SPARC has implemented __raw_readq, it reads 64-bit from any 32-bit address.
+    SPARC CPUs implement flash_read64 which calls __raw_readq.
+
+    For current SPARC architectures (LEON2 and LEON3) each read from the
+    FLASH must lead to a cache miss. This is because FLASH can not be set
+    non-cacheable since program code resides there, and alternatively disabling
+    cache is poor from performance view, or doing a cache flush between each
+    read is even poorer.
+
+    Forcing a cache miss on a SPARC is done by a special instruction "lda" -
+    load alternative space, the alternative space number (ASI) is processor
+    implementation spcific and can be found by including <asm/processor.h>.
+
+    Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
+
+commit 70431e8a7393b6b793f77957f95b999fc9a269b8
+Author: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
+Date:  Fri Mar 28 15:41:25 2008 +0100
+
+    Make MPC83xx one step closer to full relocation.
+
+    Remove a few absolute references to CFG_MONITOR_BASE for ppc/mpc83xx
+    and use GOT relative reference.
+
+    Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
+    Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
+
+commit 5b2793a3f3de34d439232b05acc8af67a028fd35
+Author: Michael Barkowski <michael.barkowski@freescale.com>
+Date:  Thu Mar 27 14:34:43 2008 -0400
+
+    mpc8323erdb: fix EEPROM page size and get MAC from EEPROM
+
+    This patch fixes eeprom page size so that you can now write more than
+    64 bytes at a time.
+
+    It also makes the board take MAC addresses, if found, from EEPROM.
+
+    User should place up to 4 addresses at offset 0x7f00, for
+    eth{,1,2,3}addr.  Any unused addresses should be zero.  This group of
+    four six-byte values should have it's CRC at the end.  crc32 and
+    eeprom commands can be used to accomplish this.
+
+    If CRC fails, MAC addresses come from the environment.  If CRC
+    succeeds, the environment is overwritten at startup.
+
+    Signed-off-by: Michael Barkowski <michael.barkowski@freescale.com>
+    Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
+
+commit 8f325cff31f6e745e6540014b131b9a97f61944c
+Author: Michael Barkowski <michael.barkowski@freescale.com>
+Date:  Fri Mar 28 15:15:38 2008 -0400
+
+    mpc8323erdb: define CONFIG_PCI_SKIP_HOST_BRIDGE
+
+    Commit 55774b512fdf63c0516d441cc5da7c54bbffb7f2 broke the onboard USB
+    controller on the PCI bus in Linux on the MPC8323ERDB.
+
+    This fixes it by defining CONFIG_PCI_SKIP_HOST_BRIDGE in the board's
+    config file.
+
+    Signed-off-by: Michael Barkowski <michael.barkowski@freescale.com>
+    Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
+
+commit e5c4ade4db1e16d3e5d4a7887f34e10e516ed3a9
+Author: Kim Phillips <kim.phillips@freescale.com>
+Date:  Fri Mar 28 10:19:07 2008 -0500
+
+    mpc83xx: cleanup System Part and Revision ID Register (SPRIDR) code
+
+    in the spirit of commit 1ced121600b2060ab2ff9f0fddd9421fd70a0dc6,
+    85xx's "Update SVR numbers to expand support", simplify SPRIDR processing
+    and processor ID display.  Add REVID_{MAJ,MIN}OR macros to make
+    REVID dependent code simpler.  Also added PARTID_NO_E and IS_E_PROCESSOR
+    convenience macros.
+
+    Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
+
+commit 81fd52c6c8fd19f0b7856b98217ce37c46c521af
+Author: Kim Phillips <kim.phillips@freescale.com>
+Date:  Fri Mar 28 10:18:53 2008 -0500
+
+    mpc83xx: display ddr frequency in board_add_ram_info banner
+
+    Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
+
+commit 35cf155c5ec1ceab2849fa5b6aa3d9a3e9e6f482
+Author: Kim Phillips <kim.phillips@freescale.com>
+Date:  Fri Mar 28 10:18:40 2008 -0500
+
+    mpc83xx: unreinvent mem_clk
+
+    delete ddr_clk and use mem_clk instead.  Rename other ddr_*_clk to
+    mem_*_clk for consistency's sake.
+
+    Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
+
+commit 730e792926ca3fe4dd1b734a3bf44e55afa6f536
+Author: Kim Phillips <kim.phillips@freescale.com>
+Date:  Fri Mar 28 14:31:23 2008 -0500
+
+    mpc83xx: enable the SATA interface on mpc8315 rdb and mpc837x rdb boards
+
+    Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
+
+commit 2eeb3e4fc54ef2f5d574dafd42c6ce93afa30393
+Author: Dave Liu <r63238@freescale.com>
+Date:  Wed Mar 26 22:57:19 2008 +0800
+
+    mpc83xx: enable the SATA interface on mpc837xemds board
+
+    Enable the first two SATA interfaces on MPC837xEMDS board,
+    The two SATA ports are on LYNX1. (SATA0/1 on J4/5)
+
+    Signed-off-by: Dave Liu <daveliu@freescale.com>
+    Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
+
+commit 6f8c85e8d1865730c158d9ef5a06c70c3a10600a
+Author: Dave Liu <r63238@freescale.com>
+Date:  Wed Mar 26 22:56:36 2008 +0800
+
+    mpc83xx: initialize serdes for MPC837xEMDS boards
+
+    This patch is stolen from Anton Vorontsov's patch
+    for mpc837xerdb boards.
+
+    The reference clk and xcorevdd voltage of serdes1/2
+    is same between mpc837xemds and mpc837xerdb.
+
+    8377E: LYNX1- 2 SATA       LYNX2- 2 PCIE
+    8378E: LYNX1- 2 SGMII      LYNX2- 2 PCIE
+    8379E: LYNX1- 2 SATA       LYNX2- 2 SATA
+
+    Signed-off-by: Dave Liu <daveliu@freescale.com>
+    Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
+
+commit cc8e839abc80887ae832767b5930d40edd6d7eb7
+Author: Stefan Roese <sr@denx.de>
+Date:  Fri Mar 28 14:09:04 2008 +0100
+
+    ppc4xx: Canyonlands: Print SATA/PCIe configuration and board revision
+
+    Canyonlands (460EX) shares the first PCIe interface with the SoC SATA
+    interface. This usage can be configured with the jumper J6. This patch
+    displays the current configuration upon bootup and changes the PCIe
+    init loop, to only initialize the availabel PCIe slots.
+
+    Signed-off-by: Stefan Roese <sr@denx.de>
+
+commit 90447ecbbac8572457b6d8903073ac3f120995ba
+Author: Tor Krill <tor@excito.com>
+Date:  Fri Mar 28 11:29:10 2008 +0100
+
+    MTD/CFI: Add support for 16bit legacy AMD flash
+
+    Add entry for 512Kx16 AMD flash to jedec_table.
+    Read out 16bit device id if chipwidth is 16bit.
+    Fixed coding style after Stefans feedback
+
+    Signed-off-by: Tor Krill <tor@excito.com>
+
+commit 5e12e75d17c4b15a310a45cd78fe71b7698a8a8e
+Author: Stefan Roese <sr@denx.de>
+Date:  Fri Mar 28 11:02:53 2008 +0100
+
+    ppc: Small change to CFG_MEM_TOP_HIDE description
+
+    Signed-off-by: Stefan Roese <sr@denx.de>
+
+commit 280df59a8d62c6e74c281b1cb7e2052df4d6cb00
+Author: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+Date:  Thu Mar 27 15:44:12 2008 +0900
+
+    sh: Add support stat structure and stat.h
+
+    Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+
+commit 4be9eb789e72b845d6693cc36b70a0b3529b3f09
+Author: Mark Jonas <toertel@gmail.com>
+Date:  Sat Mar 22 19:27:52 2008 +0100
+
+    sh: Removed warning when compiling drivers/serial/serial_sh.c.
+
+    Signed-off-by: Mark Jonas <mark.jonas@de.bosch.com>
+    Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+
+commit f309fa38929ffba71230c02330ffa42f4bba6333
+Author: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+Date:  Wed Mar 12 18:02:57 2008 +0900
+
+    sh: Remove disable_ctrlc function from R7780MP
+
+    Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+
+commit 6f4b266ff2a4fcc2bff985d6a217852469afddb3
+Author: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+Date:  Wed Mar 12 17:55:15 2008 +0900
+
+    sh: Add maintainer of R7780MP to MAINTAINER file
+
+    Update MAINTAINER entry for R7780MP. And fix maintainer's name.
+
+    Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+
+commit f5e2466f7baa887a7df0c536333eea8231333497
+Author: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+Date:  Tue Mar 25 17:11:24 2008 +0900
+
+    sh: Add support Renesas Solutions R2D plus board
+
+    R2D plus is SH reference board used with SH7751R.
+    This board has 266Mhz CPU, 64MB SDRAM, Cardbus, CF interface,
+    one PCI bus, VGA, and two Ethernet controller.
+
+    Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+
+commit e92c95180bb5bc5fd4051598a9d60beaba48988d
+Author: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+Date:  Wed Mar 12 12:15:29 2008 +0900
+
+    sh: Add support SH4 cache control
+
+    Add support SH4 cache control and flash_cache function
+
+    Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+
+commit 28e5efde4d925fcb34901d0030d0648de2da7e89
+Author: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+Date:  Mon Mar 24 01:53:01 2008 +0900
+
+    sh: Add support PCI host driver for SH7751/SH7751R
+
+    Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+
+commit ab8f4d40d069cd3cbe7563ddfe3e5f03b0c7c721
+Author: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+Date:  Mon Mar 24 02:11:26 2008 +0900
+
+    sh: Move SuperH PCI driver from cpu/sh4 to drivers/pci
+
+    Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+
+commit 566933278101c144d75361ea682678a326c1290d
+Author: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+Date:  Wed Mar 12 12:10:28 2008 +0900
+
+    sh: Add support SuperH SH7751/SH7751R
+
+    Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+
+commit 3313e0e26224fc9a0c445124f3455058c696df84
+Author: Mark Jonas <toertel@gmail.com>
+Date:  Mon Mar 10 11:37:10 2008 +0100
+
+    sh: Added support for SH7720 based board MPR2.
+
+    Signed-off-by: Mark Jonas <mark.jonas@de.bosch.com>
+    Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+
+commit 3ecff1d70ae93e628fe65b3fe1fc7c9c76cdf99f
+Author: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+Date:  Thu Mar 6 14:05:53 2008 +0900
+
+    sh: Fix receive FIFO level register of SH4A
+
+    Receive FIFO level register is different in SH4A.
+    Because register is different, cannot occasionally receive data.
+
+    Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+
+commit c133c1fb0b590662206b0eba70f4478ee0300a9a
+Author: Yusuke Goda <goda.yusuke@renesas.com>
+Date:  Tue Mar 11 12:55:12 2008 +0900
+
+    sh: Add support Renesas Solutions R7780MP
+
+    Renesas Solutions R7780MP is a reference board on SH7780.
+    This board has serial, 10/100 base Ethernet deivice, CF slot
+    and VGA devices. This board can set extension board.
+    Extension board has 10/100/1000 base Ethernet device, PCI slot,
+    S-ATA, iDVR slot.
+
+    Signed-off-by: Yusuke Goda <goda.yusuke@renesas.com>
+    Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+
+commit 1a2334a4eb6386d7cd35d9de5fa39af2c764ad28
+Author: Yusuke Goda <goda.yusuke@renesas.com>
+Date:  Wed Mar 5 14:30:02 2008 +0900
+
+    sh: Add support PCI of SuperH and SH7780
+
+    This patch add support PCI of SuperH base code and SH7780 specific code.
+
+    Signed-off-by: Yusuke Goda <goda.yusuke@renesas.com>
+    Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+
+commit b55523efff2ae11f0b9ae3cc405893c32eb78156
+Author: Yusuke Goda <goda.yusuke@renesas.com>
+Date:  Wed Mar 5 14:23:26 2008 +0900
+
+    sh: Add support SH7780
+
+    SH7780 is CPU of Renesas Technology.
+    This CPU has
+     - CPU clock 400MHz
+     - PCI support
+     - DDR-SDRAM controller
+     - etc ...
+
+    Signed-off-by: Yusuke Goda <goda.yusuke@renesas.com>
+    Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+
+commit c2042f5952a686c414031309b8f244513bf578f0
+Author: goda.yusuke <goda.yusuke@renesas.com>
+Date:  Fri Jan 25 20:46:36 2008 +0900
+
+    sh: Add support Renesas Solutions Migo-R board
+
+    Migo-R is a board based on SH7722 and has may devices.
+    In this patch, supported SCIF, NOR flash and Ethernet.
+
+    Signed-off-by: Yusuke Goda <goda.yusuke@renesas.com>
+    Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+
+commit 74d1e66d22dac91388bc538b2fe19f735edc5b82
+Author: Bartlomiej Sieka <tur@semihalf.com>
+Date:  Thu Mar 27 15:06:40 2008 +0100
+
+    Fix host tool build breakage, take two
+
+    Revert commit 87c8431f and fix build breakage so that the build continues
+    to work on FC systems.
+
+    Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>
+
+commit 7e4a0d25ed18f6437bdf59ebfa49bb0edc2f24e6
+Author: Stefan Roese <sr@denx.de>
+Date:  Wed Mar 19 09:36:47 2008 +0100
+
+    ppc4xx: Enable ECC on LWMON5
+
+    Since all ECC related problems seem to be resolved on LWMON5, this patch
+    now enables ECC support.
+
+    We have to write the ECC bytes by zeroing and flushing in smaller
+    steps, since the whole 256MByte takes too long for the external
+    watchdog.
+
+    Signed-off-by: Stefan Roese <sr@denx.de>
+
+commit 6433fa202a91a6594dd48f06807ac38ba27fa0bb
+Author: Larry Johnson <lrj@acm.org>
+Date:  Mon Mar 17 11:10:35 2008 -0500
+
+    ppc4xx: Updates to Korat-specific code
+
+    This patch contains updates for changes for the Korat PPC440EPx board.
+    These changes include:
+
+    (1) Support for "permanent" and "upgradable" copies of U-Boot, as
+    described in the new "doc/README.korat" file;
+
+    (2) a new memory map for the registers in the board's CPLD;
+
+    (3) a revised format for manufacturer's data in serial EEPROM; and
+
+    (4) changes to track updates to U-Boot for the Sequoia board.
+
+    Signed-off-by: Larry Johnson <lrj@acm.org>
+
+commit f766cdf89b3a2a7634b8c5869f606150e332036c
+Author: Markus Brunner <super.firetwister@gmail.com>
+Date:  Thu Mar 27 10:46:25 2008 +0100
+
+    ppc4xx: PPC405EP Set EMAC noise filter bits
+
+    This bug was introduced with commit aee747f19b460a0e9da20ff21e90fdaac1cec359
+    which enabled CFG_4xx_GPIO_TABLE for PPC405 and unintentionally
+    disabled the setting of the emac noise filter bits for PPC405EP when CFG_4xx_GPIO_TABLE is set.
+
+    Signed-off-by: Markus Brunner <super.firetwister@gmail.com>
+    Signed-off-by: Stefan Roese <sr@denx.de>
+
+commit f66e2c8b25c04b79e5fb385bc8989c2de7f63991
+Author: Mike Nuss <mike@terascala.com>
+Date:  Wed Feb 20 11:54:20 2008 -0500
+
+    ppc4xx: Reconfigure PLL for 667MHz processor for PPC440EPx
+
+    On PPC440EPx without a bootstrap I2C EEPROM, the PLL can be reconfigured
+    after startup to change the speed of the clocks. This patch adds the
+    option CFG_PLL_RECONFIG. If this option is set to 667, the CPU
+    initialization code will reconfigure the PLL to run the system with a CPU
+    frequency of 667MHz and PLB frequency of 166MHz, without the need for an
+    external EEPROM.
+
+    Signed-off-by: Mike Nuss <mike@terascala.com>
+    Acked-by: Stefan Roese <sr@denx.de>
+
+commit 87c8431fe24d48121f053fe67cff4ccfe097d4d1
+Author: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
+Date:  Thu Mar 27 09:12:40 2008 +0100
+
+    new-image: Fix host tool build breakage
+
+    Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
+
+commit 6fb4b640562a10daff0dbe537638d511b5b48650
+Author: Stefan Roese <sr@denx.de>
+Date:  Thu Mar 27 10:24:03 2008 +0100
+
+    ppc: Set CFG_MEM_TOP_HIDE to 0 if not already defined
+
+    Signed-off-by: Stefan Roese <sr@denx.de>
+
+commit 9462732a3ec551c11862450902cd8ee1bedea6d9
+Author: Stefan Roese <sr@denx.de>
+Date:  Wed Mar 19 10:23:43 2008 +0100
+
+    ppc4xx: Add fdt support to Prodrive alpr
+
+    Since this board will probably be ported to arch/powerpc in the
+    near future, we add device tree support now. This way we are
+    "ready" for arch/powerpc from now on.
+
+    Signed-off-by: Stefan Roese <sr@denx.de>
+
+commit 511e4f9e7f7b6719e4d91d7f0fc89412b13b5150
+Author: Pieter Voorthuijsen <pieter.voorthuijsen@prodrive.nl>
+Date:  Mon Mar 17 09:27:56 2008 +0100
+
+    ppc4xx: Enable cache support on the ALPR board
+
+    Signed-off-by: Pieter Voorthuijsen <pv@prodrive.nl>
+
+commit 14f73ca679f6fdb44cff0b7304d419db41a0ab69
+Author: Stefan Roese <sr@denx.de>
+Date:  Wed Mar 26 10:14:11 2008 +0100
+
+    ppc: Add CFG_MEM_TOP_HIDE option to hide memory area that doesn't get "touched"
+
+    If CFG_MEM_TOP_HIDE is defined in the board config header, this specified
+    memory area will get subtracted from the top (end) of ram and won't get
+    "touched" at all by U-Boot. By fixing up gd->ram_size the Linux kernel
+    should gets passed the now "corrected" memory size and won't touch it
+    either. This should work for arch/ppc and arch/powerpc. Only Linux board
+    ports in arch/powerpc with bootwrapper support, which recalculate the
+    memory size from the SDRAM controller setup, will have to get fixed
+    in Linux additionally.
+
+    This patch enables this config option on some PPC440EPx boards as a workaround
+    for the CHIP 11 errata. Here the description from the AMCC documentation:
+
+    CHIP_11: End of memory range area restricted access.
+    Category: 3
+
+    Overview:
+    The 440EPx DDR controller does not acknowledge any
+    transaction which is determined to be crossing over the
+    end-of-memory-range boundary, even if the starting address is
+    within valid memory space. Any such transaction from any PLB4
+    master will result in a PLB time-out on PLB4 bus.
+
+    Impact:
+    In case of such misaligned bursts, PLB4 masters will not
+    retrieve any data at all, just the available data up to the
+    end of memory, especially the 440 CPU. For example, if a CPU
+    instruction required an operand located in memory within the
+    last 7 words of memory, the DCU master would burst read 8
+    words to update the data cache and cross over the
+    end-of-memory-range boundary. Such a DCU read would not be
+    answered by the DDR controller, resulting in a PLB4 time-out
+    and ultimately in a Machine Check interrupt. The data would
+    be inaccessible to the CPU.
+
+    Workaround:
+    Forbid any application to access the last 256 bytes of DDR
+    memory. For example, make your operating system believe that
+    the last 256 bytes of DDR memory are absent. AMCC has a patch
+    that does this, available for Linux.
+
+    This patch sets CFG_MEM_TOP_HIDE for the following 440EPx boards:
+    lwmon5, korat, sequoia
+
+    The other remaining 440EPx board were intentionally not included
+    since it is not clear to me, if they use the end of ram for some
+    other purpose. This is unclear, since these boards have CONFIG_PRAM
+    defined and even comments like this:
+
+    PMC440.h:
+    /* esd expects pram at end of physical memory.
+     * So no logbuffer at the moment.
+     */
+
+    It is strongly recommended to not use the last 256 bytes on those
+    boards too. Patches from the board maintainers are welcome.
+
+    Signed-off-by: Stefan Roese <sr@denx.de>
+
+commit c664bf8c3c9bb9e236891f0d8dfda883e86d159b
+Author: Stefan Roese <sr@denx.de>
+Date:  Thu Mar 27 10:09:05 2008 +0100
+
+    ppc4xx: Fix Canyonlands linker script (remove bogus ASSERT)
+
+    Signed-off-by: Stefan Roese <sr@denx.de>
+
+commit d56a3ce179688cde61073a3690e21703d68fafd7
+Author: Stefan Roese <sr@denx.de>
+Date:  Tue Mar 25 17:51:13 2008 +0100
+
+    ppc4xx: Correctly pass phyiscal FLASH base address into dtb
+
+    The routine ft_board_setup() configures the EBC NOR mappings for the
+    Linux physmap_of driver. Since on 460EX/GT we remap the FLASH from
+    0x4.fc00.0000 to 0x4.cc00.0000 because of the max. 16MByte boot-CS
+    problem, we need to pass the corrected address here too.
+
+    Signed-off-by: Stefan Roese <sr@denx.de>
+
+commit 9ad31989de12ce5c67b07c4867ead47465655c4b
+Author: Stefan Roese <sr@denx.de>
+Date:  Wed Mar 19 16:35:12 2008 +0100
+
+    ppc4xx: Fix compilation warning in 4xx_enet.c
+
+    Signed-off-by: Stefan Roese <sr@denx.de>
+
+commit 4c9e855734c523900322a7c3cdd9099b4f51b51d
+Author: Stefan Roese <sr@denx.de>
+Date:  Wed Mar 19 16:20:49 2008 +0100
+
+    ppc4xx: Add AMCC Glacier 406GT eval board support
+
+    This patch adds support for the AMCC Glacier 460GT eval board.
+    The main difference to the Canyonlands board are listed here:
+
+    - 4 ethernet ports instead of 2
+    - no SATA port
+    - no USB port
+
+    Currently EMAC2+3 are not working. This will be fixed in a later
+    release.
+
+    Signed-off-by: Stefan Roese <sr@denx.de>
+
+commit d8bd643141af4710d7f1b69bbab6b760de0af0a1
+Author: Stefan Roese <sr@denx.de>
+Date:  Thu Mar 27 08:47:26 2008 +0100
+
+    ppc4xx: Mask 'vec' with 0x1f in uic_interrupt() for bit set/clear
+
+    Signed-off-by: Stefan Roese <sr@denx.de>
+
+commit b9670dd85be6e0496ef2e231043c23cad9b1d903
+Author: Anatolij Gustschin <agust@denx.de>
+Date:  Wed Mar 26 21:05:43 2008 +0100
+
+    Fix out of tree building issue
+
+    Currently U-Boot building in some external directory
+    doesn't work. This patch tries to fix the problem.
+
+    Signed-off-by: Anatolij Gustschin <agust@denx.de>
+
+commit d4ee711d8a5c366ee3f857c26b927d12e66614ff
+Author: Anatolij Gustschin <agust@denx.de>
+Date:  Wed Mar 26 18:13:33 2008 +0100
+
+    README: update documentation (availability, links, etc.)
+
+    Fix typo in README
+
+    Signed-off-by: Anatolij Gustschin <agust@denx.de>
+
+commit e813eae3bfeba9c0bda9d1bf9fc3d081f790972f
+Author: Anatolij Gustschin <agust@denx.de>
+Date:  Wed Mar 26 17:47:44 2008 +0100
+
+    Fix compilation error in cmd_usb.c
+
+    This patch fixes compilation error
+    cmd_usb.c: In function 'do_usb':
+    cmd_usb.c:552: error: void value not ignored as it ought to be
+
+    Signed-off-by: Anatolij Gustschin <agust@denx.de>
+
+commit d8c82db482d6b535d12b419d6440b88bf7091c9b
+Author: Timur Tabi <timur@freescale.com>
+Date:  Fri Mar 14 17:45:29 2008 -0500
+
+    Add support for setting the I2C bus speed in fsl_i2c.c
+
+    Add support to the Freescale I2C driver (fsl_i2c.c) for setting and querying
+    the I2C bus speed. Current 8[356]xx boards define the CFG_I2C_SPEED macro,
+    but fsl_i2c.c ignores it and uses conservative value when programming the
+    I2C bus speed.
+
+    Signed-off-by: Timur Tabi <timur@freescale.com>
+    Acked-by: Andy Fleming <afleming@freescale.com>
+
+commit d049cc7f71c0d875e8f5099d1ed23666a82b8f8e
+Author: Wolfgang Denk <wd@denx.de>
+Date:  Thu Mar 27 00:03:57 2008 +0100
+
+    Coding style cleanup, update CHANGELOG
+
+    Signed-off-by: Wolfgang Denk <wd@denx.de>
+
+commit fd0b1fe3c388a77e8fe00cdd930ca317a91198d4
+Author: Dave Liu <r63238@freescale.com>
+Date:  Wed Mar 26 22:55:32 2008 +0800
+
+    drivers: add the support for Freescale SATA controller
+
+    Add the Freescale on-chip SATA controller driver to u-boot,
+    The SATA controller is used on the 837x and 8315 targets,
+    The driver can be used to load kernel, fs and dtb.
+
+    The features list:
+    - 1.5/3 Gbps link speed
+    - LBA48, LBA28 support
+    - DMA and FPDMA support
+    - Two ports support
+
+    Signed-off-by: Dave Liu <daveliu@freescale.com>
+
+commit bede87f4c87c3ccd868cc60ebf792e0560c6d024
+Author: Dave Liu <r63238@freescale.com>
+Date:  Wed Mar 26 22:54:44 2008 +0800
+
+    ata: add the readme for SATA command line
+
+    Signed-off-by: Dave Liu <daveliu@freescale.com>
+
+commit cd54081cd479e542fc399b8a40651ff11a1ad849
+Author: Dave Liu <r63238@freescale.com>
+Date:  Wed Mar 26 22:53:24 2008 +0800
+
+    ata: enable the sata initialize on boot up
+
+    Signed-off-by: Dave Liu <daveliu@freescale.com>
+
+commit 69386383c5c2b323c66495b0b0cef6a9714d83bf
+Author: Dave Liu <r63238@freescale.com>
+Date:  Wed Mar 26 22:52:36 2008 +0800
+
+    ata: add the fis struct for SATA
+
+    Signed-off-by: Dave Liu <daveliu@freescale.com>
+
+commit ffc664e80dfb2e17de0df5ad39e91a02e9c361bc
+Author: Dave Liu <r63238@freescale.com>
+Date:  Wed Mar 26 22:51:44 2008 +0800
+
+    ata: add the libata support
+
+    add simple libata support in u-boot
+
+    Signed-off-by: Dave Liu <daveliu@freescale.com>
+
+commit 8e9bb43429e50df55fa41932cbe65841ff579220
+Author: Dave Liu <r63238@freescale.com>
+Date:  Wed Mar 26 22:50:45 2008 +0800
+
+    ata: make the ata_piix driver using new SATA framework
+
+    original ata_piix driver is using IDE framework, not real
+    SATA framework. For now, the ata_piix driver is only used
+    by x86 sc520_cdp board. This patch makes the ata_piix driver
+    use the new SATA framework, so
+
+    - remove the duplicated command stuff
+    - remove the CONFIG_CMD_IDE define in the sc520_cdp.h
+    - add the CONFIG_CMD_SATA define to sc520_cdp.h
+
+    Signed-off-by: Dave Liu <daveliu@freescale.com>
+
+commit c7057b529c3c3cb9c0ac9060686a4068f1491bbe
+Author: Dave Liu <r63238@freescale.com>
+Date:  Wed Mar 26 22:49:44 2008 +0800
+
+    ata: add the support for SATA framework
+
+    - add the SATA framework
+    - add the SATA command line
+
+    Signed-off-by: Dave Liu <daveliu@freescale.com>
+
+commit 83c7f470a4ce94f33600f11ae85ce4dcf00aa90c
+Author: Dave Liu <r63238@freescale.com>
+Date:  Wed Mar 26 22:48:18 2008 +0800
+
+    ata: merge the header of ata_piix driver
+
+    move the sata.h from include/ to drivers/block/ata_piix.h
+
+    Signed-off-by: Dave Liu <daveliu@freescale.com>
+
+commit 9eef62804d9695425b24c87b46a61a7fa74afee0
+Author: Dave Liu <r63238@freescale.com>
+Date:  Wed Mar 26 22:47:06 2008 +0800
+
+    ata: merge the ata_piix driver
+
+    move the cmd_sata.c from common/ to drivers/ata_piix.c,
+    the cmd_sata.c have some part of ata_piix controller drivers.
+    consolidate the driver to have better framework.
+
+    Signed-off-by: Dave Liu <daveliu@freescale.com>
+
+commit b9e749e95354f33eb5dc6653c6db7d502adb95fe
+Author: Markus Klotzbuecher <mk@denx.de>
+Date:  Wed Mar 26 18:26:43 2008 +0100
+
+    USB, Storage: fix a bug introduced in commit
+    f6b44e0e4d18fe507833a0f76d24a9aa72c123f1 that will cause usb_stor_info
+    to only print only information on one storage device, but not for
+    multiple.
+
+    Signed-off-by: Markus Klotzbuecher <mk@denx.de>
+
+commit 841e5edd1623f3fecb6bffc5c2f938ed7a947360
+Author: Anatolij Gustschin <agust@denx.de>
+Date:  Wed Mar 26 17:47:44 2008 +0100
+
+    Fix compilation error in cmd_usb.c
+
+    This patch fixes compilation error
+    cmd_usb.c: In function 'do_usb':
+    cmd_usb.c:552: error: void value not ignored as it ought to be
+
+    Signed-off-by: Anatolij Gustschin <agust@denx.de>
+    Signed-off-by: Markus Klotzbuecher <mk@denx.de>
+
+commit dd6c910aadf27c822f17b87eae1a9bd0b2e3aa15
+Author: Kumar Gala <galak@kernel.crashing.org>
+Date:  Wed Mar 26 08:53:53 2008 -0500
+
+    85xx: Add cpu_mp_lmb_reserve helper to reserve boot page
+
+    Provide a board_lmb_reserve helper function to ensure we reserve
+    the page of memory we are using for the boot page translation code.
+
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+
+commit 79679d80021ab095e639e250ca472fe526da02e2
+Author: Kumar Gala <galak@kernel.crashing.org>
+Date:  Wed Mar 26 08:34:25 2008 -0500
+
+    85xx: Update multicore boot mechanism to ePAPR v0.81 spec
+
+    The following changes are needed to be inline with ePAPR v0.81:
+
+    * r4, r5 and now always set to 0 on boot release
+    * r7 is used to pass the size of the initial map area (IMA)
+    * EPAPR_MAGIC value changed for book-e processors
+    * changes in the spin table layout
+    * spin table supports a 64-bit physical release address
+
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+
+commit 25eedb2c1958a13110c7de1fc809b624053cc69c
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Wed Mar 19 15:02:07 2008 -0500
+
+    FSL: Clean up board/freescale/common/Makefile
+
+    Each file that can be built here now follows some
+    CONFIG_ option so that they are appropriately built
+    or not, as needed. And CONFIG_ defines were added
+    to various board config files to make sure that happens.
+
+    The other board/freescale/*/Makefiles no longer need
+    to reach up and over into ../common to build their
+    individually needed files any more.
+
+    Boards that are CDS specific were renamed with cds_ prefix.
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit a5af4b358a7caa9c0aa374d4d894bf762ec37669
+Author: Kumar Gala <galak@kernel.crashing.org>
+Date:  Wed Feb 27 22:00:27 2008 -0600
+
+    85xx: Fix merge duplication
+
+    ft_fixup_cpu() got duplicated in some merge snafu. Remove the duplicate.
+
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+
+commit 5893b3d0a4084f87a06a5d3dc03db91206818941
+Author: James Yang <James.Yang@freescale.com>
+Date:  Tue Feb 12 16:35:07 2008 -0600
+
+    85xx: Expand CCSR space with more DDR controller registers.
+
+    Signed-off-by: James Yang <James.Yang@freescale.com>
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+
+commit a3e77fa5359b3f9f59e4e946b46d57a53057cc85
+Author: James Yang <James.Yang@freescale.com>
+Date:  Fri Feb 8 18:05:08 2008 -0600
+
+    85xx: Speed up get_ddr_freq() and get_bus_freq()
+
+    get_ddr_freq() and get_bus_freq() used get_sys_info() each time they were
+    called.  However, get_sys_info() recalculates extraneous information when
+    called each time.  Have get_ddr_freq() and get_bus_freq() return memoized
+    values from global_data instead.
+
+    Signed-off-by: James Yang <James.Yang@freescale.com>
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+
+commit e9ea679918fbc9a53fa2f2a904aac874ea736036
+Author: James Yang <James.Yang@freescale.com>
+Date:  Fri Feb 8 16:46:27 2008 -0600
+
+    85xx: Show DDR memory data rate in addition to the memory clock frequency.
+
+    Show the DDR memory data rate in addition to the memory clock
+    frequency. For DDR/DDR2 memories the memory data rate is 2x the
+    memory clock.
+
+    Signed-off-by: James Yang <James.Yang@freescale.com>
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+
+commit 591933ca6eabc440e6ed6967233aaf56fce464a3
+Author: James Yang <James.Yang@freescale.com>
+Date:  Fri Feb 8 16:44:53 2008 -0600
+
+    85xx: get_tbclk() speed up and rounding fix
+
+    Speed up get_tbclk() by referencing pre-computed bus clock
+    frequency value from global data instead of sys_info_t.  Fix
+    rounding of result to nearest; previously it was rounding
+    upwards.
+
+    Signed-off-by: James Yang <James.Yang@freescale.com>
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+
+commit 1ced121600b2060ab2ff9f0fddd9421fd70a0dc6
+Author: Andy Fleming <afleming@freescale.com>
+Date:  Wed Feb 6 01:19:40 2008 -0600
+
+    Update SVR numbers to expand support
+
+    FSL has taken to using SVR[16:23] as an SOC sub-version field.  This
+    is used to distinguish certain variants within an SOC family.  To
+    account for this, we add the SVR_SOC_VER() macro, and update the SVR_*
+    constants to reflect the larger value.  We also add SVR numbers for all
+    of the current variants.  Finally, to make things neater, rather than
+    use an enormous switch statement to print out the CPU type, we create
+    and array of SVR/name pairs (using a macro), and print out the CPU name
+    that matches the SVR SOC version.
+
+    Signed-off-by: Andy Fleming <afleming@freescale.com>
+
+commit b83eef440cf3cef816172ccbb5897ccd8e403cf3
+Author: Andy Fleming <afleming@freescale.com>
+Date:  Wed Feb 6 01:12:57 2008 -0600
+
+    Add the Freescale PCI device IDs
+
+    Signed-off-by: Andy Fleming <afleming@freescale.com>
+
+commit 7aff0c051ad0613171cf2b9941ee48675c62e7cd
+Author: Kumar Gala <galak@kernel.crashing.org>
+Date:  Thu Feb 14 11:04:23 2008 -0600
+
+    85xx: Added support for multicore boot mechanism
+
+    Added the cpu command that provides a generic mechanism to get status,
+    reset, and release secondary cores in multicore processors.
+
+    Added support for using the ePAPR defined spin-table mechanism on 85xx.
+
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+    Signed-off-by: Andy Fleming <afleming@freescale.com>
+
+commit ec2b74ffd36f02c6123725e7c2533dd2deaf4b64
+Author: Kumar Gala <galak@kernel.crashing.org>
+Date:  Thu Jan 17 16:48:33 2008 -0600
+
+    85xx: Added support for multicore boot mechanism
+
+    Added the cpu command that provides a generic mechanism to get status,
+    reset, and release secondary cores in multicore processors.
+
+    Added support for using the ePAPR defined spin-table mechanism on 85xx.
+
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+
+commit f69766e4b5d47ecd3aa58677a8da875694f364f2
+Author: Kumar Gala <galak@kernel.crashing.org>
+Date:  Wed Jan 30 14:55:14 2008 -0600
+
+    85xx: Add the concept of CFG_CCSRBAR_PHYS
+
+    When we go to 36-bit physical addresses we need to keep the concept of
+    the physical CCSRBAR address seperate from the virtual one.
+
+    For the majority of boards CFG_CCSBAR_PHYS == CFG_CCSRBAR
+
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+
+commit 5b5eb9ca5b778f763bcf332697b35cc1e747626e
+Author: Wolfgang Denk <wd@denx.de>
+Date:  Wed Mar 26 15:38:47 2008 +0100
+
+    Coding style cleanup.
+
+    Signed-off-by: Wolfgang Denk <wd@denx.de>
+
+commit da8808df7a9cef5a3d2ee286ef9ebf9de1780660
+Author: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
+Date:  Wed Mar 26 13:02:13 2008 +0100
+
+    Add CFG_RTC_DS1337_NOOSC to turn off OSC output
+
+    The default settings for RTC DS1337 keeps the OSC
+    output, 32,768 Hz, on. This add CFG_RTC_DS1337_NOOSC to
+    turn it off.
+
+    Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
+
+commit 438a4c11260b4ea9805039b0b4f92f9df5306b02
+Author: Wolfgang Denk <wd@denx.de>
+Date:  Wed Mar 26 11:48:46 2008 +0100
+
+    Cleanup coding style, update CHANGELOG
+
+    Signed-off-by: Wolfgang Denk <wd@denx.de>
+
+commit 218ca724c08ca8a649f0917cf201cf23d4b33f39
+Author: Wolfgang Denk <wd@denx.de>
+Date:  Wed Mar 26 10:40:12 2008 +0100
+
+    README: update documentation (availability, links, etc.)
+
+    Signed-off-by: Wolfgang Denk <wd@denx.de>
+
+commit f6b44e0e4d18fe507833a0f76d24a9aa72c123f1
+Author: Aras Vaichas <arasv@magtech.com.au>
+Date:  Tue Mar 25 12:09:07 2008 +1100
+
+    USB Storage, add meaningful return value
+
+    This patch changes the "usb storage" command to return success if it
+    finds a USB storage device, otherwise it returns error.
+
+    Signed-off-by: Markus Klotzbuecher <mk@denx.de>
+
+commit 18e69a35efbb078403db0c0063986470dad7d082
+Author: Anton Vorontsov <avorontsov@ru.mvista.com>
+Date:  Fri Mar 14 23:20:18 2008 +0300
+
+    83xx/fdt_support: let user specifiy FSL USB Dual-Role controller role
+
+    Linux understands "host" (default), "peripheral" and "otg" (broken).
+    Though, U-Boot doesn't restrict dr_mode variable to these values (think
+    of renames in future).
+
+    Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
+    Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
+
+commit c7604783b236e368f225efb7b3efb418fe20b404
+Author: Anton Vorontsov <avorontsov@ru.mvista.com>
+Date:  Fri Mar 14 23:20:30 2008 +0300
+
+    tsec: fix link detection for the RTL8211B PHY
+
+    RTL8211B sets link state register after autonegotiation complete,
+    so with bootdelay=0 RTL8211B will report lack of the link.
+
+    To fix this, we should wait for aneg to complete, even if the
+    link is currently down.
+
+    Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
+    Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
+
+commit 7fa9cbb00dc83fcf175042b6f20c2c9bce9a15f4
+Author: Anton Vorontsov <avorontsov@ru.mvista.com>
+Date:  Mon Mar 24 20:47:09 2008 +0300
+
+    mpc83xx: add "fsl,soc" and "fsl,immr" compatible fixups
+
+    device_type = "soc" is being deprecated, newer device trees will use
+    "fsl,soc" and/or "fsl,immr" for the soc nodes.
+
+    This patch also adds clock-frequency property for soc nodes (the same
+    value as bus-frequency).
+
+    Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
+
+commit 507e2d79c91441a0bb2cd3d0c31c8bfe3f8cec07
+Author: Joe D'Abbraccio <ljd015@freescale.com>
+Date:  Mon Mar 24 13:00:59 2008 -0400
+
+    Modified the DDR SDRAM clock control register to delay MCK/MCK_B 3/4 clock
+
+    With the original value of 1/2 clock cycle delay, the system ran relatively
+    stable except when we run benchmarks that are intensive users of memory.
+    When I run samba connected disk with a HDBENCH test, the system locks-up
+    or reboots sporadically.
+
+    Signed-off by: Joe D'Abbraccio <Joe.D'abbraccio@freescale.com>
+
+commit a7ba32d480a86db5db8dcd8ca66b21b4cadda923
+Author: Scott Wood <scottwood@freescale.com>
+Date:  Mon Mar 24 12:44:13 2008 -0500
+
+    mpc83xx: Set PCI I/O bus-address base to zero.
+
+    The device trees for these boards describe PCI I/O as starting from
+    address zero from the device's perspective.
+
+    Placing I/O elsewhere may cause problems with certain PCI boards, and may
+    cause problems with Linux.
+
+    Signed-off-by: Scott Wood <scottwood@freescale.com>
+
+commit f700e7df7fecf2d3765ae568ce77ce788cde4f3e
+Author: Anton Vorontsov <avorontsov@ru.mvista.com>
+Date:  Mon Mar 24 20:47:05 2008 +0300
+
+    mpc83xx: MPC8360E-RDK: use 33.3(3)MHz CLKIN/SYS_CLK
+
+    At least on the "33MHz Pilot" board crystal is actually 33.3MHz.
+    This patch fixes "system time drifting" problem.
+
+    Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
+
+commit 3a0cfdd576dc9b16d1468d37339182607c697fb7
+Author: Anton Vorontsov <avorontsov@ru.mvista.com>
+Date:  Mon Mar 24 20:47:02 2008 +0300
+
+    mpc83xx: MPC8360E-RDK: define CONFIG_OF_STDOUT_VIA_ALIAS
+
+    This is needed to update /choosen/linux,stdout-path properly.
+
+    Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
+
+commit 3419eb62f088d7a22f1d2a3cebf76b77e408b5b9
+Author: Anton Vorontsov <avorontsov@ru.mvista.com>
+Date:  Mon Mar 24 20:47:00 2008 +0300
+
+    mpc83xx: MPC8360E-RDK: add dhcp command
+
+    Plus modify environment to use it and remove bootfile env variable,
+    it is internal and CONFIG_BOOTFILE is used for these purposes.
+
+    Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
+
+commit d892b2dbb4087a26778bfd42470c3ea7d0e2b6aa
+Author: Anton Vorontsov <avorontsov@ru.mvista.com>
+Date:  Mon Mar 24 20:46:57 2008 +0300
+
+    mpc83xx: MPC8360E-RDK: rework ddr setup, enable ecc
+
+    Current DDR setup easily causes memory corruption, this patch fixes it.
+
+    Also fix TIMING_CFG0_MRS_CYC definition.
+
+    Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
+
+commit d47d49cc37a38f2719a3e1b9bbe08ac810cf2d9a
+Author: Anton Vorontsov <avorontsov@ru.mvista.com>
+Date:  Mon Mar 24 20:46:53 2008 +0300
+
+    mpc83xx: MPC8360E-RDK: configure pario pins for AD7843 and FHCI
+
+    This patch adds qe pario pins configuration for AD7843 ADC/Touchscreen
+    controller and FHCI (QE USB).
+
+    Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
+
+commit 7ad959490962e6842648d87d4bd795ea6cdcce67
+Author: Anton Vorontsov <avorontsov@ru.mvista.com>
+Date:  Mon Mar 24 20:46:51 2008 +0300
+
+    mpc83xx: MPC8360E-RDK: add support for NAND
+
+    Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
+
+commit 9a3e832aeb491861d029991241572ebdf4b5b61b
+Author: Anton Vorontsov <avorontsov@ru.mvista.com>
+Date:  Mon Mar 24 20:46:46 2008 +0300
+
+    mpc83xx: MPC8360E-RDK: use RGMII_RXID interface mode
+
+    This is needed for BCM PHYs to work on this board.
+
+    Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
+
+commit 300615dc5d9b0a2022fbc6af0c13159e33fd752e
+Author: Anton Vorontsov <avorontsov@ru.mvista.com>
+Date:  Mon Mar 24 20:46:34 2008 +0300
+
+    uec: add support for Broadcom BCM5481 Gigabit PHY
+
+    This patch adds basic support for Broadcom BCM5481 PHY.
+
+    RXD-RXC delay quirk comes from MPC8360E-RDK BSP source, author is
+    Peter Barada <peterb@logicpd.com>.
+
+    Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
+
+commit 6a600c3a1876bc203445df4f0fd6b12648259666
+Author: Anton Vorontsov <avorontsov@ru.mvista.com>
+Date:  Mon Mar 24 20:46:28 2008 +0300
+
+    uec: add support for RGMII_RXID interface mode
+
+    PHY drivers will use it to setup software delay between RXD and RXC
+    signals.
+
+    Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
+
+commit 91cdaa3a9d7562b869d96774e9c9ddf142c0848d
+Author: Anton Vorontsov <avorontsov@ru.mvista.com>
+Date:  Mon Mar 24 20:46:24 2008 +0300
+
+    uec: add support for gbit mii status readings
+
+    Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
+
+commit aabce7fb505ffe55ebf3bf4dcafdae97a581558d
+Author: Anton Vorontsov <avorontsov@ru.mvista.com>
+Date:  Mon Mar 24 17:40:47 2008 +0300
+
+    83xx: define CONFIG_OF_STDOUT_VIA_ALIAS for the MPC837XERDB boards
+
+    This is primarily for the early console support.
+
+    Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
+
+commit 2bd7460e9283ec98565189b3cdbcfb2bcdcdd635
+Author: Anton Vorontsov <avorontsov@ru.mvista.com>
+Date:  Mon Mar 24 17:40:43 2008 +0300
+
+    83xx: initialize serdes for MPC837XRDB boards
+
+    On the MPC8377ERDB: 2 SATA and 2 PCI-E.
+    On the MPC8378ERDB: 2 PCI-E
+    On the MPC8379ERDB: 4 SATA
+
+    Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
+
+commit 453316a2a19642d8afcbca7452e40a6b44a197b1
+Author: Anton Vorontsov <avorontsov@ru.mvista.com>
+Date:  Mon Mar 24 17:40:32 2008 +0300
+
+    83xx: serdes setup routines
+
+    This patch adds few routines to configure serdes on 837x targets.
+
+    Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
+
+commit a796cdf9c377cb4e5d61d1079a296608f8fbd903
+Author: Anton Vorontsov <avorontsov@ru.mvista.com>
+Date:  Mon Mar 24 17:40:27 2008 +0300
+
+    83xx: split COBJS onto separate lines
+
+    ..plus get rid of some #ifdefs in the .c files.
+
+    Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
+
+commit 46a3aeea73c13ab04ebf7a8739afb87ac5da94a3
+Author: Anton Vorontsov <avorontsov@ru.mvista.com>
+Date:  Mon Mar 24 17:40:23 2008 +0300
+
+    83xx: nand support for MPC837XRDB boards
+
+    Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
+
+commit 82e45a204190593e8613145a928f998fb8c909c4
+Author: Jerry Van Baren <gvb.uboot@gmail.com>
+Date:  Tue Mar 18 21:44:41 2008 -0400
+
+    Enable CONFIG_FLASH_SHOW_PROGRESS on the MPC8360EMDS.
+
+    Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
+    Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
+
+commit 0fa7a1b4719e325fce332689fb8754ec166191ff
+Author: Michael Barkowski <michael.barkowski@freescale.com>
+Date:  Thu Mar 20 13:15:39 2008 -0400
+
+    mpc8323erdb: remove RTC and add EEPROM
+
+    There's no on-board RTC on the MPC8323ERDB, but there is an EEPROM.
+
+    Signed-off-by: Michael Barkowski <michael.barkowski@freescale.com>
+    Acked-by: Kim Phillips <kim.phillips@freescale.com>
+
+commit 5bbeea86eb6afb872374cd23217cb3c1018443ed
+Author: Michael Barkowski <michael.barkowski@freescale.com>
+Date:  Thu Mar 20 13:15:34 2008 -0400
+
+    mpc8323erdb: Improve the system performance
+
+    The following changes are based on kernel UCC ethernet performance:
+
+    1. Make the CSB bus pipeline depth as 4, and enable the repeat mode
+    2. Optimize transactions between QE and CSB.  Added CFG_SPCR_OPT
+       switch to enable this setting.
+
+    The following changes are based on the App Note AN3369 and
+    verified to improve memory latency using LMbench:
+
+    3. CS0_CONFIG[AP_n_EN] is changed from 1 to 0
+    4. CS0_CONFIG[ODT_WR_CONFIG] set to 1.  Was a reserved setting
+       previously.
+    5. TIMING_CFG_1[WRREC] is changed from 3clks to 2clks  (based on
+       Twr=15ns, and this was already the setting in DDR_MODE)
+    6. TIMING_CFG_1[PRETOACT] is changed from 3clks to 2clks. (based on
+       Trp=15ns)
+    7. TIMING_CFG_1[ACTTOPRE] is changed from 9clks to 6clks. (based on
+       Tras=40ns)
+    8. TIMING_CFG_1[ACTTORW] is changed from 3clks to 2clks. (based on
+       Trcd=15ns)
+    9. TIMING_CFG_1[REFREC] changed from 21 clks to 11clks.  (based on
+       Trfc=75ns)
+    10. TIMING_CFG_2[FOUR_ACT] is changed from 10 clks to 7clks.  (based
+       on Tfaw=50ns)
+    11. TIMING_CFG_2[ADD_LAT] and DDR_MODE[AL] changed from 0 to 1 (based
+       on CL=3 and WL=2).
+
+    Signed-off-by: Michael Barkowski <michael.barkowski@freescale.com>
+    Acked-by: Kim Phillips <kim.phillips@freescale.com>
+
+commit fc549c871f43933396a5b3e21d897023d4b31b8d
+Author: Michael Barkowski <michael.barkowski@freescale.com>
+Date:  Thu Mar 20 13:15:28 2008 -0400
+
+    mpc8323erdb: use readable DDR config macros
+
+    Use available shift/mask macros to define DDR configuration.
+
+    Signed-off-by: Michael Barkowski <michael.barkowski@freescale.com>
+    Acked-by: Kim Phillips <kim.phillips@freescale.com>
+
+commit 89c7784ed90ba50301eec521144f95111e472906
+Author: Timur Tabi <timur@freescale.com>
+Date:  Fri Feb 8 13:15:55 2008 -0600
+
+    83xx: Add Vitesse VSC7385 firmware uploading
+
+    Update the MPC8349E-mITX, MPC8313E-RDB, and MPC837XE-RDB board files to upload
+    the Vitesse VSC7385 firmware.  Changed CONFIG_VSC7385 to CONFIG_VSC7385_ENET.
+    Cleaned up the board header files to make selecting the VSC7385 easier to
+    control.
+
+    Signed-off-by: Timur Tabi <timur@freescale.com>
+    Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
+
+commit b55d98c6d5b8694e560a0e727b14cb6921d7cfcc
+Author: Timur Tabi <timur@freescale.com>
+Date:  Fri Feb 8 13:15:54 2008 -0600
+
+    NET: Add Vitesse VSC7385 firmware uploading
+
+    The Vitesse VSC7385 is a 5-port switch found on the Freescale MPC8349E-mITX
+    and other boards.  A small firwmare must be uploaded to its on-board memory
+    before it can be enabled.  This patch adds the code which uploads firmware
+    (but not the firmware itself).
+
+    Previously, this feature was provided by a U-Boot application that was
+    made available only on Freescale BSPs.  The VSC7385 firmware must still
+    be obtained separately, but at least there is no longer a need for a separate
+    application.
+
+    Signed-off-by: Timur Tabi <timur@freescale.com>
+    Acked-by: Ben Warren <biggerbadderben@gmail.com>
+
+commit aa6f6d171a1f9f46ee4f03ad6acb97a6bfb71855
+Author: Wolfgang Denk <wd@denx.de>
+Date:  Wed Mar 26 00:52:10 2008 +0100
+
+    Coding Style cleanyp; update CHANGELOG
+
+    Signed-off-by: Wolfgang Denk <wd@denx.de>
+
+commit 43ddd9c820fec44816188f53346b464e20b3142d
+Author: Jerry Van Baren <gvb.uboot@gmail.com>
+Date:  Sat Mar 22 14:23:49 2008 -0400
+
+    Remove deprecated CONFIG_OF_HAS_UBOOT_ENV and CONFIG_OF_HAS_BD_T
+
+    These defines embedded the u-boot env variables and/or the bd_t structure
+    in the fdt blob.  The conclusion of discussion on the u-boot email list
+    was that embedding these in the fdt blob is not useful: there are better
+    ways of passing the data (in fact, the fdt blob itself replaces the
+    bd_t struct).
+
+    The only board that enables these is the stxxtc and they don't appear
+    to be used by linux.
+
+    Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
+    Acked-by: Kim Phillips <kim.phillips@freescale.com>
+
+commit 22ed2285743359fd1fe73e411dff914b2256e68f
+Author: Stefan Roese <sr@denx.de>
+Date:  Mon Mar 17 10:49:25 2008 +0100
+
+    rtc: Remove 2nd reference to max6900.o in drivers/rtc/Makefile
+
+    Signed-off-by: Stefan Roese <sr@denx.de>
+
+commit 1bb707c39a0833e91d9f797dd862aaaaf4af264d
+Author: Kyungmin Park <kmpark@infradead.org>
+Date:  Mon Mar 17 08:54:06 2008 +0900
+
+    Add Flex-OneNAND booting support
+
+    Flex-OneNAND is a monolithic integrated circuit with a NAND Flash array
+    using a NOR Flash interface. This on-chip integration enables system designers
+    to reduce external system logic and use high-density NAND Flash
+    in applications that would otherwise have to use more NOR components.
+
+    Flex-OneNAND enables users to configure to partition it into SLC and MLC areas
+    in more flexible way. While MLC area of Flex-OneNAND can be used to store data
+    that require low reliability and high density, SLC area of Flex-OneNAND
+    to store data that need high reliability and high performance. Flex-OneNAND
+    can let users take advantage of storing these two different types of data
+    into one chip, which is making Flex-OneNAND more cost- and space-effective.
+
+    Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
+
+commit c512389cc4a10253249271ff6c887c6dab1f0db2
+Author: André Schwarz <andre.schwarz@matrix-vision.de>
+Date:  Thu Mar 13 13:50:52 2008 +0100
+
+    MPC5200: support setup without FEC
+
+    Include FEC specific nodes in ft_cpu_setup only if CONFIG_MPC5xxx_FEC is
+    defined. Systems without FEC, i.e. no FEC node in DTB, should be possible.
+
+    Signed-off-by: Andre Schwarz <andre.schwarz@matrix-vision.de>
+    Acked-by: Grant Likely <grant.likely@secretlab.ca>
+
+commit aa3511e422946041ef626f80a05ae5e8bfc700e6
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Wed Mar 5 18:05:46 2008 -0600
+
+    FSL: Move board/mpc8266ads under board/freescale
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 7f1d846e5c5754449c286587d099d85246062772
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Wed Mar 5 18:05:47 2008 -0600
+
+    FSL: Move board/mpc7448hpc2 under board/freescale
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit b7e24d283e34727c2a6cdfdac2e09a426c579b73
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Wed Mar 5 18:05:45 2008 -0600
+
+    FSL: Move board/mpc8260ads under board/freescale
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 6a8a5dc4759867c45aa95580deb8bf26669a5d97
+Author: goda.yusuke <goda.yusuke@renesas.com>
+Date:  Wed Mar 5 17:08:33 2008 +0900
+
+    net: Add support AX88796L ethernet device
+
+    AX88796L is device of NE2000 compatible.
+    This patch support AX88796L ethernet device.
+
+    Signed-off-by: Yusuke Goda <goda.yusuke@renesas.com>
+    Acked-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+
+commit e0a6140dd381e1eed1ada2291166ef2616d8822b
+Author: Wolfgang Denk <wd@denx.de>
+Date:  Tue Mar 25 22:50:41 2008 +0100
+
+    ne2000 driver: change #ifdef to Makefile conditional compilation
+
+    Signed-off-by: Wolfgang Denk <wd@denx.de>
+
+commit e710185aae90c64d39c2d453e40e58ceefe4f250
+Author: goda.yusuke <goda.yusuke@renesas.com>
+Date:  Wed Mar 5 17:08:20 2008 +0900
+
+    net: Divided code of NE2000 ethernet driver
+
+    There are more devices of the NE2000 base.
+    A present code is difficult for us to support more devices.
+    To support more NE2000 clone devices, separated the function.
+
+    Signed-off-by: Yusuke Goda <goda.yusuke@renesas.com>
+    Acked-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+
+commit 395bce4f59a507a60a475f7ee46bed47de9482df
+Author: Mike Frysinger <vapier@gentoo.org>
+Date:  Sun Feb 24 23:58:13 2008 -0500
+
+    net/Blackfin: move on-chip MAC driver into drivers/net/
+
+    The Blackfin on-chip MAC driver was being managed in the BF537-STAMP board
+    directory, but it is not board specific, so relocate it to the drivers dir
+    so that other Blackfin ports can utilize it.
+
+    Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+
+commit 8a30b4700942f37495d2e67f5998cdffb6e3ba8a
+Author: Mike Frysinger <vapier@gentoo.org>
+Date:  Sun Feb 24 23:52:35 2008 -0500
+
+    smc91111: use SSYNC() rather than asm(ssync) for Blackfin
+
+    Since the "ssync" instruction may have hardware anomalies associated with
+    it, have the smc91111 driver use the SSYNC macro rather than invoking it
+    directly.  We workaround all the anomalies via this macro.
+
+    Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+
+commit 77ff7b7444ceb8022b46114f3d0b6d18e2fd1138
+Author: Bryan O'Donoghue <bodonoghue@codehermit.ie>
+Date:  Sun Feb 17 22:57:47 2008 +0000
+
+    8xx: Update OF support on 8xx
+
+    This patch does some shifting around of OF support on 8xx.
+
+    Signed-off-by: Bryan O'Donoghue <bodonoghue@codehermit.ie>
+
+commit 9c666a7db0b2285a270c68810889ce7d5dba304b
+Author: Kumar Gala <galak@kernel.crashing.org>
+Date:  Fri Feb 15 15:16:18 2008 -0600
+
+    ppc: Allow boards to specify how much memory they can map
+
+    For historical reasons we limited the stack to 256M because some boards
+    could only map that much via BATS. However newer boards are capable of
+    mapping more memory (for example 85xx is capble of doing up to 2G).
+
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+
+commit a6f5f317cd074bbbfa2aab4fca05904c811c19fb
+Author: Bryan O'Donoghue <bodonoghue@codehermit.ie>
+Date:  Fri Feb 15 01:05:58 2008 +0000
+
+    8xx : Add OF support to Adder875 board port - resubmit
+
+    Signed-off-by: Bryan O'Donoghue <bodonoghue@codehermit.ie>
+
+commit d058698fd2d9f769ff38ac53c8708b3fdd314f2d
+Author: Kumar Gala <galak@kernel.crashing.org>
+Date:  Thu Feb 14 20:44:42 2008 -0600
+
+    Add setexpr command
+
+    Add a simple expr style command that will set an env variable as the result
+    of the command.  This allows us to do simple math in shell.  The following
+    operations are supported: &, |, ^, +, -, *, /.
+
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+
+commit 3f105faa64b9826e088711fdfcaa70cb1230397a
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Wed Mar 5 17:27:48 2008 -0600
+
+    FSL: Move board/mpc7448hpc2 under board/freescale
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 449c703374a8868453425e15da7e2f76221b72e4
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Wed Mar 5 17:21:43 2008 -0600
+
+    FSL: Move board/mpc8266ads under board/freescale
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 5863577989ad689427bb750107e9a75f1c1645d2
+Author: Jon Loeliger <jdl@freescale.com>
+Date:  Wed Mar 5 16:41:41 2008 -0600
+
+    FSL: Move board/mpc8260ads under board/freescale
+
+    Signed-off-by: Jon Loeliger <jdl@freescale.com>
+
+commit 8a773983957ee6c4aa344469b742f29c7d26afbd
+Author: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
+Date:  Tue Mar 25 21:30:08 2008 +0900
+
+    [MIPS] Move gth2_config from ARM section to MIPS
+
+    Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
+
+commit 373b16fc0c5ae34d28b9027f809ae3cbf45cdd15
+Author: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
+Date:  Tue Mar 25 21:30:07 2008 +0900
+
+    [MIPS] Extend MIPS_MAX_CACHE_SIZE upto 64kB
+
+    Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
+
+commit d98e348e2ed5aab8f7a6471ff628ab0688b8a459
+Author: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
+Date:  Tue Mar 25 21:30:07 2008 +0900
+
+    [MIPS] Fix dcache_status()
+
+    You can't judge UNCACHED by Config.K0 LSB.
+
+    Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
+
+commit b0c66af53ec9385ac2d1cc2e5d7d1ecdc81caf34
+Author: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
+Date:  Tue Mar 25 21:30:07 2008 +0900
+
+    [MIPS] Introduce _machine_restart
+
+    Handles machine specific functions by using weak functions.
+
+    Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
+
+commit decaba6f5cf386d569ac3997bebb871b966c6b18
+Author: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
+Date:  Tue Mar 25 21:30:07 2008 +0900
+
+    [MIPS] Cleanup CP0 Status initialization
+
+    Add setup_c0_status from Linux. For the moment we disable interrupts, set
+    CU0, mark the kernel mode, and clear ERL and EXL. This is good enough for
+    reset-time configuration and will work well across most processors.
+
+    Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
+
+commit d43d43ef2845af309c25a64bb9c2c5fb3261bc23
+Author: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
+Date:  Tue Mar 25 21:30:07 2008 +0900
+
+    [MIPS] Initialize CP0 Cause before setting up CP0 Status register
+
+    Without this change, we'll be suffering from deffered WATCH exception
+    once Status.EXL is cleared. Make sure Cause.WP is cleared.
+
+    Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
+
+commit 26138623230ca2bad3c78e05a65527ea70c8b688
+Author: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
+Date:  Tue Mar 25 21:30:07 2008 +0900
+
+    [MIPS] INCA-IP: Move watchdog init code from start.S to lowlevel_init()
+
+    Move things to appropriate place.
+
+    Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
+
+commit ccf8f824ef67df028dedb29f8ea5d71a5a88d895
+Author: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
+Date:  Tue Mar 25 21:30:06 2008 +0900
+
+    [MIPS] Implement flush_cache()
+
+    We do Hit_Writeback_Inv_D and Hit_Invalidate_I. You might think that you
+    don't need to do Hit_Invalidate_I, but flush_cache() needs it since this
+    function is used not only in U-Boot specfic programs but also at loading
+    target binaries.
+
+    Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
+
+commit 2e0e5271aac917812a76c72030a2b2c6f1d3387d
+Author: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
+Date:  Tue Mar 25 21:30:06 2008 +0900
+
+    [MIPS] Fix I-/D-cache initialization loops
+
+    Currently we do 1) Index_Store_Tag_I, 2) Fill and 3) Index_Store_Tag_I
+    again per a loop for I-cache initialization. But according to 'See MIPS
+    Run', we're encouraged to use three separate loops rather than combining
+    them *for both I- and D-cache*. This patch tries to fix this.
+
+    In accordance with fixing above, mips_init_[id]cache are separated from
+    mips_cache_reset(), and rewrite cache loops are completely rewritten with
+    useful macros.
+
+    Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
+
+commit 1898840797c7f50799377bd5b285a8a93a82c419
+Author: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
+Date:  Tue Mar 25 21:30:06 2008 +0900
+
+    [MIPS] Replace memory clearance code with f_fill64
+
+    This routine fills memory with zero by 64 bytes, and is 64-bit capable.
+
+    Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
+
+commit 2f5d414ccb4024dd0992ff6b22561732dbc73590
+Author: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
+Date:  Tue Mar 25 21:30:06 2008 +0900
+
+    [MIPS] cpu/mips/cache.S: Introduce NESTED/LEAF/END macros
+
+    This patch replaces the current function definitions with NESTED, LEAF
+    and END macro. They specify some more additional information about the
+    function; an alignment of symbol, type of symbol, stack frame usage, etc.
+    These information explicitly tells the assembler and the debugger about
+    the types of code we want to generate.
+
+    Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
+
+commit 282223a607c611425fa33f5428f8eae6636972bb
+Author: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
+Date:  Tue Mar 25 11:43:17 2008 +0900
+
+    [MIPS] asm headers' updates
+
+    Make some asm headers adjusted to the latest Linux kernel.
+
+    Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
+
+commit e1390801a3c1a2b6d12fa90be368efc19f5b9bfd
+Author: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
+Date:  Tue Mar 25 11:39:29 2008 +0900
+
+    [MIPS] Request for the 'mips_cache_lock()' removal
+
+    The initial intension of having mips_cache_lock() was to use the cache
+    as memory for temporary stack use so that a C environment can be set up
+    as early as possible.
+
+    But now mips_cache_lock() follow lowlevel_init(). We've already have the
+    real memory initilaized at this point, therefore we could/should use it.
+    No reason to lock at all.
+
+    Other problems:
+
+    Cache locking is not consistent across MIPS implementaions. Some imple-
+    mentations don't support locking at all. The style of locking varies -
+    some support per line locking, others per way, etc. Some parts use bits
+    in status registers instead of cache ops. Current mips_cache_lock() is
+    not necessarily general-purpose.
+
+    And this is worthy of special mention; once U-Boot/MIPS locks the lines,
+    they are never get unlocked, so the code relies on whatever gets loaded
+    after U-Boot to re-initialize the cache and clear the locks. We're sup-
+    posed to have CFG_INIT_RAM_LOCK and unlock_ram_in_cache() implemented,
+    but leave the situation as it is for a long time.
+
+    For these reasons, I proposed the removal of mips_cache_lock() from the
+    global start-up code.
+
+    This patch adds CFG_INIT_RAM_LOCK_MIPS to make existing users aware that
+    *things have changed*. If he wants the same behavior as before, he needs
+    to have CFG_INIT_RAM_LOCK_MIPS in his config file.
+
+    If we don't have any regression report through several releases, then
+    we'll remove codes entirely.
+
+    Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
+    Acked-by: Andrew Dyer <amdyer@gmail.com>
+
+commit 0d48926c87ec96f974a6ac4034f4a2f2eab3255f
+Author: Yuri Tikhonov <yur@emcraft.com>
+Date:  Mon Mar 24 11:30:54 2008 +0100
+
+    lwmon5 SYSMON POST: fix backlight control
+
+    If the LWMON5 config has SYSMON POST among CONFIG_POSTs which may be
+    run on the board, then the SYSMON POST controls the display backlight
+    (doesn't switch backlight ON if POST FAILED, and does switch the
+    backlight ON if PASSED).
+
+    If not, then the video driver controls the display backlight (just
+    switch ON the backlight upon initialization).
+
+    Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
+
+commit ff2bdfb2c1e073f65c065011f1e18d0a130bd3d8
+Author: Yuri Tikhonov <yur@emcraft.com>
+Date:  Mon Mar 24 11:29:14 2008 +0100
+
+    lwmon5 SYSMON POST: fix handling of negative temperatures
+
+    Fix errors in the LWMON5 Sysmon POST for negative temperatures.
+
+    Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
+
+commit 55774b512fdf63c0516d441cc5da7c54bbffb7f2
+Author: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+Date:  Fri Mar 7 16:04:25 2008 +0900
+
+    pci: Add CONFIG_PCI_SKIP_HOST_BRIDGE config option
+
+    In current source code, when the device number of PCI is 0, process PCI
+    bridge without fail. However, when the device number is 0, it is not PCI
+    always bridge. There are times when device of PCI allocates.
+
+    When CONFIG_PCI_SKIP_HOST_BRIDGE is enable, this problem is solved when
+    use this patch.
+
+    Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+    Acked-by: Stefan Roese <sr@denx.de>
+
+commit 86aea3eaefa248ffb9328e2b50c64720489cdbeb
+Author: Yuri Tikhonov <yur@emcraft.com>
+Date:  Fri Mar 21 09:18:40 2008 +0100
+
+    LWMON5: fix dsPIC POST
+
+    Add test for DPIC_SYS_ERROR_REG to be zero in the LWMON5 dsPIC POST.
+
+    Signed-off-by: Yuri Tikhonov <yur@emcraft.com> ---
+
+commit 388b82fddc7c05596f3f615f190da0448227dc82
+Author: Bartlomiej Sieka <tur@semihalf.com>
+Date:  Thu Mar 20 23:23:13 2008 +0100
+
+    [new uImage] Enable new uImage support for the pcs440ep board.
+
+    Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>
+
+commit 95f4ec2b9c910c7261e6f060ea530d58b039692d
+Author: Bartlomiej Sieka <tur@semihalf.com>
+Date:  Thu Mar 20 23:23:13 2008 +0100
+
+    [new uImage] Do not compile new uImage format support by default
+
+    Disable default building of new uImage format support in preparation
+    for merge with the master. Support for new format can be enabled on
+    a per-board basis, by defining the following in the board's config file:
+
+    #define CONFIG_FIT            1
+    #define CONFIG_OF_LIBFDT      1
+
+    This can be optionally defined to give more verbose output:
+
+    #define CONFIG_FIT_VERBOSE    1 /* enable fit_format_{error,warning}() */
+
+    Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>
+
+commit dafaede8a46c7159310239e036c93e31c6374487
+Author: Bartlomiej Sieka <tur@semihalf.com>
+Date:  Thu Mar 20 23:20:31 2008 +0100
+
+    [new uImage] Disable debuging output in preparation for merge with master
+
+    Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>
+
+commit fbe7a155027beacebaee9b32e1ada781fe924bca
+Author: Bartlomiej Sieka <tur@semihalf.com>
+Date:  Thu Mar 20 19:38:45 2008 +0100
+
+    [new uImage] Compilation and new uImage handling fixes for imxtract
+
+    Fix imxtract command not being compiled-in despite CONFIG_CMD_XIMG being in
+    include/config_cmd_default.h. Fix few warnings and handling of new format
+    images.
+
+    Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>
+
+commit 36cc8cbb3379d5166f882641123521735c469f92
+Author: Bartlomiej Sieka <tur@semihalf.com>
+Date:  Thu Mar 20 23:10:19 2008 +0100
+
+    [new uImage] Fix autoscr command used with new uImage format
+
+    Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>
+
+commit 43142e817f0597be412e7cbe19413f5532eafa5d
+Author: Bartlomiej Sieka <tur@semihalf.com>
+Date:  Thu Mar 20 23:10:19 2008 +0100
+
+    [new uImage] Fix *.its files location in documentation
+
+    Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>
+
+commit 81a0ac62ea29f8252d0a714709d0ecfdbba2a15e
+Author: Wolfgang Denk <wd@denx.de>
+Date:  Thu Mar 20 22:01:38 2008 +0100
+
+    lwmon5 POST: remove unreachable code
+
+    plus some coding style cleanup
+
+    Signed-off-by: Wolfgang Denk <wd@denx.de>
+
+commit b73a19e1609d0f705cbab8014ca17aefe89e4c76
+Author: Yuri Tikhonov <yur@emcraft.com>
+Date:  Thu Mar 20 17:56:04 2008 +0300
+
+    LWMON5: POST RTC fix
+
+    Modify the RTC API to provide one a status for the time reported by
+    the rtc_get() function:
+      0 - a reliable time is guaranteed,
+    < 0 - a reliable time isn't guaranteed (power fault, clock issues,
+         and so on).
+
+    The RTC chip drivers are responsible for providing this info if the
+    corresponding chip supports such functionality. If not - always
+    report that the time is reliable.
+
+    The POST RTC test was modified to detect the RTC faults utilizing
+    this new rtc_get() feature.
+
+    Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
+
+commit a5cc5555ccee596908a7d8cf22a104f6b993bfd5
+Author: Martin Krause <martin.krause@tqs.de>
+Date:  Wed Mar 19 14:25:14 2008 +0100
+
+    TQM5200B: update MTD partition layout
+
+    - insert partition for dtb blob to TQM5200B MTD layout
+    - set env variables dependent on the configured board
+      (TQM5200 or TQM5200B)
+
+    Signed-off-by: Martin Krause <martin.krause@tqs.de>
+
+commit f0105727d132f56a21fa3ed8b162309cca6cac44
+Author: Stefan Roese <sr@denx.de>
+Date:  Wed Mar 19 07:09:26 2008 +0100
+
+    CFI: Small cleanup for FLASH_SHOW_PROGRESS
+
+    With this patch we don't need that many #ifdef's in the code. It moves
+    the subtraction into the macro and defines a NOP-macro when
+    CONFIG_FLASH_SHOW_PROGRESS is not defined.
+
+    Signed-off-by: Stefan Roese <sr@denx.de>
+    Acked-by: Gerald Van Baren <vanbaren@cideas.com>
+
+commit 9a042e9ca512beaaa2cb450274313fc477141241
+Author: Jerry Van Baren <gvb.uboot@gmail.com>
+Date:  Sat Mar 8 13:48:01 2008 -0500
+
+    Flash programming progress countdown.
+
+    Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
+
+commit 5e339fd9ed539a7d7fec59cfc88f0857ab26a53f
+Author: Bartlomiej Sieka <tur@semihalf.com>
+Date:  Wed Mar 19 10:00:06 2008 +0100
+
+    [new uImage] Fix style issue spotted by Wolfgang Denk <wd@denx.org>
+
+    Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>
+
+commit 11abe45c48ec3485a6c1a5168ce8d79c3288adc1
+Author: David Gibson <david@gibson.dropbear.id.au>
+Date:  Mon Feb 18 18:09:04 2008 +1100
+
+    libfdt: Remove no longer used code from fdt_node_offset_by_compatible()
+
+    Since fdt_node_offset_by_compatible() was converted to the new
+    fdt_next_node() iterator, a chunk of initialization code became
+    redundant, but was not removed by oversight.  This patch cleans it up.
+
+    Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
+
+commit d0ccb9b140b472039732de102fc14597eedb14df
+Author: David Gibson <david@gibson.dropbear.id.au>
+Date:  Mon Feb 18 18:06:31 2008 +1100
+
+    libfdt: Trivial cleanup for CHECK_HEADER)
+
+    Currently the CHECK_HEADER() macro is defined local to fdt_ro.c.
+    However, there are a handful of functions (fdt_move, rw_check_header,
+    fdt_open_into) from other files which could also use it (currently
+    they open-code something more-or-less identical).  Therefore, this
+    patch moves CHECK_HEADER() to libfdt_internal.h and uses it in those
+    places.
+
+    Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
+
+commit fe30a354cdbb808b5f15366a935b151a4ccee74f
+Author: Kumar Gala <galak@kernel.crashing.org>
+Date:  Wed Feb 20 14:32:36 2008 -0600
+
+    Fix fdt boardsetup command parsing
+
+    The introduciton of the 'fdt bootcpu' broke parsing for 'fdt boardsetup'.
+
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+
+commit 804887e6001e2f00bea11431bf34d6d472512cda
+Author: Kumar Gala <galak@kernel.crashing.org>
+Date:  Fri Feb 15 03:34:36 2008 -0600
+
+    Add sub-commands to fdt
+
+    fdt header                         - Display header info
+    fdt bootcpu <id>                   - Set boot cpuid
+    fdt memory <addr> <size>           - Add/Update memory node
+    fdt rsvmem print                   - Show current mem reserves
+    fdt rsvmem add <addr> <size>       - Add a mem reserve
+    fdt rsvmem delete <index>          - Delete a mem reserves
+
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+
+commit f84d65f9b085ffbed464d1d58e8aaa8f5a2efc07
+Author: David Gibson <david@gibson.dropbear.id.au>
+Date:  Thu Feb 14 16:50:34 2008 +1100
+
+    libfdt: Fix NOP handling bug in fdt_add_subnode_namelen()
+
+    fdt_add_subnode_namelen() has a bug if asked to add a subnode to a
+    node which has NOP tags interspersed with its properties.  In this
+    case fdt_add_subnode_namelen() will put the new subnode before the
+    first NOP tag, even if there are properties after it, which will
+    result in an invalid blob.
+
+    This patch fixes the bug, and adds a testcase for it.
+
+    Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
+
+commit ae0b5908de3b9855f8931bc9b32c9fc4962df5a9
+Author: David Gibson <david@gibson.dropbear.id.au>
+Date:  Tue Feb 12 11:58:31 2008 +1100
+
+    libfdt: Add and use a node iteration helper function.
+
+    This patch adds an fdt_next_node() function which can be used to
+    iterate through nodes of the tree while keeping track of depth.  This
+    function is used to simplify the iteration code in a lot of other
+    functions, and is also exported for use by library users.
+
+    Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
+
+commit 9eaeb07a7185d852c7aa10735ecd4e9edf24fb5d
+Author: David Gibson <david@gibson.dropbear.id.au>
+Date:  Fri Jan 11 14:55:05 2008 +1100
+
+    libfdt: Add fdt_set_name() function
+
+    This patch adds an fdt_set_name() function to libfdt, mirroring
+    fdt_get_name().  This is a r/w function which alters the name of a
+    given device tree node.
+
+    Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
+
+commit 23e20aa6488e6c0622496549861bfdc74108debe
+Author: Yuri Tikhonov <yur@pollux.denx.de>
+Date:  Tue Mar 18 13:33:30 2008 +0100
+
+    lwmon5: Fix register test logic to match the specific GDC h/w.
+
+    Signed-off-by: Dmitry Rakhchev <rda@emcraft.com>
+    Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
+
+commit 46bc0a938779aa1d664b847d36b08aa00f22e539
+Author: Yuri Tikhonov <yur@pollux.denx.de>
+Date:  Tue Mar 18 13:27:57 2008 +0100
+
+    Fix backlight in the lwmon5 POST.
+
+    Backlight was switched on even when temperature was too low.
+
+    Signed-off-by: Dmitry Rakhchev <rda@emcraft.com>
+    Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
+
+commit 3d61018643a2cd38c145aa6dde53f3f5f1a0e9cf
+Author: Yuri Tikhonov <yur@pollux.denx.de>
+Date:  Wed Feb 6 18:48:36 2008 +0100
+
+    The patch introduces the alternative configuration of the log buffer for the lwmon5 board: the storage for the log-buffer itself is OCM(on-chip memory), the log-buffer header is moved to six GPT registers (PPC440EPX_GPT0_COMP1, ..., PPC440EPX_GPT0_COMP5).
+
+     To enable this, alternative, configuration the U-Boot board configuration
+    file for lwmon5 includes the definitions of alternative addresses for header
+    (CONFIG_ALT_LH_ADDR) and buffer (CONFIG_ALT_LB_ADDR).
+
+     The Linux shall be configured with the CONFIG_ALT_LB_LOCATION option set,
+    and has the BOARD_ALT_LH_ADDR and BOARD_ALT_LB_ADDR constants defined in the
+    lwmon5 board-specific header (arch/ppc/platforms/4xx/lwmon5.h).
+
+    Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
+
+commit 0f009f781b5b88f25769e154ea4d42db13baf0c6
+Author: Yuri Tikhonov <yur@pollux.denx.de>
+Date:  Mon Feb 4 17:11:53 2008 +0100
+
+    Add support for the lwmon5 board reset via GPIO58.
+
+    Signed-off-by: Dmitry Rakhchev <rda@emcraft.com>
+    Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
+
+commit f694e32f93565ec1fa8d0226c584d6b89e931ed9
+Author: Yuri Tikhonov <yur@pollux.denx.de>
+Date:  Mon Feb 4 17:09:55 2008 +0100
+
+    Some fixes to dspic, fpga, and gdc post tests for lwmon5. Disable external watch-dog for now.
+
+    Signed-off-by: Dmitry Rakhchev <rda@emcraft.com>
+    Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
+
+commit b428f6a8c65c5303e5f96db8d24f2f699d94a98c
+Author: Yuri Tikhonov <yur@pollux.denx.de>
+Date:  Mon Feb 4 14:11:03 2008 +0100
+
+    The patch introduces the CRITICAL feature of POST tests. If the test marked as POST_CRITICAL fails then the alternative, post_critical, boot-command is used. If this command is not defined then U-Boot enters into interactive mode.
+
+    Signed-off-by: Dmitry Rakhchev <rda@emcraft.com>
+    Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
+
+commit 8f15d4addd49c956412e1e3bfc764a0c8b1f3184
+Author: Yuri Tikhonov <yur@pollux.denx.de>
+Date:  Mon Feb 4 14:10:42 2008 +0100
+
+    The patch adds new POST tests for the Lwmon5 board. These are:
+
+    * External Watchdog test;
+    * dsPIC tests;
+    * FPGA test;
+    * GDC test;
+    * Sysmon tests.
+
+    Signed-off-by: Dmitry Rakhchev <rda@emcraft.com>
+    Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
+
+commit c2ed33efbfff5767bca236828e021c55fd547b6c
+Author: Yuri Tikhonov <yur@pollux.denx.de>
+Date:  Mon Feb 4 14:10:01 2008 +0100
+
+    Enable CODEC POST with CFG_POST_CODEC rather than with CFG_POST_DSP.
+
+    Signed-off-by: Dmitry Rakhchev <rda@emcraft.com>
+
+commit 3515fd18d4e8e44f863ac7142b55e22b109e9af2
+Author: Wolfgang Denk <wd@denx.de>
+Date:  Tue Mar 18 17:35:51 2008 +0100
+
+    HMI1001: fix compile problem.
+
+    Signed-off-by: Wolfgang Denk <wd@denx.de>
+
+commit 1f2a9970109cebf7446e0503b10b71f8673045ee
+Author: Mike Frysinger <vapier@gentoo.org>
+Date:  Mon Feb 18 05:32:30 2008 -0500
+
+    Blackfin: BF537-stamp: drop board-specific flash driver for CFI
+
+    The parallel flash on the BF537-STAMP is CFI compliant, so there is no need
+    for the board specific driver at all.  Just use the common CFI driver.
+
+    Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+
+commit 5b22163fef865af2b6bfb6b75f1b7bf443ce170c
+Author: Mike Frysinger <vapier@gentoo.org>
+Date:  Tue Feb 19 00:36:14 2008 -0500
+
+    Blackfin: add proper ELF markings to some assembly functions
+
+    Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+
+commit cf675d3b2b9c3511c1d99bc8f8f38fd2f08bfcaf
+Author: Mike Frysinger <vapier@gentoo.org>
+Date:  Tue Feb 19 00:35:17 2008 -0500
+
+    Blackfin: new cplbinfo command for viewing cplb tables
+
+    Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+
+commit aadb72503cd1602349a5fe53356d5f55ecc1b900
+Author: Mike Frysinger <vapier@gentoo.org>
+Date:  Mon Feb 18 05:37:51 2008 -0500
+
+    Blackfin: update MAINTAINERS list
+
+    Add maintainer information for the Blackfin boards.
+
+    Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+
+commit f7ce12cb65a30c6e152eecf26f0304b7d78cf39d
+Author: Mike Frysinger <vapier@gentoo.org>
+Date:  Mon Feb 18 05:26:48 2008 -0500
+
+    Blackfin: convert BFIN_CPU to CONFIG_BFIN_CPU
+
+    Stop tying things to the processor that should be tied to other defines and
+    change BFIN_CPU to CONFIG_BFIN_CPU so that it can be used in the build
+    system to select the -mcpu option.
+
+    Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+
+commit 86a20fb920bd198105acf7b1191117f566d637ed
+Author: Mike Frysinger <vapier@gentoo.org>
+Date:  Sat Feb 16 07:40:36 2008 -0500
+
+    Blackfin: move bootldr command to common code
+
+    This moves the Blackfin-common bootldr command out of the BF537-STAMP
+    specific board directory and into the common directory so that all Blackfin
+    boards may utilize it.
+
+    Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+
+commit decbe029b2a9d3333d02c433389b1c821eea96d7
+Author: Heiko Schocher <hs@denx.de>
+Date:  Fri Mar 14 11:05:20 2008 +0100
+
+    mgcoge: update configuration
+
+    Fix configuration for mgcoge board
+
+    Signed-off-by: Heiko Schocher <hs@denx.de>
+
+commit c136724cda0219c49f1d4b346f00da29b14fdf14
+Author: Wolfgang Denk <wd@denx.de>
+Date:  Sun Mar 16 01:22:59 2008 +0100
+
+    drivers/rtc/Makefile: keep list sorted
+
+    Signed-off-by: Wolfgang Denk <wd@denx.de>
+
+commit 9536dfcce03e7be4ccbceb47a08d9ba07ada362f
+Author: Tor Krill <tor@excito.com>
+Date:  Sat Mar 15 15:40:26 2008 +0100
+
+    Add support for Intersil isl1208 RTC
+
+    Signed-off-by: Tor Krill <tor@excito.com>
+
+commit 0210cff3d079d97b2156b13685ee8de368e68a1a
+Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+Date:  Sat Mar 15 17:36:41 2008 +0100
+
+    cramfs: Fix ifdef
+
+    Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+
+commit 0b8f2a27861a9fd06eb55a34f855ec9c5102aab4
+Author: Wolfgang Denk <wd@denx.de>
+Date:  Sun Mar 16 01:12:58 2008 +0100
+
+    Conding style cleanup
+
+    Signed-off-by: Wolfgang Denk <wd@denx.de>
+
 commit 41712b4e8c95dff23354bcd620e1f9477160c190
 Author: Stefan Roese <sr@denx.de>
 Date:  Wed Mar 5 12:31:53 2008 +0100
@@ -99,165 +4042,454 @@ Date:   Tue Mar 11 15:11:18 2008 +0100
 
     Signed-off-by: Stefan Roese <sr@denx.de>
 
-commit 999ecd5aca381984d8ebbeb207ece82a1c275577
-Author: Stefan Roese <sr@denx.de>
-Date:  Tue Mar 11 15:07:10 2008 +0100
+commit 999ecd5aca381984d8ebbeb207ece82a1c275577
+Author: Stefan Roese <sr@denx.de>
+Date:  Tue Mar 11 15:07:10 2008 +0100
+
+    ppc4xx: Add basic support for AMCC 460EX/460GT (3/5)
+
+    This patch adds basic support for the AMCC 460EX/460GT PPC's.
+
+    Signed-off-by: Stefan Roese <sr@denx.de>
+
+commit 2801b2d2a9906f206ab9ee8d0b6e746d2b7fe05a
+Author: Stefan Roese <sr@denx.de>
+Date:  Tue Mar 11 15:05:50 2008 +0100
+
+    ppc4xx: Add basic support for AMCC 460EX/460GT (2/5)
+
+    This patch adds basic support for the AMCC 460EX/460GT PPC's.
+
+    Signed-off-by: Stefan Roese <sr@denx.de>
+
+commit 8ac41e3e37c3080c6b1d9461d654161cfe2aa492
+Author: Stefan Roese <sr@denx.de>
+Date:  Tue Mar 11 15:05:26 2008 +0100
+
+    ppc4xx: Add basic support for AMCC 460EX/460GT (1/5)
+
+    This patch adds basic support for the AMCC 460EX/460GT PPC's.
+
+    Signed-off-by: Stefan Roese <sr@denx.de>
+
+commit 56e410178375d9f20be25fb24e180974f0ae120b
+Author: Stefan Roese <sr@denx.de>
+Date:  Tue Feb 19 22:07:57 2008 +0100
+
+    ppc4xx: interrupt.c reworked
+
+    This patch is a rework of the 4xx interrupt handling done while
+    adding the 460EX/GT support. Interrupts are needed on 4xx for the
+    EMAC driver.
+
+    Signed-off-by: Stefan Roese <sr@denx.de>
+
+commit 84a999b6cdd0b02dc7de2cacc306eaa84afe2b46
+Author: Stefan Roese <sr@denx.de>
+Date:  Tue Feb 19 22:01:57 2008 +0100
+
+    ppc4xx: program_tlb now uses 64bit physical addess
+
+    This patch changes the physical addess parameter from 32bit to 64bit.
+    This is needed for 36bit 4xx platforms to access areas located
+    beyond the 4GB border, like SoC peripherals (EBC etc.).
+
+    Signed-off-by: Stefan Roese <sr@denx.de>
+
+commit c3307fa186af85771924c434997089b8104c0a46
+Author: Stefan Roese <sr@denx.de>
+Date:  Tue Feb 19 21:58:25 2008 +0100
+
+    ppc4xx: miiphy.c reworked
+
+    While adding the 460EX/GT support I reworked the 4xx miiphy code. It
+    badly neede some cleanup.
+
+    Signed-off-by: Stefan Roese <sr@denx.de>
+
+commit 88aff62df39c0756241ea9f9b5a7b3ade26cb82b
+Author: Stefan Roese <sr@denx.de>
+Date:  Tue Feb 19 16:21:49 2008 +0100
+
+    rtc: Add M41T62 support
+
+    This patch add support for the STM M41T62 RTC. It is used and tested
+    on the AMCC Canyonlands 406EX platform.
+
+    Signed-off-by: Stefan Roese <sr@denx.de>
+
+commit 217d383e201adc7f2271145ae345ea5eae2b7170
+Author: Niklaus Giger <niklaus.giger@netstal.com>
+Date:  Mon Feb 25 18:46:43 2008 +0100
+
+    ppc4xx: Add 405GPr based MCU25 board specific files
+
+    Signed-off-by: Niklaus Giger <niklaus.giger@netstal.com>
+
+commit 75a66dcdb383863ad33f0534cfc27b7a86947dad
+Author: Niklaus Giger <niklaus.giger@netstal.com>
+Date:  Mon Feb 25 18:46:42 2008 +0100
+
+    ppc4xx: Add 405GPr based MCU25 board config file
+
+    Signed-off-by: Niklaus Giger <niklaus.giger@netstal.com>
+
+commit b05f35436b733a240559e77e46bed8439665ecc5
+Author: Niklaus Giger <niklaus.giger@netstal.com>
+Date:  Mon Feb 25 18:46:41 2008 +0100
+
+    ppc4xx: Add 405GPr based MCU25 board. Global files
+
+    Signed-off-by: Niklaus Giger <niklaus.giger@netstal.com>
+
+commit 14c27b35ac812a71abce6e3e2f4129d5e9313660
+Author: Niklaus Giger <niklaus.giger@netstal.com>
+Date:  Mon Feb 25 18:37:02 2008 +0100
+
+    ppc4xx: HCU4/5. remove obsolete hcu_flash.c
+
+    Signed-off-by: Niklaus Giger <niklaus.giger@netstal.com>
+
+commit a079494853cc2bfeddb26673219db0b4b2b31566
+Author: Niklaus Giger <niklaus.giger@netstal.com>
+Date:  Mon Feb 25 18:37:01 2008 +0100
+
+    ppc4xx: HCU4/5. Use FLASH_CFI_LEGACY
+
+    Cleanup: Remove custom flash driver for 8 bit boot-eprom and replace it with
+    the FLASH_CFI_LEGACY et al. config options.
+
+    Signed-off-by: Niklaus Giger <niklaus.giger@netstal.com>
+
+commit e4170e5a50c8110f792bc37472833ae669d69951
+Author: Stefan Roese <sr@denx.de>
+Date:  Tue Mar 11 13:52:25 2008 +0100
+
+    ppc4xx: Fix comment in 405EX DDR2 init code
+
+    Signed-off-by: Stefan Roese <sr@denx.de>
+
+commit 766529fccc860ecb9e955b4239dff69cd9e4ea09
+Author: Bartlomiej Sieka <tur@semihalf.com>
+Date:  Fri Mar 14 16:22:34 2008 +0100
+
+    Add MD5 support to the new uImage format
+
+    Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>
+
+commit 0ede0c383530a418cf98be9122371a86573cd0db
+Author: Bartlomiej Sieka <tur@semihalf.com>
+Date:  Fri Mar 14 16:22:34 2008 +0100
+
+    Add the MD5 algorithm
+
+    MD5 supoprt is turned on by defining CONFIG_MD5, the digest can be then
+    calculated using the md5() function -- see include/md5.h for details.
+
+    Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>
+
+commit b8aa57b5d4d69e8f0810a5e632c0ce41c0f46ee0
+Author: Wolfgang Denk <wd@denx.de>
+Date:  Fri Mar 14 16:04:54 2008 +0100
+
+    tools/setlocalversion: use a git-describe-ish format
+
+    Change the automatic local version to have the form -nnnnn-gSHA1SUMID,
+    where 'nnnnn' is the number of commits since the last tag (i.e.,
+    1.3.2-rc3).  This makes it much easier to recognize "newer" versions
+    and to see how much has been changed since the referenced tag.
+
+    Stolen from Linux kernel's scripts/setlocalversio, see commit d882421f.
+
+    Signed-off-by: Wolfgang Denk <wd@denx.de>
+
+commit c6dc21c84de0f159a1752c5ebd33cff843f63609
+Author: Wolfgang Denk <wd@denx.de>
+Date:  Thu Mar 13 14:32:03 2008 +0100
+
+    HMI1001: add support for MPC5200 Rev. B processors.
+
+    Signed-off-by: Wolfgang Denk <wd@denx.de>
+
+commit 90f13dce7a7a9a84d5730576c9a24d0dbb07cb3a
+Author: Wolfgang Denk <wd@denx.de>
+Date:  Thu Mar 13 14:29:49 2008 +0100
+
+    TQM5200: remove dead code
+
+    This board never used a MGT5100 processor.
+
+    Signed-off-by: Wolfgang Denk <wd@denx.de>
+
+commit afe45c87e3c5d77bad76b1a57dccd20764d45b5d
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Wed Mar 12 12:14:15 2008 +0100
+
+    [new uImage] Fix build issue on ARM
+
+    ARM platforms don't have a bd->bi_memsize so use bd->bi_dram[0].size instead.
+
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+
+commit 3310c549a73a949430bfda90876df7552a1dab0c
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Wed Mar 12 12:13:13 2008 +0100
+
+    [new uImage] Add new uImage format documentation and examples
+
+    Create doc/uImage.FIT documentation directory with the following files:
+    - command_syntax_extensions.txt : extended command syntax description
+    - howto.txt                            : short usage howto
+    - source_file_format.txt       : internal new uImage format description
+
+    Add example image source files:
+    - kernel.its
+    - kernel_fdt.its
+    - multi.its
+
+    Update README appropriately.
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+    Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>
+
+commit 1ec73761d2e247078f4520a265d463e8b73391a2
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Wed Mar 12 10:35:52 2008 +0100
+
+    [new uImage] Fix definition of common bootm_headers_t fields
+
+    verify, autostart and lmb fields are used regardless of CONFIG_FIT
+    setting, move their definitions to common section.
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit 1d1cb4270edc6a99276834064069717f9782c491
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Wed Mar 12 10:35:51 2008 +0100
+
+    [new uImage] Fix build problems on trab board
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit f773bea8e11f4a11c388dcee956b2444203e6b65
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Wed Mar 12 10:35:46 2008 +0100
+
+    [new uImage] Add proper ramdisk/FDT handling when FIT configuration is used
+
+    Save FIT configuration provied in the first bootm argument and use it
+    when to get ramdisk/FDT subimages when second and third (ramdisk/FDT)
+    arguments are not specified.
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit 2682ce8a4225f23d72bb7fed069e928dd39d34ae
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Wed Mar 12 10:33:01 2008 +0100
+
+    [new uImage] More verbose kernel image uncompress error message
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit 1372cce2b9040fb640e5032b84e3a033a22d6ff0
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Wed Mar 12 10:33:01 2008 +0100
+
+    [new uImage] Use show_boot_progress() for new uImage format
+
+    This patch allocates a set of show_boot_progress() IDs for new uImage format
+    and adds show_boot_progress() calls in new uImage format handling code.
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit c28c4d193dbfb20b2dd3a5447640fd6de7fd0720
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Wed Mar 12 10:33:01 2008 +0100
+
+    [new uImage] Add new uImage fromat support to fpga command
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit 09475f7527460e426c0e0628fc5b8f3754fbaa23
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Wed Mar 12 10:33:01 2008 +0100
+
+    [new uImage] Add new uImage format handling to other bootm related commands
 
-    ppc4xx: Add basic support for AMCC 460EX/460GT (3/5)
+    Updated commands:
 
-    This patch adds basic support for the AMCC 460EX/460GT PPC's.
+    docboot  - cmd_doc.c
+    fdcboot  - cmd_fdc.c
+    diskboot - cmd_ide.c
+    nboot    - cmd_nand.c
+    scsiboot - cmd_scsi.c
+    usbboot  - cmd_usb.c
 
-    Signed-off-by: Stefan Roese <sr@denx.de>
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
 
-commit 2801b2d2a9906f206ab9ee8d0b6e746d2b7fe05a
-Author: Stefan Roese <sr@denx.de>
-Date:  Tue Mar 11 15:05:50 2008 +0100
+commit 1b7897f28d49a80d78d760ec6f6f11dc0f914338
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Wed Mar 12 10:33:00 2008 +0100
 
-    ppc4xx: Add basic support for AMCC 460EX/460GT (2/5)
+    [new uImage] Add new uImage format support to imgextract command
 
-    This patch adds basic support for the AMCC 460EX/460GT PPC's.
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
 
-    Signed-off-by: Stefan Roese <sr@denx.de>
+commit 424c4abdd175d2c470510df8ce0e32d3f463ec16
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Wed Mar 12 10:33:00 2008 +0100
 
-commit 8ac41e3e37c3080c6b1d9461d654161cfe2aa492
-Author: Stefan Roese <sr@denx.de>
-Date:  Tue Mar 11 15:05:26 2008 +0100
+    [new uImage] Add new uImage format support to autoscript routine
 
-    ppc4xx: Add basic support for AMCC 460EX/460GT (1/5)
+    autoscript() routine is updated to accept second argument, which
+    is only used for FIT images and provides a FIT subimage unit name.
 
-    This patch adds basic support for the AMCC 460EX/460GT PPC's.
+    autoscript() routine callers must now pass two arguments. For
+    non-interactive use (like in cmd_load.c, cmd_net.c), new environment
+    variable 'autoscript_uname' is introduced and used as a FIT
+    subimage unit name source.
 
-    Signed-off-by: Stefan Roese <sr@denx.de>
+    autoscript command accepts extended syntax of the addr argument:
+    addr:<subimg_uname>
 
-commit 56e410178375d9f20be25fb24e180974f0ae120b
-Author: Stefan Roese <sr@denx.de>
-Date:  Tue Feb 19 22:07:57 2008 +0100
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
 
-    ppc4xx: interrupt.c reworked
+commit cd7c596e9f561dbbc17b717277438aee78cde14f
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Wed Mar 12 10:33:00 2008 +0100
 
-    This patch is a rework of the 4xx interrupt handling done while
-    adding the 460EX/GT support. Interrupts are needed on 4xx for the
-    EMAC driver.
+    [new uImage] Add new uImage format support to arch specific do_bootm_linux() routines
 
-    Signed-off-by: Stefan Roese <sr@denx.de>
+    This patch updates architecture specific implementations of
+    do_bootm_linux() adding new uImage format handling for
+    operations like get kernel entry point address, get kernel
+    image data start address.
 
-commit 84a999b6cdd0b02dc7de2cacc306eaa84afe2b46
-Author: Stefan Roese <sr@denx.de>
-Date:  Tue Feb 19 22:01:57 2008 +0100
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
 
-    ppc4xx: program_tlb now uses 64bit physical addess
+commit 3dfe110149311425919e6d6a14b561b4207498f1
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Wed Mar 12 10:32:59 2008 +0100
 
-    This patch changes the physical addess parameter from 32bit to 64bit.
-    This is needed for 36bit 4xx platforms to access areas located
-    beyond the 4GB border, like SoC peripherals (EBC etc.).
+    [new uImage] Add node offsets for FIT images listed in struct bootm_headers
 
-    Signed-off-by: Stefan Roese <sr@denx.de>
+    This patch adds new node offset fields to struct bootm_headers
+    and updates bootm_headers processing code to make use of them.
+    Saved node offsets allow to avoid repeating fit_image_get_node() calls.
 
-commit c3307fa186af85771924c434997089b8104c0a46
-Author: Stefan Roese <sr@denx.de>
-Date:  Tue Feb 19 21:58:25 2008 +0100
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
 
-    ppc4xx: miiphy.c reworked
+commit bc8ed486b125452ba3bd8344f052f437329150c5
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Wed Mar 12 10:32:53 2008 +0100
 
-    While adding the 460EX/GT support I reworked the 4xx miiphy code. It
-    badly neede some cleanup.
+    [new uImage] ppc: Add new uImage format support to FDT handling routines
 
-    Signed-off-by: Stefan Roese <sr@denx.de>
+    Support for new (FIT) format uImages is added to powerpc specific
+    boot_get_fdt() routine which now recognizes, sanity checks FIT image
+    and is able to access data sections of the requested component image.
 
-commit 88aff62df39c0756241ea9f9b5a7b3ade26cb82b
-Author: Stefan Roese <sr@denx.de>
-Date:  Tue Feb 19 16:21:49 2008 +0100
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
 
-    rtc: Add M41T62 support
+commit a44a269a905f924b420020506a4d7d7eedcc0eaf
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Wed Mar 12 10:14:57 2008 +0100
 
-    This patch add support for the STM M41T62 RTC. It is used and tested
-    on the AMCC Canyonlands 406EX platform.
+    [new uImage] Re-enable interrupts for non automatic booting
 
-    Signed-off-by: Stefan Roese <sr@denx.de>
+    Re-enable interrupts if we return from do_bootm_<os> and 'autostart'
+    environment variable is not set to 'yes'.
 
-commit 217d383e201adc7f2271145ae345ea5eae2b7170
-Author: Niklaus Giger <niklaus.giger@netstal.com>
-Date:  Mon Feb 25 18:46:43 2008 +0100
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
 
-    ppc4xx: Add 405GPr based MCU25 board specific files
+commit d985c8498c4e47095820da97aa722381d39172c5
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Wed Mar 12 10:14:38 2008 +0100
 
-    Signed-off-by: Niklaus Giger <niklaus.giger@netstal.com>
+    [new uImage] Remove unnecessary arguments passed to ramdisk routines
 
-commit 75a66dcdb383863ad33f0534cfc27b7a86947dad
-Author: Niklaus Giger <niklaus.giger@netstal.com>
-Date:  Mon Feb 25 18:46:42 2008 +0100
+    boot_get_ramdisk() and image_get_ramdisk() do not need all
+    cmdtp, flag, argc and argv arguments. Simplify routines definition.
 
-    ppc4xx: Add 405GPr based MCU25 board config file
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
 
-    Signed-off-by: Niklaus Giger <niklaus.giger@netstal.com>
+commit c87796483bc7c2900470dc747c367f602577608d
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Wed Mar 12 10:12:37 2008 +0100
 
-commit b05f35436b733a240559e77e46bed8439665ecc5
-Author: Niklaus Giger <niklaus.giger@netstal.com>
-Date:  Mon Feb 25 18:46:41 2008 +0100
+    [new uImage] Add new uImage format support for ramdisk handling
 
-    ppc4xx: Add 405GPr based MCU25 board. Global files
+    This patch updates boot_get_ramdisk() routine adding format
+    verification and handling for new (FIT) uImages.
 
-    Signed-off-by: Niklaus Giger <niklaus.giger@netstal.com>
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
 
-commit 14c27b35ac812a71abce6e3e2f4129d5e9313660
-Author: Niklaus Giger <niklaus.giger@netstal.com>
-Date:  Mon Feb 25 18:37:02 2008 +0100
+commit 6986a385671749ecb3f60cf99e9cbae8e47bb50e
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Wed Mar 12 10:01:05 2008 +0100
 
-    ppc4xx: HCU4/5. remove obsolete hcu_flash.c
+    [new uImage] Add new uImage format support for kernel booting
 
-    Signed-off-by: Niklaus Giger <niklaus.giger@netstal.com>
+    New format uImages are recognized by the bootm command,
+    validity of specified kernel component image is checked and
+    its data section located and used for further processing
+    (uncompress, load, etc.)
 
-commit a079494853cc2bfeddb26673219db0b4b2b31566
-Author: Niklaus Giger <niklaus.giger@netstal.com>
-Date:  Mon Feb 25 18:37:01 2008 +0100
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
 
-    ppc4xx: HCU4/5. Use FLASH_CFI_LEGACY
+commit e32fea6adb620ecf2bd70acf2dd37e53df9d1547
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Tue Mar 11 12:35:20 2008 +0100
 
-    Cleanup: Remove custom flash driver for 8 bit boot-eprom and replace it with
-    the FLASH_CFI_LEGACY et al. config options.
+    [new uImage] Add new uImage format support for imls and iminfo commands
 
-    Signed-off-by: Niklaus Giger <niklaus.giger@netstal.com>
+    imls and iminfo can now recognize nad print out contents of the new (FIT)
+    format uImages.
 
-commit e4170e5a50c8110f792bc37472833ae669d69951
-Author: Stefan Roese <sr@denx.de>
-Date:  Tue Mar 11 13:52:25 2008 +0100
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
 
-    ppc4xx: Fix comment in 405EX DDR2 init code
+commit 9d25438fe7d70cf35a8a293ea5e392fefc672613
+Author: Bartlomiej Sieka <tur@semihalf.com>
+Date:  Tue Mar 11 12:34:47 2008 +0100
 
-    Signed-off-by: Stefan Roese <sr@denx.de>
+    [new uImage] Add support for new uImage format to mkimage tool
 
-commit b8aa57b5d4d69e8f0810a5e632c0ce41c0f46ee0
-Author: Wolfgang Denk <wd@denx.de>
-Date:  Fri Mar 14 16:04:54 2008 +0100
+    Support for the new uImage format (FIT) is added to mkimage tool.
+    Commandline syntax is appropriately extended:
 
-    tools/setlocalversion: use a git-describe-ish format
+    mkimage [-D dtc_options] -f fit-image.its fit-image
 
-    Change the automatic local version to have the form -nnnnn-gSHA1SUMID,
-    where 'nnnnn' is the number of commits since the last tag (i.e.,
-    1.3.2-rc3).  This makes it much easier to recognize "newer" versions
-    and to see how much has been changed since the referenced tag.
+    mkimage (together with dtc) takes fit-image.its and referenced therein
+    binaries (like vmlinux.bin.gz) as inputs, and produces fit-image file -- the
+    final image that can be transferred to the target (e.g., via tftp) and then
+    booted using the bootm command in U-Boot.
 
-    Stolen from Linux kernel's scripts/setlocalversio, see commit d882421f.
+    Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>
 
-    Signed-off-by: Wolfgang Denk <wd@denx.de>
+commit eb6175edd6c120d8b89678243e5a2be362ee8e40
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Mon Mar 10 17:53:49 2008 +0100
 
-commit c6dc21c84de0f159a1752c5ebd33cff843f63609
-Author: Wolfgang Denk <wd@denx.de>
-Date:  Thu Mar 13 14:32:03 2008 +0100
+    [new uImage] Make node unit names const in struct bootm_headers
 
-    HMI1001: add support for MPC5200 Rev. B processors.
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
 
-    Signed-off-by: Wolfgang Denk <wd@denx.de>
+commit 5dfb52138688ccbf0146f62683fe6217b3ce1b05
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Fri Feb 29 21:24:06 2008 +0100
 
-commit 90f13dce7a7a9a84d5730576c9a24d0dbb07cb3a
-Author: Wolfgang Denk <wd@denx.de>
-Date:  Thu Mar 13 14:29:49 2008 +0100
+    [new uImage] New uImage low-level API
 
-    TQM5200: remove dead code
+    Add FDT-based functions for handling new format component images,
+    configurations, node operations, property get/set, etc.
 
-    This board never used a MGT5100 processor.
+    fit_       - routines handling global new format uImage operations
+                 like get/set top level property, process all nodes, etc.
+    fit_image_ - routines handling component images subnodes
+    fit_conf_  - routines handling configurations node
 
-    Signed-off-by: Wolfgang Denk <wd@denx.de>
+    Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
 
 commit 30f1806f60978d707b0cff2d7bf89d141fc24290
 Author: Wolfgang Denk <wd@denx.de>
@@ -829,33 +5061,265 @@ Date:   Mon Feb 25 00:03:10 2008 +0100
 
     actua1/actua2/actua3: Fix multiple unused variable warnings
 
-    - actua1:
-       actux1.c: In function 'checkboard':
-       actux1.c:92: warning: unused variable 'revision'
+    - actua1:
+       actux1.c: In function 'checkboard':
+       actux1.c:92: warning: unused variable 'revision'
+
+    - actua2:
+       actux2.c: In function 'checkboard':
+       actux2.c:100: warning: unused variable 's'
+       actux2.c:99: warning: unused variable 'revision'
+       actux2.c: In function 'reset_phy':
+       actux2.c:130: warning: unused variable 'i'
+
+    - actua3:
+       actux3.c: In function 'checkboard':
+       actux3.c:114: warning: unused variable 'revision'
+
+    Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+
+commit f8fa6368a6a0c02164da8e2f52f18d457c6977bd
+Author: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
+Date:  Sun Feb 24 11:44:29 2008 +0900
+
+    Remove the __STRICT_ANSI__ check from the __u64/__s64 declaration on 32bit targets.
+
+    The previous patch was lacking of i386, microblaze, nios and nios2. This
+    patch tries to fix them.
+
+    Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
+
+commit 05e07b1ea22844e946cfcf7d5e8a0199d18d2a95
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Fri Feb 29 22:22:46 2008 +0100
+
+    [new uImage] Fix FDT blob totalsize calculation in boot_relocate_fdt()
+
+    Do not use global fdt blob pointer, calculate blob size from routine
+    argument blob pointer.
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit d1cc52879c8966507dad9fb575481e6d3985e64e
+Author: David Gibson <david@gibson.dropbear.id.au>
+Date:  Tue Feb 12 00:58:31 2008 +1100
+
+    libfdt: Add and use a node iteration helper function.
+
+    This patch adds an fdt_next_node() function which can be used to
+    iterate through nodes of the tree while keeping track of depth.  This
+    function is used to simplify the iteration code in a lot of other
+    functions, and is also exported for use by library users.
+
+    Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
+
+commit 8cf30809a82902a471866d2f07725ce3b8a22291
+Author: Bartlomiej Sieka <tur@semihalf.com>
+Date:  Fri Feb 29 16:00:24 2008 +0100
+
+    [new uImage] Add libfdt support to mkimage
+
+    Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>
+
+commit a6e530f00d31a8494a0422799b2b9a692a9c0eb9
+Author: Bartlomiej Sieka <tur@semihalf.com>
+Date:  Fri Feb 29 16:00:23 2008 +0100
+
+    [new uImage] Add sha1.o object to mkimage binary build
+
+    Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>
+
+commit df6f1b895c997978f03afe04502ee76b7ba34ab9
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Fri Feb 29 16:00:06 2008 +0100
+
+    [new uImage] Fix component handling for legacy multi component images
+
+    Use uint32_t when accessing size table in image_multi_count() and
+    image_multi_getimg() for multi component images.
+
+    Add missing uimage_to_cpu() endianness conversion.
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit 570abb0ad120f6002bcaa3cf6f32bd4ca2e1b248
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Fri Feb 29 15:59:59 2008 +0100
+
+    [new uImage] Share common uImage code between mkimage and U-boot
+
+    This patch adds the following common routines:
+
+    1) Dedicated mkimage print_header() is replaced with common
+    image_print_contents()
+    image_print_contents_noindent()
+
+    2) Common os/arch/type/comp fields name <--> id translation routines
+    genimg_get_os_name()
+    genimg_get_arch_name()
+    genimg_get_type_name()
+    genimg_get_comp_name()
+    genimg_get_os_id()
+    genimg_get_arch_id()
+    genimg_get_type_id()
+    genimg_get_comp_id()
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit 9a4daad0a35eb5143037eea9f786a3e9d672bdd6
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Fri Feb 29 14:58:34 2008 +0100
+
+    [new uImage] Update naming convention for bootm/uImage related code
+
+    This patch introduces the following prefix convention for the
+    image format handling and bootm related code:
+
+    genimg_            - dual format shared code
+    image_             - legacy uImage format specific code
+    fit_               - new uImage format specific code
+    boot_              - booting process related code
+
+    Related routines are renamed and a few pieces of code are moved around and
+    re-grouped.
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit 75fa002c47171b73fb4c1f2c2fe4d6391c136276
+Author: Kumar Gala <galak@kernel.crashing.org>
+Date:  Wed Feb 27 21:51:51 2008 -0600
+
+    [new uImage] Respect autostart setting in linux bootm
+
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+    Acked-by: Marian Balakowicz <m8@semihalf.com>
+
+commit d3f2fa0d278467b2232e4eb2372f905c3febfbeb
+Author: Kumar Gala <galak@kernel.crashing.org>
+Date:  Wed Feb 27 21:51:50 2008 -0600
+
+    [new uImage] Provide ability to restrict region used for boot images
+
+    Allow the user to set 'bootm_low' and 'bootm_size' env vars as a way
+    to restrict what memory range is used for bootm.
+
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+    Acked-by: Marian Balakowicz <m8@semihalf.com>
+
+commit e822d7fc4dd4755d4d0a22f05e33f33d1a0481da
+Author: Kumar Gala <galak@kernel.crashing.org>
+Date:  Wed Feb 27 21:51:49 2008 -0600
+
+    [new uImage] Use lmb for bootm allocations
+
+    Convert generic ramdisk_high(), get_boot_cmdline(), get_boot_kbd()
+    functions over to using lmb for allocation of the ramdisk, command line
+    and kernel bd info.
+
+    Convert PPC specific fdt_relocate() to use lmb for allocation of the device
+    tree.
+
+    Provided a weak function that board code can call to do additional
+    lmb reserves if needed.
+
+    Also introduce the concept of bootmap_base to specify the offset in
+    physical memory that the bootmap is located at.  This is used for
+    allocations of the cmdline, kernel bd, and device tree as they should
+    be contained within bootmap_base and bootmap_base + CFG_BOOTMAPSZ.
+
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+
+commit f5614e7926863bf0225ec860d9b319741a9c4004
+Author: Kumar Gala <galak@kernel.crashing.org>
+Date:  Wed Feb 27 21:51:48 2008 -0600
+
+    [new uImage] Add autostart flag to bootm_headers structure
+
+    The autostart env variable was dropped as part of the initial new uImage
+    cleanup.  Add it back here so the arch specific code can decide if it
+    wants to really boot or not.
+
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+    Acked-by: Marian Balakowicz <m8@semihalf.com>
+
+commit 4ed6552f715983bfc7d212c1199a1f796f1144ad
+Author: Kumar Gala <galak@kernel.crashing.org>
+Date:  Wed Feb 27 21:51:47 2008 -0600
+
+    [new uImage] Introduce lmb from linux kernel for memory mgmt of boot images
+
+    Introduce the LMB lib used on PPC in the kernel as a clean way to manage
+    the memory spaces used by various boot images and structures.  This code
+    will allow us to simplify the code in bootm and its support functions.
+
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+
+commit 4648c2e7a173b0d7f17bef4adaa0623090c9e904
+Author: Kumar Gala <galak@kernel.crashing.org>
+Date:  Tue Feb 19 22:03:47 2008 -0600
+
+    [new uImage] ppc: Allow boards to specify effective amount of memory
+
+    For historical reasons we limited the stack to 256M because some boards
+    could only map that much via BATS. However newer boards are capable of
+    mapping more memory (for example 85xx is capable of doing up to 2G).
+
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+    Acked-by: Marian Balakowicz <m8@semihalf.com>
+
+commit 274cea2bddbca10cdad7daa518951b75c44ef6bc
+Author: Kumar Gala <galak@kernel.crashing.org>
+Date:  Wed Feb 27 21:51:46 2008 -0600
+
+    [new uImage] rework error handling so common functions don't reset
+
+    Changed image_get_ramdisk() to just return NULL on error and have
+    get_ramdisk() propogate that error to the caller.  It's left to the
+    caller to call do_reset() if it wants to.
+
+    Also moved calling do_reset() in get_fdt() and fdt_relocate() on ppc
+    to a common location.  In the future we will change get_fdt() and
+    fdt_relocate() to return success/failure and not call do_reset() at all.
+
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+    Acked-by: Marian Balakowicz <m8@semihalf.com>
+
+commit d2bc095a639672def11d5d043b5688d0dbd692ec
+Author: Kumar Gala <galak@kernel.crashing.org>
+Date:  Wed Feb 27 21:51:45 2008 -0600
+
+    [new uImage] ppc: Re-order ramdisk/fdt handling sequence
+
+    Doing the fdt before the ramdisk allows us to grow the fdt w/o concern
+    however it does mean we have to go in and fixup the initrd info since
+    we don't know where it will be.
+
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+
+commit 27953493ef025fb698d68c5dee39b36f01f4d530
+Author: Kumar Gala <galak@kernel.crashing.org>
+Date:  Wed Feb 27 21:51:44 2008 -0600
 
-    - actua2:
-       actux2.c: In function 'checkboard':
-       actux2.c:100: warning: unused variable 's'
-       actux2.c:99: warning: unused variable 'revision'
-       actux2.c: In function 'reset_phy':
-       actux2.c:130: warning: unused variable 'i'
+    [new uImage] ppc: Determine if we are booting an OF style
 
-    - actua3:
-       actux3.c: In function 'checkboard':
-       actux3.c:114: warning: unused variable 'revision'
+    If we are bootin OF style than we can skip setting up some things
+    that are used for the old boot method.
 
-    Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+    Acked-by: Marian Balakowicz <m8@semihalf.com>
 
-commit f8fa6368a6a0c02164da8e2f52f18d457c6977bd
-Author: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
-Date:  Sun Feb 24 11:44:29 2008 +0900
+commit a6612bdfe7ef37b9787b66800cf02aaded05fbeb
+Author: Kumar Gala <galak@kernel.crashing.org>
+Date:  Wed Feb 27 21:51:43 2008 -0600
 
-    Remove the __STRICT_ANSI__ check from the __u64/__s64 declaration on 32bit targets.
+    [new uImage] Don't pass kdb to ramdisk_high since we may not have one
 
-    The previous patch was lacking of i386, microblaze, nios and nios2. This
-    patch tries to fix them.
+    We don't actually need the kdb param as we are just using it to get
+    bd->bi_memsize which we can get from gd->bd->bi_memsize.  Also, if we
+    boot via OF we might not actually fill out a kdb.
 
-    Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
+    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+    Acked-by: Marian Balakowicz <m8@semihalf.com>
 
 commit 2b22fa4baee51e6b467c44ea1be0d1ecd86e8775
 Author: Kumar Gala <galak@kernel.crashing.org>
@@ -917,6 +5381,98 @@ Date:     Sun Feb 17 22:56:16 2008 +0100
 
     Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
 
+commit 4efbe9dbb129f857f27856936112c8c02f016be6
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Wed Feb 27 11:02:26 2008 +0100
+
+    [new uImage] Correct raw FDT blob handlig when CONFIG_FIT is disabled
+
+    Dual format image code must properly handle all three FDT passing methods:
+    - raw FDT blob passed
+    - FDT blob embedded in the legacy uImage
+    - FDT blob embedded in the new uImage
+
+    This patch enables proper raw FDT handling when no FIT imaeg support
+    is compiled in. This is a bit tricky as we must dected FIT format even
+    when FIT uImage handling is not enabled as both FIT uImages and raw FDT
+    blobs use tha same low level format (libfdt).
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit ff0734cff0fb5397ce2f4602f4f3e5ec9c8a36e8
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Wed Feb 27 11:02:26 2008 +0100
+
+    [new uImage] POWERPC: Add image_get_fdt() routine
+
+    FDT blob may be passed either: (1) raw (2) or embedded in the legacy uImage
+    (3) or embedded in the new uImage. For the (2) case embedding image must be
+    verified before we get FDT from it. This patch factors out legacy image
+    specific verification routine to the separate helper routine.
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+    Acked-by: Kumar Gala <galak@kernel.crashing.org>
+
+commit 1efd43601f90de21ec6c0ebb9880823e822927b1
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Wed Feb 27 11:02:07 2008 +0100
+
+    [new uImage] Add image_get_kernel() routine
+
+    Legacy image specific verification is factored out to a separate helper
+    routine to keep get_kernel() generic and simple.
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+    Acked-by: Kumar Gala <galak@kernel.crashing.org>
+
+commit 8a5ea3e6168fe6a2780eeaf257a3b19f30dec658
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Wed Feb 27 11:01:04 2008 +0100
+
+    [new uImage] Move image verify flag to bootm_headers structure
+
+    Do not pass image verification flag directly to related routines.
+    Simplify argument passing and move it to the bootm_header structure which
+    contains curently processed image specific data and is already being passed
+    on the argument list.
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+    Acked-by: Kumar Gala <galak@kernel.crashing.org>
+
+commit 823afe7cefe00dafefc6696c1cc7aa828c394234
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Wed Feb 27 11:00:47 2008 +0100
+
+    [Makefile] Sort COBJS in lib_<arch> Makefiles
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit 6f0f9dfc4ee880fbf400a2ebe14238181a6c3f91
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Wed Feb 27 11:00:47 2008 +0100
+
+    [new uImage] Optimize gen_get_image() flow control
+
+    When CONFIG_HAS_DATAFLASH is not defined gen_get_image() routine has nothing
+    to do, update its control flow to better reflect that simple case.
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+    Acked-by: Kumar Gala <galak@kernel.crashing.org>
+
+commit d2ced9eb19ec74f4a359949dbe353427fa6d55ca
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Mon Feb 4 08:28:17 2008 +0100
+
+    [new uImage] POWERPC: Split get_fdt() into get and relocate routines
+
+    PPC specific FDT blob handling code is divided into two separate routines:
+
+    get_fdt()  - find and verify a FDT blob (either raw or image embedded)
+    fdt_relocate()     - move FDT blob to within BOOTMAP if needed
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+    Acked-by: Kumar Gala <galak@kernel.crashing.org>
+
 commit 33fa5c0bfaf465de8ceb23fcd6b397f68b35a817
 Author: Jon Loeliger <jdl@freescale.com>
 Date:  Mon Feb 25 13:13:37 2008 -0600
@@ -982,6 +5538,24 @@ Date:     Sun Feb 24 23:03:10 2008 +0000
 
     Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
 
+commit d5934ad7756f038a393a9cfab76a4fe306d9d930
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Mon Feb 4 08:28:09 2008 +0100
+
+    [new uImage] Add dual format uImage support framework
+
+    This patch adds framework for dual format images. Format detection is added
+    and the bootm controll flow is updated to include cases for new FIT format
+    uImages.
+
+    When the legacy (image_header based) format is detected appropriate
+    legacy specific handling is invoked. For the new (FIT based) format uImages
+    dual boot framework has a minial support, that will only print out a
+    corresponding debug messages. Implementation of the FIT specific handling will
+    be added in following patches.
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
 commit b29661fc1151077776454288051bc9a488351ce8
 Author: Wolfgang Denk <wd@denx.de>
 Date:  Sun Feb 24 15:21:36 2008 +0100
@@ -1272,6 +5846,73 @@ Date:    Sat Feb 16 02:12:37 2008 -0500
 
     Signed-off-by: Mike Frysinger <vapier@gentoo.org>
 
+commit 5583cbf736474ef754e128a54fb78632f57b48fd
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Thu Feb 21 17:27:49 2008 +0100
+
+    [new uImage] Fix erroneous use of image_get_magic() in fdc/usb cmds
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit 2242f5369822bc7780db95c47985bb408ea9157b
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Thu Feb 21 17:27:41 2008 +0100
+
+    [new uImage] Rename and move print_image_hdr() routine
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit f50433d670ec2ee9e96abac67cdc6e5e061a810d
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Thu Feb 21 17:20:20 2008 +0100
+
+    [new uImage] Add fit_parse_conf() and fit_parse_subimage() routines
+
+    Introducing routines for parsing new uImage format bootm arguments:
+    [<addr>]#<conf>            - configuration specification
+    [<addr>]:<subimg>  - subimage specification
+
+    New format images can contain multiple subimages of the same type. For example
+    a single new format image file can contain three kernels, two ramdisks and a
+    couple of FDT blobs. Subimage and configuration specifications are extensions
+    to bootm (and other image-related commands) arguments' syntax that allow to
+    specify which particular subimage should be operated on.
+
+    Subimage specification is used to denote a particular subimage. Configurations
+    are a bit more complex -- they are used to define a particualr booting setup,
+    for example a (kernel, fdt blob) pair, or a (kernel, ramdisk, fdt blob) tuple,
+    etc.
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit fff888a1997ff7de9b29e24050fc4a0fd403ba16
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Thu Feb 21 17:20:19 2008 +0100
+
+    [new uImage] Add gen_get_image() routine
+
+    This routine assures that image (whether legacy or FIT) is not
+    in a special dataflash storage.
+
+    If image address is a dataflash address image is moved to system RAM.
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit 75d3e8fbd93c14d9929d024c75af2d742c76db70
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Thu Feb 21 17:20:18 2008 +0100
+
+    [new uImage] Pull in libfdt if CONFIG_FIT is enabled
+
+    New uImage format (Flattened Image Tree) requires libfdt
+    functionality, print out error message if CONFIG_OF_LIBFDT
+    is not defined.
+
+    New uImage support is enabled by defining CONFIG_FIT (and CONFIG_OF_LIBFDT).
+    This commit turns it on by default.
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
 commit 1ba639da5604a64b3ed884a2cbb1c5414a9fa728
 Author: Michael Schwingen <michael@schwingen.org>
 Date:  Mon Feb 18 23:16:35 2008 +0100
@@ -2050,6 +6691,312 @@ Date:   Thu Jan 17 08:25:45 2008 -0600
 
     Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
 
+commit 5cf746c303710329f8040d9c62ee354313e3e91f
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Thu Jan 31 13:59:09 2008 +0100
+
+    [new uImage] Move kernel data find code to get_kernel() routine
+
+    Verification of the kernel image (in old format) and finding kernel
+    data is moved to a dedicated routine. The routine will also hold
+    support for, to be added, new image format.
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit 7b325454fd231d4273de3fe373850f777fb086bf
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Thu Jan 31 13:58:20 2008 +0100
+
+    [new uImage] Cleanup FDT handling in PPC do_boot_linux()
+
+    Move FDT blob finding and relocation to a dedicated
+    get_fdt() routine. It increases code readability and
+    will make adding support for new uImage format easier.
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit b6b0fe6460b7063ac60b9a3531ef210aedb31451
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Thu Jan 31 13:58:13 2008 +0100
+
+    [new uImage] Cleanup do_botm_linux() boot allocations
+
+    This patch moves common pre-boot allocation steps shared between PPC
+    and M68K to a helper routines:
+
+    common:
+    - get_boot_sp_limit()
+    - get_boot_cmline()
+    - get_boot_kbd()
+
+    platform:
+    - set_clocks_in_mhz()
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit ceaed2b1e54ebf14d600e02fef016c8df5cc4d40
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Thu Jan 31 13:57:17 2008 +0100
+
+    [new uImage] Move ramdisk loading to a common routine
+
+    Ramdisk loading code, including initrd_high variable handling,
+    was duplicated for PPC and M68K platforms. This patch creates
+    common helper routine that is being called from both platform
+    do_bootm_linux() routines.
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit 68d4f05e6b2383a442fb71f80f2a9fbb3d8def68
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Thu Jan 31 13:55:53 2008 +0100
+
+    [new uImage] Removed dead ramdisk code on microblaze architectures
+
+    Microblaze do_bootm_linux() includes ramdisk processing code but
+    the ramdisk does not get used anywhere later on.
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit 5ad03eb3854c162684222a718b44c0716ea0db03
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Thu Jan 31 13:55:39 2008 +0100
+
+    [new uImage] Factor out common image_get_ramdisk() routine
+
+    Architecture specific do_bootm_linux() routines share common
+    ramdisk image processing code. Move this code to a common
+    helper routine.
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit d3c5eb6dd1f4ed3c3388386cf1d1bf82aa51d56b
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Thu Jan 31 13:20:08 2008 +0100
+
+    [new uImage] Move FDT error printing to common fdt_error() routine
+
+    FDT error handling in PPC do_bootm_linux() shares the same message format.
+    This patch moves error message printing to a helper fdt_error() routine.
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+    Acked-by: Gerald Van Baren <vanbaren@cideas.com>
+
+commit 42b73e8ee00d48004791dea64b8093fb974c57e1
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Thu Jan 31 13:20:07 2008 +0100
+
+    [new uImage] Factor out common routines for getting os/arch/type/comp names
+
+    Move numeric-id to name translation for image os/arch/type/comp header
+    fields to a helper routines: image_get_os_name(), image_get_arch_name(),
+    image_get_type_name(), image_get_comp_name().
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit e99c26694a384221d336f6448c06a57479c0baa4
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Thu Jan 31 13:20:07 2008 +0100
+
+    [new uImage] Remove standalone applications handling from boootm
+
+    Standalone applications are supposed to be run using the "go" command.
+    This patch removes standalone images handling from the do_bootm().
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit 4a2ad5ff6400698433dd7203d34939c3c9cc9bff
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Thu Jan 31 13:20:07 2008 +0100
+
+    [new uImage] Remove OF_FLAT_TREE support from PPC bootm code
+
+    Support for OF_FLAT_TREE is to be obsoleted in the near future,
+    remove related code from the bootm routines.
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit 82850f3d32a2661868ec6876bed7a22c55cef718
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Thu Jan 31 13:20:06 2008 +0100
+
+    [new uImage] Use image API in SH do_bootm_linux() routine
+
+    Introduce image handling API for lately added Hitachi SH architecture.
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit 4a995edec1ac163d9326d143ffe2b47e7543407f
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Thu Jan 31 13:20:06 2008 +0100
+
+    [new uImage] Rename architecture specific bootm code files
+
+    Implementation of the do_bootm_linux() and other bootm helper routines is
+    architecture specific code. As such it resides in lib_<arch> directories
+    in files named <arch>_linux.c
+
+    This patch renames those files to a more clear and accurate
+    lib_<arch>/bootm.c form.
+
+    List of the renamed files:
+       lib_arm/armlinux.c -> lib_arm/bootm.c
+       lib_avr32/avr32_linux.c -> lib_avr32/bootm.c
+       lib_blackfin/bf533_linux.c -> lib_blackfin/bootm.c
+       lib_i386/i386_linux.c -> lib_i386/bootm.c
+       lib_m68k/m68k_linux.c -> lib_m68k/bootm.c
+       lib_microblaze/microblaze_linux.c -> lib_microblaze/bootm.c
+       lib_mips/mips_linux.c -> lib_mips/bootm.c
+       lib_nios/nios_linux.c -> lib_nios/bootm.c
+       lib_nios2/nios_linux.c -> lib_nios2/bootm.c
+       lib_ppc/ppc_linux.c -> lib_ppc/bootm.c
+       lib_sh/sh_linux.c -> lib_sh/bootm.c
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit 7582438c285bf0cef82909d0f232de64ec567a8a
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Thu Jan 31 13:20:06 2008 +0100
+
+    [new uImage] Return error on image move/uncompress overwrites
+
+    Check for overwrites during image move/uncompress, return with error
+    when the original image gets corrupted. Report clear message to the user
+    and prevent further troubles when pointer to the corrupted images is passed
+    to do_bootm_linux routine.
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit f13e7b2e993c61fed1f607962501e051940d6e80
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Tue Jan 8 18:12:17 2008 +0100
+
+    [new uImage] Cleanup image header pointer use in bootm code
+
+    - use single image header pointer instead of a set of auxilliary variables.
+    - add multi component image helper routines: get component size/data address
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit 1ee1180b6e93e56d0282ac8d943e448e9d0eab20
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Tue Jan 8 18:17:10 2008 +0100
+
+    [new uImage] Cleanup cmd_bootm.c
+
+    - sort and cleanup headers, declarations, etc.
+    - group related routines
+    - cleanup indentation, white spaces
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit af13cdbc01eaf88880978bfb4f603e012818ba24
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Tue Jan 8 18:11:45 2008 +0100
+
+    [new uImage] Add memmove_wd() common routine
+
+    Move common, watchdog sensible memmove code to a helper memmmove_wd() routine.
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit 958fc48abddeab513ea4847e34f22a2e9fe67fe1
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Tue Jan 8 18:11:44 2008 +0100
+
+    [new uImage] Fix FDT header verification in PPC do_boot_linux() routine
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit 15158971f49255ccef54f0979a942cfd3de2ae52
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Tue Jan 8 18:11:44 2008 +0100
+
+    [new uImage] Fix uImage header pointer use in i386 do_bootm_linux()
+
+    Use image header copy instead of a (possibly corrupted) pointer to
+    a initial image location.
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit 261dcf4624b25f3c551efcf8634e9194fabba9c3
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Tue Jan 8 18:11:44 2008 +0100
+
+    [new uImage] Remove I386 uImage fake_header() routine
+
+    I386 targets are not using a uImage format, instead fake header
+    is added to ram image before it is further processed by bootm.
+
+    Remove this fixup and force proper uImage use for I386.
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit 559316faf7eae0614c91d77f509b57d6c4c091ba
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Tue Jan 8 18:11:44 2008 +0100
+
+    [new uImage] Move CHUNKSZ definition to image.h
+
+    CHUNKSZ defined for PPC and M68K is set to the same value of 64K,
+    move this definition to a common header.
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit 321359f20823e0b8c5ad38b64d007a6c48cda16e
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Tue Jan 8 18:11:43 2008 +0100
+
+    [new uImage] Move gunzip() common code to common/gunzip.c
+
+    Move gunzip(), zalloc() and zfree() to a separate file.
+    Share zalloc() and zfree() with cramfs uncompress routine.
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit d45d5a18b6b36688f2365623f9d550566c664b5b
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Tue Jan 8 18:11:43 2008 +0100
+
+    [new uImage] Cleanup OF/FDT #if/#elif/#endif use in do_bootm_linux()
+
+    Make CONFIG_OF_LIBFDT and CONFIG_OF_FLAT_TREE use more
+    readable in PPC variant of do_bootm_linux() routine.
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit 5d3cc55ecbae277e08f5ff771da20b1d6a36ec36
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Tue Jan 8 18:11:43 2008 +0100
+
+    [new uImage] Move PPC do_bootm_linux() to lib_ppc/ppc_linux.c
+
+    PPC implementation of do_bootm_linux() routine is moved to
+    a dedicated file lib_ppc/ppc_linux.c
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit b97a2a0a21f279d66de8a9bdbfe21920968bcb1c
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Tue Jan 8 18:14:09 2008 +0100
+
+    [new uImage] Define a API for image handling operations
+
+    - Add inline helper macros for basic header processing
+    - Move common non inline code common/image.c
+    - Replace direct header access with the API routines
+    - Rename IH_CPU_* to IH_ARCH_*
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
+commit ed29bc4e8142b46b626f67524207b36e43d9aad6
+Author: Marian Balakowicz <m8@semihalf.com>
+Date:  Thu Jan 31 13:19:58 2008 +0100
+
+    Add missing cmd_ximg.o to common/Makefile
+
+    Signed-off-by: Marian Balakowicz <m8@semihalf.com>
+
 commit 37e3c62fa07a823e7569c872e3a9395d227ed8e3
 Author: Grzegorz Bernacki <gjb@semihalf.com>
 Date:  Mon Jan 28 10:15:02 2008 +0100
diff --git a/CREDITS b/CREDITS
index 1627dc7..e84ef38 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -236,6 +236,10 @@ E: mark.jonas@freescale.com
 D: Support for Freescale Total5200 platform
 W: http://www.mobilegt.com/
 
+N: Mark Jonas
+E: mark.jonas@de.bosch.com
+D: Support for MPR2 board
+
 N: Sam Song
 E: samsongshu@yahoo.com.cn
 D: Port to the RPXlite_DW board
@@ -431,6 +435,7 @@ D: Support for EP82xxM
 N: Art Shipkowski
 E: art@videon-central.com
 D: Support for NetSilicon NS7520
+D: Support for ColdFire MCF5275
 
 N: Michal Simek
 E: monstr@monstr.eu
index ffe0f51..d1782b4 100644 (file)
@@ -322,6 +322,7 @@ Stefan Roese <sr@denx.de>
        bunbinga                PPC405EP
        canyonlands             PPC460EX
        ebony                   PPC440GP
+       glacier                 PPC460GT
        haleakala               PPC405EXr
        katmai                  PPC440SPe
        kilauea                 PPC405EX
@@ -529,6 +530,11 @@ Dave Peverley <dpeverley@mpc-data.co.uk>
 
        omap730p2               ARM926EJS
 
+Stelian Pop <stelian.pop@leadtechdesign.com>
+
+       at91cap9adk             ARM926EJS (AT91CAP9 SoC)
+       at91sam9260ek           ARM926EJS (AT91SAM9260 SoC)
+
 Stefan Roese <sr@denx.de>
 
        ixdpg425                xscale
@@ -554,6 +560,10 @@ Richard Woodruff <r-woodruff2@ti.com>
 
        omap2420h4              ARM1136EJS
 
+Kyungmin Park <kyungmin.park@samsung.com>
+
+       apollon                 ARM1136EJS
+
 Alex Züpke <azu@sysgo.de>
 
        lart                    SA1100
@@ -654,10 +664,6 @@ Matthias Fuchs <matthias.fuchs@esd-electronics.com>
 
        TASREG                  MCF5249
 
-Zachary P. Landau <zachary.landau@labxtechnologies.com>
-
-       r5200                   mcf52x2
-
 TsiChung Liew <Tsi-Chung.Liew@freescale.com>
 
        M52277EVB               mcf5227x
@@ -694,15 +700,40 @@ Haavard Skinnemoen <hskinnemoen@atmel.com>
 #      Board                   CPU                                     #
 #########################################################################
 
-Nobuhiro Iwmaatsu <iwamatsu@nigauri.org>
+Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
 
        MS7750SE                SH7750
        MS7722SE                SH7722
+       R7780MP                 SH7780
+       R2DPlus                 SH7751R
+
+Mark Jonas <mark.jonas@de.bosch.com>
+
+       mpr2                    SH7720
 
 Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
 
        MS7720SE                SH7720
 
+Yusuke Goda <goda.yusuke@renesas.com>
+
+       MIGO-R                  SH7722
+
+#########################################################################
+# Blackfin Systems:                                                    #
+#                                                                      #
+# Maintainer Name, Email Address                                       #
+#      Board                   CPU                                     #
+#########################################################################
+
+Mike Frysinger <vapier@gentoo.org>
+Blackfin Team <u-boot-devel@blackfin.uclinux.org>
+
+       BF533-EZKIT             BF533
+       BF533-STAMP             BF533
+       BF537-STAMP             BF537
+       BF561-EZKIT             BF561
+
 #########################################################################
 # End of MAINTAINERS list                                              #
 #########################################################################
diff --git a/MAKEALL b/MAKEALL
index 01573da..38911ed 100755 (executable)
--- a/MAKEALL
+++ b/MAKEALL
@@ -185,6 +185,7 @@ LIST_4xx="          \
        ERIC            \
        EXBITGEN        \
        G2000           \
+       glacier         \
        haleakala       \
        haleakala_nand  \
        hcu4            \
@@ -259,6 +260,7 @@ LIST_824x="         \
        debris          \
        eXalion         \
        HIDDEN_DRAGON   \
+       linkstation_HGLAN       \
        MOUSSE          \
        MUSENKI         \
        MVBLUE          \
@@ -384,12 +386,6 @@ LIST_74xx="                \
        ZUMA            \
 "
 
-LIST_TSEC="            \
-       ${LIST_85xx}    \
-       ${LIST_86xx}    \
-       ${LIST_83xx}    \
-"
-
 LIST_7xx="             \
        BAB7xx          \
        CPCI750         \
@@ -398,6 +394,16 @@ LIST_7xx="         \
        ppmc7xx         \
 "
 
+#########################################################################
+## PowerPC groups
+#########################################################################
+
+LIST_TSEC="            \
+       ${LIST_83xx}    \
+       ${LIST_85xx}    \
+       ${LIST_86xx}    \
+"
+
 LIST_ppc="             \
        ${LIST_5xx}     \
        ${LIST_512x}    \
@@ -451,6 +457,7 @@ LIST_ARM7="         \
 LIST_ARM9="                    \
        at91cap9adk             \
        at91rm9200dk            \
+       at91sam9260ek           \
        cmc_pu2                 \
        ap920t                  \
        ap922_XA10              \
@@ -462,6 +469,8 @@ LIST_ARM9="                 \
        cp926ejs                \
        cp946es                 \
        cp966                   \
+       csb637                  \
+       kb9202                  \
        lpd7a400                \
        m501sk                  \
        mp2usb                  \
@@ -471,6 +480,7 @@ LIST_ARM9="                 \
        omap1510inn             \
        omap1610h2              \
        omap1610inn             \
+       omap5912osk             \
        omap730p2               \
        sbc2410x                \
        scb9328                 \
@@ -502,6 +512,9 @@ LIST_ARM11="                \
        cp1136          \
        omap2420h4      \
        apollon         \
+       imx31_litekit   \
+       imx31_phycore   \
+       mx31ads         \
 "
 
 #########################################################################
@@ -536,6 +549,9 @@ LIST_ixp="          \
        scpu            \
 "
 
+#########################################################################
+## ARM groups
+#########################################################################
 
 LIST_arm="             \
        ${LIST_SA}      \
@@ -640,8 +656,8 @@ LIST_nios2="                \
 #########################################################################
 
 LIST_microblaze="      \
-       suzaku          \
        ml401           \
+       suzaku          \
        xupv2p          \
 "
 
@@ -660,13 +676,13 @@ LIST_coldfire="                   \
        M5253EVB                \
        M5271EVB                \
        M5272C3                 \
+       M5275EVB                \
        M5282EVB                \
        M5329AFEE               \
        M5373EVB                \
        M54455EVB               \
        M5475AFE                \
        M5485AFE                \
-       r5200                   \
        TASREG                  \
 "
 
@@ -696,13 +712,17 @@ LIST_blackfin="           \
 ## SH Systems
 #########################################################################
 
+LIST_sh3="             \
+       mpr2            \
+       ms7720se        \
+"
+
 LIST_sh4="             \
        ms7750se        \
        ms7722se        \
-"
-
-LIST_sh3="             \
-       ms7720se        \
+       Migo-R          \
+       r7780mp         \
+       r2dplus         \
 "
 
 LIST_sh="              \
@@ -710,6 +730,12 @@ LIST_sh="          \
        ${LIST_sh4}     \
 "
 
+#########################################################################
+## SPARC Systems
+#########################################################################
+
+LIST_sparc="gr_xc3s_1500       gr_cpci_ax2000  gr_ep2s60       grsim   grsim_leon2"
+
 #-----------------------------------------------------------------------
 
 #----- for now, just run PPC by default -----
@@ -736,16 +762,17 @@ build_target() {
 for arg in $@
 do
        case "$arg" in
-       arm|SA|ARM7|ARM9|ARM10|ARM11|ixp|pxa| \
-       avr32| \
-       blackfin| \
-       coldfire| \
-       microblaze| \
-       mips|mips_el| \
-       nios|nios2| \
-       ppc|5xx|5xxx|512x|8xx|8220|824x|8260|83xx|85xx|86xx|4xx|7xx|74xx| \
-       x86|I486|TSEC| \
-       sh|sh4|sh3 \
+       arm|SA|ARM7|ARM9|ARM10|ARM11|ixp|pxa \
+       |avr32 \
+       |blackfin \
+       |coldfire \
+       |microblaze \
+       |mips|mips_el \
+       |nios|nios2 \
+       |ppc|5xx|5xxx|512x|8xx|8220|824x|8260|83xx|85xx|86xx|4xx|7xx|74xx|TSEC \
+       |sh|sh3|sh4 \
+       |sparc \
+       |x86|I486 \
        )
                        for target in `eval echo '$LIST_'${arg}`
                        do
index b2b59b2..86e44d0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -123,6 +123,10 @@ unexport CDPATH
 
 #########################################################################
 
+ifeq ($(ARCH),powerpc)
+ARCH = ppc
+endif
+
 ifeq ($(obj)include/config.mk,$(wildcard $(obj)include/config.mk))
 
 # load ARCH, BOARD, and CPU configuration
@@ -165,7 +169,10 @@ CROSS_COMPILE = avr32-linux-
 endif
 ifeq ($(ARCH),sh)
 CROSS_COMPILE = sh4-linux-
-endif  # sh
+endif
+ifeq ($(ARCH),sparc)
+CROSS_COMPILE = sparc-elf-
+endif  # sparc
 endif  # HOSTARCH,ARCH
 endif  # CROSS_COMPILE
 
@@ -331,10 +338,12 @@ $(U_BOOT_NAND):   $(NAND_SPL) $(obj)u-boot.bin $(obj)include/autoconf.mk
                cat $(obj)nand_spl/u-boot-spl-16k.bin $(obj)u-boot.bin > $(obj)u-boot-nand.bin
 
 $(ONENAND_IPL):        $(VERSION_FILE) $(obj)include/autoconf.mk
-               $(MAKE) -C onenand_ipl/board/$(BOARDDIR) all
+               $(MAKE) -C $(obj)onenand_ipl/board/$(BOARDDIR) all
 
 $(U_BOOT_ONENAND):     $(ONENAND_IPL) $(obj)u-boot.bin $(obj)include/autoconf.mk
+               $(MAKE) -C $(obj)onenand_ipl/board/$(BOARDDIR) all
                cat $(obj)onenand_ipl/onenand-ipl-2k.bin $(obj)u-boot.bin > $(obj)u-boot-onenand.bin
+               cat $(obj)onenand_ipl/onenand-ipl-4k.bin $(obj)u-boot.bin > $(obj)u-boot-flexonenand.bin
 
 $(VERSION_FILE):
                @( echo -n "#define U_BOOT_VERSION \"U-Boot " ; \
@@ -415,7 +424,7 @@ $(obj)include/autoconf.mk: $(obj)include/config.h $(VERSION_FILE)
        @$(XECHO) Generating include/autoconf.mk ; \
        set -e ; \
        : Generate the dependancies ; \
-       $(CC) -M $(HOST_CFLAGS) $(CPPFLAGS) -MQ $@ include/common.h > $@.dep ; \
+       $(CC) -x c -M $(HOST_CFLAGS) $(CPPFLAGS) -MQ $@ include/common.h > $@.dep ; \
        : Extract the config macros ; \
        $(CPP) $(CFLAGS) -dM include/common.h | sed -n -f tools/scripts/define2mk.sed > $@
 
@@ -1162,13 +1171,21 @@ bubinga_config: unconfig
 CANBT_config:  unconfig
        @$(MKCONFIG) $(@:_config=) ppc ppc4xx canbt esd
 
-canyonlands_config:    unconfig
-       @$(MKCONFIG) $(@:_config=) ppc ppc4xx canyonlands amcc
+# Canyonlands & Glacier use different U-Boot images
+canyonlands_config \
+glacier_config:        unconfig
+       @mkdir -p $(obj)include
+       @echo "#define CONFIG_$$(echo $(subst ,,$(@:_config=)) | \
+               tr '[:lower:]' '[:upper:]')" >$(obj)include/config.h
+       @$(MKCONFIG) -n $@ -a canyonlands ppc ppc4xx canyonlands amcc
 
-canyonlands_nand_config:       unconfig
+canyonlands_nand_config \
+glacier_nand_config:   unconfig
        @mkdir -p $(obj)include $(obj)board/amcc/canyonlands
        @mkdir -p $(obj)nand_spl/board/amcc/canyonlands
        @echo "#define CONFIG_NAND_U_BOOT" > $(obj)include/config.h
+       @echo "#define CONFIG_$$(echo $(subst ,,$(@:_nand_config=)) | \
+               tr '[:lower:]' '[:upper:]')" >> $(obj)include/config.h
        @$(MKCONFIG) -n $@ -a canyonlands ppc ppc4xx canyonlands amcc
        @echo "TEXT_BASE = 0x01000000" > $(obj)board/amcc/canyonlands/config.tmp
        @echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk
@@ -1484,6 +1501,18 @@ HIDDEN_DRAGON_config: unconfig
 kvme080_config: unconfig
        @$(MKCONFIG) $(@:_config=) ppc mpc824x kvme080 etin
 
+# HDLAN is broken ATM. Should be fixed as soon as hardware is available and as
+# time permits.
+#linkstation_HDLAN_config \
+# Remove this line when HDLAN is fixed
+linkstation_HGLAN_config: unconfig
+       @mkdir -p $(obj)include
+       @case $@ in \
+               *HGLAN*) echo "#define CONFIG_HGLAN 1" >$(obj)include/config.h; ;; \
+               *HDLAN*) echo "#define CONFIG_HLAN 1" >$(obj)include/config.h; ;; \
+       esac
+       @$(MKCONFIG) -n $@ -a linkstation ppc mpc824x linkstation
+
 MOUSSE_config: unconfig
        @$(MKCONFIG) $(@:_config=) ppc mpc824x mousse
 
@@ -1601,7 +1630,7 @@ PQ2FADS-ZU_66MHz_config   \
 PQ2FADS-ZU_66MHz_lowboot_config        \
        :               unconfig
        @mkdir -p $(obj)include
-       @mkdir -p $(obj)board/mpc8260ads
+       @mkdir -p $(obj)board/freescale/mpc8260ads
        $(if $(findstring PQ2FADS,$@), \
        @echo "#define CONFIG_ADSTYPE CFG_PQ2FADS" > $(obj)include/config.h, \
        @echo "#define CONFIG_ADSTYPE CFG_"$(subst MPC,,$(word 1,$(subst _, ,$@))) > $(obj)include/config.h)
@@ -1610,13 +1639,13 @@ PQ2FADS-ZU_66MHz_lowboot_config \
        $(if $(findstring VR,$@), \
        @echo "#define CONFIG_8260_CLKIN 66000000" >> $(obj)include/config.h))
        @[ -z "$(findstring lowboot_,$@)" ] || \
-               { echo "TEXT_BASE = 0xFF800000" >$(obj)board/mpc8260ads/config.tmp ; \
+               { echo "TEXT_BASE = 0xFF800000" >$(obj)board/freescale/mpc8260ads/config.tmp ; \
                  $(XECHO) "... with lowboot configuration" ; \
                }
-       @$(MKCONFIG) -a MPC8260ADS ppc mpc8260 mpc8260ads
+       @$(MKCONFIG) -a MPC8260ADS ppc mpc8260 mpc8260ads freescale
 
 MPC8266ADS_config:     unconfig
-       @$(MKCONFIG) $(@:_config=) ppc mpc8260 mpc8266ads
+       @$(MKCONFIG) $(@:_config=) ppc mpc8260 mpc8266ads freescale
 
 # PM825/PM826 default configuration:  small (= 8 MB) Flash / boot from 64-bit flash
 PM825_config   \
@@ -1809,15 +1838,15 @@ M5271EVB_config :               unconfig
 M5272C3_config :               unconfig
        @$(MKCONFIG) $(@:_config=) m68k mcf52x2 m5272c3
 
+M5275EVB_config :              unconfig
+       @$(MKCONFIG) $(@:_config=) m68k mcf52x2 m5275evb freescale
+
 M5282EVB_config :              unconfig
        @$(MKCONFIG) $(@:_config=) m68k mcf52x2 m5282evb
 
 TASREG_config :                unconfig
        @$(MKCONFIG) $(@:_config=) m68k mcf52x2 tasreg esd
 
-r5200_config :         unconfig
-       @$(MKCONFIG) $(@:_config=) m68k mcf52x2 r5200
-
 M5329AFEE_config \
 M5329BFEE_config :     unconfig
        @case "$@" in \
@@ -2235,7 +2264,7 @@ EVB64260_750CX_config:    unconfig
        @$(MKCONFIG) EVB64260 ppc 74xx_7xx evb64260
 
 mpc7448hpc2_config:  unconfig
-       @$(MKCONFIG) $(@:_config=) ppc 74xx_7xx mpc7448hpc2
+       @$(MKCONFIG) $(@:_config=) ppc 74xx_7xx mpc7448hpc2 freescale
 
 P3G4_config: unconfig
        @$(MKCONFIG) $(@:_config=) ppc 74xx_7xx evb64260
@@ -2286,14 +2315,9 @@ shannon_config   :       unconfig
 ## ARM92xT Systems
 #########################################################################
 
-xtract_trab = $(subst _bigram,,$(subst _bigflash,,$(subst _old,,$(subst _config,,$1))))
-
-xtract_omap1610xxx = $(subst _cs0boot,,$(subst _cs3boot,,$(subst _cs_autoboot,,$(subst _config,,$1))))
-
-xtract_omap730p2 = $(subst _cs0boot,,$(subst _cs3boot,, $(subst _config,,$1)))
-
-at91cap9adk_config     :       unconfig
-       @$(MKCONFIG) $(@:_config=) arm arm926ejs at91cap9adk atmel at91cap9
+#########################################################################
+## Atmel AT91RM9200 Systems
+#########################################################################
 
 at91rm9200dk_config    :       unconfig
        @$(MKCONFIG) $(@:_config=) arm arm920t at91rm9200dk atmel at91rm9200
@@ -2304,12 +2328,25 @@ cmc_pu2_config  :       unconfig
 csb637_config  :       unconfig
        @$(MKCONFIG) $(@:_config=) arm arm920t csb637 NULL at91rm9200
 
+kb9202_config  :       unconfig
+       @$(MKCONFIG) $(@:_config=) arm arm920t kb9202 NULL at91rm9200
+
 mp2usb_config  :       unconfig
        @$(MKCONFIG) $(@:_config=) arm arm920t mp2usb NULL at91rm9200
 
 m501sk_config  :       unconfig
        @$(MKCONFIG) $(@:_config=) arm arm920t m501sk NULL at91rm9200
 
+#########################################################################
+## Atmel ARM926EJ-S Systems
+#########################################################################
+
+at91cap9adk_config     :       unconfig
+       @$(MKCONFIG) $(@:_config=) arm arm926ejs at91cap9adk atmel at91sam9
+
+at91sam9260ek_config   :       unconfig
+       @$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9260ek atmel at91sam9
+
 ########################################################################
 ## ARM Integrator boards - see doc/README-integrator for more info.
 integratorap_config    \
@@ -2336,9 +2373,6 @@ cp922_XA10_config \
 cp1026_config: unconfig
        @board/integratorcp/split_by_variant.sh $@
 
-kb9202_config  :       unconfig
-       @$(MKCONFIG) $(@:_config=) arm arm920t kb9202 NULL at91rm9200
-
 lpd7a400_config \
 lpd7a404_config:       unconfig
        @$(MKCONFIG) $(@:_config=) arm lh7a40x lpd7a40x
@@ -2367,6 +2401,8 @@ davinci_schmoogie_config :        unconfig
 davinci_sonata_config :        unconfig
        @$(MKCONFIG) $(@:_config=) arm arm926ejs sonata davinci davinci
 
+xtract_omap1610xxx = $(subst _cs0boot,,$(subst _cs3boot,,$(subst _cs_autoboot,,$(subst _config,,$1))))
+
 omap1610inn_config \
 omap1610inn_cs0boot_config \
 omap1610inn_cs3boot_config \
@@ -2388,6 +2424,8 @@ omap1610h2_cs_autoboot_config:    unconfig
        fi;
        @$(MKCONFIG) -a $(call xtract_omap1610xxx,$@) arm arm926ejs omap1610inn NULL omap
 
+xtract_omap730p2 = $(subst _cs0boot,,$(subst _cs3boot,, $(subst _config,,$1)))
+
 omap730p2_config \
 omap730p2_cs0boot_config \
 omap730p2_cs3boot_config :     unconfig
@@ -2417,6 +2455,8 @@ SX1_config :              unconfig
        @$(MKCONFIG) $(@:_config=) arm arm925t sx1
 
 # TRAB default configuration:  8 MB Flash, 32 MB RAM
+xtract_trab = $(subst _bigram,,$(subst _bigflash,,$(subst _old,,$(subst _config,,$1))))
+
 trab_config \
 trab_bigram_config \
 trab_bigflash_config \
@@ -2462,11 +2502,6 @@ cm4008_config    :       unconfig
 cm41xx_config  :       unconfig
        @$(MKCONFIG) $(@:_config=) arm arm920t cm41xx NULL ks8695
 
-gth2_config            :       unconfig
-       @mkdir -p $(obj)include
-       @echo "#define CONFIG_GTH2 1" >$(obj)include/config.h
-       @$(MKCONFIG) -a gth2 mips mips gth2
-
 #########################################################################
 ## S3C44B0 Systems
 #########################################################################
@@ -2582,14 +2617,23 @@ zylonite_config :
 ## ARM1136 Systems
 #########################################################################
 omap2420h4_config      : unconfig
-       @$(MKCONFIG) $(@:_config=) arm arm1136 omap2420h4
+       @$(MKCONFIG) $(@:_config=) arm arm1136 omap2420h4 NULL omap24xx
 
 apollon_config         : unconfig
        @mkdir -p $(obj)include
        @echo "#define CONFIG_ONENAND_U_BOOT" > $(obj)include/config.h
-       @$(MKCONFIG) $(@:_config=) arm arm1136 apollon
+       @$(MKCONFIG) $(@:_config=) arm arm1136 apollon NULL omap24xx
        @echo "CONFIG_ONENAND_U_BOOT = y" >> $(obj)include/config.mk
 
+imx31_litekit_config   : unconfig
+       @$(MKCONFIG) $(@:_config=) arm arm1136 imx31_litekit NULL mx31
+
+imx31_phycore_config   : unconfig
+       @$(MKCONFIG) $(@:_config=) arm arm1136 imx31_phycore NULL mx31
+
+mx31ads_config         : unconfig
+       @$(MKCONFIG) $(@:_config=) arm arm1136 mx31ads NULL mx31
+
 #========================================================================
 # i386
 #========================================================================
@@ -2669,6 +2713,11 @@ pb1000_config            :       unconfig
        @echo "#define CONFIG_PB1000 1" >$(obj)include/config.h
        @$(MKCONFIG) -a pb1x00 mips mips pb1x00
 
+gth2_config:   unconfig
+       @mkdir -p $(obj)include
+       @echo "#define CONFIG_GTH2 1" >$(obj)include/config.h
+       @$(MKCONFIG) -a gth2 mips mips gth2
+
 qemu_mips_config: unconfig
        @mkdir -p $(obj)include
        @echo "#define CONFIG_QEMU_MIPS 1" >$(obj)include/config.h
@@ -2795,7 +2844,7 @@ xupv2p_config:    unconfig
 BFIN_BOARDS = bf533-ezkit bf533-stamp bf537-stamp bf561-ezkit
 
 $(BFIN_BOARDS:%=%_config)      : unconfig
-       @$(MKCONFIG) $(@:_config=) blackfin $(firstword $(subst -, ,$@)) $(@:_config=)
+       @$(MKCONFIG) $(@:_config=) blackfin blackfin $(@:_config=)
 
 $(BFIN_BOARDS):
        $(MAKE) $@_config
@@ -2805,7 +2854,7 @@ $(BFIN_BOARDS):
 # AVR32
 #========================================================================
 #########################################################################
-## AT32AP7xxx
+## AT32AP70xx
 #########################################################################
 
 atstk1002_config       :       unconfig
@@ -2827,6 +2876,11 @@ atngw100_config  :       unconfig
 #########################################################################
 ## sh3 (Renesas SuperH)
 #########################################################################
+mpr2_config: unconfig
+       @ >include/config.h
+       @echo "#define CONFIG_MPR2 1" >> include/config.h
+       @$(MKCONFIG) -a $(@:_config=) sh sh3 mpr2
+
 ms7720se_config: unconfig
        @echo "#define CONFIG_MS7720SE 1" > include/config.h
        @$(MKCONFIG) -a $(@:_config=) sh sh3 ms7720se
@@ -2842,6 +2896,53 @@ ms7722se_config :        unconfig
        @echo "#define CONFIG_MS7722SE 1" > $(obj)include/config.h
        @$(MKCONFIG) -a $(@:_config=) sh sh4 ms7722se
 
+MigoR_config :       unconfig
+       @ >include/config.h
+       @echo "#define CONFIG_MIGO_R 1" >> include/config.h
+       @./mkconfig -a $(@:_config=) sh sh4 MigoR
+
+r7780mp_config: unconfig
+       @ >include/config.h
+       @echo "#define CONFIG_R7780MP 1" >> include/config.h
+       @./mkconfig -a $(@:_config=) sh sh4 r7780mp
+
+r2dplus_config  :   unconfig
+       @ >include/config.h
+       @echo "#define CONFIG_R2DPLUS 1" >> include/config.h
+       @./mkconfig -a $(@:_config=) sh sh4 r2dplus
+
+#========================================================================
+# SPARC
+#========================================================================
+#########################################################################
+## LEON3
+#########################################################################
+
+# Gaisler GR-XC3S-1500 board
+gr_xc3s_1500_config : unconfig
+       @$(MKCONFIG) $(@:_config=) sparc leon3 gr_xc3s_1500 gaisler
+
+# Gaisler GR-CPCI-AX2000 board, a General purpose FPGA-AX system
+gr_cpci_ax2000_config : unconfig
+       @$(MKCONFIG) $(@:_config=) sparc leon3 gr_cpci_ax2000 gaisler
+
+# Gaisler GRLIB template design (GPL SPARC/LEON3) for Altera NIOS
+# Development board Stratix II edition, FPGA Device EP2S60.
+gr_ep2s60_config: unconfig
+       @$(MKCONFIG) $(@:_config=) sparc leon3 gr_ep2s60 gaisler
+
+# Gaisler LEON3 GRSIM simulator
+grsim_config : unconfig
+       @$(MKCONFIG) $(@:_config=) sparc leon3 grsim gaisler
+
+#########################################################################
+## LEON2
+#########################################################################
+
+# Gaisler LEON2 GRSIM simulator
+grsim_leon2_config : unconfig
+       @$(MKCONFIG) $(@:_config=) sparc leon2 grsim_leon2 gaisler
+
 #########################################################################
 #########################################################################
 #########################################################################
@@ -2863,9 +2964,11 @@ clean:
               $(obj)board/netstar/{eeprom,crcek,crcit,*.srec,*.bin}      \
               $(obj)board/trab/trab_fkt   $(obj)board/voiceblue/eeprom   \
               $(obj)board/{integratorap,integratorcp}/u-boot.lds         \
-              $(obj)board/{bf533-ezkit,bf533-stamp,bf537-stamp,bf561-ezkit}/u-boot.lds
-       @rm -f $(obj)include/bmp_logo.h $(obj)nand_spl/{u-boot-spl,u-boot-spl.map}
-       @rm -f $(obj)onenand_ipl/onenand-{ipl,ipl.bin,ipl-2k.bin,ipl.map}
+              $(obj)board/{bf533-ezkit,bf533-stamp,bf537-stamp,bf561-ezkit}/u-boot.lds \
+              $(obj)cpu/blackfin/bootrom-asm-offsets.[chs]
+       @rm -f $(obj)include/bmp_logo.h
+       @rm -f $(obj)nand_spl/{u-boot-spl,u-boot-spl.map,System.map}
+       @rm -f $(obj)onenand_ipl/onenand-{ipl,ipl.bin,ipl-2k.bin,ipl-4k.bin,ipl.map}
        @rm -f $(obj)api_examples/demo $(VERSION_FILE)
        @find $(OBJTREE) -type f \
                \( -name 'core' -o -name '*.bak' -o -name '*~' \
@@ -2880,7 +2983,9 @@ clobber:  clean
        @rm -f $(OBJS) $(obj)*.bak $(obj)ctags $(obj)etags $(obj)TAGS \
                $(obj)cscope.* $(obj)*.*~
        @rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL)
-       @rm -f $(obj)tools/{crc32.c,environment.c,env/crc32.c,sha1.c,inca-swap-bytes}
+       @rm -f $(obj)tools/{crc32.c,environment.c,env/crc32.c,md5.c,sha1.c,inca-swap-bytes}
+       @rm -f $(obj)tools/{image.c,fdt.c,fdt_ro.c,fdt_rw.c,fdt_strerror.c,zlib.h}
+       @rm -f $(obj)tools/{fdt_wip.c,libfdt_internal.h}
        @rm -f $(obj)cpu/mpc824x/bedbug_603e.c
        @rm -f $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm
        @[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -lname "*" -print | xargs rm -f
diff --git a/README b/README
index b230fde..36ae0fb 100644 (file)
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000 - 2005
+# (C) Copyright 2000 - 2008
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
@@ -51,7 +51,8 @@ Makefile have been tested to some extent and can be considered
 "working". In fact, many of them are used in production systems.
 
 In case of problems see the CHANGELOG and CREDITS files to find out
-who contributed the specific port.
+who contributed the specific port. The MAINTAINERS file lists board
+maintainers.
 
 
 Where to get help:
@@ -65,6 +66,22 @@ before asking FAQ's. Please see
 http://lists.sourceforge.net/lists/listinfo/u-boot-users/
 
 
+Where to get source code:
+=========================
+
+The U-Boot source code is maintained in the git repository at
+git://www.denx.de/git/u-boot.git ; you can browse it online at
+http://www.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=summary
+
+The "snapshot" links on this page allow you to download tarballs of
+any version you might be interested in. Ofifcial releases are also
+available for FTP download from the ftp://ftp.denx.de/pub/u-boot/
+directory.
+
+Pre-built (and tested) images are available from
+ftp://ftp.denx.de/pub/u-boot/images/
+
+
 Where we come from:
 ===================
 
@@ -81,6 +98,7 @@ Where we come from:
 - create ARMBoot project (http://sourceforge.net/projects/armboot)
 - add other CPU families (starting with ARM)
 - create U-Boot project (http://sourceforge.net/projects/u-boot)
+- current project page: see http://www.denx.de/wiki/UBoot
 
 
 Names and Spelling:
@@ -135,6 +153,8 @@ Directory Hierarchy:
   - at32ap     Files specific to Atmel AVR32 AP CPUs
   - i386       Files specific to i386 CPUs
   - ixp                Files specific to Intel XScale IXP CPUs
+  - leon2      Files specific to Gaisler LEON2 SPARC CPU
+  - leon3      Files specific to Gaisler LEON3 SPARC CPU
   - mcf52x2    Files specific to Freescale ColdFire MCF52x2 CPUs
   - mcf5227x   Files specific to Freescale ColdFire MCF5227x CPUs
   - mcf532x    Files specific to Freescale ColdFire MCF5329 CPUs
@@ -168,7 +188,8 @@ Directory Hierarchy:
 - lib_mips     Files generic to MIPS    architecture
 - lib_nios     Files generic to NIOS    architecture
 - lib_ppc      Files generic to PowerPC architecture
-- libfdt       Library files to support flattened device trees
+- lib_sparc    Files generic to SPARC   architecture
+- libfdt       Library files to support flattened device trees
 - net          Networking code
 - post         Power On Self Test
 - rtc          Real Time Clock drivers
@@ -320,7 +341,7 @@ The following options need to be configured:
                converts clock data to MHZ before passing it to the
                Linux kernel.
                When CONFIG_CLOCKS_IN_MHZ is defined, a definition of
-               "clocks_in_mhz=1" is  automatically  included  in  the
+               "clocks_in_mhz=1" is automatically included in the
                default environment.
 
                CONFIG_MEMSIZE_IN_BYTES         [relevant for MIPS only]
@@ -354,19 +375,6 @@ The following options need to be configured:
 
                boards with QUICC Engines require OF_QE to set UCC mac addresses
 
-               CONFIG_OF_HAS_BD_T
-
-                * CONFIG_OF_LIBFDT - enables the "fdt bd_t" command
-                * CONFIG_OF_FLAT_TREE - The resulting flat device tree
-                    will have a copy of the bd_t.  Space should be
-                    pre-allocated in the dts for the bd_t.
-
-               CONFIG_OF_HAS_UBOOT_ENV
-
-                * CONFIG_OF_LIBFDT - enables the "fdt env" command
-                * CONFIG_OF_FLAT_TREE - The resulting flat device tree
-                    will have a copy of u-boot's environment variables
-
                CONFIG_OF_BOARD_SETUP
 
                Board code has addition modification that it wants to make
@@ -664,6 +672,7 @@ The following options need to be configured:
 
                CONFIG_RTC_MPC8xx       - use internal RTC of MPC8xx
                CONFIG_RTC_PCF8563      - use Philips PCF8563 RTC
+               CONFIG_RTC_MC13783      - use MC13783 RTC
                CONFIG_RTC_MC146818     - use MC146818 RTC
                CONFIG_RTC_DS1307       - use Maxim, Inc. DS1307 RTC
                CONFIG_RTC_DS1337       - use Maxim, Inc. DS1337 RTC
@@ -671,6 +680,7 @@ The following options need to be configured:
                CONFIG_RTC_DS164x       - use Dallas DS164x RTC
                CONFIG_RTC_ISL1208      - use Intersil ISL1208 RTC
                CONFIG_RTC_MAX6900      - use Maxim, Inc. MAX6900 RTC
+               CFG_RTC_DS1337_NOOSC    - Turn off the OSC output for DS1337
 
                Note that if the RTC uses I2C, then the I2C interface
                must also be configured. See I2C Support, below.
@@ -686,9 +696,9 @@ The following options need to be configured:
                CONFIG_MAC_PARTITION and/or CONFIG_DOS_PARTITION
                and/or CONFIG_ISO_PARTITION
 
-               If IDE or SCSI support  is  enabled  (CONFIG_CMD_IDE or
-               CONFIG_CMD_SCSI) you must configure support for at least
-               one partition type as well.
+               If IDE or SCSI support is enabled (CONFIG_CMD_IDE or
+               CONFIG_CMD_SCSI) you must configure support for at
+               least one partition type as well.
 
 - IDE Reset method:
                CONFIG_IDE_RESET_ROUTINE - this is defined in several
@@ -732,6 +742,9 @@ The following options need to be configured:
                CONFIG_E1000
                Support for Intel 8254x gigabit chips.
 
+               CONFIG_E1000_FALLBACK_MAC
+               default MAC for empty eeprom after production.
+
                CONFIG_EEPRO100
                Support for Intel 82557/82559/82559ER chips.
                Optional CONFIG_EEPRO100_SROM_WRITE enables eeprom
@@ -1132,6 +1145,20 @@ The following options need to be configured:
                of the "hostname" environment variable is passed as
                option 12 to the DHCP server.
 
+               CONFIG_BOOTP_DHCP_REQUEST_DELAY
+
+               A 32bit value in microseconds for a delay between
+               receiving a "DHCP Offer" and sending the "DHCP Request".
+               This fixes a problem with certain DHCP servers that don't
+               respond 100% of the time to a "DHCP request". E.g. On an
+               AT91RM9200 processor running at 180MHz, this delay needed
+               to be *at least* 15,000 usec before a Windows Server 2003
+               DHCP server would reply 100% of the time. I recommend at
+               least 50,000 usec to be safe. The alternative is to hope
+               that one of the retries will be successful but note that
+               the DHCP timeout and retry process takes a longer than
+               this delay.
+
  - CDP Options:
                CONFIG_CDP_DEVICE_ID
 
@@ -1325,7 +1352,7 @@ The following options need to be configured:
                This option specifies a list of I2C devices that will be skipped
                when the 'i2c probe' command is issued (or 'iprobe' using the legacy
                command).  If CONFIG_I2C_MULTI_BUS is set, specify a list of bus-device
-               pairs.  Otherwise, specify a 1D array of device addresses
+               pairs.  Otherwise, specify a 1D array of device addresses
 
                e.g.
                        #undef  CONFIG_I2C_MULTI_BUS
@@ -1388,6 +1415,11 @@ The following options need to be configured:
                Currently supported on some MPC8xxx processors.  For an
                example, see include/configs/mpc8349emds.h.
 
+               CONFIG_MXC_SPI
+
+               Enables the driver for the SPI controllers on i.MX and MXC
+               SoCs. Currently only i.MX31 is supported.
+
 - FPGA Support: CONFIG_FPGA
 
                Enables FPGA subsystem.
@@ -1660,6 +1692,8 @@ The following options need to be configured:
                example, some LED's) on your board. At the moment,
                the following checkpoints are implemented:
 
+Legacy uImage format:
+
   Arg  Where                   When
     1  common/cmd_bootm.c      before attempting to boot an image
    -1  common/cmd_bootm.c      Image header has bad     magic number
@@ -1670,25 +1704,26 @@ The following options need to be configured:
     4  common/cmd_bootm.c      Image data   has correct checksum
    -4  common/cmd_bootm.c      Image is for unsupported architecture
     5  common/cmd_bootm.c      Architecture check OK
-   -5  common/cmd_bootm.c      Wrong Image Type (not kernel, multi, standalone)
+   -5  common/cmd_bootm.c      Wrong Image Type (not kernel, multi)
     6  common/cmd_bootm.c      Image Type check OK
    -6  common/cmd_bootm.c      gunzip uncompression error
    -7  common/cmd_bootm.c      Unimplemented compression type
     7  common/cmd_bootm.c      Uncompression OK
-   -8  common/cmd_bootm.c      Wrong Image Type (not kernel, multi, standalone)
-    8  common/cmd_bootm.c      Image Type check OK
+    8  common/cmd_bootm.c      No uncompress/copy overwrite error
    -9  common/cmd_bootm.c      Unsupported OS (not Linux, BSD, VxWorks, QNX)
-    9  common/cmd_bootm.c      Start initial ramdisk verification
-  -10  common/cmd_bootm.c      Ramdisk header has bad     magic number
-  -11  common/cmd_bootm.c      Ramdisk header has bad     checksum
-   10  common/cmd_bootm.c      Ramdisk header is OK
-  -12  common/cmd_bootm.c      Ramdisk data   has bad     checksum
-   11  common/cmd_bootm.c      Ramdisk data   has correct checksum
-   12  common/cmd_bootm.c      Ramdisk verification complete, start loading
-  -13  common/cmd_bootm.c      Wrong Image Type (not PPC Linux Ramdisk)
-   13  common/cmd_bootm.c      Start multifile image verification
-   14  common/cmd_bootm.c      No initial ramdisk, no multifile, continue.
-   15  common/cmd_bootm.c      All preparation done, transferring control to OS
+
+    9  common/image.c          Start initial ramdisk verification
+  -10  common/image.c          Ramdisk header has bad     magic number
+  -11  common/image.c          Ramdisk header has bad     checksum
+   10  common/image.c          Ramdisk header is OK
+  -12  common/image.c          Ramdisk data   has bad     checksum
+   11  common/image.c          Ramdisk data   has correct checksum
+   12  common/image.c          Ramdisk verification complete, start loading
+  -13  common/image.c          Wrong Image Type (not PPC Linux Ramdisk)
+   13  common/image.c          Start multifile image verification
+   14  common/image.c          No initial ramdisk, no multifile, continue.
+
+   15  lib_<arch>/bootm.c      All preparation done, transferring control to OS
 
   -30  lib_ppc/board.c         Fatal error, hang the system
   -31  post/post.c             POST test failed, detected by post_output_backlog()
@@ -1758,6 +1793,59 @@ The following options need to be configured:
   -83  common/cmd_net.c        some error in automatic boot or autoscript
    84  common/cmd_net.c        end without errors
 
+FIT uImage format:
+
+  Arg  Where                   When
+  100  common/cmd_bootm.c      Kernel FIT Image has correct format
+ -100  common/cmd_bootm.c      Kernel FIT Image has incorrect format
+  101  common/cmd_bootm.c      No Kernel subimage unit name, using configuration
+ -101  common/cmd_bootm.c      Can't get configuration for kernel subimage
+  102  common/cmd_bootm.c      Kernel unit name specified
+ -103  common/cmd_bootm.c      Can't get kernel subimage node offset
+  103  common/cmd_bootm.c      Found configuration node
+  104  common/cmd_bootm.c      Got kernel subimage node offset
+ -104  common/cmd_bootm.c      Kernel subimage hash verification failed
+  105  common/cmd_bootm.c      Kernel subimage hash verification OK
+ -105  common/cmd_bootm.c      Kernel subimage is for unsupported architecture
+  106  common/cmd_bootm.c      Architecture check OK
+ -106  common/cmd_bootm.c      Kernel subimage has wrong typea
+  107  common/cmd_bootm.c      Kernel subimge type OK
+ -107  common/cmd_bootm.c      Can't get kernel subimage data/size
+  108  common/cmd_bootm.c      Got kernel subimage data/size
+ -108  common/cmd_bootm.c      Wrong image type (not legacy, FIT)
+ -109  common/cmd_bootm.c      Can't get kernel subimage type
+ -110  common/cmd_bootm.c      Can't get kernel subimage comp
+ -111  common/cmd_bootm.c      Can't get kernel subimage os
+ -112  common/cmd_bootm.c      Can't get kernel subimage load address
+ -113  common/cmd_bootm.c      Image uncompress/copy overwrite error
+
+  120  common/image.c          Start initial ramdisk verification
+ -120  common/image.c          Ramdisk FIT image has incorrect format
+  121  common/image.c          Ramdisk FIT image has correct format
+  122  common/image.c          No Ramdisk subimage unit name, using configuration
+ -122  common/image.c          Can't get configuration for ramdisk subimage
+  123  common/image.c          Ramdisk unit name specified
+ -124  common/image.c          Can't get ramdisk subimage node offset
+  125  common/image.c          Got ramdisk subimage node offset
+ -125  common/image.c          Ramdisk subimage hash verification failed
+  126  common/image.c          Ramdisk subimage hash verification OK
+ -126  common/image.c          Ramdisk subimage for unsupported architecture
+  127  common/image.c          Architecture check OK
+ -127  common/image.c          Can't get ramdisk subimage data/size
+  128  common/image.c          Got ramdisk subimage data/size
+  129  common/image.c          Can't get ramdisk load address
+ -129  common/image.c          Got ramdisk load address
+
+ -130  common/cmd_doc.c        Icorrect FIT image format
+  131  common/cmd_doc.c        FIT image format OK
+
+ -140  common/cmd_ide.c        Icorrect FIT image format
+  141  common/cmd_ide.c        FIT image format OK
+
+ -150  common/cmd_nand.c       Icorrect FIT image format
+  151  common/cmd_nand.c       FIT image format OK
+
+
 Modem Support:
 --------------
 
@@ -1854,6 +1942,27 @@ Configuration Settings:
                Scratch address used by the alternate memory test
                You only need to set this if address zero isn't writeable
 
+- CFG_MEM_TOP_HIDE (PPC only):
+               If CFG_MEM_TOP_HIDE is defined in the board config header,
+               this specified memory area will get subtracted from the top
+               (end) of ram and won't get "touched" at all by U-Boot. By
+               fixing up gd->ram_size the Linux kernel should gets passed
+               the now "corrected" memory size and won't touch it either.
+               This should work for arch/ppc and arch/powerpc. Only Linux
+               board ports in arch/powerpc with bootwrapper support that
+               recalculate the memory size from the SDRAM controller setup
+               will have to get fixed in Linux additionally.
+
+               This option can be used as a workaround for the 440EPx/GRx
+               CHIP 11 errata where the last 256 bytes in SDRAM shouldn't
+               be touched.
+
+               WARNING: Please make sure that this value is a multiple of
+               the Linux page size (normally 4k). If this is not the case,
+               then the end address of the Linux memory will be located at a
+               non page size aligned address and this could cause major
+               problems.
+
 - CFG_TFTP_LOADADDR:
                Default load address for network file downloads
 
@@ -1894,8 +2003,11 @@ Configuration Settings:
 - CFG_BOOTMAPSZ:
                Maximum size of memory mapped by the startup code of
                the Linux kernel; all data that must be processed by
-               the Linux kernel (bd_info, boot arguments, eventually
-               initrd image) must be put below this limit.
+               the Linux kernel (bd_info, boot arguments, FDT blob if
+               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" + CFG_BOOTMAPSZ.
 
 - CFG_MAX_FLASH_BANKS:
                Max number of Flash memory banks
@@ -1940,12 +2052,24 @@ Configuration Settings:
                This option also enables the building of the cfi_flash driver
                in the drivers directory
 
+- CFG_FLASH_USE_BUFFER_WRITE
+               Use buffered writes to flash.
+
+- CONFIG_FLASH_SPANSION_S29WS_N
+               s29ws-n MirrorBit flash has non-standard addresses for buffered
+               write commands.
+
 - CFG_FLASH_QUIET_TEST
                If this option is defined, the common CFI flash doesn't
                print it's warning upon not recognized FLASH banks. This
                is useful, if some of the configured banks are only
                optionally available.
 
+- CONFIG_FLASH_SHOW_PROGRESS
+               If defined (must be an integer), print out countdown
+               digits and dots.  Recommended value: 45 (9..1) for 80
+               column displays, 15 (3..1) for 40 column displays.
+
 - CFG_RX_ETH_BUFFER:
                Defines the number of ethernet receive buffers. On some
                ethernet controllers it is recommended to set this value
@@ -2319,22 +2443,24 @@ Low Level (hardware related) configuration options:
                Overrides the default PCI memory map in cpu/mpc8260/pci.c if set.
 
 - CONFIG_SPD_EEPROM
-               Get DDR timing information from an I2C EEPROM.  Common with pluggable
-               memory modules such as SODIMMs
+               Get DDR timing information from an I2C EEPROM. Common
+               with pluggable memory modules such as SODIMMs
+
   SPD_EEPROM_ADDRESS
                I2C address of the SPD EEPROM
 
 - CFG_SPD_BUS_NUM
-               If SPD EEPROM is on an I2C bus other than the first one, specify here.
-               Note that the value must resolve to something your driver can deal with.
+               If SPD EEPROM is on an I2C bus other than the first
+               one, specify here. Note that the value must resolve
+               to something your driver can deal with.
 
 - CFG_83XX_DDR_USES_CS0
-               Only for 83xx systems. If specified, then DDR should be configured
-               using CS0 and CS1 instead of CS2 and CS3.
+               Only for 83xx systems. If specified, then DDR should
+               be configured using CS0 and CS1 instead of CS2 and CS3.
 
 - CFG_83XX_DDR_USES_CS0
-               Only for 83xx systems. If specified, then DDR should be configured
-               using CS0 and CS1 instead of CS2 and CS3.
+               Only for 83xx systems. If specified, then DDR should
+               be configured using CS0 and CS1 instead of CS2 and CS3.
 
 - CONFIG_ETHER_ON_FEC[12]
                Define to enable FEC[12] on a 8xx series processor.
@@ -2400,29 +2526,30 @@ Low Level (hardware related) configuration options:
 Building the Software:
 ======================
 
-Building U-Boot has been tested in native PPC environments (on a
-PowerBook G3 running LinuxPPC 2000) and in cross environments
-(running RedHat 6.x and 7.x Linux on x86, Solaris 2.6 on a SPARC, and
-NetBSD 1.5 on x86).
-
-If you are not using a native PPC environment, it is assumed that you
-have the GNU cross compiling tools available in your path and named
-with a prefix of "powerpc-linux-". If this is not the case, (e.g. if
-you are using Monta Vista's Hard Hat Linux CDK 1.2) you must change
-the definition of CROSS_COMPILE in Makefile. For HHL on a 4xx CPU,
-change it to:
+Building U-Boot has been tested in several native build environments
+and in many different cross environments. Of course we cannot support
+all possibly existing versions of cross development tools in all
+(potentially obsolete) versions. In case of tool chain problems we
+recommend to use the ELDK (see http://www.denx.de/wiki/DULG/ELDK)
+which is extensively used to build and test U-Boot.
 
-       CROSS_COMPILE = ppc_4xx-
+If you are not using a native environment, it is assumed that you
+have GNU cross compiling tools available in your path. In this case,
+you must set the environment variable CROSS_COMPILE in your shell.
+Note that no changes to the Makefile or any other source files are
+necessary. For example using the ELDK on a 4xx CPU, please enter:
 
+       $ CROSS_COMPILE=ppc_4xx-
+       $ export CROSS_COMPILE
 
-U-Boot is intended to be  simple  to  build.  After  installing         the
-sources         you must configure U-Boot for one specific board type. This
+U-Boot is intended to be simple to build. After installing the
+sources you must configure U-Boot for one specific board type. This
 is done by typing:
 
        make NAME_config
 
-where "NAME_config" is the name of one of the existing
-configurations; see the main Makefile for supported names.
+where "NAME_config" is the name of one of the existing configu-
+rations; see the main Makefile for supported names.
 
 Note: for some board special configuration names may exist; check if
       additional information is available from the board vendor; for
@@ -2498,20 +2625,20 @@ steps:
 Testing of U-Boot Modifications, Ports to New Hardware, etc.:
 ==============================================================
 
-If you have modified U-Boot sources (for instance added a new  board
-or  support  for  new  devices,         a new CPU, etc.) you are expected to
+If you have modified U-Boot sources (for instance added a new board
+or support for new devices, a new CPU, etc.) you are expected to
 provide feedback to the other developers. The feedback normally takes
 the form of a "patch", i. e. a context diff against a certain (latest
-official or latest in CVS) version of U-Boot sources.
+official or latest in the git repository) version of U-Boot sources.
 
-But before you submit such a patch, please verify that your  modifi-
-cation did not break existing code. At least make sure that *ALL* of
+But before you submit such a patch, please verify that your modifi-
+cation did not break existing code. At least make sure that *ALL* of
 the supported boards compile WITHOUT ANY compiler warnings. To do so,
 just run the "MAKEALL" script, which will configure and build U-Boot
-for ALL supported system. Be warned, this will take a while. You  can
-select which  (cross)  compiler  to use by passing a `CROSS_COMPILE'
-environment variable to the script, i. e. to use the cross tools from
-MontaVista's Hard Hat Linux you can type
+for ALL supported system. Be warned, this will take a while. You can
+select which (cross) compiler to use by passing a `CROSS_COMPILE'
+environment variable to the script, i. e. to use the ELDK cross tools
+you can type
 
        CROSS_COMPILE=ppc_8xx- MAKEALL
 
@@ -2519,20 +2646,21 @@ or to build on a native PowerPC system you can type
 
        CROSS_COMPILE=' ' MAKEALL
 
-When using the MAKEALL script, the default behaviour is to build U-Boot
-in the source directory. This location can be changed by setting the
-BUILD_DIR environment variable. Also, for each target built, the MAKEALL
-script saves two log files (<target>.ERR and <target>.MAKEALL) in the
-<source dir>/LOG directory. This default location can be changed by
-setting the MAKEALL_LOGDIR environment variable. For example:
+When using the MAKEALL script, the default behaviour is to build
+U-Boot in the source directory. This location can be changed by
+setting the BUILD_DIR environment variable. Also, for each target
+built, the MAKEALL script saves two log files (<target>.ERR and
+<target>.MAKEALL) in the <source dir>/LOG directory. This default
+location can be changed by setting the MAKEALL_LOGDIR environment
+variable. For example:
 
        export BUILD_DIR=/tmp/build
        export MAKEALL_LOGDIR=/tmp/log
        CROSS_COMPILE=ppc_8xx- MAKEALL
 
-With the above settings build objects are saved in the /tmp/build, log
-files are saved in the /tmp/log and the source tree remains clean during
-the whole build process.
+With the above settings build objects are saved in the /tmp/build,
+log files are saved in the /tmp/log and the source tree remains clean
+during the whole build process.
 
 
 See also "U-Boot Porting Guide" below.
@@ -2624,11 +2752,33 @@ Some configuration options can be set using Environment Variables:
 
   bootfile     - Name of the image to load with TFTP
 
+  bootm_low    - Memory range available for image processing in the bootm
+                 command can be restricted. This variable is given as
+                 a hexadecimal number and defines lowest address allowed
+                 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 descripton of CFG_BOOTMAPSZ.
+
+  bootm_size   - Memory range available for image processing in the bootm
+                 command can be restricted. This variable is given as
+                 a hexadecimal number and defines the size of the region
+                 allowed for use by the bootm command. See also "bootm_low"
+                 environment variable.
+
   autoload     - if set to "no" (any string beginning with 'n'),
                  "bootp" will just load perform a lookup of the
                  configuration from the BOOTP server, but not try to
                  load any image using TFTP
 
+  autoscript   - if set to "yes" commands like "loadb", "loady",
+                 "bootp", "tftpb", "rarpboot" and "nfs" will attempt
+                 to automatically run script images (by internally
+                 calling "autoscript").
+
+  autoscript_uname - if script image is in a format (FIT) this
+                    variable is used to get script subimage unit name.
+
   autostart    - if set to "yes", an image loaded using the "bootp",
                  "rarpboot", "tftpboot" or "diskboot" commands will
                  be automatically started (by internally calling
@@ -2843,10 +2993,24 @@ o If neither SROM nor the environment contain a MAC address, an error
 Image Formats:
 ==============
 
-The "boot" commands of this monitor operate on "image" files which
-can be basicly anything, preceeded by a special header; see the
-definitions in include/image.h for details; basicly, the header
-defines the following image properties:
+U-Boot is capable of booting (and performing other auxiliary operations on)
+images in two formats:
+
+New uImage format (FIT)
+-----------------------
+
+Flexible and powerful format based on Flattened Image Tree -- FIT (similar
+to Flattened Device Tree). It allows the use of images with multiple
+components (several kernels, ramdisks, etc.), with contents protected by
+SHA1, MD5 or CRC32. More details are found in the doc/uImage.FIT directory.
+
+
+Old uImage format
+-----------------
+
+Old image format is based on binary files which can be basically anything,
+preceded by a special header; see the definitions in include/image.h for
+details; basically, the header defines the following image properties:
 
 * Target Operating System (Provisions for OpenBSD, NetBSD, FreeBSD,
   4.4BSD, Linux, SVR4, Esix, Solaris, Irix, SCO, Dell, NCR, VxWorks,
@@ -3088,7 +3252,7 @@ TQM8xxL is in the first Flash bank):
 
 
 You can check the success of the download using the 'iminfo' command;
-this includes a checksum verification so you  can  be  sure  no         data
+this includes a checksum verification so you can be sure no data
 corruption happened:
 
        => imi 40100000
@@ -3433,7 +3597,7 @@ models provide on-chip memory (like the IMMR area on MPC8xx and
 MPC826x processors), on others (parts of) the data cache can be
 locked as (mis-) used as memory, etc.
 
-       Chris Hallinan posted a good summary of  these  issues  to  the
+       Chris Hallinan posted a good summary of these issues to the
        u-boot-users mailing list:
 
        Subject: RE: [U-Boot-Users] RE: More On Memory Bank x (nothingness)?
@@ -3723,6 +3887,8 @@ may be rejected, even when they contain important and valuable stuff.
 
 Patches shall be sent to the u-boot-users mailing list.
 
+Please see http://www.denx.de/wiki/UBoot/Patches for details.
+
 When you send a patch, please include the following information with
 it:
 
@@ -3743,18 +3909,23 @@ it:
 * If your patch adds new configuration options, don't forget to
   document these in the README file.
 
-* The patch itself. If you are accessing the CVS repository use "cvs
-  update; cvs diff -puRN"; else, use "diff -purN OLD NEW". If your
-  version of diff does not support these options, then get the latest
-  version of GNU diff.
+* The patch itself. If you are using git (which is *strongly*
+  recommended) you can easily generate the patch using the
+  "git-format-patch". If you then use "git-send-email" to send it to
+  the U-Boot mailing list, you will avoid most of the common problems
+  with some other mail clients.
+
+  If you cannot use git, use "diff -purN OLD NEW". If your version of
+  diff does not support these options, then get the latest version of
+  GNU diff.
 
-  The current directory when running this command shall be the top
-  level directory of the U-Boot source tree, or it's parent directory
-  (i. e. please make sure that your patch includes sufficient
-  directory information for the affected files).
+  The current directory when running this command shall be the parent
+  directory of the U-Boot source tree (i. e. please make sure that
+  your patch includes sufficient directory information for the
+  affected files).
 
-  We accept patches as plain text, MIME attachments or as uuencoded
-  gzipped text.
+  We prefer patches as plain text. MIME attachments are discouraged,
+  and compressed attachments must not be used.
 
 * If one logical set of modifications affects or creates several
   files, all these changes shall be submitted in a SINGLE patch file.
@@ -3781,4 +3952,6 @@ Notes:
   modification.
 
 * Remember that there is a size limit of 40 kB per message on the
-  u-boot-users mailing list. Compression may help.
+  u-boot-users mailing list. Bigger patches will be moderated. If
+  they are reasonable and not bigger than 100 kB, they will be
+  acknowledged. Even bigger patches should be avoided.
index 0598d90..c1b2b60 100644 (file)
--- a/api/api.c
+++ b/api/api.c
@@ -40,7 +40,6 @@
 
 /* U-Boot routines needed */
 extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
-extern uchar (*env_get_char)(int);
 extern uchar *env_get_addr(int);
 
 /*****************************************************************************
index a7513ea..a9a3d1a 100644 (file)
 # MA 02111-1307 USA
 #
 
+CONFIG_BFIN_CPU := $(strip $(subst ",,$(CONFIG_BFIN_CPU)))
+CONFIG_BFIN_BOOT_MODE := $(strip $(subst ",,$(CONFIG_BFIN_BOOT_MODE)))
+
 PLATFORM_RELFLAGS += -ffixed-P5
 PLATFORM_CPPFLAGS += -DCONFIG_BLACKFIN
 
+ifneq (,$(CONFIG_BFIN_CPU))
+PLATFORM_RELFLAGS += -mcpu=$(CONFIG_BFIN_CPU)
+endif
+
 SYM_PREFIX = _
 
 LDR_FLAGS += --use-vmas
-ifeq (,$(findstring s,$(MAKEFLAGS)))
+ifneq (,$(findstring s,$(MAKEFLAGS)))
 LDR_FLAGS += --quiet
 endif
index 4291d96..4a880e6 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(m68k)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index ef662fa..7b1440b 100644 (file)
@@ -31,7 +31,6 @@
 */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 17f99eb..3578670 100644 (file)
@@ -31,7 +31,6 @@
 */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 3b18009..11b28d7 100644 (file)
@@ -29,7 +29,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 0f9a157..25e16de 100644 (file)
@@ -26,7 +26,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 0f9a157..25e16de 100644 (file)
@@ -26,7 +26,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
diff --git a/board/MigoR/Makefile b/board/MigoR/Makefile
new file mode 100644 (file)
index 0000000..5a9d651
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2007
+# Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+#
+# Copyright (C) 2007
+# Kenati Technologies, Inc.
+#
+# board/MigoR/Makefile
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the 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    = lib$(BOARD).a
+
+OBJS   := migo_r.o
+SOBJS  := lowlevel_init.o
+
+$(LIB):        $(OBJS) $(SOBJS)
+       $(AR) crv $@ $(OBJS) $(SOBJS)
+
+clean:
+       rm -f $(SOBJS) $(OBJS)
+
+distclean:     clean
+       rm -f $(LIB) core *.bak .depend
+
+#########################################################################
+
+.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
+               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+
+-include .depend
+
+#########################################################################
diff --git a/board/MigoR/config.mk b/board/MigoR/config.mk
new file mode 100644 (file)
index 0000000..2c5085a
--- /dev/null
@@ -0,0 +1,31 @@
+#
+# Copyright (C) 2007
+# Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+#
+# Copyright (C) 2007
+# Kenati Technologies, Inc.
+#
+# board/MigoR/config.mk
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the 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
+
+#
+# TEXT_BASE refers to image _after_ relocation.
+#
+# NOTE: Must match value used in u-boot.lds (in this directory).
+#
+
+TEXT_BASE = 0x8FFC0000
diff --git a/board/MigoR/lowlevel_init.S b/board/MigoR/lowlevel_init.S
new file mode 100644 (file)
index 0000000..2ec8e04
--- /dev/null
@@ -0,0 +1,264 @@
+/*
+ * Copyright (C) 2007
+ * Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+ *
+ * Copyright (C) 2007
+ * Kenati Technologies, Inc.
+ *
+ * board/MigoR/lowlevel_init.S
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the 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>
+
+#include <asm/processor.h>
+
+/*
+ *  Board specific low level init code, called _very_ early in the
+ *  startup sequence. Relocation to SDRAM has not happened yet, no
+ *  stack is available, bss section has not been initialised, etc.
+ *
+ *  (Note: As no stack is available, no subroutines can be called...).
+ */
+
+       .global lowlevel_init
+
+       .text
+       .align  2
+
+lowlevel_init:
+       mov.l   CCR_A, r1       ! Address of Cache Control Register
+       mov.l   CCR_D, r0       ! Instruction Cache Invalidate
+       mov.l   r0, @r1
+
+       mov.l   MMUCR_A, r1     ! Address of MMU Control Register
+       mov.l   MMUCR_D, r0     ! TI == TLB Invalidate bit
+       mov.l   r0, @r1
+
+       mov.l   MSTPCR0_A, r1   ! Address of Power Control Register 0
+       mov.l   MSTPCR0_D, r0   !
+       mov.l   r0, @r1
+
+       mov.l   MSTPCR2_A, r1   ! Address of Power Control Register 2
+       mov.l   MSTPCR2_D, r0   !
+       mov.l   r0, @r1
+
+       mov.l   PFC_PULCR_A, r1
+       mov.w   PFC_PULCR_D, r0
+       mov.w   r0,@r1
+
+       mov.l   PFC_DRVCR_A, r1
+       mov.w   PFC_DRVCR_D, r0
+       mov.w   r0, @r1
+
+       mov.l   SBSCR_A, r1     !
+       mov.w   SBSCR_D, r0     !
+       mov.w   r0, @r1
+
+       mov.l   PSCR_A, r1      !
+       mov.w   PSCR_D, r0      !
+       mov.w   r0, @r1
+
+       mov.l   RWTCSR_A, r1    ! 0xA4520004 (Watchdog Control / Status Register)
+       mov.w   RWTCSR_D_1, r0  ! 0xA507 -> timer_STOP/WDT_CLK=max
+       mov.w   r0, @r1
+
+       mov.l   RWTCNT_A, r1    ! 0xA4520000 (Watchdog Count Register)
+       mov.w   RWTCNT_D, r0    ! 0x5A00 -> Clear
+       mov.w   r0, @r1
+
+       mov.l   RWTCSR_A, r1    ! 0xA4520004 (Watchdog Control / Status Register)
+       mov.w   RWTCSR_D_2, r0  ! 0xA504 -> timer_STOP/CLK=500ms
+       mov.w   r0, @r1
+
+       mov.l   DLLFRQ_A, r1    ! 20080115
+       mov.l   DLLFRQ_D, r0    ! 20080115
+       mov.l   r0, @r1
+
+       mov.l   FRQCR_A, r1             ! 0xA4150000 Frequency control register
+       mov.l   FRQCR_D, r0     ! 20080115
+       mov.l   r0, @r1
+
+       mov.l   CCR_A, r1               ! Address of Cache Control Register
+       mov.l   CCR_D_2, r0     ! ??
+       mov.l   r0, @r1
+
+bsc_init:
+       mov.l   CMNCR_A, r1     ! CMNCR address -> R1
+       mov.l   CMNCR_D, r0     ! CMNCR data    -> R0
+       mov.l   r0, @r1         ! CMNCR set
+
+       mov.l   CS0BCR_A, r1    ! CS0BCR address -> R1
+       mov.l   CS0BCR_D, r0    ! CS0BCR data    -> R0
+       mov.l   r0, @r1         ! CS0BCR set
+
+       mov.l   CS4BCR_A, r1    ! CS4BCR address -> R1
+       mov.l   CS4BCR_D, r0    ! CS4BCR data    -> R0
+       mov.l   r0, @r1         ! CS4BCR set
+
+       mov.l   CS5ABCR_A, r1   ! CS5ABCR address -> R1
+       mov.l   CS5ABCR_D, r0   ! CS5ABCR data    -> R0
+       mov.l   r0, @r1         ! CS5ABCR set
+
+       mov.l   CS5BBCR_A, r1   ! CS5BBCR address -> R1
+       mov.l   CS5BBCR_D, r0   ! CS5BBCR data    -> R0
+       mov.l   r0, @r1         ! CS5BBCR set
+
+       mov.l   CS6ABCR_A, r1   ! CS6ABCR address -> R1
+       mov.l   CS6ABCR_D, r0   ! CS6ABCR data    -> R0
+       mov.l   r0, @r1         ! CS6ABCR set
+
+       mov.l   CS0WCR_A, r1    ! CS0WCR address -> R1
+       mov.l   CS0WCR_D, r0    ! CS0WCR data    -> R0
+       mov.l   r0, @r1         ! CS0WCR set
+
+       mov.l   CS4WCR_A, r1    ! CS4WCR address -> R1
+       mov.l   CS4WCR_D, r0    ! CS4WCR data    -> R0
+       mov.l   r0, @r1         ! CS4WCR set
+
+       mov.l   CS5AWCR_A, r1   ! CS5AWCR address -> R1
+       mov.l   CS5AWCR_D, r0   ! CS5AWCR data    -> R0
+       mov.l   r0, @r1         ! CS5AWCR set
+
+       mov.l   CS5BWCR_A, r1   ! CS5BWCR address -> R1
+       mov.l   CS5BWCR_D, r0   ! CS5BWCR data    -> R0
+       mov.l   r0, @r1         ! CS5BWCR set
+
+       mov.l   CS6AWCR_A, r1   ! CS6AWCR address -> R1
+       mov.l   CS6AWCR_D, r0   ! CS6AWCR data    -> R0
+       mov.l   r0, @r1         ! CS6AWCR set
+
+       ! SDRAM initialization
+       mov.l   SDCR_A, r1      ! SB_SDCR address -> R1
+       mov.l   SDCR_D, r0      ! SB_SDCR data    -> R0
+       mov.l   r0, @r1         ! SB_SDCR set
+
+       mov.l   SDWCR_A, r1     ! SB_SDWCR address -> R1
+       mov.l   SDWCR_D, r0     ! SB_SDWCR data    -> R0
+       mov.l   r0, @r1         ! SB_SDWCR set
+
+       mov.l   SDPCR_A, r1     ! SB_SDPCR address -> R1
+       mov.l   SDPCR_D, r0     ! SB_SDPCR data    -> R0
+       mov.l   r0, @r1         ! SB_SDPCR set
+
+       mov.l   RTCOR_A, r1     ! SB_RTCOR address -> R1
+       mov.l   RTCOR_D, r0     ! SB_RTCOR data    -> R0
+       mov.l   r0, @r1         ! SB_RTCOR set
+
+       mov.l   RTCNT_A, r1     ! SB_RTCNT address -> R1
+       mov.l   RTCNT_D, r0     ! SB_RTCNT data    -> R0
+       mov.l   r0, @r1
+
+       mov.l   RTCSR_A, r1     ! SB_RTCSR address -> R1
+       mov.l   RTCSR_D, r0     ! SB_RTCSR data    -> R0
+       mov.l   r0, @r1         ! SB_RTCSR set
+
+       mov.l   RFCR_A, r1      ! SB_RFCR address -> R1
+       mov.l   RFCR_D, r0      ! SB_RFCR data    -> R0
+       mov.l   r0, @r1
+
+       mov.l   SDMR3_A, r1     ! SDMR3 address -> R1
+       mov     #0x00, r0       ! SDMR3 data    -> R0
+       mov.b   r0, @r1         ! SDMR3 set
+
+       ! BL bit off (init = ON)  (?!?)
+
+       stc     sr, r0                          ! BL bit off(init=ON)
+       mov.l   SR_MASK_D, r1
+       and     r1, r0
+       ldc     r0, sr
+
+       rts
+       mov     #0, r0
+
+       .align  4
+
+CCR_A:         .long   CCR
+MMUCR_A:       .long   MMUCR
+MSTPCR0_A:     .long   MSTPCR0
+MSTPCR2_A:     .long   MSTPCR2
+PFC_PULCR_A:   .long   PULCR
+PFC_DRVCR_A:   .long   DRVCR
+SBSCR_A:       .long   SBSCR
+PSCR_A:                .long   PSCR
+RWTCSR_A:      .long   RWTCSR
+RWTCNT_A:      .long   RWTCNT
+FRQCR_A:       .long   FRQCR
+PLLCR_A:       .long   PLLCR
+DLLFRQ_A:      .long   DLLFRQ
+
+CCR_D:         .long   0x00000800
+CCR_D_2:       .long   0x00000103
+MMUCR_D:       .long   0x00000004
+MSTPCR0_D:     .long   0x00001001
+MSTPCR2_D:     .long   0xffffffff
+PFC_PULCR_D:   .long   0x6000
+PFC_DRVCR_D:   .long   0x0464
+FRQCR_D:       .long   0x07033639
+PLLCR_D:       .long   0x00005000
+DLLFRQ_D:      .long   0x000004F6      ! 20080115
+
+CMNCR_A:       .long   CMNCR
+CMNCR_D:       .long   0x0000001B      ! 20080115
+CS0BCR_A:      .long   CS0BCR          ! Flash bank 1
+CS0BCR_D:      .long   0x24920400
+CS4BCR_A:      .long   CS4BCR          !
+CS4BCR_D:      .long   0x10003400      ! 20080115
+CS5ABCR_A:     .long   CS5ABCR         !
+CS5ABCR_D:     .long   0x24920400
+CS5BBCR_A:     .long   CS5BBCR         !
+CS5BBCR_D:     .long   0x24920400
+CS6ABCR_A:     .long   CS6ABCR         !
+CS6ABCR_D:     .long   0x24920400
+
+CS0WCR_A:      .long   CS0WCR
+CS0WCR_D:      .long   0x00000380
+CS4WCR_A:      .long   CS4WCR
+CS4WCR_D:      .long   0x00100A81      ! 20080115
+CS5AWCR_A:     .long   CS5AWCR
+CS5AWCR_D:     .long   0x00000300
+CS5BWCR_A:     .long   CS5BWCR
+CS5BWCR_D:     .long   0x00000300
+CS6AWCR_A:     .long   CS6AWCR
+CS6AWCR_D:     .long   0x00000300
+
+SDCR_A:                .long   SBSC_SDCR
+SDCR_D:                .long   0x80160809      ! 20080115
+SDWCR_A:       .long   SBSC_SDWCR
+SDWCR_D:       .long   0x0014450C      ! 20080115
+SDPCR_A:       .long   SBSC_SDPCR
+SDPCR_D:       .long   0x00000087
+RTCOR_A:       .long   SBSC_RTCOR
+RTCNT_A:       .long   SBSC_RTCNT
+RTCNT_D:       .long   0xA55A0012
+RTCOR_D:       .long   0xA55A001C      ! 20080115
+RTCSR_A:       .long   SBSC_RTCSR
+RFCR_A:                .long   SBSC_RFCR
+RFCR_D:                .long   0xA55A0221
+RTCSR_D:       .long   0xA55A009a      ! 20080115
+SDMR3_A:       .long   0xFE581180      ! 20080115
+
+SR_MASK_D:     .long   0xEFFFFF0F
+
+       .align  2
+
+SBSCR_D:       .word   0x0044
+PSCR_D:                .word   0x0000
+RWTCSR_D_1:    .word   0xA507
+RWTCSR_D_2:    .word   0xA504          ! 20080115
+RWTCNT_D:      .word   0x5A00
diff --git a/board/MigoR/migo_r.c b/board/MigoR/migo_r.c
new file mode 100644 (file)
index 0000000..b31f37d
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2007
+ * Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+ *
+ * Copyright (C) 2007
+ * Kenati Technologies, Inc.
+ *
+ * board/MigoR/migo_r.c
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the 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/processor.h>
+
+int checkboard(void)
+{
+       puts("BOARD: Renesas MigoR\n");
+       return 0;
+}
+
+int board_init(void)
+{
+       return 0;
+}
+
+int dram_init (void)
+{
+       DECLARE_GLOBAL_DATA_PTR;
+
+       gd->bd->bi_memstart = CFG_SDRAM_BASE;
+       gd->bd->bi_memsize = CFG_SDRAM_SIZE;
+       printf("DRAM:  %dMB\n", CFG_SDRAM_SIZE / (1024 * 1024));
+       return 0;
+}
+
+void led_set_state (unsigned short value)
+{
+}
diff --git a/board/MigoR/u-boot.lds b/board/MigoR/u-boot.lds
new file mode 100644 (file)
index 0000000..692bc62
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * Copyrigth (c) 2007
+ * Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+ *
+ * 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-sh-linux", "elf32-sh-linux", "elf32-sh-linux")
+OUTPUT_ARCH(sh)
+ENTRY(_start)
+
+SECTIONS
+{
+       /*
+          Base address of internal SDRAM is 0x0C000000.
+          Although size of SDRAM can be either 16 or 32 MBytes,
+          we assume 16 MBytes (ie ignore upper half if the full
+          32 MBytes is present).
+
+          NOTE: This address must match with the definition of
+          TEXT_BASE in config.mk (in this directory).
+
+       */
+       . = 0x8C000000 + (64*1024*1024) - (256*1024);
+
+       PROVIDE (reloc_dst = .);
+
+       PROVIDE (_ftext = .);
+       PROVIDE (_fcode = .);
+       PROVIDE (_start = .);
+
+       .text :
+       {
+               cpu/sh4/start.o         (.text)
+               . = ALIGN(8192);
+               common/environment.o    (.ppcenv)
+               . = ALIGN(8192);
+               common/environment.o    (.ppcenvr)
+               . = ALIGN(8192);
+               *(.text)
+               . = ALIGN(4);
+       } =0xFF
+       PROVIDE (_ecode = .);
+       .rodata :
+       {
+               *(.rodata)
+               . = ALIGN(4);
+       }
+       PROVIDE (_etext = .);
+
+
+       PROVIDE (_fdata = .);
+       .data :
+       {
+               *(.data)
+               . = ALIGN(4);
+       }
+       PROVIDE (_edata = .);
+
+       PROVIDE (_fgot = .);
+       .got :
+       {
+               *(.got)
+               . = ALIGN(4);
+       }
+       PROVIDE (_egot = .);
+
+       PROVIDE (__u_boot_cmd_start = .);
+       .u_boot_cmd :
+       {
+               *(.u_boot_cmd)
+               . = ALIGN(4);
+       }
+       PROVIDE (__u_boot_cmd_end = .);
+
+       PROVIDE (reloc_dst_end = .);
+       /* _reloc_dst_end = .; */
+
+       PROVIDE (bss_start = .);
+       PROVIDE (__bss_start = .);
+       .bss :
+       {
+               *(.bss)
+               . = ALIGN(4);
+       }
+       PROVIDE (bss_end = .);
+
+       PROVIDE (_end = .);
+}
index 618a10c..dbea90c 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index ddd4678..753411f 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 618a10c..dbea90c 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index ddd4678..753411f 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index f6cc94c..4d0d8a7 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index c0cf1cb..4942c42 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 7aad803..854912e 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index aa78158..817c864 100644 (file)
@@ -26,6 +26,9 @@
 
 #include <common.h>
 #include <mpc8xx.h>
+#if defined(CONFIG_OF_LIBFDT)
+       #include <libfdt.h>
+#endif
 
 /*
  * SDRAM is single Samsung K4S643232F-T70   chip (8MB)
@@ -111,3 +114,11 @@ int checkboard( void )
 
        return 0;
 }
+
+#if defined(CONFIG_OF_BOARD_SETUP)
+void ft_board_setup(void *blob, bd_t *bd)
+{
+       ft_cpu_setup(blob, bd);
+
+}
+#endif
index 27dfe08..e5de203 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 SECTIONS
 {
   /* Read-only sections, merged into text segment: */
index 7dd0bb3..f1b7ec7 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 27dfe08..e5de203 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 SECTIONS
 {
   /* Read-only sections, merged into text segment: */
index 045af28..53617b2 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 7dd0bb3..f1b7ec7 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 37fa1c9..1d125b6 100644 (file)
@@ -63,9 +63,22 @@ static u8 boot_configs[][17] = {
 /*
  * Bytes 5,6,8,9,11 change for NAND boot
  */
+#if 0
+/*
+ * Values for 512 page size NAND chips, not used anymore, just
+ * keep them here for reference
+ */
 static u8 nand_boot[] = {
        0x90, 0x01,  0xa0, 0x68, 0x58
 };
+#else
+/*
+ * Values for 2k page size NAND chips
+ */
+static u8 nand_boot[] = {
+       0x90, 0x01,  0xa0, 0xe8, 0x58
+};
+#endif
 
 static int do_bootstrap(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
index 36779f5..9986e9a 100644 (file)
@@ -32,13 +32,20 @@ extern flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#define CFG_BCSR3_PCIE         0x10
+
+#define BOARD_CANYONLANDS_PCIE 1
+#define BOARD_CANYONLANDS_SATA 2
+#define BOARD_GLACIER          3
+
 int board_early_init_f(void)
 {
        u32 sdr0_cust0;
+       u32 pvr = get_pvr();
 
-       /*------------------------------------------------------------------+
+       /*
         * Setup the interrupt controller polarities, triggers, etc.
-        *------------------------------------------------------------------*/
+        */
        mtdcr(uic0sr, 0xffffffff);      /* clear all */
        mtdcr(uic0er, 0x00000000);      /* disable all */
        mtdcr(uic0cr, 0x00000005);      /* ATI & UIC1 crit are critical */
@@ -105,27 +112,69 @@ int board_early_init_f(void)
        mtdcr(AHB_TOP, 0x8000004B);
        mtdcr(AHB_BOT, 0x8000004B);
 
-       /*
-        * Configure USB-STP pins as alternate and not GPIO
-        * It seems to be neccessary to configure the STP pins as GPIO
-        * input at powerup (perhaps while USB reset is asserted). So
-        * we configure those pins to their "real" function now.
-        */
-       gpio_config(16, GPIO_OUT, GPIO_ALT1, GPIO_OUT_1);
-       gpio_config(19, GPIO_OUT, GPIO_ALT1, GPIO_OUT_1);
+       if ((pvr == PVR_460EX_RA) || (pvr == PVR_460EX_SE_RA)) {
+               /*
+                * Configure USB-STP pins as alternate and not GPIO
+                * It seems to be neccessary to configure the STP pins as GPIO
+                * input at powerup (perhaps while USB reset is asserted). So
+                * we configure those pins to their "real" function now.
+                */
+               gpio_config(16, GPIO_OUT, GPIO_ALT1, GPIO_OUT_1);
+               gpio_config(19, GPIO_OUT, GPIO_ALT1, GPIO_OUT_1);
+       }
 
        return 0;
 }
 
-int checkboard (void)
+static void canyonlands_sata_init(int board_type)
+{
+       u32 reg;
+
+       if (board_type == BOARD_CANYONLANDS_SATA) {
+               /* Put SATA in reset */
+               SDR_WRITE(SDR0_SRST1, 0x00020001);
+
+               /* Set the phy for SATA, not PCI-E port 0 */
+               reg = SDR_READ(PESDR0_PHY_CTL_RST);
+               SDR_WRITE(PESDR0_PHY_CTL_RST, (reg & 0xeffffffc) | 0x00000001);
+               reg = SDR_READ(PESDR0_L0CLK);
+               SDR_WRITE(PESDR0_L0CLK, (reg & 0xfffffff8) | 0x00000007);
+               SDR_WRITE(PESDR0_L0CDRCTL, 0x00003111);
+               SDR_WRITE(PESDR0_L0DRV, 0x00000104);
+
+               /* Bring SATA out of reset */
+               SDR_WRITE(SDR0_SRST1, 0x00000000);
+       }
+}
+
+int checkboard(void)
 {
        char *s = getenv("serial#");
        u32 pvr = get_pvr();
 
-       if ((pvr == PVR_460GT_RA) || (pvr == PVR_460GT_SE_RA))
+       if ((pvr == PVR_460GT_RA) || (pvr == PVR_460GT_SE_RA)) {
                printf("Board: Glacier - AMCC PPC460GT Evaluation Board");
-       else
+               gd->board_type = BOARD_GLACIER;
+       } else {
                printf("Board: Canyonlands - AMCC PPC460EX Evaluation Board");
+               if (in_8((void *)(CFG_BCSR_BASE + 3)) & CFG_BCSR3_PCIE)
+                       gd->board_type = BOARD_CANYONLANDS_PCIE;
+               else
+                       gd->board_type = BOARD_CANYONLANDS_SATA;
+       }
+
+       switch (gd->board_type) {
+       case BOARD_CANYONLANDS_PCIE:
+       case BOARD_GLACIER:
+               puts(", 2*PCIe");
+               break;
+
+       case BOARD_CANYONLANDS_SATA:
+               puts(", 1*PCIe/1*SATA");
+               break;
+       }
+
+       printf(", Rev. %X", in_8((void *)(CFG_BCSR_BASE + 0)));
 
        if (s != NULL) {
                puts(", serial# ");
@@ -133,6 +182,8 @@ int checkboard (void)
        }
        putc('\n');
 
+       canyonlands_sata_init(gd->board_type);
+
        return (0);
 }
 
@@ -198,37 +249,36 @@ int testdram(void)
 }
 #endif
 
-/*************************************************************************
+/*
  *  pci_target_init
  *
  *     The bootstrap configuration provides default settings for the pci
  *     inbound map (PIM). But the bootstrap config choices are limited and
  *     may not be sufficient for a given board.
- *
- ************************************************************************/
+ */
 #if defined(CONFIG_PCI) && defined(CFG_PCI_TARGET_INIT)
 void pci_target_init(struct pci_controller * hose )
 {
-       /*-------------------------------------------------------------------+
+       /*
         * Disable everything
-        *-------------------------------------------------------------------*/
+        */
        out_le32((void *)PCIX0_PIM0SA, 0); /* disable */
        out_le32((void *)PCIX0_PIM1SA, 0); /* disable */
        out_le32((void *)PCIX0_PIM2SA, 0); /* disable */
        out_le32((void *)PCIX0_EROMBA, 0); /* disable expansion rom */
 
-       /*-------------------------------------------------------------------+
+       /*
         * Map all of SDRAM to PCI address 0x0000_0000. Note that the 440
         * strapping options to not support sizes such as 128/256 MB.
-        *-------------------------------------------------------------------*/
+        */
        out_le32((void *)PCIX0_PIM0LAL, CFG_SDRAM_BASE);
        out_le32((void *)PCIX0_PIM0LAH, 0);
        out_le32((void *)PCIX0_PIM0SA, ~(gd->ram_size - 1) | 1);
        out_le32((void *)PCIX0_BAR0, 0);
 
-       /*-------------------------------------------------------------------+
+       /*
         * Program the board's subsystem id/vendor id
-        *-------------------------------------------------------------------*/
+        */
        out_le16((void *)PCIX0_SBSYSVID, CFG_PCI_SUBSYS_VENDORID);
        out_le16((void *)PCIX0_SBSYSID, CFG_PCI_SUBSYS_DEVICEID);
 
@@ -265,13 +315,24 @@ void pcie_setup_hoses(int busno)
        int ret = 0;
        char *env;
        unsigned int delay;
+       int start;
 
        /*
         * assume we're called after the PCIX hose is initialized, which takes
         * bus ID 0 and therefore start numbering PCIe's from 1.
         */
        bus = busno;
-       for (i = 0; i <= 1; i++) {
+
+       /*
+        * Canyonlands with SATA enabled has only one PCIe slot
+        * (2nd one).
+        */
+       if (gd->board_type == BOARD_CANYONLANDS_SATA)
+               start = 1;
+       else
+               start = 0;
+
+       for (i = start; i <= 1; i++) {
 
                if (is_end_point(i))
                        ret = ppc4xx_init_pcie_endport(i);
@@ -369,6 +430,7 @@ int misc_init_r(void)
 {
        u32 sdr0_srst1 = 0;
        u32 eth_cfg;
+       u32 pvr = get_pvr();
 
        /*
         * Set EMAC mode/configuration (GMII, SGMII, RGMII...).
@@ -382,7 +444,10 @@ int misc_init_r(void)
        /* Set the for 2 RGMII mode */
        /* GMC0 EMAC4_0, GMC0 EMAC4_1, RGMII Bridge 0 */
        eth_cfg &= ~SDR0_ETH_CFG_GMC0_BRIDGE_SEL;
-       eth_cfg |= SDR0_ETH_CFG_GMC1_BRIDGE_SEL;
+       if ((pvr == PVR_460EX_RA) || (pvr == PVR_460EX_SE_RA))
+               eth_cfg |= SDR0_ETH_CFG_GMC1_BRIDGE_SEL;
+       else
+               eth_cfg &= ~SDR0_ETH_CFG_GMC1_BRIDGE_SEL;
        mtsdr(SDR0_ETH_CFG, eth_cfg);
 
        /*
@@ -407,7 +472,7 @@ void ft_board_setup(void *blob, bd_t *bd)
        /* Fixup NOR mapping */
        val[0] = 0;                             /* chip select number */
        val[1] = 0;                             /* always 0 */
-       val[2] = gd->bd->bi_flashstart;
+       val[2] = CFG_FLASH_BASE_PHYS_L;         /* we fixed up this address */
        val[3] = gd->bd->bi_flashsize;
        rc = fdt_find_and_setprop(blob, "/plb/opb/ebc", "ranges",
                                  val, sizeof(val), 1);
index bd4cab5..258fb5d 100644 (file)
@@ -51,6 +51,7 @@ tlbtab:
 #else
        tlbentry(CFG_NAND_BOOT_SPL_SRC, SZ_4K, CFG_NAND_BOOT_SPL_SRC, 4, AC_R|AC_W|AC_X|SA_G)
        tlbentry(CFG_SDRAM_BASE, SZ_256M, CFG_SDRAM_BASE, 0, AC_R|AC_W|AC_X|SA_G|SA_I)
+       tlbentry(256 << 20, SZ_256M, 256 << 20, 0, AC_R|AC_W|AC_X|SA_G|SA_I)
 #endif
 
        /*
index 12a5dcf..332e3aa 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 SECTIONS
 {
   /* Read-only sections, merged into text segment: */
@@ -57,10 +56,10 @@ SECTIONS
     cpu/ppc4xx/start.o (.text)
 
     /* Align to next NAND block */
-    . = ALIGN(0x4000);
+    . = ALIGN(0x20000);
     common/environment.o  (.ppcenv)
     /* Keep some space here for redundant env and potential bad env blocks */
-    . = ALIGN(0x10000);
+    . = ALIGN(0x80000);
 
     *(.text)
     *(.fixup)
index 7496f48..f4c13f4 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
@@ -139,8 +138,6 @@ SECTIONS
    *(COMMON)
   }
 
-  ppcenv_assert = ASSERT(. < 0xFFFF8000, ".bss section too big, overlaps .ppcenv section. Please update your confguration: CFG_MONITOR_BASE, CFG_MONITOR_LEN and TEXT_BASE may need to be modified.");
-
   _end = . ;
   PROVIDE (end = .);
 }
index 3a6389c..557cae7 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 2474146..36aa6de 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 27dfe08..e5de203 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 SECTIONS
 {
   /* Read-only sections, merged into text segment: */
index 1f7653d..b6ca3bc 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 00ca84c..0a476cf 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 1f7653d..b6ca3bc 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 5f0808d..76d1aef 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index e0b5113..94dd754 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 SECTIONS
 {
   /* Read-only sections, merged into text segment: */
index e140737..da2a400 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 7dd0bb3..f1b7ec7 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index af4223f..a0e9e96 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index c9a8af8..c36346a 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 855d952..92cf177 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index e3e5ce3..4477cd8 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 208f5dd..766e2bb 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 359fdab..6b4b4b0 100644 (file)
@@ -25,10 +25,13 @@ include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(BOARD).a
 
-COBJS  := at91cap9adk.o led.o nand.o
+COBJS-y        += at91cap9adk.o
+COBJS-y        += led.o
+COBJS-y        += partition.o
+COBJS-$(CONFIG_CMD_NAND) += nand.o
 
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS))
+SRCS    := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS    := $(addprefix $(obj),$(COBJS-y))
 SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):        $(obj).depend $(OBJS) $(SOBJS)
index 52e62de..24861ba 100644 (file)
  */
 
 #include <common.h>
-#include <asm/arch/AT91CAP9.h>
+#include <asm/arch/at91cap9.h>
+#include <asm/arch/at91cap9_matrix.h>
+#include <asm/arch/at91sam926x_mc.h>
+#include <asm/arch/at91_pmc.h>
+#include <asm/arch/at91_rstc.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/io.h>
 #if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB)
 #include <net.h>
 #endif
@@ -40,126 +46,106 @@ DECLARE_GLOBAL_DATA_PTR;
 static void at91cap9_serial_hw_init(void)
 {
 #ifdef CONFIG_USART0
-       AT91C_BASE_PIOA->PIO_PDR = AT91C_PA22_TXD0 | AT91C_PA23_RXD0;
-       AT91C_BASE_PMC->PMC_PCER = 1 << AT91C_ID_US0;
+       at91_set_A_periph(AT91_PIN_PA22, 1);            /* TXD0 */
+       at91_set_A_periph(AT91_PIN_PA23, 0);            /* RXD0 */
+       at91_sys_write(AT91_PMC_PCER, 1 << AT91_ID_US0);
 #endif
 
 #ifdef CONFIG_USART1
-       AT91C_BASE_PIOD->PIO_PDR = AT91C_PD0_TXD1 | AT91C_PD1_RXD1;
-       AT91C_BASE_PMC->PMC_PCER = 1 << AT91C_ID_US1;
+       at91_set_A_periph(AT91_PIN_PD0, 1);             /* TXD1 */
+       at91_set_A_periph(AT91_PIN_PD1, 0);             /* RXD1 */
+       at91_sys_write(AT91_PMC_PCER, 1 << AT91_ID_US1);
 #endif
 
 #ifdef CONFIG_USART2
-       AT91C_BASE_PIOD->PIO_PDR = AT91C_PD2_TXD2 | AT91C_PD3_RXD2;
-       AT91C_BASE_PMC->PMC_PCER = 1 << AT91C_ID_US2;
+       at91_set_A_periph(AT91_PIN_PD2, 1);             /* TXD2 */
+       at91_set_A_periph(AT91_PIN_PD3, 0);             /* RXD2 */
+       at91_sys_write(AT91_PMC_PCER, 1 << AT91_ID_US2);
 #endif
 
 #ifdef CONFIG_USART3   /* DBGU */
-       AT91C_BASE_PIOC->PIO_PDR = AT91C_PC31_DTXD | AT91C_PC30_DRXD;
-       AT91C_BASE_PMC->PMC_PCER = 1 << AT91C_ID_SYS;
+       at91_set_A_periph(AT91_PIN_PC30, 0);            /* DRXD */
+       at91_set_A_periph(AT91_PIN_PC31, 1);            /* DTXD */
+       at91_sys_write(AT91_PMC_PCER, 1 << AT91_ID_SYS);
 #endif
-
-
 }
 
 static void at91cap9_nor_hw_init(void)
 {
-       /* Ensure EBI supply is 3.3V */
-       AT91C_BASE_CCFG->CCFG_EBICSA |= AT91C_EBI_SUP_3V3;
+       unsigned long csa;
 
+       /* Ensure EBI supply is 3.3V */
+       csa = at91_sys_read(AT91_MATRIX_EBICSA);
+       at91_sys_write(AT91_MATRIX_EBICSA,
+                      csa | AT91_MATRIX_EBI_VDDIOMSEL_3_3V);
        /* Configure SMC CS0 for parallel flash */
-       AT91C_BASE_SMC->SMC_SETUP0 = AT91C_FLASH_NWE_SETUP |
-                                    AT91C_FLASH_NCS_WR_SETUP |
-                                    AT91C_FLASH_NRD_SETUP |
-                                    AT91C_FLASH_NCS_RD_SETUP;
-
-       AT91C_BASE_SMC->SMC_PULSE0 = AT91C_FLASH_NWE_PULSE |
-                                    AT91C_FLASH_NCS_WR_PULSE |
-                                    AT91C_FLASH_NRD_PULSE |
-                                    AT91C_FLASH_NCS_RD_PULSE;
-
-       AT91C_BASE_SMC->SMC_CYCLE0 = AT91C_FLASH_NWE_CYCLE |
-                                    AT91C_FLASH_NRD_CYCLE;
-
-       AT91C_BASE_SMC->SMC_CTRL0 =  AT91C_SMC_READMODE |
-                                    AT91C_SMC_WRITEMODE |
-                                    AT91C_SMC_NWAITM_NWAIT_DISABLE |
-                                    AT91C_SMC_BAT_BYTE_WRITE |
-                                    AT91C_SMC_DBW_WIDTH_SIXTEEN_BITS |
-                                    (AT91C_SMC_TDF & (1 << 16));
+       at91_sys_write(AT91_SMC_SETUP(0),
+                      AT91_SMC_NWESETUP_(4) | AT91_SMC_NCS_WRSETUP_(2) |
+                      AT91_SMC_NRDSETUP_(4) | AT91_SMC_NCS_RDSETUP_(2));
+       at91_sys_write(AT91_SMC_PULSE(0),
+                      AT91_SMC_NWEPULSE_(8) | AT91_SMC_NCS_WRPULSE_(10) |
+                      AT91_SMC_NRDPULSE_(8) | AT91_SMC_NCS_RDPULSE_(10));
+       at91_sys_write(AT91_SMC_CYCLE(0),
+                      AT91_SMC_NWECYCLE_(16) | AT91_SMC_NRDCYCLE_(16));
+       at91_sys_write(AT91_SMC_MODE(0),
+                      AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
+                      AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_BAT_WRITE |
+                      AT91_SMC_DBW_16 | AT91_SMC_TDF_(1));
 }
 
 #ifdef CONFIG_CMD_NAND
 static void at91cap9_nand_hw_init(void)
 {
+       unsigned long csa;
+
        /* Enable CS3 */
-       AT91C_BASE_CCFG->CCFG_EBICSA |= AT91C_EBI_CS3A_SM | AT91C_EBI_SUP_3V3;
+       csa = at91_sys_read(AT91_MATRIX_EBICSA);
+       at91_sys_write(AT91_MATRIX_EBICSA,
+                      csa | AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA |
+                      AT91_MATRIX_EBI_VDDIOMSEL_3_3V);
 
        /* Configure SMC CS3 for NAND/SmartMedia */
-       AT91C_BASE_SMC->SMC_SETUP3 = AT91C_SM_NWE_SETUP |
-                                    AT91C_SM_NCS_WR_SETUP |
-                                    AT91C_SM_NRD_SETUP |
-                                    AT91C_SM_NCS_RD_SETUP;
-
-       AT91C_BASE_SMC->SMC_PULSE3 = AT91C_SM_NWE_PULSE |
-                                    AT91C_SM_NCS_WR_PULSE |
-                                    AT91C_SM_NRD_PULSE |
-                                    AT91C_SM_NCS_RD_PULSE;
-
-       AT91C_BASE_SMC->SMC_CYCLE3 = AT91C_SM_NWE_CYCLE |
-                                    AT91C_SM_NRD_CYCLE;
-
-       AT91C_BASE_SMC->SMC_CTRL3 =  AT91C_SMC_READMODE |
-                                    AT91C_SMC_WRITEMODE |
-                                    AT91C_SMC_NWAITM_NWAIT_DISABLE |
-                                    AT91C_SMC_DBW_WIDTH_EIGTH_BITS |
-                                    AT91C_SM_TDF;
-
-       AT91C_BASE_PMC->PMC_PCER = 1 << AT91C_ID_PIOABCD;
+       at91_sys_write(AT91_SMC_SETUP(3),
+                      AT91_SMC_NWESETUP_(2) | AT91_SMC_NCS_WRSETUP_(1) |
+                      AT91_SMC_NRDSETUP_(2) | AT91_SMC_NCS_RDSETUP_(1));
+       at91_sys_write(AT91_SMC_PULSE(3),
+                      AT91_SMC_NWEPULSE_(4) | AT91_SMC_NCS_WRPULSE_(6) |
+                      AT91_SMC_NRDPULSE_(4) | AT91_SMC_NCS_RDPULSE_(6));
+       at91_sys_write(AT91_SMC_CYCLE(3),
+                      AT91_SMC_NWECYCLE_(8) | AT91_SMC_NRDCYCLE_(8));
+       at91_sys_write(AT91_SMC_MODE(3),
+                      AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
+                      AT91_SMC_EXNWMODE_DISABLE |
+                      AT91_SMC_DBW_8 | AT91_SMC_TDF_(1));
+
+       at91_sys_write(AT91_PMC_PCER, 1 << AT91CAP9_ID_PIOABCD);
 
        /* RDY/BSY is not connected */
 
        /* Enable NandFlash */
-       AT91C_BASE_PIOD->PIO_PER = AT91C_PIO_PD15;
-       AT91C_BASE_PIOD->PIO_OER = AT91C_PIO_PD15;
+       at91_set_gpio_output(AT91_PIN_PD15, 1);
 }
 #endif
 
 #ifdef CONFIG_HAS_DATAFLASH
 static void at91cap9_spi_hw_init(void)
 {
-       AT91C_BASE_PIOD->PIO_BSR = AT91C_PD0_SPI0_NPCS2D |
-                                  AT91C_PD1_SPI0_NPCS3D;
-       AT91C_BASE_PIOD->PIO_PDR = AT91C_PD0_SPI0_NPCS2D |
-                                  AT91C_PD1_SPI0_NPCS3D;
-
-       AT91C_BASE_PIOA->PIO_ASR = AT91C_PA28_SPI0_NPCS3A;
-       AT91C_BASE_PIOA->PIO_BSR = AT91C_PA4_SPI0_NPCS2A |
-                                  AT91C_PA1_SPI0_MOSI |
-                                  AT91C_PA0_SPI0_MISO |
-                                  AT91C_PA3_SPI0_NPCS1 |
-                                  AT91C_PA5_SPI0_NPCS0 |
-                                  AT91C_PA2_SPI0_SPCK;
-       AT91C_BASE_PIOA->PIO_PDR = AT91C_PA28_SPI0_NPCS3A |
-                                  AT91C_PA4_SPI0_NPCS2A |
-                                  AT91C_PA1_SPI0_MOSI |
-                                  AT91C_PA0_SPI0_MISO |
-                                  AT91C_PA3_SPI0_NPCS1 |
-                                  AT91C_PA5_SPI0_NPCS0 |
-                                  AT91C_PA2_SPI0_SPCK;
-
-       /* Enable Clock */
-       AT91C_BASE_PMC->PMC_PCER = 1 << AT91C_ID_SPI0;
+       at91_set_B_periph(AT91_PIN_PA5, 0);     /* SPI0_NPCS0 */
+
+       at91_set_B_periph(AT91_PIN_PA0, 0);     /* SPI0_MISO */
+       at91_set_B_periph(AT91_PIN_PA1, 0);     /* SPI0_MOSI */
+       at91_set_B_periph(AT91_PIN_PA2, 0);     /* SPI0_SPCK */
+
+       /* Enable clock */
+       at91_sys_write(AT91_PMC_PCER, 1 << AT91CAP9_ID_SPI0);
 }
 #endif
 
 #ifdef CONFIG_MACB
 static void at91cap9_macb_hw_init(void)
 {
-       unsigned int gpio;
-
        /* Enable clock */
-       AT91C_BASE_PMC->PMC_PCER = 1 << AT91C_ID_EMAC;
+       at91_sys_write(AT91_PMC_PCER, 1 << AT91CAP9_ID_EMAC);
 
        /*
         * Disable pull-up on:
@@ -169,54 +155,59 @@ static void at91cap9_macb_hw_init(void)
         *
         * PHY has internal pull-down
         */
-       AT91C_BASE_PIOB->PIO_PPUDR = AT91C_PB22_E_RXDV |
-                                    AT91C_PB25_E_RX0 |
-                                    AT91C_PB26_E_RX1;
+       writel(pin_to_mask(AT91_PIN_PB22) |
+              pin_to_mask(AT91_PIN_PB25) |
+              pin_to_mask(AT91_PIN_PB26),
+              pin_to_controller(AT91_PIN_PA0) + PIO_PUDR);
 
        /* Need to reset PHY -> 500ms reset */
-       AT91C_BASE_RSTC->RSTC_RMR = (AT91C_RSTC_KEY & (0xA5 << 24)) |
-                                   (AT91C_RSTC_ERSTL & (0x0D << 8)) |
-                                   AT91C_RSTC_URSTEN;
-       AT91C_BASE_RSTC->RSTC_RCR = (AT91C_RSTC_KEY & (0xA5 << 24)) |
-                                   AT91C_RSTC_EXTRST;
+       at91_sys_write(AT91_RSTC_MR, AT91_RSTC_KEY |
+                                    AT91_RSTC_ERSTL | (0x0D << 8) |
+                                    AT91_RSTC_URSTEN);
+
+       at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_EXTRST);
 
        /* Wait for end hardware reset */
-       while (!(AT91C_BASE_RSTC->RSTC_RSR & AT91C_RSTC_NRSTL));
+       while (!(at91_sys_read(AT91_RSTC_SR) & AT91_RSTC_NRSTL));
 
        /* Re-enable pull-up */
-       AT91C_BASE_PIOB->PIO_PPUER = AT91C_PB22_E_RXDV |
-                                    AT91C_PB25_E_RX0 |
-                                    AT91C_PB26_E_RX1;
-
-#ifdef CONFIG_RMII
-       gpio =  AT91C_PB30_E_MDIO |
-               AT91C_PB29_E_MDC  |
-               AT91C_PB21_E_TXCK |
-               AT91C_PB27_E_RXER |
-               AT91C_PB25_E_RX0  |
-               AT91C_PB22_E_RXDV |
-               AT91C_PB26_E_RX1  |
-               AT91C_PB28_E_TXEN |
-               AT91C_PB23_E_TX0  |
-               AT91C_PB24_E_TX1;
-       AT91C_BASE_PIOB->PIO_ASR = gpio;
-       AT91C_BASE_PIOB->PIO_BSR = 0;
-       AT91C_BASE_PIOB->PIO_PDR = gpio;
-#else
-#error AT91CAP9A-DK works only in RMII mode
+       writel(pin_to_mask(AT91_PIN_PB22) |
+              pin_to_mask(AT91_PIN_PB25) |
+              pin_to_mask(AT91_PIN_PB26),
+              pin_to_controller(AT91_PIN_PA0) + PIO_PUER);
+
+       at91_set_A_periph(AT91_PIN_PB21, 0);    /* ETXCK_EREFCK */
+       at91_set_A_periph(AT91_PIN_PB22, 0);    /* ERXDV */
+       at91_set_A_periph(AT91_PIN_PB25, 0);    /* ERX0 */
+       at91_set_A_periph(AT91_PIN_PB26, 0);    /* ERX1 */
+       at91_set_A_periph(AT91_PIN_PB27, 0);    /* ERXER */
+       at91_set_A_periph(AT91_PIN_PB28, 0);    /* ETXEN */
+       at91_set_A_periph(AT91_PIN_PB23, 0);    /* ETX0 */
+       at91_set_A_periph(AT91_PIN_PB24, 0);    /* ETX1 */
+       at91_set_A_periph(AT91_PIN_PB30, 0);    /* EMDIO */
+       at91_set_A_periph(AT91_PIN_PB29, 0);    /* EMDC */
+
+#ifndef CONFIG_RMII
+       at91_set_B_periph(AT91_PIN_PC25, 0);    /* ECRS */
+       at91_set_B_periph(AT91_PIN_PC26, 0);    /* ECOL */
+       at91_set_B_periph(AT91_PIN_PC22, 0);    /* ERX2 */
+       at91_set_B_periph(AT91_PIN_PC23, 0);    /* ERX3 */
+       at91_set_B_periph(AT91_PIN_PC27, 0);    /* ERXCK */
+       at91_set_B_periph(AT91_PIN_PC20, 0);    /* ETX2 */
+       at91_set_B_periph(AT91_PIN_PC21, 0);    /* ETX3 */
+       at91_set_B_periph(AT91_PIN_PC24, 0);    /* ETXER */
 #endif
-
        /* Unlock EMAC, 3 0 2 1 sequence */
 #define MP_MAC_KEY0    0x5969cb2a
 #define MP_MAC_KEY1    0xb4a1872e
 #define MP_MAC_KEY2    0x05683fbc
 #define MP_MAC_KEY3    0x3634fba4
 #define UNLOCK_MAC     0x00000008
-       *((AT91_REG *)((AT91_REG) MP_BLOCK_3_BASE + 0x3c)) = MP_MAC_KEY3;
-       *((AT91_REG *)((AT91_REG) MP_BLOCK_3_BASE + 0x30)) = MP_MAC_KEY0;
-       *((AT91_REG *)((AT91_REG) MP_BLOCK_3_BASE + 0x38)) = MP_MAC_KEY2;
-       *((AT91_REG *)((AT91_REG) MP_BLOCK_3_BASE + 0x34)) = MP_MAC_KEY1;
-       *((AT91_REG *)((AT91_REG) MP_BLOCK_3_BASE + 0x40)) = UNLOCK_MAC;
+       writel(MP_MAC_KEY3, MP_BLOCK_3_BASE + 0x3c);
+       writel(MP_MAC_KEY0, MP_BLOCK_3_BASE + 0x30);
+       writel(MP_MAC_KEY2, MP_BLOCK_3_BASE + 0x38);
+       writel(MP_MAC_KEY1, MP_BLOCK_3_BASE + 0x34);
+       writel(UNLOCK_MAC, MP_BLOCK_3_BASE + 0x40);
 }
 #endif
 
@@ -229,11 +220,11 @@ static void at91cap9_uhp_hw_init(void)
 #define MP_OHCI_KEY2   0x4823efbc
 #define MP_OHCI_KEY3   0x8651aae4
 #define UNLOCK_OHCI    0x00000010
-       *((AT91_REG *)((AT91_REG) MP_BLOCK_3_BASE + 0x3c)) = MP_OHCI_KEY3;
-       *((AT91_REG *)((AT91_REG) MP_BLOCK_3_BASE + 0x38)) = MP_OHCI_KEY2;
-       *((AT91_REG *)((AT91_REG) MP_BLOCK_3_BASE + 0x30)) = MP_OHCI_KEY0;
-       *((AT91_REG *)((AT91_REG) MP_BLOCK_3_BASE + 0x34)) = MP_OHCI_KEY1;
-       *((AT91_REG *)((AT91_REG) MP_BLOCK_3_BASE + 0x40)) = UNLOCK_OHCI;
+       writel(MP_OHCI_KEY3, MP_BLOCK_3_BASE + 0x3c);
+       writel(MP_OHCI_KEY2, MP_BLOCK_3_BASE + 0x38);
+       writel(MP_OHCI_KEY0, MP_BLOCK_3_BASE + 0x30);
+       writel(MP_OHCI_KEY1, MP_BLOCK_3_BASE + 0x34);
+       writel(UNLOCK_OHCI, MP_BLOCK_3_BASE + 0x40);
 }
 #endif
 
index 8588a91..04de139 100644 (file)
  */
 
 #include <common.h>
-#include <asm/arch/AT91CAP9.h>
+#include <asm/arch/at91cap9.h>
+#include <asm/arch/at91_pmc.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/io.h>
 
-#define        RED_LED         AT91C_PIO_PC29  /* this is the power led */
-#define        GREEN_LED       AT91C_PIO_PA10  /* this is the user1 led */
-#define        YELLOW_LED      AT91C_PIO_PA11  /* this is the user1 led */
+#define        RED_LED         AT91_PIN_PC29   /* this is the power led */
+#define        GREEN_LED       AT91_PIN_PA10   /* this is the user1 led */
+#define        YELLOW_LED      AT91_PIN_PA11   /* this is the user1 led */
 
 void red_LED_on(void)
 {
-       AT91C_BASE_PIOC->PIO_SODR = RED_LED;
+       at91_set_gpio_value(RED_LED, 1);
 }
 
 void red_LED_off(void)
 {
-       AT91C_BASE_PIOC->PIO_CODR = RED_LED;
+       at91_set_gpio_value(RED_LED, 0);
 }
 
 void green_LED_on(void)
 {
-       AT91C_BASE_PIOA->PIO_CODR = GREEN_LED;
+       at91_set_gpio_value(GREEN_LED, 0);
 }
 
 void green_LED_off(void)
 {
-       AT91C_BASE_PIOA->PIO_SODR = GREEN_LED;
+       at91_set_gpio_value(GREEN_LED, 1);
 }
 
 void yellow_LED_on(void)
 {
-       AT91C_BASE_PIOA->PIO_CODR = YELLOW_LED;
+       at91_set_gpio_value(YELLOW_LED, 0);
 }
 
 void yellow_LED_off(void)
 {
-       AT91C_BASE_PIOA->PIO_SODR = YELLOW_LED;
+       at91_set_gpio_value(YELLOW_LED, 1);
 }
 
 void coloured_LED_init(void)
 {
        /* Enable clock */
-       AT91C_BASE_PMC->PMC_PCER = 1 << AT91C_ID_PIOABCD;
+       at91_sys_write(AT91_PMC_PCER, 1 << AT91CAP9_ID_PIOABCD);
 
-       /* Disable peripherals on LEDs */
-       AT91C_BASE_PIOA->PIO_PER = GREEN_LED | YELLOW_LED;
-       /* Enable pins as outputs */
-       AT91C_BASE_PIOA->PIO_OER = GREEN_LED | YELLOW_LED;
-       /* Turn all LEDs OFF */
-       AT91C_BASE_PIOA->PIO_SODR = GREEN_LED | YELLOW_LED;
+       at91_set_gpio_output(RED_LED, 1);
+       at91_set_gpio_output(GREEN_LED, 1);
+       at91_set_gpio_output(YELLOW_LED, 1);
 
-       /* Disable peripherals on LEDs */
-       AT91C_BASE_PIOC->PIO_PER = RED_LED;
-       /* Enable pins as outputs */
-       AT91C_BASE_PIOC->PIO_OER = RED_LED;
-       /* Turn all LEDs OFF */
-       AT91C_BASE_PIOC->PIO_CODR = RED_LED;
+       at91_set_gpio_output(RED_LED, 0);
+       at91_set_gpio_output(GREEN_LED, 1);
+       at91_set_gpio_output(YELLOW_LED, 1);
 }
index 2f02126..c72b024 100644 (file)
@@ -25,9 +25,9 @@
  */
 
 #include <common.h>
-#include <asm/arch/hardware.h>
-
-#ifdef CONFIG_CMD_NAND
+#include <asm/arch/at91cap9.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/at91_pio.h>
 
 #include <nand.h>
 
@@ -51,10 +51,10 @@ static void at91cap9adk_nand_hwcontrol(struct mtd_info *mtd, int cmd)
                IO_ADDR_W |= MASK_ALE;
                break;
        case NAND_CTL_CLRNCE:
-               AT91C_BASE_PIOD->PIO_SODR = AT91C_PIO_PD15;
+               at91_set_gpio_value(AT91_PIN_PD15, 1);
                break;
        case NAND_CTL_SETNCE:
-               AT91C_BASE_PIOD->PIO_CODR = AT91C_PIO_PD15;
+               at91_set_gpio_value(AT91_PIN_PD15, 0);
                break;
        }
        this->IO_ADDR_W = (void *) IO_ADDR_W;
@@ -68,4 +68,3 @@ int board_nand_init(struct nand_chip *nand)
 
        return 0;
 }
-#endif
diff --git a/board/atmel/at91cap9adk/partition.c b/board/atmel/at91cap9adk/partition.c
new file mode 100644 (file)
index 0000000..3bffd71
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the 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 <asm/hardware.h>
+#include <dataflash.h>
+
+AT91S_DATAFLASH_INFO dataflash_info[CFG_MAX_DATAFLASH_BANKS];
+
+struct dataflash_addr cs[CFG_MAX_DATAFLASH_BANKS] = {
+       {CFG_DATAFLASH_LOGIC_ADDR_CS0, 0},      /* Logical adress, CS */
+};
+
+/*define the area offsets*/
+dataflash_protect_t area_list[NB_DATAFLASH_AREA] = {
+       {0x00000000, 0x000041FF, FLAG_PROTECT_SET,   0, "Bootstrap"},
+       {0x00004200, 0x000083FF, FLAG_PROTECT_CLEAR, 0, "Environment"},
+       {0x00008400, 0x00041FFF, FLAG_PROTECT_SET,   0, "U-Boot"},
+       {0x00042000, 0x00251FFF, FLAG_PROTECT_CLEAR, 0, "Kernel"},
+       {0x00252000, 0xFFFFFFFF, FLAG_PROTECT_CLEAR, 0, "FS"},
+};
index 01f3bc3..5b4cdcf 100755 (executable)
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(BOARD).a
 
-COBJS  := at91rm9200dk.o flash.o led.o mux.o
+COBJS  := at91rm9200dk.o flash.o led.o mux.o partition.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
diff --git a/board/atmel/at91rm9200dk/partition.c b/board/atmel/at91rm9200dk/partition.c
new file mode 100644 (file)
index 0000000..a8a5fe6
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the 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 <asm/hardware.h>
+#include <dataflash.h>
+
+AT91S_DATAFLASH_INFO dataflash_info[CFG_MAX_DATAFLASH_BANKS];
+
+struct dataflash_addr cs[CFG_MAX_DATAFLASH_BANKS] = {
+       {CFG_DATAFLASH_LOGIC_ADDR_CS0, 0},      /* Logical adress, CS */
+       {CFG_DATAFLASH_LOGIC_ADDR_CS3, 3}
+};
+
+/*define the area offsets*/
+dataflash_protect_t area_list[NB_DATAFLASH_AREA] = {
+       {0x00000000, 0x000041FF, FLAG_PROTECT_SET,   0, "Bootstrap"},
+       {0x00004200, 0x000083FF, FLAG_PROTECT_CLEAR, 0, "Environment"},
+       {0x00008400, 0x00041FFF, FLAG_PROTECT_SET,   0, "U-Boot"},
+       {0x00042000, 0x00251FFF, FLAG_PROTECT_CLEAR, 0, "Kernel"},
+       {0x00252000, 0xFFFFFFFF, FLAG_PROTECT_CLEAR, 0, "FS"},
+};
diff --git a/board/atmel/at91sam9260ek/Makefile b/board/atmel/at91sam9260ek/Makefile
new file mode 100644 (file)
index 0000000..defc085
--- /dev/null
@@ -0,0 +1,53 @@
+#
+# (C) Copyright 2003-2008
+# Wolfgang Denk, DENX Software Engineering, wd <at> 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).a
+
+COBJS-y        += at91sam9260ek.o
+COBJS-y        += led.o
+COBJS-y        += partition.o
+COBJS-$(CONFIG_CMD_NAND) += nand.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+
+clean:
+       rm -f $(SOBJS) $(OBJS)
+
+distclean:     clean
+       rm -f $(LIB) core *.bak .depend
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/atmel/at91sam9260ek/at91sam9260ek.c b/board/atmel/at91sam9260ek/at91sam9260ek.c
new file mode 100644 (file)
index 0000000..a55468e
--- /dev/null
@@ -0,0 +1,236 @@
+/*
+ * (C) Copyright 2007-2008
+ * Stelian Pop <stelian.pop <at> leadtechdesign.com>
+ * Lead Tech Design <www.leadtechdesign.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/at91sam9260.h>
+#include <asm/arch/at91sam9260_matrix.h>
+#include <asm/arch/at91sam926x_mc.h>
+#include <asm/arch/at91_pmc.h>
+#include <asm/arch/at91_rstc.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/io.h>
+#if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB)
+#include <net.h>
+#endif
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/* ------------------------------------------------------------------------- */
+/*
+ * Miscelaneous platform dependent initialisations
+ */
+
+static void at91sam9260ek_serial_hw_init(void)
+{
+#ifdef CONFIG_USART0
+       at91_set_A_periph(AT91_PIN_PB4, 1);             /* TXD0 */
+       at91_set_A_periph(AT91_PIN_PB5, 0);             /* RXD0 */
+       at91_sys_write(AT91_PMC_PCER, 1 << AT91_ID_US0);
+#endif
+
+#ifdef CONFIG_USART1
+       at91_set_A_periph(AT91_PIN_PB6, 1);             /* TXD1 */
+       at91_set_A_periph(AT91_PIN_PB7, 0);             /* RXD1 */
+       at91_sys_write(AT91_PMC_PCER, 1 << AT91_ID_US1);
+#endif
+
+#ifdef CONFIG_USART2
+       at91_set_A_periph(AT91_PIN_PB8, 1);             /* TXD2 */
+       at91_set_A_periph(AT91_PIN_PB9, 0);             /* RXD2 */
+       at91_sys_write(AT91_PMC_PCER, 1 << AT91_ID_US2);
+#endif
+
+#ifdef CONFIG_USART3   /* DBGU */
+       at91_set_A_periph(AT91_PIN_PB14, 0);            /* DRXD */
+       at91_set_A_periph(AT91_PIN_PB15, 1);            /* DTXD */
+       at91_sys_write(AT91_PMC_PCER, 1 << AT91_ID_SYS);
+#endif
+}
+
+#ifdef CONFIG_CMD_NAND
+static void at91sam9260ek_nand_hw_init(void)
+{
+       unsigned long csa;
+
+       /* Enable CS3 */
+       csa = at91_sys_read(AT91_MATRIX_EBICSA);
+       at91_sys_write(AT91_MATRIX_EBICSA,
+                      csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA);
+
+       /* Configure SMC CS3 for NAND/SmartMedia */
+       at91_sys_write(AT91_SMC_SETUP(3),
+                      AT91_SMC_NWESETUP_(0) | AT91_SMC_NCS_WRSETUP_(0) |
+                      AT91_SMC_NRDSETUP_(0) | AT91_SMC_NCS_RDSETUP_(0));
+       at91_sys_write(AT91_SMC_PULSE(3),
+                      AT91_SMC_NWEPULSE_(3) | AT91_SMC_NCS_WRPULSE_(3) |
+                      AT91_SMC_NRDPULSE_(3) | AT91_SMC_NCS_RDPULSE_(3));
+       at91_sys_write(AT91_SMC_CYCLE(3),
+                      AT91_SMC_NWECYCLE_(5) | AT91_SMC_NRDCYCLE_(5));
+       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));
+
+       at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9260_ID_PIOC);
+
+       /* Configure RDY/BSY */
+       at91_set_gpio_input(AT91_PIN_PC13, 1);
+
+       /* Enable NandFlash */
+       at91_set_gpio_output(AT91_PIN_PC14, 1);
+}
+#endif
+
+#ifdef CONFIG_HAS_DATAFLASH
+static void at91sam9260ek_spi_hw_init(void)
+{
+       at91_set_A_periph(AT91_PIN_PA3, 0);     /* SPI0_NPCS0 */
+       at91_set_B_periph(AT91_PIN_PC11, 0);    /* SPI0_NPCS1 */
+
+       at91_set_A_periph(AT91_PIN_PA0, 0);     /* SPI0_MISO */
+       at91_set_A_periph(AT91_PIN_PA1, 0);     /* SPI0_MOSI */
+       at91_set_A_periph(AT91_PIN_PA2, 0);     /* SPI0_SPCK */
+
+       /* Enable clock */
+       at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9260_ID_SPI0);
+}
+#endif
+
+#ifdef CONFIG_MACB
+static void at91sam9260ek_macb_hw_init(void)
+{
+       /* 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);
+
+       /* Need to reset PHY -> 500ms reset */
+       at91_sys_write(AT91_RSTC_MR, AT91_RSTC_KEY |
+                                    AT91_RSTC_ERSTL | (0x0D << 8) |
+                                    AT91_RSTC_URSTEN);
+
+       at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_EXTRST);
+
+       /* Wait for end hardware reset */
+       while (!(at91_sys_read(AT91_RSTC_SR) & AT91_RSTC_NRSTL));
+
+       /* Restore NRST value */
+       at91_sys_write(AT91_RSTC_MR, AT91_RSTC_KEY |
+                                    AT91_RSTC_ERSTL | (0x0 << 8) |
+                                    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);
+
+       at91_set_A_periph(AT91_PIN_PA19, 0);    /* ETXCK_EREFCK */
+       at91_set_A_periph(AT91_PIN_PA17, 0);    /* ERXDV */
+       at91_set_A_periph(AT91_PIN_PA14, 0);    /* ERX0 */
+       at91_set_A_periph(AT91_PIN_PA15, 0);    /* ERX1 */
+       at91_set_A_periph(AT91_PIN_PA18, 0);    /* ERXER */
+       at91_set_A_periph(AT91_PIN_PA16, 0);    /* ETXEN */
+       at91_set_A_periph(AT91_PIN_PA12, 0);    /* ETX0 */
+       at91_set_A_periph(AT91_PIN_PA13, 0);    /* ETX1 */
+       at91_set_A_periph(AT91_PIN_PA21, 0);    /* EMDIO */
+       at91_set_A_periph(AT91_PIN_PA20, 0);    /* EMDC */
+
+#ifndef CONFIG_RMII
+       at91_set_B_periph(AT91_PIN_PA28, 0);    /* ECRS */
+       at91_set_B_periph(AT91_PIN_PA29, 0);    /* ECOL */
+       at91_set_B_periph(AT91_PIN_PA25, 0);    /* ERX2 */
+       at91_set_B_periph(AT91_PIN_PA26, 0);    /* ERX3 */
+       at91_set_B_periph(AT91_PIN_PA27, 0);    /* ERXCK */
+       at91_set_B_periph(AT91_PIN_PA23, 0);    /* ETX2 */
+       at91_set_B_periph(AT91_PIN_PA24, 0);    /* ETX3 */
+       at91_set_B_periph(AT91_PIN_PA22, 0);    /* ETXER */
+#endif
+
+}
+#endif
+
+int board_init(void)
+{
+       /* Enable Ctrlc */
+       console_init_f();
+
+       /* arch number of AT91SAM9260EK-Board */
+       gd->bd->bi_arch_number = MACH_TYPE_AT91SAM9260EK;
+       /* adress of boot parameters */
+       gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
+
+       at91sam9260ek_serial_hw_init();
+#ifdef CONFIG_CMD_NAND
+       at91sam9260ek_nand_hw_init();
+#endif
+#ifdef CONFIG_HAS_DATAFLASH
+       at91sam9260ek_spi_hw_init();
+#endif
+#ifdef CONFIG_MACB
+       at91sam9260ek_macb_hw_init();
+#endif
+
+       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_RESET_PHY_R
+void reset_phy(void)
+{
+#ifdef CONFIG_MACB
+       /*
+        * Initialize ethernet HW addr prior to starting Linux,
+        * needed for nfsroot
+        */
+       eth_init(gd->bd);
+#endif
+}
+#endif
diff --git a/board/atmel/at91sam9260ek/config.mk b/board/atmel/at91sam9260ek/config.mk
new file mode 100644 (file)
index 0000000..ff2cfd1
--- /dev/null
@@ -0,0 +1 @@
+TEXT_BASE = 0x23f00000
diff --git a/board/atmel/at91sam9260ek/led.c b/board/atmel/at91sam9260ek/led.c
new file mode 100644 (file)
index 0000000..4c53742
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * (C) Copyright 2007-2008
+ * Stelian Pop <stelian.pop <at> leadtechdesign.com>
+ * Lead Tech Design <www.leadtechdesign.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/at91sam9260.h>
+#include <asm/arch/at91_pmc.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/io.h>
+
+#define        RED_LED         AT91_PIN_PA9    /* this is the power led */
+#define        GREEN_LED       AT91_PIN_PA6    /* this is the user led */
+
+void red_LED_on(void)
+{
+       at91_set_gpio_value(RED_LED, 1);
+}
+
+void red_LED_off(void)
+{
+       at91_set_gpio_value(RED_LED, 0);
+}
+
+void green_LED_on(void)
+{
+       at91_set_gpio_value(GREEN_LED, 0);
+}
+
+void green_LED_off(void)
+{
+       at91_set_gpio_value(GREEN_LED, 1);
+}
+
+void coloured_LED_init(void)
+{
+       /* Enable clock */
+       at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9260_ID_PIOA);
+
+       at91_set_gpio_output(RED_LED, 1);
+       at91_set_gpio_output(GREEN_LED, 1);
+
+       at91_set_gpio_value(RED_LED, 0);
+       at91_set_gpio_value(GREEN_LED, 1);
+}
diff --git a/board/atmel/at91sam9260ek/nand.c b/board/atmel/at91sam9260ek/nand.c
new file mode 100644 (file)
index 0000000..abb788a
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * (C) Copyright 2007-2008
+ * Stelian Pop <stelian.pop <at> leadtechdesign.com>
+ * Lead Tech Design <www.leadtechdesign.com>
+ *
+ * (C) Copyright 2006 ATMEL Rousset, Lacressonniere Nicolas
+ *
+ * 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/at91sam9260.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/at91_pio.h>
+
+#include <nand.h>
+
+/*
+ *     hardware specific access to control-lines
+ */
+#define        MASK_ALE        (1 << 21)       /* our ALE is AD21 */
+#define        MASK_CLE        (1 << 22)       /* our CLE is AD22 */
+
+static void at91sam9260ek_nand_hwcontrol(struct mtd_info *mtd, int cmd)
+{
+       struct nand_chip *this = mtd->priv;
+       ulong IO_ADDR_W = (ulong) this->IO_ADDR_W;
+
+       IO_ADDR_W &= ~(MASK_ALE|MASK_CLE);
+       switch (cmd) {
+       case NAND_CTL_SETCLE:
+               IO_ADDR_W |= MASK_CLE;
+               break;
+       case NAND_CTL_SETALE:
+               IO_ADDR_W |= MASK_ALE;
+               break;
+       case NAND_CTL_CLRNCE:
+               at91_set_gpio_value(AT91_PIN_PC14, 1);
+               break;
+       case NAND_CTL_SETNCE:
+               at91_set_gpio_value(AT91_PIN_PC14, 0);
+               break;
+       }
+       this->IO_ADDR_W = (void *) IO_ADDR_W;
+}
+
+static int at91sam9260ek_nand_ready(struct mtd_info *mtd)
+{
+       return at91_get_gpio_value(AT91_PIN_PC13);
+}
+
+int board_nand_init(struct nand_chip *nand)
+{
+       nand->eccmode = NAND_ECC_SOFT;
+       nand->hwcontrol = at91sam9260ek_nand_hwcontrol;
+       nand->dev_ready = at91sam9260ek_nand_ready;
+       nand->chip_delay = 20;
+
+       return 0;
+}
diff --git a/board/atmel/at91sam9260ek/partition.c b/board/atmel/at91sam9260ek/partition.c
new file mode 100644 (file)
index 0000000..389fb2c
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the 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 <asm/hardware.h>
+#include <dataflash.h>
+
+AT91S_DATAFLASH_INFO dataflash_info[CFG_MAX_DATAFLASH_BANKS];
+
+struct dataflash_addr cs[CFG_MAX_DATAFLASH_BANKS] = {
+       {CFG_DATAFLASH_LOGIC_ADDR_CS0, 0},      /* Logical adress, CS */
+       {CFG_DATAFLASH_LOGIC_ADDR_CS1, 1}
+};
+
+/*define the area offsets*/
+dataflash_protect_t area_list[NB_DATAFLASH_AREA] = {
+       {0x00000000, 0x000041FF, FLAG_PROTECT_SET,   0, "Bootstrap"},
+       {0x00004200, 0x000083FF, FLAG_PROTECT_CLEAR, 0, "Environment"},
+       {0x00008400, 0x00041FFF, FLAG_PROTECT_SET,   0, "U-Boot"},
+       {0x00042000, 0x00251FFF, FLAG_PROTECT_CLEAR, 0, "Kernel"},
+       {0x00252000, 0xFFFFFFFF, FLAG_PROTECT_CLEAR, 0, "FS"},
+};
diff --git a/board/atmel/at91sam9260ek/u-boot.lds b/board/atmel/at91sam9260ek/u-boot.lds
new file mode 100644 (file)
index 0000000..05a6d83
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * (C) Copyright 2002
+ * Gary Jennejohn, DENX Software Engineering, <gj <at> 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-littlearm", "elf32-littlearm", "elf32-littlearm")
+/*OUTPUT_FORMAT("elf32-arm", "elf32-arm", "elf32-arm")*/
+OUTPUT_ARCH(arm)
+ENTRY(_start)
+SECTIONS
+{
+       . = 0x00000000;
+
+       . = ALIGN(4);
+       .text :
+       {
+         cpu/arm926ejs/start.o (.text)
+         *(.text)
+       }
+
+       . = ALIGN(4);
+       .rodata : { *(.rodata) }
+
+       . = ALIGN(4);
+       .data : { *(.data) }
+
+       . = ALIGN(4);
+       .got : { *(.got) }
+
+       . = .;
+       __u_boot_cmd_start = .;
+       .u_boot_cmd : { *(.u_boot_cmd) }
+       __u_boot_cmd_end = .;
+
+       . = ALIGN(4);
+       __bss_start = .;
+       .bss : { *(.bss) }
+       _end = .;
+}
index bb6ce76..1ef4de4 100644 (file)
@@ -82,7 +82,7 @@ struct fsl_e_tlb_entry tlb_table[] = {
         * 0xe210_0000  1M      PCI2 IO
         * 0xe300_0000  1M      PCIe IO
         */
-       SET_TLB_ENTRY(1, CFG_CCSRBAR, CFG_CCSRBAR,
+       SET_TLB_ENTRY(1, CFG_CCSRBAR, CFG_CCSRBAR_PHYS,
                      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
                      0, 5, BOOKE_PAGESZ_64M, 1),
 };
index 3f04cae..dd5375b 100644 (file)
@@ -21,7 +21,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index e55c1a7..6688095 100644 (file)
@@ -39,7 +39,7 @@ $(LIB):       $(obj).depend $(OBJS) $(SOBJS) u-boot.lds
        $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
 
 u-boot.lds: u-boot.lds.S
-       $(CPP) $(CPPFLAGS) -P -Ubfin $^ > $@.tmp
+       $(CPP) $(CPPFLAGS) -D__ASSEMBLY__ -P -Ubfin $^ > $@.tmp
        mv -f $@.tmp $@
 
 clean:
index 98ed6f8..738f69c 100644 (file)
@@ -34,13 +34,6 @@ DECLARE_GLOBAL_DATA_PTR;
 
 int checkboard(void)
 {
-#if (BFIN_CPU == ADSP_BF531)
-       printf("CPU:   ADSP BF531 Rev.: 0.%d\n", *pCHIPID >> 28);
-#elif (BFIN_CPU == ADSP_BF532)
-       printf("CPU:   ADSP BF532 Rev.: 0.%d\n", *pCHIPID >> 28);
-#else
-       printf("CPU:   ADSP BF533 Rev.: 0.%d\n", *pCHIPID >> 28);
-#endif
        printf("Board: ADI BF533 EZ-Kit Lite board\n");
        printf("       Support: http://blackfin.uclinux.org/\n");
        return 0;
index f39be5f..de80ffe 100644 (file)
@@ -20,6 +20,6 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 # MA 02111-1307 USA
 #
-# TEXT_BASE should be defined as the MAX_SDRAM Address - 256k bytes
-#  256k is defined as CFG_MONITOR_LEN in ./include/configs/<board>.h
-TEXT_BASE = 0x01FC0000
+
+# This is not actually used for Blackfin boards so do not change it
+#TEXT_BASE = do-not-use-me
index 9742e02..e4b83d1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * U-boot - u-boot.lds.S
  *
- * Copyright (c) 2005-2007 Analog Device Inc.
+ * Copyright (c) 2005-2008 Analog Device Inc.
  *
  * (C) Copyright 2000-2004
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  */
 
 #include <config.h>
+#include <asm/blackfin.h>
+#undef ALIGN
+
+/* If we don't actually load anything into L1 data, this will avoid
+ * a syntax error.  If we do actually load something into L1 data,
+ * we'll get a linker memory load error (which is what we'd want).
+ * 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_B_SRAM
+# define L1_DATA_B_SRAM      CFG_MONITOR_BASE
+# define L1_DATA_B_SRAM_SIZE 0
+#endif
 
 OUTPUT_ARCH(bfin)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
+
+/* The 0xC offset is so we don't clobber the tiny LDR jump block. */
+MEMORY
 {
-  /* 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) }
-  . = CFG_MONITOR_BASE;
-  .text      :
-  {
-    /* WARNING - the following is hand-optimized to fit within */
-    /* the sector before the environment sector. If it throws  */
-    /* an error during compilation remove an object here to get        */
-    /* it linked after the configuration sector.               */
+       ram     : ORIGIN = CFG_MONITOR_BASE, LENGTH = CFG_MONITOR_LEN
+       l1_code : ORIGIN = L1_INST_SRAM+0xC, LENGTH = L1_INST_SRAM_SIZE
+       l1_data : ORIGIN = L1_DATA_B_SRAM,   LENGTH = L1_DATA_B_SRAM_SIZE
+}
 
-    cpu/bf533/start.o          (.text)
-    cpu/bf533/start1.o         (.text)
-    cpu/bf533/traps.o          (.text)
-    cpu/bf533/interrupt.o      (.text)
-    cpu/bf533/serial.o         (.text)
-    common/dlmalloc.o          (.text)
-/*  lib_blackfin/bf533_string.o        (.text) */
-/*  lib_generic/vsprintf.o     (.text) */
-    lib_generic/crc32.o                (.text)
-    lib_generic/zlib.o         (.text)
-    board/bf533-ezkit/bf533-ezkit.o            (.text)
+SECTIONS
+{
+       .text :
+       {
+#ifdef ENV_IS_EMBEDDED
+               /* WARNING - the following is hand-optimized to fit within
+                * the sector before the environment sector. If it throws
+                * an error during compilation remove an object here to get
+                * it linked after the configuration sector.
+                */
 
-    . = DEFINED(env_offset) ? env_offset : .;
-    common/environment.o       (.text)
+               cpu/blackfin/start.o            (.text)
+               cpu/blackfin/traps.o            (.text)
+               cpu/blackfin/interrupt.o        (.text)
+               cpu/blackfin/serial.o           (.text)
+               common/dlmalloc.o               (.text)
+               lib_generic/crc32.o             (.text)
+               lib_generic/zlib.o              (.text)
+               board/bf533-ezkit/bf533-ezkit.o         (.text)
 
-    *(.text)
-    *(.fixup)
-    *(.got1)
-  }
-  _etext = .;
-  PROVIDE (etext = .);
-  .rodata    :
-  {
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
+               . = DEFINED(env_offset) ? env_offset : .;
+               common/environment.o    (.text)
+#endif
 
-  /* 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;
+               *(.text .text.*)
+       } >ram
 
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
+       .rodata :
+       {
+               . = ALIGN(4);
+               *(.rodata .rodata.*)
+               *(.rodata1)
+               *(.eh_frame)
+               . = ALIGN(4);
+       } >ram
 
-  ___u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  ___u_boot_cmd_end = .;
+       .data :
+       {
+               . = ALIGN(256);
+               *(.data .data.*)
+               *(.data1)
+               *(.sdata)
+               *(.sdata2)
+               *(.dynamic)
+               CONSTRUCTORS
+       } >ram
 
+       .u_boot_cmd :
+       {
+               ___u_boot_cmd_start = .;
+               *(.u_boot_cmd)
+               ___u_boot_cmd_end = .;
+       } >ram
 
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
+       .text_l1 :
+       {
+               . = ALIGN(4);
+               __stext_l1 = .;
+               *(.l1.text)
+               . = ALIGN(4);
+               __etext_l1 = .;
+       } >l1_code AT>ram
+       __stext_l1_lma = LOADADDR(.text_l1);
 
-  . = ALIGN(256);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(256);
-  __init_end = .;
+       .data_l1 :
+       {
+               . = ALIGN(4);
+               __sdata_l1 = .;
+               *(.l1.data)
+               *(.l1.bss)
+               . = ALIGN(4);
+               __edata_l1 = .;
+       } >l1_data AT>ram
+       __sdata_l1_lma = LOADADDR(.data_l1);
 
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
+       .bss :
+       {
+               . = ALIGN(4);
+               __bss_start = .;
+               *(.sbss) *(.scommon)
+               *(.dynbss)
+               *(.bss .bss.*)
+               *(COMMON)
+               __bss_end = .;
+       } >ram
 }
index 02c941b..1115df8 100644 (file)
@@ -29,7 +29,7 @@ include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(BOARD).a
 
-COBJS  := $(BOARD).o spi.o
+COBJS  := $(BOARD).o spi_flash.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
@@ -39,7 +39,7 @@ $(LIB):       $(obj).depend $(OBJS) $(SOBJS) u-boot.lds
        $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
 
 u-boot.lds: u-boot.lds.S
-       $(CPP) $(CPPFLAGS) -P -Ubfin $^ > $@.tmp
+       $(CPP) $(CPPFLAGS) -D__ASSEMBLY__ -P -Ubfin $^ > $@.tmp
        mv -f $@.tmp $@
 
 clean:
index af03597..c4dde92 100644 (file)
@@ -43,13 +43,6 @@ DECLARE_GLOBAL_DATA_PTR;
 
 int checkboard(void)
 {
-#if (BFIN_CPU == ADSP_BF531)
-       printf("CPU:   ADSP BF531 Rev.: 0.%d\n", *pCHIPID >> 28);
-#elif (BFIN_CPU == ADSP_BF532)
-       printf("CPU:   ADSP BF532 Rev.: 0.%d\n", *pCHIPID >> 28);
-#else
-       printf("CPU:   ADSP BF533 Rev.: 0.%d\n", *pCHIPID >> 28);
-#endif
        printf("Board: ADI BF533 Stamp board\n");
        printf("       Support: http://blackfin.uclinux.org/\n");
        return 0;
index 113438b..de80ffe 100644 (file)
@@ -20,6 +20,6 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 # MA 02111-1307 USA
 #
-# TEXT_BASE should be defined as the MAX_SDRAM Address - 256k bytes
-#  256k is defined as CFG_MONITOR_LEN in ./include/configs/<board>.h
-TEXT_BASE = 0x07FC0000
+
+# This is not actually used for Blackfin boards so do not change it
+#TEXT_BASE = do-not-use-me
diff --git a/board/bf533-stamp/spi.c b/board/bf533-stamp/spi.c
deleted file mode 100644 (file)
index 15141cf..0000000
+++ /dev/null
@@ -1,474 +0,0 @@
-/****************************************************************************
- *  SPI flash driver for M25P64
- ****************************************************************************/
-#include <common.h>
-#include <linux/ctype.h>
-#include <asm/io.h>
-#include <asm/mach-common/bits/spi.h>
-
-#if defined(CONFIG_SPI)
-
- /*Application definitions */
-
-#define        NUM_SECTORS     128     /* number of sectors */
-#define SECTOR_SIZE            0x10000
-#define NOP_NUM                1000
-
-#define COMMON_SPI_SETTINGS (SPE|MSTR|CPHA|CPOL)       /*Settings to the SPI_CTL */
-#define TIMOD01 (0x01)         /*stes the SPI to work with core instructions */
-
- /*Flash commands */
-#define SPI_WREN       (0x06)  /*Set Write Enable Latch */
-#define SPI_WRDI       (0x04)  /*Reset Write Enable Latch */
-#define SPI_RDSR       (0x05)  /*Read Status Register */
-#define SPI_WRSR       (0x01)  /*Write Status Register */
-#define SPI_READ       (0x03)  /*Read data from memory */
-#define SPI_PP         (0x02)  /*Program Data into memory */
-#define SPI_SE         (0xD8)  /*Erase one sector in memory */
-#define SPI_BE         (0xC7)  /*Erase all memory */
-#define WIP            (0x1)   /*Check the write in progress bit of the SPI status register */
-#define WEL            (0x2)   /*Check the write enable bit of the SPI status register */
-
-#define TIMEOUT 350000000
-
-typedef enum {
-       NO_ERR,
-       POLL_TIMEOUT,
-       INVALID_SECTOR,
-       INVALID_BLOCK,
-} ERROR_CODE;
-
-void spi_init_f(void);
-void spi_init_r(void);
-ssize_t spi_read(uchar *, int, uchar *, int);
-ssize_t spi_write(uchar *, int, uchar *, int);
-
-char ReadStatusRegister(void);
-void Wait_For_SPIF(void);
-void SetupSPI(const int spi_setting);
-void SPI_OFF(void);
-void SendSingleCommand(const int iCommand);
-
-ERROR_CODE GetSectorNumber(unsigned long ulOffset, int *pnSector);
-ERROR_CODE EraseBlock(int nBlock);
-ERROR_CODE ReadData(unsigned long ulStart, long lCount, int *pnData);
-ERROR_CODE WriteData(unsigned long ulStart, long lCount, int *pnData);
-ERROR_CODE Wait_For_Status(char Statusbit);
-ERROR_CODE Wait_For_WEL(void);
-
-/* -------------------
- * Variables
- * ------------------- */
-
-/* **************************************************************************
- *
- *  Function:    spi_init_f
- *
- *  Description: Init SPI-Controller (ROM part)
- *
- *  return:      ---
- *
- * *********************************************************************** */
-void spi_init_f(void)
-{
-}
-
-/* **************************************************************************
- *
- *  Function:    spi_init_r
- *
- *  Description: Init SPI-Controller (RAM part) -
- *              The malloc engine is ready and we can move our buffers to
- *              normal RAM
- *
- *  return:      ---
- *
- * *********************************************************************** */
-void spi_init_r(void)
-{
-       return;
-}
-
-/****************************************************************************
- *  Function:    spi_write
- **************************************************************************** */
-ssize_t spi_write(uchar * addr, int alen, uchar * buffer, int len)
-{
-       unsigned long offset;
-       int start_block, end_block;
-       int start_byte, end_byte;
-       ERROR_CODE result = NO_ERR;
-       uchar temp[SECTOR_SIZE];
-       int i, num;
-
-       offset = addr[0] << 16 | addr[1] << 8 | addr[2];
-       /* Get the start block number */
-       result = GetSectorNumber(offset, &start_block);
-       if (result == INVALID_SECTOR) {
-               printf("Invalid sector! ");
-               return 0;
-       }
-       /* Get the end block number */
-       result = GetSectorNumber(offset + len - 1, &end_block);
-       if (result == INVALID_SECTOR) {
-               printf("Invalid sector! ");
-               return 0;
-       }
-
-       for (num = start_block; num <= end_block; num++) {
-               ReadData(num * SECTOR_SIZE, SECTOR_SIZE, (int *)temp);
-               start_byte = num * SECTOR_SIZE;
-               end_byte = (num + 1) * SECTOR_SIZE - 1;
-               if (start_byte < offset)
-                       start_byte = offset;
-               if (end_byte > (offset + len))
-                       end_byte = (offset + len - 1);
-               for (i = start_byte; i <= end_byte; i++)
-                       temp[i - num * SECTOR_SIZE] = buffer[i - offset];
-               EraseBlock(num);
-               result = WriteData(num * SECTOR_SIZE, SECTOR_SIZE, (int *)temp);
-               if (result != NO_ERR)
-                       return 0;
-               printf(".");
-       }
-       return len;
-}
-
-/****************************************************************************
- *  Function:    spi_read
- **************************************************************************** */
-ssize_t spi_read(uchar * addr, int alen, uchar * buffer, int len)
-{
-       unsigned long offset;
-       offset = addr[0] << 16 | addr[1] << 8 | addr[2];
-       ReadData(offset, len, (int *)buffer);
-       return len;
-}
-
-void SendSingleCommand(const int iCommand)
-{
-       unsigned short dummy;
-
-       /*turns on the SPI in single write mode */
-       SetupSPI((COMMON_SPI_SETTINGS | TIMOD01));
-
-       /*sends the actual command to the SPI TX register */
-       *pSPI_TDBR = iCommand;
-       SSYNC();
-
-       /*The SPI status register will be polled to check the SPIF bit */
-       Wait_For_SPIF();
-
-       dummy = *pSPI_RDBR;
-
-       /*The SPI will be turned off */
-       SPI_OFF();
-
-}
-
-void SetupSPI(const int spi_setting)
-{
-
-       if (icache_status() || dcache_status())
-               udelay(CONFIG_CCLK_HZ / 50000000);
-       /*sets up the PF2 to be the slave select of the SPI */
-       *pSPI_FLG = 0xFB04;
-       *pSPI_BAUD = CONFIG_SPI_BAUD;
-       *pSPI_CTL = spi_setting;
-       SSYNC();
-}
-
-void SPI_OFF(void)
-{
-
-       *pSPI_CTL = 0x0400;     /* disable SPI */
-       *pSPI_FLG = 0;
-       *pSPI_BAUD = 0;
-       SSYNC();
-       udelay(CONFIG_CCLK_HZ / 50000000);
-
-}
-
-void Wait_For_SPIF(void)
-{
-       unsigned short dummyread;
-       while ((*pSPI_STAT & TXS)) ;
-       while (!(*pSPI_STAT & SPIF)) ;
-       while (!(*pSPI_STAT & RXS)) ;
-       dummyread = *pSPI_RDBR; /* Read dummy to empty the receive register      */
-
-}
-
-ERROR_CODE Wait_For_WEL(void)
-{
-       int i;
-       char status_register = 0;
-       ERROR_CODE ErrorCode = NO_ERR;  /* tells us if there was an error erasing flash */
-
-       for (i = 0; i < TIMEOUT; i++) {
-               status_register = ReadStatusRegister();
-               if ((status_register & WEL)) {
-                       ErrorCode = NO_ERR;     /* tells us if there was an error erasing flash */
-                       break;
-               }
-               ErrorCode = POLL_TIMEOUT;       /* Time out error */
-       };
-
-       return ErrorCode;
-}
-
-ERROR_CODE Wait_For_Status(char Statusbit)
-{
-       int i;
-       char status_register = 0xFF;
-       ERROR_CODE ErrorCode = NO_ERR;  /* tells us if there was an error erasing flash */
-
-       for (i = 0; i < TIMEOUT; i++) {
-               status_register = ReadStatusRegister();
-               if (!(status_register & Statusbit)) {
-                       ErrorCode = NO_ERR;     /* tells us if there was an error erasing flash */
-                       break;
-               }
-               ErrorCode = POLL_TIMEOUT;       /* Time out error */
-       };
-
-       return ErrorCode;
-}
-
-char ReadStatusRegister(void)
-{
-       char status_register = 0;
-
-       SetupSPI((COMMON_SPI_SETTINGS | TIMOD01));      /* Turn on the SPI */
-
-       *pSPI_TDBR = SPI_RDSR;  /* send instruction to read status register */
-       SSYNC();
-       Wait_For_SPIF();        /*wait until the instruction has been sent */
-       *pSPI_TDBR = 0;         /*send dummy to receive the status register */
-       SSYNC();
-       Wait_For_SPIF();        /*wait until the data has been sent */
-       status_register = *pSPI_RDBR;   /*read the status register */
-
-       SPI_OFF();              /* Turn off the SPI */
-
-       return status_register;
-}
-
-ERROR_CODE GetSectorNumber(unsigned long ulOffset, int *pnSector)
-{
-       int nSector = 0;
-       ERROR_CODE ErrorCode = NO_ERR;
-
-       if (ulOffset > (NUM_SECTORS * 0x10000 - 1)) {
-               ErrorCode = INVALID_SECTOR;
-               return ErrorCode;
-       }
-
-       nSector = (int)ulOffset / 0x10000;
-       *pnSector = nSector;
-
-       /* ok */
-       return ErrorCode;
-}
-
-ERROR_CODE EraseBlock(int nBlock)
-{
-       unsigned long ulSectorOff = 0x0, ShiftValue;
-       ERROR_CODE ErrorCode = NO_ERR;
-
-       /* if the block is invalid just return */
-       if ((nBlock < 0) || (nBlock > NUM_SECTORS)) {
-               ErrorCode = INVALID_BLOCK;      /* tells us if there was an error erasing flash */
-               return ErrorCode;
-       }
-       /* figure out the offset of the block in flash */
-       if ((nBlock >= 0) && (nBlock < NUM_SECTORS)) {
-               ulSectorOff = (nBlock * SECTOR_SIZE);
-
-       } else {
-               ErrorCode = INVALID_BLOCK;      /* tells us if there was an error erasing flash */
-               return ErrorCode;
-       }
-
-       /* A write enable instruction must previously have been executed */
-       SendSingleCommand(SPI_WREN);
-
-       /*The status register will be polled to check the write enable latch "WREN" */
-       ErrorCode = Wait_For_WEL();
-
-       if (POLL_TIMEOUT == ErrorCode) {
-               printf("SPI Erase block error\n");
-               return ErrorCode;
-       } else
-               /*Turn on the SPI to send single commands */
-               SetupSPI((COMMON_SPI_SETTINGS | TIMOD01));
-
-       /* Send the erase block command to the flash followed by the 24 address  */
-       /* to point to the start of a sector. */
-       *pSPI_TDBR = SPI_SE;
-       SSYNC();
-       Wait_For_SPIF();
-       ShiftValue = (ulSectorOff >> 16);       /* Send the highest byte of the 24 bit address at first */
-       *pSPI_TDBR = ShiftValue;
-       SSYNC();
-       Wait_For_SPIF();        /* Wait until the instruction has been sent */
-       ShiftValue = (ulSectorOff >> 8);        /* Send the middle byte of the 24 bit address  at second */
-       *pSPI_TDBR = ShiftValue;
-       SSYNC();
-       Wait_For_SPIF();        /* Wait until the instruction has been sent */
-       *pSPI_TDBR = ulSectorOff;       /* Send the lowest byte of the 24 bit address finally */
-       SSYNC();
-       Wait_For_SPIF();        /* Wait until the instruction has been sent */
-
-       /*Turns off the SPI */
-       SPI_OFF();
-
-       /* Poll the status register to check the Write in Progress bit */
-       /* Sector erase takes time */
-       ErrorCode = Wait_For_Status(WIP);
-
-       /* block erase should be complete */
-       return ErrorCode;
-}
-
-/*****************************************************************************
-* ERROR_CODE ReadData()
-*
-* Read a value from flash for verify purpose
-*
-* Inputs:      unsigned long ulStart - holds the SPI start address
-*                      int pnData - pointer to store value read from flash
-*                      long lCount - number of elements to read
-***************************************************************************** */
-ERROR_CODE ReadData(unsigned long ulStart, long lCount, int *pnData)
-{
-       unsigned long ShiftValue;
-       char *cnData;
-       int i;
-
-       cnData = (char *)pnData;        /* Pointer cast to be able to increment byte wise */
-
-       /* Start SPI interface   */
-       SetupSPI((COMMON_SPI_SETTINGS | TIMOD01));
-
-       *pSPI_TDBR = SPI_READ;  /* Send the read command to SPI device */
-       SSYNC();
-       Wait_For_SPIF();        /* Wait until the instruction has been sent */
-       ShiftValue = (ulStart >> 16);   /* Send the highest byte of the 24 bit address at first */
-       *pSPI_TDBR = ShiftValue;        /* Send the byte to the SPI device */
-       SSYNC();
-       Wait_For_SPIF();        /* Wait until the instruction has been sent */
-       ShiftValue = (ulStart >> 8);    /* Send the middle byte of the 24 bit address  at second */
-       *pSPI_TDBR = ShiftValue;        /* Send the byte to the SPI device */
-       SSYNC();
-       Wait_For_SPIF();        /* Wait until the instruction has been sent */
-       *pSPI_TDBR = ulStart;   /* Send the lowest byte of the 24 bit address finally */
-       SSYNC();
-       Wait_For_SPIF();        /* Wait until the instruction has been sent */
-
-       /* After the SPI device address has been placed on the MOSI pin the data can be */
-       /* received on the MISO pin. */
-       for (i = 0; i < lCount; i++) {
-               *pSPI_TDBR = 0; /*send dummy */
-               SSYNC();
-               while (!(*pSPI_STAT & RXS)) ;
-               *cnData++ = *pSPI_RDBR; /*read  */
-
-               if ((i >= SECTOR_SIZE) && (i % SECTOR_SIZE == 0))
-                       printf(".");
-       }
-
-       SPI_OFF();              /* Turn off the SPI */
-
-       return NO_ERR;
-}
-
-ERROR_CODE WriteFlash(unsigned long ulStartAddr, long lTransferCount,
-                     int *iDataSource, long *lWriteCount)
-{
-
-       unsigned long ulWAddr;
-       long lWTransferCount = 0;
-       int i;
-       char iData;
-       char *temp = (char *)iDataSource;
-       ERROR_CODE ErrorCode = NO_ERR;  /* tells us if there was an error erasing flash */
-
-       /* First, a Write Enable Command must be sent to the SPI. */
-       SendSingleCommand(SPI_WREN);
-
-       /* Second, the SPI Status Register will be tested whether the  */
-       /*         Write Enable Bit has been set.  */
-       ErrorCode = Wait_For_WEL();
-       if (POLL_TIMEOUT == ErrorCode) {
-               printf("SPI Write Time Out\n");
-               return ErrorCode;
-       } else
-               /* Third, the 24 bit address will be shifted out the SPI MOSI bytewise. */
-               SetupSPI((COMMON_SPI_SETTINGS | TIMOD01));      /* Turns the SPI on */
-       *pSPI_TDBR = SPI_PP;
-       SSYNC();
-       Wait_For_SPIF();        /*wait until the instruction has been sent */
-       ulWAddr = (ulStartAddr >> 16);
-       *pSPI_TDBR = ulWAddr;
-       SSYNC();
-       Wait_For_SPIF();        /*wait until the instruction has been sent */
-       ulWAddr = (ulStartAddr >> 8);
-       *pSPI_TDBR = ulWAddr;
-       SSYNC();
-       Wait_For_SPIF();        /*wait until the instruction has been sent */
-       ulWAddr = ulStartAddr;
-       *pSPI_TDBR = ulWAddr;
-       SSYNC();
-       Wait_For_SPIF();        /*wait until the instruction has been sent */
-       /* Fourth, maximum number of 256 bytes will be taken from the Buffer */
-       /* and sent to the SPI device. */
-       for (i = 0; (i < lTransferCount) && (i < 256); i++, lWTransferCount++) {
-               iData = *temp;
-               *pSPI_TDBR = iData;
-               SSYNC();
-               Wait_For_SPIF();        /*wait until the instruction has been sent */
-               temp++;
-       }
-
-       SPI_OFF();              /* Turns the SPI off */
-
-       /* Sixth, the SPI Write in Progress Bit must be toggled to ensure the  */
-       /* programming is done before start of next transfer. */
-       ErrorCode = Wait_For_Status(WIP);
-
-       if (POLL_TIMEOUT == ErrorCode) {
-               printf("SPI Program Time out!\n");
-               return ErrorCode;
-       } else
-
-               *lWriteCount = lWTransferCount;
-
-       return ErrorCode;
-}
-
-ERROR_CODE WriteData(unsigned long ulStart, long lCount, int *pnData)
-{
-
-       unsigned long ulWStart = ulStart;
-       long lWCount = lCount, lWriteCount;
-       long *pnWriteCount = &lWriteCount;
-
-       ERROR_CODE ErrorCode = NO_ERR;
-
-       while (lWCount != 0) {
-               ErrorCode = WriteFlash(ulWStart, lWCount, pnData, pnWriteCount);
-
-               /* After each function call of WriteFlash the counter must be adjusted */
-               lWCount -= *pnWriteCount;
-
-               /* Also, both address pointers must be recalculated. */
-               ulWStart += *pnWriteCount;
-               pnData += *pnWriteCount / 4;
-       }
-
-       /* return the appropriate error code */
-       return ErrorCode;
-}
-
-#endif                         /* CONFIG_SPI */
diff --git a/board/bf533-stamp/spi_flash.c b/board/bf533-stamp/spi_flash.c
new file mode 100644 (file)
index 0000000..8784741
--- /dev/null
@@ -0,0 +1,2 @@
+/* Share the spi flash code */
+#include "../bf537-stamp/spi_flash.c"
index 03ef72b..01780c5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * U-boot - u-boot.lds.S
  *
- * Copyright (c) 2005-2007 Analog Device Inc.
+ * Copyright (c) 2005-2008 Analog Device Inc.
  *
  * (C) Copyright 2000-2004
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  */
 
 #include <config.h>
+#include <asm/blackfin.h>
+#undef ALIGN
+
+/* If we don't actually load anything into L1 data, this will avoid
+ * a syntax error.  If we do actually load something into L1 data,
+ * we'll get a linker memory load error (which is what we'd want).
+ * 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_B_SRAM
+# define L1_DATA_B_SRAM      CFG_MONITOR_BASE
+# define L1_DATA_B_SRAM_SIZE 0
+#endif
 
 OUTPUT_ARCH(bfin)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
+
+/* The 0xC offset is so we don't clobber the tiny LDR jump block. */
+MEMORY
 {
-  /* 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) }
-  . = CFG_MONITOR_BASE;
-  .text      :
-  {
-    /* WARNING - the following is hand-optimized to fit within */
-    /* the sector before the environment sector. If it throws  */
-    /* an error during compilation remove an object here to get        */
-    /* it linked after the configuration sector.               */
+       ram     : ORIGIN = CFG_MONITOR_BASE, LENGTH = CFG_MONITOR_LEN
+       l1_code : ORIGIN = L1_INST_SRAM+0xC, LENGTH = L1_INST_SRAM_SIZE
+       l1_data : ORIGIN = L1_DATA_B_SRAM,   LENGTH = L1_DATA_B_SRAM_SIZE
+}
 
-    cpu/bf533/start.o          (.text)
-    cpu/bf533/start1.o         (.text)
-    cpu/bf533/traps.o          (.text)
-    cpu/bf533/interrupt.o      (.text)
-    cpu/bf533/serial.o         (.text)
-    common/dlmalloc.o          (.text)
-/*  lib_blackfin/bf533_string.o        (.text) */
-/*  lib_generic/vsprintf.o     (.text) */
-    lib_generic/crc32.o                (.text)
-/*  lib_generic/zlib.o         (.text) */
-/*  board/stamp/stamp.o                (.text) */
+SECTIONS
+{
+       .text :
+       {
+#ifdef ENV_IS_EMBEDDED
+               /* WARNING - the following is hand-optimized to fit within
+                * the sector before the environment sector. If it throws
+                * an error during compilation remove an object here to get
+                * it linked after the configuration sector.
+                */
 
-    . = DEFINED(env_offset) ? env_offset : .;
-    common/environment.o       (.text)
+               cpu/blackfin/start.o            (.text)
+               cpu/blackfin/traps.o            (.text)
+               cpu/blackfin/interrupt.o        (.text)
+               cpu/blackfin/serial.o           (.text)
+               common/dlmalloc.o               (.text)
+               lib_generic/crc32.o             (.text)
 
-    *(.text)
-    *(.fixup)
-    *(.got1)
-  }
-  _etext = .;
-  PROVIDE (etext = .);
-  .rodata    :
-  {
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
+               . = DEFINED(env_offset) ? env_offset : .;
+               common/environment.o    (.text)
+#endif
 
-  /* 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;
+               *(.text .text.*)
+       } >ram
 
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
+       .rodata :
+       {
+               . = ALIGN(4);
+               *(.rodata .rodata.*)
+               *(.rodata1)
+               *(.eh_frame)
+               . = ALIGN(4);
+       } >ram
 
-  ___u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  ___u_boot_cmd_end = .;
+       .data :
+       {
+               . = ALIGN(256);
+               *(.data .data.*)
+               *(.data1)
+               *(.sdata)
+               *(.sdata2)
+               *(.dynamic)
+               CONSTRUCTORS
+       } >ram
 
+       .u_boot_cmd :
+       {
+               ___u_boot_cmd_start = .;
+               *(.u_boot_cmd)
+               ___u_boot_cmd_end = .;
+       } >ram
 
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
+       .text_l1 :
+       {
+               . = ALIGN(4);
+               __stext_l1 = .;
+               *(.l1.text)
+               . = ALIGN(4);
+               __etext_l1 = .;
+       } >l1_code AT>ram
+       __stext_l1_lma = LOADADDR(.text_l1);
 
-  . = ALIGN(256);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(256);
-  __init_end = .;
+       .data_l1 :
+       {
+               . = ALIGN(4);
+               __sdata_l1 = .;
+               *(.l1.data)
+               *(.l1.bss)
+               . = ALIGN(4);
+               __edata_l1 = .;
+       } >l1_data AT>ram
+       __sdata_l1_lma = LOADADDR(.data_l1);
 
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
+       .bss :
+       {
+               . = ALIGN(4);
+               __bss_start = .;
+               *(.sbss) *(.scommon)
+               *(.dynbss)
+               *(.bss .bss.*)
+               *(COMMON)
+               __bss_end = .;
+       } >ram
 }
index e488844..ea8c436 100644 (file)
@@ -29,7 +29,7 @@ include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(BOARD).a
 
-COBJS  := $(BOARD).o flash.o ether_bf537.o post-memory.o stm_m25p64.o cmd_bf537led.o nand.o
+COBJS  := $(BOARD).o post-memory.o spi_flash.o cmd_bf537led.o nand.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
@@ -39,7 +39,7 @@ $(LIB):       $(obj).depend $(OBJS) $(SOBJS) u-boot.lds
        $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
 
 u-boot.lds: u-boot.lds.S
-       $(CPP) $(CPPFLAGS) -P -Ubfin $^ > $@.tmp
+       $(CPP) $(CPPFLAGS) -D__ASSEMBLY__ -P -Ubfin $^ > $@.tmp
        mv -f $@.tmp $@
 
 clean:
index d279817..e714177 100644 (file)
@@ -31,7 +31,6 @@
 #include <asm/blackfin.h>
 #include <asm/io.h>
 #include <net.h>
-#include "ether_bf537.h"
 #include <asm/mach-common/bits/bootrom.h>
 
 /**
@@ -54,60 +53,8 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define POST_WORD_ADDR 0xFF903FFC
 
-/*
- * the bootldr command loads an address, checks to see if there
- *   is a Boot stream that the on-chip BOOTROM can understand,
- *   and loads it via the BOOTROM Callback. It is possible
- *   to also add booting from SPI, or TWI, but this function does
- *   not currently support that.
- */
-int do_bootldr(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
-{
-       ulong addr, entry;
-       ulong *data;
-
-       /* Get the address */
-       if (argc < 2) {
-               addr = load_addr;
-       } else {
-               addr = simple_strtoul(argv[1], NULL, 16);
-       }
-
-       /* Check if it is a LDR file */
-       data = (ulong *) addr;
-       if (*data == 0xFF800060 || *data == 0xFF800040 || *data == 0xFF800020) {
-               /* We want to boot from FLASH or SDRAM */
-               entry = _BOOTROM_BOOT_DXE_FLASH;
-               printf("## Booting ldr image at 0x%08lx ...\n", addr);
-               if (icache_status())
-                       icache_disable();
-               if (dcache_status())
-                       dcache_disable();
-
-             __asm__("R7=%[a];\n" "P0=%[b];\n" "JUMP (P0);\n":
-             :[a] "d"(addr),[b] "a"(entry)
-             :"R7", "P0");
-
-       } else {
-               printf("## No ldr image at address 0x%08lx\n", addr);
-       }
-
-       return 0;
-}
-
-U_BOOT_CMD(bootldr, 2, 0, do_bootldr,
-          "bootldr - boot ldr image from memory\n",
-          "[addr]\n         - boot ldr image stored in memory\n");
-
 int checkboard(void)
 {
-#if (BFIN_CPU == ADSP_BF534)
-       printf("CPU:   ADSP BF534 Rev.: 0.%d\n", *pCHIPID >> 28);
-#elif (BFIN_CPU == ADSP_BF536)
-       printf("CPU:   ADSP BF536 Rev.: 0.%d\n", *pCHIPID >> 28);
-#else
-       printf("CPU:   ADSP BF537 Rev.: 0.%d\n", *pCHIPID >> 28);
-#endif
        printf("Board: ADI BF537 stamp board\n");
        printf("       Support: http://blackfin.uclinux.org/\n");
        return 0;
@@ -173,12 +120,10 @@ long int initdram(int board_type)
 /* miscellaneous platform dependent initialisations */
 int misc_init_r(void)
 {
-#if (BFIN_BOOT_MODE == BF537_BYPASS_BOOT)
+#if defined(CONFIG_CMD_NET)
        char nid[32];
        unsigned char *pMACaddr = (unsigned char *)0x203F0000;
-       u8 SrcAddr[6] = { 0x02, 0x80, 0xAD, 0x20, 0x31, 0xB8 };
 
-#if defined(CONFIG_CMD_NET)
        /* The 0xFF check here is to make sure we don't use the address
         * in flash if it's simply been erased (aka all 0xFF values) */
        if (getenv("ethaddr") == NULL && is_valid_ether_addr(pMACaddr)) {
@@ -187,11 +132,7 @@ int misc_init_r(void)
                        pMACaddr[2], pMACaddr[3], pMACaddr[4], pMACaddr[5]);
                setenv("ethaddr", nid);
        }
-       if (getenv("ethaddr")) {
-               SetupMacAddr(SrcAddr);
-       }
 #endif
-#endif                         /* BFIN_BOOT_MODE == BF537_BYPASS_BOOT */
 
 #if defined(CONFIG_BFIN_IDE)
 #if defined(CONFIG_BFIN_TRUE_IDE)
@@ -214,13 +155,6 @@ int misc_init_r(void)
 #endif                         /* CONFIG_MISC_INIT_R */
 
 #ifdef CONFIG_POST
-#if (BFIN_BOOT_MODE != BF537_BYPASS_BOOT)
-/* Using sw10-PF5 as the hotkey */
-int post_hotkeys_pressed(void)
-{
-       return 0;
-}
-#else
 /* Using sw10-PF5 as the hotkey */
 int post_hotkeys_pressed(void)
 {
@@ -253,7 +187,6 @@ int post_hotkeys_pressed(void)
        }
 }
 #endif
-#endif
 
 #if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
 void post_word_store(ulong a)
index a623c3d..1b87d53 100644 (file)
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 # MA 02111-1307 USA
 #
-# TEXT_BASE should be defined as the MAX_SDRAM Address - 256k bytes
-#  256k is defined as CFG_MONITOR_LEN in ./include/configs/<board>.h
-TEXT_BASE = 0x03FC0000
+
+# This is not actually used for Blackfin boards so do not change it
+#TEXT_BASE = do-not-use-me
+
+# 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))
diff --git a/board/bf537-stamp/flash-defines.h b/board/bf537-stamp/flash-defines.h
deleted file mode 100644 (file)
index 1fa7a10..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * U-boot - flash-defines.h
- *
- * Copyright (c) 2005-2007 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
- */
-
-#ifndef __FLASHDEFINES_H__
-#define __FLASHDEFINES_H__
-
-#include <common.h>
-
-#define V_ULONG(a)             (*(volatile unsigned long *)( a ))
-#define V_BYTE(a)              (*(volatile unsigned char *)( a ))
-#define TRUE                   0x1
-#define FALSE                  0x0
-#define BUFFER_SIZE            0x80000
-#define NO_COMMAND             0
-#define GET_CODES              1
-#define RESET                  2
-#define WRITE                  3
-#define FILL                   4
-#define ERASE_ALL              5
-#define ERASE_SECT             6
-#define READ                   7
-#define GET_SECTNUM            8
-#define FLASH_START_L          0x0000
-#define FLASH_START_H          0x2000
-#define FLASH_MAN_ST           2
-#define RESET_VAL              0xF0
-
-flash_info_t flash_info[CFG_MAX_FLASH_BANKS];
-
-int get_codes(void);
-int poll_toggle_bit(long lOffset);
-void reset_flash(void);
-int erase_flash(void);
-int erase_block_flash(int);
-void unlock_flash(long lOffset);
-int write_data(long lStart, long lCount, uchar * pnData);
-int read_flash(long nOffset, int *pnValue);
-int write_flash(long nOffset, int nValue);
-void get_sector_number(long lOffset, int *pnSector);
-int GetSectorProtectionStatus(flash_info_t * info, int nSector);
-int GetOffset(int nBlock);
-int AFP_NumSectors = 71;
-long AFP_SectorSize2 = 0x10000;
-int AFP_SectorSize1 = 0x2000;
-
-#define NUM_SECTORS            71
-
-#define WRITESEQ1              0x0AAA
-#define WRITESEQ2              0x0554
-#define WRITESEQ3              0x0AAA
-#define WRITESEQ4              0x0AAA
-#define WRITESEQ5              0x0554
-#define WRITESEQ6              0x0AAA
-#define WRITEDATA1             0xaa
-#define WRITEDATA2             0x55
-#define WRITEDATA3             0x80
-#define WRITEDATA4             0xaa
-#define WRITEDATA5             0x55
-#define WRITEDATA6             0x10
-#define PriFlashABegin         0
-#define SecFlashABegin         8
-#define SecFlashBBegin         36
-#define PriFlashAOff           0x0
-#define PriFlashBOff           0x100000
-#define SecFlashAOff           0x10000
-#define SecFlashBOff           0x280000
-#define INVALIDLOCNSTART       0x20270000
-#define INVALIDLOCNEND         0x20280000
-#define BlockEraseVal          0x30
-#define UNLOCKDATA1            0xaa
-#define UNLOCKDATA2            0x55
-#define UNLOCKDATA3            0xa0
-#define GETCODEDATA1           0xaa
-#define GETCODEDATA2           0x55
-#define GETCODEDATA3           0x90
-#define SecFlashASec1Off       0x200000
-#define SecFlashASec2Off       0x204000
-#define SecFlashASec3Off       0x206000
-#define SecFlashASec4Off       0x208000
-#define SecFlashAEndOff                0x210000
-#define SecFlashBSec1Off       0x280000
-#define SecFlashBSec2Off       0x284000
-#define SecFlashBSec3Off       0x286000
-#define SecFlashBSec4Off       0x288000
-#define SecFlashBEndOff                0x290000
-
-#define SECT32                 32
-#define SECT33                 33
-#define SECT34                 34
-#define SECT35                 35
-#define SECT36                 36
-#define SECT37                 37
-#define SECT38                 38
-#define SECT39                 39
-
-#define FLASH_SUCCESS  0
-#define FLASH_FAIL     -1
-
-#endif
diff --git a/board/bf537-stamp/flash.c b/board/bf537-stamp/flash.c
deleted file mode 100644 (file)
index 8252c42..0000000
+++ /dev/null
@@ -1,403 +0,0 @@
-/*
- * U-boot - flash.c Flash driver for PSD4256GV
- *
- * Copyright (c) 2005-2007 Analog Devices Inc.
- * This file is based on BF533EzFlash.c originally written by 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 <malloc.h>
-#include <config.h>
-#include <asm/io.h>
-#include "flash-defines.h"
-
-void flash_reset(void)
-{
-       reset_flash();
-}
-
-unsigned long flash_get_size(ulong baseaddr, flash_info_t * info, int bank_flag)
-{
-       int id = 0, i = 0;
-       static int FlagDev = 1;
-
-       id = get_codes();
-       if (FlagDev) {
-               FlagDev = 0;
-       }
-       info->flash_id = id;
-       switch (bank_flag) {
-       case 0:
-               for (i = PriFlashABegin; i < SecFlashABegin; i++)
-                       info->start[i] = (baseaddr + (i * AFP_SectorSize1));
-               for (i = SecFlashABegin; i < NUM_SECTORS; i++)
-                       info->start[i] =
-                           (baseaddr + SecFlashAOff +
-                            ((i - SecFlashABegin) * AFP_SectorSize2));
-               info->size = 0x400000;
-               info->sector_count = NUM_SECTORS;
-               break;
-       case 1:
-               info->start[0] = baseaddr + SecFlashASec1Off;
-               info->start[1] = baseaddr + SecFlashASec2Off;
-               info->start[2] = baseaddr + SecFlashASec3Off;
-               info->start[3] = baseaddr + SecFlashASec4Off;
-               info->size = 0x10000;
-               info->sector_count = 4;
-               break;
-       case 2:
-               info->start[0] = baseaddr + SecFlashBSec1Off;
-               info->start[1] = baseaddr + SecFlashBSec2Off;
-               info->start[2] = baseaddr + SecFlashBSec3Off;
-               info->start[3] = baseaddr + SecFlashBSec4Off;
-               info->size = 0x10000;
-               info->sector_count = 4;
-               break;
-       }
-       return (info->size);
-}
-
-unsigned long flash_init(void)
-{
-       unsigned long size_b;
-       int i;
-
-       size_b = 0;
-       for (i = 0; i < CFG_MAX_FLASH_BANKS; ++i) {
-               flash_info[i].flash_id = FLASH_UNKNOWN;
-       }
-
-       size_b = flash_get_size(CFG_FLASH_BASE, &flash_info[0], 0);
-
-       if (flash_info[0].flash_id == FLASH_UNKNOWN || size_b == 0) {
-               printf("## Unknown FLASH on Bank 0 - Size = 0x%08lx = %ld MB\n",
-                      size_b, size_b >> 20);
-       }
-
-       /* flash_protect (int flag, ulong from, ulong to, flash_info_t *info) */
-       (void)flash_protect(FLAG_PROTECT_SET, CFG_FLASH_BASE,
-                           (flash_info[0].start[2] - 1), &flash_info[0]);
-#if (BFIN_BOOT_MODE == BF537_BYPASS_BOOT)
-       (void)flash_protect(FLAG_PROTECT_SET, 0x203F0000, 0x203FFFFF,
-                           &flash_info[0]);
-#endif
-
-       return (size_b);
-}
-
-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) {
-       case (STM_ID_29W320EB & 0xFFFF):
-       case (STM_ID_29W320DB & 0xFFFF):
-               printf("ST Microelectronics ");
-               break;
-       default:
-               printf("Unknown Vendor: (0x%08X) ", info->flash_id);
-               break;
-       }
-       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;
-}
-
-int flash_erase(flash_info_t * info, int s_first, int s_last)
-{
-       int cnt = 0, i;
-       int prot, sect;
-
-       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");
-
-       cnt = s_last - s_first + 1;
-
-#if (BFIN_BOOT_MODE == BF537_BYPASS_BOOT)
-       printf("Erasing Flash locations, Please Wait\n");
-       for (i = s_first; i <= s_last; i++) {
-               if (info->protect[i] == 0) {    /* not protected */
-                       if (erase_block_flash(i) < 0) {
-                               printf("Error Sector erasing \n");
-                               return FLASH_FAIL;
-                       }
-               }
-       }
-#elif (BFIN_BOOT_MODE == BF537_SPI_MASTER_BOOT)
-       if (cnt == FLASH_TOT_SECT) {
-               printf("Erasing flash, Please Wait \n");
-               if (erase_flash() < 0) {
-                       printf("Erasing flash failed \n");
-                       return FLASH_FAIL;
-               }
-       } else {
-               printf("Erasing Flash locations, Please Wait\n");
-               for (i = s_first; i <= s_last; i++) {
-                       if (info->protect[i] == 0) {    /* not protected */
-                               if (erase_block_flash(i) < 0) {
-                                       printf("Error Sector erasing \n");
-                                       return FLASH_FAIL;
-                               }
-                       }
-               }
-       }
-#endif
-       printf("\n");
-       return FLASH_SUCCESS;
-}
-
-int write_buff(flash_info_t * info, uchar * src, ulong addr, ulong cnt)
-{
-       int d;
-       if (addr % 2) {
-               read_flash(addr - 1 - CFG_FLASH_BASE, &d);
-               d = (int)((d & 0x00FF) | (*src++ << 8));
-               write_data(addr - 1, 2, (uchar *) & d);
-               write_data(addr + 1, cnt - 1, src);
-       } else
-               write_data(addr, cnt, src);
-       return FLASH_SUCCESS;
-}
-
-int write_data(long lStart, long lCount, uchar * pnData)
-{
-       long i = 0;
-       unsigned long ulOffset = lStart - CFG_FLASH_BASE;
-       int d;
-       int nSector = 0;
-       int flag = 0;
-
-       if (lCount % 2) {
-               flag = 1;
-               lCount = lCount - 1;
-       }
-
-       for (i = 0; i < lCount - 1; i += 2, ulOffset += 2) {
-               get_sector_number(ulOffset, &nSector);
-               read_flash(ulOffset, &d);
-               if (d != 0xffff) {
-                       printf
-                           ("Flash not erased at offset 0x%x Please erase to reprogram \n",
-                            ulOffset);
-                       return FLASH_FAIL;
-               }
-               unlock_flash(ulOffset);
-               d = (int)(pnData[i] | pnData[i + 1] << 8);
-               write_flash(ulOffset, d);
-               if (poll_toggle_bit(ulOffset) < 0) {
-                       printf("Error programming the flash \n");
-                       return FLASH_FAIL;
-               }
-               if ((i > 0) && (!(i % AFP_SectorSize2)))
-                       printf(".");
-       }
-       if (flag) {
-               get_sector_number(ulOffset, &nSector);
-               read_flash(ulOffset, &d);
-               if (d != 0xffff) {
-                       printf
-                           ("Flash not erased at offset 0x%x Please erase to reprogram \n",
-                            ulOffset);
-                       return FLASH_FAIL;
-               }
-               unlock_flash(ulOffset);
-               d = (int)(pnData[i] | (d & 0xFF00));
-               write_flash(ulOffset, d);
-               if (poll_toggle_bit(ulOffset) < 0) {
-                       printf("Error programming the flash \n");
-                       return FLASH_FAIL;
-               }
-       }
-       return FLASH_SUCCESS;
-}
-
-int write_flash(long nOffset, int nValue)
-{
-       long addr;
-
-       addr = (CFG_FLASH_BASE + nOffset);
-       *(unsigned volatile short *)addr = nValue;
-       SSYNC();
-#if (BFIN_BOOT_MODE == BF537_SPI_MASTER_BOOT)
-       if (icache_status())
-               udelay(CONFIG_CCLK_HZ / 1000000);
-#endif
-       return FLASH_SUCCESS;
-}
-
-int read_flash(long nOffset, int *pnValue)
-{
-       unsigned short *pFlashAddr =
-           (unsigned short *)(CFG_FLASH_BASE + nOffset);
-
-       *pnValue = *pFlashAddr;
-
-       return TRUE;
-}
-
-int poll_toggle_bit(long lOffset)
-{
-       unsigned int u1, u2;
-       volatile unsigned long *FB =
-           (volatile unsigned long *)(CFG_FLASH_BASE + lOffset);
-       while (1) {
-               u1 = *(volatile unsigned short *)FB;
-               u2 = *(volatile unsigned short *)FB;
-               u1 ^= u2;
-               if (!(u1 & 0x0040))
-                       break;
-               if (!(u2 & 0x0020))
-                       continue;
-               else {
-                       u1 = *(volatile unsigned short *)FB;
-                       u2 = *(volatile unsigned short *)FB;
-                       u1 ^= u2;
-                       if (!(u1 & 0x0040))
-                               break;
-                       else {
-                               reset_flash();
-                               return FLASH_FAIL;
-                       }
-               }
-       }
-       return FLASH_SUCCESS;
-}
-
-void reset_flash(void)
-{
-       write_flash(WRITESEQ1, RESET_VAL);
-       /* Wait for 10 micro seconds */
-       udelay(10);
-}
-
-int erase_flash(void)
-{
-       write_flash(WRITESEQ1, WRITEDATA1);
-       write_flash(WRITESEQ2, WRITEDATA2);
-       write_flash(WRITESEQ3, WRITEDATA3);
-       write_flash(WRITESEQ4, WRITEDATA4);
-       write_flash(WRITESEQ5, WRITEDATA5);
-       write_flash(WRITESEQ6, WRITEDATA6);
-
-       if (poll_toggle_bit(0x0000) < 0)
-               return FLASH_FAIL;
-
-       return FLASH_SUCCESS;
-}
-
-int erase_block_flash(int nBlock)
-{
-       long ulSectorOff = 0x0;
-
-       if ((nBlock < 0) || (nBlock > AFP_NumSectors))
-               return FALSE;
-
-       /* figure out the offset of the block in flash */
-       if ((nBlock >= 0) && (nBlock < SecFlashABegin))
-               ulSectorOff = nBlock * AFP_SectorSize1;
-
-       else if ((nBlock >= SecFlashABegin) && (nBlock < NUM_SECTORS))
-               ulSectorOff =
-                   SecFlashAOff + (nBlock - SecFlashABegin) * AFP_SectorSize2;
-       /* no such sector */
-       else
-               return FLASH_FAIL;
-
-       write_flash((WRITESEQ1 | ulSectorOff), WRITEDATA1);
-       write_flash((WRITESEQ2 | ulSectorOff), WRITEDATA2);
-       write_flash((WRITESEQ3 | ulSectorOff), WRITEDATA3);
-       write_flash((WRITESEQ4 | ulSectorOff), WRITEDATA4);
-       write_flash((WRITESEQ5 | ulSectorOff), WRITEDATA5);
-
-       write_flash(ulSectorOff, BlockEraseVal);
-
-       if (poll_toggle_bit(ulSectorOff) < 0)
-               return FLASH_FAIL;
-       printf(".");
-
-       return FLASH_SUCCESS;
-}
-
-void unlock_flash(long ulOffset)
-{
-       unsigned long ulOffsetAddr = ulOffset;
-       ulOffsetAddr &= 0xFFFF0000;
-
-       write_flash((WRITESEQ1 | ulOffsetAddr), UNLOCKDATA1);
-       write_flash((WRITESEQ2 | ulOffsetAddr), UNLOCKDATA2);
-       write_flash((WRITESEQ3 | ulOffsetAddr), UNLOCKDATA3);
-}
-
-int get_codes()
-{
-       int dev_id = 0;
-
-       write_flash(WRITESEQ1, GETCODEDATA1);
-       write_flash(WRITESEQ2, GETCODEDATA2);
-       write_flash(WRITESEQ3, GETCODEDATA3);
-
-       read_flash(0x0402, &dev_id);
-       dev_id &= 0x0000FFFF;
-
-       reset_flash();
-
-       return dev_id;
-}
-
-void get_sector_number(long ulOffset, int *pnSector)
-{
-       int nSector = 0;
-       long lMainEnd = 0x400000;
-       long lBootEnd = 0x10000;
-
-       /* sector numbers for the FLASH A boot sectors */
-       if (ulOffset < lBootEnd) {
-               nSector = (int)ulOffset / AFP_SectorSize1;
-       }
-       /* sector numbers for the FLASH B boot sectors */
-       else if ((ulOffset >= lBootEnd) && (ulOffset < lMainEnd)) {
-               nSector = ((ulOffset / (AFP_SectorSize2)) + 7);
-       }
-       /* if it is a valid sector, set it */
-       if ((nSector >= 0) && (nSector < AFP_NumSectors))
-               *pnSector = nSector;
-
-}
diff --git a/board/bf537-stamp/spi_flash.c b/board/bf537-stamp/spi_flash.c
new file mode 100644 (file)
index 0000000..7c73ddd
--- /dev/null
@@ -0,0 +1,815 @@
+/*
+ * SPI flash driver
+ *
+ * Enter bugs at http://blackfin.uclinux.org/
+ *
+ * Copyright (c) 2005-2007 Analog Devices Inc.
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+/* Configuration options:
+ * CONFIG_SPI_BAUD - value to load into SPI_BAUD (divisor of SCLK to get SPI CLK)
+ * CONFIG_SPI_FLASH_SLOW_READ - force usage of the slower read
+ *             WARNING: make sure your SCLK + SPI_BAUD is slow enough
+ */
+
+#include <common.h>
+#include <malloc.h>
+#include <asm/io.h>
+#include <asm/mach-common/bits/spi.h>
+
+/* Forcibly phase out these */
+#ifdef CONFIG_SPI_FLASH_NUM_SECTORS
+# error do not set CONFIG_SPI_FLASH_NUM_SECTORS
+#endif
+#ifdef CONFIG_SPI_FLASH_SECTOR_SIZE
+# error do not set CONFIG_SPI_FLASH_SECTOR_SIZE
+#endif
+
+#if defined(CONFIG_SPI)
+
+struct flash_info {
+       char     *name;
+       uint16_t id;
+       unsigned sector_size;
+       unsigned num_sectors;
+};
+
+/* SPI Speeds: 50 MHz / 33 MHz */
+static struct flash_info flash_spansion_serial_flash[] = {
+       { "S25FL016", 0x0215, 64 * 1024, 32 },
+       { "S25FL032", 0x0216, 64 * 1024, 64 },
+       { "S25FL064", 0x0217, 64 * 1024, 128 },
+       { "S25FL0128", 0x0218, 256 * 1024, 64 },
+       { NULL, 0, 0, 0 }
+};
+
+/* SPI Speeds: 50 MHz / 20 MHz */
+static struct flash_info flash_st_serial_flash[] = {
+       { "m25p05", 0x2010, 32 * 1024, 2 },
+       { "m25p10", 0x2011, 32 * 1024, 4 },
+       { "m25p20", 0x2012, 64 * 1024, 4 },
+       { "m25p40", 0x2013, 64 * 1024, 8 },
+       { "m25p16", 0x2015, 64 * 1024, 32 },
+       { "m25p32", 0x2016, 64 * 1024, 64 },
+       { "m25p64", 0x2017, 64 * 1024, 128 },
+       { "m25p128", 0x2018, 256 * 1024, 64 },
+       { NULL, 0, 0, 0 }
+};
+
+/* SPI Speeds: 66 MHz / 33 MHz */
+static struct flash_info flash_atmel_dataflash[] = {
+       { "AT45DB011x", 0x0c, 264, 512 },
+       { "AT45DB021x", 0x14, 264, 1025 },
+       { "AT45DB041x", 0x1c, 264, 2048 },
+       { "AT45DB081x", 0x24, 264, 4096 },
+       { "AT45DB161x", 0x2c, 528, 4096 },
+       { "AT45DB321x", 0x34, 528, 8192 },
+       { "AT45DB642x", 0x3c, 1056, 8192 },
+       { NULL, 0, 0, 0 }
+};
+
+/* SPI Speed: 50 MHz / 25 MHz or 40 MHz / 20 MHz */
+static struct flash_info flash_winbond_serial_flash[] = {
+       { "W25X10", 0x3011, 16 * 256, 32 },
+       { "W25X20", 0x3012, 16 * 256, 64 },
+       { "W25X40", 0x3013, 16 * 256, 128 },
+       { "W25X80", 0x3014, 16 * 256, 256 },
+       { "W25P80", 0x2014, 256 * 256, 16 },
+       { "W25P16", 0x2015, 256 * 256, 32 },
+       { NULL, 0, 0, 0 }
+};
+
+struct flash_ops {
+       uint8_t read, write, erase, status;
+};
+
+#ifdef CONFIG_SPI_FLASH_SLOW_READ
+# define OP_READ 0x03
+#else
+# define OP_READ 0x0B
+#endif
+static struct flash_ops flash_st_ops = {
+       .read = OP_READ,
+       .write = 0x02,
+       .erase = 0xD8,
+       .status = 0x05,
+};
+
+static struct flash_ops flash_atmel_ops = {
+       .read = OP_READ,
+       .write = 0x82,
+       .erase = 0x81,
+       .status = 0xD7,
+};
+
+static struct flash_ops flash_winbond_ops = {
+       .read = OP_READ,
+       .write = 0x02,
+       .erase = 0x20,
+       .status = 0x05,
+};
+
+struct manufacturer_info {
+       const char *name;
+       uint8_t id;
+       struct flash_info *flashes;
+       struct flash_ops *ops;
+};
+
+static struct {
+       struct manufacturer_info *manufacturer;
+       struct flash_info *flash;
+       struct flash_ops *ops;
+       uint8_t manufacturer_id, device_id1, device_id2;
+       unsigned int write_length;
+       unsigned long sector_size, num_sectors;
+} flash;
+
+enum {
+       JED_MANU_SPANSION = 0x01,
+       JED_MANU_ST       = 0x20,
+       JED_MANU_ATMEL    = 0x1F,
+       JED_MANU_WINBOND  = 0xEF,
+};
+
+static struct manufacturer_info flash_manufacturers[] = {
+       {
+               .name = "Spansion",
+               .id = JED_MANU_SPANSION,
+               .flashes = flash_spansion_serial_flash,
+               .ops = &flash_st_ops,
+       },
+       {
+               .name = "ST",
+               .id = JED_MANU_ST,
+               .flashes = flash_st_serial_flash,
+               .ops = &flash_st_ops,
+       },
+       {
+               .name = "Atmel",
+               .id = JED_MANU_ATMEL,
+               .flashes = flash_atmel_dataflash,
+               .ops = &flash_atmel_ops,
+       },
+       {
+               .name = "Winbond",
+               .id = JED_MANU_WINBOND,
+               .flashes = flash_winbond_serial_flash,
+               .ops = &flash_winbond_ops,
+       },
+};
+
+#define        TIMEOUT 5000    /* timeout of 5 seconds */
+
+/* BF54x support */
+#ifndef pSPI_CTL
+# define pSPI_CTL  pSPI0_CTL
+# define pSPI_BAUD pSPI0_BAUD
+# define pSPI_FLG  pSPI0_FLG
+# define pSPI_RDBR pSPI0_RDBR
+# define pSPI_STAT pSPI0_STAT
+# define pSPI_TDBR pSPI0_TDBR
+# define SPI0_SCK      0x0001
+# define SPI0_MOSI     0x0004
+# define SPI0_MISO     0x0002
+# define SPI0_SEL1     0x0010
+#endif
+
+/* Default to the SPI SSEL that we boot off of:
+ *     BF54x, BF537, (everything new?): SSEL1
+ *     BF533, BF561: SSEL2
+ */
+#ifndef CONFIG_SPI_FLASH_SSEL
+# if defined(__ADSPBF531__) || defined(__ADSPBF532__) || \
+     defined(__ADSPBF533__) || defined(__ADSPBF561__)
+#  define CONFIG_SPI_FLASH_SSEL 2
+# else
+#  define CONFIG_SPI_FLASH_SSEL 1
+# endif
+#endif
+#define SSEL_MASK (1 << CONFIG_SPI_FLASH_SSEL)
+
+static void SPI_INIT(void)
+{
+       /* [#3541] This delay appears to be necessary, but not sure
+        * exactly why as the history behind it is non-existant.
+        */
+       udelay(CONFIG_CCLK_HZ / 25000000);
+
+       /* enable SPI pins: SSEL, MOSI, MISO, SCK */
+#ifdef __ADSPBF54x__
+       *pPORTE_FER |= (SPI0_SCK | SPI0_MOSI | SPI0_MISO | SPI0_SEL1);
+#elif defined(__ADSPBF534__) || defined(__ADSPBF536__) || defined(__ADSPBF537__)
+       *pPORTF_FER |= (PF10 | PF11 | PF12 | PF13);
+#elif defined(__ADSPBF52x__)
+       bfin_write_PORTG_MUX((bfin_read_PORTG_MUX() & ~PORT_x_MUX_0_MASK) | PORT_x_MUX_0_FUNC_3);
+       bfin_write_PORTG_FER(bfin_read_PORTG_FER() | PG1 | PG2 | PG3 | PG4);
+#endif
+
+       /* initate communication upon write of TDBR */
+       *pSPI_CTL = (SPE|MSTR|CPHA|CPOL|0x01);
+       *pSPI_BAUD = CONFIG_SPI_BAUD;
+}
+
+static void SPI_DEINIT(void)
+{
+       /* put SPI settings back to reset state */
+       *pSPI_CTL = 0x0400;
+       *pSPI_BAUD = 0;
+       SSYNC();
+}
+
+static void SPI_ON(void)
+{
+       /* toggle SSEL to reset the device so it'll take a new command */
+       *pSPI_FLG = 0xFF00 | SSEL_MASK;
+       SSYNC();
+
+       *pSPI_FLG = ((0xFF & ~SSEL_MASK) << 8) | SSEL_MASK;
+       SSYNC();
+}
+
+static void SPI_OFF(void)
+{
+       /* put SPI settings back to reset state */
+       *pSPI_FLG = 0xFF00;
+       SSYNC();
+}
+
+static uint8_t spi_write_read_byte(uint8_t transmit)
+{
+       *pSPI_TDBR = transmit;
+       SSYNC();
+
+       while ((*pSPI_STAT & TXS))
+               if (ctrlc())
+                       break;
+       while (!(*pSPI_STAT & SPIF))
+               if (ctrlc())
+                       break;
+       while (!(*pSPI_STAT & RXS))
+               if (ctrlc())
+                       break;
+
+       /* Read dummy to empty the receive register */
+       return *pSPI_RDBR;
+}
+
+static uint8_t read_status_register(void)
+{
+       uint8_t status_register;
+
+       /* send instruction to read status register */
+       SPI_ON();
+       spi_write_read_byte(flash.ops->status);
+       /* send dummy to receive the status register */
+       status_register = spi_write_read_byte(0);
+       SPI_OFF();
+
+       return status_register;
+}
+
+static int wait_for_ready_status(void)
+{
+       ulong start = get_timer(0);
+
+       while (get_timer(0) - start < TIMEOUT) {
+               switch (flash.manufacturer_id) {
+               case JED_MANU_SPANSION:
+               case JED_MANU_ST:
+               case JED_MANU_WINBOND:
+                       if (!(read_status_register() & 0x01))
+                               return 0;
+                       break;
+
+               case JED_MANU_ATMEL:
+                       if (read_status_register() & 0x80)
+                               return 0;
+                       break;
+               }
+
+               if (ctrlc()) {
+                       puts("\nAbort\n");
+                       return -1;
+               }
+       }
+
+       puts("Timeout\n");
+       return -1;
+}
+
+/* Request and read the manufacturer and device id of parts which
+ * are compatible with the JEDEC standard (JEP106) and use that to
+ * setup other operating conditions.
+ */
+static int spi_detect_part(void)
+{
+       uint16_t dev_id;
+       size_t i;
+
+       static char called_init;
+       if (called_init)
+               return 0;
+
+       SPI_ON();
+
+       /* Send the request for the part identification */
+       spi_write_read_byte(0x9F);
+
+       /* Now read in the manufacturer id bytes */
+       do {
+               flash.manufacturer_id = spi_write_read_byte(0);
+               if (flash.manufacturer_id == 0x7F)
+                       puts("Warning: unhandled manufacturer continuation byte!\n");
+       } while (flash.manufacturer_id == 0x7F);
+
+       /* Now read in the first device id byte */
+       flash.device_id1 = spi_write_read_byte(0);
+
+       /* Now read in the second device id byte */
+       flash.device_id2 = spi_write_read_byte(0);
+
+       SPI_OFF();
+
+       dev_id = (flash.device_id1 << 8) | flash.device_id2;
+
+       for (i = 0; i < ARRAY_SIZE(flash_manufacturers); ++i) {
+               if (flash.manufacturer_id == flash_manufacturers[i].id)
+                       break;
+       }
+       if (i == ARRAY_SIZE(flash_manufacturers))
+               goto unknown;
+
+       flash.manufacturer = &flash_manufacturers[i];
+       flash.ops = flash_manufacturers[i].ops;
+
+       switch (flash.manufacturer_id) {
+       case JED_MANU_SPANSION:
+       case JED_MANU_ST:
+       case JED_MANU_WINBOND:
+               for (i = 0; flash.manufacturer->flashes[i].name; ++i) {
+                       if (dev_id == flash.manufacturer->flashes[i].id)
+                               break;
+               }
+               if (!flash.manufacturer->flashes[i].name)
+                       goto unknown;
+
+               flash.flash = &flash.manufacturer->flashes[i];
+               flash.sector_size = flash.flash->sector_size;
+               flash.num_sectors = flash.flash->num_sectors;
+               flash.write_length = 256;
+               break;
+
+       case JED_MANU_ATMEL: {
+               uint8_t status = read_status_register();
+
+               for (i = 0; flash.manufacturer->flashes[i].name; ++i) {
+                       if ((status & 0x3c) == flash.manufacturer->flashes[i].id)
+                               break;
+               }
+               if (!flash.manufacturer->flashes[i].name)
+                       goto unknown;
+
+               flash.flash = &flash.manufacturer->flashes[i];
+               flash.sector_size = flash.flash->sector_size;
+               flash.num_sectors = flash.flash->num_sectors;
+
+               /* see if flash is in "power of 2" mode */
+               if (status & 0x1)
+                       flash.sector_size &= ~(1 << (ffs(flash.sector_size) - 1));
+
+               flash.write_length = flash.sector_size;
+               break;
+       }
+       }
+
+       called_init = 1;
+       return 0;
+
+ unknown:
+       printf("Unknown SPI device: 0x%02X 0x%02X 0x%02X\n",
+               flash.manufacturer_id, flash.device_id1, flash.device_id2);
+       return 1;
+}
+
+/*
+ * Function:    spi_init_f
+ * Description: Init SPI-Controller (ROM part)
+ * return:      ---
+ */
+void spi_init_f(void)
+{
+}
+
+/*
+ * Function:    spi_init_r
+ * Description: Init SPI-Controller (RAM part) -
+ *              The malloc engine is ready and we can move our buffers to
+ *              normal RAM
+ *  return:      ---
+ */
+void spi_init_r(void)
+{
+#if defined(CONFIG_POST) && (CONFIG_POST & CFG_POST_SPI)
+       /* Our testing strategy here is pretty basic:
+        *  - fill src memory with an 8-bit pattern
+        *  - write the src memory to the SPI flash
+        *  - read the SPI flash into the dst memory
+        *  - compare src and dst memory regions
+        *  - repeat a few times
+        * The variations we test for:
+        *  - change the 8-bit pattern a bit
+        *  - change the read/write block size so we know:
+        *    - writes smaller/equal/larger than the buffer work
+        *    - writes smaller/equal/larger than the sector work
+        *  - change the SPI offsets so we know:
+        *    - writing partial sectors works
+        */
+       uint8_t *mem_src, *mem_dst;
+       size_t i, c, l, o;
+       size_t test_count, errors;
+       uint8_t pattern;
+
+       SPI_INIT();
+
+       if (spi_detect_part())
+               goto out;
+       eeprom_info();
+
+       ulong lengths[] = {
+               flash.write_length,
+               flash.write_length * 2,
+               flash.write_length / 2,
+               flash.sector_size,
+               flash.sector_size * 2,
+               flash.sector_size / 2
+       };
+       ulong offsets[] = {
+               0,
+               flash.write_length,
+               flash.write_length * 2,
+               flash.write_length / 2,
+               flash.write_length / 4,
+               flash.sector_size,
+               flash.sector_size * 2,
+               flash.sector_size / 2,
+               flash.sector_size / 4,
+       };
+
+       /* the exact addresses are arbitrary ... they just need to not overlap */
+       mem_src = (void *)(0);
+       mem_dst = (void *)(max(flash.write_length, flash.sector_size) * 2);
+
+       test_count = 0;
+       errors = 0;
+       pattern = 0x00;
+
+       for (i = 0; i < 16; ++i) {      /* 16 = 8 bits * 2 iterations */
+               for (l = 0; l < ARRAY_SIZE(lengths); ++l) {
+                       for (o = 0; o < ARRAY_SIZE(offsets); ++o) {
+                               ulong len = lengths[l];
+                               ulong off = offsets[o];
+
+                               printf("Testing pattern 0x%02X of length %5lu and offset %5lu: ", pattern, len, off);
+
+                               /* setup the source memory region */
+                               memset(mem_src, pattern, len);
+
+                               test_count += 4;
+                               for (c = 0; c < 4; ++c) {       /* 4 is just a random repeat count */
+                                       if (ctrlc()) {
+                                               puts("\nAbort\n");
+                                               goto out;
+                                       }
+
+                                       /* make sure background fill pattern != pattern */
+                                       memset(mem_dst, pattern ^ 0xFF, len);
+
+                                       /* write out the source memory and then read it back and compare */
+                                       eeprom_write(0, off, mem_src, len);
+                                       eeprom_read(0, off, mem_dst, len);
+
+                                       if (memcmp(mem_src, mem_dst, len)) {
+                                               for (c = 0; c < len; ++c)
+                                                       if (mem_src[c] != mem_dst[c])
+                                                               break;
+                                               printf(" FAIL @ offset %u, skipping repeats ", c);
+                                               ++errors;
+                                               break;
+                                       }
+
+                                       /* XXX: should shrink write region here to test with
+                                        * leading/trailing canaries so we know surrounding
+                                        * bytes don't get screwed.
+                                        */
+                               }
+                               puts("\n");
+                       }
+               }
+
+               /* invert the pattern every other run and shift out bits slowly */
+               pattern ^= 0xFF;
+               if (i % 2)
+                       pattern = (pattern | 0x01) << 1;
+       }
+
+       if (errors)
+               printf("SPI FAIL: Out of %i tests, there were %i errors ;(\n", test_count, errors);
+       else
+               printf("SPI PASS: %i tests worked!\n", test_count);
+
+ out:
+       SPI_DEINIT();
+
+#endif
+}
+
+static void transmit_address(uint32_t addr)
+{
+       /* Send the highest byte of the 24 bit address at first */
+       spi_write_read_byte(addr >> 16);
+       /* Send the middle byte of the 24 bit address  at second */
+       spi_write_read_byte(addr >> 8);
+       /* Send the lowest byte of the 24 bit address finally */
+       spi_write_read_byte(addr);
+}
+
+/*
+ * Read a value from flash for verify purpose
+ * Inputs:     unsigned long ulStart - holds the SPI start address
+ *                     int pnData - pointer to store value read from flash
+ *                     long lCount - number of elements to read
+ */
+static int read_flash(unsigned long address, long count, uchar *buffer)
+{
+       size_t i;
+
+       /* Send the read command to SPI device */
+       SPI_ON();
+       spi_write_read_byte(flash.ops->read);
+       transmit_address(address);
+
+#ifndef CONFIG_SPI_FLASH_SLOW_READ
+       /* Send dummy byte when doing SPI fast reads */
+       spi_write_read_byte(0);
+#endif
+
+       /* After the SPI device address has been placed on the MOSI pin the data can be */
+       /* received on the MISO pin. */
+       for (i = 1; i <= count; ++i) {
+               *buffer++ = spi_write_read_byte(0);
+               if (i % flash.sector_size == 0)
+                       puts(".");
+       }
+
+       SPI_OFF();
+
+       return 0;
+}
+
+static int enable_writing(void)
+{
+       ulong start;
+
+       if (flash.manufacturer_id == JED_MANU_ATMEL)
+               return 0;
+
+       /* A write enable instruction must previously have been executed */
+       SPI_ON();
+       spi_write_read_byte(0x06);
+       SPI_OFF();
+
+       /* The status register will be polled to check the write enable latch "WREN" */
+       start = get_timer(0);
+       while (get_timer(0) - start < TIMEOUT) {
+               if (read_status_register() & 0x02)
+                       return 0;
+
+               if (ctrlc()) {
+                       puts("\nAbort\n");
+                       return -1;
+               }
+       }
+
+       puts("Timeout\n");
+       return -1;
+}
+
+static long address_to_sector(unsigned long address)
+{
+       if (address > (flash.num_sectors * flash.sector_size) - 1)
+               return -1;
+       return address / flash.sector_size;
+}
+
+static int erase_sector(int address)
+{
+       /* sector gets checked in higher function, so assume it's valid
+        * here and figure out the offset of the sector in flash
+        */
+       if (enable_writing())
+               return -1;
+
+       /*
+        * Send the erase block command to the flash followed by the 24 address
+        * to point to the start of a sector
+        */
+       SPI_ON();
+       spi_write_read_byte(flash.ops->erase);
+       transmit_address(address);
+       SPI_OFF();
+
+       return wait_for_ready_status();
+}
+
+/* Write [count] bytes out of [buffer] into the given SPI [address] */
+static long write_flash(unsigned long address, long count, uchar *buffer)
+{
+       long i, write_buffer_size;
+
+       if (enable_writing())
+               return -1;
+
+       /* Send write command followed by the 24 bit address */
+       SPI_ON();
+       spi_write_read_byte(flash.ops->write);
+       transmit_address(address);
+
+       /* Shoot out a single write buffer */
+       write_buffer_size = min(count, flash.write_length);
+       for (i = 0; i < write_buffer_size; ++i)
+               spi_write_read_byte(buffer[i]);
+
+       SPI_OFF();
+
+       /* Wait for the flash to do its thing */
+       if (wait_for_ready_status()) {
+               puts("SPI Program Time out! ");
+               return -1;
+       }
+
+       return i;
+}
+
+/* Write [count] bytes out of [buffer] into the given SPI [address] */
+static int write_sector(unsigned long address, long count, uchar *buffer)
+{
+       long write_cnt;
+
+       while (count != 0) {
+               write_cnt = write_flash(address, count, buffer);
+               if (write_cnt == -1)
+                       return -1;
+
+               /* Now that we've sent some bytes out to the flash, update
+                * our counters a bit
+                */
+               count -= write_cnt;
+               address += write_cnt;
+               buffer += write_cnt;
+       }
+
+       /* return the appropriate error code */
+       return 0;
+}
+
+/*
+ * Function:    spi_write
+ */
+ssize_t spi_write(uchar *addr, int alen, uchar *buffer, int len)
+{
+       unsigned long offset;
+       int start_sector, end_sector;
+       int start_byte, end_byte;
+       uchar *temp = NULL;
+       int num, ret = 0;
+
+       SPI_INIT();
+
+       if (spi_detect_part())
+               goto out;
+
+       offset = addr[0] << 16 | addr[1] << 8 | addr[2];
+
+       /* Get the start block number */
+       start_sector = address_to_sector(offset);
+       if (start_sector == -1) {
+               puts("Invalid sector! ");
+               goto out;
+       }
+       end_sector = address_to_sector(offset + len - 1);
+       if (end_sector == -1) {
+               puts("Invalid sector! ");
+               goto out;
+       }
+
+       /* Since flashes operate in sector units but the eeprom command
+        * operates as a continuous stream of bytes, we need to emulate
+        * the eeprom behavior.  So here we read in the sector, overlay
+        * any bytes we're actually modifying, erase the sector, and
+        * then write back out the new sector.
+        */
+       temp = malloc(flash.sector_size);
+       if (!temp) {
+               puts("Malloc for sector failed! ");
+               goto out;
+       }
+
+       for (num = start_sector; num <= end_sector; num++) {
+               unsigned long address = num * flash.sector_size;
+
+               /* XXX: should add an optimization when spanning sectors:
+                * No point in reading in a sector if we're going to be
+                * clobbering the whole thing.  Need to also add a test
+                * case to make sure the optimization is correct.
+                */
+               if (read_flash(address, flash.sector_size, temp)) {
+                       puts("Read sector failed! ");
+                       len = 0;
+                       break;
+               }
+
+               start_byte = max(address, offset);
+               end_byte = address + flash.sector_size - 1;
+               if (end_byte > (offset + len))
+                       end_byte = (offset + len - 1);
+
+               memcpy(temp + start_byte - address,
+                       buffer + start_byte - offset,
+                       end_byte - start_byte + 1);
+
+               if (erase_sector(address)) {
+                       puts("Erase sector failed! ");
+                       goto out;
+               }
+
+               if (write_sector(address, flash.sector_size, temp)) {
+                       puts("Write sector failed! ");
+                       goto out;
+               }
+
+               puts(".");
+       }
+
+       ret = len;
+
+ out:
+       free(temp);
+
+       SPI_DEINIT();
+
+       return ret;
+}
+
+/*
+ * Function: spi_read
+ */
+ssize_t spi_read(uchar *addr, int alen, uchar *buffer, int len)
+{
+       unsigned long offset;
+
+       SPI_INIT();
+
+       if (spi_detect_part())
+               len = 0;
+       else {
+               offset = addr[0] << 16 | addr[1] << 8 | addr[2];
+               read_flash(offset, len, buffer);
+       }
+
+       SPI_DEINIT();
+
+       return len;
+}
+
+/*
+ *     Spit out some useful information about the SPI eeprom
+ */
+int eeprom_info(void)
+{
+       int ret = 0;
+
+       SPI_INIT();
+
+       if (spi_detect_part())
+               ret = 1;
+       else
+               printf("SPI Device: %s 0x%02X (%s) 0x%02X 0x%02X\n"
+                       "Parameters: num sectors = %i, sector size = %i, write size = %i\n"
+                       "Flash Size: %i mbit (%i mbyte)\n"
+                       "Status: 0x%02X\n",
+                       flash.flash->name, flash.manufacturer_id, flash.manufacturer->name,
+                       flash.device_id1, flash.device_id2, flash.num_sectors,
+                       flash.sector_size, flash.write_length,
+                       (flash.num_sectors * flash.sector_size) >> 17,
+                       (flash.num_sectors * flash.sector_size) >> 20,
+                       read_status_register());
+
+       SPI_DEINIT();
+
+       return ret;
+}
+
+#endif
diff --git a/board/bf537-stamp/stm_m25p64.c b/board/bf537-stamp/stm_m25p64.c
deleted file mode 100644 (file)
index c48c3c7..0000000
+++ /dev/null
@@ -1,516 +0,0 @@
-/****************************************************************************
- *  SPI flash driver for M25P64
- ****************************************************************************/
-#include <common.h>
-#include <linux/ctype.h>
-#include <asm/io.h>
-#include <asm/mach-common/bits/spi.h>
-
-#if defined(CONFIG_SPI)
-
-/* Application definitions */
-
-#define        NUM_SECTORS     128     /* number of sectors */
-#define SECTOR_SIZE    0x10000
-#define NOP_NUM                1000
-
-#define COMMON_SPI_SETTINGS (SPE|MSTR|CPHA|CPOL) /* Settings to the SPI_CTL */
-#define TIMOD01 (0x01) /* stes the SPI to work with core instructions */
-
-/* Flash commands */
-#define        SPI_WREN        (0x06)  /*Set Write Enable Latch */
-#define        SPI_WRDI        (0x04)  /*Reset Write Enable Latch */
-#define        SPI_RDSR        (0x05)  /*Read Status Register */
-#define        SPI_WRSR        (0x01)  /*Write Status Register */
-#define        SPI_READ        (0x03)  /*Read data from memory */
-#define        SPI_FAST_READ   (0x0B)  /*Read data from memory */
-#define        SPI_PP          (0x02)  /*Program Data into memory */
-#define        SPI_SE          (0xD8)  /*Erase one sector in memory */
-#define        SPI_BE          (0xC7)  /*Erase all memory */
-#define        WIP             (0x1)   /*Check the write in progress bit of the SPI status register */
-#define        WEL             (0x2)   /*Check the write enable bit of the SPI status register */
-
-#define        TIMEOUT         350000000
-
-typedef enum {
-       NO_ERR,
-       POLL_TIMEOUT,
-       INVALID_SECTOR,
-       INVALID_BLOCK,
-} ERROR_CODE;
-
-void spi_init_f(void);
-void spi_init_r(void);
-ssize_t spi_read(uchar *, int, uchar *, int);
-ssize_t spi_write(uchar *, int, uchar *, int);
-
-char ReadStatusRegister(void);
-void Wait_For_SPIF(void);
-void SetupSPI(const int spi_setting);
-void SPI_OFF(void);
-void SendSingleCommand(const int iCommand);
-
-ERROR_CODE GetSectorNumber(unsigned long ulOffset, int *pnSector);
-ERROR_CODE EraseBlock(int nBlock);
-ERROR_CODE ReadData(unsigned long ulStart, long lCount, int *pnData);
-ERROR_CODE WriteData(unsigned long ulStart, long lCount, int *pnData);
-ERROR_CODE Wait_For_Status(char Statusbit);
-ERROR_CODE Wait_For_WEL(void);
-
-/*
- * Function:    spi_init_f
- * Description: Init SPI-Controller (ROM part)
- * return:      ---
- */
-void spi_init_f(void)
-{
-}
-
-/*
- * Function:    spi_init_r
- * Description: Init SPI-Controller (RAM part) -
- *              The malloc engine is ready and we can move our buffers to
- *              normal RAM
- *  return:      ---
- */
-void spi_init_r(void)
-{
-       return;
-}
-
-/*
- * Function:    spi_write
- */
-ssize_t spi_write(uchar * addr, int alen, uchar * buffer, int len)
-{
-       unsigned long offset;
-       int start_block, end_block;
-       int start_byte, end_byte;
-       ERROR_CODE result = NO_ERR;
-       uchar temp[SECTOR_SIZE];
-       int i, num;
-
-       offset = addr[0] << 16 | addr[1] << 8 | addr[2];
-       /* Get the start block number */
-       result = GetSectorNumber(offset, &start_block);
-       if (result == INVALID_SECTOR) {
-               printf("Invalid sector! ");
-               return 0;
-       }
-       /* Get the end block number */
-       result = GetSectorNumber(offset + len - 1, &end_block);
-       if (result == INVALID_SECTOR) {
-               printf("Invalid sector! ");
-               return 0;
-       }
-
-       for (num = start_block; num <= end_block; num++) {
-               ReadData(num * SECTOR_SIZE, SECTOR_SIZE, (int *)temp);
-               start_byte = num * SECTOR_SIZE;
-               end_byte = (num + 1) * SECTOR_SIZE - 1;
-               if (start_byte < offset)
-                       start_byte = offset;
-               if (end_byte > (offset + len))
-                       end_byte = (offset + len - 1);
-               for (i = start_byte; i <= end_byte; i++)
-                       temp[i - num * SECTOR_SIZE] = buffer[i - offset];
-               EraseBlock(num);
-               result = WriteData(num * SECTOR_SIZE, SECTOR_SIZE, (int *)temp);
-               if (result != NO_ERR)
-                       return 0;
-               printf(".");
-       }
-       return len;
-}
-
-/*
- * Function: spi_read
- */
-ssize_t spi_read(uchar * addr, int alen, uchar * buffer, int len)
-{
-       unsigned long offset;
-       offset = addr[0] << 16 | addr[1] << 8 | addr[2];
-       ReadData(offset, len, (int *)buffer);
-       return len;
-}
-
-void SendSingleCommand(const int iCommand)
-{
-       unsigned short dummy;
-
-       /* turns on the SPI in single write mode */
-       SetupSPI((COMMON_SPI_SETTINGS | TIMOD01));
-
-       /* sends the actual command to the SPI TX register */
-       *pSPI_TDBR = iCommand;
-       SSYNC();
-
-       /* The SPI status register will be polled to check the SPIF bit */
-       Wait_For_SPIF();
-
-       dummy = *pSPI_RDBR;
-
-       /* The SPI will be turned off */
-       SPI_OFF();
-
-}
-
-void SetupSPI(const int spi_setting)
-{
-
-       if (icache_status() || dcache_status())
-               udelay(CONFIG_CCLK_HZ / 50000000);
-       /*sets up the PF10 to be the slave select of the SPI */
-       *pPORTF_FER |= (PF10 | PF11 | PF12 | PF13);
-       *pSPI_FLG = 0xFF02;
-       *pSPI_BAUD = CONFIG_SPI_BAUD;
-       *pSPI_CTL = spi_setting;
-       SSYNC();
-
-       *pSPI_FLG = 0xFD02;
-       SSYNC();
-}
-
-void SPI_OFF(void)
-{
-
-       *pSPI_CTL = 0x0400;     /* disable SPI */
-       *pSPI_FLG = 0;
-       *pSPI_BAUD = 0;
-       SSYNC();
-       udelay(CONFIG_CCLK_HZ / 50000000);
-
-}
-
-void Wait_For_SPIF(void)
-{
-       unsigned short dummyread;
-       while ((*pSPI_STAT & TXS)) ;
-       while (!(*pSPI_STAT & SPIF)) ;
-       while (!(*pSPI_STAT & RXS)) ;
-       /* Read dummy to empty the receive register */
-       dummyread = *pSPI_RDBR;
-}
-
-ERROR_CODE Wait_For_WEL(void)
-{
-       int i;
-       char status_register = 0;
-       ERROR_CODE ErrorCode = NO_ERR;
-
-       for (i = 0; i < TIMEOUT; i++) {
-               status_register = ReadStatusRegister();
-               if ((status_register & WEL)) {
-                       ErrorCode = NO_ERR;
-                       break;
-               }
-               ErrorCode = POLL_TIMEOUT;       /* Time out error */
-       };
-
-       return ErrorCode;
-}
-
-ERROR_CODE Wait_For_Status(char Statusbit)
-{
-       int i;
-       char status_register = 0xFF;
-       ERROR_CODE ErrorCode = NO_ERR;
-
-       for (i = 0; i < TIMEOUT; i++) {
-               status_register = ReadStatusRegister();
-               if (!(status_register & Statusbit)) {
-                       ErrorCode = NO_ERR;
-                       break;
-               }
-               ErrorCode = POLL_TIMEOUT;       /* Time out error */
-       };
-
-       return ErrorCode;
-}
-
-char ReadStatusRegister(void)
-{
-       char status_register = 0;
-
-       SetupSPI((COMMON_SPI_SETTINGS | TIMOD01));      /* Turn on the SPI */
-
-       *pSPI_TDBR = SPI_RDSR;  /* send instruction to read status register */
-       SSYNC();
-       Wait_For_SPIF();        /*wait until the instruction has been sent */
-       *pSPI_TDBR = 0;         /*send dummy to receive the status register */
-       SSYNC();
-       Wait_For_SPIF();        /*wait until the data has been sent */
-       status_register = *pSPI_RDBR;   /*read the status register */
-
-       SPI_OFF();              /* Turn off the SPI */
-
-       return status_register;
-}
-
-ERROR_CODE GetSectorNumber(unsigned long ulOffset, int *pnSector)
-{
-       int nSector = 0;
-       ERROR_CODE ErrorCode = NO_ERR;
-
-       if (ulOffset > (NUM_SECTORS * 0x10000 - 1)) {
-               ErrorCode = INVALID_SECTOR;
-               return ErrorCode;
-       }
-
-       nSector = (int)ulOffset / 0x10000;
-       *pnSector = nSector;
-
-       return ErrorCode;
-}
-
-ERROR_CODE EraseBlock(int nBlock)
-{
-       unsigned long ulSectorOff = 0x0, ShiftValue;
-       ERROR_CODE ErrorCode = NO_ERR;
-
-       /* if the block is invalid just return */
-       if ((nBlock < 0) || (nBlock > NUM_SECTORS)) {
-               ErrorCode = INVALID_BLOCK;
-               return ErrorCode;
-       }
-       /* figure out the offset of the block in flash */
-       if ((nBlock >= 0) && (nBlock < NUM_SECTORS)) {
-               ulSectorOff = (nBlock * SECTOR_SIZE);
-
-       } else {
-               ErrorCode = INVALID_BLOCK;
-               return ErrorCode;
-       }
-
-       /* A write enable instruction must previously have been executed */
-       SendSingleCommand(SPI_WREN);
-
-       /* The status register will be polled to check the write enable latch "WREN" */
-       ErrorCode = Wait_For_WEL();
-
-       if (POLL_TIMEOUT == ErrorCode) {
-               printf("SPI Erase block error\n");
-               return ErrorCode;
-       } else
-
-       /* Turn on the SPI to send single commands */
-       SetupSPI((COMMON_SPI_SETTINGS | TIMOD01));
-
-       /*
-        * Send the erase block command to the flash followed by the 24 address
-        * to point to the start of a sector
-        */
-       *pSPI_TDBR = SPI_SE;
-       SSYNC();
-       Wait_For_SPIF();
-       /* Send the highest byte of the 24 bit address at first */
-       ShiftValue = (ulSectorOff >> 16);
-       *pSPI_TDBR = ShiftValue;
-       SSYNC();
-       /* Wait until the instruction has been sent */
-       Wait_For_SPIF();
-       /* Send the middle byte of the 24 bit address  at second */
-       ShiftValue = (ulSectorOff >> 8);
-       *pSPI_TDBR = ShiftValue;
-       SSYNC();
-       /* Wait until the instruction has been sent */
-       Wait_For_SPIF();
-       /* Send the lowest byte of the 24 bit address finally */
-       *pSPI_TDBR = ulSectorOff;
-       SSYNC();
-       /* Wait until the instruction has been sent */
-       Wait_For_SPIF();
-
-       /* Turns off the SPI */
-       SPI_OFF();
-
-       /* Poll the status register to check the Write in Progress bit */
-       /* Sector erase takes time */
-       ErrorCode = Wait_For_Status(WIP);
-
-       /* block erase should be complete */
-       return ErrorCode;
-}
-
-/*
- * ERROR_CODE ReadData()
- * Read a value from flash for verify purpose
- * Inputs:     unsigned long ulStart - holds the SPI start address
- *                     int pnData - pointer to store value read from flash
- *                     long lCount - number of elements to read
- */
-ERROR_CODE ReadData(unsigned long ulStart, long lCount, int *pnData)
-{
-       unsigned long ShiftValue;
-       char *cnData;
-       int i;
-
-       /* Pointer cast to be able to increment byte wise */
-
-       cnData = (char *)pnData;
-       /* Start SPI interface */
-       SetupSPI((COMMON_SPI_SETTINGS | TIMOD01));
-
-#ifdef CONFIG_SPI_FLASH_FAST_READ
-       /* Send the read command to SPI device */
-       *pSPI_TDBR = SPI_FAST_READ;
-#else
-       /* Send the read command to SPI device */
-       *pSPI_TDBR = SPI_READ;
-#endif
-       SSYNC();
-       /* Wait until the instruction has been sent */
-       Wait_For_SPIF();
-       /* Send the highest byte of the 24 bit address at first */
-       ShiftValue = (ulStart >> 16);
-       /* Send the byte to the SPI device */
-       *pSPI_TDBR = ShiftValue;
-       SSYNC();
-       /* Wait until the instruction has been sent */
-       Wait_For_SPIF();
-       /* Send the middle byte of the 24 bit address  at second */
-       ShiftValue = (ulStart >> 8);
-       /* Send the byte to the SPI device */
-       *pSPI_TDBR = ShiftValue;
-       SSYNC();
-       /* Wait until the instruction has been sent */
-       Wait_For_SPIF();
-       /* Send the lowest byte of the 24 bit address finally */
-       *pSPI_TDBR = ulStart;
-       SSYNC();
-       /* Wait until the instruction has been sent */
-       Wait_For_SPIF();
-
-#ifdef CONFIG_SPI_FLASH_FAST_READ
-       /* Send dummy for FAST_READ */
-       *pSPI_TDBR = 0;
-       SSYNC();
-       /* Wait until the instruction has been sent */
-       Wait_For_SPIF();
-#endif
-
-       /* After the SPI device address has been placed on the MOSI pin the data can be */
-       /* received on the MISO pin. */
-       for (i = 0; i < lCount; i++) {
-               *pSPI_TDBR = 0;
-               SSYNC();
-               while (!(*pSPI_STAT & RXS)) ;
-               *cnData++ = *pSPI_RDBR;
-
-               if ((i >= SECTOR_SIZE) && (i % SECTOR_SIZE == 0))
-                       printf(".");
-       }
-
-       /* Turn off the SPI */
-       SPI_OFF();
-
-       return NO_ERR;
-}
-
-ERROR_CODE WriteFlash(unsigned long ulStartAddr, long lTransferCount,
-                     int *iDataSource, long *lWriteCount)
-{
-
-       unsigned long ulWAddr;
-       long lWTransferCount = 0;
-       int i;
-       char iData;
-       char *temp = (char *)iDataSource;
-       ERROR_CODE ErrorCode = NO_ERR;
-
-       /* First, a Write Enable Command must be sent to the SPI. */
-       SendSingleCommand(SPI_WREN);
-
-       /*
-        * Second, the SPI Status Register will be tested whether the
-        * Write Enable Bit has been set
-        */
-       ErrorCode = Wait_For_WEL();
-       if (POLL_TIMEOUT == ErrorCode) {
-               printf("SPI Write Time Out\n");
-               return ErrorCode;
-       } else
-               /* Third, the 24 bit address will be shifted out
-                * the SPI MOSI bytewise.
-                * Turns the SPI on
-                */
-               SetupSPI((COMMON_SPI_SETTINGS | TIMOD01));
-       *pSPI_TDBR = SPI_PP;
-       SSYNC();
-       /*wait until the instruction has been sent */
-       Wait_For_SPIF();
-       ulWAddr = (ulStartAddr >> 16);
-       *pSPI_TDBR = ulWAddr;
-       SSYNC();
-       /*wait until the instruction has been sent */
-       Wait_For_SPIF();
-       ulWAddr = (ulStartAddr >> 8);
-       *pSPI_TDBR = ulWAddr;
-       SSYNC();
-       /*wait until the instruction has been sent */
-       Wait_For_SPIF();
-       ulWAddr = ulStartAddr;
-       *pSPI_TDBR = ulWAddr;
-       SSYNC();
-       /*wait until the instruction has been sent */
-       Wait_For_SPIF();
-       /*
-        * Fourth, maximum number of 256 bytes will be taken from the Buffer
-        * and sent to the SPI device.
-        */
-       for (i = 0; (i < lTransferCount) && (i < 256); i++, lWTransferCount++) {
-               iData = *temp;
-               *pSPI_TDBR = iData;
-               SSYNC();
-               /*wait until the instruction has been sent */
-               Wait_For_SPIF();
-               temp++;
-       }
-
-       /* Turns the SPI off */
-       SPI_OFF();
-
-       /*
-        * Sixth, the SPI Write in Progress Bit must be toggled to ensure the
-        * programming is done before start of next transfer
-        */
-       ErrorCode = Wait_For_Status(WIP);
-
-       if (POLL_TIMEOUT == ErrorCode) {
-               printf("SPI Program Time out!\n");
-               return ErrorCode;
-       } else
-
-               *lWriteCount = lWTransferCount;
-
-       return ErrorCode;
-}
-
-ERROR_CODE WriteData(unsigned long ulStart, long lCount, int *pnData)
-{
-
-       unsigned long ulWStart = ulStart;
-       long lWCount = lCount, lWriteCount;
-       long *pnWriteCount = &lWriteCount;
-
-       ERROR_CODE ErrorCode = NO_ERR;
-
-       while (lWCount != 0) {
-               ErrorCode = WriteFlash(ulWStart, lWCount, pnData, pnWriteCount);
-
-               /*
-                * After each function call of WriteFlash the counter
-                * must be adjusted
-                */
-               lWCount -= *pnWriteCount;
-
-               /* Also, both address pointers must be recalculated. */
-               ulWStart += *pnWriteCount;
-               pnData += *pnWriteCount / 4;
-       }
-
-       /* return the appropriate error code */
-       return ErrorCode;
-}
-
-#endif                         /* CONFIG_SPI */
index 8632097..01780c5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * U-boot - u-boot.lds.S
  *
- * Copyright (c) 2005-2007 Analog Device Inc.
+ * Copyright (c) 2005-2008 Analog Device Inc.
  *
  * (C) Copyright 2000-2004
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  */
 
 #include <config.h>
+#include <asm/blackfin.h>
+#undef ALIGN
+
+/* If we don't actually load anything into L1 data, this will avoid
+ * a syntax error.  If we do actually load something into L1 data,
+ * we'll get a linker memory load error (which is what we'd want).
+ * 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_B_SRAM
+# define L1_DATA_B_SRAM      CFG_MONITOR_BASE
+# define L1_DATA_B_SRAM_SIZE 0
+#endif
 
 OUTPUT_ARCH(bfin)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
+
+/* The 0xC offset is so we don't clobber the tiny LDR jump block. */
 MEMORY
- {
- ram :    ORIGIN = (CFG_MONITOR_BASE), LENGTH = (256 * 1024)
- l1_code : ORIGIN = 0xFFA00000, LENGTH = 0xC000
- l1_data : ORIGIN = 0xFF900000, LENGTH = 0x4000
- }
+{
+       ram     : ORIGIN = CFG_MONITOR_BASE, LENGTH = CFG_MONITOR_LEN
+       l1_code : ORIGIN = L1_INST_SRAM+0xC, LENGTH = L1_INST_SRAM_SIZE
+       l1_data : ORIGIN = L1_DATA_B_SRAM,   LENGTH = L1_DATA_B_SRAM_SIZE
+}
 
 SECTIONS
 {
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS; /*0x1000;*/
-  .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) }
-  . = CFG_MONITOR_BASE;
-  .text      :
-  {
-    /* WARNING - the following is hand-optimized to fit within */
-    /* the sector before the environment sector. If it throws  */
-    /* an error during compilation remove an object here to get        */
-    /* it linked after the configuration sector.               */
-
-    cpu/bf537/start.o          (.text)
-    cpu/bf537/start1.o         (.text)
-    cpu/bf537/traps.o          (.text)
-    cpu/bf537/interrupt.o      (.text)
-    cpu/bf537/serial.o         (.text)
-    common/dlmalloc.o          (.text)
-/*  lib_blackfin/bf533_string.o        (.text) */
-/*  lib_generic/vsprintf.o     (.text) */
-    lib_generic/crc32.o                (.text)
-/*  lib_generic/zlib.o         (.text) */
-/*  board/bf537-stamp/bf537-stamp.o            (.text) */
-
-    . = DEFINED(env_offset) ? env_offset : .;
-    common/environment.o       (.text)
-
-    *(EXCLUDE_FILE (board/bf537-stamp/post-memory.o) .text)
-    *(.fixup)
-    *(.got1)
-  }  > ram
-  _etext = .;
-  PROVIDE (etext = .);
-  .text_l1     :
-  {
-  . = ALIGN(4) ;
-  _text_l1 = .;
-  PROVIDE (text_l1 = .);
-  board/bf537-stamp/post-memory.o   (.text)
-  . = ALIGN(4) ;
-  _etext_l1 = .;
-  PROVIDE (etext_l1 = .);
-  } > l1_code AT > ram
-
-  .rodata :
-  {
-    . = ALIGN(4);
-    *(EXCLUDE_FILE (board/bf537-stamp/post-memory.o) .rodata)
-    *(EXCLUDE_FILE (board/bf537-stamp/post-memory.o) .rodata1)
-    *(EXCLUDE_FILE (board/bf537-stamp/post-memory.o) .rodata.str1.4)
-    *(.eh_frame)
-    . = ALIGN(4);
-  } > ram
-
-  . = ALIGN(4);
-  _erodata = .;
-  PROVIDE (erodata = .);
-  .rodata_l1 :
- {
-   . = ALIGN(4) ;
-   _rodata_l1 = .;
-   PROVIDE (rodata_l1 = .);
-   board/bf537-stamp/post-memory.o (.rodata)
-   board/bf537-stamp/post-memory.o (.rodata1)
-   board/bf537-stamp/post-memory.o (.rodata.str1.4)
-   . = ALIGN(4) ;
-   _erodata_l1 = .;
-   PROVIDE(erodata_l1 = .);
- } > l1_data AT > ram
-
-  .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
-  } > ram
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  ___u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) } > ram
-  ___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       :
-  {
-  __bss_start = .;
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  } > ram
-  _end = . ;
-  PROVIDE (end = .);
+       .text :
+       {
+#ifdef ENV_IS_EMBEDDED
+               /* WARNING - the following is hand-optimized to fit within
+                * the sector before the environment sector. If it throws
+                * an error during compilation remove an object here to get
+                * it linked after the configuration sector.
+                */
+
+               cpu/blackfin/start.o            (.text)
+               cpu/blackfin/traps.o            (.text)
+               cpu/blackfin/interrupt.o        (.text)
+               cpu/blackfin/serial.o           (.text)
+               common/dlmalloc.o               (.text)
+               lib_generic/crc32.o             (.text)
+
+               . = DEFINED(env_offset) ? env_offset : .;
+               common/environment.o    (.text)
+#endif
+
+               *(.text .text.*)
+       } >ram
+
+       .rodata :
+       {
+               . = ALIGN(4);
+               *(.rodata .rodata.*)
+               *(.rodata1)
+               *(.eh_frame)
+               . = ALIGN(4);
+       } >ram
+
+       .data :
+       {
+               . = ALIGN(256);
+               *(.data .data.*)
+               *(.data1)
+               *(.sdata)
+               *(.sdata2)
+               *(.dynamic)
+               CONSTRUCTORS
+       } >ram
+
+       .u_boot_cmd :
+       {
+               ___u_boot_cmd_start = .;
+               *(.u_boot_cmd)
+               ___u_boot_cmd_end = .;
+       } >ram
+
+       .text_l1 :
+       {
+               . = ALIGN(4);
+               __stext_l1 = .;
+               *(.l1.text)
+               . = ALIGN(4);
+               __etext_l1 = .;
+       } >l1_code AT>ram
+       __stext_l1_lma = LOADADDR(.text_l1);
+
+       .data_l1 :
+       {
+               . = ALIGN(4);
+               __sdata_l1 = .;
+               *(.l1.data)
+               *(.l1.bss)
+               . = ALIGN(4);
+               __edata_l1 = .;
+       } >l1_data AT>ram
+       __sdata_l1_lma = LOADADDR(.data_l1);
+
+       .bss :
+       {
+               . = ALIGN(4);
+               __bss_start = .;
+               *(.sbss) *(.scommon)
+               *(.dynbss)
+               *(.bss .bss.*)
+               *(COMMON)
+               __bss_end = .;
+       } >ram
 }
index a3c2e5b..73bef24 100644 (file)
@@ -39,7 +39,7 @@ $(LIB):       $(obj).depend $(OBJS) $(SOBJS) u-boot.lds
        $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
 
 u-boot.lds: u-boot.lds.S
-       $(CPP) $(CPPFLAGS) -P -Ubfin $^ > $@.tmp
+       $(CPP) $(CPPFLAGS) -D__ASSEMBLY__ -P -Ubfin $^ > $@.tmp
        mv -f $@.tmp $@
 
 clean:
index a623c3d..de80ffe 100644 (file)
@@ -20,6 +20,6 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 # MA 02111-1307 USA
 #
-# TEXT_BASE should be defined as the MAX_SDRAM Address - 256k bytes
-#  256k is defined as CFG_MONITOR_LEN in ./include/configs/<board>.h
-TEXT_BASE = 0x03FC0000
+
+# This is not actually used for Blackfin boards so do not change it
+#TEXT_BASE = do-not-use-me
index 84df5fc..ddafdcb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * U-boot - u-boot.lds.S
  *
- * Copyright (c) 2005-2007 Analog Device Inc.
+ * Copyright (c) 2005-2008 Analog Device Inc.
  *
  * (C) Copyright 2000-2004
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  */
 
 #include <config.h>
+#include <asm/blackfin.h>
+#undef ALIGN
+
+/* If we don't actually load anything into L1 data, this will avoid
+ * a syntax error.  If we do actually load something into L1 data,
+ * we'll get a linker memory load error (which is what we'd want).
+ * 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_B_SRAM
+# define L1_DATA_B_SRAM      CFG_MONITOR_BASE
+# define L1_DATA_B_SRAM_SIZE 0
+#endif
 
 OUTPUT_ARCH(bfin)
-OUTPUT_ARCH(bfin)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
+
+/* The 0xC offset is so we don't clobber the tiny LDR jump block. */
+MEMORY
 {
-  /* 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) }
-  . = CFG_MONITOR_BASE;
-  .text      :
-  {
-    /* WARNING - the following is hand-optimized to fit within */
-    /* the sector before the environment sector. If it throws  */
-    /* an error during compilation remove an object here to get        */
-    /* it linked after the configuration sector.               */
+       ram     : ORIGIN = CFG_MONITOR_BASE, LENGTH = CFG_MONITOR_LEN
+       l1_code : ORIGIN = L1_INST_SRAM+0xC, LENGTH = L1_INST_SRAM_SIZE
+       l1_data : ORIGIN = L1_DATA_B_SRAM,   LENGTH = L1_DATA_B_SRAM_SIZE
+}
 
-    cpu/bf561/start.o          (.text)
-    cpu/bf561/start1.o         (.text)
-    cpu/bf561/traps.o          (.text)
-    cpu/bf561/interrupt.o      (.text)
-    cpu/bf561/serial.o         (.text)
-    common/dlmalloc.o          (.text)
-/*  lib_blackfin/bf533_string.o        (.text) */
-/*  lib_generic/vsprintf.o     (.text) */
-    lib_generic/crc32.o                (.text)
-    lib_generic/zlib.o         (.text)
-    board/bf561-ezkit/bf561-ezkit.o            (.text)
+SECTIONS
+{
+       .text :
+       {
+#ifdef ENV_IS_EMBEDDED
+               /* WARNING - the following is hand-optimized to fit within
+                * the sector before the environment sector. If it throws
+                * an error during compilation remove an object here to get
+                * it linked after the configuration sector.
+                */
 
-    . = DEFINED(env_offset) ? env_offset : .;
-    common/environment.o       (.text)
+               cpu/blackfin/start.o            (.text)
+               cpu/blackfin/traps.o            (.text)
+               cpu/blackfin/interrupt.o        (.text)
+               cpu/blackfin/serial.o           (.text)
+               common/dlmalloc.o               (.text)
+               lib_generic/crc32.o             (.text)
+               lib_generic/zlib.o              (.text)
+               board/bf561-ezkit/bf561-ezkit.o         (.text)
 
-    *(.text)
-    *(.fixup)
-    *(.got1)
-  }
-  _etext = .;
-  PROVIDE (etext = .);
-  .rodata    :
-  {
-    *(.rodata)
-    *(.rodata1)
-    *(.rodata.str1.4)
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
+               . = DEFINED(env_offset) ? env_offset : .;
+               common/environment.o    (.text)
+#endif
 
-  /* 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;
+               *(.text .text.*)
+       } >ram
 
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
+       .rodata :
+       {
+               . = ALIGN(4);
+               *(.rodata .rodata.*)
+               *(.rodata1)
+               *(.eh_frame)
+               . = ALIGN(4);
+       } >ram
 
-  ___u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  ___u_boot_cmd_end = .;
+       .data :
+       {
+               . = ALIGN(256);
+               *(.data .data.*)
+               *(.data1)
+               *(.sdata)
+               *(.sdata2)
+               *(.dynamic)
+               CONSTRUCTORS
+       } >ram
 
+       .u_boot_cmd :
+       {
+               ___u_boot_cmd_start = .;
+               *(.u_boot_cmd)
+               ___u_boot_cmd_end = .;
+       } >ram
 
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
+       .text_l1 :
+       {
+               . = ALIGN(4);
+               __stext_l1 = .;
+               *(.l1.text)
+               . = ALIGN(4);
+               __etext_l1 = .;
+       } >l1_code AT>ram
+       __stext_l1_lma = LOADADDR(.text_l1);
 
-  . = ALIGN(256);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(256);
-  __init_end = .;
+       .data_l1 :
+       {
+               . = ALIGN(4);
+               __sdata_l1 = .;
+               *(.l1.data)
+               *(.l1.bss)
+               . = ALIGN(4);
+               __edata_l1 = .;
+       } >l1_data AT>ram
+       __sdata_l1_lma = LOADADDR(.data_l1);
 
-  __bss_start = .;
-  .bss       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-  }
-  _end = . ;
-  PROVIDE (end = .);
+       .bss :
+       {
+               . = ALIGN(4);
+               __bss_start = .;
+               *(.sbss) *(.scommon)
+               *(.dynbss)
+               *(.bss .bss.*)
+               *(COMMON)
+               __bss_end = .;
+       } >ram
 }
index d72c861..a1a85d0 100644 (file)
@@ -278,7 +278,7 @@ void m48_watchdog_arm(int usec)
 /*
  * U-Boot RTC support.
  */
-void
+int
 rtc_get( struct rtc_time *tmp )
 {
        m48_tod_get(&tmp->tm_year,
@@ -295,6 +295,8 @@ rtc_get( struct rtc_time *tmp )
                tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
                tmp->tm_hour, tmp->tm_min, tmp->tm_sec );
 #endif
+
+       return 0;
 }
 
 void
index 7b86670..ee598c2 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 3165d56..1a25a98 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 703056b..5d2efad 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 SECTIONS
 {
   /* Read-only sections, merged into text segment: */
index 2267bf8..8f719ea 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(m68k)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index e617e90..8d9c08e 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index ddd4678..753411f 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index a0fac7f..a72ba46 100644 (file)
@@ -139,8 +139,15 @@ int misc_init_r (void)
        struct rtc_time tm;
        char bootcmd[32];
 
-       hdr = (image_header_t *) (CFG_MONITOR_BASE - sizeof (image_header_t));
-       timestamp = (time_t) hdr->ih_time;
+       hdr = (image_header_t *) (CFG_MONITOR_BASE - image_get_header_size ());
+#if defined(CONFIG_FIT)
+       if (genimg_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+               puts ("Non legacy image format not supported\n");
+               return -1;
+       }
+#endif
+
+       timestamp = (time_t)image_get_time (hdr);
        to_tm (timestamp, &tm);
        printf ("Welcome to U-Boot on Cray L1. Compiled %4d-%02d-%02d  %2d:%02d:%02d (UTC)\n", tm.tm_year, tm.tm_mon, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
 
@@ -170,9 +177,9 @@ long int initdram (int board_type)
 
 /* ------------------------------------------------------------------------- */
 /* stubs so we can print dates w/o any nvram RTC.*/
-void rtc_get (struct rtc_time *tmp)
+int rtc_get (struct rtc_time *tmp)
 {
-       return;
+       return 0;
 }
 void rtc_set (struct rtc_time *tmp)
 {
index 1c89d41..56c6cdb 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 1608f8c..88dcaf9 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index bbc7607..44af70e 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index de8ffa0..0021918 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index c437db6..289bff2 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 14a7846..27b51f7 100644 (file)
@@ -586,5 +586,5 @@ noCacheJump:
        sw      t1, 0(t0)
        sync
 
-       j       ra
+       jr      ra
        nop
index 0f9a157..25e16de 100644 (file)
@@ -26,7 +26,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 0f9a157..25e16de 100644 (file)
@@ -26,7 +26,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index b055c90..94ab745 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 3165d56..1a25a98 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index a1678b9..2168087 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 580575a..25bbd26 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 06f6524..799002f 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 7fd4fb1..50250b1 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 024997e..c57cd6b 100644 (file)
@@ -28,7 +28,9 @@ endif
 
 LIB    = $(obj)lib$(BOARD).a
 
-COBJS  = $(BOARD).o strataflash.o ../common/misc.o
+COBJS  = $(BOARD).o \
+       ../common/misc.o \
+       ../common/auto_update.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
index 078df00..b663184 100644 (file)
@@ -1,4 +1,7 @@
 /*
+ * (C) Copyright 2005-2008
+ * Matthias Fuchs, esd gmbh germany, matthias.fuchs@esd-electronics.com
+ *
  * (C) Copyright 2001-2003
  * Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.com
  *
 
 #include <common.h>
 #include <asm/processor.h>
+#include <asm/io.h>
 #include <command.h>
 #include <malloc.h>
+#include <flash.h>
+#include <asm/4xx_pci.h>
+#include <pci.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if 0
-#define FPGA_DEBUG
-#endif
+#undef FPGA_DEBUG
 
 extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 extern void lxt971_no_sleep(void);
+extern ulong flash_get_size (ulong base, int banknum);
+
+int flash_banks = CFG_MAX_FLASH_BANKS_DETECT;
 
 /* fpga configuration data - gzip compressed and generated by bin2c */
 const unsigned char fpgadata[] =
@@ -46,82 +54,94 @@ const unsigned char fpgadata[] =
  */
 #include "../common/fpga.c"
 
-
 /* Prototypes */
 int gunzip(void *, int, unsigned char *, unsigned long *);
 
-
 #ifdef CONFIG_LCD_USED
 /* logo bitmap data - gzip compressed and generated by bin2c */
 unsigned char logo_bmp[] =
 {
-#include CFG_LCD_LOGO_NAME
+#include "logo_640_480_24bpp.c"
 };
 
 /*
  * include common lcd code (for esd boards)
  */
 #include "../common/lcd.c"
-
-#include CFG_LCD_HEADER_NAME
+#include "../common/s1d13505_640_480_16bpp.h"
+#include "../common/s1d13806_640_480_16bpp.h"
 #endif /* CONFIG_LCD_USED */
 
+/*
+ * include common auto-update code (for esd boards)
+ */
+#include "../common/auto_update.h"
+
+au_image_t au_image[] = {
+       {"preinst.img", 0, -1, AU_SCRIPT},
+       {"u-boot.img", 0xfff80000, 0x00080000, AU_FIRMWARE | AU_PROTECT},
+       {"pImage", 0xfe000000, 0x00100000, AU_NOR | AU_PROTECT},
+       {"pImage.initrd", 0xfe100000, 0x00400000, AU_NOR | AU_PROTECT},
+       {"work.img", 0xfe500000, 0x01400000, AU_NOR},
+       {"data.img", 0xff900000, 0x00580000, AU_NOR},
+       {"logo.img", 0xffe80000, 0x00100000, AU_NOR | AU_PROTECT},
+       {"postinst.img", 0, 0, AU_SCRIPT},
+};
+
+int N_AU_IMAGES = (sizeof(au_image) / sizeof(au_image[0]));
 
 int board_revision(void)
 {
        unsigned long cntrl0Reg;
-       unsigned long value;
+       volatile unsigned long value;
 
        /*
         * Get version of APC405 board from GPIO's
         */
 
-       /*
-        * Setup GPIO pins (CS2/GPIO11 and CS3/GPIO12 as GPIO)
-        */
+       /* Setup GPIO pins (CS2/GPIO11, CS3/GPIO12 and CS4/GPIO13 as GPIO) */
        cntrl0Reg = mfdcr(cntrl0);
-       mtdcr(cntrl0, cntrl0Reg | 0x03000000);
-       out32(GPIO0_ODR, in32(GPIO0_ODR) & ~0x00180000);
-       out32(GPIO0_TCR, in32(GPIO0_TCR) & ~0x00180000);
-       udelay(1000);                   /* wait some time before reading input */
-       value = in32(GPIO0_IR) & 0x00180000;       /* get config bits */
+       mtdcr(cntrl0, cntrl0Reg | 0x03800000);
+       out_be32((void*)GPIO0_ODR, in_be32((void*)GPIO0_ODR) & ~0x001c0000);
+       out_be32((void*)GPIO0_TCR, in_be32((void*)GPIO0_TCR) & ~0x001c0000);
+
+       /* wait some time before reading input */
+       udelay(1000);
 
+       /* get config bits */
+       value = in_be32((void*)GPIO0_IR) & 0x001c0000;
        /*
         * Restore GPIO settings
         */
        mtdcr(cntrl0, cntrl0Reg);
 
        switch (value) {
-       case 0x00180000:
-               /* CS2==1 && CS3==1 -> version <= 1.2 */
+       case 0x001c0000:
+               /* CS2==1 && CS3==1 && CS4==1 -> version <= 1.2 */
                return 2;
-       case 0x00080000:
-               /* CS2==0 && CS3==1 -> version 1.3 */
+       case 0x000c0000:
+               /* CS2==0 && CS3==1 && CS4==1 -> version 1.3 */
                return 3;
-#if 0 /* not yet manufactured ! */
-       case 0x00100000:
-               /* CS2==1 && CS3==0 -> version 1.4 */
-               return 4;
-       case 0x00000000:
-               /* CS2==0 && CS3==0 -> version 1.5 */
-               return 5;
-#endif
+       case 0x00180000:
+               /* CS2==1 && CS3==1 && CS4==0 -> version 1.6 */
+               return 6;
+       case 0x00140000:
+               /* CS2==1 && CS3==0 && CS4==1 -> version 1.8 */
+               return 8;
        default:
                /* should not be reached! */
                return 0;
        }
 }
 
-
 int board_early_init_f (void)
 {
        /*
-        * First pull fpga-prg pin low, to disable fpga logic (on version 2 board)
+        * First pull fpga-prg pin low, to disable fpga logic
         */
-       out32(GPIO0_ODR, 0x00000000);        /* no open drain pins      */
-       out32(GPIO0_TCR, CFG_FPGA_PRG);      /* setup for output        */
-       out32(GPIO0_OR,  CFG_FPGA_PRG);      /* set output pins to high */
-       out32(GPIO0_OR, 0);                  /* pull prg low            */
+       out_be32((void*)GPIO0_ODR, 0x00000000);        /* no open drain pins */
+       out_be32((void*)GPIO0_TCR, CFG_FPGA_PRG);      /* setup for output   */
+       out_be32((void*)GPIO0_OR, 0);                  /* pull prg low       */
 
        /*
         * IRQ 0-15  405GP internally generated; active high; level sensitive
@@ -140,48 +160,61 @@ int board_early_init_f (void)
        mtdcr(uiccr, 0x00000000);       /* set all to be non-critical*/
        mtdcr(uicpr, 0xFFFFFF81);       /* set int polarities */
        mtdcr(uictr, 0x10000000);       /* set int trigger levels */
-       mtdcr(uicvcr, 0x00000001);      /* set vect base=0,INT0 highest priority*/
+       mtdcr(uicvcr, 0x00000001);      /* set vect base=0 */
        mtdcr(uicsr, 0xFFFFFFFF);       /* clear all ints */
 
        /*
-        * EBC Configuration Register: set ready timeout to 512 ebc-clks -> ca. 15 us
+        * EBC Configuration Register: set ready timeout to 512 ebc-clks
+        */
+       mtebc(epcr, 0xa8400000); /* ebc always driven */
+
+       /*
+        * New boards have a single 32MB flash connected to CS0
+        * instead of two 16MB flashes on CS0+1.
         */
-#if 1 /* test-only */
-       mtebc (epcr, 0xa8400000); /* ebc always driven */
-#else
-       mtebc (epcr, 0x28400000); /* ebc in high-z */
-#endif
+       if (board_revision() >= 8) {
+               /* disable CS1 */
+               mtebc(pb1ap, 0);
+               mtebc(pb1cr, 0);
+
+               /* resize CS0 to 32MB */
+               mtebc(pb0ap, CFG_EBC_PB0AP_HWREV8);
+               mtebc(pb0cr, CFG_EBC_PB0CR_HWREV8);
+       }
 
        return 0;
 }
 
-
-/* ------------------------------------------------------------------------- */
-
-int misc_init_f (void)
+int board_early_init_r(void)
 {
-       return 0;  /* dummy implementation */
+       if (gd->board_type >= 8)
+               flash_banks = 1;
+
+       return 0;
 }
 
+#define FUJI_BASE    0xf0100200
+#define LCDBL_PWM    0xa0
+#define LCDBL_PWMMIN 0xa4
+#define LCDBL_PWMMAX 0xa8
 
-int misc_init_r (void)
+int misc_init_r(void)
 {
-       volatile unsigned short *fpga_mode =
-               (unsigned short *)((ulong)CFG_FPGA_BASE_ADDR + CFG_FPGA_CTRL);
-       volatile unsigned short *fpga_ctrl2 =
-               (unsigned short *)((ulong)CFG_FPGA_BASE_ADDR + CFG_FPGA_CTRL2);
-       volatile unsigned char *duart0_mcr =
-               (unsigned char *)((ulong)DUART0_BA + 4);
-       volatile unsigned char *duart1_mcr =
-               (unsigned char *)((ulong)DUART1_BA + 4);
-       volatile unsigned short *fuji_lcdbl_pwm =
-               (unsigned short *)((ulong)0xf0100200 + 0xa0);
+       u16 *fpga_mode = (u16 *)(CFG_FPGA_BASE_ADDR + CFG_FPGA_CTRL);
+       u16 *fpga_ctrl2 =(u16 *)(CFG_FPGA_BASE_ADDR + CFG_FPGA_CTRL2);
+       u8 *duart0_mcr = (u8 *)(DUART0_BA + 4);
+       u8 *duart1_mcr = (u8 *)(DUART1_BA + 4);
        unsigned char *dst;
        ulong len = sizeof(fpgadata);
        int status;
        int index;
        int i;
        unsigned long cntrl0Reg;
+       char *str;
+       uchar *logo_addr;
+       ulong logo_size;
+       ushort minb, maxb;
+       int result;
 
        /*
         * Setup GPIO pins (CS6+CS7 as GPIO)
@@ -190,9 +223,9 @@ int misc_init_r (void)
        mtdcr(cntrl0, cntrl0Reg | 0x00300000);
 
        dst = malloc(CFG_FPGA_MAX_SIZE);
-       if (gunzip (dst, CFG_FPGA_MAX_SIZE, (uchar *)fpgadata, &len) != 0) {
-               printf ("GUNZIP ERROR - must RESET board to recover\n");
-               do_reset (NULL, 0, 0, NULL);
+       if (gunzip(dst, CFG_FPGA_MAX_SIZE, (uchar *)fpgadata, &len) != 0) {
+               printf("GUNZIP ERROR - must RESET board to recover\n");
+               do_reset(NULL, 0, 0, NULL);
        }
 
        status = fpga_boot(dst, len);
@@ -200,31 +233,34 @@ int misc_init_r (void)
                printf("\nFPGA: Booting failed ");
                switch (status) {
                case ERROR_FPGA_PRG_INIT_LOW:
-                       printf("(Timeout: INIT not low after asserting PROGRAM*)\n ");
+                       printf("(Timeout: "
+                              "INIT not low after asserting PROGRAM*)\n ");
                        break;
                case ERROR_FPGA_PRG_INIT_HIGH:
-                       printf("(Timeout: INIT not high after deasserting PROGRAM*)\n ");
+                       printf("(Timeout: "
+                              "INIT not high after deasserting PROGRAM*)\n ");
                        break;
                case ERROR_FPGA_PRG_DONE:
-                       printf("(Timeout: DONE not high after programming FPGA)\n ");
+                       printf("(Timeout: "
+                              "DONE not high after programming FPGA)\n ");
                        break;
                }
 
                /* display infos on fpgaimage */
                index = 15;
-               for (i=0; i<4; i++) {
+               for (i = 0; i < 4; i++) {
                        len = dst[index];
                        printf("FPGA: %s\n", &(dst[index+1]));
-                       index += len+3;
+                       index += len + 3;
                }
-               putc ('\n');
+               putc('\n');
                /* delayed reboot */
-               for (i=20; i>0; i--) {
+               for (i = 20; i > 0; i--) {
                        printf("Rebooting in %2d seconds \r",i);
-                       for (index=0;index<1000;index++)
+                       for (index = 0; index < 1000; index++)
                                udelay(1000);
                }
-               putc ('\n');
+               putc('\n');
                do_reset(NULL, 0, 0, NULL);
        }
 
@@ -235,12 +271,12 @@ int misc_init_r (void)
 
        /* display infos on fpgaimage */
        index = 15;
-       for (i=0; i<4; i++) {
+       for (i = 0; i < 4; i++) {
                len = dst[index];
-               printf("%s ", &(dst[index+1]));
-               index += len+3;
+               printf("%s ", &(dst[index + 1]));
+               index += len + 3;
        }
-       putc ('\n');
+       putc('\n');
 
        free(dst);
 
@@ -255,51 +291,117 @@ int misc_init_r (void)
        /*
         * Write board revision in FPGA
         */
-       *fpga_ctrl2 = (*fpga_ctrl2 & 0xfff0) | (gd->board_type & 0x000f);
+       out_be16(fpga_ctrl2,
+                (in_be16(fpga_ctrl2) & 0xfff0) | (gd->board_type & 0x000f));
 
        /*
         * Enable power on PS/2 interface (with reset)
         */
-       *fpga_mode |= CFG_FPGA_CTRL_PS2_RESET;
+       out_be16(fpga_mode, in_be16(fpga_mode) | CFG_FPGA_CTRL_PS2_RESET);
        for (i=0;i<100;i++)
                udelay(1000);
        udelay(1000);
-       *fpga_mode &= ~CFG_FPGA_CTRL_PS2_RESET;
+       out_be16(fpga_mode, in_be16(fpga_mode) & ~CFG_FPGA_CTRL_PS2_RESET);
 
        /*
         * Enable interrupts in exar duart mcr[3]
         */
-       *duart0_mcr = 0x08;
-       *duart1_mcr = 0x08;
+       out_8(duart0_mcr, 0x08);
+       out_8(duart1_mcr, 0x08);
 
        /*
         * Init lcd interface and display logo
         */
-       lcd_init((uchar *)CFG_LCD_BIG_REG, (uchar *)CFG_LCD_BIG_MEM,
-                regs_13806_640_480_16bpp,
-                sizeof(regs_13806_640_480_16bpp)/sizeof(regs_13806_640_480_16bpp[0]),
-                logo_bmp, sizeof(logo_bmp));
+       str = getenv("splashimage");
+       if (str) {
+               logo_addr = (uchar *)simple_strtoul(str, NULL, 16);
+               logo_size = CFG_VIDEO_LOGO_MAX_SIZE;
+       } else {
+               logo_addr = logo_bmp;
+               logo_size = sizeof(logo_bmp);
+       }
+
+       if (gd->board_type >= 6) {
+               result = lcd_init((uchar *)CFG_LCD_BIG_REG,
+                                 (uchar *)CFG_LCD_BIG_MEM,
+                                 regs_13505_640_480_16bpp,
+                                 sizeof(regs_13505_640_480_16bpp) /
+                                 sizeof(regs_13505_640_480_16bpp[0]),
+                                 logo_addr, logo_size);
+               if (result && str) {
+                       /* retry with internal image */
+                       logo_addr = logo_bmp;
+                       logo_size = sizeof(logo_bmp);
+                       lcd_init((uchar *)CFG_LCD_BIG_REG,
+                                (uchar *)CFG_LCD_BIG_MEM,
+                                regs_13505_640_480_16bpp,
+                                sizeof(regs_13505_640_480_16bpp) /
+                                sizeof(regs_13505_640_480_16bpp[0]),
+                                logo_addr, logo_size);
+               }
+       } else {
+               result = lcd_init((uchar *)CFG_LCD_BIG_REG,
+                                 (uchar *)CFG_LCD_BIG_MEM,
+                                 regs_13806_640_480_16bpp,
+                                 sizeof(regs_13806_640_480_16bpp) /
+                                 sizeof(regs_13806_640_480_16bpp[0]),
+                                 logo_addr, logo_size);
+               if (result && str) {
+                       /* retry with internal image */
+                       logo_addr = logo_bmp;
+                       logo_size = sizeof(logo_bmp);
+                       lcd_init((uchar *)CFG_LCD_BIG_REG,
+                                (uchar *)CFG_LCD_BIG_MEM,
+                                regs_13806_640_480_16bpp,
+                                sizeof(regs_13806_640_480_16bpp) /
+                                sizeof(regs_13806_640_480_16bpp[0]),
+                                logo_addr, logo_size);
+               }
+       }
 
        /*
         * Reset microcontroller and setup backlight PWM controller
         */
-       *fpga_mode |= 0x0014;
+       out_be16(fpga_mode, in_be16(fpga_mode) | 0x0014);
        for (i=0;i<10;i++)
                udelay(1000);
-       *fpga_mode |= 0x001c;
-       *fuji_lcdbl_pwm = 0x00ff;
+       out_be16(fpga_mode, in_be16(fpga_mode) | 0x001c);
+
+       minb = 0;
+       maxb = 0xff;
+       str = getenv("lcdbl");
+       if (str) {
+               minb = (ushort)simple_strtoul(str, &str, 16) & 0x00ff;
+               if (str && (*str=',')) {
+                       str++;
+                       maxb = (ushort)simple_strtoul(str, NULL, 16) & 0x00ff;
+               } else
+                       minb = 0;
+
+               out_be16((u16 *)(FUJI_BASE + LCDBL_PWMMIN), minb);
+               out_be16((u16 *)(FUJI_BASE + LCDBL_PWMMAX), maxb);
+
+               printf("LCDBL: min=0x%02x, max=0x%02x\n", minb, maxb);
+       }
+       out_be16((u16 *)(FUJI_BASE + LCDBL_PWM), 0xff);
+
+       if (getenv("usb_self") == NULL) {
+               setenv("usb_load", CFG_USB_LOAD_COMMAND);
+               setenv("usbargs", CFG_USB_ARGS);
+               setenv("bootcmd", CONFIG_BOOTCOMMAND);
+               setenv("usb_self", CFG_USB_SELF_COMMAND);
+               saveenv();
+       }
 
        return (0);
 }
 
-
 /*
  * Check Board Identity:
  */
-
 int checkboard (void)
 {
-       unsigned char str[64];
+       char str[64];
        int i = getenv_r ("serial#", str, sizeof(str));
 
        puts ("Board: ");
@@ -311,18 +413,11 @@ int checkboard (void)
        }
 
        gd->board_type = board_revision();
-       printf(", Rev 1.%ld\n", gd->board_type);
-
-       /*
-        * Disable sleep mode in LXT971
-        */
-       lxt971_no_sleep();
+       printf(", Rev. 1.%ld\n", gd->board_type);
 
        return 0;
 }
 
-/* ------------------------------------------------------------------------- */
-
 long int initdram (int board_type)
 {
        unsigned long val;
@@ -330,43 +425,64 @@ long int initdram (int board_type)
        mtdcr(memcfga, mem_mb0cf);
        val = mfdcr(memcfgd);
 
-#if 0
-       printf("\nmb0cf=%x\n", val); /* test-only */
-       printf("strap=%x\n", mfdcr(strap)); /* test-only */
-#endif
-
        return (4*1024*1024 << ((val & 0x000e0000) >> 17));
 }
 
-/* ------------------------------------------------------------------------- */
-
-int testdram (void)
+#ifdef CONFIG_IDE_RESET
+void ide_set_reset(int on)
 {
-       /* TODO: XXX XXX XXX */
-       printf ("test: 16 MB - ok\n");
+       u16 *fpga_mode = (u16 *)(CFG_FPGA_BASE_ADDR + CFG_FPGA_CTRL);
 
-       return (0);
+       /*
+        * Assert or deassert CompactFlash Reset Pin
+        */
+       if (on) {
+               out_be16(fpga_mode,
+                        in_be16(fpga_mode) & ~CFG_FPGA_CTRL_CF_RESET);
+       } else {
+               out_be16(fpga_mode,
+                        in_be16(fpga_mode) | CFG_FPGA_CTRL_CF_RESET);
+       }
 }
+#endif /* CONFIG_IDE_RESET */
 
-/* ------------------------------------------------------------------------- */
+void reset_phy(void)
+{
+       /*
+        * Disable sleep mode in LXT971
+        */
+       lxt971_no_sleep();
+}
 
-#ifdef CONFIG_IDE_RESET
+#if defined(CONFIG_USB_OHCI_NEW) && defined(CFG_USB_OHCI_BOARD_INIT)
+int usb_board_init(void)
+{
+       return 0;
+}
 
-void ide_set_reset(int on)
+int usb_board_stop(void)
 {
-       volatile unsigned short *fpga_mode =
-               (unsigned short *)((ulong)CFG_FPGA_BASE_ADDR + CFG_FPGA_CTRL);
+       unsigned short tmp;
+       int i;
 
        /*
-        * Assert or deassert CompactFlash Reset Pin
+        * reset PCI bus
+        * This is required to make some very old Linux OHCI driver
+        * work after U-Boot has used the OHCI controller.
         */
-       if (on) {               /* assert RESET */
-               *fpga_mode &= ~(CFG_FPGA_CTRL_CF_RESET);
-       } else {                /* release RESET */
-               *fpga_mode |= CFG_FPGA_CTRL_CF_RESET;
-       }
-}
+       pci_read_config_word(PCIDEVID_405GP, PCIBRDGOPT2, &tmp);
+       pci_write_config_word(PCIDEVID_405GP, PCIBRDGOPT2, (tmp | 0x1000));
 
-#endif /* CONFIG_IDE_RESET */
+       for (i = 0; i < 100; i++)
+               udelay(1000);
 
-/* ------------------------------------------------------------------------- */
+       pci_write_config_word(PCIDEVID_405GP, PCIBRDGOPT2, tmp);
+       return 0;
+}
+
+int usb_board_init_fail(void)
+{
+       usb_board_stop();
+       return 0;
+}
+#endif /* defined(CONFIG_USB_OHCI) && defined(CFG_USB_OHCI_BOARD_INIT) */
index c31625a..0b4664e 100644 (file)
-  0x1f,0x8b,0x08,0x08,0x30,0x6a,0x41,0x42,0x00,0x03,0x61,0x62,0x67,0x34,0x30,0x35,
-  0x5f,0x31,0x5f,0x30,0x32,0x2e,0x62,0x69,0x74,0x00,0xed,0xbd,0x0b,0x74,0x1c,0xd5,
-  0x95,0x2e,0xbc,0xeb,0x54,0x49,0x2e,0x75,0xb7,0xd4,0xa5,0x87,0x89,0x00,0x63,0x4a,
-  0x2d,0xd9,0xb4,0x3d,0x6d,0xb9,0x2d,0x1b,0x59,0x08,0x59,0x2a,0x3d,0x20,0x1d,0xec,
-  0x60,0x41,0x98,0xc4,0x93,0x9f,0xcb,0x34,0xc4,0xc9,0x78,0xb2,0x9c,0x5c,0x43,0x72,
-  0xe7,0x3a,0x8f,0x21,0x47,0x0f,0xdb,0x6d,0xcb,0xe0,0xb6,0x71,0x12,0x67,0xe2,0x24,
-  0xed,0x07,0x60,0x88,0x27,0xd3,0x96,0x0d,0x96,0x31,0x81,0x92,0x11,0x20,0x1b,0x61,
-  0x2b,0x84,0x49,0xcc,0x23,0xd0,0x26,0x82,0x08,0x22,0x8c,0x30,0x0e,0x91,0xdf,0xff,
-  0xde,0xa7,0xba,0xaa,0xab,0x65,0x67,0xee,0xcc,0xbd,0x97,0xb5,0xfe,0xf5,0xaf,0x74,
-  0xd6,0x4c,0x76,0xaa,0x8e,0x4b,0x55,0xa7,0x4e,0xed,0xfd,0x9d,0xbd,0xbf,0xbd,0x37,
-  0xe4,0xf9,0x47,0xad,0xff,0x00,0x48,0x77,0x82,0x76,0xe7,0x5d,0xff,0x30,0x27,0x7c,
-  0xed,0xdf,0xcf,0xfa,0xfb,0x70,0x55,0xe5,0xd7,0xbf,0xb4,0x18,0xee,0x02,0x4f,0xd5,
-  0x37,0xae,0x0d,0x7f,0xe5,0x1f,0xaa,0xae,0xad,0x86,0x2f,0x81,0xb7,0x2a,0x1c,0xbe,
-  0x76,0x66,0x78,0xf6,0xcc,0xaa,0xd9,0xb0,0x18,0xf2,0x66,0xcd,0xa9,0x0d,0xd7,0xd4,
-  0x86,0x67,0xc1,0x97,0x41,0x2a,0xf4,0x5d,0xc0,0xdf,0xa3,0x3f,0xfa,0xdb,0xaf,0x84,
-  0x81,0x4b,0x00,0x30,0x21,0x2c,0x45,0xe9,0xbf,0xbd,0x61,0x49,0x97,0x80,0x37,0xcc,
-  0x08,0x83,0x49,0xff,0x1b,0xd2,0xe7,0xf3,0xc2,0xa0,0xbb,0xff,0xb7,0x14,0x06,0x03,
-  0x5a,0xa1,0x5e,0x81,0x22,0xf8,0x5f,0xff,0x24,0x50,0xb8,0x2d,0xff,0x57,0xc7,0xb3,
-  0xff,0xc4,0x78,0xfc,0xfd,0x6f,0x8f,0xff,0xcf,0xdc,0x0f,0x80,0xf2,0xbf,0x3d,0x5e,
-  0xfb,0xcf,0x8d,0xb7,0x85,0x0b,0x1a,0xfe,0x8b,0x1c,0x90,0x68,0x76,0x4b,0xfe,0x92,
-  0x60,0x34,0xf4,0xd9,0xd7,0x37,0x73,0xce,0xc3,0x05,0xde,0x90,0xf2,0x9f,0x95,0xbf,
-  0xc5,0x5f,0x08,0xef,0x1d,0x58,0x30,0xd6,0xfc,0x12,0xfb,0x00,0xe6,0xa6,0xfc,0xfd,
-  0xf2,0xbd,0xd0,0xd7,0x3e,0xfb,0xb0,0x6f,0x4c,0x1e,0x85,0x65,0xe9,0xf1,0x5c,0x3b,
-  0x0e,0xfb,0x79,0x65,0xca,0x1b,0x66,0xff,0x68,0xac,0xbb,0xa7,0x7c,0x40,0xed,0xc9,
-  0x7d,0x07,0xd6,0xf1,0x40,0xca,0x1b,0x63,0x21,0xd8,0xc1,0x03,0x83,0x6a,0x0f,0x4b,
-  0x29,0xe1,0xf4,0xf8,0x58,0xce,0x00,0xec,0x86,0x90,0xe9,0xad,0x62,0xc1,0xd8,0x36,
-  0x49,0x37,0x63,0x61,0x96,0x82,0x6d,0x9a,0x6e,0xfe,0x98,0x07,0x16,0xe0,0x34,0xea,
-  0xfd,0xd3,0xc3,0xec,0x2d,0xc9,0xbe,0xbe,0x39,0x71,0x27,0xec,0x87,0xca,0x5e,0x6f,
-  0x92,0x4d,0x97,0x7f,0x0e,0x01,0x53,0x4d,0x06,0x52,0xbc,0x0b,0x02,0xbd,0x5e,0x2e,
-  0xae,0xbf,0xd5,0xf4,0x24,0x9b,0x46,0x95,0xa8,0xfd,0xc0,0x85,0x23,0xa5,0x67,0xa0,
-  0xde,0xf4,0x27,0x65,0x43,0xff,0xa3,0x54,0x6d,0x4e,0x4a,0xb2,0x67,0xe0,0xf7,0x50,
-  0xdd,0xeb,0x5f,0x2b,0x2f,0x80,0x43,0x66,0xd8,0x2c,0x48,0xca,0xa6,0xd2,0x9a,0x1e,
-  0x9e,0x92,0x9e,0x84,0x0b,0xd0,0x60,0x8a,0xaf,0xe0,0x4d,0x14,0xbe,0x37,0x8a,0x4f,
-  0x77,0x46,0xc2,0x23,0x87,0xe4,0xb3,0xfa,0x79,0xbc,0x54,0xfe,0xa8,0x3c,0x06,0xf6,
-  0xf5,0x0d,0x6d,0x27,0xa4,0xaf,0x5f,0xa6,0x7d,0x89,0xce,0x26,0xe5,0x63,0xf0,0x82,
-  0x56,0x65,0xfa,0x3b,0xe5,0xa5,0xf0,0xaa,0x5e,0x4b,0xd7,0x6f,0x55,0xf4,0xf4,0xf8,
-  0xfe,0x9c,0x90,0x86,0xf7,0x6f,0x7a,0x93,0xde,0x28,0xac,0x53,0x66,0xe2,0x3f,0x64,
-  0x29,0x69,0x1d,0xaf,0x36,0x3f,0x03,0x72,0x08,0xda,0x53,0xe5,0x2f,0x2b,0x49,0x76,
-  0x02,0x57,0x7f,0xfa,0x7e,0x72,0x16,0x58,0xf3,0x93,0x64,0x0a,0x0a,0x95,0xbd,0xf3,
-  0xc3,0x45,0xfd,0xd0,0x91,0xd0,0x4d,0x2f,0xe4,0xfa,0x20,0xce,0x83,0xa6,0x1c,0x66,
-  0x63,0x60,0xdf,0x7f,0x54,0x9a,0x0c,0x7b,0xf9,0x8c,0x54,0xd7,0x77,0xd8,0x65,0x2d,
-  0x3f,0x4c,0xcc,0x18,0xf2,0x2e,0x6f,0x3f,0x01,0xab,0xf8,0x94,0x61,0x6f,0x7f,0xee,
-  0x53,0xbc,0x93,0x97,0xa5,0xd4,0xe5,0x97,0xf5,0x3b,0xd7,0x8f,0xa8,0x3e,0xbc,0x6c,
-  0x9d,0xe9,0xaf,0x65,0x01,0xfe,0x51,0x22,0xd4,0xe7,0xbf,0x4e,0xee,0x65,0x1d,0x4a,
-  0x78,0xe4,0x6a,0xc9,0x5b,0xa9,0x0e,0x42,0x8d,0xe9,0x0f,0xcb,0xb7,0x3a,0xab,0xde,
-  0xb8,0x2a,0x3d,0x3f,0x49,0x39,0x05,0x1f,0x68,0x0d,0x7d,0x05,0xa3,0xe5,0xa3,0xc6,
-  0x05,0x4f,0xbd,0x79,0x9f,0x81,0xcf,0x7b,0xce,0x3a,0x35,0x98,0x6b,0xcf,0xcf,0x8e,
-  0x9c,0x91,0xf4,0xfc,0x48,0x2a,0x4e,0x4b,0xfd,0x09,0x1f,0xce,0x36,0xfc,0x1a,0x6a,
-  0xcd,0x7c,0x2e,0x1f,0x87,0xa3,0x7c,0x36,0xcd,0xcf,0x7b,0xce,0xfa,0x89,0x14,0x6e,
-  0x86,0xbd,0x30,0xa3,0xd7,0xbb,0x2c,0x58,0xca,0x56,0x69,0xf3,0x8e,0x5e,0xb1,0x4c,
-  0x1e,0x84,0x87,0xb5,0x69,0xa6,0xd7,0x60,0x67,0x61,0x25,0x94,0x1d,0xf5,0x2e,0x63,
-  0x2f,0x39,0xf3,0x6f,0xc2,0x4f,0xc5,0xf3,0x7a,0xc7,0x58,0x2d,0x3e,0x66,0x08,0x9f,
-  0x2e,0x70,0x42,0x5a,0x95,0x98,0x96,0xca,0x8b,0xb0,0x37,0xe0,0x07,0xed,0xf8,0xe0,
-  0xcb,0xd9,0x28,0xd8,0xf3,0x1f,0x29,0x19,0xb0,0xe7,0x53,0xe5,0x1d,0x10,0x34,0x3d,
-  0x61,0xc6,0xd7,0x6f,0x93,0xa6,0x9b,0xde,0xeb,0xd8,0x00,0xb4,0x97,0x4e,0x35,0x71,
-  0xe9,0xbe,0xe4,0xac,0xcf,0xe1,0x89,0x3b,0xe0,0x34,0xd4,0x73,0x6f,0x42,0xbe,0x9e,
-  0x1f,0x82,0x4a,0xee,0x4b,0xb0,0xd3,0xfc,0x00,0xd4,0xf2,0xfc,0x14,0x1b,0x86,0x37,
-  0x5a,0xfe,0x89,0xdf,0x9f,0x90,0x4f,0x2b,0xce,0xfd,0x43,0x0a,0xc6,0xa0,0x1e,0xfc,
-  0x1c,0xe7,0x67,0x4c,0x49,0x0b,0xc3,0x74,0xa4,0x5d,0x3e,0xa6,0x8e,0xc1,0x13,0x1a,
-  0x1e,0x79,0xc9,0xb9,0x1f,0x55,0x1b,0x82,0x53,0x50,0x6f,0xf8,0xe3,0xf2,0x76,0x38,
-  0x08,0xb5,0xc6,0xba,0x78,0xf9,0x76,0xf5,0x15,0xe8,0x6e,0xbc,0x2f,0x2e,0xe3,0x29,
-  0xa3,0x32,0xea,0x8b,0xcb,0x07,0x9c,0xfb,0xe1,0xca,0x62,0xd8,0x07,0x95,0x86,0x37,
-  0xee,0xa9,0x50,0x57,0xc3,0x57,0x8d,0xae,0x38,0xeb,0x83,0x57,0x78,0xc0,0xf0,0xc5,
-  0xd9,0x90,0x74,0x9d,0x59,0xb9,0x3c,0x18,0xc7,0x15,0x65,0xab,0x85,0xd2,0x9c,0x8a,
-  0xf4,0x78,0x5c,0x3f,0x6d,0xec,0x2b,0x8d,0x5e,0x1a,0xf6,0x23,0x3d,0x60,0xe4,0x25,
-  0xd9,0xdb,0xf0,0x63,0xb5,0xa0,0x45,0x8d,0xb3,0xe7,0x9c,0xf5,0xa0,0x2a,0x0a,0xec,
-  0x82,0x90,0xe1,0xd5,0x8a,0x94,0xf6,0xb6,0x40,0x30,0x32,0x5f,0xcb,0x1d,0x82,0xf5,
-  0x65,0x01,0x43,0xd5,0x58,0x9f,0x8a,0xa7,0x22,0x41,0x8d,0x1d,0x90,0xec,0xf5,0xd0,
-  0x93,0x1f,0x15,0xcf,0xeb,0x5d,0x21,0x97,0x19,0xb1,0xdb,0xaa,0x4b,0x8e,0xf0,0x09,
-  0x29,0x38,0x0a,0x55,0x80,0xef,0xf7,0x98,0xd1,0x03,0xf5,0x25,0x3e,0x7c,0xd1,0x92,
-  0xbd,0x3e,0x37,0x5d,0x95,0x7e,0xde,0x56,0xf9,0xa4,0x71,0xaa,0xe8,0xeb,0x2d,0xde,
-  0x78,0xf1,0x49,0x38,0x55,0x58,0x6f,0x14,0x0c,0xe2,0xf3,0xfe,0x09,0xea,0x5b,0x70,
-  0x2a,0xde,0xc9,0xb5,0xe7,0x73,0x53,0x8e,0x3d,0x3f,0xde,0x29,0xfa,0xc1,0x68,0x7d,
-  0x8b,0x0f,0x87,0xf9,0x5e,0xf4,0x74,0xd3,0x8c,0x7d,0xd3,0x78,0x1b,0xe6,0x36,0x15,
-  0xc4,0xe5,0xe7,0x9c,0xf5,0x53,0xa3,0xa5,0xa0,0x07,0x2a,0x41,0x06,0x8f,0xd4,0x16,
-  0xbb,0xab,0xb6,0x34,0xc6,0x51,0x9f,0x8c,0x19,0x01,0x40,0xfd,0x00,0x5a,0x0f,0x04,
-  0x34,0x14,0x0e,0x3b,0xf3,0xa9,0xde,0xd0,0x67,0x3d,0x6f,0x51,0x3b,0xce,0x4f,0x4b,
-  0xa8,0x55,0xd5,0x02,0xef,0xc0,0x16,0xd0,0x69,0xc6,0xfa,0xf8,0x2e,0xa8,0x68,0xba,
-  0x52,0x2b,0x3a,0xe0,0xe8,0x9f,0xd2,0x89,0xdb,0xad,0xf9,0xd4,0xd8,0x14,0x58,0x9d,
-  0x13,0x34,0xd4,0x78,0x60,0xb1,0xb1,0x1f,0x02,0x86,0x77,0x3d,0xc3,0xa9,0xce,0x9b,
-  0x4e,0xff,0xf0,0x39,0x47,0xff,0x24,0x26,0x3a,0xef,0xb7,0x02,0x56,0xa3,0x10,0x8a,
-  0x37,0xf7,0xc1,0xbb,0xac,0xca,0xf0,0x6f,0xec,0x18,0x82,0x0f,0x3b,0xab,0x0d,0xbc,
-  0xff,0x61,0x47,0x3f,0x04,0xa5,0xed,0xf6,0xf8,0xbe,0xdc,0x53,0xb8,0x1e,0x68,0x36,
-  0xb4,0x77,0xad,0x23,0x78,0x29,0xb3,0xba,0xe9,0xea,0xb8,0x7c,0xc8,0x59,0x3f,0x41,
-  0x2d,0x21,0xe6,0xff,0x6a,0xfe,0x39,0x1d,0xfa,0xa1,0x96,0xa6,0x5d,0x67,0x63,0x93,
-  0xaa,0x00,0xf5,0x4f,0x0a,0xfa,0x55,0xf1,0x22,0x0e,0x65,0xae,0x9f,0x13,0x84,0x27,
-  0x70,0x19,0x7b,0x13,0x2c,0xa8,0xac,0x81,0x00,0x57,0x77,0xb0,0x1d,0xf0,0x79,0x5e,
-  0xcd,0xbd,0x3a,0x3b,0x65,0xdc,0xcf,0xcb,0x93,0xc1,0x44,0xd1,0x21,0xfb,0xf5,0xe2,
-  0xf8,0xb4,0xfe,0x09,0x37,0xf9,0xa0,0x03,0x74,0xf3,0xf2,0x52,0xe6,0x83,0xee,0xb6,
-  0x68,0xaf,0x37,0x9c,0x7b,0x40,0xed,0x30,0xf5,0x51,0x35,0x8c,0xe3,0xed,0xf7,0x9b,
-  0x90,0x26,0xd1,0xf7,0x6b,0x76,0x7d,0x83,0x4d,0xe2,0x1d,0x89,0xb2,0x3e,0x75,0x51,
-  0xfb,0x93,0xec,0x07,0x6c,0x8a,0xe9,0x5d,0x96,0xfb,0x6b,0x75,0x95,0x5a,0xf6,0x96,
-  0xba,0x8c,0xf5,0x6b,0xf6,0x7a,0xdb,0xa1,0x4e,0x86,0x3f,0xf3,0x79,0x29,0xfc,0x48,
-  0x27,0xc3,0xf3,0x3b,0xc2,0xa9,0xfc,0x45,0xf2,0x64,0xed,0x63,0x3e,0xeb,0x98,0x7f,
-  0xb9,0xfc,0x1b,0xf6,0x3c,0x9f,0x9d,0x08,0x2d,0x97,0x0f,0x39,0xfa,0x47,0xbd,0xca,
-  0xd2,0xb7,0xeb,0x92,0x1d,0xef,0x37,0xfd,0xf8,0x96,0x5f,0x1c,0xf0,0x6b,0xb3,0x07,
-  0x60,0x99,0x54,0x6f,0x2e,0x4c,0xca,0xa3,0xea,0x69,0x78,0x8a,0xf4,0xc9,0x01,0x47,
-  0xff,0x18,0xb6,0xfd,0x3a,0x25,0x7d,0xcf,0xf8,0xa0,0xb3,0x2a,0xb5,0xae,0x74,0xc2,
-  0xbd,0xe6,0x7c,0x7e,0x7d,0x6a,0x5d,0x8f,0x7c,0x5a,0x3a,0xb8,0x61,0x76,0xca,0x3f,
-  0x86,0x1a,0xc6,0x7e,0xbf,0x3b,0x6c,0xfd,0xd3,0xc3,0x0a,0xf8,0x3a,0x28,0x1b,0x2e,
-  0xa8,0x61,0x9b,0x8d,0xdf,0x24,0xf4,0x11,0xef,0xb7,0x8b,0x5e,0x80,0x07,0x13,0x77,
-  0x9a,0x78,0xab,0xef,0x39,0xef,0x57,0x03,0x31,0xde,0xf4,0x2c,0xcb,0x7d,0xdd,0x78,
-  0x58,0x2b,0xeb,0x9f,0xdf,0xca,0xea,0x7a,0x76,0x07,0xa6,0xf5,0xcf,0xbf,0x27,0xf7,
-  0xa8,0xba,0x4e,0x47,0xc5,0xb5,0xac,0xc9,0x74,0xde,0x57,0x34,0xa3,0x7f,0x42,0x2a,
-  0xcd,0xa7,0x27,0x9c,0xbb,0x16,0xba,0x21,0x4a,0x6a,0xa7,0x1f,0xb6,0xa1,0x46,0x42,
-  0xe1,0xa8,0xb3,0x3e,0x77,0x4c,0xb4,0x9e,0xb7,0x60,0xf4,0x73,0xdf,0x9d,0xf4,0x01,
-  0xec,0x36,0xfd,0xf1,0xe2,0xaf,0x19,0x27,0x50,0x7f,0x0a,0x0d,0x7c,0xb0,0xaf,0x16,
-  0x50,0xc8,0xdc,0x4f,0x1c,0x6c,0x7d,0x2b,0x8f,0xf8,0x50,0xe8,0xf5,0xc6,0xe5,0x11,
-  0xed,0x0a,0x03,0x8f,0xec,0x6a,0xff,0x10,0xce,0x68,0x0f,0x69,0xe2,0x1f,0xda,0xd7,
-  0x8f,0x6b,0x67,0xd3,0xf6,0x4e,0x1e,0x51,0x3f,0x40,0x61,0xc5,0xa0,0x7c,0x56,0x39,
-  0x6f,0xce,0xa6,0x23,0x49,0xed,0xe9,0xbc,0x86,0x84,0x6f,0x54,0x36,0x5b,0xec,0xf1,
-  0x6d,0xca,0x52,0xb4,0xbf,0x53,0xcd,0xae,0xa4,0x27,0x04,0x3f,0x27,0x43,0x16,0x67,
-  0x03,0x6c,0x0d,0xa0,0xfe,0x0c,0xcb,0x5b,0xd5,0x27,0xda,0x43,0x89,0x20,0x5a,0x34,
-  0xc3,0xd6,0x3f,0x3c,0x27,0x04,0x96,0xbd,0x03,0x31,0x1e,0xef,0x27,0x30,0x22,0x3d,
-  0xc1,0x02,0x78,0x24,0x77,0x2b,0xec,0xe3,0x95,0x9b,0x54,0x1c,0xef,0xac,0x1f,0x55,
-  0xf1,0x59,0xf3,0x33,0x8b,0xf9,0xe2,0xdb,0xb4,0x90,0xd9,0x55,0xcd,0x46,0xa4,0x76,
-  0x9c,0x16,0xa9,0xbb,0x8a,0xeb,0xbb,0xd4,0x10,0x57,0xab,0xd8,0x01,0x67,0x7d,0xf2,
-  0xfc,0xa5,0xd6,0xf3,0x9e,0x28,0xfe,0x65,0xea,0x03,0x40,0x7b,0xba,0xf1,0xf7,0x23,
-  0xa8,0xb1,0xab,0xfa,0xfc,0xc9,0x8e,0x84,0x79,0xa6,0xa2,0x9e,0xfb,0xba,0x3b,0x4c,
-  0x66,0xdf,0x4f,0xe2,0x2a,0x7a,0xde,0xb9,0xa6,0xff,0x71,0x79,0x84,0x5f,0x98,0xd2,
-  0xd0,0xe7,0x1f,0x2d,0x7e,0x1d,0xce,0x6b,0xf5,0x03,0xf8,0xbc,0x1c,0xfe,0x0c,0x0d,
-  0x1c,0xe7,0x67,0xd8,0xd1,0x3f,0x0e,0xfe,0xd9,0x27,0xef,0xd4,0x8e,0xc0,0xb6,0xfe,
-  0xfc,0x0f,0xe5,0x6a,0xed,0x37,0x07,0xea,0x69,0xd9,0x8c,0x74,0x1e,0x89,0xe3,0xfa,
-  0xe9,0x91,0x47,0x59,0x06,0xff,0xfc,0x42,0xe0,0x1f,0x39,0xc9,0xa6,0xb4,0x76,0x99,
-  0xb3,0x5f,0xf6,0x7d,0xcc,0xa6,0xc2,0xa3,0x80,0xf8,0xa7,0x87,0x9d,0x83,0x2e,0x5d,
-  0x08,0x99,0xf9,0x8f,0x29,0x36,0xfe,0x29,0x52,0x95,0xae,0x92,0x60,0xaf,0x3a,0x87,
-  0x25,0x94,0xfd,0x65,0x41,0xb3,0x2b,0xcc,0x06,0x52,0xdb,0x74,0xdd,0xbc,0x29,0x1c,
-  0xf8,0xbd,0x1b,0xff,0x58,0xf8,0x21,0xcc,0xf4,0x92,0x2e,0xa3,0xd2,0xcc,0x4b,0x7a,
-  0xb6,0x4a,0x8f,0xaa,0x01,0x73,0x7e,0x92,0x8d,0xe0,0xfa,0xd9,0x8a,0x13,0xeb,0xc2,
-  0x3f,0xc6,0x44,0x67,0x3d,0x54,0xb6,0xf7,0x17,0xd6,0x9a,0xa1,0xa4,0xdc,0x0e,0x27,
-  0x4a,0xac,0x15,0x02,0x7f,0x84,0x2a,0xfc,0x5e,0xd8,0xa0,0x63,0xbf,0x6c,0xfc,0xb3,
-  0x70,0x54,0xfe,0x4a,0x64,0x8c,0x2f,0xc3,0x85,0x27,0x2f,0x83,0xf3,0x6d,0x62,0x85,
-  0xbc,0xce,0xde,0xb4,0x96,0xca,0xc5,0xf8,0xe7,0xea,0x5d,0x37,0xf4,0x43,0x7f,0x63,
-  0xb5,0x19,0x0a,0x4f,0x48,0x44,0x4f,0x37,0xd1,0xf5,0x8b,0x47,0xe0,0x35,0xa8,0x16,
-  0x78,0xe0,0x62,0xfc,0xd3,0x83,0x86,0x92,0x2b,0x72,0xaf,0x3a,0x8a,0x37,0xfd,0x2a,
-  0xe2,0x31,0x5c,0x21,0x67,0xa1,0x0b,0x08,0x2f,0x35,0x5d,0x02,0xff,0xd4,0x32,0x13,
-  0xda,0x41,0x31,0x51,0xdb,0xac,0x80,0x00,0xd3,0x69,0x06,0xd6,0xc2,0x03,0x42,0x35,
-  0xe5,0x66,0xf0,0x8f,0x9e,0xc6,0x3f,0xf8,0x91,0xbe,0xc4,0x57,0xf2,0xb2,0x61,0x75,
-  0x39,0xfb,0x81,0xf4,0xd3,0xce,0x29,0xa9,0xf9,0xcb,0xd9,0x61,0xfe,0x30,0x02,0x03,
-  0xcf,0x72,0x96,0x8d,0x7f,0x3e,0x42,0xfc,0xe3,0xad,0x61,0x07,0x70,0x59,0xcd,0x19,
-  0xf6,0xf5,0x30,0x5e,0xb4,0x35,0x51,0x33,0xe2,0xaf,0x91,0xef,0xe7,0xbf,0xde,0xfe,
-  0x4d,0xd3,0x7f,0x3d,0xda,0x6b,0xfb,0xe7,0xe0,0x9f,0x5d,0xf8,0x11,0x9d,0x87,0x86,
-  0xe7,0x50,0x11,0x1d,0xa5,0xf5,0x23,0xbe,0x20,0x48,0xcf,0xcf,0xa0,0x33,0xff,0x19,
-  0xfc,0x83,0x67,0x4f,0xf3,0xee,0x57,0xd7,0xee,0xe9,0x48,0x40,0x3f,0xaf,0x42,0x0d,
-  0x26,0x1f,0xe7,0x2f,0x58,0xa7,0x2e,0xc2,0x3f,0x66,0xc1,0x32,0xf6,0xba,0xf2,0x38,
-  0x94,0xf7,0x7f,0x76,0x94,0x69,0x6c,0x25,0x5c,0x8b,0x6a,0x84,0xbd,0x9e,0x58,0x85,
-  0xa7,0x08,0xff,0x38,0xd7,0x77,0xf0,0xcf,0x72,0xf6,0x86,0xd2,0xbd,0xa6,0x2c,0xe5,
-  0x39,0xdd,0xf4,0x00,0xfc,0x00,0x61,0x1e,0x3e,0xe6,0x1b,0xc6,0x2a,0xeb,0xd4,0x25,
-  0xf0,0x4f,0x98,0xbd,0x08,0xdd,0xa9,0x00,0x09,0x0c,0xda,0xb9,0x98,0xcf,0x01,0xd4,
-  0xf0,0xa1,0x4b,0xe3,0x1f,0x7f,0x02,0x5f,0xfa,0x79,0xb3,0x8a,0x17,0x24,0x8a,0x7f,
-  0xa4,0xbe,0x71,0x67,0x00,0x05,0x79,0x18,0x0e,0x59,0xa7,0x4e,0x3b,0xf7,0x63,0xe3,
-  0x1f,0x0f,0x5a,0x1f,0x9d,0x84,0x1c,0x01,0x84,0xd2,0x88,0x28,0x37,0x2d,0xbc,0xe4,
-  0xac,0xff,0x0c,0xfe,0xf9,0x9c,0x25,0xf8,0xe2,0xcd,0x15,0xfa,0x41,0x4f,0xbd,0xb1,
-  0x50,0xd8,0x3b,0x45,0x18,0xbe,0x4b,0xe0,0x9f,0xef,0xb3,0x21,0x65,0x9f,0x54,0x69,
-  0x78,0xe2,0xec,0x21,0x63,0xb5,0x85,0x70,0x86,0x6c,0xa8,0x93,0x82,0x4b,0xe0,0x1f,
-  0x3c,0xab,0x54,0x12,0x8c,0xa9,0x60,0xe3,0xc7,0x5f,0x0a,0xff,0x90,0xf5,0xaf,0x08,
-  0x45,0x6e,0x2a,0x62,0x9d,0xa8,0xf5,0xec,0x23,0xd6,0xa9,0x8b,0xf1,0x8f,0xff,0x41,
-  0x44,0x3b,0x28,0x94,0x2c,0x58,0x51,0xae,0x83,0xd9,0x2a,0x1e,0xb3,0xd7,0x18,0xbb,
-  0x4d,0x08,0xc7,0xe5,0x8b,0xf0,0x4f,0x1c,0xf1,0xcf,0x39,0xad,0xfe,0x06,0xff,0x7a,
-  0xf9,0x65,0xe5,0x1c,0xb3,0xec,0xbb,0x91,0x3e,0x95,0xc1,0x3f,0xa5,0x36,0xfe,0x19,
-  0x6c,0x7e,0x5f,0xdf,0xc7,0x6a,0x5b,0x7d,0x1b,0x0e,0xcc,0x51,0x0f,0x42,0x15,0xc1,
-  0x86,0xa1,0x96,0xeb,0xac,0xf1,0x17,0xe3,0x1f,0x04,0x39,0xa9,0xce,0x9e,0x5b,0x43,
-  0xa5,0xf9,0x2b,0x19,0x01,0x83,0x00,0x44,0x38,0x43,0x3c,0xa6,0xd3,0x29,0x70,0xe1,
-  0x1f,0x70,0xf0,0x0f,0x0a,0x4a,0x68,0x91,0xaa,0xdd,0xaf,0xb0,0xb6,0xd8,0x56,0x63,
-  0x0d,0x3d,0xef,0x16,0x35,0xfd,0xbc,0xe3,0xf0,0x4f,0xe3,0x95,0xd6,0xec,0x85,0x8c,
-  0xbc,0xb8,0x98,0x4f,0xc4,0x87,0x04,0x2c,0xf7,0xb1,0xca,0xbf,0x84,0x7f,0x8a,0xde,
-  0x8e,0x13,0x9e,0x51,0xe3,0x72,0x6e,0xf4,0x20,0xb7,0xee,0x5f,0x39,0x25,0x89,0xfb,
-  0x1f,0x76,0xf4,0x4f,0x06,0xff,0x34,0x0f,0x69,0x28,0x34,0xfa,0x35,0xf9,0x1d,0x78,
-  0x57,0xb3,0xf1,0x8f,0x38,0x55,0x7c,0xc8,0xd1,0x3f,0x36,0xfe,0xf1,0xf3,0x6b,0xca,
-  0x94,0xe5,0xca,0xbd,0x80,0x68,0xf3,0x98,0x85,0xb7,0xc5,0xc2,0x63,0xf5,0x92,0xff,
-  0x52,0xf8,0x47,0x7e,0xc7,0x13,0x54,0x6b,0x81,0xf1,0x9b,0x12,0xec,0x0c,0xac,0x81,
-  0x7b,0x11,0x11,0xdd,0x3a,0x9c,0x86,0x46,0xf2,0x1a,0x67,0x3d,0x38,0xf8,0xa7,0x8a,
-  0x91,0x61,0x0a,0x9a,0xa5,0xf8,0xe1,0xb4,0xfd,0xdc,0xd2,0xc0,0xce,0xa7,0x74,0x31,
-  0xfe,0xf1,0x2e,0x62,0x93,0x60,0x37,0x2f,0x33,0xd7,0xdc,0xc3,0x5e,0x91,0x56,0x09,
-  0x18,0xc0,0x5e,0x5f,0xbb,0x57,0x17,0xdf,0xef,0x0e,0xe7,0xfa,0x36,0xfe,0xf1,0x0f,
-  0xb3,0xc9,0xfc,0xcf,0xfc,0xba,0xb7,0x7c,0xdf,0x93,0xdf,0x50,0xfe,0x90,0x9c,0x91,
-  0x42,0xfc,0xf3,0x66,0xde,0x9f,0xb7,0xcf,0x23,0xe1,0xbd,0x0c,0xfe,0xc9,0x4f,0xef,
-  0x37,0xd1,0xac,0x93,0x70,0xd6,0xff,0x78,0x73,0x3f,0x9a,0x75,0x4b,0xc3,0xac,0x4f,
-  0x0b,0x19,0xfc,0x03,0xb6,0xfd,0x1a,0x9b,0x72,0x3e,0xfa,0x42,0xfc,0xfa,0x54,0xc1,
-  0x98,0x7c,0x1e,0x9e,0xe7,0xd7,0x90,0xfd,0xba,0x60,0x5c,0x30,0x05,0xfe,0x31,0xc7,
-  0xe3,0x1f,0xd3,0xfb,0x55,0xf9,0xa9,0x08,0xee,0xa7,0x4c,0xb5,0x96,0xbd,0xae,0x75,
-  0x28,0xd3,0x46,0xbc,0xe1,0xa2,0x37,0xf8,0x7e,0xad,0x8c,0xee,0x3f,0x83,0x37,0x20,
-  0x8d,0x7f,0xbc,0x4d,0xec,0xf5,0xd8,0xc3,0x3a,0x6a,0x9b,0x7b,0x70,0x9b,0xb6,0x4e,
-  0x9d,0x66,0x76,0xe1,0xf3,0xe2,0x29,0x31,0x3e,0x83,0x7f,0x74,0x5b,0xff,0x00,0x58,
-  0xda,0x26,0x2f,0x9c,0xfb,0x1c,0x3c,0x60,0x12,0xec,0x09,0x8c,0xe0,0x29,0xa1,0x88,
-  0xfa,0x2f,0xc2,0x3f,0xde,0x24,0xde,0xf6,0x1f,0x2d,0xed,0x7a,0x9c,0x1d,0xe9,0x24,
-  0xfc,0x53,0x4e,0xa6,0x7c,0x2b,0xed,0xa0,0x33,0xf7,0xc3,0x6d,0xfc,0x13,0x97,0x77,
-  0x46,0xce,0xa0,0x62,0xbf,0x19,0xad,0x79,0xe3,0x1f,0xf5,0x2b,0x2c,0x0d,0x9c,0x56,
-  0xc5,0x19,0xfb,0x2b,0xa5,0xf1,0x4f,0x41,0x4a,0xfe,0x2e,0x0a,0xdf,0x41,0x7b,0x27,
-  0xd5,0xc1,0x9b,0xd2,0x5c,0xfa,0x43,0x67,0xe1,0x88,0xf5,0x17,0x8d,0x71,0xf8,0x47,
-  0xc0,0x9e,0x11,0x14,0x6a,0x4d,0x4f,0x92,0xad,0x41,0x20,0x57,0x45,0x88,0x6e,0x44,
-  0x7b,0x4d,0x40,0x9d,0x4b,0xe0,0x9f,0x2b,0x93,0x62,0xfc,0x74,0xb4,0x5f,0x6c,0x67,
-  0xe3,0x8f,0x95,0xe9,0xe4,0xc1,0x18,0x91,0xba,0xd2,0xe3,0x5d,0xfa,0x27,0x8d,0x7f,
-  0xca,0xd8,0x00,0xdf,0xad,0xe2,0xfe,0x74,0x4e,0xfb,0x4e,0x1c,0xa6,0x0f,0xa0,0x99,
-  0x1b,0xe0,0x0f,0x18,0x02,0x1a,0x65,0xf4,0x0f,0xd8,0xf8,0x87,0xb3,0x91,0xd4,0x19,
-  0xb8,0xce,0x54,0x4f,0xca,0x3b,0xe1,0xcd,0xd6,0xda,0x7e,0xff,0x1e,0x71,0xff,0x96,
-  0xeb,0xc3,0xd1,0x3f,0x89,0x3c,0xeb,0x79,0xaf,0xee,0xc0,0xd9,0x40,0xe1,0x90,0xbf,
-  0xbb,0xf8,0x75,0x76,0xa1,0xec,0x89,0x01,0xff,0x89,0x6d,0xef,0xeb,0x17,0x74,0x7c,
-  0xde,0x13,0xf2,0xb0,0x83,0x67,0xcc,0x15,0x62,0xfd,0x98,0xf9,0x1f,0x77,0xe0,0x3f,
-  0xe4,0x75,0x7a,0x41,0xb7,0xfc,0x06,0x1c,0xe0,0x73,0x53,0xbe,0xe4,0x03,0x75,0xea,
-  0x6b,0xd0,0x30,0xba,0x6e,0x4c,0x1e,0xcd,0xe0,0x13,0xe1,0xff,0x99,0x89,0xb7,0xa1,
-  0x5f,0x40,0xa1,0x76,0x8b,0xef,0x54,0xd1,0x71,0xe8,0xe2,0xd3,0x53,0xf7,0x9d,0xe0,
-  0xbf,0x80,0x2e,0x93,0x4c,0x3f,0x4b,0xe5,0xda,0xf3,0xd9,0x0f,0x03,0xca,0x6e,0x29,
-  0x64,0xae,0xae,0x42,0x7b,0x84,0x0f,0x0e,0x5d,0xe1,0xc0,0x4e,0x48,0xe0,0x0c,0x7c,
-  0xa6,0x0a,0x81,0xf1,0xee,0xa2,0x50,0x3f,0xee,0xd0,0xb7,0x3a,0xef,0x2b,0xed,0xff,
-  0x41,0xd8,0x73,0xeb,0x48,0x29,0x0a,0xed,0x79,0xc9,0xc0,0xfb,0xc6,0x0e,0x98,0xde,
-  0x9b,0x97,0xbc,0x71,0xa7,0x85,0x48,0x11,0xff,0x48,0xf6,0x7a,0x90,0xd2,0xf8,0x27,
-  0x1f,0xdf,0xbe,0x8a,0x42,0xaa,0x20,0x59,0xfc,0x0b,0x15,0xf5,0x83,0xb9,0x36,0x29,
-  0xef,0x54,0x05,0xb4,0x4e,0xca,0xbc,0xc5,0x85,0x7f,0x14,0xb1,0x1e,0x46,0xc5,0xfc,
-  0x5c,0xff,0x48,0x01,0x2d,0xbc,0xdf,0x41,0x43,0x2f,0x02,0x45,0xb2,0xef,0x57,0x67,
-  0xe3,0x9f,0xdb,0x32,0xfe,0x9f,0x90,0xfa,0x1a,0xab,0x46,0xf4,0xd8,0x3c,0x03,0xc6,
-  0xd4,0x2a,0x71,0xc4,0x3e,0x35,0xe8,0xf8,0xdf,0xfa,0xc5,0x7a,0x98,0x39,0xe8,0x1d,
-  0xf5,0xd4,0x41,0x57,0x6e,0xa8,0x2d,0x7f,0x14,0x61,0x0c,0x97,0x74,0xf3,0xca,0x51,
-  0x36,0xa9,0x70,0x9d,0xb5,0x1e,0xb2,0xf0,0x8f,0xb6,0x1b,0x2a,0xfb,0x6d,0xeb,0xcc,
-  0xf3,0xc2,0xb8,0x91,0xaf,0xe2,0x09,0x44,0xe0,0xc6,0xcd,0x91,0x6d,0xb9,0x3e,0xdc,
-  0x88,0xa1,0x7d,0xb7,0xd7,0x5b,0xd2,0xc6,0x3f,0xd7,0xb3,0x3b,0xcc,0x1f,0xf2,0x99,
-  0xdb,0xf3,0xbe,0x95,0xfb,0x14,0xdc,0x1f,0x9f,0x96,0xf2,0xd6,0x14,0xdd,0xc1,0x27,
-  0xb4,0x09,0x3c,0x70,0x54,0xb1,0xc7,0x47,0x22,0x3e,0x75,0x37,0xd4,0xf5,0xf9,0x6b,
-  0xe5,0xc3,0xf0,0xeb,0xb2,0xba,0x47,0x67,0xd6,0xca,0x3e,0x18,0x1d,0x4b,0x0e,0xe1,
-  0x15,0x6e,0xe6,0x1f,0xc5,0xeb,0x4c,0x04,0x42,0x2f,0x39,0xf8,0xd9,0xc1,0x3f,0x7f,
-  0x92,0x9f,0x34,0xf0,0x7b,0x8c,0xf9,0xff,0xd4,0x7c,0x16,0x81,0xdb,0xdc,0x5e,0xff,
-  0x49,0xef,0x93,0x46,0x7a,0x2b,0x31,0x98,0xd1,0xcf,0x8a,0x98,0x9f,0xc3,0x88,0x9f,
-  0x43,0x88,0x76,0xea,0xda,0x7c,0x4f,0x94,0x57,0xc2,0xa0,0x35,0x2d,0xc7,0x23,0xaf,
-  0x59,0xc2,0x81,0x0c,0x3e,0x4c,0xeb,0x93,0xae,0x7b,0xaa,0xf2,0x13,0xbf,0x85,0x19,
-  0x84,0xf6,0x27,0xc1,0x49,0x40,0xfd,0xf9,0x4d,0xf6,0x06,0x5f,0x95,0x22,0xfd,0x09,
-  0x19,0xff,0x89,0xa1,0x59,0xf8,0xc7,0x53,0x33,0x75,0x32,0x3c,0xcc,0x67,0x26,0x62,
-  0xdf,0x62,0xf5,0xb0,0xd6,0x9c,0x91,0xfa,0xcc,0xb7,0x73,0xdf,0x80,0x55,0x09,0xf1,
-  0xbc,0xfd,0xce,0xf5,0x23,0x25,0x6b,0xd3,0x4a,0xdb,0xe3,0x53,0x11,0x3d,0x76,0xe3,
-  0xf7,0xa8,0x2a,0x49,0xd8,0x81,0xd3,0x7e,0x19,0xcd,0xb0,0x50,0xec,0xaf,0x3a,0xd7,
-  0xb7,0xf1,0x0f,0xa2,0x9d,0x20,0xbc,0x07,0xf3,0x36,0x84,0x12,0xc5,0xb5,0xea,0x61,
-  0x3c,0xb2,0x30,0x51,0x9e,0xc1,0x3f,0x19,0xfc,0x66,0xe1,0x1f,0x72,0xf2,0x98,0x0e,
-  0xec,0x31,0xc6,0x8c,0xa7,0x48,0x38,0xe6,0x19,0xb6,0xf1,0x8f,0x3d,0x3f,0x2e,0xff,
-  0xcf,0x10,0x3b,0x88,0xd6,0x90,0xcc,0xa2,0x7e,0x0a,0xaa,0x85,0xc7,0xa0,0xe5,0x16,
-  0x34,0xf4,0x88,0x88,0x0e,0x38,0xf7,0x93,0xc6,0x3f,0x4d,0xde,0x78,0xd3,0x90,0x80,
-  0x31,0x64,0x76,0x61,0x97,0x14,0x68,0xc4,0x8d,0xde,0x83,0xda,0x3e,0xb6,0x95,0x8e,
-  0xfc,0x05,0xfc,0x83,0xe3,0x5b,0x3d,0xf8,0x0f,0xa5,0x7d,0xb0,0x95,0x8e,0x54,0x5c,
-  0xfe,0x23,0x98,0x4e,0xe3,0x0f,0x2b,0xf6,0x7a,0x4b,0xe3,0x9f,0x88,0xb7,0x08,0xad,
-  0x7f,0x1b,0xda,0x77,0xb5,0xa8,0xa8,0x0f,0x57,0xac,0x8e,0x08,0x81,0x75,0xf2,0x5d,
-  0xfa,0x0e,0x42,0x50,0x87,0x1c,0xfd,0x33,0x96,0x23,0xf0,0x4f,0x89,0x7f,0x05,0x79,
-  0x1b,0x10,0x78,0x14,0x58,0x78,0xaf,0x0a,0xf0,0x48,0x10,0x8e,0xb2,0xda,0x92,0x10,
-  0x97,0xcf,0x3b,0xfe,0x9f,0x98,0x85,0x07,0x5a,0x10,0xf6,0x0c,0xb5,0x9c,0xc2,0xfd,
-  0x5a,0xce,0xfa,0xe6,0x97,0xd5,0x73,0x04,0x03,0xd6,0x97,0x77,0x1a,0xaf,0x68,0xe2,
-  0xc1,0xdf,0x52,0xdc,0xf8,0xe7,0x15,0x68,0x68,0xf2,0xc5,0x3b,0x10,0x16,0x42,0x43,
-  0x63,0x41,0xbc,0x63,0xc8,0xf3,0xa2,0x72,0x0d,0x4e,0x4b,0xc7,0x1c,0xfd,0x94,0x6a,
-  0xe1,0x25,0x69,0x3c,0xfe,0x51,0x3b,0x8b,0xca,0x20,0x86,0x42,0x90,0xfc,0x3f,0x31,
-  0xc4,0x3f,0xc1,0x4e,0x28,0xc3,0x53,0xb5,0x12,0xf9,0x7f,0x1c,0xfd,0x13,0xc9,0x11,
-  0xf8,0xe7,0x26,0xb5,0xe8,0xa1,0x4e,0xd6,0xc6,0x04,0x3e,0x1c,0x82,0x36,0xa8,0x30,
-  0x3c,0x45,0x6b,0x14,0x65,0x8b,0xb2,0xf4,0x26,0xc4,0x3f,0x2f,0x39,0xfa,0x64,0x93,
-  0x85,0x7f,0x4c,0x9c,0xb4,0xed,0x9a,0x35,0xff,0x4d,0x38,0xb1,0x5a,0xa0,0xf1,0x0a,
-  0xad,0x09,0xa7,0x9a,0x09,0xff,0xcf,0x3b,0xce,0xfb,0x4a,0x94,0x90,0x37,0x8f,0x60,
-  0xed,0xb4,0xed,0xca,0x41,0xa5,0x0e,0xf1,0xaa,0xfc,0xac,0x7e,0x30,0x7a,0x19,0xbe,
-  0xe8,0xe2,0x0a,0xb0,0x1c,0x3b,0xc5,0x19,0xfc,0xb3,0x04,0xe8,0xfa,0x75,0xc6,0xcc,
-  0xb8,0xdc,0x02,0xa7,0x2c,0x58,0xf8,0x07,0xb1,0x42,0xbe,0x86,0x0b,0x43,0x4b,0x7b,
-  0x84,0x5e,0x1a,0x8f,0x7f,0x7c,0x0b,0xf8,0xe7,0xa2,0x38,0xff,0xf5,0x16,0xfe,0xe9,
-  0xbf,0xa1,0x1a,0xfe,0x9e,0x17,0xeb,0x70,0xd4,0x5a,0x6f,0x99,0xef,0x2b,0xa8,0x10,
-  0xfe,0x99,0xc9,0xd5,0x04,0x1b,0x56,0xd6,0xc0,0xcc,0xc7,0xf2,0x51,0x60,0x88,0x11,
-  0x79,0x57,0xa2,0x68,0x7f,0x34,0xed,0x1a,0x3a,0x94,0xc1,0x3f,0xca,0x02,0xda,0x64,
-  0xc5,0xd5,0x24,0x2c,0x60,0xa8,0x7f,0x96,0xe1,0xf7,0x32,0xc0,0xda,0xd5,0x0a,0x72,
-  0x3b,0x4f,0x48,0x7f,0x4a,0x77,0x1d,0x72,0xd6,0x9b,0x0e,0xb7,0xc3,0x0f,0xf1,0xfb,
-  0x55,0xef,0xc9,0x1d,0x00,0xdc,0xad,0x34,0x7f,0x66,0x19,0xe2,0x81,0x4e,0xfa,0x7e,
-  0xef,0x2e,0xda,0xa8,0xe2,0xa7,0x3d,0x80,0x78,0x20,0xe5,0xe8,0x9f,0x60,0xec,0x0e,
-  0xfc,0x7e,0xeb,0x52,0xa1,0xef,0xc9,0x77,0x20,0x2c,0x99,0x17,0xed,0x5c,0x8e,0xf6,
-  0xe5,0x39,0x7e,0x6d,0xca,0x7b,0x5a,0x2e,0x52,0xbf,0xc0,0x05,0xfe,0x79,0x2b,0xe0,
-  0xe0,0x55,0x81,0x7f,0x50,0xc9,0x3c,0x25,0xac,0x79,0x9d,0x81,0xda,0x63,0x00,0x46,
-  0x71,0x9b,0xb9,0x2e,0x59,0x9e,0x82,0x33,0x0a,0x6e,0xcc,0x51,0x9f,0x64,0xf6,0xa7,
-  0x39,0xe7,0x0d,0x6b,0xff,0x2e,0x55,0xc2,0x11,0xbc,0x7e,0xc1,0xbe,0xf2,0x37,0xe0,
-  0xf9,0x64,0x35,0x45,0x34,0x2a,0xe1,0x83,0x95,0x96,0xff,0x67,0xab,0x3d,0x3f,0x8f,
-  0x5a,0xf8,0xa7,0x0f,0xf7,0x9b,0x05,0xe6,0x6f,0x13,0x33,0x5a,0xd4,0xe5,0x81,0xd7,
-  0xa3,0x7d,0x25,0xfa,0x88,0xff,0x1e,0xf9,0x46,0x58,0xc5,0xee,0x24,0xfd,0xf0,0x1e,
-  0xb3,0xc7,0x23,0xfe,0xc1,0x87,0x9a,0xc6,0xbd,0xdf,0x62,0xb7,0xc3,0x2a,0x6d,0x46,
-  0xab,0x87,0xf0,0xcf,0x0f,0xca,0xa6,0x3c,0xeb,0x5d,0x96,0x5b,0x82,0x33,0x40,0x8e,
-  0x2f,0xd6,0x77,0xb1,0xff,0x27,0x7c,0xd9,0x02,0xed,0x01,0x16,0x8a,0xe2,0x7c,0x1e,
-  0xa6,0x30,0x07,0x6d,0x63,0x5b,0x26,0x74,0xc0,0x43,0xc2,0xff,0xe3,0x8c,0xdf,0x21,
-  0xec,0x57,0x2d,0x29,0xd5,0xa5,0xca,0x0b,0x4a,0xa8,0x14,0xed,0xd1,0x07,0xc6,0x60,
-  0x6b,0x35,0x1d,0xa9,0x40,0x44,0x34,0x57,0x28,0x52,0x67,0xfd,0x70,0x49,0xe8,0xdb,
-  0xb8,0x3f,0xf9,0xb9,0xb5,0x24,0x70,0x01,0x7b,0xc6,0x0c,0x11,0x86,0x78,0xdb,0xba,
-  0x14,0x45,0x28,0xec,0xf9,0x91,0xb4,0x27,0x55,0xdb,0xff,0x83,0xd6,0xed,0x7b,0x46,
-  0x01,0xc1,0x9e,0x11,0x28,0x37,0x7f,0xb6,0xac,0xb9,0x04,0x9e,0x81,0xd9,0xa6,0x6f,
-  0x94,0x65,0xfc,0x93,0x69,0xfc,0x33,0x4a,0xe8,0x05,0x77,0xeb,0x5f,0x1f,0xcd,0x4f,
-  0xb2,0x01,0x6d,0x47,0x8c,0xfc,0x39,0xf2,0x14,0xb4,0x80,0x5b,0x4d,0x35,0xc9,0x86,
-  0x5d,0xf8,0x47,0x8c,0x8f,0xd2,0x78,0xe5,0xc7,0x50,0xb9,0xcc,0x93,0x6c,0x1a,0x81,
-  0x1d,0xfc,0x51,0xb4,0x5f,0x2c,0xa4,0x77,0xb1,0xbb,0x4c,0xf5,0x12,0xf8,0xc7,0xc8,
-  0x9b,0x8d,0x68,0x07,0xd7,0x5b,0x4b,0x5e,0x78,0xc3,0x08,0x24,0xb4,0xe0,0x4b,0xde,
-  0x39,0x4c,0xd1,0x1f,0xc0,0x89,0x52,0x67,0xb9,0xfc,0x3f,0x10,0x23,0x7b,0x8a,0x9f,
-  0xc9,0x3d,0x1d,0xef,0x73,0x44,0x5f,0x86,0x67,0x17,0x3e,0xc8,0x70,0x4e,0xed,0xd1,
-  0xf9,0xdf,0xf4,0x4e,0x89,0xcc,0xd7,0xba,0xc9,0xe3,0x91,0xf1,0x87,0x5b,0xfe,0x9f,
-  0x06,0xf0,0x9f,0x28,0x3f,0x97,0x3c,0x53,0xd8,0x10,0x41,0xb4,0x83,0xf6,0xab,0x6c,
-  0x2f,0x79,0x3c,0x36,0x72,0x1b,0xff,0xe4,0x64,0xfc,0x2d,0x69,0xfc,0xbc,0x5b,0xd6,
-  0xe1,0x0f,0xd0,0xd0,0xef,0x53,0xe5,0x27,0x97,0x1c,0x81,0xda,0xd7,0x70,0xd9,0x1c,
-  0x6f,0x7a,0x13,0xc4,0xfa,0xc9,0xe0,0x1f,0x5e,0x9a,0x8e,0x7f,0x7d,0xe8,0x99,0xda,
-  0xda,0x35,0x38,0xf3,0xa4,0x1a,0x63,0x4f,0xf2,0x7f,0xbb,0x7d,0x0b,0xc2,0x1e,0x79,
-  0x27,0x5f,0xd7,0x36,0x9d,0xfc,0x3f,0xa3,0xce,0xfa,0x71,0xe2,0x5f,0x61,0xc6,0x61,
-  0x1b,0x02,0xa1,0x2b,0x80,0xad,0x8d,0x3f,0xa0,0xeb,0xc2,0xe2,0xf3,0xdd,0x9a,0xc0,
-  0xc3,0x27,0x24,0x7b,0xbc,0x99,0xb3,0x33,0xed,0x4f,0x2b,0x4a,0x00,0xa1,0xc7,0xe9,
-  0x9d,0xb8,0x31,0xf9,0xb9,0x32,0x5d,0xe0,0x4f,0xc4,0x3f,0xd3,0x05,0xfe,0x71,0xd6,
-  0x0f,0xe4,0x10,0xec,0x14,0x46,0x36,0x00,0x7f,0x64,0xf5,0xe6,0xe4,0xd5,0xb3,0x77,
-  0xc2,0x0b,0x52,0x2d,0x0e,0x93,0x68,0x69,0x09,0xa0,0xd2,0x67,0xd8,0xdf,0x97,0xed,
-  0xff,0x39,0x92,0x2c,0x5e,0xcc,0x49,0xc8,0x37,0x8b,0xd3,0x1e,0xb3,0xd1,0xf2,0x27,
-  0xb5,0xb4,0x7f,0x63,0xd4,0x7e,0x5d,0xf8,0xde,0xd2,0xfe,0xc9,0xb0,0x1c,0x5a,0xf2,
-  0x02,0x5e,0x0d,0xf5,0xcf,0x4e,0x5c,0x96,0xf5,0xbd,0x84,0xb8,0xe0,0x23,0xeb,0x4f,
-  0x6f,0x76,0xee,0xc7,0xf1,0xff,0xfc,0xc9,0x53,0x00,0xeb,0xa0,0xec,0x75,0x9f,0xe7,
-  0x8a,0x3a,0x65,0x1d,0xc2,0xaa,0x02,0xba,0xff,0x06,0xf1,0x68,0xf2,0x13,0xce,0xeb,
-  0x35,0x15,0x6b,0xff,0xe5,0xa9,0x31,0xf2,0xa0,0x43,0xd2,0x53,0x72,0x6e,0x60,0x01,
-  0x3e,0x66,0x05,0x05,0x6e,0x46,0xb4,0x62,0x58,0x4c,0xf3,0x93,0x74,0xf4,0x4f,0x54,
-  0xbb,0x23,0xed,0x0f,0x09,0x4c,0x86,0x55,0xe4,0x06,0x99,0x9f,0x7b,0x07,0x0a,0xd3,
-  0x84,0x87,0x84,0x5b,0xa7,0x60,0x8f,0x83,0xc7,0x22,0xea,0x02,0x11,0xff,0x2a,0xa8,
-  0x69,0xf7,0xb0,0x8e,0x44,0xd8,0xf4,0x7b,0xe5,0xa5,0xf0,0x7b,0x3d,0x94,0x5a,0x14,
-  0x2e,0x3e,0x1c,0xff,0x08,0xe6,0x50,0xfc,0x6b,0x83,0x73,0x3f,0xc6,0xc4,0x34,0xfe,
-  0x39,0x31,0x61,0xac,0xf1,0x69,0x6d,0x52,0x5f,0x88,0x37,0xcf,0x33,0xce,0x44,0x1a,
-  0x68,0x99,0x9d,0x35,0xce,0x68,0xe4,0x51,0x44,0xfc,0x63,0x3f,0xaf,0x6a,0xfb,0x7f,
-  0xf6,0xe0,0xfa,0x39,0xd3,0x5e,0xf5,0x92,0x12,0x93,0xff,0xbb,0xf1,0x47,0xb3,0xba,
-  0xdf,0x9f,0xfc,0x14,0x22,0xd2,0x56,0x31,0x3f,0xed,0x19,0xff,0xcc,0xe5,0xe9,0xfd,
-  0xd4,0x3f,0x75,0xdc,0x56,0xb2,0x57,0x29,0xeb,0xbd,0x69,0x19,0xe2,0x9f,0x55,0x81,
-  0x32,0x52,0x9b,0xb8,0x9f,0x0a,0x8a,0xfd,0xe3,0x89,0xcc,0x7e,0xca,0xf6,0xff,0xd4,
-  0xb0,0xc9,0xb0,0x3b,0x5e,0x31,0x34,0x7f,0xa4,0xe8,0x0e,0x65,0x5b,0xdb,0x9d,0x23,
-  0xf3,0xf1,0x79,0xb5,0xb4,0x6b,0xc8,0x74,0xbe,0xdf,0x25,0x8a,0xe3,0x7f,0x5e,0x88,
-  0x42,0x85,0xe9,0xad,0x68,0x5a,0x20,0x1c,0xfb,0xee,0xfd,0xac,0xdb,0xff,0x33,0x6c,
-  0xfb,0x7f,0x6a,0x51,0xa8,0xe6,0x5f,0x4b,0x15,0x2f,0x91,0xdf,0x83,0x6e,0x3a,0x32,
-  0x2c,0xa5,0x4f,0x7d,0x94,0xb9,0x7f,0xc9,0xde,0x8f,0xcb,0xc7,0xa2,0x63,0x46,0x8d,
-  0x84,0xeb,0x21,0xa1,0x8d,0x41,0xad,0x00,0x42,0x4a,0x8f,0x38,0x35,0xc1,0x1d,0xff,
-  0x4a,0xef,0xf7,0x37,0x16,0x57,0x28,0xa7,0xda,0xea,0xa3,0xf9,0xf1,0x07,0x10,0x21,
-  0x48,0xf6,0x7e,0xdf,0x12,0x9e,0x19,0x8f,0x7f,0x8c,0xae,0xf8,0xfd,0x53,0xb5,0x7d,
-  0xe1,0xca,0x68,0x30,0x5e,0x44,0x8e,0x9d,0x5a,0xe3,0xef,0x33,0xfe,0x9c,0x40,0x06,
-  0xff,0xd4,0xa4,0xf1,0x0f,0xc2,0x9e,0xc5,0x09,0x14,0x5a,0xbc,0xeb,0xd9,0x50,0xc9,
-  0x3e,0x69,0xfa,0x38,0xff,0x8f,0xfd,0x0b,0x96,0xa4,0xfd,0x3f,0x45,0xac,0xa5,0x73,
-  0x97,0x1e,0x8a,0xe4,0x69,0x53,0xfb,0x10,0xf6,0x04,0x23,0x1e,0x0d,0xd5,0x38,0x1e,
-  0x31,0xe4,0x4b,0xf9,0x7f,0x0a,0x56,0x04,0xa2,0x40,0x4f,0x97,0xcf,0xe5,0xde,0xc8,
-  0x58,0x6b,0x6d,0x89,0x97,0x5b,0x1e,0x21,0x7a,0xf0,0x8f,0x9d,0xfb,0xd9,0x64,0xfb,
-  0x43,0xd6,0xcb,0x7b,0x8c,0x53,0x5a,0x7d,0x4b,0xc1,0x32,0x79,0xa8,0xf5,0x94,0x56,
-  0x4b,0x61,0xaf,0x93,0x70,0xaa,0x88,0x9e,0xb7,0xfc,0x2d,0x44,0x55,0xe9,0xf1,0x12,
-  0xe1,0x1f,0xf2,0xff,0xb4,0xcd,0xd1,0xcf,0xa9,0xf3,0x3e,0x53,0x30,0x28,0x2f,0x46,
-  0xd8,0x53,0x84,0x88,0x08,0x11,0xd4,0xbb,0x70,0xaf,0xc0,0x4b,0xce,0x7e,0xad,0xa6,
-  0x94,0xa2,0x8d,0x95,0xe0,0x25,0x06,0x47,0x8d,0x81,0x40,0x88,0xa3,0xae,0xe9,0x31,
-  0xa6,0x6b,0xb9,0x02,0x08,0xb5,0x7e,0x9d,0x5c,0x43,0xcf,0x39,0xfb,0xa9,0x08,0xda,
-  0xe6,0xf5,0xf4,0xbc,0x55,0xed,0x9d,0xf4,0xe0,0xad,0x8b,0xe2,0xac,0xa5,0x62,0x57,
-  0x70,0xc9,0x4d,0x14,0xef,0x6b,0xdb,0x62,0x39,0xbe,0x5e,0x75,0xc6,0x97,0x2a,0xdb,
-  0xe1,0x11,0x9c,0xb4,0xf9,0xf1,0xa6,0xb7,0xc5,0xec,0xa9,0x1b,0x58,0x05,0xfe,0x43,
-  0x8f,0x88,0x97,0x89,0x53,0xde,0x38,0x1c,0x77,0xee,0x1f,0xf1,0x8f,0x75,0xff,0x71,
-  0xf9,0x61,0xf1,0xe0,0x95,0x9a,0xbc,0x18,0x5f,0xeb,0x15,0x8d,0x74,0xff,0x88,0x7f,
-  0x2a,0x85,0xff,0x87,0x67,0xd6,0xcf,0xf6,0x34,0x28,0xba,0x73,0xb1,0x91,0xc6,0x3f,
-  0x43,0x0a,0xfd,0x43,0x02,0xc6,0xf6,0xa5,0x5e,0x72,0xc6,0xab,0x69,0xff,0x4f,0x3e,
-  0x7c,0x2a,0xa1,0x8c,0xa9,0x61,0xc5,0xb7,0xf2,0x4b,0x3a,0xf4,0x2b,0x55,0x04,0x84,
-  0x10,0x88,0xe6,0x54,0x09,0xfc,0x93,0x89,0x97,0x49,0x96,0xff,0xa7,0x20,0xc5,0x6a,
-  0xe1,0x29,0x63,0x2e,0x0f,0xa6,0x8a,0x82,0xda,0xab,0xb8,0x8c,0x05,0x22,0xaa,0x85,
-  0x00,0xe1,0x9f,0x8c,0x7d,0xb1,0xfd,0x3f,0x79,0x61,0xed,0x3e,0x7d,0x57,0xab,0x7e,
-  0x34,0x4f,0x63,0x14,0x08,0xcb,0xed,0x8d,0x84,0x8b,0x06,0x60,0xb6,0xf5,0xe1,0x3c,
-  0xe3,0x8c,0xe7,0x85,0x96,0xff,0xc7,0x63,0xb0,0xab,0xe0,0xb1,0xce,0x2f,0xf3,0xbc,
-  0xc1,0x35,0x93,0xfb,0x10,0x11,0xf5,0xa9,0xf8,0xfd,0xf2,0xd9,0xdc,0xf2,0x87,0x18,
-  0xf6,0xfd,0xc4,0xd4,0x9f,0x0a,0xff,0x4f,0xde,0x72,0xf6,0x53,0xe5,0x4f,0x6d,0xb3,
-  0x52,0xf9,0x8b,0xca,0xeb,0x9b,0x9e,0x31,0xe7,0x0c,0xfb,0xf0,0xfb,0xc5,0x53,0xb3,
-  0x08,0xff,0x3c,0x63,0x0f,0x07,0xd5,0x8e,0x07,0x25,0xca,0x97,0xc2,0x87,0xb4,0xf0,
-  0xb4,0x66,0xd4,0x30,0x9e,0xea,0x03,0x33,0x93,0xf2,0x39,0x7e,0x06,0x9e,0x22,0x7d,
-  0x92,0xf1,0x8f,0x19,0xf0,0x94,0x65,0xbf,0x36,0xe1,0x47,0x7b,0x3e,0xde,0x30,0xe4,
-  0x3b,0x2a,0xd7,0xc3,0x91,0x78,0x7d,0xca,0x77,0xaa,0xfc,0x83,0xf0,0x91,0x78,0x43,
-  0x6a,0x61,0x4f,0xf9,0x20,0xb7,0xc7,0xef,0x28,0xdd,0x0c,0x7f,0x26,0xfd,0xf3,0x19,
-  0xf9,0x8b,0xd0,0x1d,0x9e,0xb1,0x23,0x3f,0x22,0xbf,0x2e,0xb6,0x51,0xf9,0xdf,0x96,
-  0x7f,0x6a,0xa2,0x60,0x7a,0xbf,0xcd,0xde,0x6b,0xb7,0x6f,0xc8,0x8e,0x7f,0x79,0xb5,
-  0xa6,0x4d,0xb0,0x07,0xbe,0x66,0x7a,0x4e,0x36,0xf9,0xe0,0x61,0x7d,0x46,0x7f,0x8c,
-  0x80,0xdf,0x2a,0x82,0x52,0xf7,0xa0,0xe9,0xb7,0xc7,0x47,0x95,0xf4,0xfe,0x4b,0x67,
-  0x9f,0x85,0x24,0xbe,0x24,0x2f,0xa0,0xda,0xd9,0x86,0x47,0x54,0xb7,0xff,0x39,0x83,
-  0x9f,0xc5,0x7e,0x1f,0x95,0x64,0x42,0xfe,0x57,0x5c,0x3f,0x93,0xcd,0x82,0x4e,0xb9,
-  0x8e,0x51,0xa0,0x4a,0x45,0x7d,0xeb,0x49,0xfb,0xcf,0x7f,0x9f,0xd1,0x0f,0x40,0x41,
-  0x8d,0x7a,0x73,0x21,0x97,0xfb,0x70,0x1b,0x55,0x6f,0x86,0xda,0x3e,0x37,0x02,0xaf,
-  0x49,0xf5,0xbd,0xeb,0x70,0xbf,0x6f,0x85,0x2a,0x92,0xcd,0x43,0x99,0xeb,0x6b,0x67,
-  0x81,0xae,0xe6,0x5f,0x26,0xd7,0xc1,0x00,0xd4,0xa5,0x7c,0x66,0xf1,0x66,0x04,0x42,
-  0x82,0xe6,0x61,0x19,0x3e,0x04,0x06,0xc7,0x9c,0xf7,0xf5,0x20,0xe2,0x9f,0x3f,0xa2,
-  0x91,0xea,0xda,0xe3,0x79,0x08,0x62,0xa9,0xca,0xbb,0x54,0x5f,0x7b,0x88,0x0c,0x71,
-  0xaf,0x37,0x99,0x3b,0x92,0xa6,0x76,0xb0,0x51,0x7b,0x3a,0x85,0xff,0x47,0x38,0x25,
-  0x78,0xfb,0x74,0x88,0xf1,0xca,0x98,0xa7,0x87,0xed,0x84,0x1f,0x5b,0xc3,0x46,0xd2,
-  0xa6,0x9c,0xa5,0x24,0xc3,0x7e,0xbf,0x25,0x3e,0x31,0x1b,0x5e,0xa9,0x88,0x73,0x8e,
-  0xfb,0xfd,0x9b,0xda,0x69,0xbd,0xe9,0x34,0x2d,0xed,0x88,0x07,0x74,0xe1,0x8a,0xcc,
-  0xe8,0x1f,0x8a,0x7f,0xd1,0xf3,0xfa,0x37,0xc8,0xd3,0x8c,0x7e,0xad,0x1e,0x2a,0x77,
-  0xc9,0x4f,0x96,0xbe,0xa9,0x37,0xf4,0xfd,0x24,0xc9,0xce,0xc1,0x99,0x20,0x02,0xc5,
-  0xee,0x8e,0x94,0x33,0x3e,0x31,0xf1,0xac,0x24,0xec,0xd7,0x47,0x68,0xad,0x9e,0x84,
-  0x7a,0x25,0x3f,0x17,0x1f,0x13,0xcd,0xd6,0xc0,0xd5,0x49,0xf9,0x77,0x09,0x01,0xad,
-  0x47,0xcb,0x53,0x15,0x17,0xc5,0xbf,0x36,0x15,0x1f,0x57,0xcf,0x6a,0x88,0x7f,0xba,
-  0xa5,0x97,0xe0,0x1c,0xaf,0x7f,0xc1,0xdf,0x2f,0xcf,0x40,0x44,0xdd,0x60,0xe1,0x1f,
-  0xfb,0x81,0xc9,0xff,0xf3,0x47,0xc2,0x3f,0x9b,0x9a,0x10,0x08,0xe9,0x73,0x47,0x3d,
-  0x67,0xd9,0x7b,0xb0,0x9a,0x97,0x8f,0x76,0xc4,0x02,0xf3,0x78,0x17,0x9e,0x9a,0xdf,
-  0x23,0x27,0x99,0xcb,0xff,0x63,0xad,0x07,0x0d,0xdf,0x7e,0x12,0x42,0x7d,0xea,0x1c,
-  0xf6,0x5e,0xee,0x3e,0x3c,0xd2,0xc5,0x59,0xbe,0xbd,0x1e,0x5c,0xf8,0x67,0x62,0xda,
-  0xc9,0x13,0x2f,0xc2,0xd9,0xe6,0x5f,0x37,0x3d,0xc9,0xa2,0x11,0xbc,0x7e,0xc0,0xcc,
-  0x8b,0x15,0xf9,0xb4,0x2e,0x45,0x40,0xa3,0x64,0x06,0xff,0x14,0x8e,0x68,0x76,0xfc,
-  0x45,0x3d,0xc5,0xeb,0x7b,0x7d,0xf8,0x75,0x34,0x9d,0x41,0xc1,0xef,0xeb,0x0a,0xb1,
-  0xf9,0x4c,0xe0,0x8d,0x5e,0xc3,0xe1,0xff,0x34,0x3e,0xa9,0x7c,0x20,0xbc,0x3d,0x34,
-  0x2d,0x84,0x8e,0xc8,0xdb,0x73,0x8e,0xf0,0x8f,0x29,0x3b,0xa1,0xd2,0xb1,0x4c,0x7c,
-  0xcd,0xf6,0xff,0x6c,0xea,0x38,0x5e,0x38,0x06,0x35,0x66,0x7e,0xb2,0x79,0x58,0x7a,
-  0x57,0x9b,0xda,0xef,0x23,0xfe,0xcf,0x0b,0xb6,0xff,0xc7,0xbe,0x9f,0xfe,0xb4,0x3f,
-  0x30,0x6f,0xa3,0x4c,0x0b,0xbb,0x1c,0xd1,0xf5,0x5d,0xc3,0xf0,0xab,0xb6,0xb9,0x83,
-  0xf9,0x9c,0x9d,0x65,0x74,0xff,0x08,0x84,0x3e,0x76,0xe2,0xe3,0x4e,0xfc,0x4b,0x63,
-  0x9f,0xe5,0xdd,0x42,0x11,0x35,0x45,0x20,0xc1,0xf5,0x93,0x11,0x35,0xb0,0x40,0x4d,
-  0xcf,0xcf,0xa8,0xfd,0xb4,0x88,0xdf,0x2c,0xff,0x4f,0xde,0x17,0x73,0x7f,0xaa,0x3e,
-  0x9e,0xf8,0xf2,0x70,0xe9,0xb7,0xd9,0x69,0x58,0xb1,0x61,0x71,0xea,0x33,0x4b,0xd8,
-  0x1b,0x7d,0x0f,0xa3,0xfd,0x46,0x3c,0x30,0xe2,0xc2,0x3f,0x16,0xff,0xc7,0x7b,0x05,
-  0xbb,0x19,0xba,0x13,0x75,0x66,0x7e,0x4d,0x33,0x5e,0xdf,0x08,0xbf,0xab,0x4a,0x1d,
-  0x5f,0xe7,0xcf,0x10,0x35,0x28,0x2c,0xbf,0x94,0x6b,0x8f,0x37,0xf2,0x2d,0xfc,0x23,
-  0xfd,0x4a,0x7e,0xb2,0xf1,0xbc,0x76,0x7d,0xbf,0x7f,0x0f,0xee,0x2e,0x3e,0x54,0x1a,
-  0x8e,0xfa,0x53,0xf2,0x59,0x95,0xfc,0x63,0x05,0xa3,0xae,0xe7,0xb5,0xe3,0x5f,0x05,
-  0x49,0xe1,0x4f,0xab,0x7f,0x59,0x7d,0xa2,0xcc,0x03,0x07,0x21,0x3c,0xb4,0x80,0x37,
-  0x1f,0x7f,0xeb,0x19,0xde,0x3d,0xce,0xff,0x93,0xf6,0x3f,0x07,0x2d,0xef,0x71,0x68,
-  0x40,0xad,0x62,0xa5,0xb0,0x42,0x99,0x76,0x50,0x8d,0x5e,0x76,0x96,0xaf,0xb2,0xfc,
-  0xc9,0x27,0x9c,0xe7,0x6d,0x13,0xf8,0x67,0x66,0xca,0xb3,0x08,0xb5,0xe5,0xe3,0xf8,
-  0xe0,0x9b,0xbe,0x15,0xa8,0x85,0xfb,0x62,0x65,0x29,0xb6,0xc8,0x78,0x83,0xff,0x10,
-  0x11,0x20,0xf9,0x7f,0x2e,0x8a,0x7f,0xa9,0xa5,0x81,0x01,0xa5,0x5b,0x27,0xb5,0xe3,
-  0x51,0xf5,0xb6,0xb7,0x96,0x98,0x57,0x54,0xe0,0x0a,0x7c,0xc0,0xd2,0xe7,0xaf,0x3a,
-  0xf7,0x93,0xf1,0xff,0xb0,0x61,0x38,0x6f,0xd4,0xf3,0x50,0x42,0xbe,0xde,0x73,0xd8,
-  0xac,0x6a,0xab,0x5c,0x2c,0x0f,0xc3,0xab,0x50,0x45,0xf8,0xe7,0x4c,0xc6,0xbf,0x64,
-  0xf3,0x7f,0xda,0xe4,0x94,0x6a,0xfb,0x7f,0x16,0x8c,0x19,0xf5,0x5a,0x0e,0x7f,0x20,
-  0xa5,0x0c,0x5f,0x8c,0x7f,0x2c,0x3c,0x50,0xb0,0x89,0xcc,0x22,0x1a,0xe2,0x82,0x78,
-  0x39,0x9a,0x45,0x72,0x83,0xac,0xc7,0xfd,0x5d,0xda,0x35,0xf4,0x8c,0x73,0x7d,0xc4,
-  0x3f,0x8a,0x30,0xbb,0x1b,0xd9,0x50,0x29,0x45,0x5b,0x44,0xd8,0x65,0x57,0x7b,0x60,
-  0x99,0x97,0x3c,0x12,0x14,0xe1,0x12,0xf1,0x2f,0xfb,0x67,0xf9,0x7f,0x42,0x86,0xe7,
-  0xfb,0xec,0x0f,0xb4,0xf0,0x28,0x5e,0x46,0xb0,0x67,0xea,0xdf,0x92,0xff,0xc7,0xc6,
-  0x3f,0x87,0xc7,0xc5,0xbf,0x2a,0xd3,0x6c,0x1f,0xc4,0x3f,0x88,0x34,0x84,0xff,0x27,
-  0x82,0x2b,0xb0,0x33,0x1d,0xff,0x6a,0x3a,0x94,0x63,0x5f,0x5f,0xe0,0x1f,0x56,0x97,
-  0x76,0xfb,0xdc,0x5a,0x2f,0x91,0xe0,0x1b,0x86,0x6a,0x7a,0xf0,0x32,0x1b,0xff,0x9c,
-  0x9f,0xe0,0xf0,0x79,0xf2,0xed,0x78,0x96,0x7c,0x52,0x3b,0x87,0xf8,0xa7,0x6b,0x7d,
-  0xf1,0x49,0xf8,0x93,0xf4,0x54,0x0b,0x1e,0x41,0x20,0x24,0x9e,0xb7,0xfc,0x3d,0x67,
-  0x3f,0x1b,0x4b,0xc7,0xbf,0xf2,0xe3,0x72,0x1f,0x9c,0x8a,0xd6,0x1b,0xca,0x86,0xae,
-  0x0a,0xf8,0x1d,0xcc,0x35,0x7c,0xad,0xf2,0x94,0x4d,0xe7,0xa0,0x8a,0x2e,0x75,0xd8,
-  0xd1,0x3f,0xe4,0xff,0x19,0x23,0xff,0x0f,0x2f,0x1a,0x25,0x47,0x90,0x16,0xe9,0xf4,
-  0xe8,0xb0,0x03,0x6f,0x83,0x25,0xd8,0x96,0xb6,0x31,0x10,0x44,0xa0,0xe7,0x58,0xb6,
-  0xff,0x67,0xa6,0x91,0xd7,0xaa,0xbd,0x0e,0xbb,0xa2,0xa1,0xd6,0x4d,0x1a,0xab,0x90,
-  0x56,0xe7,0xea,0xad,0x9e,0xb8,0xe7,0x06,0x3c,0xb5,0xd8,0x10,0xfe,0x1f,0x7b,0xfe,
-  0x29,0xfe,0x45,0x20,0x47,0x1d,0x64,0x27,0x61,0x9f,0x51,0xd9,0x88,0xf3,0x5f,0x21,
-  0x3d,0xa2,0x57,0x1a,0x3b,0xc8,0x11,0xf4,0x88,0x92,0x9b,0xed,0xff,0xd9,0x3a,0x91,
-  0x66,0x1b,0xef,0x7f,0x7d,0x3a,0x7a,0x15,0x8a,0xb3,0x29,0xd1,0x5e,0x08,0x1b,0x05,
-  0x04,0x84,0xf6,0x31,0xf2,0x77,0xe1,0xd2,0xb2,0xc7,0x2f,0x71,0xe2,0x5f,0x1d,0x84,
-  0x7e,0xeb,0x0c,0xbf,0x26,0x0f,0xb1,0x34,0xff,0x67,0xbb,0x76,0x0a,0x9e,0x10,0xf8,
-  0x27,0xe3,0xcf,0x11,0xf8,0xc7,0x9a,0xff,0xb0,0x2a,0x60,0x76,0x39,0xe2,0x1f,0xbd,
-  0x4a,0xf5,0xf3,0x62,0x9d,0xa5,0xfd,0x3f,0xec,0xa2,0xf8,0x97,0xba,0x63,0xc3,0xbb,
-  0xda,0x1a,0x0b,0xed,0xa8,0xda,0xfd,0x66,0x79,0xf2,0xca,0x44,0x7b,0x50,0x69,0x57,
-  0xc8,0xff,0xd3,0x94,0x21,0xb9,0x5a,0xf8,0x07,0xf1,0x4c,0xb4,0xe8,0x15,0x75,0x9b,
-  0xf5,0x75,0xf8,0x60,0x43,0x4b,0x82,0x7b,0xc3,0x01,0x9f,0xad,0x9f,0x99,0x83,0x6f,
-  0xb7,0x88,0xf8,0xd7,0x4c,0xfa,0x7e,0xcf,0xc3,0xc3,0xed,0xe2,0x6b,0xad,0x63,0x3f,
-  0x30,0xca,0x34,0xef,0x20,0xee,0x50,0x28,0x7e,0x8d,0x1b,0x13,0xc8,0xc4,0x77,0x44,
-  0xfc,0xab,0x2e,0x55,0x40,0x6e,0x9f,0x0f,0xcc,0x5d,0x29,0x7f,0x8d,0x3c,0x19,0x7e,
-  0xcb,0x67,0xe9,0xde,0xe5,0x72,0x01,0x7f,0xde,0xf2,0xff,0xb0,0xa9,0xf6,0xf5,0x6d,
-  0xfe,0x8f,0x88,0xee,0xbd,0xa6,0x5f,0x46,0xc4,0xc2,0x05,0x6c,0x1b,0x3d,0x66,0xd2,
-  0x3b,0xd2,0x2a,0x4c,0x61,0x58,0x3e,0xd0,0x69,0xaf,0x07,0xdc,0xbf,0x0b,0xff,0x8f,
-  0x6f,0x9f,0x5c,0x69,0x5c,0x30,0x1b,0x52,0x0b,0x4e,0x7d,0xfa,0x0d,0xf3,0xc8,0x86,
-  0xea,0x28,0x9a,0xad,0x7f,0x53,0x8f,0x58,0xd4,0x8e,0xa3,0x19,0xfc,0x93,0xd6,0x3f,
-  0xea,0xb7,0xe4,0x2f,0xe0,0x83,0xe7,0x0f,0xa9,0xcb,0xe5,0xdb,0xa3,0xbf,0xe5,0x8f,
-  0x85,0xbc,0xcb,0x8b,0x85,0x3f,0xd9,0x2c,0x58,0x8e,0x16,0xca,0x59,0x0f,0xb0,0x59,
-  0xdb,0x4b,0xfe,0xc0,0x97,0xf0,0xe9,0xf6,0x1a,0x21,0x93,0x60,0x4f,0xec,0x67,0xd1,
-  0x29,0x92,0x77,0x74,0xeb,0x66,0xbe,0x4a,0x13,0xfb,0x35,0x53,0xb7,0xc7,0xdb,0xfe,
-  0x9f,0x60,0x98,0x59,0x8a,0x1d,0x61,0xcf,0x7d,0xf0,0x80,0x54,0x01,0xde,0x9a,0x76,
-  0x0b,0xff,0xe0,0xc6,0x36,0xb3,0x7f,0x1c,0xcb,0x11,0xcf,0xcb,0x7d,0xc9,0xe2,0x90,
-  0x76,0x81,0xf0,0x4c,0x92,0xbd,0x08,0xaf,0x19,0x3f,0x90,0xfc,0x4f,0xca,0x4f,0x0a,
-  0xfb,0xe2,0x75,0xf3,0x07,0xac,0xf8,0x57,0x1d,0xf7,0x6f,0x94,0xdf,0x4f,0x87,0x05,
-  0x11,0x28,0x9e,0xa1,0x78,0x74,0xb2,0x79,0xa4,0xe4,0x8c,0x54,0x6f,0x4e,0x4e,0xca,
-  0xc3,0x2e,0xfe,0x80,0x30,0x6a,0xdc,0x77,0x12,0x77,0x1f,0x17,0xa4,0xbb,0xd1,0x1e,
-  0xc9,0x67,0x2b,0xde,0x84,0x79,0x80,0x42,0x48,0xc4,0xbf,0x3e,0x3d,0xda,0xdc,0xdf,
-  0x62,0xdf,0x4f,0xda,0xff,0xc3,0xd5,0x3d,0xed,0x1f,0x20,0x8c,0x09,0x50,0xfc,0x6b,
-  0x44,0xd9,0x16,0x0b,0x80,0x27,0x3c,0x61,0x29,0xd9,0x2f,0x04,0x42,0x81,0xe1,0xf1,
-  0xf1,0x2f,0xae,0xf2,0xa6,0x14,0xdf,0x2d,0x11,0x5f,0x17,0x61,0xcf,0x8f,0xf9,0xf4,
-  0x52,0xb5,0xbb,0x69,0x81,0xea,0xc4,0xbf,0xb2,0xf9,0x3f,0x95,0x09,0xb5,0xaa,0x68,
-  0xc0,0x7c,0x40,0x0b,0xf6,0x07,0xab,0xd8,0x08,0x6b,0x9b,0xa2,0xab,0xf8,0x87,0x16,
-  0x58,0x40,0x08,0xf1,0x8f,0xa3,0x7f,0xda,0xf3,0x97,0xaa,0x62,0x7e,0xf6,0x74,0xbc,
-  0x4f,0xd1,0xc0,0x03,0xbe,0xdd,0x1d,0x88,0xf7,0xca,0x6a,0x4b,0x7c,0xdd,0xde,0x3a,
-  0x78,0x81,0xe1,0x0c,0x74,0xcb,0xa6,0xb3,0xa0,0x13,0x3f,0x39,0xab,0xd1,0xf3,0xce,
-  0xbc,0xab,0x63,0xcc,0xf8,0x99,0x4e,0xe8,0xa8,0xf8,0x2c,0x7c,0x54,0x72,0xbd,0xcf,
-  0x3f,0x4b,0x3e,0x1b,0x3d,0x53,0x88,0xf6,0xfd,0xc3,0xe6,0xe1,0xce,0xf1,0xf8,0xa7,
-  0xe0,0x84,0xfc,0x24,0x1f,0x69,0xab,0x7a,0xd6,0xa7,0x96,0x2f,0x37,0xce,0xe8,0x0d,
-  0xcf,0x14,0x10,0xed,0xe7,0x85,0xb4,0xff,0xc7,0x99,0x7f,0x2b,0xfe,0x85,0xeb,0xe1,
-  0x43,0x56,0x67,0xc6,0x78,0xa0,0x57,0x8d,0xb1,0x20,0x7f,0x3a,0x3e,0xb3,0xff,0x70,
-  0x0f,0xfb,0xa3,0xb2,0xce,0x08,0xa4,0xee,0xef,0x61,0xa3,0xce,0xfa,0xef,0x4f,0xfb,
-  0x7f,0xf0,0xa5,0xaf,0x0d,0xef,0x80,0xa8,0xe9,0xe1,0x2c,0xa2,0x75,0x48,0xa1,0x03,
-  0x5d,0x61,0x36,0x6c,0x74,0x34,0x05,0xcd,0xf9,0xe1,0xc0,0x89,0xf1,0xfc,0x67,0x9c,
-  0xc6,0x2b,0x42,0xa8,0x88,0x9a,0xcc,0x47,0xdb,0x61,0xba,0xbe,0x1f,0xbe,0x4e,0xd3,
-  0x38,0x8c,0x40,0xf4,0x51,0x7a,0x23,0x29,0xe7,0xfd,0x2a,0x13,0x1d,0xfb,0xbb,0x13,
-  0x86,0x59,0xb8,0x37,0x57,0xd9,0xf6,0x55,0x0b,0x21,0x0b,0xa2,0xb2,0xf0,0x07,0x16,
-  0xa7,0x1c,0xfd,0x60,0xfb,0x7f,0xd6,0x51,0x74,0x75,0xb3,0xfa,0x74,0x6f,0xbe,0xd9,
-  0x3c,0xe6,0xb3,0x22,0x62,0xcd,0xc3,0x9a,0xe5,0x08,0x92,0x8f,0xb6,0xda,0xe3,0x6d,
-  0xfc,0xe3,0x0b,0xcb,0xa1,0xa6,0x17,0xe0,0xde,0x7e,0x54,0x3b,0x8f,0xe0,0xb4,0x08,
-  0xa0,0xf5,0x8f,0xf0,0x8c,0x15,0x08,0xcb,0xe0,0x01,0x33,0xed,0xff,0x51,0x47,0x59,
-  0xbd,0x22,0x99,0x33,0xfb,0xbd,0xf7,0x05,0x96,0x94,0xae,0x43,0x8d,0xa1,0x26,0xa5,
-  0xfe,0xd8,0x9b,0x06,0x39,0x12,0x8b,0x3e,0x1e,0xc7,0xff,0xa9,0xa4,0xef,0xa5,0x12,
-  0xb8,0x19,0x1a,0xf4,0xe6,0xa1,0x35,0xef,0x50,0xc4,0x87,0x73,0x83,0xde,0xd1,0xa8,
-  0xe3,0xfc,0xa0,0x85,0xb6,0xd7,0xcf,0x68,0x1a,0xff,0xa8,0xcb,0x59,0x81,0xd1,0x19,
-  0x9b,0x31,0x34,0xff,0x20,0x7b,0x55,0x5a,0xc5,0xbf,0x86,0x1f,0x32,0x22,0x04,0xc4,
-  0x03,0xc3,0xde,0xe5,0x55,0x67,0x75,0xfb,0xfa,0x16,0xff,0x07,0xef,0xff,0xfa,0xd9,
-  0x05,0x86,0xa9,0x85,0x46,0xbc,0xd3,0xe4,0x1d,0xf0,0x4c,0xa2,0x7e,0xc4,0x57,0x23,
-  0xdf,0x0c,0x2f,0x6c,0x0f,0x0f,0x5f,0x7d,0x7d,0xf1,0x4b,0x19,0xfe,0x73,0xbe,0xcd,
-  0x0f,0x97,0xcf,0xa1,0x36,0x6e,0x20,0x58,0x58,0x03,0x17,0x5a,0x1b,0xcc,0x7f,0x1b,
-  0x2d,0xc6,0x53,0xba,0xe5,0xff,0x61,0xf6,0xfc,0x67,0xf8,0x3f,0x1d,0x23,0xbc,0x1f,
-  0x67,0x7b,0x6d,0x5c,0x0e,0x4b,0x67,0x78,0xd5,0xa0,0x2f,0xf9,0xa9,0x14,0x9c,0x49,
-  0x89,0xf9,0xc9,0xd8,0x3b,0x1b,0xff,0x78,0xff,0x89,0x9d,0xd3,0x3a,0x61,0xc6,0x51,
-  0xd5,0x28,0xda,0x04,0xbb,0xa3,0x65,0x87,0x66,0x2c,0x43,0x6d,0xfe,0xc3,0x25,0x16,
-  0xfe,0xa9,0xb0,0xaf,0xcf,0x1d,0xfe,0x4f,0xd5,0x1b,0x9d,0xab,0x62,0x4b,0x53,0x6a,
-  0x3f,0xfb,0xa2,0xb2,0x37,0x31,0x05,0x9f,0x37,0xf7,0x55,0xd8,0xcd,0x1f,0x4c,0x5d,
-  0xb1,0x1c,0xbf,0x2f,0x7b,0xfe,0x2d,0xfc,0x93,0x66,0x2f,0xb4,0x19,0x38,0xb1,0xaa,
-  0x70,0xfb,0x54,0x20,0xb0,0x64,0x07,0xf5,0x07,0x58,0x85,0x79,0x25,0xed,0xbf,0xb2,
-  0xf9,0x3f,0x95,0xc2,0xdb,0x03,0x87,0x11,0xff,0xf8,0x16,0xcb,0xcb,0x95,0xd3,0x4a,
-  0x35,0x11,0xa1,0x4f,0x09,0x8f,0x50,0x41,0x02,0xf5,0x8f,0x7d,0x3f,0x19,0xfe,0x73,
-  0x53,0x2f,0x1b,0xab,0xa8,0x97,0xfc,0x2b,0xbe,0x94,0x88,0x92,0xff,0x87,0x2c,0xd4,
-  0xc4,0xb4,0x23,0xe8,0xc0,0x45,0xfc,0x9f,0x19,0xc4,0x8f,0x25,0x5a,0x48,0xfe,0xc6,
-  0x0e,0xb2,0x80,0x75,0xc6,0xd7,0xe3,0xf2,0x1f,0x94,0x34,0xfe,0xc9,0x8c,0xb7,0xfd,
-  0x3f,0x68,0x76,0x1f,0x94,0xdb,0xb4,0xea,0x56,0x04,0x42,0x08,0x63,0x72,0x2b,0x8d,
-  0x17,0xe3,0x81,0x77,0x60,0x9f,0xfa,0x17,0xf8,0x3f,0x44,0xfb,0x81,0xd5,0x70,0x57,
-  0xd3,0xea,0x78,0xee,0x90,0x7d,0x85,0x11,0xe2,0x1f,0x5a,0x7c,0x15,0xfb,0xfd,0xda,
-  0xfc,0x1f,0x95,0xa2,0x5d,0x6d,0x50,0x11,0x51,0xc3,0xb9,0x2d,0x5c,0x00,0x21,0xc1,
-  0xff,0xd1,0x2f,0xcd,0xff,0x29,0xf1,0xad,0xc0,0xfd,0x57,0x4c,0xaa,0x2a,0xb9,0x8f,
-  0xcb,0xc7,0x22,0x68,0x91,0x4b,0x3c,0x04,0x84,0xc6,0x2c,0x22,0xd0,0x71,0x67,0xfd,
-  0x6c,0xba,0xdc,0xf1,0xff,0x0c,0x19,0x4f,0xb3,0xfa,0x96,0x75,0xcb,0xe4,0x3d,0x2d,
-  0xa7,0x8a,0x26,0x0b,0xff,0x0f,0x79,0x84,0xe8,0x79,0x4f,0xc8,0x0e,0x5e,0x2a,0x4c,
-  0xd3,0xa2,0xd6,0xcb,0xd7,0xf2,0xb7,0xa1,0x61,0xc1,0x67,0x11,0xf6,0x74,0x9e,0x0a,
-  0x56,0xb5,0xfa,0xc8,0x5f,0xf4,0xa2,0x51,0x65,0xac,0xcb,0xf2,0xff,0x88,0xf8,0x57,
-  0xbd,0xaa,0xae,0xb8,0xab,0x8c,0xc7,0x24,0xe1,0xff,0x29,0xe3,0x3d,0x46,0x40,0x42,
-  0xe1,0x58,0x13,0x05,0xc2,0xae,0xe4,0xf8,0x21,0x8c,0x8b,0x7f,0x35,0xe1,0xf3,0xde,
-  0xa0,0x6d,0x81,0xd0,0x22,0x9c,0x96,0x1c,0x3c,0x92,0x68,0x55,0xb5,0xa2,0x3e,0x68,
-  0x6b,0x89,0x1a,0x57,0x5e,0x82,0xff,0x43,0xb3,0xb7,0x98,0xb6,0xbd,0x28,0x40,0x85,
-  0xbe,0x8f,0x05,0x04,0xfe,0x69,0x5c,0x2d,0x05,0xc6,0xf1,0x7f,0x72,0x2c,0xfc,0x83,
-  0x77,0xbb,0x18,0xde,0x35,0x11,0xff,0x6c,0x92,0xa7,0xe2,0x13,0x51,0x58,0x53,0x7e,
-  0x47,0x21,0x22,0x93,0x37,0x2e,0x0f,0x57,0xd8,0xeb,0xd3,0xc2,0x3f,0xb5,0xc6,0x4c,
-  0x4d,0xee,0x84,0x53,0x3a,0xe2,0x9f,0x1f,0xcd,0xff,0x07,0xf5,0x43,0xb1,0x0c,0x18,
-  0x22,0x40,0xdf,0x53,0x34,0x3f,0xaf,0x3a,0xfe,0x9f,0x20,0x58,0xfe,0x1f,0x1f,0x97,
-  0xa3,0x04,0x7b,0xe0,0x6a,0x2e,0x5b,0x47,0x42,0xbc,0x39,0x65,0x10,0xfe,0x59,0xc8,
-  0x8b,0x0f,0x75,0x3a,0xe3,0x05,0xfe,0xa9,0x25,0x6f,0xcf,0x75,0x45,0xf7,0x1b,0x5f,
-  0xe0,0xde,0x68,0x51,0x50,0x12,0x88,0x28,0x21,0x3f,0x01,0x87,0xdb,0x2a,0x09,0xea,
-  0x1f,0x72,0xb2,0x6a,0x82,0x92,0xa3,0x7f,0xe6,0xeb,0x71,0x49,0xdf,0xe2,0x55,0x03,
-  0x6b,0x55,0x3a,0x22,0x02,0x37,0x3f,0x36,0x04,0xff,0x70,0x3c,0xff,0x67,0x9a,0xa9,
-  0xd6,0xb0,0x3c,0xd8,0xcc,0xa7,0x34,0x79,0xcd,0xf6,0xcd,0x7c,0x2f,0x7c,0x6d,0x40,
-  0x5d,0x96,0xbb,0x51,0x5b,0x65,0x08,0x3c,0xd0,0x6f,0x18,0xb6,0x7e,0x10,0xf8,0x07,
-  0xf1,0xc9,0x3d,0xf2,0x17,0xd9,0x6f,0x78,0x59,0xc2,0xbb,0xbc,0xf9,0x67,0x14,0x11,
-  0x1b,0xf2,0x21,0x22,0x2a,0xf9,0xf7,0x76,0x81,0x7f,0x0e,0xd9,0xb7,0x9f,0xc6,0x3f,
-  0xb5,0x43,0xfe,0xa7,0xf0,0x7b,0xdc,0xc1,0x70,0x75,0x25,0xe4,0xa5,0x9c,0x88,0xbe,
-  0xe4,0xc6,0xd7,0x4e,0x29,0x42,0xd5,0x67,0xf0,0x8f,0xcd,0x7f,0xf6,0xfd,0xf2,0x99,
-  0x80,0xd1,0x17,0x9f,0x5b,0xe1,0xf7,0xca,0x17,0x70,0xdb,0x5e,0x3f,0xe4,0x1b,0x93,
-  0x9f,0x33,0xde,0xec,0x9c,0x4b,0xf8,0x67,0xb0,0x3d,0x9b,0xff,0x33,0xb3,0x4f,0xed,
-  0x91,0x6f,0x8a,0x77,0xc6,0xca,0x7a,0xbd,0x11,0xf9,0x76,0x78,0x18,0xea,0xfb,0xf1,
-  0xfe,0x9f,0x33,0xd6,0xb5,0x22,0x02,0xac,0x91,0x7f,0x6e,0xd8,0xd7,0xb7,0xfd,0x3f,
-  0xd3,0xbe,0xcd,0x14,0xf3,0x17,0xe1,0x32,0xc9,0xfb,0x8d,0xdc,0xd7,0x71,0xfc,0x8c,
-  0xfe,0xbc,0x65,0xec,0xe5,0xc4,0x0f,0xe1,0x41,0xd3,0x7b,0x0f,0xcb,0xf8,0x5b,0x6c,
-  0xfc,0x93,0x47,0x61,0xc4,0x04,0xdf,0x4a,0xfe,0x9f,0x85,0xc2,0xe3,0x81,0x47,0x9e,
-  0x43,0xfc,0x53,0x41,0xaa,0xe9,0xc7,0x8e,0x7d,0x4c,0x4c,0xb4,0xe2,0x7d,0xf9,0xa3,
-  0x72,0x10,0x8e,0x99,0xb8,0xdb,0x6a,0x7b,0xe0,0x9c,0x4e,0x44,0xa0,0xbc,0xa4,0x7c,
-  0x98,0xf8,0xa5,0xf8,0xe0,0xcd,0xef,0x39,0xcf,0x6b,0xf3,0x7f,0x6e,0x4e,0xc2,0x12,
-  0x6d,0x53,0x05,0x69,0x9b,0xe2,0x11,0xe9,0x3b,0xac,0xd6,0xac,0x24,0xda,0xcf,0x19,
-  0x49,0xc4,0xbf,0x86,0x32,0xfa,0x24,0xc3,0x7f,0x5e,0xae,0x1d,0x91,0x66,0xb7,0x2d,
-  0x30,0xcb,0x37,0xeb,0x6f,0x2a,0xe2,0x2f,0x9e,0x84,0x37,0xb9,0xb0,0x77,0x29,0x87,
-  0xff,0xd3,0x69,0xf3,0x7f,0x92,0x2c,0xe6,0x59,0x03,0xd5,0x86,0xaa,0x32,0xcb,0x23,
-  0x71,0x65,0x92,0xbd,0xa5,0x77,0x00,0xb3,0xfc,0x3f,0xe3,0xf9,0x3f,0x68,0xdf,0x75,
-  0x72,0x53,0x30,0xcf,0x5a,0x0a,0x9c,0xb1,0x4a,0xf3,0xf2,0x24,0x6e,0x13,0x7e,0xac,
-  0x4f,0x25,0x22,0x74,0xca,0x7e,0xbd,0x76,0xfc,0xab,0x17,0x41,0xce,0xea,0xce,0x36,
-  0xb5,0x82,0xdf,0xd4,0xd6,0xbe,0x16,0xb6,0x69,0xbe,0x81,0xf9,0x61,0x66,0x9a,0xc2,
-  0x51,0x3f,0xab,0xfd,0x40,0x9b,0x3d,0xde,0xe6,0x3f,0x17,0xfc,0x69,0xdb,0x14,0xfe,
-  0x82,0x54,0x05,0x95,0xed,0xf2,0xeb,0x68,0xd6,0x1b,0xfa,0xf3,0x92,0xc5,0x6f,0xc7,
-  0x5f,0xd3,0xaa,0x07,0xfd,0x8f,0xcb,0x19,0x7c,0x95,0xb8,0x3c,0xfd,0xbc,0x27,0x28,
-  0x5a,0x01,0x57,0x1f,0xc8,0x3f,0x20,0xe2,0x3b,0x0d,0x03,0xfe,0x13,0x1d,0xa3,0xad,
-  0xe7,0xe1,0xfa,0x43,0xfe,0xd1,0xf2,0xe1,0x15,0xd9,0xf8,0xe7,0x7a,0xd3,0xdf,0x23,
-  0x8f,0xf0,0x37,0x35,0x81,0x76,0x9e,0x82,0x0b,0xe1,0x2a,0x5c,0x96,0xcd,0x4b,0xf9,
-  0xf3,0x14,0x1f,0xec,0x91,0xc3,0x99,0xf8,0x23,0x20,0xfe,0x81,0xc0,0x49,0x62,0x3b,
-  0xa7,0xfc,0x30,0x3d,0x85,0xe8,0xb4,0x12,0x7a,0x0c,0x4f,0xd4,0xd7,0x13,0x98,0x47,
-  0x81,0x78,0x53,0xed,0x61,0x89,0x0c,0xff,0x59,0xe0,0x9f,0x60,0x6f,0x9a,0xdf,0x92,
-  0xde,0x5f,0xec,0xbe,0x41,0xef,0xc5,0xf9,0xfc,0x2c,0x1e,0x49,0xd0,0x87,0x36,0x7d,
-  0x1c,0xfe,0x11,0x20,0x81,0xe2,0x8f,0x22,0xec,0x15,0xc2,0x2f,0x7a,0xba,0x51,0xb8,
-  0x09,0xf1,0xe1,0x9a,0x18,0x21,0xcc,0xa6,0x64,0x86,0x9f,0x96,0x33,0x62,0x07,0x3d,
-  0x89,0x8d,0x4c,0xd6,0xd6,0x8b,0x2b,0x0a,0xd5,0x66,0x57,0x5d,0xc7,0x52,0xf6,0x0c,
-  0xef,0x36,0xd4,0xa4,0x0c,0x19,0xfc,0x53,0x48,0xfc,0x9f,0x34,0x9b,0xf7,0x7b,0xd6,
-  0xc2,0x78,0x12,0x31,0x72,0x43,0xa3,0x8f,0xec,0xfb,0x79,0xa8,0x33,0x67,0x8e,0xca,
-  0x63,0x8e,0x3f,0xd0,0xc1,0x3f,0x78,0x7d,0xf9,0x05,0xa8,0xea,0xf3,0x89,0xb0,0xd7,
-  0x0d,0xf5,0xc6,0xc2,0xc7,0xbd,0x21,0xfd,0x05,0x22,0x3a,0x5e,0xec,0xff,0x21,0xb4,
-  0x43,0x34,0x39,0x08,0xa4,0x08,0x0f,0x6b,0x4f,0xe0,0x46,0xbe,0xa0,0x87,0xd5,0xa9,
-  0xaf,0xf2,0x00,0x3d,0x6f,0xc6,0xbf,0x61,0xe2,0x7a,0xd8,0x6f,0x6d,0x13,0x28,0xba,
-  0x57,0x41,0xe3,0x69,0xc6,0x96,0x9a,0xde,0x6b,0x85,0x7f,0x2c,0x41,0x4b,0x2b,0xe3,
-  0xff,0xd1,0x61,0x32,0xcc,0xb5,0xf0,0xcf,0x1b,0xbc,0xa3,0x73,0x4a,0x4a,0x25,0x1a,
-  0xcc,0x63,0x89,0x19,0x4b,0xbc,0xdf,0x66,0x93,0xcd,0x1f,0x26,0xca,0xf0,0x08,0x22,
-  0x28,0xfb,0x17,0x29,0xb5,0xf8,0xcf,0xbe,0x9a,0x2f,0x1d,0x56,0xb6,0xc1,0x9c,0x54,
-  0xb0,0x56,0x1e,0x80,0x8f,0xda,0xbf,0x7b,0xcc,0x5f,0xdb,0x5c,0x99,0x7a,0x26,0x11,
-  0x36,0x2b,0x6b,0xdd,0xfe,0x9f,0x49,0x0e,0xfe,0x19,0x81,0x37,0xd5,0xeb,0xcc,0x09,
-  0x49,0xe1,0x16,0xab,0x37,0x0a,0x52,0xc5,0x67,0xef,0xc1,0x53,0x7d,0xfe,0x0f,0xe5,
-  0x41,0x67,0x7f,0xa4,0x66,0xe6,0xff,0x78,0xea,0xb5,0x48,0xfd,0x31,0x9f,0x45,0x3b,
-  0xef,0x8e,0xa2,0xf0,0x35,0x5c,0xa8,0xdd,0x86,0x8f,0xe2,0xf5,0x0e,0x7f,0x46,0xe8,
-  0x4f,0x01,0x72,0x5e,0x6f,0x9f,0xa0,0xe3,0x46,0x8c,0x1c,0x41,0x8f,0x41,0x99,0xe1,
-  0x59,0xc6,0x7c,0xdb,0x57,0xc1,0xb5,0x74,0xe4,0x55,0x07,0x6f,0x58,0xf1,0xaf,0x74,
-  0x74,0x6f,0xd5,0x8a,0x6b,0x8e,0x95,0x12,0xcc,0x7b,0x98,0x97,0x2f,0xcb,0x1b,0x63,
-  0x77,0xc4,0xb7,0xf1,0x60,0x14,0xa7,0x22,0xc3,0x3f,0x5c,0x22,0xf4,0x8f,0x8e,0xeb,
-  0x2d,0x80,0xeb,0x4d,0x4a,0xbb,0x9d,0xf7,0x2b,0xba,0xd1,0x75,0x2d,0x2e,0xbc,0x2e,
-  0x4b,0xd5,0xbb,0xe2,0x5f,0x39,0x84,0x7f,0x6a,0x2d,0xfc,0x73,0x08,0xd1,0x4e,0x88,
-  0x84,0xe3,0x50,0x95,0xc8,0x1b,0x91,0x97,0xb0,0xe3,0x6a,0x6d,0xc2,0x97,0x90,0xcf,
-  0x64,0xf0,0x55,0xa1,0x9d,0x8f,0x33,0x21,0x9d,0xf6,0xc5,0x8b,0x2d,0x44,0x54,0xc0,
-  0x3b,0xd0,0x34,0x1b,0xd5,0x0a,0xf1,0x7f,0x9c,0xf5,0x60,0xc5,0xbf,0x04,0xe9,0x45,
-  0xf0,0x5d,0xa3,0x7e,0xf2,0xff,0x9c,0xc2,0x69,0xc9,0xff,0x97,0x2b,0x11,0x11,0x6d,
-  0xab,0x32,0xd6,0xc6,0x5d,0xfe,0x31,0x0e,0x84,0x67,0xc8,0xc8,0xa2,0x12,0xfb,0x11,
-  0xa3,0x40,0x98,0xf0,0xe7,0x04,0x8c,0xfb,0x27,0xc9,0x5f,0x86,0x47,0xda,0x03,0xe4,
-  0xe1,0x19,0x76,0xde,0x2f,0xe1,0x9f,0x5d,0x69,0xfe,0x8f,0x24,0xe2,0x5f,0x71,0xb6,
-  0x3d,0x67,0xbf,0x14,0x30,0xae,0xdc,0x18,0x50,0x12,0xab,0xd5,0x00,0x79,0x30,0x0e,
-  0x3b,0xe3,0x2d,0xfc,0x13,0x24,0x6f,0x4f,0xdf,0x5a,0x0b,0xed,0x5c,0x46,0x61,0x2f,
-  0x1d,0x05,0x68,0xe1,0x5b,0x74,0x9d,0x02,0x61,0x2e,0xfc,0x73,0x55,0x14,0x46,0x6d,
-  0xb6,0x73,0xcd,0x2d,0x95,0xb0,0x6e,0x45,0x59,0x02,0x8f,0x88,0xb4,0xa3,0xb2,0x48,
-  0x7f,0x6b,0x37,0xe5,0x7f,0xbd,0x93,0xab,0x39,0xe3,0xe9,0xe9,0xaa,0x11,0xed,0x34,
-  0x6f,0x6f,0x7d,0x45,0x9b,0x47,0xe8,0x65,0x08,0xce,0x69,0x57,0x19,0x6b,0x5b,0xe5,
-  0xa1,0xc8,0x39,0xed,0x69,0x91,0xff,0xe5,0xe0,0xe7,0x1a,0xe1,0xff,0xa9,0xbd,0x89,
-  0xe6,0x47,0xff,0x16,0xcc,0x26,0x62,0x70,0x05,0x9c,0x5a,0x4c,0x19,0x64,0xcd,0x73,
-  0x8c,0x17,0x83,0x55,0x5f,0xcc,0x1f,0x94,0x0f,0x39,0xe3,0x4b,0x81,0xf0,0x4f,0x35,
-  0x25,0x79,0x1d,0xd3,0x7a,0x74,0x06,0xde,0xf6,0x22,0x1d,0x7a,0xa2,0x95,0xe0,0x4d,
-  0x30,0xde,0xbe,0x23,0x1a,0xd0,0xd4,0xf1,0xf1,0xaf,0x5d,0xc1,0xa0,0x60,0x77,0x27,
-  0xd6,0x47,0xe8,0x31,0xdb,0x15,0x69,0x57,0x4b,0xa8,0x71,0x3e,0x01,0xa1,0x36,0x55,
-  0x37,0xf2,0xb2,0xfc,0x3f,0x25,0xdb,0x55,0x6b,0xfe,0x03,0x43,0x0a,0x0a,0x8d,0x5e,
-  0x02,0x96,0xfb,0x4a,0x70,0x86,0x93,0x6c,0x3b,0x3c,0xa2,0x6d,0x25,0x46,0xf4,0x73,
-  0xce,0xfb,0x4a,0x28,0xf4,0x7e,0xa7,0x5b,0xd1,0xcc,0xbf,0x23,0x6f,0x55,0xdc,0x9b,
-  0x76,0xeb,0x6d,0x24,0xc4,0x8b,0x47,0xf2,0x11,0xff,0x38,0xfe,0x81,0x25,0x76,0x3c,
-  0x94,0xc6,0x7f,0x08,0x4f,0x65,0x68,0xcf,0xeb,0x36,0x93,0x07,0x8c,0xd7,0x51,0x20,
-  0xec,0xa5,0x0c,0x9e,0x71,0xf8,0xcf,0x82,0x7f,0x55,0x95,0xa6,0x3d,0x5b,0x47,0x12,
-  0xba,0x09,0x22,0x10,0x96,0xc1,0x3f,0xaa,0xe2,0xe4,0x7f,0x0d,0xb3,0x35,0x10,0xd8,
-  0xe6,0x4d,0x14,0x0d,0x2b,0xe2,0xc8,0xe2,0xe2,0x6f,0xc1,0x2f,0xd0,0x22,0x7b,0xdc,
-  0xf1,0x2f,0x15,0xf7,0x5f,0xfb,0x2d,0x27,0x0f,0x85,0x69,0x2a,0x0c,0x21,0x88,0xb4,
-  0x8b,0xd9,0xec,0x3e,0xe8,0xe0,0x3a,0x7d,0x41,0x07,0x5c,0xf9,0x17,0xf8,0xfd,0x5a,
-  0x24,0xe7,0x37,0x8c,0x87,0xa5,0x29,0x86,0xf7,0x1b,0xec,0x75,0x49,0x1c,0x89,0xb2,
-  0xdb,0xf5,0x6d,0x6a,0x59,0x9f,0xc7,0x8d,0x7f,0x82,0xa5,0x88,0x7f,0xfa,0x05,0xc8,
-  0x39,0x5c,0xf1,0x41,0xf7,0x94,0x63,0xfe,0x6f,0x77,0xbc,0xa1,0xfe,0xf6,0xd0,0xbc,
-  0xd4,0xc2,0xe5,0xe5,0x3f,0x85,0xe7,0xf9,0xec,0x14,0x02,0xa1,0x4c,0x3e,0x9a,0xe0,
-  0xff,0xa4,0x68,0x3f,0xf5,0xe9,0x0f,0xd6,0xbe,0xd6,0xfa,0x44,0x9a,0xd6,0x2b,0x55,
-  0x92,0xb0,0x53,0x39,0x63,0xf3,0x09,0xed,0xf5,0x10,0xcd,0x49,0xc7,0xbf,0x4e,0xc9,
-  0xf7,0x1a,0x67,0x92,0xb3,0x53,0x0b,0xc6,0xca,0xc9,0xa2,0xcd,0x1e,0xc2,0xbf,0x78,
-  0xaf,0x79,0x84,0xef,0x46,0x90,0x2e,0xbb,0xf8,0x36,0x52,0x7a,0xff,0xf5,0x6d,0x76,
-  0x07,0xff,0xc3,0xe3,0xd0,0xa2,0x5e,0x8f,0xfa,0xe7,0xf7,0x30,0x6d,0x38,0xaf,0x2a,
-  0xf7,0xa7,0xd0,0xa5,0xff,0x8d,0x99,0xbf,0x8c,0xbd,0x97,0x89,0x2f,0x10,0xfe,0xe1,
-  0x38,0xfe,0x6e,0x76,0x07,0xfe,0xc3,0x72,0x53,0xbd,0xc7,0xa2,0x3d,0xf7,0x77,0x2d,
-  0x2b,0x52,0xfb,0x56,0xc1,0x97,0x0f,0xa0,0xbe,0xca,0xec,0xbf,0x0c,0x87,0x7f,0x88,
-  0xd6,0x8a,0xfc,0x69,0xa4,0x7f,0xa4,0x6d,0x6a,0x70,0x28,0x2f,0xdc,0x3e,0x40,0x0c,
-  0xab,0x14,0x02,0x21,0xb7,0xff,0x7c,0x27,0x08,0x7b,0x94,0x04,0xe2,0x27,0x77,0x1b,
-  0xa1,0x51,0x18,0xd1,0x2e,0x1c,0x08,0x10,0x2d,0x73,0x29,0x6e,0x54,0x89,0x88,0xcb,
-  0x32,0xfb,0xaf,0x84,0x36,0x22,0xd9,0xf1,0x0e,0x9a,0x0d,0xc3,0x9a,0x1f,0xad,0xde,
-  0xcc,0xdf,0x35,0x81,0x0c,0x9f,0x98,0xb1,0x61,0x87,0x7f,0x25,0x65,0xf0,0x0f,0x09,
-  0xd7,0x47,0xf2,0xad,0xc0,0x07,0x1d,0xf9,0xd2,0x1e,0x38,0x8c,0x1a,0x3e,0x74,0x71,
-  0xfe,0x97,0x15,0xbd,0xd2,0x2c,0x62,0x8f,0x6c,0x21,0x9c,0xf9,0x4f,0x7a,0x42,0xda,
-  0xa3,0x37,0x05,0xcc,0x08,0xe2,0x9f,0xf1,0xfc,0x9f,0x4c,0xb4,0x2b,0x8f,0x04,0xaf,
-  0xc8,0x00,0x62,0x6b,0xa3,0x5d,0x5a,0xc0,0xe2,0xff,0x38,0xef,0x17,0x7c,0x4e,0x7e,
-  0x4a,0xdb,0xee,0x0a,0xd4,0x3f,0xd5,0xa8,0xa8,0x77,0x97,0x84,0xfa,0xbd,0x73,0x58,
-  0xfe,0x0f,0x1e,0xb1,0xf0,0x40,0xc6,0xff,0x03,0xa5,0x4b,0xf1,0xb6,0xf1,0xed,0xef,
-  0x2d,0x3e,0x57,0xf1,0xe7,0x8a,0xda,0xc1,0xfb,0x3e,0xee,0x18,0x81,0x23,0xc6,0xe4,
-  0xa3,0xde,0x3d,0x68,0xe8,0x0f,0x19,0xdd,0xa6,0xef,0x31,0xd9,0xcc,0x75,0xf0,0xcf,
-  0x55,0x67,0xe1,0x69,0x91,0xbf,0x53,0x3e,0xc2,0x2f,0x94,0xcc,0xbb,0xc9,0xdb,0xcd,
-  0xea,0x94,0xef,0x41,0xfd,0xe1,0x09,0x83,0xe5,0xef,0xc7,0xce,0x07,0x05,0xb5,0xc3,
-  0xcd,0xff,0x39,0x1b,0x7d,0x96,0x23,0xc8,0x31,0xe5,0x6a,0xf6,0x2a,0xdf,0x0f,0x37,
-  0x9f,0x90,0x6f,0x85,0x37,0xf5,0xb9,0xa9,0xc9,0xa7,0xe4,0x2a,0x38,0x02,0xdf,0x89,
-  0x4e,0x72,0xc7,0xbf,0x38,0xbc,0x8f,0x46,0x24,0xf0,0x86,0x0a,0x45,0x3e,0xb6,0x06,
-  0xb7,0x29,0xea,0x29,0xf6,0x16,0xac,0x2b,0x25,0x20,0xc4,0xa2,0x9d,0xff,0x26,0xd5,
-  0x22,0x10,0x62,0xa3,0xb9,0x6e,0xfc,0xb3,0x3a,0x84,0xcb,0x80,0x33,0x45,0x59,0xc3,
-  0xa6,0x03,0x5a,0x73,0x13,0x76,0xeb,0x4b,0x4c,0x6f,0x55,0x00,0x82,0xdb,0x20,0xd8,
-  0x58,0x3a,0x2e,0xfe,0xc5,0xba,0x10,0x24,0x44,0xb8,0x47,0xe1,0x6b,0x8c,0xc0,0x2d,
-  0x38,0x7b,0xbf,0x17,0xb4,0x1f,0x39,0xe9,0x89,0x56,0xfc,0x9c,0xf8,0x9c,0x49,0x96,
-  0xcd,0xff,0x41,0x10,0x62,0x86,0xd6,0xa2,0xda,0x3c,0xc4,0x6b,0x35,0x44,0x23,0x6f,
-  0xf9,0xce,0x28,0xc2,0x22,0xe7,0xa1,0x21,0xae,0x21,0xfb,0xdb,0xeb,0xe2,0x3f,0xef,
-  0x64,0x17,0x50,0xed,0x2c,0xec,0x65,0xe7,0x95,0x91,0xa6,0x86,0x18,0xb1,0x7d,0x34,
-  0x3f,0x5c,0x2f,0xf2,0x01,0x01,0x81,0x71,0xcb,0xcc,0xac,0xfc,0x2f,0xd8,0xa9,0x11,
-  0xec,0xc9,0x7f,0xd0,0x5b,0x21,0x1d,0x32,0x6a,0xe9,0x6a,0x29,0xe3,0x23,0xa9,0x8a,
-  0xfc,0x4b,0xc3,0xf0,0x5a,0x51,0x7d,0x23,0xe2,0x73,0x17,0xfe,0xb9,0xe1,0x2a,0xe8,
-  0x68,0x0b,0x7c,0x53,0x0d,0xa2,0xda,0xec,0x88,0x05,0x71,0xbd,0x31,0xb3,0x74,0x1d,
-  0xdc,0x2b,0x12,0xe1,0x61,0x5d,0x63,0xe5,0x12,0xbc,0xc3,0xa4,0xe3,0xff,0x41,0xfc,
-  0xa3,0x77,0x24,0x02,0x66,0x1e,0x5c,0xd1,0x09,0x9c,0x2f,0x81,0xeb,0xc2,0xb9,0xa6,
-  0x15,0x21,0x4d,0xb2,0xbe,0xb6,0xdd,0xea,0xd2,0x26,0xdc,0x7f,0x8d,0xba,0xf8,0x87,
-  0x93,0x61,0x1d,0x2f,0x4b,0xed,0xb8,0x29,0xf7,0x32,0x58,0x9b,0x9c,0x96,0xb8,0xfc,
-  0xdb,0x53,0x4f,0xc0,0x36,0x3e,0x6d,0x78,0xcd,0xf2,0xdc,0x8f,0x8d,0x09,0x2b,0x66,
-  0x44,0x3d,0xdf,0x66,0x4f,0x66,0xf8,0xcf,0x88,0x7f,0x3a,0x22,0x61,0x33,0xbf,0x92,
-  0xad,0x6c,0xe2,0xf1,0x1e,0x63,0x46,0xad,0x6c,0x2a,0xdb,0xb4,0xa5,0xc3,0xde,0x59,
-  0xf2,0x01,0xfe,0x6b,0x98,0x64,0xf8,0x6b,0xdd,0xfc,0xe7,0x49,0x4f,0x32,0xf1,0xbd,
-  0xb4,0xc9,0x43,0x45,0x27,0x61,0x2e,0x79,0x7b,0xc6,0xd4,0x23,0x9f,0xae,0x24,0xa1,
-  0x0f,0x2e,0x18,0x0d,0x86,0xf0,0x77,0xd9,0xf3,0xa3,0x4e,0xb4,0x48,0x56,0xf9,0x66,
-  0xf3,0x62,0x18,0x55,0xae,0x83,0x82,0x27,0xbb,0x2a,0xd2,0x1e,0xa1,0x66,0x7c,0x35,
-  0x51,0xf1,0x85,0x66,0xf8,0x09,0x11,0x69,0x33,0x7f,0x1c,0xca,0x8d,0xe0,0xe0,0x84,
-  0x12,0x6d,0x0f,0x94,0x71,0xf5,0x9f,0x58,0x89,0x4a,0xfa,0x73,0x3e,0xee,0xa7,0x60,
-  0x55,0x74,0x86,0x41,0xfe,0x1f,0x07,0x8f,0xe1,0xf3,0x9a,0x7b,0x29,0xa9,0x7f,0x29,
-  0xfb,0xbc,0xba,0xd3,0x2c,0xbf,0x6b,0x7a,0x0d,0xbb,0x63,0xda,0xde,0x8d,0x33,0x52,
-  0x1d,0xcb,0xd9,0xab,0x2c,0x9d,0xff,0xd5,0x9f,0x85,0x7f,0xba,0x23,0x89,0xa8,0x5a,
-  0x8d,0xfb,0xf7,0xe4,0xc1,0xc0,0xa8,0x1a,0x0e,0x2c,0xd4,0xd3,0x5f,0xdc,0x3b,0xe4,
-  0x7f,0x8e,0x8e,0xe3,0x3f,0x0f,0xc3,0xc7,0xb8,0xed,0x9a,0x34,0x32,0x61,0x89,0x7a,
-  0x9c,0xef,0xef,0xac,0x4c,0x94,0x7f,0xcb,0x66,0x04,0x9d,0xe6,0x87,0xa0,0xbe,0x5d,
-  0xc4,0xbf,0x32,0xf8,0x0d,0xed,0x91,0x56,0xaf,0x14,0x88,0x6d,0x38,0xa3,0xdd,0x77,
-  0x7a,0x3f,0xbe,0x50,0x18,0x26,0xa3,0x5e,0x1b,0xc7,0x7f,0x5e,0x69,0x1c,0x84,0xa2,
-  0xa8,0x4f,0xbb,0x72,0xb1,0xf1,0x8a,0x59,0x65,0x84,0xd0,0xfa,0xf3,0x57,0x6c,0x0b,
-  0x78,0x50,0x13,0x89,0x42,0x59,0xf1,0x2f,0xa0,0x6c,0xa3,0x25,0x71,0x56,0xa1,0xb7,
-  0xb5,0x55,0x37,0x06,0xe3,0x45,0xef,0x00,0x25,0x82,0xa1,0xd9,0x7d,0x5b,0x5f,0xcd,
-  0xf5,0xe8,0x78,0xfe,0x33,0x5b,0x0d,0xc1,0x16,0x4f,0x1c,0x81,0xd3,0x8f,0xd2,0x69,
-  0x4a,0x69,0x46,0x90,0x20,0xfa,0x06,0xf0,0x54,0x56,0xfc,0x8b,0xdc,0x3e,0xc1,0x88,
-  0xa7,0xc8,0x43,0xfe,0xa2,0x8a,0x88,0x5a,0x94,0xa6,0xfd,0x20,0xfe,0xe9,0x83,0x36,
-  0x3d,0x21,0xf8,0xcf,0x99,0xf8,0xd7,0x55,0x77,0x1a,0x66,0xeb,0x13,0x25,0x05,0x94,
-  0xff,0xfe,0x2a,0x54,0x11,0xdb,0x39,0x05,0x47,0x6f,0xc5,0xe7,0x5d,0x51,0x7e,0xac,
-  0xe9,0x50,0x6b,0x15,0xc7,0xa9,0x38,0xef,0xe4,0x5f,0xf4,0x5c,0x3e,0x64,0x9c,0x83,
-  0xb9,0x2d,0xf7,0xfd,0x4a,0xde,0xa3,0x9c,0x63,0x0d,0x44,0x84,0x3e,0x09,0xe4,0xf6,
-  0x41,0x18,0xf0,0x32,0x0a,0x0d,0xd9,0xfc,0xe7,0x1a,0xe5,0xa4,0x7e,0x50,0xaa,0x6a,
-  0x82,0xc1,0x67,0xbe,0xa9,0xbe,0xa8,0xcc,0xbd,0xc1,0x17,0x97,0x4e,0x6a,0x07,0x7d,
-  0xb3,0x1b,0x71,0xd8,0x9f,0xa4,0x83,0x30,0x91,0xfe,0xe1,0x3b,0x0e,0x7e,0x2e,0x05,
-  0x13,0xff,0x53,0x4e,0xd9,0x5e,0xba,0x1a,0x93,0x2a,0x4b,0xd4,0x15,0x38,0xff,0x1c,
-  0xa6,0x83,0xdc,0xce,0x52,0x6d,0x47,0xef,0x0e,0x80,0xca,0xe5,0xfb,0x33,0xfc,0x67,
-  0xa5,0x13,0x56,0x40,0x59,0xd3,0x74,0xed,0xa1,0xc5,0x95,0x6d,0xb0,0x38,0x22,0xf8,
-  0xcf,0x5b,0xf2,0x04,0x10,0xc2,0xe7,0x55,0x2b,0x04,0xfe,0x71,0xd6,0x43,0x69,0x49,
-  0x27,0x5b,0x81,0xeb,0xd3,0xf2,0xa7,0xa9,0x95,0x11,0x35,0x5e,0xb4,0x9d,0x3d,0x82,
-  0x6a,0x07,0xe7,0x7f,0x28,0x6f,0x35,0xed,0xef,0xe2,0xec,0xa1,0x0c,0xbf,0x42,0xd9,
-  0x03,0x2f,0x12,0xc8,0xdf,0x24,0xdf,0x08,0x07,0x8d,0xea,0x25,0x21,0xca,0x56,0x9b,
-  0x86,0x2f,0x82,0xde,0x6f,0xe7,0x6a,0xa8,0x8e,0xe6,0xbb,0xf3,0xbf,0x10,0xff,0xe8,
-  0xef,0x42,0x9d,0xb1,0xee,0x47,0xf2,0x1f,0xd4,0x53,0x65,0xa1,0x28,0xa1,0x41,0xe3,
-  0x57,0x36,0x43,0xfe,0x23,0x55,0xd4,0x07,0xc8,0xe2,0x3f,0x33,0xa2,0xe1,0x20,0xda,
-  0x8c,0xea,0xfd,0x91,0xfa,0x12,0x5c,0x5d,0x3a,0xae,0x37,0x11,0x7f,0x3c,0xa6,0x1c,
-  0x85,0x2a,0xe5,0x30,0x2f,0x3f,0xe0,0xf2,0xef,0x4d,0x83,0x35,0xa5,0xe5,0x31,0xf2,
-  0xff,0xc0,0xfd,0x06,0xd5,0x73,0x68,0x9a,0x0e,0x69,0xda,0xcf,0x69,0x78,0x94,0x97,
-  0x25,0x54,0x37,0xff,0x59,0xcd,0x89,0x00,0x3f,0x90,0x80,0xbc,0x1a,0xe6,0xcf,0xdd,
-  0x62,0x2c,0x25,0x37,0x45,0xae,0xb1,0xdb,0x72,0x53,0xbc,0x57,0xb6,0xcd,0xd4,0x0d,
-  0x95,0xf2,0xbf,0x1c,0xfd,0x23,0x4d,0xe2,0xab,0xe6,0xa0,0x3e,0x5f,0xb6,0xf2,0x2a,
-  0x78,0x90,0x36,0x7a,0xcb,0xd9,0x24,0x98,0x5b,0x74,0x67,0xaf,0xf7,0x1e,0x76,0x34,
-  0xf8,0x90,0x5a,0x0e,0x84,0x07,0x9c,0xfd,0x45,0xb0,0xb4,0x28,0xde,0xd9,0x39,0x2b,
-  0x91,0x3f,0xe6,0xad,0x85,0x77,0xf8,0xbc,0xa1,0x7c,0x8a,0x7f,0xfd,0x99,0x5f,0x9b,
-  0xf2,0x7f,0xb7,0xe3,0x34,0x3b,0xc0,0x67,0xe9,0x3e,0xe2,0x3f,0x3b,0xf1,0xaf,0xfc,
-  0x87,0x8c,0x33,0x9c,0x76,0x97,0x1d,0x3b,0xd8,0x51,0x8a,0xce,0x27,0x11,0x06,0x9c,
-  0xf1,0x08,0x86,0x21,0xee,0x50,0xd4,0xa7,0x60,0x66,0xb2,0xd8,0x85,0x7f,0x94,0xa7,
-  0xe0,0x48,0x67,0x43,0x22,0xff,0xb4,0x7c,0xda,0xe8,0xfb,0xfe,0x9c,0xa1,0xfc,0x7d,
-  0xf2,0x1b,0xc6,0x0b,0xf1,0x59,0xa9,0xb5,0x3d,0xd7,0x9c,0xe6,0xef,0xb5,0xcf,0x8e,
-  0xfe,0x6c,0xac,0x38,0x93,0xaf,0xb1,0x03,0x36,0xdd,0xda,0x09,0x33,0x5a,0x62,0xb5,
-  0x4d,0x87,0x78,0xa7,0x56,0x36,0xec,0xa9,0x91,0x37,0xc3,0xba,0xed,0xc1,0x11,0x75,
-  0x79,0xee,0x7b,0xe6,0xca,0x44,0x59,0xb0,0xa0,0x86,0xbd,0xb7,0xd2,0x7e,0xbf,0x00,
-  0x1b,0x61,0x55,0xe9,0x8c,0x04,0x3e,0xd4,0x20,0xbb,0x1f,0xfe,0x41,0xec,0xd7,0x0a,
-  0x57,0x41,0xd9,0xc0,0x67,0x96,0xb1,0x57,0xfa,0x37,0x86,0xa7,0xf8,0xb2,0xf8,0xcf,
-  0x46,0x09,0x47,0x35,0x1e,0xba,0x53,0xdd,0xb3,0x35,0x05,0xbc,0x6c,0x71,0x1f,0x05,
-  0x3e,0x80,0x0a,0x71,0xe4,0x51,0xfe,0x7b,0x5c,0xa9,0x20,0x0b,0xe8,0xc2,0x63,0x39,
-  0xdb,0xa1,0xcb,0xac,0x0f,0x86,0xf6,0xc8,0xc7,0x03,0xbc,0xad,0x3a,0xb5,0x20,0x59,
-  0x7e,0xbc,0xe3,0x08,0x6a,0xd4,0x19,0xa3,0xf2,0xef,0xd9,0x69,0xf6,0xb8,0x9e,0xe5,
-  0x3f,0x4f,0x68,0x43,0xa4,0x6d,0xcc,0x9b,0x7b,0x88,0xf6,0xdc,0x59,0xdb,0x7c,0xa3,
-  0x48,0xfc,0xc9,0x21,0x8f,0x90,0xfc,0x16,0x82,0xa3,0xda,0xe4,0xd5,0x49,0xdc,0x61,
-  0xd9,0xcf,0x2b,0x69,0x27,0xf9,0x85,0x60,0x03,0xf7,0x8f,0xfa,0xeb,0x34,0x5c,0x48,
-  0x43,0xbe,0xd1,0x4f,0x9d,0xe7,0xbf,0x45,0x20,0x77,0x35,0x25,0x3e,0x1f,0x86,0xb9,
-  0xb0,0x30,0x9b,0xff,0xbc,0x98,0xf7,0xe8,0x84,0xf6,0xab,0x43,0x10,0xeb,0xac,0x37,
-  0x3c,0xb4,0x1f,0xff,0x39,0xea,0xc8,0xab,0x93,0x4c,0xd6,0x62,0x50,0x1d,0x46,0x44,
-  0xf4,0x88,0x0b,0xff,0x44,0x45,0xfc,0xcb,0xb3,0xa9,0x28,0xa8,0xc7,0x62,0xb8,0x30,
-  0x92,0x45,0x23,0x4a,0x17,0x14,0x98,0x5d,0xe1,0xdc,0xf7,0xf4,0x76,0x1e,0xd0,0x3d,
-  0x59,0xfc,0x67,0xfc,0xbf,0x24,0x05,0xd9,0xc3,0x6c,0x75,0x8c,0x17,0x86,0xfa,0x6b,
-  0x28,0x2d,0x6e,0x9b,0x4f,0x1f,0xf4,0x84,0x8b,0xa6,0xad,0xe7,0x89,0x0a,0x40,0x20,
-  0xd4,0x9e,0xc1,0x3f,0x60,0xe4,0x51,0xbc,0xaf,0x60,0x90,0x49,0x7a,0x4c,0x9a,0x6d,
-  0x86,0xba,0xdb,0x71,0x63,0xce,0x2a,0x8f,0x7a,0x4f,0x34,0x2f,0xc9,0x35,0xa7,0x55,
-  0xb1,0x85,0xc9,0x6d,0x29,0xd9,0xe1,0x3f,0x5f,0x3e,0x4a,0xde,0x0c,0xc3,0xbf,0xab,
-  0x3d,0xba,0xe6,0xac,0x88,0x56,0x50,0x62,0x97,0x52,0x3f,0xb8,0xf0,0x43,0x79,0xc4,
-  0x3c,0x2b,0x51,0x3d,0x81,0xe6,0x1d,0x65,0xf6,0xfc,0xf4,0xda,0xfc,0xe7,0x31,0xf9,
-  0x5e,0xf8,0x40,0x45,0x61,0x34,0x70,0x1e,0xce,0xe9,0xd7,0x9b,0x08,0x9b,0xeb,0xf4,
-  0x23,0x66,0x43,0x36,0xff,0xd9,0xd4,0x7e,0x61,0xf1,0x7f,0x7a,0x58,0x25,0x7c,0x60,
-  0xa2,0x70,0x96,0x1d,0x87,0x7d,0xad,0xe5,0x2f,0x79,0x7a,0xb4,0x5f,0x2a,0xaf,0x01,
-  0x9d,0x2a,0x4a,0x39,0xfe,0x81,0x7e,0xc5,0x21,0x9d,0x2e,0xf0,0x09,0x61,0x0e,0xce,
-  0x27,0xee,0xc8,0x06,0xfe,0x31,0xcc,0x7c,0x5b,0x2d,0xe2,0x13,0x7b,0x4b,0xb2,0xc7,
-  0x13,0xff,0xd9,0x4a,0xf2,0x62,0x02,0x76,0xf6,0x52,0xda,0xbb,0xb6,0x0b,0xf1,0x0f,
-  0x4e,0xe3,0x4e,0xe5,0xc7,0x8a,0xc5,0xbf,0x72,0xee,0xe7,0x96,0x4c,0xfe,0x75,0x9a,
-  0x28,0x25,0xf8,0xf0,0x50,0x6b,0xfa,0xc2,0x78,0x05,0x87,0x9f,0x33,0x3e,0xff,0x9d,
-  0xf0,0xb0,0xf4,0x81,0x55,0xcd,0x06,0xe7,0x27,0x3e,0xc7,0x5c,0x38,0xfa,0xa5,0x0c,
-  0xff,0xc7,0x79,0x5f,0x88,0x7f,0x14,0x0a,0xaa,0xa6,0xd9,0x65,0xf7,0x50,0xa0,0x27,
-  0x04,0x63,0x6a,0xad,0x99,0x9f,0x9c,0x10,0xf2,0x39,0xd7,0xb7,0xdf,0xd6,0xd1,0x89,
-  0xe9,0x7a,0x08,0xf4,0xd7,0x9f,0xd6,0x03,0xbd,0x05,0xa3,0x9e,0x10,0x5c,0xcf,0xca,
-  0xf1,0xfe,0xe5,0x3a,0xf8,0xb9,0x72,0x71,0xfe,0x97,0x3d,0x3f,0x6b,0x69,0xff,0x85,
-  0x42,0x91,0xaf,0xf0,0x01,0x45,0x45,0x18,0xdc,0xb4,0x53,0xeb,0x50,0x16,0x9b,0x97,
-  0xce,0xff,0x1a,0xcb,0x9d,0x0c,0xbb,0xf9,0x94,0x14,0xa2,0x1d,0x14,0xda,0xca,0x86,
-  0x3c,0xcb,0xaf,0xb8,0x19,0x1e,0xb6,0xf1,0x80,0x83,0x7f,0xec,0xfa,0x3f,0x49,0xf9,
-  0x7e,0xf3,0x23,0xbc,0xbe,0x9f,0xf2,0xbf,0x7e,0xad,0xd7,0x0c,0xab,0xb3,0xf0,0x2f,
-  0x3e,0xa3,0x0b,0xfe,0xb3,0x0b,0xff,0xd8,0xf1,0x2f,0x8b,0xcf,0xb3,0x9f,0x88,0x64,
-  0xdf,0x15,0x3b,0x94,0x82,0x65,0xf2,0x4e,0x27,0xff,0xcb,0xc9,0x3f,0x4d,0xe7,0x7f,
-  0xa5,0xb7,0x69,0x4b,0x6a,0xcd,0xf9,0xdd,0xb8,0x5f,0x18,0x83,0x7f,0x1a,0x44,0xa0,
-  0xb8,0x73,0xeb,0x7c,0x8b,0x7f,0x9e,0xf1,0xff,0xf4,0x6b,0xe9,0xfd,0x17,0xb9,0x7d,
-  0x76,0x47,0xcb,0xcc,0xbc,0xb9,0xa8,0x3f,0xf7,0x4a,0xfa,0xa1,0xfb,0x96,0xb1,0x17,
-  0xe1,0xb7,0x96,0x6b,0xe8,0xa5,0x4c,0x7d,0x0f,0xf8,0xa9,0x4d,0x72,0x7e,0x43,0xda,
-  0xdb,0x36,0x8d,0xd2,0xfc,0x27,0x43,0xb2,0xef,0xcb,0x23,0x31,0x72,0x04,0xad,0xba,
-  0x98,0xff,0xb3,0xd6,0xf2,0xaf,0x5a,0x6c,0x67,0x9d,0xd4,0x8e,0x4f,0x78,0x14,0xa7,
-  0x85,0x9b,0x06,0xe0,0xc7,0x69,0xfe,0xcf,0xb8,0xf8,0x17,0xa1,0x1d,0x36,0x0c,0xa7,
-  0x19,0x39,0x82,0xbc,0x41,0x38,0x6f,0x52,0xfc,0x4b,0x1e,0x2e,0x3d,0x64,0x11,0xa1,
-  0xff,0x52,0xfd,0x1f,0x8b,0x0f,0x8c,0xc2,0x62,0x3a,0xc2,0x9c,0x53,0x97,0xce,0xff,
-  0xe2,0x1f,0x92,0x7f,0x40,0x23,0xda,0x4f,0x5f,0x95,0xe1,0xdb,0x48,0xf8,0x47,0x78,
-  0x0c,0xdc,0xfe,0x1f,0xa7,0xfe,0x4f,0xee,0x50,0xda,0x11,0xc1,0xb6,0xc3,0xbe,0x44,
-  0xb5,0x31,0x9d,0xf0,0xcc,0x23,0x56,0x62,0xd7,0xa5,0xf2,0xbf,0x9a,0x2c,0x37,0x91,
-  0x55,0xa6,0x06,0x85,0x18,0xc5,0x53,0x56,0xb3,0xc0,0xa5,0xf8,0x3f,0x56,0xb6,0xbb,
-  0x26,0xdc,0x3e,0x55,0xac,0x13,0xf1,0x4f,0x45,0xc4,0x83,0xf8,0x87,0x8b,0xc2,0x38,
-  0x9a,0x6b,0xff,0x35,0x66,0xe7,0xbf,0x5b,0x4f,0xd7,0x0d,0x96,0xfd,0x6d,0xad,0x2a,
-  0xf1,0xf1,0xe2,0x63,0xad,0x66,0x6b,0x55,0x76,0xfe,0x7b,0xcc,0xc9,0x7f,0xc7,0xbb,
-  0x15,0xd1,0xae,0xf5,0xc2,0xff,0x43,0x66,0xbd,0x78,0xe8,0xa6,0xf4,0x54,0xfc,0x21,
-  0x3b,0xff,0x8b,0x59,0x7c,0x21,0x38,0xa7,0xe2,0x6c,0xb4,0x76,0x6c,0xa7,0xf1,0x11,
-  0xdf,0xa0,0x3c,0x85,0x1f,0xb4,0x5c,0x67,0xcf,0x65,0xe5,0x7f,0x8d,0x31,0x2b,0xff,
-  0x1d,0x7a,0x88,0xed,0xd3,0xc9,0x84,0xff,0xa7,0x64,0x0a,0x22,0x22,0x7e,0x54,0x17,
-  0xfc,0x9f,0xec,0xfc,0xaf,0xf5,0xe9,0xe7,0xc5,0x07,0xd7,0x49,0xf1,0xe2,0xf3,0x1a,
-  0x4b,0x89,0xff,0x9c,0x13,0x6f,0x53,0x13,0x82,0xff,0xe3,0xac,0x9f,0x4d,0x69,0xfe,
-  0x8f,0xd7,0x76,0xbb,0x75,0x25,0x69,0x3e,0x25,0x4a,0x84,0xbf,0xa9,0x02,0xd6,0x2b,
-  0x56,0xfc,0xcb,0xc5,0x5f,0x1d,0x42,0xd8,0x89,0x9b,0x20,0xf1,0xbc,0xd0,0x6d,0x15,
-  0x7a,0xa2,0xc7,0x54,0xe3,0x69,0xff,0xcf,0xba,0x2c,0xfc,0x23,0x6d,0x57,0x5d,0xfe,
-  0x1f,0x9b,0x08,0x24,0x04,0xa9,0xcf,0x5e,0x2a,0x17,0xe5,0x7f,0xd1,0x24,0xa7,0x5f,
-  0x04,0xa4,0x85,0x49,0xb8,0xf0,0xd4,0x7e,0x0b,0x08,0x65,0xe7,0xbf,0xd7,0xa6,0xfd,
-  0x3f,0xf0,0x04,0x47,0x21,0xc5,0x82,0xf0,0x14,0x59,0xa8,0xc5,0x78,0xe4,0x51,0x0b,
-  0x08,0x65,0xe7,0x7f,0xcd,0xb6,0xf4,0x4f,0x8b,0xb1,0x4b,0xc3,0x0f,0x07,0x88,0xb8,
-  0x12,0x0f,0x99,0x57,0xe4,0x10,0x5f,0x45,0xd1,0xc7,0xe5,0xbf,0xc3,0xed,0xf6,0xf7,
-  0xfb,0x32,0x3c,0x86,0x82,0xdc,0x1a,0x10,0x8c,0xe8,0x7e,0x8f,0x51,0x35,0x10,0x7b,
-  0x18,0x24,0x53,0xe4,0x7f,0xd9,0xf7,0xbf,0x23,0x76,0x87,0x95,0xff,0xbe,0x5c,0xbe,
-  0x03,0xfe,0x44,0xc2,0x22,0xf9,0x0e,0xe5,0x63,0xde,0xf0,0x9e,0x67,0x89,0xfc,0x46,
-  0xfc,0x08,0xdf,0x35,0x2e,0xff,0xfd,0xaa,0x9d,0x0e,0x9f,0x93,0xf2,0xe3,0x9c,0x44,
-  0xf8,0xd7,0xd7,0x25,0xe4,0x91,0xe8,0x99,0x92,0xda,0x6c,0xff,0x8f,0x93,0xff,0x7e,
-  0x4a,0xfe,0x8d,0x71,0x84,0x37,0x0c,0x2d,0x0c,0x16,0xdf,0x0b,0xdf,0x89,0x37,0xa4,
-  0xee,0x3b,0x25,0x9f,0xd7,0xde,0xec,0x6b,0xb0,0xf2,0xdf,0xed,0xf9,0x79,0x44,0x4a,
-  0xf3,0x9f,0x97,0xb3,0xe7,0xf8,0xbf,0x93,0x70,0x9d,0x8c,0x4f,0x94,0x08,0xa5,0xf2,
-  0xef,0x66,0x6f,0xf4,0xa7,0xeb,0x6f,0x64,0xf8,0x3f,0x4e,0xfe,0xfb,0x3d,0xec,0xe5,
-  0x36,0x4a,0x7c,0x9b,0xdf,0x8a,0xfa,0x6a,0x8f,0x3a,0xc3,0x2c,0xbd,0x9b,0xbd,0xce,
-  0xd3,0xe3,0xb3,0xf3,0xdf,0xb7,0x59,0xf3,0x29,0x16,0x9e,0xe9,0xd5,0x02,0x0b,0xa4,
-  0x5d,0xbd,0x56,0x44,0xcc,0xe6,0x73,0x66,0xf4,0x15,0xe5,0x7f,0x09,0xfe,0x73,0x18,
-  0xd7,0xcf,0xaf,0x88,0xed,0x43,0x65,0xee,0x4e,0xc5,0x1b,0x4c,0x84,0xa9,0x67,0xd9,
-  0x9b,0xe9,0xfa,0x21,0x99,0xfc,0x77,0xc9,0xd1,0xb7,0x62,0xd9,0x98,0xfe,0x8d,0x34,
-  0x51,0xf0,0x5d,0xf3,0xea,0xed,0xf2,0x80,0xed,0x1f,0x73,0xe7,0xbf,0xdb,0xf6,0xae,
-  0xfc,0xbb,0x70,0x0e,0x66,0x9b,0xf8,0xa1,0x51,0x98,0xa3,0xc1,0xf4,0x0d,0xe3,0xfe,
-  0x34,0x9d,0xff,0xde,0x7f,0x29,0xff,0x4f,0x08,0xf6,0x29,0xd5,0xa6,0x77,0xb3,0xbc,
-  0x53,0xd9,0x2f,0x55,0x9a,0x05,0x0f,0xb1,0x11,0xf5,0xe7,0x7f,0x29,0xff,0x1d,0x0f,
-  0x2e,0x96,0x44,0xe0,0xa6,0x87,0xc2,0xee,0x5a,0xa5,0xa9,0x6e,0x11,0x19,0x64,0xe3,
-  0xf2,0xdf,0x3d,0x8a,0xe3,0xff,0x21,0x45,0x54,0x41,0x6e,0xc6,0x01,0xd2,0x48,0xe6,
-  0x95,0x3a,0x1b,0xe0,0xe9,0xa9,0xcb,0xec,0xbf,0x58,0x0e,0xc5,0xbf,0x84,0xf7,0xef,
-  0xcb,0xc6,0x7e,0xcb,0x9a,0xa0,0x7d,0xd7,0xe7,0xf5,0xa3,0x7e,0x3e,0x0b,0x47,0x14,
-  0xf1,0xbc,0xa6,0xa3,0x7f,0xb6,0xa6,0xe3,0x5f,0xeb,0xf6,0xc8,0xb4,0x11,0x6b,0x30,
-  0xaf,0xfe,0x08,0x9f,0x17,0xf5,0xc9,0xe1,0x82,0x54,0xf9,0x88,0x6d,0xbf,0xde,0x75,
-  0xbe,0x47,0x8a,0x7f,0x9d,0xe3,0xb8,0xbf,0x50,0x71,0x93,0xf5,0x22,0x9f,0x3b,0x74,
-  0xc3,0x58,0xf1,0x59,0xf5,0xc5,0xf8,0x53,0xb4,0x6c,0xa6,0xc2,0x1b,0xd2,0x6e,0x23,
-  0x7f,0x5c,0xfc,0x4b,0xdd,0xcf,0x03,0x51,0x35,0x16,0x78,0x07,0x1e,0xe1,0x81,0x7e,
-  0x6f,0x37,0x3b,0x07,0xab,0xa9,0xec,0x4f,0x92,0x4d,0x55,0xda,0x21,0x90,0x8a,0x84,
-  0x3d,0x7a,0xc6,0xff,0x33,0x71,0x00,0xe7,0x67,0x3b,0xcf,0x03,0x5c,0x0f,0x1d,0x50,
-  0xd1,0xef,0x0d,0xb7,0xbf,0x28,0x3d,0x22,0x05,0xcd,0x35,0x61,0x56,0xe1,0xeb,0xb6,
-  0xfc,0x39,0x81,0xac,0xf8,0xd7,0x13,0x7c,0xaa,0xa9,0xc6,0xee,0x1a,0x32,0x7e,0x4e,
-  0x65,0x0f,0x11,0xff,0xd0,0xfe,0x8b,0xa6,0xb1,0x82,0x4f,0x6f,0x9f,0x9e,0x8a,0x10,
-  0xbb,0xda,0x9e,0x4f,0x28,0x1c,0x81,0x0f,0x79,0x75,0x4d,0xfe,0xce,0xf2,0x77,0x94,
-  0x17,0xb4,0x6a,0xf3,0x3e,0x9a,0x9f,0x63,0xf1,0xc9,0x34,0x2d,0xca,0xe5,0xa7,0x79,
-  0xed,0xf2,0xfc,0xb0,0x0c,0x59,0xf8,0xe7,0x1c,0x5c,0xbf,0x78,0x9d,0xb9,0xed,0x63,
-  0x9c,0xa8,0x99,0x02,0x08,0xe9,0x56,0x18,0xb4,0xf9,0x63,0xe9,0x0d,0xe5,0xf1,0x03,
-  0x17,0xd5,0xff,0xf9,0x23,0xaf,0xe2,0xbe,0xed,0xf2,0xf6,0x68,0x9a,0x4d,0x34,0x80,
-  0x6a,0x4d,0xd0,0xae,0x86,0xf4,0xd7,0xa0,0xea,0x96,0x82,0xa4,0x57,0xcb,0x8e,0x7f,
-  0x19,0xfa,0xa0,0xba,0xb6,0xf9,0x06,0xd8,0xd6,0x1a,0x30,0x5f,0x48,0xde,0x75,0x4e,
-  0x7b,0x85,0x96,0xc1,0x93,0xec,0x6d,0xd8,0xcf,0x81,0x22,0x5c,0x55,0x59,0xf8,0x67,
-  0x0b,0x24,0x36,0x04,0xf3,0x8b,0xf2,0xb5,0x36,0x58,0x42,0xd3,0x32,0xa0,0xad,0xb7,
-  0xfc,0x3f,0xcf,0x2a,0x9b,0xee,0x4a,0xe8,0xb8,0x5f,0xa8,0x71,0xd7,0x3f,0x94,0xf6,
-  0x9a,0xfa,0x96,0x60,0x3f,0xbb,0x17,0xfe,0x35,0x2e,0xac,0xff,0x1b,0xf0,0xfd,0xb8,
-  0x40,0x08,0xbf,0x31,0x1e,0x8f,0x97,0x45,0xd5,0x6f,0x33,0x35,0x53,0xff,0x07,0x7c,
-  0xf0,0x7b,0x08,0xf3,0x60,0x9e,0xfc,0x0b,0xe3,0x19,0xa3,0x66,0xd8,0x5f,0x23,0x8f,
-  0x68,0xbf,0x4a,0x7e,0x77,0xc4,0x7f,0x7d,0xc7,0x73,0x7c,0x70,0x47,0x38,0x50,0x59,
-  0x2b,0x17,0x65,0xf8,0x3f,0x13,0x9f,0x34,0x3e,0x86,0xab,0x3b,0xc9,0xff,0xa3,0xfd,
-  0x99,0xa2,0x5d,0xc9,0x09,0x67,0xf5,0x73,0x85,0xf7,0xd2,0x44,0x0d,0x29,0x67,0xe1,
-  0xe9,0x3e,0xef,0x2e,0x77,0xfd,0xc3,0x1b,0x46,0xd4,0x8f,0x38,0xa1,0x05,0xdc,0x74,
-  0x9c,0xe1,0xb5,0x29,0x5f,0xd2,0x1b,0xd2,0xd1,0x6c,0x51,0x3e,0xc2,0x71,0x76,0x28,
-  0x37,0xdc,0x88,0x47,0xa6,0x8f,0xab,0xff,0x83,0xdb,0x84,0x56,0xa1,0x3f,0x11,0x16,
-  0x8e,0xa2,0x3e,0x79,0xd0,0x82,0x3d,0x2f,0xc3,0x4a,0x78,0xc4,0x9c,0x3e,0xca,0x8a,
-  0x9c,0x7c,0xed,0x5e,0x11,0xff,0xc2,0x4d,0x6b,0x84,0xfd,0x46,0x7d,0xda,0x14,0xd5,
-  0x8d,0x0a,0xf8,0x0a,0x84,0x3d,0x5d,0xf8,0xe0,0xfa,0xaa,0x8e,0x6b,0xa2,0x08,0x84,
-  0xc2,0x2e,0xfc,0x83,0xda,0x5b,0xd3,0x7f,0xa5,0x4e,0xbe,0xab,0x0f,0x92,0x5c,0x27,
-  0xd8,0xec,0x53,0x1f,0xa1,0xfa,0x3f,0x49,0x34,0x5b,0x5d,0x8d,0xa1,0x14,0x1e,0x29,
-  0xca,0xaa,0xff,0x73,0x7e,0x70,0x36,0x0f,0xbd,0x43,0xf9,0x23,0xbc,0x96,0x1f,0x4e,
-  0x94,0x07,0xe1,0x50,0xac,0x9a,0xa3,0xbe,0x7d,0x4f,0x3b,0x9c,0xb8,0x36,0x11,0x4a,
-  0xc8,0xb5,0xd9,0xf5,0x7f,0x8c,0xa7,0xd8,0xcc,0x4e,0x39,0xd5,0x32,0x16,0x11,0xf5,
-  0x7f,0x8e,0x59,0x86,0xa9,0x93,0x84,0xb2,0x5a,0x65,0x7c,0xfd,0x1f,0x95,0xd8,0x3e,
-  0x9e,0x0d,0x54,0xfd,0x26,0x2e,0xd8,0xbf,0x88,0x7f,0xa4,0x6e,0x32,0x8b,0x28,0xf0,
-  0x2a,0xaa,0xef,0xd7,0x9e,0xa9,0xff,0xd3,0xb2,0x98,0xca,0xf8,0x2c,0x0f,0x6e,0xde,
-  0xfa,0x36,0xdf,0x67,0x54,0x1a,0x72,0xfc,0x8a,0x1c,0x4e,0x1e,0x21,0xef,0x06,0x36,
-  0x15,0xf6,0xc5,0x03,0xc4,0x60,0xd1,0xb3,0xf1,0x0f,0xaf,0x8c,0xe0,0xa2,0xb2,0xdc,
-  0x3e,0x54,0xaf,0x46,0x38,0x82,0xbc,0x1b,0x3c,0x15,0x7c,0x1f,0x6c,0x8d,0x7a,0xe2,
-  0x45,0x2b,0xc7,0xe3,0x1f,0xc1,0xf6,0xa1,0x7a,0x38,0x64,0xfd,0x15,0xde,0x26,0x60,
-  0x4f,0x2e,0x9e,0xd2,0xa3,0x91,0x48,0x9c,0xb1,0x42,0x7b,0x3d,0x10,0xff,0x07,0xf1,
-  0x21,0xa5,0xb9,0xa5,0xd4,0xd3,0x56,0x22,0x7c,0x99,0x31,0x88,0xb0,0xc7,0xbb,0x42,
-  0x0a,0x8a,0x40,0x58,0xc1,0x0a,0xf9,0x17,0xce,0xfe,0x8b,0xea,0xff,0xa0,0xda,0x69,
-  0xc9,0x1f,0x2c,0x3b,0x09,0x7f,0x82,0xca,0xc6,0x7c,0x4a,0xe3,0xfa,0x1d,0x9a,0x75,
-  0x84,0x0d,0x2f,0xc3,0x85,0xc2,0xab,0x89,0x08,0xfd,0xce,0x04,0x7b,0x3e,0x29,0x5f,
-  0xfe,0xdf,0x61,0x76,0x53,0xc1,0x60,0xf9,0x6d,0xf8,0x0f,0xbb,0x09,0x08,0xcd,0xd1,
-  0x09,0x18,0xac,0x23,0x44,0xf4,0x27,0x6d,0x17,0x11,0x69,0x9e,0x53,0x5c,0xf8,0x47,
-  0xe9,0x81,0xad,0x14,0xe4,0x42,0xfc,0x23,0x05,0xa0,0x40,0xe4,0x7f,0xa5,0x2b,0x02,
-  0x41,0xac,0x35,0x50,0x12,0xcc,0xaa,0x7f,0x88,0xf8,0x27,0x0d,0xea,0x16,0xe0,0x36,
-  0x4a,0x6f,0x8e,0x68,0x6b,0x94,0xc4,0xae,0x69,0xf4,0xe0,0xb8,0x91,0x5c,0x5f,0xa6,
-  0x1b,0x6a,0x51,0xbb,0x8b,0xff,0x93,0x43,0xfc,0x1f,0x54,0xe3,0x1b,0xe0,0x1d,0x14,
-  0x18,0xb9,0xd1,0x08,0x4f,0x16,0xa4,0x2b,0x0c,0xe8,0xc2,0xc3,0xf6,0x9c,0xa3,0x1f,
-  0xb6,0x4a,0x43,0x6a,0xef,0xb2,0x70,0xd4,0x1f,0x2f,0x5c,0xac,0x7c,0xb8,0xab,0xaa,
-  0x31,0x57,0xbc,0x56,0x69,0xb2,0xb1,0x90,0x0a,0x21,0x9e,0x32,0xab,0xa2,0xbe,0xb8,
-  0x94,0xe1,0x3f,0x53,0xfd,0x9f,0xeb,0xa0,0xfe,0x26,0xdf,0x26,0x86,0x0b,0xa3,0xd3,
-  0xae,0x87,0x60,0x88,0x34,0xb1,0x21,0x7c,0xf0,0xb3,0xcb,0x66,0x66,0xd5,0x3f,0x24,
-  0xfe,0xcf,0xb2,0x2a,0x58,0xc0,0x9b,0x75,0x18,0x2e,0x15,0x65,0x36,0x13,0xca,0x98,
-  0x22,0x60,0x67,0x54,0x19,0x8b,0x76,0x2b,0x3e,0xde,0xec,0xae,0x67,0x88,0x68,0xc7,
-  0xd8,0x96,0x4c,0xa4,0xe4,0xe5,0xea,0xfd,0x8d,0x88,0x7f,0x86,0xdb,0x4f,0x6f,0x7a,
-  0x42,0xa9,0x26,0x20,0x54,0xa3,0x3c,0x65,0x94,0x73,0xe1,0xff,0x71,0xc6,0x4f,0x5c,
-  0x00,0x0f,0x70,0xbd,0x75,0x87,0x1e,0xe8,0x44,0x8b,0x85,0x6a,0x67,0x47,0xd1,0x1a,
-  0xb4,0x50,0x6a,0x2f,0x65,0x30,0xa9,0xbb,0xa1,0x22,0x15,0x0c,0x17,0x1d,0x72,0xea,
-  0xc7,0x5a,0xfc,0xe7,0x84,0xa6,0x2e,0xda,0x7a,0x0f,0x74,0x82,0x08,0x7b,0x1d,0x85,
-  0xa7,0x93,0x0f,0x12,0xa2,0x98,0xa4,0xee,0x85,0x29,0xe6,0xa6,0xf1,0xf5,0x0f,0x3f,
-  0x16,0x4e,0x1e,0xb6,0x01,0x86,0xf8,0xbc,0xa1,0x09,0x4b,0x9a,0xff,0x05,0xfe,0x1c,
-  0xbf,0x8e,0xea,0xeb,0xde,0x01,0xff,0xa3,0xf3,0xda,0x68,0x68,0x79,0x47,0x76,0xfd,
-  0xc3,0xd7,0xe8,0x6b,0xd2,0xca,0xc5,0x6e,0xa2,0xcf,0x4f,0x66,0xee,0x4c,0x54,0x30,
-  0xa2,0xd1,0xd0,0x2f,0xa9,0x35,0xbc,0xbb,0x9b,0x33,0xf5,0x7f,0xd0,0x7e,0xb5,0xfe,
-  0x99,0x7f,0x43,0xf7,0xf5,0xcb,0x8f,0xc7,0xc7,0xe2,0xb3,0x8f,0x2d,0x78,0xb7,0xfc,
-  0x25,0x4a,0xdb,0x19,0xf2,0x0f,0xcb,0xd5,0xc6,0x9b,0x7c,0x36,0x42,0xa3,0xe2,0x41,
-  0xcd,0xc5,0xff,0x89,0xec,0x85,0x32,0x55,0x5d,0x84,0xa0,0x77,0x4f,0xa2,0xce,0x54,
-  0x67,0x06,0x06,0x61,0x9b,0x54,0x46,0xf9,0xc8,0x3f,0x50,0x3a,0x50,0x75,0x67,0xd5,
-  0xff,0xd1,0x60,0xb3,0xfa,0xb8,0xa6,0xc3,0x67,0x6e,0x6b,0x1f,0x84,0xc7,0x35,0xdc,
-  0xaf,0xdd,0x85,0xcb,0xf8,0x67,0x20,0xea,0xb5,0xd6,0xf1,0xef,0x97,0xfe,0x6b,0x8b,
-  0x77,0x59,0x91,0xa9,0xd9,0xef,0x8b,0xf8,0x3f,0xdd,0x86,0x5e,0x9a,0x57,0x8a,0x20,
-  0xa7,0xdb,0xa8,0x30,0x57,0xeb,0xf8,0xa1,0x91,0x3f,0xed,0xc7,0x80,0xfb,0xcd,0x1f,
-  0x41,0x68,0xb1,0xa8,0x7f,0x68,0x7f,0x2f,0xc3,0x68,0xef,0x70,0x5b,0x04,0x33,0x36,
-  0xcd,0x7e,0x0b,0xc6,0x5a,0xbe,0x61,0xce,0xe0,0xb8,0xcc,0xde,0xd4,0xe9,0x79,0xcb,
-  0x15,0x78,0x8d,0xd7,0xc7,0x11,0xba,0xb8,0xeb,0x1f,0x2e,0x45,0xa5,0xf1,0x24,0xe0,
-  0xb2,0xf9,0xbd,0x32,0xa6,0xe1,0xb6,0x94,0xcb,0x43,0xbe,0x3f,0x32,0x32,0x4c,0x13,
-  0xde,0x36,0x86,0x1b,0xab,0x5a,0xb3,0xf0,0x8f,0xa9,0x9d,0x85,0xf3,0xfd,0xe5,0xdc,
-  0x37,0x5a,0x3c,0xaa,0x9e,0x5f,0x83,0x66,0x6e,0x40,0x9e,0x83,0x86,0x6f,0xb7,0xe9,
-  0x3f,0x54,0x7c,0x12,0x5e,0xc4,0x4f,0xef,0xe6,0xd1,0xe2,0x4c,0xfd,0x9f,0x15,0x88,
-  0x7f,0xf6,0xb5,0x05,0x12,0xea,0x26,0xf6,0x5e,0xac,0x3b,0xb2,0xd5,0xf4,0x2a,0x57,
-  0x94,0xeb,0xbb,0xa1,0xda,0xbc,0x32,0xc6,0xfe,0x10,0x38,0xda,0xa6,0x47,0x29,0x9e,
-  0xd5,0xea,0xc6,0x3f,0xfb,0x60,0x7a,0x62,0xc9,0xa6,0xa6,0xb7,0xa0,0x47,0x0b,0x98,
-  0x32,0xc2,0x00,0xb8,0x5e,0x9a,0x4a,0x40,0xee,0x1d,0xad,0xcb,0xf6,0xff,0xb8,0xf8,
-  0xcf,0xca,0x6e,0x1e,0xe4,0x9e,0x2b,0x98,0x19,0x49,0xaa,0xba,0x79,0xe5,0x9c,0x76,
-  0x45,0xdd,0xcf,0x16,0x1f,0x9d,0x1f,0x0e,0x3c,0x5b,0xb1,0x0b,0xa2,0x46,0x2c,0xec,
-  0xce,0xff,0xf2,0x11,0xfe,0xa9,0xe5,0xbe,0x07,0x2e,0x4b,0xf1,0xd3,0x70,0x6d,0x9f,
-  0xf7,0xf1,0x4f,0xeb,0x70,0x41,0xab,0x1a,0xf4,0x76,0xca,0xef,0xf3,0x67,0xb5,0xaa,
-  0xdb,0x0a,0x4e,0xca,0x46,0x86,0xff,0x9c,0xff,0xa4,0x76,0x01,0x2d,0x46,0xfe,0x7a,
-  0x79,0xb8,0xef,0x63,0x68,0xe8,0xc7,0xd9,0x18,0x85,0x3f,0xeb,0xb5,0x7d,0xfe,0xa6,
-  0x8e,0xfe,0xb5,0x2f,0xea,0x4f,0x47,0x56,0x8d,0x3e,0x33,0xec,0xe4,0x6b,0x1c,0xc8,
-  0x79,0x4a,0xb9,0xd0,0xd6,0x90,0xf2,0x8e,0xc9,0xe7,0xd5,0x0b,0x73,0x66,0xeb,0xbe,
-  0x31,0xb9,0x1e,0x86,0xd5,0x6b,0xcd,0xd0,0x09,0xf9,0x6c,0x4c,0x14,0x82,0x1e,0x9f,
-  0xff,0xb5,0xdf,0xf2,0xff,0x1c,0xc7,0x0f,0xad,0x3a,0xaa,0x76,0x77,0x84,0xf4,0x18,
-  0x04,0x46,0xd5,0xb3,0x08,0x84,0xde,0x5c,0x50,0x8d,0xa7,0xe4,0x0c,0xff,0xa7,0x5f,
-  0x59,0x2b,0xed,0xb6,0xe3,0xcb,0xfb,0x8d,0x00,0x47,0x6b,0xee,0xc3,0x6d,0x66,0xa8,
-  0x2f,0x32,0x87,0xea,0x1f,0xde,0xa9,0x53,0x21,0x44,0x97,0xff,0x67,0xe2,0x48,0x26,
-  0x9e,0xf8,0x84,0x36,0xb5,0x5f,0x25,0x5a,0xf8,0x6a,0xd5,0x22,0x96,0xb3,0x07,0xe0,
-  0x2b,0x74,0xaa,0xc7,0x89,0xdf,0x35,0x6a,0x2e,0xff,0xc3,0x29,0x34,0x73,0xd3,0x29,
-  0x5e,0x39,0x6c,0x12,0x63,0x47,0x1a,0xd1,0xfe,0x28,0x10,0xa3,0x94,0xc9,0xc7,0x3c,
-  0x06,0x76,0x3d,0x84,0xf2,0xb3,0xda,0xa9,0x18,0xf9,0xbb,0x10,0x1f,0x8e,0xed,0x10,
-  0x47,0x46,0xd2,0x81,0x51,0xb9,0xe7,0x22,0xfe,0x8f,0x75,0x7d,0xe3,0x71,0x6e,0xf9,
-  0x63,0x8d,0x5a,0xbc,0xfe,0x04,0x9f,0xf2,0x1a,0x3c,0x4e,0xa7,0x32,0xfe,0xcc,0xa3,
-  0x8a,0x5d,0xff,0x19,0xc7,0xef,0x52,0x03,0x69,0x47,0x16,0xbb,0xf6,0x58,0xfe,0x68,
-  0xd3,0x93,0xc4,0x08,0xa2,0x53,0xdd,0xf6,0xeb,0x42,0xbc,0xe4,0xf8,0x7f,0x10,0x06,
-  0x73,0x1d,0xbc,0xf4,0xbc,0x4f,0x98,0xc1,0xb7,0x6a,0x08,0x08,0xed,0x16,0xfb,0xaf,
-  0xdc,0x0c,0xff,0xe7,0x04,0xe1,0x1f,0x3e,0x23,0x75,0xe5,0xb7,0xd9,0x4f,0xf9,0x63,
-  0x7c,0x4b,0xf4,0xca,0xe5,0x6c,0x72,0xc9,0xde,0xad,0xd3,0x86,0xf3,0x6a,0xd8,0x1b,
-  0xf1,0x87,0x85,0x3f,0xa4,0x89,0x3b,0xe3,0x97,0xa4,0xeb,0x1f,0xfa,0x6b,0xd8,0x61,
-  0xbe,0x0b,0x92,0x80,0x77,0xbb,0x00,0x4e,0xec,0x08,0xbe,0xa7,0x86,0x9b,0x0e,0xf3,
-  0x6f,0x40,0xb8,0xcf,0x1f,0x96,0x5c,0xfc,0x9f,0xab,0x32,0xfe,0x31,0xe3,0x1c,0xbf,
-  0xde,0xf0,0xdb,0x69,0x92,0xfe,0xd1,0x07,0x9e,0x34,0xde,0xb4,0x02,0x85,0x19,0xfe,
-  0x4f,0xb6,0xff,0x47,0xb7,0xf1,0x39,0xab,0xef,0xf5,0x3d,0x8e,0xeb,0xf3,0x8f,0x16,
-  0x3f,0xfc,0xe2,0xfa,0x3f,0x7e,0x91,0xff,0xa5,0x5a,0x44,0x20,0x78,0x2c,0x77,0xde,
-  0x98,0xfa,0x8d,0xc0,0xeb,0xe6,0x2a,0x51,0x08,0x51,0xde,0xe0,0x8c,0x6f,0x74,0xd5,
-  0x3f,0x44,0x61,0xca,0x56,0x21,0x3c,0x6e,0xce,0xa0,0x8c,0xda,0x37,0x22,0x0f,0xc7,
-  0xcb,0xc6,0xc7,0xbf,0xd6,0xda,0x7c,0xfb,0x01,0xd8,0x6d,0x54,0x1c,0xf5,0x12,0xb1,
-  0x6a,0xb7,0x12,0xb4,0xf3,0x4f,0x85,0x63,0x3f,0x73,0x7d,0x57,0xfd,0xe7,0x61,0x38,
-  0x9f,0x98,0x1b,0xb7,0x04,0xdc,0x38,0xcf,0x48,0x34,0x0f,0xe7,0xbd,0xc7,0x44,0xfe,
-  0xd7,0x09,0xc7,0x9e,0x66,0xf9,0x7f,0x46,0x23,0x4f,0x64,0x1c,0x41,0x0b,0x79,0x73,
-  0x4a,0x19,0xb5,0xfd,0x3f,0xf6,0xf5,0xdd,0xfe,0x1f,0x41,0x8b,0x2d,0x10,0x6e,0x01,
-  0x25,0x1c,0x25,0xc3,0x27,0xfd,0x07,0xfe,0x1f,0xc2,0x33,0x86,0x20,0x02,0x2d,0xc6,
-  0x8d,0x61,0xa0,0x99,0x02,0x5b,0xf2,0x6a,0xcb,0x23,0x14,0xcd,0xd4,0x7f,0x56,0x32,
-  0xf5,0x7f,0x54,0x51,0xa6,0x58,0x04,0x6e,0xf4,0xad,0x2d,0x20,0xfc,0x3f,0x10,0xc8,
-  0xce,0x7f,0x57,0x21,0xe3,0xff,0x91,0x10,0xed,0x90,0xd0,0x02,0xeb,0x75,0x3d,0x12,
-  0x2c,0x6a,0xea,0x8b,0xb7,0x95,0x09,0xa8,0xd0,0xe4,0xf8,0x33,0xc7,0x4a,0xa3,0x22,
-  0xdf,0xca,0x4b,0x8f,0x79,0xa2,0x55,0x94,0xfd,0x29,0x33,0xfa,0x51,0xa8,0xe4,0xcd,
-  0xbd,0x2d,0xbc,0x55,0x78,0x84,0x3e,0x76,0xfc,0x87,0x19,0xff,0x8f,0x70,0xfb,0x3c,
-  0x9d,0x16,0x0a,0xeb,0x44,0x45,0x20,0x9b,0xff,0xfc,0xd6,0x45,0xf9,0x5f,0x08,0x7b,
-  0x2a,0x94,0x7f,0xe6,0x14,0x36,0x92,0x70,0x7c,0xb4,0x21,0x42,0xf9,0xe3,0x91,0x57,
-  0x82,0xd5,0x16,0x3f,0x3c,0x1b,0xff,0xd0,0xfd,0x78,0x10,0x0f,0x8c,0x6e,0xe5,0x04,
-  0x7b,0x12,0x3d,0x7a,0x65,0x49,0x84,0xc3,0x31,0x83,0x47,0xad,0xfc,0xaf,0x0c,0x1e,
-  0xce,0xe9,0xb3,0x9f,0x57,0x81,0xf5,0xaa,0x2e,0x0a,0x21,0x2a,0xbb,0xee,0x5c,0x6a,
-  0x4c,0x2b,0x61,0x7d,0xed,0x6d,0x1e,0xf1,0xbc,0xaf,0x3a,0xfa,0x76,0x93,0x5d,0xff,
-  0x19,0x61,0x8f,0xf6,0x08,0x0b,0x44,0x2c,0xfe,0x15,0x17,0xc0,0x72,0x88,0xa5,0xe7,
-  0xf3,0x78,0x96,0xff,0xc7,0xa9,0xff,0xfc,0x0a,0x74,0xb7,0x7a,0xe9,0xfe,0xf7,0xe9,
-  0xf5,0xc6,0x7d,0xf1,0xe2,0x21,0xe5,0x15,0x78,0x3c,0x3b,0xff,0x3d,0x93,0xff,0x25,
-  0xb2,0xe3,0x6d,0xfe,0x8f,0x42,0xb4,0x1f,0xc4,0x4b,0x1f,0x8e,0xcf,0x7f,0xcf,0xe2,
-  0xff,0x8c,0xfa,0xaa,0x34,0x02,0xa2,0xca,0x98,0x45,0xfb,0xd1,0x45,0x21,0x6e,0xe2,
-  0xdb,0x67,0xc6,0xdb,0xf5,0x9f,0x75,0x36,0x0c,0x4f,0xc1,0x56,0x44,0x3b,0xc5,0xc3,
-  0x50,0x9f,0xea,0x20,0xda,0xcf,0x0e,0x78,0x14,0xaa,0x45,0xfe,0xbb,0xf3,0x7e,0x83,
-  0x9d,0xbe,0x8c,0xfe,0xd9,0x6d,0x5a,0x7c,0x15,0xe8,0x8e,0x56,0x0c,0xa9,0x61,0xe6,
-  0xb3,0x19,0x9b,0x19,0xbe,0x50,0x19,0x4c,0xca,0xf8,0x6f,0x1f,0x33,0xca,0x53,0xea,
-  0x3d,0x6c,0x33,0xdf,0xcb,0x2b,0xf8,0x4d,0x35,0x28,0x3c,0xac,0x4d,0xb1,0xf2,0xdf,
-  0x9d,0xeb,0xc7,0x26,0x6b,0x7f,0xe6,0xa2,0xda,0xe1,0x1b,0x70,0x81,0xef,0x4a,0x85,
-  0xa8,0x6c,0xe9,0x89,0xf6,0x6b,0x13,0xbe,0xe5,0x72,0x7d,0xc5,0xf3,0xb1,0xbb,0xe9,
-  0xd4,0x01,0xfb,0xf6,0x41,0x9d,0xe4,0xf2,0xff,0x8c,0xa9,0x75,0xbd,0xfe,0x5d,0x1d,
-  0x23,0xfc,0x0c,0x88,0x32,0xc8,0xef,0x9b,0x7f,0x8c,0x8a,0x53,0x87,0x9c,0xf8,0x94,
-  0x69,0xd7,0xff,0x19,0x93,0x8f,0xa3,0xbe,0xda,0x9d,0x92,0x7b,0xe4,0x7a,0xfd,0x69,
-  0x5e,0xff,0x65,0x85,0x0c,0xd9,0x91,0xce,0xd9,0x43,0x54,0xff,0xc7,0x99,0x9f,0x47,
-  0x0b,0x37,0x1b,0x7b,0xb5,0x19,0x54,0xdd,0xe8,0x30,0xec,0xd5,0xb6,0x98,0xde,0x6f,
-  0xcb,0xb7,0xc3,0x0f,0xcb,0x42,0xa1,0xd0,0x32,0x54,0x8c,0xbf,0x05,0x51,0xc8,0x31,
-  0x13,0xff,0xda,0x24,0xf2,0xbf,0xac,0xe7,0x45,0x7d,0x3b,0x85,0x1c,0x41,0x93,0xe0,
-  0x31,0x69,0x86,0xba,0x9a,0x0a,0x77,0xfc,0x10,0xca,0x7a,0xaf,0x5c,0xe6,0xca,0xef,
-  0xbb,0x2b,0x53,0x7f,0x95,0x84,0xed,0xa4,0xff,0x17,0x48,0x0f,0x44,0x43,0xa0,0x86,
-  0x8b,0x96,0x2a,0x3f,0xb6,0xea,0x3f,0x67,0xf2,0xbf,0x4e,0x97,0xd8,0xfa,0x13,0xd5,
-  0xd4,0x19,0xa3,0x7a,0x10,0xb5,0x6b,0x1d,0x69,0x24,0x23,0x9f,0xe2,0x05,0x6f,0x5a,
-  0x1e,0x8f,0xb7,0xb2,0xf2,0xdf,0xad,0xf1,0x13,0x46,0xd4,0x53,0x15,0x55,0x07,0xd2,
-  0xc4,0x57,0x5c,0x21,0x61,0x77,0xfd,0x43,0x7b,0x7c,0xaf,0x96,0xd1,0xe7,0x68,0xf8,
-  0x44,0xd9,0xe7,0x3a,0x38,0xaf,0xcf,0x0b,0xfb,0xe8,0xfa,0x47,0xac,0x23,0x19,0xfb,
-  0xd8,0xdb,0xe9,0xe2,0xf3,0x24,0x2d,0xb7,0x03,0x79,0x00,0x2a,0x25,0x35,0x29,0xef,
-  0x64,0x5d,0x08,0x84,0x28,0xfe,0xe2,0xbc,0x5f,0x97,0xff,0x67,0x04,0xf6,0x31,0x51,
-  0xa6,0x98,0x8e,0x90,0x5b,0x23,0x40,0x89,0xf3,0x01,0xcb,0xff,0x63,0xff,0x5c,0xfe,
-  0x9f,0x01,0xbe,0x1b,0xf7,0xfb,0x54,0xa8,0x0d,0xb6,0x19,0x21,0x75,0x89,0x15,0x28,
-  0x14,0xfa,0x39,0x83,0x7f,0xd2,0xf9,0x5f,0xc2,0x9e,0x1a,0x7f,0xc2,0xab,0xa1,0xe1,
-  0xa8,0x23,0xfb,0xab,0xe0,0xfd,0x4f,0x82,0xe7,0xad,0xf9,0x71,0xd5,0x7f,0xfe,0x89,
-  0xe5,0xff,0x99,0x30,0xda,0x71,0xd6,0x14,0xfe,0x8d,0x93,0x32,0x55,0x00,0x98,0x57,
-  0x3a,0x03,0x0d,0x7d,0x22,0x3d,0x15,0x99,0xfa,0x84,0xe4,0xff,0xf9,0x13,0x9f,0xbd,
-  0x18,0xaf,0x16,0xe2,0x17,0xda,0x71,0x21,0xb5,0xcb,0xe7,0x8d,0x23,0xb8,0x91,0xf7,
-  0x9f,0x28,0xaf,0x84,0xd7,0x61,0x76,0x2a,0xff,0xa2,0xfc,0xaf,0x0a,0xbd,0x1f,0x1e,
-  0xff,0x7c,0xa5,0x48,0x04,0xf3,0xae,0x2d,0xdf,0xa9,0xfe,0x9c,0xfa,0x5f,0x7c,0x58,
-  0xb4,0x13,0xee,0x97,0x02,0x29,0xd5,0xcd,0xff,0xe9,0xcf,0x19,0x50,0x76,0x79,0x02,
-  0x91,0xbc,0x39,0xed,0x3e,0x43,0x3c,0xb8,0xc4,0x06,0xda,0xba,0xac,0x65,0xb0,0x16,
-  0xe1,0xec,0x56,0xaa,0xf8,0x97,0xa9,0xf7,0x42,0xfe,0x9f,0x5d,0x78,0xb5,0x3c,0x6b,
-  0x1a,0x11,0x46,0xae,0x14,0xc4,0x60,0x31,0x8d,0xff,0x46,0xfa,0x3c,0xa6,0xba,0xe3,
-  0x5f,0x06,0xad,0x1f,0x33,0x99,0x9a,0x91,0xf4,0x54,0x46,0xd2,0x89,0x93,0x23,0xca,
-  0x0b,0xc4,0xff,0x09,0xcb,0xab,0x48,0x3f,0xbc,0x84,0x0b,0xc9,0x74,0xf8,0x3f,0x88,
-  0x7f,0xe0,0x02,0x6b,0xa0,0x68,0xe9,0x88,0x26,0x26,0xca,0x94,0xed,0x15,0xd2,0x71,
-  0x12,0x4e,0x4b,0x33,0x53,0xde,0x71,0xfe,0x1f,0xfc,0x1e,0xab,0xcd,0x82,0x5d,0xa2,
-  0xbe,0x1f,0x5e,0xbf,0x5d,0xb6,0x57,0xec,0x84,0x0a,0x30,0x75,0xc1,0x88,0xfe,0x95,
-  0x63,0xbf,0x04,0xfe,0x39,0x1a,0xe8,0x57,0xcf,0x05,0x66,0x70,0xe1,0x2d,0xec,0x64,
-  0xe9,0x15,0x72,0x52,0x5e,0xcc,0xd6,0x48,0xa2,0x7e,0x54,0x26,0xff,0x6b,0x18,0xf1,
-  0xcf,0x2e,0xa8,0x38,0x81,0x07,0x6f,0x26,0x76,0xca,0x90,0x17,0x9a,0x46,0xa4,0xfd,
-  0x34,0x3f,0x75,0x90,0xdf,0x96,0xe8,0x0c,0x70,0xd5,0x1d,0xff,0xfa,0x50,0x9a,0x0c,
-  0x4f,0xc7,0xa9,0xc9,0x05,0x9b,0x0c,0x0f,0x27,0x66,0x1c,0xf3,0x1e,0x24,0x62,0x5e,
-  0xbb,0x40,0x08,0x93,0x0f,0x3d,0xc4,0xb7,0x8c,0xaa,0xcb,0xe1,0x6c,0x86,0xff,0x23,
-  0xf0,0xcf,0x9c,0xc1,0x50,0x8d,0xf7,0x46,0xf3,0x99,0x44,0x88,0x68,0x75,0x03,0xf0,
-  0x91,0x56,0x37,0xe2,0x4f,0xb6,0x57,0xf2,0x54,0x5e,0xb8,0x33,0x14,0x96,0x5f,0x1d,
-  0x5f,0xff,0x90,0xd8,0x3e,0x27,0x95,0x0b,0x94,0x5f,0x39,0xab,0xf9,0x49,0x0b,0x16,
-  0x26,0xbd,0x67,0x23,0xaf,0xc0,0x3c,0x7e,0x51,0xfd,0xe7,0xd3,0xbc,0xda,0xf4,0xed,
-  0xb2,0xab,0x41,0xf2,0xb4,0xb0,0xf0,0xb1,0x67,0x46,0xa4,0xfe,0xc5,0x55,0x7c,0x9d,
-  0x9b,0xff,0x63,0xe5,0x7f,0x95,0xf1,0xb5,0xa3,0x1e,0x0a,0x7b,0x5d,0x87,0xdb,0x28,
-  0x39,0xed,0x51,0xbf,0x47,0xde,0x0c,0x0f,0xe5,0x95,0x11,0xff,0xe7,0xb4,0x83,0xaf,
-  0x28,0xff,0xeb,0xf1,0xf6,0x2f,0x11,0xa9,0xfb,0x32,0xfb,0x31,0xdf,0xb0,0x10,0xd1,
-  0xb7,0xd9,0x79,0xe8,0x34,0xa7,0x24,0x05,0xfe,0xb1,0x7f,0x56,0xfe,0x57,0x62,0x8f,
-  0x1a,0xb6,0xfa,0x89,0x10,0xba,0xb6,0x10,0x66,0x57,0x92,0xfd,0x31,0xb8,0x95,0x57,
-  0xa4,0xb2,0xea,0x6f,0x08,0xff,0x4f,0x74,0x16,0x0f,0x25,0x58,0xd0,0x0a,0x84,0xa5,
-  0x64,0xa7,0x22,0xd0,0x19,0xfe,0xdc,0x33,0x7b,0xf7,0xac,0xbb,0x28,0xfe,0xa5,0x52,
-  0xb6,0x57,0x39,0x75,0xbb,0x48,0x97,0xfd,0xb1,0xf9,0xa8,0x30,0x16,0xa9,0xbd,0x64,
-  0xfc,0xab,0x89,0xca,0x3e,0x53,0xe0,0x63,0xf1,0xe4,0xc2,0x74,0x7c,0x04,0xf1,0xc0,
-  0x62,0x78,0x97,0x93,0x7f,0x60,0x3c,0xfe,0x31,0x28,0xed,0xc8,0x33,0x05,0x0d,0xf1,
-  0xd7,0xef,0x54,0xe3,0x4d,0x15,0x92,0x65,0x91,0xe5,0xa9,0xc6,0xdf,0x41,0x70,0x99,
-  0x2f,0xce,0x52,0x9a,0xdb,0xff,0xb3,0x5f,0xad,0x34,0x82,0x08,0x7b,0x7c,0x8f,0x40,
-  0x41,0xab,0x27,0x9e,0xbb,0x5d,0xdb,0x07,0x53,0xc9,0x4c,0x2f,0x86,0x3c,0xed,0xae,
-  0x45,0x6a,0x56,0xfc,0x0b,0x9c,0xfc,0x2f,0x85,0xef,0x62,0x95,0x46,0xa4,0x48,0x38,
-  0xa2,0x43,0x8d,0x5e,0x12,0x7e,0xa4,0x07,0x8d,0x9a,0x2c,0xfe,0x8f,0x4f,0xf0,0x9f,
-  0x29,0xff,0x2b,0x48,0x40,0xa8,0xc4,0x93,0x90,0xb7,0x44,0x7a,0xa0,0x9a,0x3a,0x62,
-  0xdc,0xd9,0xf4,0x56,0xab,0x30,0xc4,0xe7,0xb3,0xfd,0x3f,0x6c,0x1e,0x3e,0xdd,0xa7,
-  0x4e,0x1a,0x94,0x18,0xe5,0xbf,0xc5,0x2e,0x6b,0xbc,0x1e,0xdf,0xef,0xfb,0x5a,0x83,
-  0x91,0x8b,0xf8,0xc7,0xa9,0x9f,0x43,0xf8,0xe7,0x1c,0x63,0x86,0xef,0x07,0xf2,0x49,
-  0xf5,0x20,0x05,0xee,0x07,0x3b,0x1e,0x4c,0x23,0xa2,0x8e,0x39,0xc6,0x8b,0x25,0xb3,
-  0x44,0xfd,0x43,0x67,0x3f,0x65,0xe1,0x1f,0x1d,0xd4,0xe7,0xd8,0x31,0xf5,0xa8,0x54,
-  0xa9,0x7a,0x3b,0x03,0x09,0x2e,0x10,0x11,0x15,0x82,0x5e,0x73,0xcb,0xc5,0xf1,0xaf,
-  0xbc,0x5d,0xc4,0xe7,0xb9,0x2d,0xf0,0x2c,0xb4,0x41,0xa8,0x89,0xd2,0xfc,0x2d,0x44,
-  0x14,0x6e,0xaf,0xe0,0x6d,0x65,0x7a,0xf4,0xa2,0xfc,0xf7,0x5d,0xed,0xdb,0x0c,0x75,
-  0x30,0x30,0x82,0xbb,0xf5,0x4a,0xe3,0xc7,0xf1,0xad,0x36,0x22,0xf2,0x54,0xb0,0x36,
-  0x25,0x10,0xb9,0x28,0xff,0xfd,0x1c,0x9f,0x6d,0x04,0xe9,0x26,0x0f,0xd2,0x6d,0x6b,
-  0xcd,0x0e,0xc2,0x99,0x02,0x07,0x4d,0x11,0x11,0x73,0xc7,0xbf,0x04,0x3b,0xba,0x69,
-  0x61,0x5c,0xee,0xe3,0xa7,0xa0,0xb2,0xd9,0xbf,0x41,0xb6,0x32,0xc8,0xd2,0xfd,0x2f,
-  0xc4,0xa9,0xf1,0xf1,0xaf,0x06,0xf0,0x99,0xb2,0xae,0xa6,0x13,0xc1,0x74,0x6d,0x2c,
-  0x97,0xc2,0x5e,0xcd,0xba,0xde,0x2f,0x80,0x10,0x3b,0x90,0x15,0xff,0x7a,0xa2,0x34,
-  0x94,0x54,0x87,0xd9,0x75,0x54,0x08,0x31,0xa1,0xbe,0xcb,0x76,0x68,0x02,0x11,0xa5,
-  0x58,0x29,0xdc,0xaf,0x6c,0x5b,0x9f,0xc5,0xff,0xa1,0xfc,0xf7,0x6e,0x33,0x14,0x56,
-  0x55,0xa6,0x72,0x91,0xb8,0x34,0x8f,0xf2,0x53,0x72,0x51,0x51,0x27,0x98,0x9f,0xf2,
-  0x2f,0x46,0xf3,0xdc,0xfc,0x9f,0x32,0x09,0xad,0xbf,0x3e,0xe3,0x80,0x5a,0xd3,0x3e,
-  0x89,0x80,0xc1,0x68,0x9e,0xce,0x10,0x51,0x88,0x8e,0x36,0xec,0x72,0x58,0x05,0xf2,
-  0x68,0x5e,0x56,0xfd,0x43,0xca,0xff,0x32,0xe7,0x05,0x43,0x11,0xef,0x64,0xf8,0x9f,
-  0x6d,0x0d,0x89,0x19,0x11,0x9b,0xff,0xa3,0xca,0xf5,0xec,0x08,0xbf,0x3b,0x95,0x9f,
-  0xc5,0xff,0xb9,0x6a,0x27,0x8c,0x71,0x51,0xe4,0x70,0x44,0xd9,0x8f,0x0f,0x5e,0x80,
-  0xfa,0x5c,0x4f,0x9b,0xf5,0x61,0x46,0x42,0x65,0xf2,0x73,0xd9,0xf5,0x0f,0xd1,0x7e,
-  0xbd,0xe5,0x7f,0x44,0xbe,0x09,0x3e,0x88,0x37,0x6c,0xf7,0x7d,0x46,0x7e,0x0a,0x05,
-  0xbc,0xc2,0xc1,0xbf,0x29,0x37,0x8e,0xac,0x6f,0x18,0xf2,0xf7,0x14,0xc7,0x33,0xf1,
-  0x26,0xc4,0x3f,0x8f,0x41,0x99,0xe6,0x5d,0xc4,0x5e,0xe5,0x1d,0xda,0x8c,0x84,0x7a,
-  0x13,0xde,0xff,0xaa,0xc4,0x8c,0x61,0x3c,0xb2,0x81,0x34,0x2a,0x69,0x98,0x0c,0xfe,
-  0x89,0xc3,0xe6,0xc8,0x1e,0x98,0x72,0xc0,0xfb,0x55,0xf6,0xba,0xf1,0x70,0xd1,0x8c,
-  0x98,0x6a,0x4c,0x7d,0xdd,0xaa,0xa0,0x68,0xb0,0x52,0xbe,0x2a,0x3c,0xe3,0xa8,0x77,
-  0x59,0x53,0x67,0x16,0xff,0x30,0xc9,0x2b,0x74,0x5c,0x54,0xfd,0x20,0x43,0x08,0x82,
-  0x60,0xf3,0xc9,0x35,0x16,0xd3,0xb7,0xb5,0x2c,0xed,0x1b,0x57,0xff,0x70,0x27,0x9c,
-  0xe0,0xd5,0x29,0x7f,0xa2,0x58,0xf0,0x37,0xc8,0xdb,0x79,0xd6,0x86,0x31,0xba,0xfa,
-  0x0c,0xab,0x4b,0xa2,0xf0,0xa8,0xb3,0x7e,0xa8,0xff,0xc5,0xa9,0x30,0x2a,0x99,0xf8,
-  0xec,0xc5,0x39,0x69,0x7d,0x2b,0xea,0xd1,0x99,0x57,0x27,0xe5,0x28,0x9c,0x0e,0xd7,
-  0x0f,0x8a,0xd0,0x98,0x3d,0x3f,0x6d,0x1a,0xe5,0x83,0xcf,0x3e,0xb0,0x20,0x45,0x66,
-  0x4e,0x9a,0xdb,0xf9,0xd9,0x43,0x56,0x3e,0x14,0xf1,0x57,0x4f,0xb0,0x37,0x61,0xb6,
-  0xe1,0x1b,0x75,0xf5,0x67,0x31,0x11,0xff,0xf4,0x40,0x20,0x1c,0xdc,0x04,0x53,0xd1,
-  0x6c,0x51,0x35,0xad,0xa6,0x11,0xdc,0xbf,0x57,0x9a,0x79,0xbb,0x3a,0x52,0xed,0xab,
-  0x73,0xab,0x29,0x7e,0xf1,0xae,0x9b,0xff,0xac,0xee,0x03,0xbd,0x4f,0x2d,0xc3,0x4f,
-  0xf0,0xe7,0x52,0x25,0x97,0x78,0xd1,0x48,0xe1,0x8f,0xa9,0xec,0x4c,0x5c,0x37,0x79,
-  0x17,0x0f,0x8c,0x5e,0x54,0xff,0x10,0xc7,0x43,0xac,0x64,0x0d,0xc0,0x6e,0x2d,0xc4,
-  0xbd,0xb9,0x04,0x14,0xcb,0x7c,0x7d,0x79,0x1a,0x33,0xf9,0x9a,0xed,0x53,0x0f,0x40,
-  0x15,0x3b,0xb0,0x02,0xec,0xeb,0xe7,0x2d,0xa5,0x6a,0xab,0xa6,0x6f,0xbb,0xbc,0xd3,
-  0x3c,0x03,0x95,0xb1,0xfb,0x56,0xb2,0xd7,0xb5,0xd7,0x82,0xf5,0xfd,0x9f,0xde,0x20,
-  0x8f,0xa6,0x5e,0x08,0x56,0x1d,0xf4,0x75,0xcb,0xa9,0x4c,0xfd,0xe7,0xfc,0xb3,0x25,
-  0x4f,0x4a,0x0d,0x80,0xfb,0xa9,0x0f,0xf9,0xd3,0x7a,0x9d,0xe2,0xef,0x10,0xf3,0x39,
-  0x73,0x00,0xf5,0x4f,0x9c,0x8b,0x88,0xea,0x87,0xf2,0xf0,0xc5,0xf5,0x7f,0x10,0x3f,
-  0xdb,0xc2,0x79,0x38,0xb7,0xbe,0x3a,0x71,0xff,0x51,0x99,0x4e,0xcd,0x4b,0x65,0xf5,
-  0xff,0x32,0xe3,0x2e,0xff,0xcf,0x0b,0xb6,0xb0,0x4f,0x0f,0x24,0xbc,0x9b,0xd8,0xd2,
-  0x18,0x9d,0xf2,0xb8,0xfb,0x5f,0xf4,0x83,0xc3,0x87,0x1f,0x50,0x76,0x83,0x8a,0xc2,
-  0x8d,0x03,0x94,0x6f,0x02,0x54,0x11,0x48,0x10,0x53,0x4b,0xb3,0xfb,0x7f,0x8d,0xd8,
-  0xfd,0xbf,0x32,0x8e,0x20,0x0a,0x2c,0xea,0x56,0x45,0x6e,0x9c,0x58,0x4f,0x92,0x65,
-  0xea,0xf3,0x48,0x13,0x45,0xd9,0xe7,0xb4,0xff,0xc1,0x4e,0x04,0x3b,0xa5,0x54,0xe9,
-  0x94,0xd1,0x46,0xa5,0x12,0x4c,0xd1,0x91,0xca,0x7e,0xbf,0x76,0xfd,0x67,0x77,0xf5,
-  0x6f,0xb1,0x1e,0x0c,0xff,0x87,0x1d,0xdf,0x4d,0x03,0xa1,0xe2,0x31,0xa7,0x1e,0x42,
-  0x8b,0x66,0xad,0xae,0x02,0x57,0x75,0x71,0xbc,0xbe,0x5e,0xaf,0xe5,0xa7,0x8f,0x1c,
-  0x08,0xb9,0xf3,0xbf,0x8e,0x3a,0x78,0x38,0x30,0xa2,0x66,0x88,0xf1,0xb1,0x4a,0xc4,
-  0xf3,0x24,0xdc,0x5d,0x79,0xd4,0x93,0x74,0xe5,0x7f,0xa5,0xdc,0xfe,0x1f,0xcb,0x71,
-  0x91,0x3b,0x80,0x16,0x70,0x29,0x17,0x1b,0xb1,0xdd,0x5c,0x04,0x8e,0x33,0xfe,0x1f,
-  0x3b,0xff,0x3d,0x03,0x03,0x50,0x50,0x1f,0x6b,0x9b,0xb1,0x2d,0x6f,0x79,0xe0,0x0d,
-  0xd5,0x3a,0x52,0xe4,0xc2,0x03,0x2a,0xc5,0xbf,0xea,0xa8,0x7e,0xe3,0x61,0x8b,0x08,
-  0x14,0x46,0xfc,0xf3,0x21,0xd4,0x25,0x7d,0xe1,0x0e,0x04,0x42,0x85,0x75,0xe6,0x8c,
-  0xac,0xfa,0x3f,0x57,0x51,0x91,0x67,0x2b,0x2c,0x68,0xb8,0x12,0x07,0x08,0xf6,0xb0,
-  0x74,0x29,0xf5,0x4b,0xf9,0x7f,0xae,0xb6,0xe7,0x47,0x4c,0xd4,0x29,0xa8,0xd3,0xd5,
-  0x9a,0x2b,0x43,0xea,0x77,0xa4,0x7a,0xca,0x20,0xfb,0x0b,0xfc,0x1f,0x47,0xf8,0x83,
-  0xf4,0x35,0xc8,0xb7,0xf6,0x53,0x33,0xcc,0x3c,0x77,0xfe,0x57,0xc6,0xff,0xd3,0x64,
-  0x3d,0x2f,0xb5,0xbd,0x80,0xc7,0xf8,0xcc,0x70,0x84,0x10,0xe0,0xde,0xf1,0xfc,0xe7,
-  0x4c,0xfd,0x67,0xe6,0xda,0x88,0x6d,0xe3,0x21,0x2d,0xaf,0x86,0x89,0x8a,0xd0,0x34,
-  0x9f,0x97,0xec,0x7f,0x31,0x2c,0x12,0xe1,0x45,0x21,0xa0,0xd3,0xfc,0x7b,0x49,0x5f,
-  0xa2,0x23,0x08,0x27,0xec,0xfa,0xcf,0xce,0xf5,0x1d,0xff,0x4f,0xb1,0x9b,0x08,0xa4,
-  0xd5,0x33,0xd1,0x8f,0xe9,0x28,0xe0,0xc2,0xc8,0xce,0xff,0x1a,0xb2,0xf9,0x1e,0x56,
-  0xe2,0x33,0x0a,0x6f,0x93,0x05,0xbc,0xd3,0xb2,0x77,0xbc,0xd6,0xb8,0x18,0xff,0x58,
-  0x45,0xf6,0x9c,0xea,0x85,0xef,0x10,0x22,0x5a,0x4c,0x1e,0x1e,0xe5,0x3a,0xae,0x2f,
-  0xf2,0x5c,0x5c,0xff,0x27,0xbb,0xdb,0xc5,0x90,0x9d,0x26,0x3f,0x84,0x78,0x66,0xba,
-  0x15,0xaf,0xb1,0x7f,0x6e,0xfe,0x8f,0x10,0xae,0xb4,0x05,0x87,0x21,0x43,0xf9,0x5f,
-  0xce,0xf8,0x0c,0xff,0x47,0x76,0x39,0x22,0x44,0xdb,0x8b,0x04,0xd5,0x3f,0x94,0x6a,
-  0xc9,0x22,0x1f,0xcf,0xbd,0xa4,0xff,0xc7,0x12,0x26,0x50,0x44,0x6c,0x26,0xe2,0x19,
-  0x70,0x4e,0x1d,0xcf,0xbd,0xc8,0xff,0xe3,0xaa,0xfe,0x47,0x69,0xef,0x04,0x84,0x8a,
-  0x2b,0x8c,0xfb,0xf0,0xc3,0xc4,0xf9,0x39,0x24,0x5d,0xec,0xff,0x11,0xfc,0x1f,0x51,
-  0xed,0x30,0xa5,0x1e,0xc5,0x23,0x5d,0x9c,0xe9,0x5a,0x4c,0xa9,0xa5,0x8a,0xd0,0xae,
-  0xfc,0xaf,0x9c,0xbe,0xec,0xe7,0x15,0x42,0x9b,0x14,0x32,0x24,0xcd,0xd3,0xc9,0x49,
-  0x88,0x5d,0xa2,0xfe,0xb3,0xe5,0x4f,0x23,0xda,0x79,0x7a,0x1a,0x2b,0x3f,0x23,0x88,
-  0x58,0xab,0xc1,0x23,0xe6,0x33,0x93,0xff,0x35,0x31,0xeb,0xfe,0xad,0x30,0x16,0xac,
-  0xee,0x24,0x20,0x54,0xbc,0x9d,0x51,0x45,0x68,0xbc,0xff,0x4b,0xd5,0xff,0x91,0xb3,
-  0x27,0x8a,0xd6,0xc3,0x62,0x54,0x5c,0xb5,0xc4,0xf7,0x7e,0xb5,0xd3,0x9e,0x7f,0xc4,
-  0x3f,0x6a,0x66,0xda,0x15,0x72,0x33,0x4a,0x84,0xc0,0xed,0x23,0x2a,0x2e,0x3c,0x77,
-  0xfe,0x97,0xab,0xff,0x97,0xdd,0xed,0x02,0xd1,0xcb,0x53,0xbc,0xb2,0x6d,0xfe,0x10,
-  0x1b,0x2e,0x79,0x2a,0x31,0x33,0x46,0xfe,0x1f,0xdd,0xb9,0x7e,0xe7,0x82,0x4b,0x7c,
-  0x2f,0xbb,0x8d,0x90,0x39,0xbf,0x82,0x8f,0x10,0x34,0xb2,0xfc,0x3f,0x4e,0xfc,0x2b,
-  0xc3,0xff,0x71,0xbe,0xdf,0xdf,0xc1,0xe3,0xc6,0x8c,0x66,0x6f,0x94,0xbd,0xce,0xd3,
-  0x47,0x5c,0xf9,0xef,0xb1,0x3b,0xb4,0x34,0xff,0xe7,0x0d,0x9b,0x08,0xf4,0x1b,0xf8,
-  0x73,0xfb,0xbc,0xa8,0x77,0x49,0xf9,0x9b,0xfc,0x63,0x3c,0x72,0xf5,0x72,0xf9,0x90,
-  0xa3,0x7f,0x10,0xff,0x48,0x2e,0x7d,0x2e,0x14,0xcb,0x10,0x9c,0x26,0xb3,0x95,0x40,
-  0x43,0x73,0x0a,0x2d,0x6c,0x56,0xff,0x0b,0xc7,0x7e,0xf5,0xc8,0xc7,0x6d,0x47,0xd0,
-  0xe3,0x70,0x36,0x5e,0x1f,0xf5,0x0d,0xcb,0x95,0xf0,0x5d,0x3e,0x7b,0x68,0x7c,0xfe,
-  0x17,0xa1,0x35,0x73,0xfe,0xb7,0x49,0x7f,0x6a,0x69,0x22,0xd3,0xe3,0xdb,0xbf,0xf6,
-  0xf6,0x67,0xa3,0xf2,0xe4,0xfe,0x3d,0xc6,0xb5,0xd9,0xf9,0x5f,0x1a,0x4f,0xeb,0xab,
-  0xbb,0xd9,0xeb,0xab,0xd3,0x4f,0xb7,0x11,0xf6,0xe8,0x33,0xa9,0xc2,0xc9,0xed,0xf0,
-  0x10,0x94,0x99,0x59,0xf9,0x5f,0x7a,0xb6,0xff,0xc7,0x22,0x02,0x49,0xdd,0xf1,0x50,
-  0xab,0x14,0x06,0x1f,0x24,0xad,0x42,0x1c,0x19,0x7b,0x31,0x36,0xd1,0xde,0x4d,0x17,
-  0x8f,0xd8,0x8d,0x30,0xb6,0xa3,0x85,0xad,0x6f,0x55,0xf4,0xf2,0xef,0xe2,0x17,0x17,
-  0xa6,0x8c,0x9b,0x4c,0xfe,0x17,0x97,0x32,0xfe,0x9f,0x0c,0x11,0x68,0xcc,0xa8,0x37,
-  0xd7,0x75,0x8a,0x42,0xd0,0x16,0x50,0x74,0xf4,0x9b,0x99,0xed,0xff,0x11,0xc2,0xc7,
-  0xc6,0x79,0x98,0xfd,0x7b,0xdc,0xe8,0xd5,0x09,0xaa,0x70,0x56,0xff,0xaf,0x15,0x69,
-  0xfe,0x4f,0x97,0xcb,0xfe,0x0e,0x41,0xb2,0x77,0xfa,0xe2,0xab,0xdb,0x58,0x88,0x3e,
-  0xbd,0x13,0xbe,0xec,0xfc,0x2f,0xc7,0xff,0xb3,0x34,0x33,0xbe,0x27,0x16,0xe8,0xf5,
-  0x6e,0x2f,0x0a,0xa9,0x3d,0x7a,0x65,0x2a,0x3b,0xff,0x4b,0xf8,0x7f,0x2a,0x88,0x9f,
-  0xf9,0xa2,0x9d,0x96,0xd2,0x87,0x1f,0xb2,0x1e,0x89,0x51,0xe1,0xcd,0xa4,0x95,0x0a,
-  0xed,0xf2,0xff,0x5c,0x95,0xee,0x7f,0xd1,0x2d,0xbf,0xcf,0x89,0x28,0xf5,0xf7,0x54,
-  0xdd,0xb1,0x07,0xaa,0x6e,0x9b,0x9f,0x2c,0x0e,0xf1,0x31,0x49,0xa4,0x66,0xbb,0xf2,
-  0xbf,0xd2,0xfe,0x1f,0xff,0x87,0xe5,0x67,0xe3,0xe9,0xe7,0x3d,0x89,0xfa,0x79,0xde,
-  0x80,0xbf,0x15,0x2d,0xda,0x49,0x98,0x47,0xf6,0x2b,0x13,0xff,0xb2,0xd7,0x4f,0xbe,
-  0x48,0x7b,0xd7,0xab,0x53,0x0b,0xe2,0xcd,0x4f,0xc1,0x6b,0x7c,0x77,0x6a,0x5d,0xb7,
-  0x7c,0xde,0xf8,0x68,0xc5,0xdc,0xe8,0x82,0xb1,0xe6,0xd1,0x56,0x87,0xff,0x93,0xae,
-  0xff,0xac,0x22,0xec,0x29,0x7d,0xda,0x0c,0xa4,0x54,0x4e,0xfc,0x52,0xf2,0xff,0x9c,
-  0x0d,0x8c,0xf0,0xfd,0xed,0x81,0xa8,0xda,0x23,0x27,0x1d,0xfb,0x68,0xd7,0x7f,0xce,
-  0xb3,0x3e,0x2b,0x3d,0x11,0xd3,0x3c,0x6b,0x45,0x86,0xb2,0x3c,0x87,0x0d,0xe0,0x13,
-  0x55,0x18,0x79,0x54,0xff,0x47,0x77,0xee,0xc7,0xae,0xff,0x23,0xe6,0xff,0xd1,0x54,
-  0x70,0x93,0xf0,0x9f,0x90,0xff,0x07,0x08,0x48,0x4c,0x35,0xf2,0xb2,0xea,0x1f,0xba,
-  0xfa,0x5f,0x50,0x22,0x12,0x5f,0xb0,0xf6,0x81,0x9d,0xf0,0x9a,0xc8,0xcf,0x6a,0x1e,
-  0x81,0x8f,0xcc,0x39,0x08,0x3c,0xca,0x4d,0x57,0xfe,0x57,0x66,0x3d,0xc0,0x9f,0x45,
-  0xd9,0x43,0xe9,0xac,0xfe,0x34,0x35,0x2a,0x1d,0x6d,0xc6,0xd5,0x00,0xd7,0x1b,0x05,
-  0xa3,0xe5,0x2e,0xfe,0xb3,0x3b,0xfe,0x85,0x42,0xc2,0xb7,0xc1,0x1b,0x92,0xd2,0xb4,
-  0x67,0xe1,0xe8,0x18,0xb8,0x44,0xfd,0xc3,0x50,0xbf,0x80,0x6d,0x4f,0x2b,0x3e,0x53,
-  0xdd,0xc8,0x66,0xc2,0xaf,0x89,0xc1,0x35,0x8a,0x0f,0x72,0x1d,0x04,0x46,0x6f,0x4e,
-  0xde,0x9a,0xf1,0xff,0xd8,0xf5,0x9f,0xbd,0xe1,0x2a,0x31,0x51,0x54,0xf8,0xce,0x9f,
-  0x61,0x44,0xef,0x86,0xc4,0x32,0xaa,0x0f,0x79,0x71,0xfd,0xe7,0x6f,0x93,0xdb,0x87,
-  0xff,0xf7,0x51,0xf5,0x3b,0x1e,0xe1,0x08,0x1a,0xf6,0xd6,0x00,0x7e,0xd1,0xf1,0xb2,
-  0xe8,0x15,0xcb,0x99,0xdb,0xff,0xb3,0xc0,0xea,0xff,0x55,0x2b,0x1f,0x36,0x11,0xff,
-  0x84,0x7c,0x3f,0x2a,0xf6,0x05,0x76,0xf3,0xba,0x61,0xff,0xf5,0xf2,0xfd,0xf0,0x51,
-  0xb2,0xd4,0xb8,0xfa,0x7a,0x37,0xff,0x39,0x27,0x3d,0x3f,0x1f,0x0a,0xd8,0x3c,0xcf,
-  0x7c,0x9a,0xa6,0xe5,0x4d,0xa0,0x46,0xa8,0xde,0x3a,0x3c,0x75,0xa5,0x91,0xd5,0xff,
-  0x82,0xf2,0xdf,0x5f,0x73,0xe6,0xbf,0x08,0xd5,0x72,0x1c,0xd5,0x8e,0x98,0x9f,0xbd,
-  0x1d,0x23,0xda,0x47,0x30,0xe7,0x4e,0x5f,0x56,0xfe,0xd7,0xe5,0x6e,0xfc,0x43,0xfa,
-  0x67,0x94,0x6d,0xc6,0x6d,0xe3,0x75,0xa6,0x6c,0x69,0xd4,0x69,0x86,0x9a,0x9d,0xff,
-  0x65,0xe3,0x9f,0x5c,0x81,0xee,0xa2,0xde,0x45,0x45,0x77,0x68,0x0f,0x67,0x10,0xe0,
-  0x83,0xa9,0xe9,0x59,0xf1,0x2f,0x25,0x5b,0xff,0x0c,0xce,0xdf,0xc3,0xa8,0x7e,0x5a,
-  0xd0,0x3a,0xd2,0xcd,0x82,0x94,0x91,0x91,0x9d,0xff,0xe5,0xc2,0x3f,0x0d,0xdc,0xff,
-  0xb6,0x77,0x09,0xbc,0x97,0x3e,0xa2,0x9e,0x1f,0xad,0x4e,0x14,0x50,0xfe,0x97,0xfd,
-  0xbc,0xae,0xfa,0xcf,0xb6,0x3d,0x2a,0x4f,0xc0,0x26,0x91,0x11,0xdf,0x6c,0x39,0x82,
-  0x72,0xc8,0xff,0x63,0xaf,0xb7,0x74,0xfd,0xe7,0xd6,0x34,0x3f,0x96,0x1c,0x41,0xde,
-  0xc5,0x56,0x1b,0x2c,0xad,0xb8,0x42,0x44,0xc4,0xc6,0xd7,0x3f,0x24,0xfb,0x1b,0xf5,
-  0xda,0xfd,0xa7,0xd4,0x8d,0x6b,0xae,0x71,0x22,0x32,0xd2,0x87,0x22,0x22,0xe6,0xea,
-  0x7f,0x5a,0xe3,0xc6,0x3f,0x8f,0x40,0x65,0x63,0x70,0xbd,0xe7,0xcb,0xe2,0xc8,0xff,
-  0x23,0x88,0x2b,0x38,0xbe,0xcb,0xed,0xff,0x71,0xea,0x3f,0x5b,0xd5,0x9e,0x2b,0xa3,
-  0xe4,0x08,0x82,0x59,0xb0,0xd4,0xf0,0x16,0x7d,0x55,0xb1,0xa9,0x32,0xe3,0xea,0x1f,
-  0xda,0xcf,0x4b,0xf9,0xfe,0xea,0x0a,0xb9,0x31,0x5d,0xf6,0xb0,0xb9,0xcc,0xe8,0xb1,
-  0xe2,0x2f,0x99,0xfc,0xaf,0x4d,0x6e,0x3c,0xb0,0x4f,0x6b,0x30,0x16,0xfe,0x2a,0x5d,
-  0xdf,0x98,0xe2,0x5f,0xca,0x39,0x78,0x3a,0x3b,0xfe,0x65,0x8d,0x6f,0x48,0xc3,0x00,
-  0x7d,0x9e,0xe1,0xff,0x95,0x3c,0x05,0x5e,0x4c,0x5f,0xa1,0xe5,0x7d,0x91,0x11,0xef,
-  0xca,0xff,0xca,0xe0,0x1f,0x99,0xf0,0xcf,0x57,0xc0,0xbf,0x82,0x41,0x7b,0xcc,0xe1,
-  0xff,0xc0,0xf4,0x71,0xfe,0x1f,0x48,0x7b,0x7b,0xb4,0x5c,0x7c,0x5e,0x43,0x14,0xbe,
-  0x56,0xc8,0x11,0x64,0x78,0x4b,0x58,0x1f,0xdf,0xd7,0xae,0x1b,0xf3,0xb3,0xf2,0xbf,
-  0x14,0x1b,0xff,0xe4,0x5a,0xc2,0x4d,0x71,0x8f,0x02,0xe9,0x7e,0x6a,0x7d,0xd2,0x23,
-  0xda,0x74,0xe3,0xca,0x38,0xb8,0xfa,0x5f,0x28,0x16,0x9e,0x59,0x47,0x78,0xe9,0x14,
-  0x35,0x2e,0xd9,0xe0,0xad,0xb0,0x1c,0x41,0x76,0xc4,0x33,0xab,0xff,0x45,0x24,0x1b,
-  0xff,0x54,0x93,0xbf,0x68,0xc4,0x85,0xa0,0x58,0x7d,0x24,0x8b,0xff,0xac,0x5a,0xf5,
-  0x7f,0x14,0xbf,0xf5,0xbc,0x55,0x9a,0xaf,0xb3,0x2b,0x2a,0x1a,0xa1,0x8a,0x23,0x47,
-  0xe1,0x9f,0x58,0x76,0xff,0x0b,0x0b,0xff,0x24,0xf2,0x2c,0xfc,0x53,0x1e,0x53,0x53,
-  0xec,0x51,0xed,0x50,0x1a,0x11,0x29,0xb9,0x0f,0xfe,0xcd,0x8e,0x6c,0xfe,0xf3,0xc4,
-  0x05,0xc4,0x4f,0xa0,0xa4,0xc8,0x01,0x6d,0x36,0x8b,0x8e,0xa9,0x73,0x98,0x09,0x0f,
-  0xd8,0xdf,0x4b,0x1b,0xe8,0xe1,0xf9,0xe1,0xa6,0x8c,0xff,0xc7,0xae,0xff,0x9c,0x27,
-  0xbe,0x56,0x4a,0xcc,0x0c,0x07,0xd6,0x8b,0xb2,0x87,0x57,0xe2,0x11,0x69,0x05,0xfc,
-  0xab,0x91,0xd5,0xff,0x22,0xe6,0xf4,0x3f,0x45,0xfc,0xf3,0x11,0x9f,0x95,0xf2,0x2d,
-  0xf2,0xbe,0x11,0xf8,0x2d,0xbf,0x8e,0x80,0xd0,0x05,0xde,0xd7,0xfe,0x98,0xee,0xcf,
-  0xf2,0xff,0xa4,0xf1,0x40,0xbe,0x15,0xd6,0xb9,0x97,0xcf,0x8c,0xcb,0x4b,0x33,0x1a,
-  0x38,0x45,0x3b,0x88,0x2c,0xff,0x4f,0x09,0xe5,0xbf,0xcf,0x4d,0x15,0xf4,0xd0,0xfe,
-  0x3d,0xfe,0xbd,0x25,0xfe,0x7d,0xde,0xd3,0x1a,0xd5,0xff,0x41,0x20,0xf4,0x81,0xf1,
-  0x01,0xdf,0x1b,0x45,0xfc,0xe3,0xf2,0x57,0x6b,0x16,0xfe,0xf1,0xd7,0x16,0x1d,0x8e,
-  0x89,0xc4,0xf6,0x11,0xa6,0xe5,0xac,0x82,0xd0,0x30,0xde,0xf6,0x61,0xd8,0x8b,0xf8,
-  0x47,0x0d,0xcb,0x8f,0x3a,0xf1,0xb2,0xd2,0x0c,0xff,0x59,0xa0,0x3b,0x75,0xfe,0xad,
-  0x01,0xb1,0x4d,0xeb,0x17,0x1a,0xec,0x21,0xb8,0x86,0xf4,0x95,0xbb,0xff,0x45,0xf6,
-  0xfe,0x2b,0xe1,0x95,0x8a,0x7c,0xe9,0x36,0x8e,0xa4,0x7f,0xf4,0x0a,0xb2,0xef,0x9b,
-  0x9c,0xf7,0xd5,0x53,0x68,0x79,0xcb,0x27,0xa7,0xed,0xcb,0x98,0x7f,0x53,0x40,0xf7,
-  0x50,0xfd,0xe4,0x85,0xc9,0xe2,0xb3,0xa8,0x88,0xaa,0x09,0xff,0xb8,0xfa,0x5f,0xa4,
-  0xe3,0x5f,0xe9,0xf1,0xf7,0xf6,0xe7,0x6f,0x94,0x1f,0x4c,0xfb,0x7f,0x10,0x1a,0x9d,
-  0x36,0x51,0xd5,0x24,0x9b,0xb7,0x68,0xf6,0xf3,0x26,0x44,0xfe,0xfb,0xf7,0x52,0xc4,
-  0xf7,0x10,0x85,0x10,0x17,0xb6,0x6e,0xab,0x33,0x8e,0xc0,0xf5,0xa8,0x78,0x51,0xb1,
-  0x9f,0x47,0x9b,0xec,0x77,0xfb,0x7f,0xb6,0x58,0xf8,0xa7,0x6f,0x5d,0x52,0x17,0xc2,
-  0xa6,0x67,0x36,0x7b,0x2b,0xd8,0x6b,0x02,0x98,0xa1,0x45,0xee,0xe6,0x81,0x65,0xfe,
-  0xec,0xfe,0x17,0x21,0x67,0x9b,0x2f,0x51,0x76,0xb6,0xbc,0x89,0x49,0xa2,0xfe,0x8f,
-  0x47,0x30,0x58,0xf4,0xc0,0x5d,0x94,0x18,0x9e,0xf1,0xff,0xdc,0xe6,0xb3,0xf9,0x09,
-  0x0b,0xf8,0x6c,0x3d,0x34,0xe8,0x55,0x3c,0x2d,0xf0,0x80,0x16,0x3a,0x40,0xfd,0xbf,
-  0xf4,0x6e,0xd2,0x3f,0x73,0x9a,0xdc,0xfc,0x9f,0x90,0x4a,0xfc,0x67,0xef,0xae,0x03,
-  0xef,0x9b,0x7f,0x84,0xda,0x56,0xff,0x06,0xaf,0x2f,0xa7,0x4b,0xa9,0x25,0xb3,0x7b,
-  0x0e,0x4e,0x6b,0xf8,0x7d,0xed,0x91,0x53,0x4e,0xff,0x9d,0xc4,0x44,0x51,0xff,0x90,
-  0xec,0xfb,0x77,0xcd,0x33,0x5a,0x43,0xbf,0xff,0x65,0xef,0x93,0xf0,0x41,0xc5,0x77,
-  0xfa,0x29,0x11,0x2c,0xf1,0x71,0xc5,0x3c,0xea,0x00,0x32,0x3c,0xf5,0x22,0xff,0x0f,
-  0x95,0xf1,0xb1,0xf0,0xb3,0x74,0x36,0x71,0x76,0x4e,0x38,0x0a,0x11,0x39,0x00,0xdf,
-  0xe3,0xb3,0xa3,0xb8,0x3e,0xc3,0x17,0xfb,0x7f,0x92,0x8c,0xe2,0x5f,0xf5,0xc4,0xf7,
-  0x7e,0x9f,0x27,0x0d,0x16,0x9d,0xd4,0x73,0x57,0x40,0xdd,0xcf,0xa7,0x47,0xf1,0x48,
-  0x32,0xb3,0xbf,0xce,0xf8,0x7f,0xa8,0x11,0x95,0xb5,0x0c,0xf4,0x9e,0x96,0xa8,0xa1,
-  0xea,0x0c,0x7c,0xbb,0xe9,0x79,0x93,0x9e,0x2a,0x67,0x7f,0x97,0x9a,0xe8,0x14,0xd9,
-  0x16,0x61,0x44,0x6b,0xda,0x7b,0xca,0x02,0x37,0xe6,0x25,0xdb,0x03,0xd2,0xfe,0xd6,
-  0xf4,0xf5,0xed,0xf7,0xbb,0x65,0xa2,0x5d,0xff,0xb9,0x23,0x24,0x88,0xe2,0x82,0x78,
-  0x73,0x3a,0xda,0x1d,0x0d,0x56,0x78,0xcb,0xe1,0x44,0x6f,0xd5,0x92,0x75,0x3d,0x1d,
-  0xe0,0xc4,0xbb,0x1d,0xfc,0x13,0xf6,0xda,0x81,0x42,0x99,0x96,0x41,0x43,0x2a,0x34,
-  0x5a,0x3c,0x26,0x5d,0x88,0x35,0xd0,0x7a,0xc8,0xae,0xff,0x23,0xd2,0xca,0xe2,0x99,
-  0x6e,0x5f,0x23,0xf0,0x5e,0xa4,0xf6,0xa8,0x2f,0x21,0xff,0x23,0xbc,0xd7,0x54,0x6f,
-  0xf8,0xf6,0xca,0x85,0xee,0xfa,0x87,0x16,0x0c,0xde,0x50,0x24,0x84,0x03,0xa2,0x10,
-  0x90,0xac,0xeb,0xfd,0x88,0x18,0xa7,0xc1,0x13,0x4d,0x95,0x5f,0xc9,0xd7,0x58,0xb5,
-  0x7d,0x3b,0x82,0xff,0x93,0x26,0xbd,0x8b,0x85,0x91,0x12,0xc4,0x95,0x04,0x1a,0x6e,
-  0x15,0x9a,0x1a,0xf9,0x36,0x5e,0x91,0x2a,0x9d,0x93,0x7b,0x9d,0xb3,0xff,0x4a,0x66,
-  0xfc,0x3f,0x42,0x38,0xa6,0xd2,0x46,0xa6,0x73,0xfd,0x94,0x61,0xf5,0x9f,0x6f,0x2c,
-  0x82,0xbd,0xb1,0x19,0xd1,0xbc,0xe1,0xdc,0x90,0xc3,0x1f,0x5e,0x92,0xf6,0xff,0xf8,
-  0x83,0xde,0x02,0x93,0x0a,0x21,0xfe,0xac,0x16,0xef,0x7f,0x6b,0xb2,0x6e,0x38,0x14,
-  0xee,0x68,0x7a,0xf9,0xf7,0x6c,0x8e,0xb1,0x20,0xec,0x75,0xf1,0x9f,0x6d,0xfe,0x4f,
-  0x4a,0xe4,0x7f,0x11,0x10,0xc2,0xfb,0x3f,0xaf,0xd7,0x0e,0x78,0x4f,0xca,0xa3,0xea,
-  0x05,0x6d,0x1e,0x41,0x23,0x57,0xfe,0xbb,0xcd,0xff,0x49,0x38,0xf3,0x83,0x1b,0x99,
-  0x31,0x8a,0x88,0x3d,0x29,0x07,0xd5,0x59,0x7a,0x15,0xf7,0x85,0xe5,0x0c,0xff,0xb9,
-  0x3f,0x9e,0xd6,0x27,0x3a,0x73,0x88,0x04,0xb7,0xf3,0x73,0xd6,0x36,0xaa,0x54,0x30,
-  0x82,0x50,0xa8,0xca,0xd4,0xdf,0xb6,0xf1,0xcf,0xa2,0x8c,0xb7,0xe7,0x0d,0xe3,0x71,
-  0x7e,0x4d,0xea,0xf2,0xef,0xb2,0x2b,0xa4,0x9f,0xb5,0x95,0x1d,0x53,0xcf,0x32,0x3d,
-  0xdb,0xff,0xa3,0xe0,0x7c,0x6e,0xbe,0xc9,0xa7,0xa4,0xd7,0xdb,0x52,0xd8,0xa6,0xe9,
-  0x6b,0xf3,0xe6,0x78,0x0a,0xf4,0xdd,0x45,0xba,0xb9,0x63,0x8e,0x9b,0xff,0x5c,0x92,
-  0xf6,0xff,0xbc,0x27,0x93,0xe1,0x48,0x03,0xa1,0xa7,0xf8,0x5c,0xfe,0xaf,0x3b,0xa5,
-  0xeb,0xf9,0x4b,0xe6,0xae,0xb8,0x6f,0x89,0x77,0x1c,0xff,0x59,0x58,0xff,0x8e,0x54,
-  0x26,0x31,0xa7,0xa7,0xad,0x5e,0xf3,0xf1,0x8e,0x63,0x30,0x16,0xa9,0x2f,0xf2,0xaf,
-  0xcc,0xe2,0x3f,0xa7,0xed,0xdd,0x66,0xbb,0x2c,0x4c,0xfc,0xd3,0x43,0xec,0x15,0xa8,
-  0x8f,0xa0,0x5a,0x5b,0x4c,0x88,0x3d,0xea,0xdb,0x04,0xec,0xe2,0xfe,0xa7,0x9b,0x3d,
-  0x16,0xb0,0x91,0x05,0xed,0x76,0x7d,0x28,0x8a,0xc0,0xf8,0x6d,0xd8,0xd7,0x52,0xbd,
-  0x4c,0xfd,0x49,0xbb,0x7e,0x89,0xfc,0xaf,0xf6,0xec,0x46,0x60,0x46,0x6c,0x13,0x1b,
-  0xe1,0xfb,0x1a,0x05,0x5f,0x7a,0xa5,0xb3,0xde,0x1c,0xff,0x4f,0xa1,0xc7,0xd5,0x08,
-  0xb5,0x4d,0x0f,0x99,0xa5,0x9a,0x48,0xc4,0x98,0x6a,0x04,0xe3,0xac,0xdd,0xd1,0x3f,
-  0x8e,0xff,0x67,0x65,0x97,0x6e,0x35,0x02,0xa3,0x36,0xa3,0xfd,0xb7,0xd5,0xa3,0x6a,
-  0x97,0x53,0x1a,0x11,0x51,0x16,0x70,0xef,0x2f,0x32,0xf5,0xde,0xd3,0xfe,0x9f,0x75,
-  0x2f,0xa1,0x35,0xff,0x96,0x00,0x06,0xd2,0x90,0xf1,0x7e,0xe1,0x3c,0x4a,0x7c,0x3b,
-  0xab,0x9d,0x82,0x79,0xc6,0xba,0xd1,0xf2,0xaf,0x64,0xea,0xf9,0xd8,0xfe,0x9f,0x5f,
-  0xc9,0x73,0x94,0x83,0x16,0x10,0x7a,0xbb,0xf3,0xc5,0xc6,0xb9,0x86,0x3a,0x28,0xef,
-  0x51,0x67,0xd0,0x0a,0x6c,0x95,0x99,0xb3,0x7e,0x96,0xdb,0xf8,0xe7,0x41,0xa6,0x33,
-  0x1b,0xf6,0xf0,0x98,0xd5,0xff,0x54,0x47,0xfc,0x53,0x0f,0xf3,0xb9,0xa7,0x20,0xc3,
-  0xd7,0xb2,0xfd,0x3f,0x69,0xd8,0x43,0xdd,0xbe,0x9e,0xe5,0x6d,0xd1,0x0a,0xa3,0x26,
-  0xce,0x14,0x95,0xfc,0x3f,0x38,0x63,0x45,0x52,0x06,0x8f,0x51,0xf4,0xd0,0x42,0x9b,
-  0x69,0xd8,0x53,0x34,0x24,0xad,0x5e,0x79,0x97,0x11,0xd9,0xe4,0xa9,0x90,0x56,0xab,
-  0xd3,0x5b,0xbc,0x9b,0x20,0x37,0x53,0xff,0xb0,0xc4,0xf5,0x7e,0x1d,0xd8,0x73,0x50,
-  0x9f,0xb3,0xc0,0xb7,0xa1,0x78,0x0a,0x3b,0xd8,0x58,0xd9,0xe4,0x2f,0x91,0x82,0x99,
-  0xfe,0x2c,0xb0,0x5d,0x4c,0x8b,0xbf,0x68,0x9b,0x03,0x14,0xfb,0xd8,0x87,0x50,0x1f,
-  0x5d,0x17,0x97,0x11,0x18,0x6f,0x12,0x47,0x5c,0xf5,0x0f,0xb5,0x84,0x68,0x3b,0xe2,
-  0xef,0xf4,0x8a,0xf9,0xa7,0x6e,0xa7,0x29,0xb5,0x5f,0xaf,0xf7,0x85,0x3a,0xa4,0xb7,
-  0x60,0xac,0xb1,0x8a,0x1d,0xe9,0x94,0x3d,0xe3,0xfa,0x7f,0x89,0x68,0x97,0xea,0x38,
-  0x82,0xd4,0xfb,0x8d,0x99,0xf1,0x25,0x4b,0x9a,0x5e,0x25,0xfe,0x73,0xc2,0x3b,0x24,
-  0xdf,0x64,0x0f,0xb7,0xfb,0x7f,0x51,0x5a,0xae,0xd5,0x98,0xc9,0xaa,0xff,0xf3,0x72,
-  0x28,0x95,0xa7,0x05,0x06,0x24,0xd1,0xaf,0x73,0x2a,0x5b,0x93,0xa9,0xff,0x93,0xf1,
-  0xff,0x88,0xef,0xf7,0x00,0x0a,0x03,0x6c,0x23,0xcc,0x30,0xf2,0x5a,0xd9,0x7f,0x23,
-  0x44,0x74,0x00,0xff,0xb4,0xab,0xfe,0x0f,0xf9,0x7f,0xda,0xe6,0xa5,0x16,0x06,0x29,
-  0xec,0xd5,0x39,0x2f,0x2a,0x1c,0x41,0xbf,0xc5,0x0f,0x79,0x86,0x70,0x04,0xf1,0x5d,
-  0xa9,0x85,0x4b,0xbc,0x5d,0x17,0xf5,0x7f,0xc7,0xcf,0x30,0xcd,0xc6,0x24,0x7d,0x3b,
-  0x4c,0x1e,0xec,0x84,0x3c,0xa4,0x7e,0x64,0x9d,0x6a,0xca,0xe4,0x87,0x66,0xf8,0x3f,
-  0xf5,0x24,0x50,0xd9,0xe7,0xf3,0x3a,0x0a,0x43,0xbe,0xbf,0x93,0xab,0x61,0x2e,0xf9,
-  0x7f,0x96,0x78,0x35,0x77,0xff,0x53,0xc3,0xba,0x7f,0xf9,0x0e,0x8e,0xfb,0x2f,0xe3,
-  0xca,0x30,0x7b,0xdd,0x48,0x1a,0x33,0x86,0x83,0xad,0xf2,0x6d,0xb0,0x57,0x2f,0xdb,
-  0xa8,0x46,0xd9,0x74,0x07,0x5f,0x01,0xdf,0x9c,0xe7,0xa8,0x29,0x14,0x0c,0xdb,0xf1,
-  0xd5,0xa7,0x7e,0x73,0xeb,0x44,0xf8,0x61,0x5e,0xb9,0x89,0xe3,0x75,0x17,0xfe,0x19,
-  0xb0,0xd5,0xce,0x02,0xd5,0x99,0xcf,0x64,0x20,0x14,0x57,0x6b,0x58,0xa7,0xba,0xbb,
-  0xbd,0x22,0xa5,0x56,0xb0,0x52,0x57,0xff,0x53,0x0b,0xcf,0x4c,0x20,0x5a,0xe6,0x7e,
-  0xab,0x9e,0xcf,0x59,0xd8,0x6f,0xd4,0xb5,0xee,0xd8,0xc4,0xae,0x81,0x5f,0xc7,0xab,
-  0x96,0xf8,0x1e,0x91,0xa7,0x5f,0x9c,0xff,0xa5,0x15,0xbb,0xe2,0x11,0x67,0x8c,0xfa,
-  0x96,0xab,0x36,0xca,0x5f,0x36,0xc6,0x8c,0xda,0x97,0x44,0xab,0xbe,0x8b,0xf2,0xbf,
-  0x8e,0x09,0x36,0x51,0x83,0xc5,0xe7,0x3c,0x67,0x36,0x34,0xf9,0x46,0xe5,0x39,0xc4,
-  0xff,0xa1,0xd6,0xb4,0x70,0x71,0xfe,0x57,0x82,0x89,0xb6,0x17,0x16,0x31,0x69,0x9f,
-  0x51,0x59,0x13,0xa9,0x79,0x46,0x16,0x8d,0x18,0xbc,0xd7,0xe3,0xd7,0xee,0x8a,0x7f,
-  0xa5,0xdd,0x3e,0xb9,0x21,0x6a,0x7b,0x61,0x08,0x20,0x84,0x5f,0x68,0x54,0xdd,0xc4,
-  0xca,0xb5,0x2e,0x33,0xd0,0x8f,0x97,0x4a,0xd8,0xb3,0x69,0xf3,0x7f,0x7a,0xbd,0x5a,
-  0x81,0x2f,0xda,0xe1,0xcc,0x4f,0x4b,0x65,0x24,0x12,0x0e,0x44,0x73,0x57,0x43,0xc2,
-  0xec,0x02,0x57,0xfe,0x3b,0xb3,0xfa,0x7f,0x51,0xf5,0x83,0x19,0x40,0xfd,0xbf,0xfc,
-  0xbb,0x2c,0x37,0xd7,0x02,0x35,0xf9,0xa9,0xb2,0x92,0x17,0x94,0x2a,0x73,0x61,0xa2,
-  0x9c,0x67,0xd5,0xff,0x11,0xcf,0x7b,0x4f,0x87,0xb0,0x5f,0x46,0xc1,0x09,0xe9,0x2c,
-  0x3c,0x09,0x75,0x3e,0xaa,0x6f,0x93,0x38,0x47,0x81,0x8c,0x94,0xbc,0x24,0xe7,0x22,
-  0xfc,0x33,0xe6,0x9d,0x64,0x9c,0xe1,0x0d,0xbc,0x60,0x58,0x2e,0xa2,0x44,0x30,0x82,
-  0xcd,0x78,0xaa,0x73,0xde,0x31,0xe2,0xff,0x64,0xf2,0xc5,0xe0,0xb8,0x9d,0xff,0x1e,
-  0x22,0x20,0x94,0x50,0x77,0x14,0x4d,0x85,0x47,0x78,0x65,0xb4,0xa0,0x87,0x1d,0x57,
-  0xf6,0x77,0x0a,0xd7,0xd0,0xa8,0xee,0xe2,0xff,0x08,0xfc,0xd3,0x1c,0x0e,0xac,0xed,
-  0xdc,0x2d,0x85,0x60,0x4d,0x02,0x57,0x4b,0x1b,0x3e,0xc8,0x22,0xaa,0x50,0xb7,0x4d,
-  0xa4,0x2a,0x37,0x65,0xf3,0x7f,0xd2,0x49,0x76,0xbf,0xa0,0xf9,0x4c,0xaa,0x09,0x86,
-  0xd7,0x87,0x9b,0xd3,0x81,0xa4,0xdc,0x71,0xf9,0xef,0x3c,0xd3,0xff,0x7d,0x3b,0x09,
-  0x7a,0x65,0x52,0xd6,0xe1,0x10,0xcc,0x69,0xf4,0x89,0x0a,0x51,0x0a,0x15,0x82,0x2e,
-  0x36,0x0d,0x7b,0xfc,0x68,0xc6,0xff,0xf3,0x4d,0x14,0xea,0x2c,0xff,0xd8,0x1b,0x4a,
-  0xc3,0xe2,0x82,0x51,0xc4,0xdb,0x4f,0xb3,0x86,0x03,0xbe,0xd1,0xe6,0x8b,0xfb,0xbf,
-  0x0b,0x37,0xe3,0x0b,0x50,0xef,0xf3,0xed,0x12,0xd7,0xb7,0x3d,0x90,0xca,0x64,0xf2,
-  0xbf,0x65,0xf8,0x6c,0x4e,0xfc,0x8b,0xf2,0x19,0xbb,0x94,0x4a,0xc3,0x73,0x1d,0x2a,
-  0xde,0x35,0x76,0x20,0xec,0x7a,0x16,0x1a,0x5d,0xed,0xe6,0xff,0x64,0xc5,0xbf,0x70,
-  0x3d,0x8c,0xaa,0x15,0x01,0x8f,0xb5,0x3f,0xb5,0x3d,0xa8,0x52,0x98,0x8d,0x3a,0xf8,
-  0x6d,0xb4,0xd0,0x81,0x01,0xe7,0x61,0x15,0x9f,0x31,0xe4,0x59,0xc2,0x1a,0x60,0x05,
-  0x39,0x46,0xd2,0x11,0xb1,0x03,0x79,0xcb,0x9b,0x8e,0x67,0xfa,0x5f,0x40,0x9a,0xff,
-  0x7c,0xbd,0x7c,0x18,0x9e,0xe1,0x75,0x86,0xef,0x6f,0xbc,0xaa,0xde,0x0b,0x75,0x29,
-  0xff,0x2c,0x76,0xd8,0xfc,0x48,0xab,0xeb,0xf3,0x65,0xf1,0x9f,0x45,0xff,0xaf,0xab,
-  0xc5,0x67,0x65,0x5c,0x28,0x6c,0xe8,0x5d,0x17,0x95,0xcf,0xb6,0x9c,0x8b,0x53,0xc5,
-  0xc8,0x66,0xd1,0xe1,0xa2,0xbf,0x20,0x59,0x9c,0xd5,0xff,0x42,0x4c,0xb2,0xed,0x1f,
-  0x03,0x5f,0x72,0xc2,0x7b,0x70,0x88,0x57,0x19,0xae,0x7e,0xc4,0x13,0x5c,0xfc,0x9f,
-  0xf5,0xe3,0xe2,0x5f,0x54,0x4f,0x03,0xed,0xf3,0x96,0xb4,0x62,0x61,0x82,0x3f,0x79,
-  0xc2,0xe9,0x1f,0x97,0xa9,0xff,0xcc,0xde,0x44,0x21,0x94,0x88,0x2c,0x87,0x57,0xe1,
-  0x7e,0x5e,0x96,0x15,0x01,0xbc,0xb8,0xff,0x85,0x3d,0x7b,0x7d,0xd3,0x49,0x68,0xdf,
-  0x1a,0x4d,0xcf,0x27,0x0b,0x99,0x97,0xec,0x7f,0xea,0xa7,0x22,0xcf,0xa7,0xa1,0x21,
-  0xbe,0x40,0xa7,0xb6,0xa7,0x89,0xaa,0x44,0xda,0x23,0x64,0x11,0x81,0x2e,0x11,0xff,
-  0xb2,0x68,0xcf,0x2c,0x2f,0x36,0xe1,0x18,0x9c,0xb5,0x77,0xe8,0xe9,0xc2,0x2c,0x99,
-  0xf8,0x9a,0x8b,0xff,0xdc,0x87,0xf6,0x51,0x44,0x43,0x16,0xdb,0x6d,0xc1,0x87,0xa4,
-  0x4b,0xf5,0xbf,0xc8,0x86,0x31,0x10,0x2f,0x9a,0xd2,0x39,0x3e,0xc2,0x95,0xf1,0xff,
-  0x58,0xf8,0xc7,0xea,0xf6,0xa5,0x59,0xe3,0x03,0xd5,0xf0,0x4b,0x14,0xae,0xb4,0x3b,
-  0xc2,0xff,0xc5,0xfc,0xf7,0xf6,0x36,0x45,0x24,0x82,0x95,0xc0,0x63,0xae,0x08,0x91,
-  0x79,0x09,0xff,0x8f,0xf0,0x36,0x20,0xec,0x11,0xfc,0x13,0x6f,0x94,0x9e,0xd7,0x9a,
-  0x81,0x1a,0xbb,0xff,0x85,0xad,0x7f,0xfa,0x5d,0xfd,0xdf,0x5b,0x4f,0x41,0x43,0xcb,
-  0xbf,0xd1,0x83,0x7f,0xa8,0xd8,0x1e,0x1e,0xab,0xdf,0x7d,0xa6,0x9e,0xc9,0xa6,0x1c,
-  0xbb,0xff,0x97,0x68,0x0b,0x4b,0xfe,0x31,0xaa,0x17,0x94,0xf1,0x90,0x88,0x7f,0x78,
-  0x38,0xc7,0x85,0x7f,0xd4,0x74,0xfc,0xab,0x17,0x36,0x51,0xff,0x53,0x93,0x65,0x3a,
-  0xc2,0x53,0xff,0xd3,0xec,0xfe,0x5f,0x6a,0x4e,0x9f,0x64,0xe5,0xbf,0x17,0xf5,0x55,
-  0xec,0x42,0xfb,0x55,0xda,0x6a,0x3d,0x66,0x63,0x97,0xd6,0x84,0x82,0x24,0x9e,0x37,
-  0x13,0xff,0x2a,0x75,0xc5,0xbf,0x94,0x1f,0xb1,0xca,0x88,0x3a,0x98,0x15,0x58,0x84,
-  0xf1,0xfd,0x4f,0x27,0xe2,0xfd,0x8b,0x87,0x92,0xe8,0x6e,0xeb,0xa2,0xbe,0x74,0x3c,
-  0x2b,0xea,0x8e,0x70,0xb9,0xe2,0x5f,0xf0,0x17,0xe2,0x5f,0xcb,0xac,0xf5,0xc0,0xd2,
-  0xfd,0x4f,0xed,0xf1,0x41,0x4d,0x4f,0xaf,0xb7,0xcf,0xa5,0xa0,0x5f,0xaa,0x87,0x7c,
-  0x53,0x14,0x42,0x74,0x79,0xe4,0xb2,0xfb,0x7f,0xa5,0xf1,0x4f,0x17,0xc2,0x1e,0x6d,
-  0x8d,0x54,0x29,0xca,0x98,0xdf,0x7a,0x7f,0x26,0x22,0x36,0x93,0xfa,0x5f,0x5c,0xdc,
-  0xff,0xcb,0xd2,0x3f,0x52,0xa8,0xf7,0x33,0x41,0x5c,0x2d,0xed,0x4e,0xe0,0x38,0x37,
-  0xa4,0xe2,0xc6,0xfc,0x80,0xe3,0xcf,0x71,0xfa,0xbf,0x2f,0xcb,0x7d,0x83,0xaf,0x82,
-  0x10,0x5a,0xfc,0xf6,0x5f,0xc3,0x4a,0x71,0x24,0x20,0xbe,0x68,0x20,0xfe,0xb3,0x33,
-  0x7e,0x47,0x8c,0xf4,0x95,0x15,0xff,0xd2,0x9f,0xe7,0x57,0xa5,0xf2,0x97,0xc8,0xaf,
-  0xc2,0x73,0xb6,0x47,0xe8,0x0f,0x7c,0x1e,0xf9,0x7f,0x0e,0x8c,0xeb,0x7f,0x21,0xb2,
-  0x77,0xdf,0x37,0x49,0x9f,0xe0,0xd7,0xd7,0x07,0xa7,0xa5,0x8c,0x86,0x41,0xc5,0xe2,
-  0xaa,0xff,0xe3,0xe0,0x9f,0x53,0x82,0xb6,0x5a,0x3f,0xf4,0xd9,0x58,0xf9,0xab,0xa8,
-  0x7f,0x44,0xdb,0x8b,0xf3,0xea,0x99,0xf8,0x5c,0x1d,0x11,0x51,0xa9,0xa3,0xcf,0xa9,
-  0xff,0xe9,0x1f,0xe8,0x6e,0x6b,0xd9,0x71,0x72,0x5b,0x05,0xd5,0x02,0x36,0x68,0x3c,
-  0x94,0x08,0xa5,0x0a,0x96,0xb3,0xc3,0x1c,0xf5,0x89,0xe1,0x3d,0xcd,0xa6,0xbb,0xfb,
-  0x7f,0xa9,0xd6,0xf3,0x4e,0x7d,0x9d,0xc6,0x1f,0x50,0x6f,0x42,0x35,0xb5,0x52,0xb7,
-  0x3d,0x42,0x3a,0x3e,0xef,0x09,0x8f,0xe9,0xc6,0x3f,0xf6,0x7e,0x56,0xe8,0x73,0x44,
-  0xa1,0xb9,0x7d,0xb0,0xd5,0x0c,0xf5,0xd9,0x1a,0xc9,0x10,0xfc,0xe7,0x0c,0xfe,0x71,
-  0xec,0xcb,0x59,0xf6,0x02,0x2a,0xea,0xb5,0x49,0xf9,0x5d,0x38,0xb4,0xcc,0x79,0x5e,
-  0xea,0xb8,0xed,0xea,0x7f,0x11,0x07,0x7b,0xfc,0xe7,0x2c,0x7d,0x5b,0xb0,0xa7,0xf8,
-  0x58,0xfc,0xb4,0x4d,0x3c,0xf8,0x0e,0xd4,0xdf,0x32,0x21,0xc9,0x82,0x99,0x7c,0xb1,
-  0x4c,0xfd,0xc3,0xd7,0x45,0xb7,0x74,0x61,0xdd,0xce,0x5b,0xb4,0x67,0x71,0x6a,0x87,
-  0xc8,0x7f,0xb7,0xef,0x9f,0x2b,0x2e,0x3e,0x73,0x17,0x4c,0x05,0x35,0x09,0x7f,0xd0,
-  0xbb,0x2d,0xfe,0x2d,0x45,0x64,0x0a,0x08,0xe1,0x5c,0xd4,0xff,0xc2,0xa2,0x49,0x77,
-  0x59,0x8d,0x83,0xdf,0x82,0x27,0xd8,0x54,0xab,0x10,0xe2,0xcf,0x61,0xaa,0xe6,0x4d,
-  0x16,0xa5,0x34,0x57,0xfe,0x97,0xb5,0xde,0xaa,0x11,0x36,0x77,0x34,0x55,0xa8,0xa8,
-  0x7f,0x4c,0x72,0x8b,0x0d,0x7a,0xab,0x68,0x7e,0xa8,0x10,0x59,0x16,0xff,0xc7,0xee,
-  0xff,0xfe,0xb8,0xfc,0xcb,0xe8,0x0b,0x46,0xfd,0x21,0xdf,0x7a,0xf2,0x6f,0xe8,0x8f,
-  0x1f,0x9d,0x9f,0x2c,0xa7,0xfc,0x1a,0x5c,0x21,0xdd,0xe3,0xea,0x1f,0x8a,0xe7,0xdd,
-  0x2d,0xf6,0xef,0x73,0xc1,0xff,0x6b,0xd4,0x27,0xe7,0xb5,0xda,0x01,0xff,0x49,0xf9,
-  0xfd,0x84,0x68,0x8d,0xba,0xab,0x70,0x78,0x4a,0x36,0xfe,0x99,0xcd,0x7d,0x47,0xe5,
-  0xd3,0x38,0x7e,0x76,0x8b,0xef,0x18,0xae,0x96,0x81,0x8a,0x6b,0xa3,0x0b,0x8f,0xa1,
-  0x99,0x1e,0xa0,0xfa,0x9c,0xfd,0x6e,0xff,0x8f,0xc8,0xff,0xaa,0x06,0x35,0xde,0x34,
-  0x0c,0x6b,0xf4,0xea,0xdb,0x62,0x0f,0x06,0xa6,0x43,0x2c,0x1e,0x88,0x7a,0x13,0x9e,
-  0x4a,0x88,0xf1,0xe9,0xa9,0x82,0x58,0x40,0x07,0x37,0xfe,0xd9,0x0f,0x3a,0x57,0x89,
-  0x0f,0xb6,0x4d,0x0d,0x44,0x22,0x01,0x16,0x62,0x49,0xe1,0x66,0xf7,0xec,0xcc,0x8b,
-  0x51,0x85,0x16,0xb8,0x2c,0x2b,0xff,0xbd,0x64,0xbf,0x36,0x55,0x57,0x37,0xb0,0x81,
-  0xc0,0x8f,0x28,0x7f,0x01,0x94,0x4a,0x7d,0x13,0xc7,0xeb,0x27,0x61,0x69,0x59,0x0c,
-  0xa1,0x17,0x8b,0xe5,0x86,0xb3,0xfa,0x5f,0xec,0x86,0xaa,0xc4,0xda,0xb8,0x7c,0x0c,
-  0xfe,0x1c,0x2f,0x37,0x42,0xef,0x78,0x6b,0x61,0x34,0x55,0x95,0xf2,0x6f,0x95,0x5f,
-  0x84,0xfe,0xe6,0xaa,0xb1,0x7c,0x1f,0x73,0xd5,0x7f,0xb6,0xf0,0x0f,0xcc,0x3c,0x2a,
-  0x8f,0xc2,0x1f,0xa1,0xa1,0xd5,0x7f,0xf6,0xd7,0x63,0x30,0x22,0x5d,0x6f,0xfa,0xdf,
-  0x93,0x9f,0x86,0xb3,0xea,0xf5,0x07,0xfc,0xe6,0xf8,0xfa,0xcf,0x52,0xfd,0xa6,0x09,
-  0x44,0x62,0x7c,0x41,0x7b,0x7c,0x99,0x6f,0x8f,0xfc,0x20,0xbc,0xaa,0xd5,0x0f,0xae,
-  0xdd,0x28,0x07,0xf9,0x30,0x29,0x3a,0x2e,0xb7,0x8e,0xe7,0xff,0x04,0xbc,0xdf,0x67,
-  0xef,0x22,0x5a,0x4e,0x24,0x83,0x7b,0x70,0x63,0xb5,0xa6,0xb5,0x72,0x58,0xa5,0x8a,
-  0x49,0xdd,0x50,0x63,0x74,0xc5,0x3a,0xee,0xb1,0x5f,0xaf,0xdd,0xff,0x22,0xee,0x2d,
-  0x65,0x87,0xa8,0xda,0x2a,0xa8,0xf9,0x9e,0x08,0x6c,0xe0,0xa1,0x94,0xba,0xe5,0xe6,
-  0x75,0x90,0xe0,0x21,0x3c,0x95,0x9b,0xc9,0x7f,0xa7,0xfe,0x5f,0x8f,0xf1,0x19,0x15,
-  0x79,0x8b,0xd8,0x6b,0xb0,0x32,0x5e,0x3e,0x27,0xb8,0x88,0xdd,0xab,0xaf,0xe4,0x33,
-  0x53,0x35,0xdf,0x65,0x3f,0x6d,0xdc,0xc3,0xa7,0x25,0xbc,0x11,0x16,0x71,0xfc,0x3f,
-  0x82,0xff,0xac,0xd5,0x81,0x3f,0xdc,0xf1,0x9e,0xfe,0x0c,0x24,0xe1,0xf6,0x0d,0x4d,
-  0x0b,0xe0,0x25,0x3d,0x94,0xf2,0xc5,0x9b,0xd7,0x06,0x53,0x2a,0x42,0x23,0x45,0x2e,
-  0xca,0xca,0xff,0x3a,0x67,0x6d,0x13,0xce,0x35,0x5d,0x80,0xeb,0xf8,0xcc,0x41,0xb9,
-  0xce,0xb8,0x20,0x35,0x98,0x13,0x3e,0x94,0xbe,0x8b,0x0b,0xa9,0xa1,0xcf,0x6f,0x8c,
-  0xe3,0x3f,0x8b,0xb0,0x60,0x5c,0x2e,0x83,0x17,0xa4,0x24,0xb9,0x05,0x40,0xea,0x87,
-  0xba,0x5e,0x5f,0xbc,0xfc,0x66,0x52,0xd4,0xa6,0x2f,0x2e,0xb9,0xfc,0x3f,0xa8,0x7f,
-  0x1e,0x83,0x99,0x10,0x1b,0x64,0x1a,0x5b,0x47,0xf5,0x0f,0x47,0xe5,0xdb,0x61,0x05,
-  0xaa,0x75,0x95,0x12,0xe1,0x57,0xa0,0x85,0x52,0x0d,0xb6,0xc1,0xb9,0x7e,0x1b,0xfc,
-  0x54,0xd9,0xdb,0x36,0x23,0x59,0xba,0x9c,0x5d,0x81,0x78,0xaf,0x5c,0x57,0xbf,0xcb,
-  0x2e,0x83,0x95,0xbd,0xc2,0x23,0x54,0x8f,0xc0,0xef,0xbf,0x2f,0x53,0x87,0xb3,0xf2,
-  0xdf,0x45,0x35,0x89,0x54,0x30,0x7c,0x85,0x9f,0x77,0x45,0xf4,0x84,0x1a,0x6e,0x5f,
-  0x00,0x1d,0x06,0x4e,0x63,0x92,0x15,0x30,0x14,0x0c,0x15,0xd8,0x03,0x6e,0xfe,0x8f,
-  0x72,0x5a,0x69,0xa0,0x22,0xcf,0x41,0x7e,0xb8,0x71,0x76,0xc2,0x37,0x2c,0x5f,0xc1,
-  0x0e,0x1b,0x0d,0x9d,0xeb,0x50,0x43,0x1b,0x87,0xf5,0x79,0xc9,0x50,0x74,0x7c,0xfe,
-  0xbb,0x95,0xed,0x9e,0xb2,0xfc,0x21,0x0a,0xf5,0x7f,0xa7,0x7e,0x04,0xb1,0xe2,0x63,
-  0xad,0x63,0x7a,0x7d,0xd1,0xf8,0xfc,0x77,0x0a,0x82,0xb4,0xfa,0xd7,0xe3,0xfe,0xe5,
-  0x60,0x3c,0xbc,0x2c,0x14,0xbf,0x72,0x2a,0x1c,0xfc,0x89,0x20,0x3a,0x56,0x18,0xa7,
-  0xda,0xaa,0x0c,0xdf,0x66,0xd9,0xe5,0xff,0xe9,0x5c,0x0c,0xbb,0xd8,0xf4,0x65,0xde,
-  0xcd,0x9e,0xa9,0xb0,0x9a,0x6d,0x5d,0x46,0xd5,0xf6,0xd8,0x6a,0x08,0x2d,0x0e,0xc6,
-  0xdb,0x1f,0xe4,0xbb,0xa0,0x9a,0x36,0x56,0xe3,0xfd,0x3f,0x81,0x03,0x94,0xdf,0x44,
-  0xd9,0x49,0x66,0x6c,0x7d,0x7b,0x05,0x47,0x20,0x64,0x96,0xc6,0x3d,0x15,0xb0,0xbf,
-  0x30,0x10,0xc1,0x2b,0x38,0xaf,0x57,0xe0,0x9f,0x7d,0x56,0xfd,0x67,0x05,0x3a,0x74,
-  0x9d,0xea,0x1f,0x6e,0x6f,0x6f,0xab,0x08,0x19,0x91,0x22,0x0f,0x9d,0xaa,0x20,0x2a,
-  0x35,0xcb,0xd4,0x7f,0x16,0xf8,0xa7,0xaa,0xc4,0xff,0x60,0xb9,0x64,0xf4,0xdf,0x52,
-  0xb5,0x71,0x60,0x05,0xfe,0x75,0x01,0x84,0x56,0x14,0x93,0x69,0xae,0xe2,0x88,0x88,
-  0x2a,0x9d,0xf8,0xa9,0x9d,0xff,0xee,0x1f,0xf4,0x8a,0xfc,0xaf,0x16,0xff,0xaf,0x9a,
-  0x4f,0x1a,0xe7,0x28,0x10,0xf6,0x21,0x55,0xf8,0x81,0x79,0x86,0xbf,0x55,0x7e,0xc7,
-  0xf1,0x17,0xc5,0x72,0xb6,0x4b,0x1f,0xd2,0x7a,0x7b,0x99,0xb2,0xdd,0x59,0x55,0xab,
-  0xef,0x65,0xdc,0x96,0xfe,0x0e,0xe6,0x99,0xf0,0x31,0x28,0xbe,0x5f,0xb2,0xd9,0xb4,
-  0x14,0x99,0x3b,0xfe,0x45,0x68,0x47,0x15,0x6e,0x9f,0x1e,0x7d,0x2b,0xa8,0x3a,0x3b,
-  0xa6,0xac,0x31,0x0a,0x40,0x6d,0x67,0xd4,0x88,0x96,0xf8,0xcf,0xf2,0xfd,0x19,0xff,
-  0x8f,0x42,0x20,0xc7,0x77,0xab,0x57,0x0b,0xf4,0xe9,0xbb,0x16,0x40,0xab,0x5a,0xc2,
-  0x6e,0x80,0xb6,0x96,0x02,0x43,0xad,0xa6,0x8c,0x30,0xd0,0x29,0xf4,0xd3,0x54,0xe8,
-  0xe4,0xbf,0x4f,0xdc,0x4e,0xfd,0xd7,0x9a,0x10,0xe4,0xbc,0xdd,0xb6,0xdf,0xc0,0xf9,
-  0x59,0x6f,0x01,0xd1,0x03,0xc1,0x0d,0x81,0xed,0xf0,0x08,0xed,0x67,0x93,0xb0,0x32,
-  0xe3,0xff,0xb1,0xfa,0x7f,0x45,0x45,0x99,0xa3,0x53,0x2d,0x55,0x4b,0x42,0xf1,0xe2,
-  0x8a,0xbb,0x5e,0x31,0x42,0xad,0xbe,0x8d,0xf2,0x35,0xfc,0x47,0x46,0x77,0xd4,0xff,
-  0x93,0xb6,0x25,0x39,0xf6,0xf7,0x2b,0xf8,0x3f,0x14,0xe4,0xda,0x24,0xbf,0x43,0x6c,
-  0xe7,0x94,0xbf,0x54,0xde,0xae,0x9e,0xd2,0x29,0x1e,0x2a,0x8f,0x70,0x42,0x80,0x88,
-  0x7f,0x0e,0x8d,0xcb,0xff,0xaa,0x02,0xff,0xea,0x6b,0x74,0x3e,0x18,0xa9,0xd2,0x7c,
-  0xb1,0x62,0x9d,0x0d,0x7f,0xa6,0xb6,0xd0,0xd7,0x49,0xf9,0x5f,0x8d,0xb8,0xf0,0x3a,
-  0x2f,0xe2,0xff,0xfc,0x4d,0xcc,0x9b,0xa2,0xfa,0x87,0x6a,0x20,0x11,0x1c,0x2e,0x52,
-  0x83,0xf7,0xab,0xb3,0x77,0xa8,0x29,0x36,0xcd,0x5c,0x99,0x98,0xc9,0xd5,0x3b,0x8b,
-  0x5c,0xf9,0xef,0x2b,0x16,0x88,0x32,0x59,0x38,0x09,0x05,0x94,0x08,0x3f,0x16,0xa9,
-  0x09,0x14,0x20,0x10,0x0a,0x1e,0x0c,0x56,0xb4,0xa3,0xc0,0x43,0xa6,0x3a,0x87,0x1d,
-  0xd2,0x1d,0xfe,0x0f,0xe2,0x9f,0xa7,0xf9,0x34,0xf3,0xca,0x25,0x9e,0xab,0xe1,0x87,
-  0x90,0x38,0x10,0x5b,0xb6,0x72,0x0e,0x0e,0xbb,0xc6,0xf4,0xa4,0x8a,0xae,0x28,0xc1,
-  0xef,0x57,0x57,0xc7,0xf5,0xbf,0xd0,0xfe,0xcc,0x67,0x25,0xfc,0x47,0x59,0x3d,0xfb,
-  0x4d,0xdb,0xac,0xb7,0x7c,0xcb,0xbd,0x97,0xc1,0xf3,0xfc,0x3a,0x2a,0xfb,0x7c,0x59,
-  0x60,0x45,0xfb,0x3c,0x7d,0xc1,0xf2,0xe6,0xac,0xfc,0x77,0x4d,0xb4,0x35,0xe7,0xf2,
-  0x88,0xe7,0x3d,0xa8,0x2f,0xf5,0x27,0x3f,0x35,0x00,0xdf,0xc9,0xad,0x6d,0xcc,0xd7,
-  0xbd,0xc7,0xe0,0x5d,0xa8,0x83,0x6c,0xfe,0x4f,0xba,0xff,0x57,0xc1,0x58,0xf9,0xc7,
-  0x70,0xb8,0x6d,0x56,0x34,0x34,0x56,0x7c,0x59,0xeb,0xf3,0x6d,0xb3,0x77,0x7e,0xaa,
-  0x5f,0xaa,0x85,0x3f,0xf1,0x59,0xa9,0xb5,0xfd,0xf2,0x45,0xfe,0x1f,0x43,0x5d,0x22,
-  0x1f,0x32,0xef,0xd7,0xcb,0x0c,0x75,0x31,0x4c,0x1a,0x7e,0x28,0x90,0x48,0x78,0xdf,
-  0x62,0x45,0xc6,0xdb,0x30,0x4d,0xf1,0xdc,0xc9,0x1e,0x75,0xf0,0x52,0x1a,0xff,0x6c,
-  0xf0,0xb4,0xe6,0xbe,0xce,0x3a,0x29,0xda,0xd5,0xca,0xea,0x94,0xef,0x43,0x59,0xec,
-  0xc7,0xad,0x45,0x1a,0x3c,0x66,0x94,0x01,0x4e,0x6c,0xd4,0xd5,0xff,0x74,0xc0,0xea,
-  0x6f,0xa5,0xb3,0x47,0x14,0x6e,0x28,0x7a,0x4c,0x61,0x39,0x2c,0x69,0xe8,0xaa,0x77,
-  0x3b,0x63,0x13,0x77,0xc5,0x83,0xe0,0xa9,0x68,0x3f,0xea,0xaa,0x3f,0x2f,0xf0,0x4c,
-  0xb4,0x00,0x37,0x35,0xb9,0x87,0x0e,0xcc,0x79,0xc9,0xd7,0xb3,0xe6,0x1a,0xf6,0x2f,
-  0x46,0xc0,0xf4,0x3f,0x19,0x98,0xa1,0x53,0xc5,0x30,0x35,0x24,0x7f,0xd5,0x59,0x6f,
-  0x1b,0x29,0xfe,0xc5,0xeb,0x35,0x84,0x85,0xa3,0x30,0xa6,0x3d,0xf1,0x92,0xbf,0xa4,
-  0x63,0x00,0xde,0x35,0xea,0x07,0xd7,0x7d,0xdf,0x1b,0x8d,0xa3,0x3d,0x0a,0xfb,0xb7,
-  0xb8,0xf2,0xaf,0xad,0xfe,0x5f,0xf5,0x7c,0xd2,0x60,0xf1,0x6c,0xfd,0x70,0x70,0x76,
-  0xbf,0xef,0x3d,0xb9,0x4e,0x3f,0xbc,0xa3,0x61,0xd8,0x37,0xba,0xad,0x8a,0x2a,0x02,
-  0x81,0x3f,0x25,0x67,0xfc,0x3f,0xbc,0x84,0xfc,0x39,0x33,0x7b,0xd4,0xd6,0xf6,0x24,
-  0xdf,0x6e,0x6e,0xab,0x09,0x0e,0x78,0x2a,0x94,0x57,0xcc,0xd0,0xb2,0xe0,0x66,0xb9,
-  0x1c,0x7a,0x78,0x75,0xb8,0x6b,0x87,0xbc,0x6c,0x3c,0xfe,0x89,0xaa,0x3b,0x28,0xfb,
-  0x00,0xa6,0xf3,0x58,0x92,0x85,0x1a,0xd7,0xa8,0xa8,0x7f,0x62,0x07,0x42,0x5b,0x1e,
-  0xe1,0x01,0xdd,0xbb,0xc3,0x55,0x4d,0x29,0x8d,0x7f,0x40,0xdd,0x5a,0xc4,0x83,0x1c,
-  0x02,0x68,0xdf,0x99,0x22,0xc5,0xa1,0x72,0x01,0x0a,0xc0,0x93,0xbc,0x02,0xbc,0x7a,
-  0x6e,0x93,0x33,0x3e,0x8d,0x7f,0xb8,0x1a,0xef,0x00,0xb3,0x1f,0xc7,0xaf,0x05,0x56,
-  0x01,0xfd,0xac,0x72,0x50,0x24,0x02,0xbc,0x4b,0x9f,0x46,0xa2,0x19,0x1c,0x7d,0x98,
-  0xc8,0xb7,0xfa,0x7f,0xad,0x4b,0xca,0xa9,0xf8,0x59,0x89,0x1a,0x4f,0x7d,0xe9,0x2c,
-  0x2e,0x9a,0xfa,0x96,0x85,0x66,0x6e,0xa2,0xf5,0xbb,0x0a,0xe2,0x9f,0xa8,0x2b,0x1f,
-  0xc1,0x9c,0xf8,0x06,0x1c,0x06,0x51,0x84,0x7c,0x52,0x29,0xe2,0x9f,0x7e,0xdf,0xa0,
-  0x3c,0x67,0xf0,0x79,0xcb,0xa3,0x78,0x16,0x44,0xfd,0x84,0x1e,0x39,0xec,0xf0,0x67,
-  0x38,0xe2,0x9f,0x35,0x5c,0x24,0x79,0x55,0x6a,0xfb,0x07,0xcb,0x4f,0x7a,0x36,0x17,
-  0xe9,0x66,0x97,0xe5,0x11,0xba,0xa0,0xfe,0x5c,0x9d,0x6e,0x7a,0x7b,0x02,0x99,0xf8,
-  0x17,0xf1,0x7f,0xa8,0x88,0xba,0x27,0xcc,0x22,0xb0,0x5b,0xd2,0xcd,0x98,0x12,0x78,
-  0x88,0xa7,0xcb,0x40,0x0d,0x18,0xa8,0x81,0x09,0x3a,0x56,0x65,0xf9,0x7f,0xc8,0xc9,
-  0xe6,0xe9,0x61,0x5f,0x55,0xf6,0xb3,0x40,0xaf,0xba,0xb6,0x69,0xbb,0xd1,0xa5,0x57,
-  0xf6,0xca,0x84,0x27,0xb7,0xc1,0x74,0xea,0xbf,0x96,0xcd,0xff,0x39,0xc0,0xc3,0xc4,
-  0xef,0xfd,0x3a,0x7c,0x24,0x85,0xcd,0x50,0x4f,0xf1,0x54,0x76,0xd0,0x76,0x0c,0x92,
-  0x7f,0x0c,0xa1,0x32,0x38,0xfe,0x1f,0xc2,0x3f,0xe7,0xad,0x7e,0x2b,0x69,0x47,0x10,
-  0xb5,0x29,0x3c,0xc7,0x33,0x44,0x68,0x72,0x74,0xb8,0xfd,0x3f,0xbf,0xd0,0x5f,0x28,
-  0xad,0x7a,0xcb,0x97,0x14,0xdd,0x4e,0xbb,0xc9,0xfb,0x8a,0xf6,0x0b,0xaa,0xe9,0xfa,
-  0x03,0x76,0x6b,0x8c,0x8c,0xff,0xa7,0x3f,0x27,0x1f,0xba,0xcc,0xc0,0xa0,0xda,0xcd,
-  0x2a,0xf5,0x75,0x6a,0x79,0x6a,0x7e,0x02,0x72,0x85,0x61,0xf2,0x52,0x20,0x2c,0x4d,
-  0x6d,0xca,0xe6,0xff,0x88,0x26,0x20,0x35,0xcc,0xa7,0xe3,0x44,0xa5,0xbc,0x1a,0x38,
-  0x69,0x80,0x56,0xe2,0x40,0x1e,0xf1,0xbd,0xdd,0xfc,0x9f,0x55,0x94,0xff,0x75,0xb6,
-  0xe9,0x8e,0xce,0x55,0x66,0xd9,0xc9,0x2b,0x3f,0xc3,0x2e,0x6b,0x5d,0xe7,0xf6,0x87,
-  0xe4,0x2d,0x67,0xe7,0xb3,0xf8,0x3f,0xcf,0x40,0xd8,0xf4,0x85,0xbd,0x9e,0xf6,0x67,
-  0xb4,0xf0,0x7b,0x7e,0xaf,0xbc,0xb6,0xe9,0x19,0x6a,0xfb,0x7e,0x3d,0xde,0xff,0xaf,
-  0xb7,0xd6,0x0f,0xe7,0x5f,0xe7,0xce,0xff,0x9a,0xf8,0x24,0xfc,0x19,0xad,0x8f,0x3f,
-  0x29,0xed,0x30,0x44,0xfd,0x1f,0x2e,0x9f,0x34,0xec,0x8e,0x21,0xfa,0x05,0xc4,0x3f,
-  0x95,0xee,0xfc,0x2f,0xd1,0xff,0x82,0x57,0x51,0x5a,0x59,0x08,0xce,0xb0,0x7b,0x5f,
-  0xc5,0x3f,0x14,0x12,0x6d,0xe9,0xf2,0x93,0xf2,0x71,0xea,0x0f,0x92,0xf2,0x25,0x9b,
-  0x33,0xfc,0x04,0x8b,0xff,0x73,0xad,0xe3,0x3f,0xef,0x57,0xa3,0x6c,0x92,0xba,0x0a,
-  0xc8,0xed,0x43,0x85,0x58,0xad,0x40,0xd8,0x09,0x67,0x3c,0xf1,0x7f,0x76,0x9b,0x53,
-  0xd2,0xf1,0xbe,0x78,0x68,0x68,0xcd,0x12,0x76,0xbf,0xb2,0xca,0x4a,0x04,0x3b,0xcc,
-  0x29,0xdf,0x5f,0xbd,0x98,0xff,0x53,0x61,0xce,0xd7,0x8a,0x26,0xc4,0x44,0xa0,0x79,
-  0x56,0xd1,0xbf,0xe2,0x0a,0xac,0x30,0xd3,0x15,0x26,0x45,0x86,0x6f,0x86,0x9f,0x4c,
-  0xfc,0x9f,0xf3,0xbc,0x9a,0x9c,0x3c,0xd7,0xd3,0x36,0x93,0xfc,0x9f,0x3d,0xc6,0xa1,
-  0x44,0x3d,0xcf,0x4f,0x94,0x0f,0x6b,0xef,0x91,0x7d,0xbf,0xa8,0xfe,0xb3,0xd8,0x74,
-  0x7b,0x09,0xf6,0xd4,0xc1,0x67,0x63,0x2c,0x9a,0x6b,0x33,0x84,0x59,0xe9,0xc5,0xf5,
-  0x0f,0x5d,0xfb,0x7d,0x8a,0x8f,0x14,0x68,0x5f,0xaa,0x68,0xca,0xf0,0x43,0xe4,0x02,
-  0x2a,0x04,0x74,0x49,0xff,0x4f,0x1f,0xbc,0x22,0xfa,0x9f,0x7a,0xa6,0x6a,0xab,0xc7,
-  0xfb,0x7f,0x32,0xfd,0xdf,0x25,0xc2,0x3f,0x5f,0xcf,0xf8,0x8b,0x54,0x3b,0x70,0x23,
-  0xbb,0xc6,0x8f,0xe3,0xff,0x88,0x6a,0xcf,0x45,0x43,0xf1,0xf5,0xa2,0xff,0xa9,0x27,
-  0x97,0xb7,0xd9,0x81,0xb0,0xb4,0x6b,0xe8,0x2f,0xf0,0x7f,0xfa,0x45,0xdb,0x29,0xb9,
-  0xac,0xc9,0xf6,0x3f,0xa8,0x63,0xb7,0xd4,0x95,0xac,0x1b,0xcf,0xff,0xb9,0xa0,0x59,
-  0xf5,0x0c,0x45,0xff,0xf7,0x75,0xbf,0x2a,0x46,0xfc,0x93,0x7e,0xde,0x88,0x45,0x95,
-  0x71,0xf3,0x7f,0x72,0x70,0x7e,0x82,0xc2,0xed,0x3f,0xc4,0x0f,0x22,0x0c,0xf0,0xbd,
-  0xd4,0x51,0xa7,0x1f,0xb4,0x89,0xd0,0x07,0x2d,0xd7,0x8a,0xab,0x5f,0x06,0xf5,0x7f,
-  0x37,0x84,0xb7,0xe7,0x98,0x16,0x83,0x99,0x25,0x6a,0x67,0x53,0x26,0x10,0x06,0x31,
-  0xbd,0x52,0x2d,0xe0,0xec,0x70,0xa6,0xff,0xa9,0xb2,0x51,0x79,0x8c,0xe1,0xa6,0xbe,
-  0x95,0xfd,0x3b,0xac,0x30,0x66,0xd0,0xfc,0xac,0xd5,0xdb,0x98,0x78,0xcc,0x67,0xa1,
-  0x4d,0x15,0x19,0x61,0xae,0xfc,0x2f,0x65,0x3b,0xfc,0xab,0x36,0xd3,0xf0,0xbe,0xc4,
-  0x4e,0x1a,0xf7,0xc1,0x4c,0x43,0xdd,0xec,0xb1,0x03,0x61,0xe9,0x19,0xf6,0x50,0x23,
-  0x36,0x7b,0xbc,0x13,0xff,0xda,0xc4,0x86,0x02,0x07,0x25,0xea,0x7f,0x2a,0x57,0xb4,
-  0x1f,0x74,0xbf,0xf1,0xac,0xfc,0x2f,0xd1,0xff,0x9d,0xd3,0x78,0xc2,0x3f,0xe9,0x61,
-  0x65,0xb6,0xc0,0x2e,0xaa,0x7f,0xa8,0x6a,0x49,0x38,0x6b,0xcc,0x86,0x02,0x53,0x8e,
-  0xc3,0x00,0xed,0x67,0x71,0xfe,0xb5,0x7e,0x97,0x07,0x92,0x88,0x58,0x4d,0xe3,0xf8,
-  0x3f,0xd3,0xc9,0xc9,0x83,0xfb,0x53,0xdc,0x78,0x7a,0xa3,0xac,0x86,0xad,0x01,0xea,
-  0x70,0x87,0x9f,0x89,0xc3,0x88,0x76,0xd6,0x43,0x8e,0x01,0xa4,0x4d,0x3d,0x80,0xdb,
-  0x70,0x4e,0xdb,0x52,0xfd,0xc6,0x50,0x61,0x87,0xe2,0xcb,0x62,0xf0,0x66,0xf3,0x7f,
-  0x76,0xf3,0x69,0x96,0xff,0xb6,0x83,0x97,0x99,0x57,0xea,0x05,0x25,0xb0,0x2a,0xe3,
-  0xd1,0xcd,0x1f,0x20,0xfe,0x8f,0x93,0x9f,0x18,0x53,0x8b,0xe0,0x24,0x9f,0xa5,0x17,
-  0x44,0xe4,0x03,0xac,0x93,0x5f,0x1b,0xf5,0x2f,0x91,0xeb,0xd5,0xe7,0x1d,0x46,0x74,
-  0xec,0xaa,0xb7,0x50,0xb8,0x4b,0x1f,0xcf,0xff,0xc9,0x78,0x8f,0x13,0x08,0xa4,0x9d,
-  0xc4,0x8a,0x33,0xba,0xc8,0x6f,0x72,0xf5,0xff,0x52,0xba,0xe1,0x2c,0x6f,0xd0,0xfd,
-  0x07,0xe5,0x0d,0x70,0x34,0xde,0x10,0xf5,0xbf,0xeb,0xad,0xd7,0x8e,0xd8,0x89,0x3c,
-  0x17,0x36,0xd5,0x0f,0xad,0xa3,0xfc,0x77,0x7b,0x3c,0xf5,0x7f,0x17,0xfe,0x9c,0xb1,
-  0x76,0x1f,0xee,0xa7,0x42,0xe6,0x0b,0x41,0x56,0xd2,0x44,0xf7,0x5f,0x10,0x66,0x6f,
-  0x98,0xbb,0x13,0xa1,0xd4,0xfc,0x6f,0x07,0xde,0xbb,0xd1,0x9e,0x4f,0x0d,0xe2,0xb0,
-  0x87,0x9c,0x5a,0x07,0x58,0x9c,0xea,0x1d,0x19,0xde,0xbb,0x18,0xf5,0x0b,0x9b,0x62,
-  0x3d,0xef,0x0f,0xf5,0x19,0xfd,0xde,0x7b,0xdc,0xfc,0x1f,0xea,0xff,0xce,0xd3,0x7c,
-  0x06,0x61,0xe6,0x82,0xec,0x46,0x63,0x9b,0xc5,0x78,0x19,0x49,0xcf,0x67,0x53,0xc6,
-  0xff,0xbc,0x63,0x22,0xea,0x93,0x98,0x78,0x89,0x09,0xcb,0xad,0xf7,0x8b,0xe2,0xa5,
-  0xec,0x8f,0x69,0x22,0x81,0xfa,0xa6,0x68,0x55,0xe9,0xe2,0xff,0xc4,0x9d,0xfc,0x77,
-  0x38,0xae,0xfd,0x11,0x0a,0xf0,0xb5,0x36,0x6f,0xd7,0xff,0x1f,0x10,0xf5,0x9f,0xa9,
-  0x51,0x88,0xe8,0x88,0x9a,0x72,0xd6,0x4f,0x52,0x13,0xf5,0x90,0x01,0x37,0xf5,0xa3,
-  0x13,0xcf,0xa2,0xf5,0x5f,0x17,0xed,0xf8,0x17,0xe6,0x24,0xfe,0xbc,0x29,0x04,0x29,
-  0x8b,0xff,0xa3,0xd8,0xfe,0x1f,0x12,0x36,0x78,0x13,0x72,0x94,0x91,0x63,0x67,0x42,
-  0x32,0x53,0xcf,0xd0,0xed,0xff,0xd1,0xdd,0xde,0x57,0xd1,0x86,0xa6,0x82,0xd3,0x30,
-  0xd9,0xc5,0xa0,0x4e,0x64,0xfc,0xcf,0x25,0x99,0xfc,0xf7,0xc8,0xee,0xf2,0x10,0xf7,
-  0xea,0xed,0x37,0xb2,0x0e,0x2b,0x02,0x3b,0xc2,0xb7,0xe9,0xa1,0x03,0xde,0xaa,0x5c,
-  0xb7,0xff,0xc7,0xaa,0xbf,0x41,0xfe,0x67,0xe8,0x99,0x86,0xc0,0x6f,0x9b,0xbc,0xd6,
-  0xe2,0x97,0xee,0x21,0x7b,0x54,0xd3,0x30,0xe0,0xdf,0xdd,0x91,0xc8,0xe4,0x7f,0x4d,
-  0x4c,0xf7,0xbf,0xd8,0x63,0x59,0xf3,0x35,0x7e,0xbd,0x78,0x8f,0x95,0xb6,0x73,0x82,
-  0x18,0x65,0x7a,0x43,0xbf,0xbf,0x5b,0x1e,0x76,0xf0,0x8c,0xa8,0x7f,0x88,0x20,0xd0,
-  0x67,0xca,0x97,0x91,0xff,0xc7,0xf0,0x3d,0x23,0xd7,0xc0,0xeb,0x7c,0x6e,0x0a,0x67,
-  0x6c,0x32,0xa5,0xc6,0x53,0x20,0x2c,0x9c,0xc1,0x93,0x71,0xd1,0xff,0x4b,0x0f,0x72,
-  0x16,0xd2,0x9e,0x86,0x40,0x34,0x92,0x9b,0x1b,0x34,0xd0,0xbe,0x1f,0xb8,0x32,0x56,
-  0x34,0x1d,0xf6,0x21,0xde,0x23,0x28,0x98,0xe1,0x03,0xe4,0xac,0x25,0x76,0x37,0x6d,
-  0xba,0x7d,0xa2,0xbf,0x8c,0x8a,0x9b,0xb9,0x64,0x3c,0x88,0xf6,0x08,0x81,0x1f,0xa5,
-  0xc2,0x51,0x7d,0xf5,0x80,0x64,0xcf,0xbf,0xc8,0xff,0x8a,0x6d,0x6d,0x57,0x77,0x1c,
-  0x08,0xf1,0x1f,0xc3,0x56,0x43,0xdd,0xc5,0x42,0xfa,0x9a,0xf6,0x80,0x99,0x17,0x2f,
-  0x9a,0x49,0x7f,0x3a,0x9a,0x97,0x70,0xed,0xf7,0xa5,0x89,0x23,0xda,0x05,0x3e,0x7b,
-  0x8f,0xaf,0x9f,0xec,0xaf,0x54,0xb5,0x38,0xd4,0xd7,0x3e,0x4d,0x3b,0xca,0xab,0x7b,
-  0xe7,0xc3,0x35,0x33,0xb5,0x0f,0x79,0x38,0xe5,0xd3,0x64,0x70,0xfa,0xbf,0x8f,0x4a,
-  0x54,0xff,0x07,0x97,0x19,0x85,0xbd,0x2e,0xc0,0xbc,0x5e,0xff,0x60,0xf1,0x08,0xed,
-  0x58,0x4d,0xff,0x10,0x05,0x46,0xf5,0x06,0xee,0xbb,0xa8,0xff,0x7b,0xaa,0x6a,0xd0,
-  0xd7,0x6e,0xf1,0x5b,0x0c,0xff,0x56,0x79,0x9a,0x46,0xf8,0x27,0x64,0xca,0xef,0xc7,
-  0x5f,0xa0,0xd4,0x3c,0x77,0xfd,0x43,0xf2,0xff,0xec,0x36,0x75,0xae,0x6e,0x65,0x21,
-  0xb4,0xe6,0x95,0xe6,0xfc,0xa7,0x3c,0x33,0xf4,0xd7,0xa8,0x7e,0x51,0x77,0xd3,0x71,
-  0xfe,0x1a,0xf5,0x43,0xd9,0x33,0xae,0xfe,0x21,0xee,0xbf,0x20,0xd8,0x89,0xf3,0xf3,
-  0x73,0xb6,0x24,0xea,0x5d,0xcb,0xa6,0x6b,0xb1,0x7e,0x34,0xd3,0xaa,0xc5,0x3f,0x5c,
-  0x8a,0x1b,0x55,0x7b,0x36,0xed,0xfc,0xaf,0xb2,0xe9,0xb1,0xaf,0xb2,0x06,0xbe,0x8a,
-  0xcf,0xf8,0x8a,0xf7,0x1f,0x8b,0xae,0x84,0x9f,0xf0,0x3b,0x87,0xd4,0xef,0x36,0x9d,
-  0x87,0x1f,0xb6,0x97,0x27,0xd4,0x61,0xa6,0x66,0xf5,0x7f,0x3f,0x03,0x61,0x43,0x5d,
-  0x23,0xe7,0xf2,0xdf,0xeb,0x75,0x2d,0x5e,0x4d,0x56,0xc0,0xd4,0xba,0x87,0x43,0x8a,
-  0x7c,0xd8,0xec,0x15,0xd0,0x48,0xbe,0x62,0x5c,0xfd,0x9f,0x9f,0xf5,0xfb,0x8f,0xc9,
-  0x67,0x8d,0x0f,0xd4,0x86,0x96,0x85,0xa3,0x82,0x36,0x4f,0x65,0x7f,0x28,0xff,0x8b,
-  0xf8,0x3f,0x77,0xba,0xf0,0x5e,0x50,0xd9,0xa9,0x9c,0x51,0xaa,0x24,0x1f,0xc8,0x21,
-  0xf6,0x82,0x4e,0x68,0xd0,0x5b,0x27,0x2a,0xb4,0xfb,0x56,0x5a,0x6f,0x84,0x77,0x6e,
-  0xc2,0x57,0x6e,0x8f,0xb7,0xf2,0xbf,0x74,0x20,0xd8,0x03,0x0f,0x4f,0x9b,0x61,0x7a,
-  0x96,0xc9,0x93,0xc8,0x23,0x84,0x40,0x85,0x89,0xd4,0x78,0xb3,0x60,0x19,0xbb,0xc2,
-  0xd9,0x31,0x34,0xc2,0x4f,0x95,0xd9,0x04,0x72,0x06,0xd8,0x4f,0xf5,0x55,0xa8,0x9d,
-  0x4a,0x6b,0xd8,0x1d,0x73,0x1e,0xeb,0xfc,0x5a,0x6a,0x5a,0x84,0x4d,0xd6,0xf7,0xc6,
-  0xca,0xdf,0x52,0xcf,0x32,0x75,0x5c,0xfe,0x17,0xce,0x5e,0x45,0xfb,0x43,0x50,0x4e,
-  0x6a,0x67,0x8e,0x27,0x5f,0xdf,0x45,0xf9,0x98,0x35,0x6c,0x9d,0xbe,0x9b,0xeb,0xef,
-  0xa2,0x22,0x2a,0xca,0x8a,0x7f,0x7d,0xbc,0x6c,0x16,0x0f,0x8d,0x78,0x77,0x50,0x58,
-  0x33,0x16,0xfa,0xbd,0xbc,0x1c,0xce,0xb7,0xd6,0xf3,0xcf,0x3e,0x2a,0x5f,0x07,0x27,
-  0xa0,0x3c,0xee,0x1b,0xf1,0xd6,0x8e,0x8b,0x7f,0x3d,0x05,0xfe,0x4e,0x34,0xc9,0xc4,
-  0x7f,0x26,0x47,0x90,0xc8,0xd0,0x29,0x00,0x39,0xa5,0x2d,0x87,0xa7,0xb4,0x82,0x95,
-  0xcd,0x59,0xf9,0x5f,0x54,0xe4,0x30,0xea,0x2b,0xf5,0x4e,0x8d,0xfc,0x4a,0x0a,0x2f,
-  0xf1,0x95,0x10,0x11,0x08,0x11,0x02,0xc2,0x66,0x04,0xd2,0xac,0x6a,0x89,0xef,0x5f,
-  0xc6,0xe7,0x7f,0x99,0x81,0x6f,0x06,0x37,0xb2,0xa9,0xb0,0x5a,0x0a,0x10,0xed,0x67,
-  0x0a,0xec,0xeb,0xa5,0x46,0xe4,0xf2,0x8d,0xca,0x6a,0x75,0xce,0x12,0x75,0xc3,0xf8,
-  0xfc,0xaf,0xd2,0x40,0xb3,0xba,0x9e,0xd9,0xfd,0x2f,0xda,0xa7,0x14,0x52,0xe2,0x52,
-  0xe9,0x26,0x36,0xc5,0x58,0x5d,0x26,0xfa,0x35,0x64,0xc7,0xbf,0xf6,0x59,0x6e,0x9f,
-  0x5c,0x68,0xd3,0xf5,0xcf,0x2c,0xa1,0x44,0xf8,0xdd,0x4a,0xc8,0x08,0x16,0x35,0x2d,
-  0x86,0x36,0x36,0x95,0xfc,0x3f,0x19,0xfc,0x23,0xf8,0x3f,0xad,0xf8,0x7e,0x1f,0x94,
-  0xcb,0x8c,0xa3,0xad,0x5b,0xc1,0xb7,0xc2,0x53,0x66,0x8c,0xb5,0xd6,0x97,0x90,0xea,
-  0x42,0x8b,0x7a,0x8f,0x95,0xff,0x6e,0x7f,0x5f,0x94,0xff,0x75,0x4e,0xfb,0x59,0xcb,
-  0xc2,0x5f,0xc1,0xcb,0xca,0x29,0xad,0xa1,0xc5,0xff,0xab,0xc2,0x93,0xc6,0x2f,0x05,
-  0xff,0x99,0x9d,0x54,0xfe,0xa4,0xfc,0x33,0xf1,0x79,0xb2,0xfb,0xbf,0xff,0x8e,0xbc,
-  0xf1,0x2f,0xc9,0xdf,0x84,0x77,0xc3,0x38,0x2d,0xb8,0xff,0x32,0xfe,0x44,0x89,0xc0,
-  0x1b,0xe4,0x39,0xf0,0x22,0xcc,0xa2,0x23,0x87,0xb3,0xfa,0x9f,0xd6,0xa8,0x77,0x29,
-  0xde,0xf6,0x76,0x3d,0x16,0x0b,0xd7,0xe2,0x66,0xac,0x5d,0x37,0x7a,0x82,0x95,0x6a,
-  0xb0,0x0d,0x77,0xa0,0x3b,0x18,0xf5,0xbf,0x18,0xd7,0xff,0x7d,0xbd,0xa6,0x1b,0xf3,
-  0x8b,0x99,0xa2,0xb7,0x95,0x85,0x0c,0xb5,0xd0,0xe3,0x23,0x04,0x38,0x5f,0xa5,0xc2,
-  0x47,0x54,0xf8,0x51,0xd5,0x5c,0xfd,0x70,0x37,0x4d,0xdc,0x9e,0xb3,0x0f,0xb6,0x46,
-  0xbc,0x1b,0x72,0x17,0x37,0xad,0x86,0xe9,0xc6,0x1a,0xc4,0x93,0x51,0x82,0x91,0x91,
-  0x78,0x60,0x31,0xfc,0x9c,0x07,0x50,0x60,0xef,0x38,0xf1,0xb2,0xc4,0xf7,0x87,0xe0,
-  0x95,0x29,0x81,0xcf,0xf9,0xff,0xc5,0x5b,0xa1,0x11,0xda,0xf1,0xfd,0xcc,0x7b,0x0d,
-  0x9c,0x8a,0xd5,0x1b,0x0b,0xe2,0x5d,0x5f,0xe1,0xbd,0xd0,0x7d,0x9b,0x6f,0xd3,0xb8,
-  0xfc,0xaf,0x34,0xdb,0x67,0x3b,0xbc,0x02,0x35,0x44,0x2c,0x1c,0x52,0x44,0x61,0xcc,
-  0xa4,0xbc,0x3d,0x7a,0x4a,0xaa,0x8f,0xce,0xdc,0x50,0x9c,0xdd,0xff,0x7d,0x38,0x52,
-  0x55,0x14,0xe2,0xe5,0x16,0x10,0x2d,0xc0,0xfd,0xb1,0x3e,0xd6,0x44,0x5f,0xdc,0x03,
-  0x5b,0x60,0x79,0x81,0x88,0x48,0x66,0xf7,0x7f,0x7f,0x8a,0x6f,0x4b,0xa8,0xc7,0x3d,
-  0x35,0x84,0x76,0xda,0xbd,0xef,0xb2,0xeb,0xe0,0xb8,0x12,0xa0,0xb2,0x87,0xa5,0xfa,
-  0x53,0x91,0x19,0x3c,0x7f,0x88,0xb9,0xfa,0xbf,0xe3,0xfe,0xab,0xdc,0x48,0x0c,0xaa,
-  0x4f,0x6e,0xd8,0x61,0xf3,0x0f,0xf3,0x51,0xc0,0x65,0x03,0xec,0x7e,0x54,0x65,0xa1,
-  0x95,0x79,0xd5,0xee,0xfe,0xef,0xc4,0xff,0x51,0xcb,0x46,0x83,0xe1,0xdc,0xcd,0x22,
-  0x7f,0x41,0xfe,0x26,0x7e,0xc8,0xff,0xc6,0xcb,0xfa,0x55,0x63,0x65,0x89,0x68,0x0d,
-  0x9f,0xb7,0x84,0x65,0xf6,0xe3,0x54,0xff,0xf9,0x7d,0x54,0xc2,0xea,0x72,0xf9,0x07,
-  0xf0,0xe7,0xc4,0xbc,0xb7,0x0a,0xc6,0xe4,0x2b,0xb4,0x3d,0x7c,0x77,0x2a,0x14,0x6c,
-  0xff,0xa9,0xa0,0x46,0xe7,0x2f,0x97,0x59,0x06,0xff,0x38,0xfd,0xdf,0xa1,0x82,0x1c,
-  0x17,0x84,0x76,0x44,0x62,0x66,0x9f,0xff,0x21,0xd9,0x02,0x42,0xd9,0xfd,0xdf,0x73,
-  0xce,0xa3,0xfe,0xbf,0x1e,0x8d,0x54,0xf3,0x74,0x2a,0x7b,0x98,0x0a,0x8d,0x79,0xab,
-  0xe1,0x42,0xe7,0xbd,0xc7,0xd0,0x22,0x3c,0x45,0x1b,0x5b,0x91,0xff,0xe5,0xf8,0xd3,
-  0x1e,0xb1,0xea,0x6f,0x18,0x6a,0x95,0xe7,0x7e,0xd1,0xbd,0x5d,0x6d,0x25,0xda,0x61,
-  0x70,0x6a,0x4a,0xbd,0x55,0xe6,0xd1,0xc7,0xb4,0x19,0xb7,0x07,0x97,0xb1,0xb7,0x9a,
-  0xec,0xf1,0xd4,0xff,0xf4,0x31,0x75,0x5a,0xab,0xba,0xec,0x89,0x8d,0xb1,0x09,0x14,
-  0xff,0x8a,0xb2,0xdb,0xa2,0x7b,0x8c,0xaf,0x99,0x6a,0x4b,0xae,0x55,0x01,0xbb,0x74,
-  0x5c,0xfd,0x67,0x75,0x97,0xaa,0x47,0xd5,0x7f,0x61,0x8a,0xe8,0xf6,0xa5,0xae,0xc0,
-  0x8d,0x7f,0x37,0x9b,0x6a,0xaa,0x5a,0xae,0xa9,0xe3,0xfe,0xa2,0x55,0x75,0xd7,0xff,
-  0x19,0x46,0x7b,0x77,0xca,0xac,0x1d,0x0b,0x3d,0x29,0x3f,0x84,0xf6,0xa2,0x3e,0xe5,
-  0x7b,0x4c,0xfa,0x9a,0xb1,0x1b,0xed,0x11,0x6e,0x34,0xde,0x21,0x57,0x4f,0x4a,0xbd,
-  0xaa,0xc3,0x15,0xff,0x92,0x76,0xc2,0x29,0xe3,0x49,0xb2,0xef,0x43,0xc6,0x47,0x4a,
-  0xbd,0xb9,0x2e,0x21,0x3f,0x08,0x63,0x4d,0xd5,0x66,0xbe,0x4a,0x0c,0x90,0xbe,0xfa,
-  0x61,0x81,0xb7,0x9d,0xf9,0xd1,0x9e,0x14,0x65,0xa2,0x51,0xdb,0xcc,0x31,0xfe,0x3b,
-  0xcc,0xea,0xf7,0xbd,0x2a,0xd7,0xf2,0x11,0x69,0xb6,0xe9,0x4b,0x79,0xc3,0xc2,0xd5,
-  0xef,0x3b,0x29,0xab,0x4e,0xfc,0x6b,0x05,0x2c,0x85,0x5f,0xa6,0x2a,0xa3,0xea,0xeb,
-  0x72,0x0b,0xc2,0x1e,0xb4,0xef,0x7d,0x4d,0x01,0x1e,0x4b,0x05,0xcc,0xcf,0x3e,0x22,
-  0x7f,0x89,0xef,0xeb,0x0d,0x2d,0xf3,0x25,0xdb,0x83,0x59,0xfe,0x9f,0x7d,0x9c,0xd8,
-  0x3e,0x1b,0xa6,0x88,0x6a,0x3f,0x68,0xdd,0x80,0x3e,0x13,0x33,0xc2,0x73,0xa7,0xc2,
-  0xbe,0xb6,0xca,0x94,0xa8,0xd7,0xea,0x8a,0x7f,0x49,0x38,0x09,0x51,0xfa,0xfa,0x38,
-  0x6e,0xfc,0x7b,0x83,0x70,0x33,0x48,0x31,0xd0,0x07,0xf3,0x34,0x0f,0x42,0x71,0xdc,
-  0x98,0x4c,0xd3,0x3c,0xcc,0xb1,0x5f,0xed,0xf9,0x4b,0xe9,0xfe,0x25,0xdf,0x7a,0xb9,
-  0xc2,0xa0,0xeb,0xa3,0xa1,0xc1,0xcf,0x5c,0xa9,0x3a,0x8a,0x6a,0xa7,0x4c,0x24,0x92,
-  0xe0,0xa3,0x81,0x93,0x7f,0xba,0xf5,0xaa,0xb3,0xf0,0x5d,0x8a,0xef,0xbc,0x24,0x6f,
-  0x34,0xdf,0x24,0xfb,0x6e,0xb2,0x51,0x15,0x11,0xe0,0x51,0x6a,0x74,0x25,0xfc,0xcf,
-  0xc4,0x7f,0x76,0xd5,0x7f,0x26,0x98,0x34,0x9b,0xba,0x55,0x96,0xc2,0x11,0xaa,0xff,
-  0x13,0xf3,0x2e,0x17,0x65,0x7f,0x10,0x3f,0x7f,0x1d,0x44,0xff,0xf7,0x1e,0x04,0x6b,
-  0x99,0xf8,0xd7,0x08,0x3c,0xa1,0x50,0x35,0x42,0x4f,0x90,0xd0,0x60,0xca,0x1b,0xbb,
-  0x75,0x7a,0x6b,0x17,0x9f,0x9e,0xf2,0xf6,0x34,0xf9,0xf4,0x75,0x94,0x08,0xd6,0xd3,
-  0x14,0x76,0xf1,0x7f,0xfa,0xc8,0xed,0x63,0x94,0x86,0xd1,0x48,0x09,0x98,0x97,0x10,
-  0x8e,0x7a,0xab,0x11,0x2a,0xef,0xb0,0x12,0x0d,0xee,0xc9,0xf8,0x7f,0x0a,0x77,0x8a,
-  0x6c,0x32,0xb5,0x27,0x77,0x3a,0xce,0xff,0xd7,0x4d,0x6f,0x0c,0x55,0x5a,0x97,0x99,
-  0x6e,0x84,0x9a,0xee,0x88,0xba,0x3c,0x53,0x0f,0x8a,0xf8,0x3f,0x3c,0xb9,0x04,0xd7,
-  0xcf,0x74,0xf5,0x85,0x38,0xae,0x87,0x90,0x3c,0x1d,0x5e,0x31,0xab,0xac,0xfc,0x2c,
-  0xab,0x62,0xb3,0x6c,0x38,0xf1,0xac,0x14,0xae,0x9f,0xf3,0x16,0xe8,0x4d,0xe7,0x03,
-  0xa6,0xe4,0x4d,0x38,0x5f,0x4f,0xe3,0x11,0x2f,0x41,0xc7,0xbd,0x24,0xf4,0x44,0xed,
-  0xf1,0x2d,0xb8,0x7f,0x7f,0x81,0xba,0x39,0xf7,0xc8,0x41,0x0b,0x76,0x26,0xe4,0xa5,
-  0x2c,0xed,0xff,0x39,0x2e,0x8e,0x50,0xfd,0x1f,0x37,0xff,0x27,0xb7,0x43,0xdf,0x6a,
-  0x06,0x6b,0xf0,0x6e,0x5f,0xb3,0x89,0x64,0x1d,0xbc,0x9a,0x1e,0x73,0x44,0x5d,0x85,
-  0x47,0xae,0x0a,0x37,0x65,0xf8,0x3c,0x84,0x7f,0x3a,0x78,0xf4,0x68,0x9e,0xc6,0x96,
-  0x58,0xd5,0xd1,0x81,0x45,0xd4,0x0e,0xbe,0x5d,0x8c,0x17,0x33,0x46,0xf5,0x7f,0x1c,
-  0x7e,0x7b,0x52,0x9a,0xcc,0x57,0xc6,0xcb,0x86,0xf2,0x4e,0x79,0xbe,0x0d,0x3f,0x4c,
-  0xcc,0x48,0x5d,0x19,0xd9,0x7a,0x05,0xac,0xe3,0x53,0x52,0x57,0x2e,0x67,0x6f,0xe4,
-  0xad,0x4a,0xcc,0x24,0xff,0xcf,0x59,0xfb,0xf2,0x88,0x7f,0x14,0xba,0x7f,0xf3,0xb3,
-  0x05,0x9e,0x08,0x3c,0xa3,0x13,0x11,0x5a,0xc6,0xbf,0xa8,0x8a,0xb6,0x17,0xc4,0x08,
-  0xaa,0x4f,0x45,0xae,0x97,0x5f,0x75,0xc6,0x23,0xfe,0xe1,0x02,0x2d,0x2f,0xf3,0xf6,
-  0xd0,0x46,0xde,0x9c,0xa0,0xcb,0x47,0x2d,0x47,0x50,0x92,0x3a,0xea,0x32,0xab,0xff,
-  0x85,0x8b,0xff,0x43,0x65,0x10,0xba,0x53,0xbe,0xb8,0x1c,0xbc,0x51,0xcc,0x4f,0x10,
-  0x27,0xea,0x19,0xab,0x2c,0x15,0x9e,0xda,0x52,0x45,0xd4,0xbe,0x43,0x0e,0x9f,0x87,
-  0xf8,0x3f,0xed,0x96,0x93,0x67,0xb2,0xb5,0x6d,0x8c,0xa2,0xfe,0x59,0x05,0x5b,0xac,
-  0xfd,0xd4,0x36,0xab,0x22,0x62,0x86,0x0f,0xc6,0xe1,0x71,0x0a,0x7b,0xa5,0xd4,0xa3,
-  0xec,0x8a,0x04,0xe2,0xbd,0x63,0xde,0xe1,0x40,0x81,0xdd,0xf6,0xe2,0x0d,0xf8,0x61,
-  0xb2,0x2c,0x35,0x7f,0x79,0x91,0xe9,0xc2,0x3f,0x08,0x1a,0x35,0x7d,0x13,0x82,0xc6,
-  0x09,0xfa,0x6a,0xb1,0x11,0x6b,0xcf,0xe7,0xa2,0x8c,0x9b,0xd5,0x58,0x36,0x7a,0x31,
-  0xff,0xe7,0x30,0x9f,0x1d,0xf7,0x0d,0x21,0xda,0x21,0xb7,0x8f,0xff,0x1d,0xf9,0xfa,
-  0xc0,0x73,0x46,0x95,0x45,0x84,0x7e,0xd5,0xea,0x7f,0xf1,0x91,0xab,0x9f,0x66,0x8a,
-  0x11,0xfe,0x99,0xc9,0xbd,0x66,0x7a,0xf7,0x3d,0xff,0x98,0xe2,0xe4,0x23,0x0f,0x5f,
-  0xa2,0xfe,0xa1,0x66,0x65,0x7b,0xa5,0xbb,0x21,0xf8,0x7f,0x24,0x88,0x40,0xd5,0xd4,
-  0xdf,0x6a,0xb1,0x94,0x26,0x02,0x3d,0x93,0x79,0xde,0x8c,0xff,0xe7,0x5a,0xab,0x7a,
-  0xe1,0x26,0xf6,0x07,0x96,0x67,0x95,0xdd,0x73,0x18,0xce,0xa9,0x9c,0x8b,0xf9,0xcf,
-  0x6c,0x71,0x70,0xb5,0x16,0xa0,0xe8,0xfc,0x50,0x67,0x1e,0x4c,0x6d,0xa4,0x23,0x54,
-  0x38,0xa8,0xd1,0x3b,0x2e,0xff,0xdd,0x6a,0xf2,0x5e,0x14,0x68,0x49,0x97,0x7d,0x66,
-  0x7d,0xb1,0xd5,0x7a,0x82,0xae,0x60,0xbb,0x86,0x72,0x33,0xfc,0x90,0x9e,0xfc,0x3b,
-  0x8d,0xb1,0x5b,0x45,0xd9,0xe7,0x46,0xea,0x76,0x4a,0x4f,0x37,0x0c,0xfd,0x4c,0xd0,
-  0x9c,0x1a,0x8d,0x1e,0xeb,0x79,0x3f,0x76,0xec,0x5d,0xff,0x55,0x2f,0x1b,0xe7,0xb4,
-  0x79,0x86,0xff,0x16,0xef,0x9e,0xa6,0x73,0xe9,0x32,0xce,0x78,0xe4,0xa7,0x96,0x3f,
-  0xe7,0x54,0xc9,0xb8,0xfa,0x87,0xa5,0x13,0x4f,0xea,0xef,0xab,0xa8,0x84,0x07,0x3b,
-  0x08,0xed,0xcc,0x16,0x8e,0x23,0xfe,0x22,0x25,0x46,0xa1,0xd0,0xf4,0x3b,0x8b,0x1a,
-  0x94,0xe9,0xff,0xbe,0xbc,0x34,0x05,0x6b,0x0c,0xea,0x66,0x8e,0x9b,0xca,0x98,0x88,
-  0x76,0xb1,0x14,0xa3,0x32,0x38,0x22,0x22,0xd6,0xdf,0x5a,0x39,0x9e,0xff,0x63,0xf1,
-  0x31,0xd4,0xee,0x76,0x45,0xfd,0xb1,0xd5,0xff,0xe2,0x79,0x58,0x6f,0x54,0xd0,0x83,
-  0x0f,0x41,0xda,0xf1,0x95,0x59,0x0f,0xa5,0x39,0xdb,0x95,0xd5,0x94,0x76,0x17,0xf7,
-  0xac,0x64,0x3f,0xd2,0x71,0x3e,0x37,0x92,0xdb,0xc7,0x4a,0xbb,0x1b,0x92,0x7e,0x64,
-  0x4d,0xb5,0xab,0xfe,0x61,0xc9,0x49,0xe3,0x7d,0x68,0x68,0x0d,0xc5,0xa5,0x6a,0xe5,
-  0xdf,0xa9,0x7e,0xf5,0xf7,0xe5,0xb7,0xe1,0x15,0xa3,0xda,0x66,0x7c,0xd5,0x8f,0xab,
-  0x7f,0x08,0x9d,0x60,0x95,0x01,0x17,0xf5,0x0f,0xeb,0x8d,0x09,0x9b,0xe4,0xe7,0xdd,
-  0x15,0x11,0xf1,0x48,0x36,0xff,0x27,0x41,0x45,0xcc,0xb4,0x50,0x67,0xb9,0x15,0x76,
-  0x24,0xbc,0xad,0xa7,0xdb,0x5e,0xe8,0x56,0x68,0x6c,0x3c,0xff,0x67,0x0d,0x94,0x73,
-  0x55,0x67,0xb5,0x44,0x3b,0xe4,0xde,0x54,0xee,0x69,0x68,0xd7,0x45,0xdb,0x8b,0x20,
-  0x88,0x42,0xd0,0x89,0x80,0xab,0xfe,0x61,0x0e,0xf1,0x9f,0xd3,0x65,0x0f,0xa9,0x5f,
-  0xf0,0xfc,0x6a,0xf6,0xa2,0x91,0xf6,0x97,0xfa,0xd2,0xa1,0x31,0x17,0x5f,0x48,0x97,
-  0x26,0xc5,0x57,0x24,0xb6,0xc4,0xd4,0xd1,0xdc,0xdf,0x99,0xab,0xc2,0xc2,0xed,0x33,
-  0x80,0xdf,0x6f,0x19,0xd5,0x7f,0x2e,0xc1,0xfd,0xc5,0x45,0xf5,0x0f,0xeb,0xe3,0x6f,
-  0x26,0x66,0x8f,0x2d,0x58,0xee,0x3d,0x04,0xcf,0x0a,0xb7,0x0f,0x7b,0x95,0x3d,0x4f,
-  0xf5,0x7f,0x96,0x8b,0x42,0x40,0xb3,0xc6,0xd5,0x3f,0xbc,0xea,0x17,0xc6,0x75,0xf1,
-  0xfa,0x84,0x3f,0xec,0x9d,0xce,0x4e,0x71,0x2b,0x9b,0x1b,0x3e,0xb2,0x60,0xcf,0x90,
-  0x7e,0x46,0xa1,0x46,0x8a,0xe5,0x87,0x5c,0xfc,0x9f,0x8f,0x8d,0xdf,0xb5,0xa1,0xfd,
-  0x3a,0x2a,0x57,0xc3,0xb9,0xf6,0x59,0x29,0xdf,0xb0,0x7c,0x5e,0x7d,0x51,0x94,0x7d,
-  0x96,0xcf,0xc3,0x91,0xf8,0xf5,0xa2,0xff,0xbb,0x33,0xfe,0xd1,0xc2,0x3d,0x83,0xcf,
-  0x42,0x19,0xa8,0xa3,0x4d,0x97,0xc5,0xde,0x85,0xb2,0x61,0x75,0x04,0xf1,0xdb,0x2a,
-  0xab,0x23,0xc6,0xeb,0xb0,0x2e,0xa1,0x8f,0x74,0x2d,0x67,0x5f,0x75,0xde,0x17,0xc0,
-  0x46,0xf5,0x3e,0xc4,0x4b,0x79,0xad,0x4c,0xe3,0x8f,0xa9,0x53,0x06,0x54,0xb3,0x69,
-  0x33,0xac,0x50,0xc5,0x63,0xbe,0x81,0x88,0x45,0x10,0x81,0x46,0x5c,0xfc,0x9f,0x3e,
-  0xb5,0x8d,0xeb,0x5a,0x5e,0x98,0x95,0xf1,0x2d,0x38,0x8d,0x6a,0x05,0xf8,0xd4,0x8e,
-  0x88,0xf0,0x78,0x8c,0xb0,0xb4,0x63,0xbf,0xd5,0x99,0xff,0x1d,0x13,0x3b,0x51,0x7f,
-  0x86,0x21,0x3f,0x29,0x07,0xe0,0x23,0x4a,0x1b,0xd9,0x5e,0xde,0x09,0xcf,0x98,0x55,
-  0xbd,0x56,0xfc,0xc2,0x72,0x85,0xbd,0xe5,0xea,0x8f,0xfc,0x10,0xed,0x9e,0x94,0x82,
-  0xdd,0xf2,0xef,0xe1,0x8f,0xf0,0x6d,0xd3,0xbf,0xe3,0x99,0xed,0xba,0x55,0xf8,0xa5,
-  0x78,0x28,0xdd,0xff,0xbd,0x29,0xd3,0x8f,0x5e,0xd2,0x3e,0x86,0x23,0x6a,0x43,0x55,
-  0xfe,0x32,0xb9,0x4a,0xc2,0xef,0xab,0x77,0x61,0xaa,0x7c,0x0e,0x99,0xf5,0x5e,0x77,
-  0x05,0x98,0x21,0x17,0xff,0x87,0xfa,0x09,0x56,0x02,0x35,0x65,0x10,0x61,0x8b,0xd5,
-  0x21,0xf9,0x0f,0x02,0xd8,0xac,0xa3,0xc4,0xf6,0xd7,0xf0,0x0f,0x89,0xfe,0xef,0xf6,
-  0xfd,0xf3,0x9c,0xc5,0x86,0x18,0x1f,0xc7,0xe7,0x15,0x61,0x8e,0x1d,0x6c,0x6a,0xc5,
-  0x6a,0x78,0xc7,0x66,0x10,0x4d,0x37,0xe7,0x27,0x03,0x29,0x67,0x36,0xa9,0xfe,0x18,
-  0x7e,0x74,0xba,0x3a,0x8b,0x41,0xa2,0x0d,0x52,0xfd,0x79,0x3a,0xaa,0xb5,0x2e,0xd8,
-  0x6e,0xde,0x84,0x2b,0xd0,0xf7,0x40,0x69,0x70,0xc0,0x3b,0xc7,0x55,0x9f,0x13,0xd4,
-  0xc5,0xf8,0x11,0x85,0x20,0x14,0x97,0x75,0xbe,0x5a,0xab,0x32,0xbd,0x0f,0xa1,0x3d,
-  0x25,0xfb,0xeb,0xed,0x96,0x7f,0x67,0xbc,0x10,0xbd,0xe2,0x80,0xa8,0xf7,0xe8,0xc4,
-  0xbf,0xae,0xa2,0xb2,0xf3,0x0d,0xe0,0x3f,0x81,0x07,0x51,0xff,0xf4,0xe5,0x6f,0xeb,
-  0x78,0x9d,0x1a,0xbf,0x9a,0xfe,0x5d,0xf8,0xbc,0xdf,0xc1,0xf9,0x99,0xf0,0x61,0x20,
-  0x95,0xc5,0xff,0xc1,0x45,0x38,0xe4,0x7b,0x1d,0x57,0xe3,0x61,0x2a,0x84,0x78,0x42,
-  0xae,0x82,0xc3,0xca,0x5c,0x6a,0xd4,0x72,0x5e,0x3a,0x42,0xfc,0x9f,0xec,0xfa,0x87,
-  0x23,0xb0,0xaf,0x2c,0xd0,0x18,0xd9,0x50,0x14,0x4a,0xae,0xf1,0x4c,0x8f,0x04,0xff,
-  0x14,0x98,0x0e,0x6b,0xda,0x02,0xa9,0xf9,0x3d,0x81,0xe3,0xd0,0x85,0xd0,0x85,0xea,
-  0xff,0xb8,0xf2,0xc1,0x07,0xf4,0x27,0x54,0xbd,0x1f,0x37,0xad,0x3e,0xde,0xce,0xa2,
-  0x86,0xa7,0xaa,0x1d,0x51,0x1d,0x2e,0x83,0x2b,0x2d,0xfb,0x2e,0x3e,0xbd,0xf7,0x24,
-  0x7b,0x3c,0xe2,0x1f,0xdf,0x3e,0x9e,0x30,0xd5,0x4d,0x4d,0x3e,0x1c,0x26,0xda,0x7e,
-  0x85,0xe8,0xb2,0x56,0x63,0x11,0x7a,0x11,0xa2,0xfe,0x8f,0xb3,0x3e,0x11,0xff,0xec,
-  0x4a,0x55,0x99,0x21,0x5f,0x57,0x05,0x5b,0xc3,0xaa,0x8c,0x9b,0x47,0xbd,0xc0,0x9f,
-  0xc1,0x85,0x74,0xf5,0x93,0xf2,0xdb,0xb8,0xde,0xaa,0x44,0x7d,0x00,0x17,0xfe,0x79,
-  0x52,0x11,0xde,0x9e,0xc1,0xe2,0x73,0x0a,0x02,0xa1,0xd6,0xfc,0xd1,0xe6,0xd3,0x4b,
-  0xd2,0x65,0x9f,0x3f,0xe6,0x17,0xd4,0x86,0x03,0x59,0xf9,0x5f,0xad,0xda,0x4e,0xb4,
-  0x5f,0xb8,0x2c,0x29,0xff,0xeb,0x90,0x8e,0xf6,0x2b,0x8c,0x6a,0xe7,0x35,0x43,0xd8,
-  0xf7,0x29,0xca,0x99,0x9c,0xfa,0x67,0xfd,0xd9,0xf1,0x2f,0xaa,0x07,0x5e,0x6d,0xc6,
-  0xe2,0x78,0xdb,0xaf,0xc6,0x02,0x94,0xdf,0x3d,0x53,0xdf,0xdf,0x2e,0xe2,0x5f,0x0a,
-  0xec,0x37,0x42,0xa3,0xde,0xac,0xfa,0x3f,0x92,0xa8,0x7f,0x88,0xbb,0x03,0xd4,0x36,
-  0x1b,0xa8,0x6c,0x5d,0x98,0xe5,0x40,0x72,0x99,0x4e,0x19,0x52,0x8e,0xab,0x70,0xd4,
-  0x19,0x3f,0x2c,0x4d,0x36,0x7e,0xd9,0xf6,0x0f,0xd1,0xc8,0x22,0x56,0x5f,0xf2,0xd3,
-  0xf8,0x94,0xc5,0x5d,0xd7,0x7d,0xf1,0x32,0xf5,0x31,0xc2,0x03,0xc3,0xac,0xc8,0xe1,
-  0x03,0xbb,0xfd,0x3f,0xea,0x87,0x30,0xc7,0x0c,0xc5,0xbd,0x3e,0x78,0x09,0xe6,0xd0,
-  0xfd,0x03,0x9c,0x80,0x70,0xdf,0xc2,0x70,0xb3,0xcf,0xf8,0x28,0x47,0x54,0x04,0x7a,
-  0x35,0x93,0xff,0xf5,0x59,0xc1,0xff,0x31,0x27,0x0c,0xe2,0x6a,0xf9,0x18,0xf6,0x37,
-  0x2e,0x1c,0x6d,0x26,0x47,0x59,0x43,0xaf,0x68,0x14,0x9b,0x2e,0x8d,0x98,0x8d,0x7f,
-  0xd0,0xac,0xf7,0x52,0xfd,0x4c,0x38,0xc4,0xaa,0xa2,0xbe,0xbd,0xcf,0x84,0xd4,0x8f,
-  0x3a,0xab,0x2d,0xc6,0xf8,0x19,0xa8,0x4b,0xf9,0xc6,0xd7,0x3f,0x5c,0x41,0xf8,0xa7,
-  0xb5,0x68,0x12,0xac,0xa4,0x8d,0xd8,0x3d,0xcc,0xe9,0x08,0x3f,0x68,0x33,0xa2,0x5f,
-  0x72,0x7d,0xef,0x3f,0x85,0x15,0x3c,0x5d,0xef,0x71,0x25,0x2f,0x8b,0x7a,0x6a,0x8a,
-  0xae,0x90,0xf6,0x72,0x11,0x11,0xfb,0xad,0x78,0xde,0xac,0xfe,0xef,0x88,0x7f,0xd8,
-  0xea,0xd4,0xd6,0xbe,0xe0,0x65,0x9e,0x50,0x53,0x3b,0x24,0x8c,0xe9,0xa8,0xc6,0x8d,
-  0xdd,0xd4,0xff,0x62,0x0e,0x33,0x95,0xd9,0x16,0x9e,0x7c,0x35,0xab,0xfe,0xf3,0x61,
-  0xb5,0x2a,0x81,0xf8,0x67,0x3a,0x1c,0x86,0x2a,0x5e,0x90,0x90,0xaf,0x40,0x84,0x8c,
-  0x66,0xe2,0x98,0x4c,0x85,0x0e,0xeb,0xa9,0x23,0x7c,0x06,0x8f,0x5d,0xa2,0xff,0xd7,
-  0x95,0xc7,0x60,0x6c,0x10,0x8f,0xb4,0x65,0x1a,0x73,0x8f,0xaf,0xff,0x5c,0x25,0xd8,
-  0x3e,0x76,0xb7,0xaf,0xa9,0x56,0x04,0x24,0x5d,0xef,0x6e,0x89,0xa8,0x6f,0xec,0x3c,
-  0xaf,0xf2,0x65,0x4a,0x5a,0xbf,0x25,0x46,0x6e,0x9f,0x36,0x83,0xba,0x7d,0x79,0xa6,
-  0x9a,0xab,0x53,0x76,0x45,0x1a,0x2e,0x52,0xe3,0x53,0xce,0x7a,0x40,0xfc,0xa3,0xef,
-  0x53,0x03,0x4d,0xaa,0xb6,0xa6,0x42,0x5f,0xad,0xa6,0xeb,0x3f,0xff,0xbc,0x10,0x61,
-  0x8f,0x48,0xdc,0x50,0x05,0x95,0x65,0x7c,0xfd,0x9f,0x04,0x39,0x79,0x70,0x1b,0xa2,
-  0xe8,0xe9,0xc4,0x28,0x84,0x3d,0xf3,0x5d,0x15,0x72,0xdc,0xf8,0xa7,0xd1,0x18,0x6d,
-  0x0d,0x97,0xf8,0x72,0x64,0xa9,0xd5,0x44,0xe1,0xc8,0x0a,0x59,0x57,0x86,0x9d,0x19,
-  0x90,0xea,0xb3,0xeb,0x3f,0xa7,0xf9,0x3f,0xe9,0x7e,0x5e,0x24,0x50,0xff,0xd3,0x73,
-  0xe9,0x88,0x98,0x8d,0xf7,0xde,0x72,0xea,0xff,0x6c,0xca,0x19,0x32,0x70,0x5a,0x5a,
-  0x7d,0x7b,0x9a,0x1f,0x84,0x83,0x46,0x55,0xab,0x7f,0x63,0x47,0x09,0xfc,0x2e,0x58,
-  0x6d,0xac,0x8b,0xc3,0x50,0xde,0xef,0x2c,0xfe,0xf3,0x01,0x97,0xff,0xe7,0xad,0xc2,
-  0xd8,0x83,0x81,0x69,0xea,0x1a,0x16,0x50,0xd6,0xf2,0x00,0xcc,0xef,0x0c,0x04,0x95,
-  0x98,0x61,0x01,0x21,0x29,0xed,0x8a,0xcf,0xaa,0xff,0x83,0x66,0xab,0xdc,0x40,0xfc,
-  0xbc,0xa7,0x74,0x85,0x68,0x73,0xef,0xa9,0x80,0x07,0x94,0x0a,0x43,0xc6,0xe7,0xf5,
-  0xed,0xa2,0xc4,0xff,0x2c,0xfc,0x33,0xb1,0x93,0x3d,0xd6,0xb2,0x8d,0x68,0xcf,0x73,
-  0xf8,0x7d,0x08,0x3b,0x3b,0xe2,0xb7,0x56,0xc0,0x6a,0xd3,0xc2,0x3f,0xe4,0xcf,0xbf,
-  0xb8,0xfe,0xf3,0x3e,0x25,0x6c,0x84,0xe2,0xc5,0x9d,0xb8,0x2d,0xea,0x8e,0x8a,0xb2,
-  0x87,0xaf,0x20,0x7e,0xf3,0x52,0x63,0x2f,0xab,0xb0,0xa1,0x94,0x6a,0xb3,0xef,0x9f,
-  0xfc,0x3f,0x04,0x8a,0x8e,0xc4,0x8b,0x05,0xed,0xf9,0x33,0x08,0x8c,0x05,0xf1,0xbb,
-  0x71,0x1d,0xf5,0x83,0x3b,0xa5,0xa6,0xeb,0x3f,0xdb,0xf3,0x6f,0xf3,0x7f,0x44,0xb5,
-  0xe7,0x01,0x14,0xf2,0x71,0xdb,0x6b,0x35,0x82,0xef,0x94,0xa3,0xea,0x58,0x4e,0x95,
-  0x94,0x8d,0x7f,0x44,0xfc,0x2b,0xc0,0x4b,0x75,0x44,0x3b,0xf7,0x13,0xbf,0x22,0x11,
-  0xb8,0x22,0xf6,0x1b,0xb6,0xd5,0xe2,0x3f,0x53,0xfe,0x97,0x3f,0xab,0xfe,0x33,0xf9,
-  0x9f,0xb9,0x9e,0x8a,0xd5,0x34,0x15,0xc0,0x1a,0x6e,0x11,0x81,0x58,0xba,0xec,0x33,
-  0xed,0x17,0x3a,0xcd,0xac,0xfa,0xcf,0x82,0xff,0x6c,0x94,0x0d,0xaa,0xdf,0x64,0x57,
-  0xa9,0x2b,0x8d,0xb2,0x61,0xcf,0x3d,0x9e,0x1a,0x54,0xe3,0x77,0xe2,0xf7,0xdb,0xf4,
-  0x3a,0x3c,0xce,0xa7,0x1c,0xc8,0xc2,0x3f,0x3b,0x54,0xfc,0x9a,0xf8,0xee,0x44,0x70,
-  0xd8,0x5b,0xcb,0xa8,0x1b,0xbb,0xff,0x74,0x07,0x7d,0xc8,0xb3,0x8e,0xf9,0x97,0x37,
-  0xbf,0xa1,0xec,0x5d,0x71,0xed,0x16,0x81,0x7f,0x9c,0xef,0xe5,0x2a,0x57,0x3d,0x2e,
-  0x6a,0xfb,0x95,0x4f,0xd6,0x8d,0x3c,0x18,0xeb,0x08,0x0f,0x7c,0x84,0xf6,0xb7,0xc0,
-  0x5d,0x4f,0xde,0xb0,0xea,0xf7,0x46,0xd1,0x5a,0x3d,0x0e,0x67,0x3b,0x1b,0x3e,0xcc,
-  0x1f,0xeb,0xa8,0x57,0xfe,0xd4,0x3e,0x3b,0xb5,0xf0,0x54,0xf3,0x79,0xed,0x0f,0x5c,
-  0x6c,0xe4,0x07,0x1d,0x3e,0xf3,0x0e,0xe2,0x1f,0x6a,0x5b,0x8c,0xae,0x56,0x56,0xb2,
-  0x78,0x0f,0x6a,0x9b,0xc8,0xb2,0xa2,0x49,0x06,0xea,0x9f,0x3e,0xaa,0xf0,0x03,0x7b,
-  0xb5,0xb2,0xbe,0x82,0x65,0xec,0x3d,0x07,0xff,0x68,0xb0,0x09,0x9e,0x54,0xa7,0x30,
-  0x6f,0x1f,0x6a,0xa7,0xc7,0xf8,0xcc,0x3e,0xd4,0x4e,0xad,0xfa,0x93,0x42,0x5f,0x89,
-  0x42,0x88,0x5b,0xb8,0xd7,0x5d,0xff,0x79,0x49,0x49,0x3f,0x24,0x8d,0x0a,0xf0,0xaa,
-  0xcc,0x10,0x44,0x44,0x04,0x12,0xcd,0xb0,0x2b,0x62,0xcd,0x67,0x94,0xf0,0xa4,0xc7,
-  0xed,0xff,0xe9,0x99,0x88,0xfb,0x7d,0xa3,0xda,0x8a,0xf7,0x3d,0x01,0x0d,0x29,0xdf,
-  0x28,0xfb,0x0a,0x9c,0x41,0xfb,0x22,0x77,0x0b,0x3e,0xf3,0x25,0xeb,0x3f,0x3f,0x41,
-  0xd6,0x7c,0x27,0x4d,0x54,0xdf,0xe4,0xa4,0x37,0x41,0x82,0x93,0x08,0x46,0xf3,0x93,
-  0xa9,0x47,0xc4,0xb5,0x31,0x38,0xae,0xce,0xa6,0xa4,0xa7,0x31,0x11,0x06,0x52,0x47,
-  0x3f,0x55,0x17,0x3c,0x6f,0xa6,0xe3,0x5f,0x2f,0x52,0xc5,0x0f,0x77,0xfd,0x67,0xae,
-  0x2c,0xc7,0x1d,0xe7,0x36,0xca,0x1f,0x1c,0x83,0x0f,0xd8,0x4c,0x33,0x36,0xca,0x02,
-  0xc6,0x13,0x65,0x95,0x78,0xd9,0xc0,0x00,0x7e,0x08,0xf5,0x51,0xc2,0x3f,0x2d,0xf6,
-  0xfb,0xe5,0x52,0x48,0xd9,0x27,0x9a,0x0c,0x16,0x6d,0xd7,0x7a,0xc8,0xdf,0x9e,0xcc,
-  0xad,0x70,0x31,0xa8,0xad,0x54,0xf1,0x61,0x67,0xfd,0x58,0xf5,0x0f,0xa3,0x56,0xb6,
-  0x05,0x55,0xfb,0xb9,0x22,0x5c,0xa4,0x40,0x37,0xf8,0x32,0xfb,0x7d,0x8a,0xb7,0x66,
-  0xf2,0xdf,0xf3,0x97,0xd0,0xfa,0x97,0x44,0xfd,0xb1,0x7d,0x78,0xff,0x95,0xcb,0x3c,
-  0xba,0x78,0x5e,0xaa,0x38,0x47,0x44,0x17,0xe2,0x87,0x9b,0x99,0xf5,0x79,0xd5,0x58,
-  0xa1,0x1d,0xef,0x83,0xf7,0x61,0x9e,0x79,0xdf,0xe8,0x84,0x51,0xe1,0xf1,0x28,0x10,
-  0x89,0x6f,0x56,0xff,0x82,0x54,0xc6,0xff,0x23,0xb9,0xfa,0x9f,0x5e,0xe0,0xd5,0x87,
-  0x7c,0xdd,0xf2,0xc7,0xea,0x11,0x7d,0x76,0x4a,0xd4,0xc7,0x1e,0xa3,0xd6,0x2d,0x47,
-  0x3f,0x97,0xc1,0x3f,0x5c,0xb5,0xeb,0x1f,0x16,0x91,0x30,0x7d,0x54,0xfd,0x57,0x14,
-  0x54,0xc4,0x3f,0xea,0x0e,0x56,0x69,0xf4,0x28,0x01,0xf0,0x6c,0x42,0x7c,0xe2,0xe6,
-  0xff,0xb8,0xf2,0x71,0x74,0x32,0xf4,0xb8,0xd1,0x30,0x74,0x03,0x11,0xa0,0x4f,0x74,
-  0x30,0x54,0xb5,0xa6,0x13,0x19,0xfe,0x73,0xba,0xfe,0x8f,0x37,0xd9,0x24,0xea,0xff,
-  0x98,0x6a,0xb2,0xe9,0x03,0x86,0x1b,0x3d,0x33,0x98,0xf0,0x84,0xa0,0x87,0x07,0xf4,
-  0x2b,0xe2,0xae,0xfa,0x87,0x90,0xc9,0xff,0x5a,0x4a,0x85,0x8e,0x17,0x2b,0x49,0xf9,
-  0x39,0x78,0x21,0x1e,0x4e,0xf9,0x2e,0x97,0xaf,0x31,0x3e,0x84,0xaa,0x46,0x5f,0xb2,
-  0xd8,0x1c,0xcf,0x7f,0xb6,0xd9,0x3e,0x73,0x0d,0x7f,0xa2,0x79,0x0c,0x4e,0x49,0x0d,
-  0xc3,0x94,0x81,0x62,0x53,0x7f,0xc7,0xf1,0x9f,0x5d,0xf1,0xe8,0xa8,0x2f,0x3e,0x61,
-  0x06,0x02,0x75,0x5c,0x96,0x71,0xef,0x14,0xe3,0x20,0xaf,0xa2,0x44,0xe6,0x97,0xc7,
-  0xd5,0xff,0xb1,0xcb,0x1e,0x42,0x6d,0xa3,0x9a,0x2c,0x22,0x44,0x14,0x38,0x88,0x6a,
-  0x73,0x2a,0x8e,0xaf,0x6e,0xc5,0x27,0xca,0xe0,0x1f,0x53,0x59,0xa0,0xba,0xf3,0x95,
-  0xe8,0xeb,0x10,0xdb,0xae,0x14,0xe2,0xc3,0x3c,0xd8,0x10,0x0d,0xc4,0xf3,0x00,0xf1,
-  0x92,0xed,0xff,0x89,0x1a,0x77,0x64,0xd5,0x3f,0x1c,0xf6,0x2c,0xf1,0x4c,0x46,0xb5,
-  0x73,0x67,0x0a,0xf7,0x4b,0x57,0xc0,0xca,0xc4,0x35,0x89,0xbc,0x9b,0xd8,0x59,0x6e,
-  0xa4,0xc7,0x47,0xc0,0xaa,0xff,0x73,0x35,0x95,0x3d,0x44,0x61,0xc4,0x53,0xca,0x28,
-  0x23,0x2c,0x6c,0x2e,0xac,0x2d,0x56,0xd9,0xab,0x89,0x30,0xff,0x89,0xc7,0x8d,0x7f,
-  0xd2,0xf9,0xef,0xa2,0x2c,0xc0,0x19,0xb8,0xae,0x37,0x5f,0xd4,0x07,0xd0,0x1a,0xcc,
-  0x75,0x88,0x07,0x1a,0xcf,0x6b,0xf5,0xbc,0xe0,0xa0,0xab,0xff,0x97,0x9a,0xe9,0x3f,
-  0xeb,0x08,0x05,0xb4,0xa3,0x49,0xf9,0xc2,0x72,0xa5,0x70,0x04,0xf9,0x12,0xf8,0xfd,
-  0x3a,0xfc,0x87,0xcb,0xc7,0xe5,0x7f,0x79,0x29,0x10,0xd6,0x21,0x09,0x8f,0x90,0x4f,
-  0x6c,0x24,0x3d,0x51,0x76,0xc2,0x79,0xbf,0x99,0xfa,0x3f,0xd6,0xf3,0x8e,0x7a,0x4b,
-  0xd9,0x64,0x6d,0x02,0x22,0xa2,0x3c,0x42,0x44,0xeb,0xf8,0x96,0x94,0xba,0xc4,0x55,
-  0x7f,0x4c,0xf0,0x7f,0xa4,0xcc,0x7c,0xa6,0xbc,0x61,0x4f,0x3e,0xef,0x88,0xea,0x43,
-  0x79,0xd5,0x2c,0x9f,0x0b,0xfc,0x1c,0x44,0xfc,0x93,0xe1,0x3f,0x67,0xd5,0xff,0xc1,
-  0x8d,0x67,0x4a,0xbe,0x0e,0x0e,0x1b,0xdd,0x3c,0xff,0x1d,0xf9,0x7a,0x76,0x88,0xf8,
-  0x3f,0x8f,0xca,0xa7,0x9d,0x7a,0xc5,0xd9,0xf5,0x7f,0xe0,0x5e,0xc9,0x0f,0x32,0xa9,
-  0x8a,0x7a,0xb1,0xd5,0x36,0xc6,0xda,0xea,0xf5,0x19,0xe6,0xc5,0xf5,0x7f,0x32,0xf9,
-  0x3e,0x0b,0xe3,0x13,0xd2,0x89,0xf0,0xa2,0x11,0x2a,0xdc,0xf3,0x97,0xea,0x1f,0xa6,
-  0xd9,0x3b,0xf3,0x37,0xe6,0x3a,0x1e,0x1e,0x6a,0xf5,0x55,0x6d,0xa8,0x71,0x70,0xf1,
-  0x7f,0x2e,0xae,0x7f,0x98,0x49,0x84,0xc7,0x85,0x67,0x96,0x1b,0xc1,0x51,0x17,0xfe,
-  0xc9,0xae,0xff,0x03,0xa1,0x25,0x02,0xff,0xec,0x4a,0x90,0x47,0xc8,0xa3,0xf0,0xc7,
-  0x94,0x29,0xc4,0xf0,0x74,0xe1,0x1f,0x9f,0x9e,0x8d,0xf7,0xfc,0xbc,0xc8,0x39,0x42,
-  0x8d,0x50,0xf5,0x12,0x9f,0x29,0x1f,0xcf,0xe0,0x9f,0x9c,0xac,0xb4,0x26,0x8a,0x7f,
-  0x79,0x09,0xff,0x34,0x50,0x86,0xfb,0x49,0x23,0x7d,0xea,0x1d,0x37,0xfe,0xb1,0xcb,
-  0x1e,0x8a,0x7f,0x18,0x29,0xa0,0x7a,0xc8,0x1f,0x52,0x23,0xd4,0x0d,0x72,0x05,0x7f,
-  0x51,0x9b,0xd7,0xe2,0xd3,0x70,0x6b,0xec,0xe0,0x9f,0xd2,0xac,0xfa,0x87,0x95,0x5a,
-  0x64,0x05,0x09,0x86,0x68,0x84,0x3a,0x0b,0x62,0x50,0xa9,0xaa,0x9c,0xb9,0xf2,0xdf,
-  0x9d,0xfa,0x3f,0xa2,0x1f,0xe5,0x8c,0x96,0xd8,0xa2,0x22,0x0a,0x5b,0x94,0x19,0xde,
-  0xdb,0xd8,0x55,0x08,0xfc,0x04,0x63,0x2a,0x93,0xff,0x5e,0xaa,0xd8,0xf9,0xef,0xa2,
-  0xfe,0xe4,0x4c,0x43,0x7d,0x09,0xf7,0x93,0xbf,0x84,0x72,0xc3,0x8b,0x88,0xc8,0x66,
-  0x58,0xb9,0xf2,0xdf,0x27,0x2e,0x2e,0x75,0xdf,0xbf,0x51,0xb9,0x59,0x08,0x1b,0x5a,
-  0x50,0x3f,0x54,0x30,0x11,0x11,0xd3,0xbc,0x99,0xfc,0xf7,0x88,0xd5,0xff,0xcb,0x1e,
-  0x5f,0x27,0x88,0x40,0x06,0x45,0xc4,0x70,0x3d,0xf4,0x09,0xfc,0x33,0xd3,0x9d,0xff,
-  0xae,0x6a,0x89,0xf1,0x78,0x7b,0x02,0x4e,0xbb,0xe8,0xff,0x55,0x1c,0x66,0xfd,0x5a,
-  0x15,0x31,0xb2,0x3c,0x59,0xf1,0x2f,0x8b,0xe4,0x93,0x6b,0xd5,0x3f,0x8c,0x24,0x58,
-  0x90,0x3f,0x81,0x78,0xbe,0x6b,0x2b,0x21,0x22,0xe3,0x5a,0xae,0xa6,0x98,0xc7,0x1e,
-  0xee,0xca,0xff,0x6a,0x4a,0x17,0x6a,0xab,0xa1,0xb0,0x17,0x0c,0x9b,0x57,0xd6,0x30,
-  0x15,0xe2,0xa6,0xde,0xa2,0xea,0xb9,0x1e,0x47,0xff,0xd8,0xf5,0x7f,0xd2,0xdf,0x6f,
-  0xc8,0x88,0x7d,0x97,0x51,0x46,0x83,0x48,0x0c,0x2f,0x45,0x60,0x73,0x8d,0x81,0xd7,
-  0x57,0x1d,0xfe,0xb3,0x5d,0xff,0xc7,0x4f,0xdf,0x2f,0x0a,0x89,0xfc,0xa0,0xe7,0xa7,
-  0xf0,0x31,0xd5,0xff,0xa9,0xf1,0x7a,0xe0,0x08,0xdf,0x15,0x5d,0xb0,0xc4,0xeb,0xc9,
-  0xf0,0x9f,0xc7,0xf1,0x7f,0xa4,0x9f,0x25,0x64,0x51,0x01,0xd8,0xb0,0x02,0x61,0x84,
-  0x9f,0x13,0x2e,0xfe,0xb3,0x55,0xff,0xc7,0xca,0xf6,0x82,0x0b,0x71,0x14,0x36,0x95,
-  0x7f,0x0c,0xcf,0x23,0xec,0xc9,0x3f,0x8a,0xb0,0xf0,0x75,0x7e,0xed,0x90,0x6f,0x18,
-  0xf7,0xa7,0x0e,0xff,0x39,0x5d,0xff,0x47,0x78,0x7b,0x50,0x9f,0xb4,0x78,0xbf,0x28,
-  0x6f,0x8c,0xae,0xa0,0xf5,0xd0,0xca,0x5e,0xe2,0x9d,0x30,0x63,0x40,0xd5,0x5d,0xfd,
-  0xbf,0xdc,0xf5,0x7f,0x60,0xaf,0x3e,0x83,0x7b,0x9b,0x9a,0x4e,0xc2,0x4a,0x63,0x8b,
-  0x99,0x87,0xe3,0x8d,0x4e,0xb8,0x86,0xf2,0xdf,0x87,0x5c,0xfe,0x9f,0xec,0xfa,0x3f,
-  0xe0,0x85,0xf6,0x67,0x19,0x27,0x9a,0x7d,0x09,0x6e,0xd3,0x62,0xc4,0xff,0x0c,0x05,
-  0x32,0xfc,0xe7,0x1e,0xf7,0xf3,0x9e,0xa6,0x7c,0xf3,0x27,0xcb,0xff,0x48,0x1e,0xfb,
-  0x47,0xf2,0xb7,0x17,0x8f,0xc0,0x21,0xa9,0x9a,0x8f,0x3c,0x5c,0x7e,0xdc,0x89,0xf7,
-  0x65,0xfa,0x5f,0x88,0xf1,0x38,0x1b,0x3d,0xf2,0x0e,0x38,0xc5,0xeb,0x61,0x42,0x42,
-  0x1e,0xf1,0xbd,0xd7,0x38,0xd9,0x5c,0x48,0x85,0x29,0xec,0xeb,0x27,0x32,0xf9,0x5f,
-  0xa2,0xcc,0x8b,0x00,0x42,0xfa,0x79,0xb8,0x9e,0xfb,0x52,0x1d,0x67,0xe1,0xb8,0x54,
-  0xde,0xe9,0x4b,0xc9,0x15,0x0e,0xff,0x79,0x4b,0xa6,0xff,0x29,0xe2,0xb1,0xa8,0xe0,
-  0xf3,0xbc,0xcb,0x11,0xd8,0x94,0x46,0xa8,0xff,0xe9,0x13,0xa9,0xc0,0x51,0x9c,0x9f,
-  0xb0,0x13,0xaf,0xcc,0xea,0x7f,0xf1,0x04,0x09,0xb4,0x3b,0xa3,0x8e,0xf0,0xf8,0x19,
-  0x0e,0x69,0x3d,0x7c,0x3a,0xb9,0x6a,0x9d,0xe5,0x96,0xe1,0xff,0x54,0x89,0x6a,0x48,
-  0xa1,0xd6,0xf9,0x5a,0xbb,0x89,0x5f,0x68,0x25,0x4e,0x0d,0x7b,0xae,0x2c,0xa9,0x05,
-  0xcd,0x60,0x59,0x53,0x26,0x3e,0xcb,0xd3,0xfd,0x2f,0xec,0xe7,0x8d,0xfb,0x57,0xe1,
-  0x87,0x70,0x5a,0xaa,0xe5,0xa1,0x15,0xf2,0x10,0xa7,0x1e,0xbf,0xbe,0x84,0x57,0xcf,
-  0xf4,0xbf,0x98,0x68,0xd7,0x3f,0xc4,0xe7,0x3d,0xad,0x7d,0x8f,0x80,0xd0,0xa0,0xc5,
-  0x80,0x3a,0x80,0x1b,0xb1,0xb3,0xfa,0x5c,0xd3,0xff,0x16,0x1b,0xce,0xc4,0xb3,0xa4,
-  0xb1,0x8a,0xb3,0x65,0xb3,0xc1,0x1c,0xfc,0x9b,0x5a,0xf5,0x79,0xfe,0x3d,0xdd,0xbf,
-  0xac,0xbc,0x5e,0x3b,0x6f,0xc5,0xbf,0xc8,0x35,0x64,0xf5,0x7f,0x77,0xf9,0x7f,0xde,
-  0x83,0x1e,0x33,0xa0,0xa9,0x97,0xe1,0xd7,0xd1,0xd5,0x36,0x75,0xcb,0xfc,0x31,0x56,
-  0x4f,0xb4,0x1c,0x1b,0x11,0x09,0x22,0xb4,0xab,0xfe,0x73,0x0e,0xe2,0x61,0x2d,0x7a,
-  0x85,0xaa,0xb4,0x07,0x4b,0x3a,0x60,0xa9,0xee,0x25,0xd8,0xd3,0x1d,0x24,0x3c,0x5c,
-  0x34,0x60,0x9b,0x7e,0x77,0xfd,0xe7,0x1d,0x7a,0x8f,0x4a,0x41,0xfc,0x40,0x90,0xf2,
-  0xc7,0xcb,0x28,0xb1,0x4e,0xdb,0x4f,0xfe,0x1f,0x0b,0x11,0x89,0xa9,0xce,0xe0,0x1f,
-  0xb3,0x64,0x9f,0x76,0xd2,0x98,0xdd,0x12,0x1a,0x95,0x83,0xec,0x05,0xa8,0xd4,0xfd,
-  0xa3,0x4d,0x75,0x70,0xd6,0xe8,0xb6,0x66,0x6c,0xbf,0x55,0xc1,0x20,0xe3,0x1f,0x38,
-  0x06,0x3d,0xea,0xd9,0xc0,0x53,0x51,0x41,0x72,0x46,0xfc,0xd3,0xe6,0x1f,0xfd,0x9b,
-  0xef,0xc2,0x9f,0xe1,0x69,0xf3,0xef,0x33,0xfc,0x67,0x39,0x53,0xff,0xb9,0x55,0x7b,
-  0x04,0xfa,0x8d,0xb0,0xe1,0x4b,0x34,0x07,0x95,0xd7,0xa4,0x6a,0xd5,0x1f,0x6e,0x0e,
-  0xe1,0x8b,0xa8,0x72,0xf2,0x13,0xcd,0xec,0xfa,0x87,0x4a,0x10,0x62,0x26,0x1a,0xa9,
-  0x87,0x68,0x7e,0xa0,0x4a,0xf6,0x8e,0xae,0x09,0x99,0xfb,0xad,0xb6,0x29,0x54,0xda,
-  0x28,0x80,0x40,0xda,0xe5,0xff,0x19,0x96,0x16,0xb0,0x8e,0xfe,0x0a,0xbe,0x64,0xf3,
-  0x1a,0x95,0x3d,0xc0,0xf4,0x84,0xb7,0x06,0xe7,0x67,0x17,0xe8,0xa2,0x1e,0x14,0xec,
-  0x5e,0x56,0x91,0xed,0xff,0x39,0xd1,0x46,0xd1,0x9f,0x07,0x13,0xea,0xdf,0x21,0xda,
-  0xf9,0x21,0x2f,0xdb,0xee,0xfd,0x16,0xc2,0x80,0x5f,0xf2,0x29,0x6f,0xa7,0x11,0x42,
-  0x19,0x55,0x48,0xce,0xae,0xff,0xfc,0x4c,0x70,0x4e,0xcc,0x27,0x35,0xa9,0xca,0xaf,
-  0xb5,0x24,0xb5,0x89,0xc1,0xeb,0x47,0xc3,0xa6,0x7f,0x96,0x3c,0x60,0x7e,0x04,0x56,
-  0xff,0x77,0x17,0xff,0x67,0xa7,0xf1,0x11,0xf5,0xc3,0x5a,0x8d,0xda,0xe6,0xe7,0x4a,
-  0xbd,0x44,0x61,0x2c,0xd2,0xcf,0xc2,0x1f,0xdb,0x7a,0x46,0xb3,0xfa,0xdd,0x3b,0xfc,
-  0x9c,0x1d,0x39,0x23,0xda,0x0b,0xb0,0x81,0x9c,0x6c,0x41,0x41,0xd4,0xf7,0x25,0xdb,
-  0x42,0x04,0x3b,0x11,0x3f,0x97,0x3b,0x9f,0xaa,0xab,0xfe,0xf3,0x7a,0x62,0x77,0x97,
-  0x23,0xda,0xf1,0x94,0xaa,0x73,0xc9,0xdb,0x33,0x47,0xbe,0x5d,0xd9,0x0b,0xd3,0x4c,
-  0xcf,0x32,0xe6,0x94,0x16,0xc9,0xd4,0x7f,0x26,0xff,0x0f,0x45,0xbb,0xa6,0x2d,0xc5,
-  0xe7,0xdd,0xcb,0x67,0xea,0xea,0xf2,0xdc,0xc9,0xfc,0x69,0xcb,0x23,0xf4,0x17,0xf2,
-  0xdf,0x69,0xf7,0x7a,0xb9,0xee,0x09,0xd2,0x87,0xa6,0xa9,0xd4,0xff,0x62,0x7f,0x49,
-  0x50,0x54,0xdc,0xd2,0xd2,0xeb,0x2d,0xab,0xfe,0x33,0x82,0x9c,0xee,0x78,0xde,0xb0,
-  0x5c,0x83,0xaf,0x75,0x1e,0x5f,0x9b,0x28,0x0e,0xe2,0x8e,0x75,0xab,0xe8,0xff,0x2e,
-  0x2a,0x42,0xaf,0x4b,0xb0,0xd3,0x0e,0xdf,0x23,0x02,0x22,0xec,0xc5,0x0a,0x4c,0xcb,
-  0x1e,0x69,0x33,0xd3,0xfc,0x1f,0x2d,0xd3,0xa1,0x9b,0xf2,0xdf,0x33,0xf8,0x67,0x08,
-  0x7a,0x13,0xdd,0xc6,0x52,0x6d,0xbe,0xb0,0x86,0x4d,0x68,0xcd,0xaf,0x51,0x4e,0x41,
-  0x55,0x34,0x5f,0x10,0x3f,0xe0,0x5e,0x63,0x7c,0xff,0x2f,0x6d,0x35,0x91,0x4c,0x36,
-  0x06,0x88,0x76,0x5b,0xdf,0x8a,0xd6,0xb6,0x5a,0xd9,0x07,0x77,0xdd,0xf8,0x17,0xf2,
-  0xdf,0x95,0x0a,0x76,0x9f,0x51,0x66,0xa8,0x83,0xed,0x16,0x4d,0x37,0xb8,0xfe,0x2d,
-  0xc2,0x3f,0x53,0xb3,0xf8,0xd2,0x59,0xfd,0xbf,0xf8,0x0a,0xbd,0x2c,0x52,0x7a,0x2b,
-  0xb9,0x7d,0x94,0x90,0x69,0x35,0xc2,0xd0,0xf5,0x34,0x22,0x62,0x69,0xff,0x8f,0x7d,
-  0x3f,0x3d,0x2a,0x55,0xdb,0xeb,0x2e,0xf1,0xdd,0x40,0x6d,0xbf,0x44,0xfe,0x3b,0xa5,
-  0x7d,0xb5,0x3e,0x0e,0xe9,0x8a,0x7c,0x44,0x4d,0xbc,0x26,0x53,0xff,0xb9,0xff,0x72,
-  0xd1,0xe4,0xab,0xc5,0xbf,0xbe,0x99,0xd2,0xd8,0xaf,0x33,0xbc,0xeb,0xaf,0x1c,0x32,
-  0xfe,0x99,0x22,0x62,0xf1,0xf2,0x74,0x28,0x30,0x8e,0x78,0x29,0xc3,0xff,0x79,0x87,
-  0x9f,0x4b,0x14,0xdd,0x15,0xda,0xfc,0xcc,0xb3,0xb4,0x1b,0x35,0x0a,0x06,0x3b,0x3e,
-  0x86,0x83,0xc1,0x06,0xea,0x9f,0x4e,0xf1,0x20,0x91,0x0f,0x7e,0xc8,0x55,0xff,0xe7,
-  0x58,0x0b,0x6e,0x9a,0x6a,0xd5,0x01,0x51,0xed,0xb0,0x56,0x52,0x3b,0x8b,0x50,0x40,
-  0x45,0x6d,0xf0,0x80,0x93,0x08,0x3f,0xae,0xfe,0x33,0xcd,0x0f,0xa5,0xbd,0x53,0xd9,
-  0x0d,0x8f,0x56,0x44,0xb4,0x67,0xd1,0x31,0xc4,0xf1,0x77,0xb9,0xea,0x1f,0x8a,0xfc,
-  0x77,0xdc,0xa6,0x0d,0xb6,0x13,0xdb,0x79,0xba,0x11,0x8b,0x07,0x50,0x28,0x21,0xfe,
-  0x15,0x1b,0x92,0xec,0xf9,0x1c,0x57,0xff,0xb9,0xdb,0x10,0x69,0xef,0xab,0x09,0xbf,
-  0xc5,0x8b,0x29,0xec,0x35,0x49,0x1c,0x51,0xec,0xfc,0x77,0x6e,0xcf,0xff,0x57,0xa5,
-  0xed,0x0a,0x35,0xf9,0xfa,0x37,0x8b,0xed,0x5c,0xdb,0x42,0x40,0x28,0x70,0xaa,0x3d,
-  0x8d,0x88,0xce,0x58,0xe3,0x5f,0xcd,0xe4,0x73,0x09,0xfc,0x73,0x2f,0x2c,0xe8,0x93,
-  0x89,0x6d,0x45,0xd5,0xc5,0x3b,0x52,0x5a,0xbf,0x15,0xf6,0xc2,0x15,0xa8,0x8b,0xf5,
-  0x96,0x9d,0xff,0x45,0xdd,0xeb,0xd4,0x94,0xf0,0xff,0xcc,0x58,0x15,0x1b,0x42,0x45,
-  0xf7,0x2a,0x94,0x0b,0xff,0x8f,0x96,0xae,0x70,0xd5,0xee,0xac,0x07,0xca,0xff,0xda,
-  0x35,0x1a,0x32,0x77,0xe8,0xb8,0xbb,0x6c,0xc7,0xfd,0x42,0x5e,0x09,0x7b,0x91,0xea,
-  0x1f,0xb6,0xa4,0x3b,0x82,0x8d,0xab,0xff,0x2c,0xfa,0x5f,0xd0,0x67,0xbb,0x24,0x50,
-  0x67,0xac,0x84,0x99,0xa6,0xda,0xda,0xbe,0x11,0xd6,0x25,0xfe,0x11,0x44,0xfe,0xfb,
-  0x1e,0x43,0x7c,0xbf,0xb1,0x16,0xc3,0xbe,0x7e,0x6c,0xb2,0xf2,0xa7,0xce,0x99,0xf8,
-  0x89,0xc8,0x93,0xdb,0x9f,0xe3,0xf3,0x8e,0xe5,0x2f,0x62,0x87,0xe1,0x87,0xa9,0x69,
-  0xba,0x53,0x11,0x7a,0xe1,0xf2,0xf2,0x4c,0x3e,0x9a,0x7a,0xf9,0x4e,0x78,0x97,0x09,
-  0x12,0xef,0x07,0xea,0x69,0xdc,0xb8,0x1d,0x89,0x97,0x8f,0xb0,0x8f,0x00,0xd7,0x1b,
-  0xe9,0x93,0x31,0x23,0xed,0xff,0xb1,0xbf,0x47,0x63,0xe2,0x79,0x43,0x90,0x7c,0x86,
-  0xa1,0xa1,0x75,0x65,0x7c,0xdb,0x90,0xff,0x15,0xf9,0x0a,0xe3,0x79,0x3e,0x97,0xea,
-  0x1f,0x9e,0x6f,0x3d,0x6f,0x0a,0xfb,0x95,0xa9,0xff,0xfc,0xa8,0xb4,0xd9,0x78,0x4c,
-  0x99,0x31,0x10,0xbc,0x8b,0x3d,0x79,0x20,0x17,0xca,0x0e,0x7b,0x6f,0x09,0x94,0x98,
-  0xab,0x60,0xd7,0xc6,0x02,0x44,0x74,0xc6,0xe3,0x70,0x1d,0xf1,0x0f,0xdf,0x73,0xde,
-  0x6f,0x1c,0x36,0x6b,0x8f,0x69,0x33,0xcc,0x48,0x4d,0xee,0x1d,0xe4,0xaf,0xe6,0x5d,
-  0x06,0x2b,0x2d,0x5a,0x87,0xf3,0x40,0x08,0x30,0xf2,0xb8,0xa5,0xaf,0x52,0x2e,0xfc,
-  0x23,0xf2,0x4f,0x7b,0xd5,0x9e,0xa6,0xb5,0x38,0x9f,0x89,0x94,0x17,0x6e,0xf2,0x41,
-  0x87,0x52,0x01,0x14,0x61,0x54,0xba,0x41,0x28,0xa2,0x8c,0xbd,0xe8,0xc1,0xfd,0xe3,
-  0x87,0xc4,0x6f,0x59,0x23,0xd7,0x01,0xee,0xb6,0x86,0xfc,0x1a,0x0b,0xa9,0x47,0x8e,
-  0x86,0x21,0xbd,0x83,0xb6,0xfa,0xbf,0x3b,0xfc,0x3d,0x0e,0x3b,0x09,0x66,0xa3,0xb6,
-  0xf1,0x8e,0x28,0x88,0x07,0x06,0x17,0xc6,0x71,0x19,0x9c,0x61,0xb5,0xb0,0x4e,0xcc,
-  0x8f,0xe5,0x1f,0xcb,0xd4,0x7f,0x5e,0xcf,0xc9,0xe9,0xb1,0xab,0xd0,0xf7,0xab,0x8e,
-  0x3a,0x9c,0xf8,0x06,0xe2,0x9b,0x55,0xa3,0xbd,0x9b,0x0d,0x9b,0xd1,0xde,0x29,0x17,
-  0x12,0xc2,0xde,0x65,0xea,0x3f,0x9b,0x2d,0x4b,0xe1,0x09,0xb3,0x5c,0x53,0x07,0x71,
-  0xf7,0xb4,0x06,0x2a,0xdf,0xf2,0xae,0x47,0xf4,0xf2,0x34,0x04,0xc2,0xa2,0x22,0xf1,
-  0x70,0x3a,0xfe,0x95,0xcd,0xff,0x31,0x19,0x88,0x32,0xc8,0x6b,0x88,0x0f,0x13,0x67,
-  0xd3,0x38,0x9a,0x39,0x25,0x96,0x2c,0x1a,0x51,0x7a,0x58,0x65,0x76,0xff,0x2f,0xc2,
-  0x3f,0xbb,0x88,0xef,0x0a,0x1e,0x8a,0xef,0x50,0x35,0x80,0xe9,0x40,0xb4,0x04,0x31,
-  0x3f,0x6a,0xc2,0xe2,0xc3,0x64,0xf6,0x5f,0xfc,0x2a,0xe2,0xff,0x84,0x61,0x41,0xbc,
-  0xb8,0x4e,0x94,0x9d,0xc1,0xaf,0x5b,0x57,0xce,0x40,0x37,0xa8,0xa2,0x43,0x9c,0x35,
-  0x3f,0x66,0x16,0xfe,0xf9,0x25,0xa3,0xfe,0x17,0xe5,0x02,0xef,0x19,0x7e,0xf3,0xd3,
-  0xa3,0xda,0x85,0x1c,0x3c,0x42,0xf5,0x6d,0x46,0x2c,0xff,0xcf,0xc5,0xf5,0x9f,0x05,
-  0xda,0x39,0xc3,0x1b,0x46,0xfd,0x63,0xe5,0xe7,0x15,0x01,0xa4,0x05,0x7f,0x9e,0xcf,
-  0x3e,0x76,0xb5,0x1b,0xff,0x50,0xfe,0x17,0x15,0xf9,0xf1,0xf6,0x94,0xff,0x02,0x61,
-  0x49,0x65,0x6f,0x17,0xf5,0xbf,0xd8,0xaf,0xa7,0x1b,0x61,0x10,0x71,0x8e,0xf0,0xcf,
-  0x78,0xff,0x4f,0x6f,0x57,0x1a,0x0f,0xf7,0x53,0xa1,0x63,0x65,0x77,0x85,0x85,0x90,
-  0x7d,0xbb,0x95,0x44,0xaf,0x27,0x1b,0xff,0x38,0xfe,0x9f,0x9d,0x6e,0x47,0x8a,0x25,
-  0xe4,0xed,0xb6,0x3a,0xc2,0x8f,0x66,0xfb,0x7f,0x72,0x2c,0x7c,0xa8,0x64,0x36,0x0e,
-  0xdc,0x16,0x44,0xfe,0x17,0xe2,0x13,0x77,0xfe,0x17,0x81,0x1c,0x6f,0x1a,0xed,0xf4,
-  0x52,0x61,0x4c,0x7a,0xde,0xb4,0x47,0x48,0xb1,0xf0,0xcf,0xa5,0xea,0xff,0x5c,0xec,
-  0xe8,0x58,0x0a,0x67,0xca,0x28,0x50,0xdb,0x3c,0xbe,0xfe,0x73,0xe6,0xb6,0x53,0x96,
-  0xa0,0xd8,0x15,0x1d,0x1b,0x11,0x28,0x92,0xff,0xc7,0x5e,0xcf,0x17,0xf5,0xbf,0xe8,
-  0x0a,0x83,0xed,0x31,0x2b,0x5a,0x80,0xcb,0x54,0x4f,0xe1,0xa9,0xb1,0x4c,0xfd,0xb1,
-  0xac,0xfe,0x17,0x89,0xec,0x46,0x18,0x93,0x0d,0xc2,0x3f,0x57,0x12,0x1e,0xb0,0xaf,
-  0x6f,0xf5,0xff,0xaa,0xeb,0xb3,0xda,0x7e,0xf1,0xba,0xe7,0x44,0xda,0x97,0xa8,0x08,
-  0x54,0x25,0xdf,0x8c,0x50,0x27,0x79,0x80,0xf0,0xcf,0xc5,0xf5,0x0f,0xd3,0xf3,0xd3,
-  0x67,0x09,0x1a,0x1e,0x59,0x46,0xdf,0x0b,0xa4,0xf1,0x8f,0x3d,0x3f,0x3b,0xc6,0xfb,
-  0x7f,0xec,0x42,0xdc,0x94,0x11,0x56,0xc0,0x44,0xc6,0x9c,0xbb,0x7e,0x85,0xd5,0xff,
-  0x7d,0x86,0x95,0xed,0x45,0x42,0x97,0x68,0xa4,0x28,0x95,0x51,0xff,0xa0,0xcd,0x16,
-  0x91,0x80,0xe2,0x5f,0xf6,0xf5,0xcd,0x71,0xfe,0x9f,0x94,0x03,0xf3,0x44,0x46,0xd8,
-  0xaa,0xce,0x69,0x24,0x8c,0x66,0xd7,0xff,0x51,0x9c,0xea,0xd9,0x53,0xad,0x89,0xdd,
-  0x6f,0x39,0xf6,0xd7,0xda,0xfd,0x1c,0xff,0x62,0xff,0x0b,0x4a,0xfb,0x22,0x21,0x21,
-  0x68,0x3f,0x41,0x38,0xc4,0x6a,0x45,0xff,0x8b,0x4b,0xd4,0x3f,0x4c,0xf7,0x83,0x98,
-  0x90,0x71,0x8c,0x38,0x42,0xf1,0xf8,0xfc,0x77,0x7b,0xbf,0x2f,0xd5,0x37,0xfa,0x5c,
-  0x65,0x81,0x51,0xd0,0xd2,0xfd,0x4f,0x9d,0xfc,0xd3,0xf1,0xfe,0x9f,0xa0,0x10,0xb4,
-  0x80,0x7d,0x24,0x10,0xcd,0xca,0xff,0xba,0xa8,0xff,0x45,0xcc,0x29,0x53,0xb3,0x09,
-  0x85,0x59,0xca,0xd6,0x88,0xc0,0x3f,0xf6,0x7a,0xc8,0xee,0x7f,0x81,0x13,0x15,0xb1,
-  0x60,0x40,0xd0,0xf6,0x08,0x09,0x20,0x94,0xa9,0xbf,0x9a,0x95,0xff,0x45,0xf9,0xfe,
-  0x3e,0xd1,0x88,0xb3,0x35,0xdd,0xf8,0x75,0x59,0x6b,0x55,0x09,0x0a,0xc7,0x33,0xf9,
-  0x5f,0xe9,0xfa,0x3f,0xf3,0x5d,0xd6,0x9f,0xdc,0xaa,0x14,0xcf,0x12,0x0f,0x4e,0x1d,
-  0x3f,0x59,0xc6,0xff,0x53,0x9a,0xe5,0x2f,0x92,0x1a,0x5a,0xd7,0x8a,0xf1,0x46,0x95,
-  0x15,0x41,0x7b,0xd1,0x98,0xdd,0xea,0x1f,0xd7,0xff,0x5d,0x80,0x9c,0x82,0xb4,0xff,
-  0x87,0xbc,0x3d,0x29,0xb5,0x47,0x4f,0x13,0x81,0xb8,0x1e,0xa0,0xd4,0xf8,0xec,0xfe,
-  0xef,0x6e,0x7f,0x97,0x39,0x4c,0xc2,0xbe,0x34,0xf1,0x09,0x11,0x51,0xc2,0x7a,0x5e,
-  0x57,0xfe,0xbb,0x98,0x46,0x8f,0x53,0x7f,0xdb,0xea,0x7f,0x2a,0x3c,0xfc,0xc4,0x17,
-  0x4a,0xf7,0x93,0xb5,0xd7,0x83,0x93,0xff,0x65,0xfb,0x7f,0xc4,0xfb,0xfd,0x10,0xba,
-  0xed,0xfc,0xaf,0x2a,0xab,0xfe,0x8f,0x7d,0xfd,0xa0,0xab,0xfe,0x8f,0x96,0xf5,0x0f,
-  0x6d,0x41,0xe4,0xbf,0x8f,0xeb,0xff,0x95,0xb5,0xba,0x1a,0x33,0xeb,0x4d,0x1b,0xe3,
-  0x02,0x08,0xb9,0xfa,0xc5,0x2b,0x59,0xfd,0x2f,0x66,0xa6,0xc3,0x5e,0xa9,0xca,0x36,
-  0x14,0x8e,0xc2,0x53,0x14,0xda,0x18,0xdf,0xff,0xeb,0x12,0xfd,0x2f,0xfa,0x45,0x59,
-  0xa4,0x7e,0xdc,0x2f,0xe8,0x83,0xde,0x30,0x64,0xfa,0xbf,0xeb,0x52,0x96,0xff,0x47,
-  0xb4,0xfd,0x4a,0x3b,0x72,0x5b,0xf1,0xfa,0xe9,0x40,0xf6,0x70,0xe6,0xfa,0x8e,0xff,
-  0x27,0xd3,0xff,0xc2,0x11,0x5e,0x25,0xea,0x05,0x55,0x44,0x7c,0xef,0xe2,0xfa,0x87,
-  0x97,0xd2,0xb7,0xc3,0x69,0xa1,0xdc,0x55,0xff,0x70,0x62,0x56,0xfc,0xa2,0x7e,0xb1,
-  0xaf,0xa7,0xfc,0x5e,0x38,0xc7,0xaf,0x4f,0xf9,0x37,0xc9,0xa7,0xd9,0xa1,0x38,0xf1,
-  0x37,0x26,0x98,0x19,0xff,0x8f,0xed,0x7f,0x0e,0x5b,0xb7,0x3d,0xa4,0xd6,0xe2,0xb6,
-  0xeb,0x31,0x03,0xf5,0xcf,0x17,0x03,0xfd,0xb0,0x2a,0x51,0xd6,0xab,0x7e,0xdb,0xe5,
-  0xff,0x01,0xc8,0xf6,0x57,0x47,0x3c,0xf7,0x88,0x6d,0x9a,0x68,0x84,0x7a,0x14,0x56,
-  0xea,0x22,0x82,0xef,0xaa,0xff,0x93,0x5d,0x7f,0xbe,0xd2,0xb4,0xf6,0x5f,0x56,0xc7,
-  0x87,0x7e,0x8b,0x21,0x8c,0x82,0xab,0xfe,0xa1,0xf3,0xbc,0x4b,0x4b,0x68,0xff,0xb8,
-  0x80,0xcc,0x8a,0x15,0xcf,0x6a,0x1e,0xa6,0xf5,0xc3,0xa9,0xff,0x45,0xa6,0xfe,0x21,
-  0xb8,0xad,0x8f,0x88,0xfe,0x50,0xd9,0xe7,0x3e,0x41,0x73,0x1d,0xa6,0x56,0x3b,0x6d,
-  0x0b,0x93,0x5f,0x72,0xd7,0x3f,0x3c,0x5b,0x9a,0x36,0x6a,0x96,0xbd,0xdb,0x88,0x42,
-  0x29,0xd5,0xff,0x99,0x30,0xda,0x3c,0x26,0xfd,0x77,0x4a,0x7d,0x72,0xe3,0x9f,0x36,
-  0x65,0x69,0xa6,0x6d,0x13,0x95,0xa1,0xbe,0x21,0x19,0x20,0xc7,0x8e,0x30,0xbb,0xc3,
-  0xda,0x6b,0x3c,0xc0,0xd5,0x64,0x53,0xca,0xdd,0xff,0x2b,0x6d,0xef,0x40,0xd8,0x3b,
-  0xe9,0x26,0x11,0x76,0x87,0xe9,0x66,0x57,0x37,0x2e,0x03,0xea,0x08,0x1f,0x49,0x16,
-  0xb9,0xfa,0x7f,0x41,0xda,0xff,0x33,0x2b,0x77,0x40,0x7b,0xa0,0x28,0xb4,0x63,0xcd,
-  0x9c,0x76,0x42,0x8c,0x41,0x6a,0xd4,0xd8,0x4f,0xf5,0x28,0x52,0x6a,0x55,0x7b,0x46,
-  0xff,0x80,0x8a,0xd7,0x77,0xea,0xcb,0x19,0x75,0x9f,0xb9,0xe9,0xf1,0xf2,0x11,0xe5,
-  0x23,0xe5,0x0a,0xd3,0xdf,0xdd,0x31,0x6c,0xdc,0xa5,0x86,0x0d,0x5f,0xb7,0x64,0x66,
-  0xf2,0xbf,0xae,0xa2,0x24,0x37,0x7c,0xde,0x13,0x94,0xdd,0xa6,0x37,0xf4,0xe5,0xdb,
-  0xfd,0xbb,0xd7,0x8d,0xca,0x47,0xf9,0x07,0x56,0x45,0xcd,0x61,0x47,0xff,0xc0,0xb3,
-  0x39,0xf2,0xdd,0xc6,0xed,0xad,0x73,0x73,0xaf,0x7a,0x16,0xee,0x36,0x5e,0xd7,0xe6,
-  0x96,0xe4,0x3f,0x3b,0xf1,0x6e,0xb8,0x1d,0x3e,0x35,0x29,0xa7,0x57,0xba,0xbb,0xf1,
-  0x75,0xed,0x53,0x4a,0xbe,0x39,0xcb,0xb9,0x9f,0x1b,0x6e,0x54,0x66,0x49,0x3e,0xa3,
-  0x59,0xbb,0xaa,0x4f,0xba,0xbb,0xed,0xbf,0x19,0x9f,0xd3,0x26,0xf6,0xe5,0xce,0x82,
-  0xb5,0x8d,0xff,0x53,0x83,0x3e,0x98,0x25,0xdd,0x6e,0x7c,0x41,0xcb,0x31,0x0b,0xed,
-  0xfb,0x81,0x4e,0x56,0x76,0x77,0xec,0xf6,0xe8,0xa7,0x7c,0x4a,0xbb,0x54,0xc6,0x23,
-  0x7a,0x89,0xaa,0xac,0x94,0xee,0xe6,0x8b,0xf4,0xa2,0xd2,0x9c,0x03,0x28,0x44,0xf4,
-  0x22,0x55,0x71,0xd1,0xcd,0xb8,0x52,0x16,0x55,0x17,0x79,0x2e,0x83,0x9c,0x4e,0xdc,
-  0x74,0x97,0xb2,0xcb,0xb4,0x1b,0x38,0x1e,0x89,0x40,0xae,0xfe,0x7d,0x3e,0x25,0x2a,
-  0x2d,0x82,0xcf,0x43,0x0e,0x0f,0x1b,0xce,0xfd,0x2f,0xca,0xa9,0x6a,0xbb,0x8a,0x7f,
-  0x6e,0xd6,0xc4,0xa3,0x4a,0x95,0x74,0x15,0x6f,0x5e,0x52,0x72,0x54,0x0a,0x68,0xb7,
-  0x6f,0xfc,0x42,0x14,0x62,0xd2,0x3d,0xd2,0xed,0xf1,0x4f,0xeb,0xee,0xfb,0x79,0xd6,
-  0x88,0xea,0x50,0x5a,0x81,0x1f,0x1c,0x37,0x50,0x50,0x98,0x04,0xbc,0xa5,0x4c,0x2a,
-  0x85,0x5c,0x49,0xe3,0xb8,0xcc,0x50,0x50,0x0a,0x79,0xa1,0x73,0x3f,0xcf,0x46,0x94,
-  0xbb,0x24,0x95,0xdf,0x18,0xd6,0xd6,0x90,0x60,0xde,0xa8,0x17,0xb6,0x2b,0x65,0x6d,
-  0x2a,0x34,0x41,0x2b,0x2f,0x09,0x08,0x41,0xe3,0x99,0xf9,0x79,0x76,0x7e,0xce,0xad,
-  0xbd,0xad,0x89,0xbf,0xc5,0x0d,0x94,0x22,0x84,0x9a,0x89,0x4d,0xf8,0x27,0x5a,0xef,
-  0x2e,0x51,0x73,0x98,0xd4,0x64,0xb6,0x46,0x4b,0xd4,0x89,0x90,0xb9,0x1f,0x3e,0x49,
-  0xfa,0x14,0xdc,0x60,0x4e,0x5c,0xb6,0xe2,0x76,0x4b,0x58,0x9e,0x73,0xbb,0xf4,0x05,
-  0x68,0x1c,0x2c,0x5c,0xa6,0x4c,0x92,0x26,0xc0,0x6d,0x78,0x4a,0x81,0xcc,0xf3,0x72,
-  0xaa,0xfd,0x92,0xab,0x2a,0x9a,0xa4,0xc7,0x51,0x88,0x2a,0x71,0x29,0x08,0x8d,0x92,
-  0x66,0x34,0x72,0x71,0x5e,0x31,0x15,0x5c,0xf5,0x99,0xf9,0x7c,0x96,0xf8,0xc5,0x2b,
-  0x15,0x9d,0xc7,0x74,0x1d,0x05,0x40,0xa1,0x82,0xe5,0x49,0xed,0x50,0x16,0x2f,0xd5,
-  0x73,0x55,0xc4,0xe0,0x3a,0x2f,0x95,0x5c,0xf3,0xd3,0x9a,0xb3,0x58,0x7a,0x05,0x2e,
-  0x33,0x26,0xc6,0x27,0x2c,0x96,0xfe,0x8e,0x7d,0xde,0xc8,0x11,0x02,0x7c,0xde,0x98,
-  0x14,0x9f,0x50,0x81,0xf3,0xff,0x4f,0xc6,0x44,0xf7,0xf3,0x1a,0xf2,0x32,0x78,0x1d,
-  0xe6,0x12,0x31,0x21,0x0a,0x47,0x51,0xc8,0x8b,0xa1,0x35,0x59,0x04,0x97,0xc1,0x44,
-  0x53,0x5a,0x26,0x1d,0xe5,0x97,0xe1,0x29,0xd7,0xfa,0x69,0x52,0xa2,0x6d,0xa5,0x81,
-  0x1b,0x55,0xad,0x49,0x09,0xb7,0xf9,0x50,0x88,0x1f,0x50,0xca,0x78,0xec,0xee,0xf2,
-  0x60,0x5e,0x3b,0x44,0xdb,0x7c,0x7a,0xb3,0x0a,0xae,0xf7,0x05,0x14,0x03,0xa3,0xda,
-  0x10,0x08,0x85,0xa8,0x83,0x0e,0x09,0x9a,0xe0,0x43,0x80,0x11,0xd3,0x74,0x10,0xf9,
-  0x00,0xa6,0x96,0x99,0x1f,0x26,0x85,0xf9,0x02,0xbd,0x58,0x55,0x0e,0x38,0x42,0x4e,
-  0x95,0x19,0x49,0xa0,0xf0,0x42,0x4e,0xb8,0x6d,0x41,0xf8,0x73,0x21,0xc5,0x2c,0xcb,
-  0xdc,0x7f,0x53,0x4e,0xb4,0x6d,0x91,0xfe,0x79,0x75,0x62,0x47,0x5a,0x28,0x6c,0xcf,
-  0x89,0x9a,0x91,0xf0,0x17,0xd4,0x9c,0x0e,0x7c,0x71,0x8b,0xc2,0x37,0xfa,0x14,0xae,
-  0xb9,0xd6,0x8f,0x7d,0x3f,0x9c,0xca,0x5a,0x01,0xa3,0x29,0x0c,0xb7,0xa9,0x34,0x97,
-  0x1c,0xa7,0x59,0xd5,0x65,0xd5,0xbd,0x1e,0x6e,0xb8,0x55,0x59,0xdc,0x76,0xb9,0x7e,
-  0x63,0xa4,0xf0,0x01,0x5b,0x68,0x57,0xe6,0xb4,0xe5,0xe9,0x4d,0x11,0x63,0x83,0x52,
-  0xc1,0x2f,0xd7,0x9b,0x23,0x9a,0x7b,0xbd,0x45,0x73,0x16,0x49,0x9f,0x87,0x1b,0xf8,
-  0x44,0x4b,0xf8,0x5b,0x5e,0x48,0x8b,0xb2,0x09,0x0a,0xf1,0xef,0x49,0x2a,0xae,0xfe,
-  0x42,0x5e,0x62,0xb8,0xd6,0x4f,0xae,0x74,0x0b,0x6f,0x8d,0x4e,0xdc,0x94,0x93,0x16,
-  0x4a,0x73,0x6e,0x84,0x3c,0x7e,0xeb,0x9d,0x25,0xa5,0x4a,0xae,0xd4,0x88,0x47,0x4a,
-  0x4a,0x73,0x32,0xf9,0x38,0xc0,0x8b,0x24,0xc5,0x34,0x74,0x2d,0xa2,0x14,0x81,0xc2,
-  0x1b,0x49,0x60,0x85,0x8a,0xd4,0x08,0x5a,0x04,0xf0,0x54,0xa7,0x38,0x02,0x19,0xfd,
-  0xf3,0xec,0x8d,0xec,0x16,0xfe,0xef,0xd1,0x29,0xa5,0xf9,0x37,0xb2,0x42,0x14,0xca,
-  0x23,0x6a,0x0b,0x93,0xa4,0xbe,0xe8,0x44,0xad,0xf4,0xc6,0x4f,0xdd,0xc2,0x5f,0x8e,
-  0x5e,0x5b,0x7a,0x95,0x31,0x2b,0x33,0x3f,0x37,0xe6,0xdc,0xdd,0x76,0xbb,0xfe,0x05,
-  0x75,0xe2,0x73,0x39,0x77,0xf3,0xdb,0x71,0x3e,0x73,0x56,0xe6,0xde,0xdd,0xb6,0x28,
-  0xfa,0x0f,0xa5,0x57,0x3d,0x37,0x01,0x4f,0x45,0xff,0x67,0xe9,0x44,0xb3,0xd0,0xb9,
-  0x9f,0x1b,0x9a,0x50,0x09,0xfc,0x4e,0x9f,0x5b,0x9a,0xdf,0x2e,0xdf,0xcd,0xff,0x9b,
-  0x3e,0x77,0x51,0xfe,0x73,0x0a,0x0d,0xfb,0x54,0x69,0xce,0x73,0x78,0x64,0x73,0xf4,
-  0x0b,0xa5,0xf9,0x66,0xa1,0xf3,0x7e,0x6f,0xb8,0x31,0x67,0x16,0x9e,0xfd,0xc2,0xa2,
-  0xdb,0x9e,0xa3,0x3f,0x14,0x2d,0x2a,0x9d,0xf8,0x9c,0x72,0x6d,0xe7,0x7d,0xd1,0x2f,
-  0xd1,0xea,0xa6,0x53,0x9f,0x2e,0xcd,0x5a,0x3f,0x4c,0x8a,0xf2,0x48,0x18,0x95,0x4c,
-  0xbb,0xa4,0x93,0xb6,0xc1,0xa7,0x96,0x96,0x11,0x3f,0x18,0x14,0x5a,0xfb,0x11,0x5c,
-  0x21,0xb8,0xab,0xcb,0xac,0xb6,0x5c,0xe9,0x4e,0xbe,0xe8,0xce,0xcb,0x4a,0x73,0x56,
-  0x92,0x10,0x4d,0x0b,0x11,0xfc,0x43,0x25,0x2b,0x73,0xca,0x78,0x29,0x1e,0x51,0x78,
-  0x66,0xf8,0x0d,0xc6,0xb5,0xcb,0xa4,0xdb,0xe1,0x0b,0x50,0x62,0xae,0x20,0xe1,0x56,
-  0xd0,0x70,0xa1,0x4a,0x0b,0xe0,0x0b,0x4c,0x41,0xb3,0x88,0x47,0x3e,0x05,0xee,0xfb,
-  0xb9,0xa1,0x89,0x47,0x79,0x69,0x90,0xbe,0x3c,0x12,0x74,0xe6,0x41,0x81,0x96,0x4d,
-  0xae,0x47,0x6b,0xc7,0xf5,0x43,0x1f,0xa5,0x7b,0x3d,0xdc,0xd0,0xd4,0xa9,0xe3,0xea,
-  0x6a,0xc2,0x65,0x69,0x09,0x9e,0x42,0xbc,0x6d,0x71,0x44,0x6b,0x2f,0x21,0x81,0xa9,
-  0x85,0x59,0xe3,0x73,0x8c,0xb6,0xd6,0xc0,0x6d,0xea,0x44,0x12,0xb4,0xd9,0xad,0xbe,
-  0x89,0xcd,0x53,0x48,0xd7,0x95,0xf8,0x5a,0x8a,0x25,0x68,0x6b,0xd5,0x6f,0xf3,0x4d,
-  0x34,0xb2,0xe6,0xa7,0x95,0xdf,0x16,0x9e,0xe8,0x53,0x9a,0xd2,0xc2,0x8a,0x66,0x14,
-  0x5a,0xf4,0x42,0x35,0x27,0x7d,0x44,0xcd,0x31,0x32,0xdf,0x57,0x8e,0x6a,0xdc,0x05,
-  0x5a,0x27,0x2a,0x99,0x08,0x09,0x8a,0x22,0x81,0x61,0x18,0x12,0x2e,0x25,0x09,0x17,
-  0x0d,0xe9,0x42,0x5a,0x3d,0x99,0xfb,0x69,0xbc,0xb5,0xa9,0x82,0xb7,0xe9,0xfa,0xb4,
-  0x58,0x53,0x3b,0x70,0xbe,0x15,0x6a,0x62,0x93,0x99,0xb2,0xba,0x33,0x50,0xf6,0xc5,
-  0xd2,0x22,0x03,0x48,0x2d,0xa9,0xa5,0xe0,0xec,0xef,0x40,0x32,0x3e,0x1d,0xbd,0x7c,
-  0x91,0x72,0x59,0x53,0x4e,0xfc,0x86,0xa8,0xb4,0x09,0x7e,0xd3,0xfc,0x7d,0xde,0x1c,
-  0x9d,0xb5,0x48,0xfd,0x3c,0x2a,0xf7,0x1b,0x48,0xff,0x57,0xc3,0x44,0xd7,0xf3,0xae,
-  0x30,0x1a,0xa3,0xda,0x51,0xa8,0x66,0xf7,0xe1,0x30,0x38,0x2a,0x57,0xcb,0x39,0xf8,
-  0x7e,0xaf,0x53,0xd5,0x5c,0x28,0xc1,0xe5,0x8d,0x9f,0xce,0xa7,0x51,0xff,0x80,0xeb,
-  0x57,0xb1,0x2c,0xcf,0xe7,0x69,0x36,0x5a,0x07,0x2b,0xc2,0x92,0x0f,0x9a,0x0d,0x6e,
-  0x56,0x44,0x55,0x55,0x0d,0x28,0x31,0xae,0x93,0x3e,0xf9,0x0a,0x7d,0xda,0x99,0x5f,
-  0x09,0x4c,0x81,0x7c,0x43,0x06,0x78,0xd9,0xb8,0x16,0xf2,0x41,0xbe,0x95,0xbf,0xcc,
-  0x2b,0x20,0xcf,0x60,0xb7,0x40,0x1c,0xa6,0xf0,0x7c,0x60,0x46,0xd6,0xf8,0x8a,0xb6,
-  0xeb,0xf8,0xcd,0x5f,0x2c,0x2e,0x51,0xfa,0xa4,0x59,0xfc,0xe6,0xd6,0xe2,0x49,0xca,
-  0xdb,0x53,0xae,0x0b,0xe2,0xc2,0xdb,0xa8,0x6c,0xcf,0x29,0x53,0x16,0xb4,0xca,0x9a,
-  0x7b,0xfd,0x40,0xf9,0x8a,0x25,0x6d,0x5f,0x5c,0xf2,0xf9,0xb5,0x13,0xcb,0x73,0x96,
-  0x34,0x7e,0x51,0xff,0xfc,0xe6,0x89,0x0f,0xe5,0x2c,0x69,0x9b,0x1c,0xfe,0x7c,0xac,
-  0x70,0xab,0xb4,0xa4,0xf7,0x8b,0xe1,0xcb,0xd6,0xe6,0x64,0xdf,0x8f,0xb8,0x8d,0x28,
-  0x6c,0x04,0xbc,0x0d,0x8e,0xc2,0x26,0x98,0x03,0x97,0x03,0xbb,0x0d,0x06,0x95,0x6b,
-  0x21,0x0f,0xef,0x47,0x73,0x8f,0xcf,0x5b,0x5c,0x25,0xf9,0x3a,0x9b,0xa5,0xc2,0x58,
-  0xcb,0x5d,0x52,0xa9,0x82,0x42,0x67,0x4b,0x98,0x2c,0x9a,0xa4,0x99,0x2d,0x55,0x52,
-  0x69,0x27,0xe9,0x0d,0xd7,0x78,0xe5,0x06,0x6d,0x56,0xcb,0x4d,0xb7,0x48,0x85,0x8d,
-  0x37,0xb4,0x16,0xde,0x96,0x73,0x0b,0x4c,0x34,0x1a,0xb5,0xab,0x5a,0x94,0x1c,0x49,
-  0x31,0x0c,0xad,0xd0,0x50,0x26,0x4a,0x13,0x0d,0xd7,0x78,0xb5,0xac,0x49,0x6d,0xc5,
-  0x95,0x28,0x45,0x24,0x34,0x89,0xb1,0x89,0xba,0xa2,0x6e,0x61,0xc1,0xdb,0x3a,0x4a,
-  0xca,0xb8,0x3a,0xeb,0x56,0x85,0x4e,0xad,0x70,0x8f,0xf7,0xdc,0xc9,0xe2,0xc6,0x76,
-  0x6d,0x3a,0x78,0x24,0xc6,0x8d,0x04,0x04,0x4b,0x3c,0x85,0xac,0xcd,0x48,0x68,0x41,
-  0x43,0x1c,0xd9,0xa1,0x85,0xdc,0x6f,0x0b,0x7c,0xcd,0x9f,0x83,0x97,0xfb,0xae,0xad,
-  0x52,0x17,0xc8,0x28,0x98,0x65,0xf8,0x6d,0xb1,0xcf,0x49,0x1b,0xcd,0x89,0xe1,0xd2,
-  0x05,0xb9,0x9f,0x83,0xdb,0xfa,0xaf,0x0d,0x97,0xba,0xaf,0x9f,0x37,0x81,0x8c,0xfe,
-  0x17,0x02,0x39,0x07,0x73,0xee,0x01,0x84,0x01,0x15,0x13,0xfb,0xe5,0x7b,0xca,0x6e,
-  0xef,0xfc,0x07,0xfd,0xf2,0x7e,0xef,0x3d,0xd2,0xe6,0xd8,0x3f,0x54,0x4c,0x34,0xdd,
-  0xf3,0xaf,0x1a,0x07,0x8a,0xc2,0x9d,0xbe,0xc6,0x72,0x30,0x4c,0x2d,0xdc,0xe2,0x93,
-  0x64,0xad,0x05,0x05,0x05,0x05,0x3c,0x52,0x44,0x82,0xfb,0x7e,0x1a,0x2e,0x2c,0xbc,
-  0xf0,0xeb,0xf3,0x27,0x2f,0xfc,0x4e,0x08,0x17,0x4e,0x5e,0x38,0x77,0xb1,0x00,0xff,
-  0x07,0xbf,0xfa,0x37,0x17,0xee,0xc5,0xeb,0xef,0xfd,0x1d,0x09,0x2f,0xbd,0x89,0x57,
-  0x43,0x01,0x2f,0x9b,0x3c,0xf3,0xcf,0xa1,0xd7,0xfc,0x78,0x24,0xb9,0x7b,0x69,0xd6,
-  0xfd,0x34,0x2c,0x3c,0x82,0xe3,0x8f,0xfc,0x4e,0x08,0x0d,0x74,0x1b,0x0d,0x34,0xbe,
-  0xef,0xec,0xb9,0xd9,0x75,0x74,0xa4,0x6f,0xe0,0x43,0xf7,0xf8,0xf2,0xd2,0x9b,0x9f,
-  0x2b,0xaa,0xef,0x5c,0xfb,0xdf,0xca,0xaf,0xbe,0xf9,0xf9,0x0d,0x0d,0x9d,0xeb,0xce,
-  0x95,0x2f,0x8f,0x3c,0x57,0xbc,0xab,0x73,0xed,0x9d,0x78,0xea,0xf9,0x07,0xf6,0xa2,
-  0xe0,0x1e,0x2f,0xb1,0xbb,0x8d,0xcd,0xda,0x04,0x25,0xaf,0x8f,0x84,0xd6,0x4f,0x97,
-  0xe4,0x3d,0xcb,0x96,0x19,0x93,0x5a,0x27,0x94,0x48,0xcf,0x2a,0x77,0x93,0x70,0x79,
-  0x9e,0x7b,0x3e,0x15,0x85,0x40,0xe0,0xff,0xd4,0x6e,0x78,0x36,0xe7,0x6e,0x09,0x15,
-  0x35,0xe2,0xc3,0x1c,0xc4,0x93,0x78,0x44,0x20,0x46,0x5f,0xb4,0x19,0xf1,0xa1,0x6b,
-  0x3c,0x43,0x6d,0x2c,0x40,0xe0,0x4a,0xd2,0xcf,0xa8,0x66,0x6d,0x01,0x84,0x80,0x86,
-  0x00,0xf1,0xa1,0xfb,0x86,0xf4,0x3b,0x39,0x82,0x34,0x90,0x38,0xdc,0x09,0x42,0x40,
-  0xd8,0x00,0xa4,0x36,0x25,0xae,0xdc,0x79,0x79,0x29,0xbb,0x51,0x93,0xdc,0xe3,0x55,
-  0xe5,0x1e,0x69,0x12,0xff,0xb4,0x2e,0xf5,0xb7,0x90,0x30,0x41,0x2f,0xec,0x4f,0x1f,
-  0x29,0x3c,0x48,0xc2,0x9a,0xe6,0x59,0x92,0xfb,0x7e,0x00,0x04,0x08,0x04,0x54,0xb3,
-  0x51,0xfa,0x43,0x78,0xd9,0xf4,0x11,0xfa,0x43,0x0a,0x22,0x46,0x32,0xc5,0x99,0x5f,
-  0xa9,0x32,0x55,0xca,0x83,0x26,0x43,0x8b,0x2b,0x15,0x28,0xb0,0xa8,0xb6,0x49,0x29,
-  0xb7,0x8e,0x6c,0xa6,0x23,0x46,0x53,0x6b,0xd6,0xf7,0xf8,0x37,0xca,0x4d,0xbd,0xb8,
-  0xa8,0x62,0x85,0xd3,0x95,0x9b,0xda,0x8a,0xc2,0x2d,0x3b,0xd2,0x82,0xb2,0x56,0xfa,
-  0x1b,0xf8,0x0c,0x2f,0xd2,0xf1,0x94,0xeb,0xee,0xcd,0x10,0xcc,0x56,0x15,0x53,0x0a,
-  0x43,0x0e,0xdc,0x42,0xf1,0x5a,0x02,0x41,0x9f,0x43,0x6b,0x83,0xc2,0x02,0xb8,0x92,
-  0x5f,0x36,0x98,0x13,0x76,0x99,0x77,0x84,0x42,0xa8,0x21,0x72,0x50,0xad,0xa1,0x76,
-  0x6a,0x41,0x4d,0xdc,0x68,0xe0,0xc9,0xc6,0xb6,0x42,0x14,0xb4,0xdb,0x94,0x4f,0xa9,
-  0x85,0xc7,0x68,0x2f,0x1b,0xce,0x5c,0xdf,0x60,0x25,0x6a,0x27,0x94,0x41,0x69,0x69,
-  0x80,0xa1,0x22,0x2b,0xb3,0xc0,0x0d,0x90,0x40,0xff,0x94,0x30,0x56,0x69,0xd6,0x78,
-  0x88,0x16,0x96,0xc2,0x8d,0xa4,0xe8,0xa3,0x88,0x47,0x72,0x2d,0x81,0x8e,0xe0,0xfc,
-  0x47,0xcb,0x36,0xa1,0xfe,0xd4,0xb8,0x33,0x5e,0x6b,0x34,0xd8,0x37,0xb5,0x4d,0x38,
-  0x2c,0x2f,0xce,0x48,0x55,0xa1,0xc0,0x19,0x29,0x76,0x7a,0x83,0xec,0x2e,0x1d,0xdf,
-  0x08,0x5c,0xde,0xee,0xdc,0xbf,0x81,0x78,0x89,0x40,0xe0,0x97,0x54,0x38,0xa0,0x54,
-  0x09,0x41,0x3b,0xa0,0x84,0x57,0x93,0x50,0x7a,0x40,0x99,0x73,0xf0,0xf2,0xf0,0x8d,
-  0xaa,0x6a,0x3a,0x78,0xcc,0x68,0xc4,0x05,0xa1,0x09,0x76,0xac,0x69,0xe0,0xd4,0x74,
-  0xca,0x02,0x28,0xd2,0x91,0x32,0x81,0x18,0xf1,0x69,0xf0,0x94,0x83,0x1f,0x0c,0x7c,
-  0xb8,0x30,0x17,0x6c,0xf5,0x03,0x96,0xa0,0x92,0x10,0xb3,0x8f,0x10,0xfe,0x0c,0x41,
-  0x66,0x3d,0x58,0xf7,0x53,0x1a,0xfe,0xb4,0x0f,0xda,0x2d,0x01,0x0d,0xb1,0x82,0x0b,
-  0x03,0x8f,0xac,0x3f,0xa0,0x44,0x7b,0x4b,0xf5,0x1b,0x7d,0x68,0xaf,0x9d,0xfb,0x91,
-  0x04,0x3e,0x14,0x46,0x1c,0x84,0x59,0xb7,0x20,0x36,0x09,0xb8,0x7e,0x04,0x5e,0x55,
-  0x5d,0xf6,0xa2,0x55,0x12,0x78,0x58,0x58,0xf3,0xb4,0x60,0x5d,0x1f,0x0d,0xbd,0x38,
-  0x42,0x78,0x18,0x2f,0xa5,0x39,0xcf,0x6b,0x28,0xad,0x79,0x25,0xf8,0x62,0x35,0x4d,
-  0x69,0x95,0x48,0x40,0x95,0x6c,0x09,0x80,0x02,0x08,0xec,0xc6,0x9c,0xf9,0x89,0x48,
-  0xb9,0xd0,0xc8,0x35,0x5c,0xb7,0x7f,0x51,0x80,0x52,0x09,0x9c,0x78,0x62,0x44,0xa1,
-  0xdd,0x8a,0xa1,0xb7,0xaa,0x62,0x67,0x14,0x29,0x4b,0x0b,0x74,0xa4,0xc4,0x12,0x5c,
-  0xd5,0x25,0x68,0x7e,0x6e,0x94,0xd3,0x20,0xf0,0xf3,0x69,0x21,0xff,0xc6,0x6c,0xa1,
-  0x6c,0xd1,0x55,0x2e,0xbc,0x91,0x73,0x23,0xa2,0xbb,0x49,0x08,0xd2,0xa4,0x03,0x25,
-  0x96,0x50,0xf8,0x9c,0xf2,0x4d,0x6e,0x0b,0x6d,0x9b,0xa3,0xff,0xa0,0x16,0xba,0xe6,
-  0x5f,0xba,0x11,0x96,0x21,0x08,0x9c,0x50,0x9a,0x7f,0x80,0xdd,0xcd,0x5f,0x2f,0x9b,
-  0x5b,0x9a,0xf7,0x1c,0x2c,0xc3,0x61,0x13,0x54,0xe9,0x39,0x3c,0x32,0x49,0x9f,0x50,
-  0x7a,0x79,0x66,0x7c,0xeb,0x0d,0x02,0x7f,0x12,0x1a,0x24,0x7c,0xb8,0x00,0x85,0x89,
-  0xcf,0x49,0xff,0x03,0x8f,0x94,0x97,0x2e,0x7a,0x2e,0xe7,0x7f,0x90,0xfe,0x29,0x85,
-  0xf6,0xcc,0xfb,0x42,0xd0,0x5b,0xc1,0x3f,0xa3,0xb3,0x48,0xce,0x06,0x14,0xfe,0x4e,
-  0xbf,0x2c,0x22,0x80,0xe2,0x67,0x10,0x9f,0x03,0x1e,0x31,0xff,0x5b,0xf8,0x53,0x11,
-  0x25,0xf3,0xbe,0x0c,0x5c,0xb7,0xa8,0x7f,0x68,0x53,0xf5,0x50,0x5a,0x90,0x56,0xda,
-  0x47,0x50,0x68,0x2b,0x8d,0xde,0xb8,0xc9,0x8d,0x07,0x6e,0x88,0x2a,0xcb,0xa5,0xc9,
-  0xf0,0x69,0x9e,0x93,0xea,0x5c,0x2e,0x15,0xa0,0xa0,0xa5,0x94,0x1a,0x75,0xb2,0xf4,
-  0xe9,0xf6,0xc2,0x14,0x9e,0xf2,0xb0,0x26,0xae,0x99,0xae,0xf5,0x73,0x2b,0x2c,0xc6,
-  0x4d,0x41,0x6e,0x44,0xdb,0x80,0x42,0x1e,0x0a,0x94,0x2d,0x23,0x8e,0x48,0xd6,0x11,
-  0x16,0x71,0x5d,0xdf,0xc0,0xf5,0x63,0xe3,0x43,0x25,0x40,0xeb,0x27,0x28,0xd6,0x0f,
-  0x59,0x65,0xc2,0x93,0xd6,0x29,0xee,0xfa,0xbe,0x9a,0x14,0x63,0xb5,0xa6,0x2b,0xbe,
-  0x42,0xa6,0x18,0xbd,0x25,0x01,0x14,0x9a,0x95,0xd6,0x36,0x3c,0xa2,0x4a,0xac,0xc4,
-  0x10,0x9f,0x4c,0xa1,0xe1,0x9a,0x1f,0x46,0xfb,0xdc,0x70,0x8e,0x2a,0x35,0x43,0x15,
-  0x2f,0xd1,0x73,0x82,0x28,0xb4,0x9a,0x28,0xa8,0x64,0xef,0x4d,0x3a,0x05,0x19,0x7c,
-  0x68,0xe0,0x07,0xd7,0xa4,0x95,0x72,0x54,0x3d,0xaa,0xa1,0x81,0xb6,0x82,0xd6,0xa3,
-  0xd2,0xa4,0xa1,0x92,0x90,0x0a,0x71,0xa0,0x84,0x88,0xd1,0xfa,0x4a,0x9c,0xfb,0x69,
-  0x82,0x38,0x0f,0x23,0x08,0x64,0x5b,0x35,0x8e,0x08,0x4c,0x55,0x3d,0x00,0x31,0xaa,
-  0x84,0xab,0x32,0xc6,0x62,0x7c,0x87,0xae,0x6e,0x32,0x34,0xd7,0xf7,0x95,0x9b,0xd1,
-  0x36,0x39,0x24,0x14,0x5a,0xdb,0x76,0x4b,0x98,0x5d,0xaa,0x7c,0xc5,0xad,0x9f,0x71,
-  0x3c,0x5b,0x0c,0x3f,0x02,0x66,0xa0,0xfe,0x59,0x0c,0x3f,0x41,0xe1,0xf2,0x78,0xfa,
-  0x88,0x1a,0x87,0xc5,0xd7,0xfd,0x44,0x99,0x60,0x94,0xba,0xc6,0xdf,0x10,0xad,0xa8,
-  0xc9,0x2b,0x80,0xbb,0x38,0x24,0xb6,0xd7,0x48,0x1e,0xb8,0xab,0x93,0xde,0x57,0x21,
-  0x1d,0x29,0x4d,0x40,0x8d,0x7a,0x05,0xbb,0x71,0x05,0x64,0xbe,0xf7,0x56,0x7c,0xbc,
-  0x59,0xa6,0x6f,0x19,0x53,0x60,0x15,0xf5,0x6a,0x6d,0x45,0xe1,0x59,0x2a,0x5a,0xd1,
-  0xca,0x4a,0xa0,0x03,0x05,0x0f,0x09,0xee,0xf5,0xa3,0x10,0x7e,0x33,0xe4,0x56,0xf8,
-  0x3e,0x0a,0x9f,0x8d,0x22,0x6c,0xfb,0x77,0x7e,0x6d,0x4b,0xbe,0xc1,0x5a,0x61,0xa3,
-  0x76,0xed,0xc1,0xfc,0xd6,0xe6,0x3b,0xb4,0xf6,0xcc,0xf7,0x8e,0xef,0x6b,0x71,0x6f,
-  0x29,0x6e,0x42,0xa5,0x07,0x50,0xdb,0x5c,0xbe,0x0c,0x85,0x55,0x9d,0xe2,0xc8,0xed,
-  0x85,0x1d,0x0a,0x2d,0xbc,0x1b,0x27,0x49,0xd9,0xfa,0x67,0x16,0x6a,0x6e,0x86,0x18,
-  0xdd,0xde,0xa8,0xc6,0x48,0x97,0xb7,0xa2,0x1a,0xec,0x84,0x00,0xf8,0xe2,0x32,0xea,
-  0x67,0x07,0xd1,0x18,0x52,0xa4,0xa5,0x5a,0x2a,0x45,0x34,0x58,0xb8,0x49,0x89,0x16,
-  0x5e,0x8e,0x82,0xc4,0x17,0x7f,0x85,0x8e,0x44,0x0b,0x63,0x4a,0xb4,0xd4,0x47,0x88,
-  0xd1,0x3d,0x3f,0x46,0x8b,0x56,0x58,0x82,0x68,0xb0,0xd0,0x68,0x69,0xb5,0x84,0x96,
-  0x96,0xd6,0xc6,0x12,0x5f,0x4e,0xa1,0x84,0x47,0x94,0x1c,0x8f,0x24,0xb7,0x19,0x90,
-  0x59,0x3f,0xb8,0x00,0x41,0xac,0x44,0x03,0x77,0x07,0x25,0x6b,0x14,0x04,0x8a,0x70,
-  0x2b,0xad,0x4d,0xe1,0x3b,0x29,0x2d,0x11,0xa7,0x32,0xfb,0xbb,0x34,0x2c,0x6c,0x0d,
-  0x2a,0x24,0xc0,0xf6,0xb4,0x60,0x6c,0x6f,0x9d,0x66,0x1d,0x49,0x6a,0xd3,0x14,0x70,
-  0xad,0xe7,0xcf,0xca,0x9f,0x33,0x5e,0x1e,0xbc,0x76,0x4e,0x69,0x3e,0x0a,0x9d,0x28,
-  0xe4,0x7d,0x96,0x7d,0xce,0xe8,0x7b,0xf9,0xda,0x6b,0xf3,0x3f,0xdb,0xf6,0x39,0x43,
-  0x19,0x2c,0x9b,0xb3,0xc9,0x90,0x32,0xf3,0x13,0x51,0xee,0x01,0xb4,0xfe,0x60,0xc3,
-  0x00,0xc8,0xe9,0x47,0xa0,0xb8,0x88,0xf0,0x80,0xb9,0x72,0x99,0x34,0xa9,0xed,0x2b,
-  0x7a,0x96,0x7d,0xb7,0x60,0x61,0x1a,0x0d,0x6a,0x08,0x14,0xa5,0x62,0xcd,0x38,0xa0,
-  0xcd,0xea,0xf4,0xdd,0x92,0x06,0x8a,0x0b,0xca,0x5c,0xc3,0xe1,0x3f,0x80,0x85,0xff,
-  0x57,0xf0,0x21,0x81,0xc0,0x5f,0xbf,0x8f,0x20,0xb0,0xfe,0xcd,0xf9,0x73,0x7f,0xfd,
-  0xfe,0xc9,0xdd,0xff,0x8c,0xf8,0xf0,0xfc,0x33,0xef,0x9f,0x3c,0xf3,0xcf,0x97,0xbc,
-  0xbe,0x00,0x81,0x1f,0x21,0x08,0x6c,0x68,0x58,0x80,0xc2,0xc9,0x01,0x81,0x0f,0x8b,
-  0x3f,0x3a,0x79,0xf6,0xd2,0xf7,0x73,0x7d,0xe9,0xc2,0xe7,0x7f,0x4d,0x68,0xb0,0xe1,
-  0xea,0xc8,0xf3,0x0f,0x7c,0xd8,0xb9,0xf6,0x5b,0xe5,0xf7,0x2e,0xbc,0xf0,0xc0,0xae,
-  0xce,0xb3,0x77,0x5e,0x3f,0x39,0x72,0xbe,0x68,0xee,0x38,0x7c,0xc8,0x56,0x85,0xb7,
-  0x40,0xf0,0x1b,0x1e,0x2a,0xa7,0xb2,0x25,0x16,0xac,0xf2,0x68,0x07,0x56,0x06,0x13,
-  0x0b,0x7c,0x77,0x7b,0xb4,0xa6,0x4e,0xc0,0x53,0x86,0x47,0x73,0x8f,0xb7,0xed,0x89,
-  0xa6,0xe2,0xfb,0x6c,0xe1,0xcd,0xba,0x16,0xcb,0x99,0x0e,0x66,0x5b,0xa3,0xde,0xda,
-  0x2f,0x8c,0x97,0x01,0x59,0xe3,0xa1,0x53,0x40,0x11,0xa6,0xc1,0x0d,0x30,0x2b,0xa6,
-  0x34,0xe5,0x6a,0xbd,0x1d,0xe1,0x32,0x5f,0xa8,0x49,0x2a,0x31,0x9d,0x53,0xee,0xdf,
-  0x84,0x30,0x5e,0xe4,0x1b,0xba,0x06,0x39,0x3e,0xd4,0x11,0x8d,0xd0,0x6a,0xe0,0x65,
-  0x3b,0x94,0xbb,0x71,0x3f,0x78,0xc9,0xeb,0x73,0xfb,0x3b,0xe9,0x40,0x2d,0xa4,0x52,
-  0x6d,0x14,0xd4,0x42,0xed,0x93,0x80,0xa9,0xa6,0x73,0xca,0xfd,0xbc,0xae,0x7f,0xc1,
-  0x69,0x27,0x85,0x08,0x56,0x23,0x5f,0xa2,0xea,0x6b,0xb7,0x4f,0x39,0xee,0x5e,0x92,
-  0x33,0xa3,0x59,0x38,0xe2,0x63,0x92,0x11,0x63,0x01,0xfd,0xb3,0xf7,0x41,0xc0,0x67,
-  0x5a,0x2d,0xab,0x02,0xae,0xbf,0xa0,0x3a,0xbe,0x25,0x21,0x88,0x3b,0x88,0x21,0x30,
-  0x6b,0xc4,0xaf,0x59,0x8d,0xd9,0xa7,0xdc,0xe3,0x3d,0xab,0xaa,0xb6,0xc0,0x0e,0x63,
-  0xba,0xe6,0xe9,0x2c,0xd8,0x02,0x3b,0x0d,0x6f,0x89,0xe7,0xf9,0x82,0x2d,0xbe,0x1d,
-  0xd2,0xf4,0xd2,0x35,0x9d,0x2c,0x01,0x3b,0x60,0xba,0xe6,0x7e,0x02,0x67,0xfe,0x6b,
-  0x2c,0x01,0xb4,0xc4,0x0d,0xa4,0xb3,0x8a,0xf3,0x4a,0x22,0x78,0xa4,0x93,0xdf,0xa9,
-  0xbb,0xf0,0xaa,0x6a,0xcd,0xbf,0x42,0x93,0x4c,0x42,0x9e,0x21,0xdf,0x66,0x4c,0x80,
-  0xb2,0xcf,0xaa,0xc5,0xd2,0x22,0x8e,0x47,0x3a,0xd5,0x3b,0x99,0x96,0xa9,0xd7,0xaa,
-  0x6a,0x34,0xff,0x03,0xf0,0x0d,0x98,0x64,0x4e,0x98,0x83,0x02,0x6a,0xfc,0x3b,0x11,
-  0x67,0xe4,0x29,0xb7,0x36,0x4e,0xa2,0x17,0x21,0x4e,0x65,0xf2,0x8f,0xf0,0xfa,0xab,
-  0xc2,0xe2,0x25,0x4e,0x4a,0x75,0x2a,0x65,0xfd,0xbe,0x6f,0xc8,0xda,0x5d,0xcf,0x6a,
-  0x85,0x92,0x4a,0x09,0xc7,0x78,0xfd,0x01,0xf5,0x1b,0x2c,0xeb,0xfe,0x51,0xc1,0x8a,
-  0xd9,0xd1,0x8a,0x40,0xe5,0x94,0x47,0x01,0xe6,0xa7,0x27,0xb5,0x36,0xe9,0x65,0xbd,
-  0x4a,0x13,0x58,0x05,0x7d,0xb2,0xde,0x17,0xa4,0xf5,0xa0,0x46,0xee,0xb9,0x88,0x8a,
-  0x3b,0x79,0xfe,0xac,0xae,0xc7,0x94,0xa2,0x26,0xe0,0xdc,0x5a,0x3f,0xee,0xd1,0x1a,
-  0x97,0x2d,0xf0,0xea,0x33,0xf1,0xff,0xf5,0xc3,0xec,0x1c,0x40,0x70,0x29,0x1c,0x7d,
-  0xaa,0x35,0x2d,0xb3,0xf1,0xff,0x32,0xf9,0xa7,0xee,0x7f,0x09,0x86,0x18,0xa1,0xa5,
-  0xcb,0xbd,0xc5,0xf9,0xc5,0x83,0xea,0xea,0xdc,0xe3,0xb9,0x40,0xee,0x68,0xf6,0x50,
-  0x08,0x6b,0x83,0xce,0x78,0xbf,0xff,0xe2,0x7f,0x89,0x6b,0xb8,0xb7,0xc3,0xbc,0x1c,
-  0xc7,0xc8,0x0f,0xbf,0xba,0x08,0xa6,0xf4,0x2c,0x38,0x64,0x5e,0x62,0x54,0xe6,0xc7,
-  0xda,0xdb,0xdb,0xc5,0x15,0x03,0x1b,0x7f,0x1a,0x80,0xca,0x39,0x77,0xbd,0x7b,0x89,
-  0xfb,0x71,0xfd,0x8a,0xca,0x8a,0x4a,0xc5,0xa3,0xb3,0x22,0xa6,0x84,0x3b,0xd7,0x17,
-  0x2a,0x97,0x1c,0xd6,0x70,0xe1,0xc2,0x05,0xf3,0x7f,0x21,0xfc,0x2f,0xc6,0x9f,0xbb,
-  0xf0,0xf4,0x7f,0x65,0xfc,0xbc,0x0b,0x17,0x8e,0xff,0x57,0xc6,0x5f,0xfd,0x9f,0xbc,
-  0x9f,0x0f,0xd2,0xc2,0xcc,0xff,0xe2,0xfd,0x5f,0x7d,0xc4,0x39,0xf2,0xc1,0xc5,0xe3,
-  0x99,0xad,0xf4,0xfe,0x03,0xc1,0x3d,0xde,0xa5,0x0f,0xdd,0x02,0x64,0x8e,0xfc,0x25,
-  0x7d,0xf8,0x1f,0x08,0xee,0x9f,0xa3,0xf4,0xfe,0x03,0xc1,0xfd,0xcb,0xe8,0xab,0x4b,
-  0x0b,0xb3,0xff,0x03,0x7d,0xf8,0x17,0x04,0xd7,0xd3,0x5a,0x87,0x48,0xe9,0x01,0x69,
-  0x3f,0x95,0x12,0xa0,0xac,0x23,0xcc,0x12,0xe8,0x9f,0xfd,0x45,0x7d,0xf8,0x17,0x84,
-  0x2c,0x7d,0xd8,0xc9,0x50,0x1f,0x7e,0x83,0xf4,0x21,0x13,0x8a,0x71,0xd2,0x21,0xd4,
-  0x90,0x03,0x42,0x43,0xda,0xc2,0x25,0xf5,0xe1,0x7f,0x20,0x64,0xdd,0xff,0x7f,0x62,
-  0xfe,0x5d,0xf7,0x23,0x26,0x39,0xad,0x0f,0xc3,0x97,0x14,0x8c,0x71,0xfa,0xf0,0xbf,
-  0x74,0xfd,0xff,0xea,0xfc,0xff,0x27,0xde,0x6f,0xb6,0xbd,0xcb,0xf2,0x5d,0xfc,0xc5,
-  0xdf,0xa5,0xf4,0xe1,0x7f,0xea,0xe7,0xd2,0x87,0xff,0xc1,0xef,0x92,0xfa,0xf0,0xff,
-  0x23,0xbf,0xff,0x0b,0xfa,0xf0,0xff,0xd7,0xe3,0xff,0x6b,0xbf,0x30,0xe8,0x12,0x13,
-  0xff,0xdd,0xec,0xfb,0x3f,0xbb,0xd2,0x5f,0x7f,0x7f,0xfd,0xfd,0xf5,0xf7,0xd7,0xdf,
-  0x5f,0x7f,0x7f,0xfd,0xfd,0xf5,0xf7,0xd7,0xdf,0x5f,0x7f,0x7f,0xfd,0xfd,0xf5,0xf7,
-  0xff,0xe7,0x9f,0xd8,0x3b,0x30,0xb1,0x77,0x70,0x1f,0xce,0xa9,0xb9,0xe3,0xef,0x8c,
-  0x86,0xfa,0xef,0xfc,0xdd,0x27,0xf4,0x67,0x83,0xcf,0x43,0xc8,0x28,0x6f,0x81,0x12,
-  0xf3,0x93,0xb9,0xbe,0xe2,0x59,0xf2,0x23,0xee,0x9d,0xb8,0x3f,0xf2,0xc9,0x5c,0x1e,
-  0x1a,0x8e,0xd0,0xfd,0x1b,0xd0,0x60,0x7e,0x32,0xd7,0x57,0xf4,0x8d,0x5b,0xcc,0x2b,
-  0x5e,0xbe,0x2f,0xf6,0xc9,0x5c,0x1e,0xc2,0x47,0xc2,0x23,0x46,0xf9,0x32,0x33,0x6c,
-  0x7e,0x32,0xd7,0xcf,0x9f,0xfb,0xcf,0x2b,0xcc,0x49,0xff,0xf6,0xa5,0x85,0x9f,0xcc,
-  0xe5,0x71,0xfe,0xad,0xfb,0xff,0xa4,0xe6,0xdf,0x77,0xcd,0x66,0x0e,0x75,0x9f,0x4a,
-  0x7c,0x72,0xf3,0xef,0xc7,0xf5,0xb3,0x10,0x3e,0xa9,0xf9,0x2f,0x98,0xda,0x33,0x0a,
-  0x57,0xfe,0xed,0x63,0x9f,0xf9,0x64,0x2e,0x8f,0xf3,0x6f,0xdd,0xff,0x27,0xb6,0xfe,
-  0x2b,0x27,0x3e,0x6a,0x78,0xbf,0xb1,0x51,0xfd,0x5f,0x0f,0xfd,0xdf,0xfa,0x85,0x8f,
-  0x34,0xe0,0xfa,0xf9,0xde,0x27,0xb7,0xfe,0x35,0xa9,0x1a,0xa6,0xe4,0x4d,0xfb,0xe4,
-  0xd6,0xbf,0x75,0xff,0x9f,0xd4,0xfc,0xe7,0x97,0xb5,0xdc,0x08,0x55,0x27,0xa7,0x7e,
-  0x52,0xeb,0x27,0x7c,0xc1,0x24,0xfd,0x19,0x1e,0x35,0x3f,0x99,0xeb,0x2b,0xea,0xdd,
-  0xdf,0x37,0xab,0x77,0x6f,0xfc,0xc4,0xf4,0x7f,0xfa,0xfe,0xff,0x4f,0x5d,0x77,0x7f,
-  0xe9,0xa7,0x94,0x6f,0xfc,0x57,0xb3,0xfc,0x53,0x1b,0x3e,0x31,0xfd,0x73,0x61,0x94,
-  0xf4,0xe7,0xe8,0x27,0x35,0xff,0xfe,0xfa,0xdf,0x7f,0x60,0x5e,0xfb,0xea,0x17,0x8e,
-  0x7c,0x32,0x97,0xc7,0xf9,0xb7,0xee,0xff,0x13,0x9b,0xff,0xfa,0xb5,0x3f,0xe5,0xb3,
-  0x3f,0xb5,0x33,0xef,0x93,0xb9,0x3c,0xce,0xff,0x11,0xd2,0x9f,0x9f,0xd8,0xfa,0xcf,
-  0x9d,0xfc,0xaf,0x5f,0xe5,0x53,0x7f,0xf9,0x5a,0xcb,0xff,0x7a,0xe8,0xff,0xd6,0xaf,
-  0x21,0x7d,0xff,0x9f,0xd8,0xfc,0x4f,0xf9,0xdb,0xc7,0x41,0x9f,0xf8,0x93,0x4f,0x4e,
-  0xff,0x5c,0x20,0xfd,0xf9,0xc9,0xad,0xff,0x2b,0x72,0xca,0x8c,0xfa,0x9d,0xf9,0x2f,
-  0x7c,0x32,0x97,0xa7,0xa8,0x81,0xb8,0xff,0xff,0xab,0xf3,0x1f,0x06,0x0a,0x6d,0xde,
-  0x25,0x85,0x41,0x70,0x9d,0xe4,0x30,0x18,0xff,0xe5,0x78,0x42,0xfa,0xdf,0xe6,0x84,
-  0x21,0x21,0x65,0xae,0x79,0xec,0x8b,0xe3,0xc7,0xfd,0xbf,0xcd,0x20,0xf7,0xae,0x58,
-  0x11,0x01,0x00,
+  0x1f,0x8b,0x08,0x08,0x49,0xe1,0xdb,0x46,0x00,0x03,0x61,0x62,0x67,0x34,0x30,0x35,
+  0x5f,0x31,0x5f,0x30,0x33,0x2e,0x62,0x69,0x74,0x00,0xed,0xfd,0x7d,0x7c,0x14,0xd7,
+  0x75,0x3f,0x8e,0x9f,0xb9,0x33,0x12,0xa3,0xdd,0x95,0x76,0xf4,0xe4,0xac,0x6d,0x20,
+  0xa3,0x95,0x20,0x6b,0xb2,0x88,0x45,0x60,0x8c,0xb1,0x90,0x06,0x49,0x26,0x8a,0x4d,
+  0x8c,0x4c,0xdd,0x84,0xf6,0x9b,0xa6,0x6b,0x42,0x53,0xda,0x17,0x49,0x65,0x27,0x9f,
+  0x96,0xe6,0x93,0x26,0x57,0x2b,0x81,0x85,0x21,0xf6,0x1a,0x93,0x46,0x4e,0x69,0xba,
+  0x60,0xea,0xc8,0x09,0x4d,0x96,0x07,0x9b,0x07,0x53,0x3c,0xc2,0x32,0x11,0x18,0xdb,
+  0x0a,0x71,0x53,0xf9,0x21,0xf6,0x9a,0xc8,0x44,0xb6,0x89,0x23,0xdb,0xc4,0x11,0xcf,
+  0xdf,0x73,0xee,0xec,0x3c,0xec,0x4a,0x24,0xe9,0xe7,0xf3,0xf3,0xef,0xf7,0xc7,0x2f,
+  0x9b,0x3f,0x72,0x3c,0x7b,0x35,0xcc,0x3d,0x7b,0xe7,0xdc,0xf7,0x3d,0xe7,0x7d,0xce,
+  0x81,0xa2,0xe0,0xa8,0xf5,0x3f,0x00,0xe9,0x4e,0xd0,0xee,0x5c,0xf1,0xd7,0x73,0x63,
+  0xd7,0xff,0xe5,0xec,0xbf,0x8c,0xcd,0xa9,0xfd,0xd2,0xe7,0x57,0xc2,0x0a,0xf0,0xd5,
+  0x7d,0xf9,0xfa,0xd8,0x17,0xfe,0xba,0xee,0xfa,0x79,0xf0,0x79,0xf0,0xd7,0xc5,0x62,
+  0x37,0xcc,0xd2,0x6f,0x9c,0xa5,0xcf,0x81,0x95,0x50,0x34,0xbb,0x6e,0x41,0x5d,0xdd,
+  0x82,0x39,0xd7,0xc3,0x5f,0x81,0x54,0x1a,0xb8,0x8c,0x9f,0xef,0x3f,0xf4,0xa7,0x5f,
+  0x88,0x01,0x97,0x00,0x60,0x52,0x4c,0x8a,0xd3,0xff,0xfb,0x63,0x92,0x2e,0x01,0x6f,
+  0x9c,0x19,0x03,0x93,0xfe,0x1b,0xb2,0xdf,0x17,0xc5,0x40,0xf7,0xfe,0xb7,0x14,0x03,
+  0x03,0xda,0xa0,0x41,0x81,0x32,0xf8,0xfd,0x1f,0x09,0x14,0x6e,0xcb,0xff,0xd3,0xf1,
+  0xec,0x0f,0x18,0x8f,0x9f,0xff,0xe3,0xf1,0x7f,0xc8,0xf3,0x00,0x28,0xff,0xc7,0xe3,
+  0xb5,0x3f,0x6c,0xbc,0x2d,0x5c,0xd6,0xa0,0x02,0x0a,0x40,0x22,0xed,0x0a,0x01,0x50,
+  0xd1,0x1a,0x7e,0xef,0x5e,0x41,0xa1,0xb1,0xdf,0xbe,0xbf,0x59,0x70,0x09,0x2e,0xf3,
+  0xeb,0xe3,0xc5,0x63,0xf2,0x57,0xe0,0x35,0xde,0x98,0x09,0x8e,0xc9,0x74,0x65,0x61,
+  0xa6,0xe4,0x8c,0x3c,0x07,0x2e,0xeb,0x8d,0x03,0xb7,0x9e,0xa9,0x8e,0x49,0xed,0xd9,
+  0xf1,0x5c,0x7b,0x07,0x9e,0xe0,0x61,0x43,0xdd,0xc7,0x6a,0x60,0x03,0xaf,0xcd,0xf8,
+  0xf7,0x31,0xba,0x52,0x9b,0x51,0xff,0x17,0xd3,0xe1,0x49,0xf3,0xa6,0x51,0x3f,0x0a,
+  0x8a,0x9e,0x1d,0xdf,0x5d,0x70,0x1c,0x76,0x43,0xed,0xa2,0xa2,0x18,0x6b,0x81,0x07,
+  0x21,0x6a,0xfa,0x62,0x8c,0xae,0x44,0x4d,0x7f,0x1d,0x03,0xfe,0xb0,0x16,0xed,0xf7,
+  0xd5,0x41,0x18,0xd7,0x43,0xf6,0x79,0x2a,0x77,0xc0,0x13,0x30,0x23,0xa3,0xa6,0x99,
+  0x0c,0x1b,0xa0,0xd6,0xf4,0xa7,0xd9,0x69,0xbc,0x52,0x6b,0x5e,0x97,0x6e,0xfa,0x18,
+  0x3c,0xc1,0x66,0x98,0xd7,0xa6,0x59,0x4c,0x89,0xdb,0x13,0xae,0x3c,0x0d,0xe7,0xa1,
+  0xa1,0xbd,0x38,0x56,0xfe,0x05,0xf6,0x32,0x34,0x98,0xc1,0xb4,0x4c,0x57,0xea,0x51,
+  0x60,0xd3,0xe9,0x2b,0x73,0x69,0x5a,0x06,0xc5,0x7e,0xfe,0x8c,0x74,0x10,0x2e,0xc3,
+  0x0d,0xc6,0xd2,0x51,0x79,0x18,0x85,0x46,0x33,0x38,0x2a,0x5f,0x10,0x42,0xc9,0xa8,
+  0x7c,0x46,0xbb,0x0c,0x37,0x99,0x05,0xa3,0xf2,0x18,0xd8,0xf7,0x37,0xb4,0x1d,0x74,
+  0x13,0xa3,0x24,0x2d,0x4f,0x53,0xdf,0x76,0xef,0xdf,0x30,0x10,0x88,0x09,0x61,0x9e,
+  0x19,0x8c,0x55,0x6b,0xce,0x7c,0x07,0x0a,0xa2,0xb0,0xbb,0x3b,0x3a,0xa6,0xee,0x49,
+  0x4c,0x33,0x72,0x9e,0x3f,0x34,0xca,0xa2,0xf0,0x24,0x9f,0x35,0x50,0x32,0xda,0x7c,
+  0x37,0xfe,0x28,0xd9,0xe7,0x29,0x58,0x42,0xda,0xb8,0xdb,0x37,0x8f,0x29,0xf0,0x30,
+  0xa9,0xc5,0xd6,0x4f,0x6f,0xac,0xb0,0x45,0xda,0x9d,0xae,0x39,0x71,0x6b,0x8c,0xcd,
+  0xc7,0xdf,0xce,0xfa,0xc4,0xa5,0xa9,0xb0,0xb7,0x63,0x56,0x5c,0x5d,0xc3,0xae,0xd2,
+  0xef,0xe1,0x33,0x33,0xfe,0x35,0xec,0x55,0xd8,0xcb,0x67,0x0e,0x47,0xf0,0x0a,0x09,
+  0x99,0x6b,0xd6,0xb0,0x56,0xe7,0xfe,0xad,0x6a,0x00,0xde,0x47,0x6d,0x94,0xc4,0x26,
+  0x29,0xf0,0x0b,0x52,0x4b,0x4c,0x16,0xf7,0x3f,0xac,0xc6,0x64,0xc3,0x78,0x5f,0x9b,
+  0xdb,0x17,0x8c,0x4d,0x2a,0x73,0x56,0xbd,0x31,0x85,0xf4,0xd3,0xc8,0x83,0x77,0xf9,
+  0x2f,0x18,0x39,0xfa,0xf9,0xe8,0x99,0xd2,0x0b,0xa5,0x97,0x8d,0xc6,0xfe,0xe0,0xbb,
+  0xf2,0x60,0xa1,0xad,0x9f,0xde,0x02,0xa1,0x0d,0x43,0x4d,0xcb,0x01,0x78,0xc6,0xab,
+  0xff,0xc0,0xee,0xe6,0x61,0x38,0x1f,0xab,0x1f,0x08,0x1c,0x90,0x67,0x38,0xfa,0x6f,
+  0x2d,0xdd,0x02,0x7b,0x61,0xa6,0xa1,0xb6,0x37,0x55,0xc0,0x3d,0x30,0xd3,0xf4,0xb7,
+  0xb3,0x57,0xe8,0x8a,0xa9,0xb6,0xd7,0xbd,0xa0,0xec,0x55,0x66,0xbe,0xa0,0xfe,0x86,
+  0x95,0x39,0xbf,0xaf,0x09,0xdf,0x15,0x93,0xc2,0xf9,0x36,0x80,0x77,0xbe,0xa6,0x6a,
+  0x09,0xd7,0x8d,0x44,0xbe,0xca,0xda,0xc1,0xd6,0x7f,0x6b,0x85,0x58,0x6f,0x7c,0x20,
+  0xe6,0x2b,0x89,0x75,0x7a,0xf5,0xa9,0xa2,0x50,0x43,0x42,0x77,0x8c,0x2d,0x03,0x7b,
+  0xbd,0x8d,0x54,0xf6,0xc2,0x39,0x9c,0xaf,0xaa,0xcb,0x0b,0xd8,0x31,0xfc,0xc3,0x60,
+  0x4a,0x1e,0xc1,0x2b,0xf5,0x3c,0x90,0xaa,0x1e,0xe3,0xe7,0xa0,0x81,0xab,0x29,0xff,
+  0x57,0xc1,0x79,0x7e,0xc8,0xc0,0x18,0x34,0xc0,0x2c,0x2e,0x67,0x0c,0x12,0x82,0x28,
+  0x38,0x57,0x60,0x14,0xa6,0xd2,0x95,0x4d,0xce,0xf3,0xa8,0xda,0x30,0x9c,0x85,0x86,
+  0x55,0x81,0x9e,0xf2,0x47,0xf8,0x51,0x54,0x54,0x30,0x29,0xd3,0x95,0x05,0xf1,0x12,
+  0x14,0xa4,0xb3,0x50,0x67,0xdc,0x96,0x94,0x0f,0x3b,0xcf,0xc3,0x95,0x95,0xb0,0x5f,
+  0xab,0xbd,0x53,0xed,0x61,0xd3,0xc3,0xeb,0xa1,0xd6,0xf0,0x27,0xd9,0x30,0xec,0x47,
+  0xe1,0x1a,0x12,0x6e,0x04,0xfd,0x0e,0x35,0xc9,0x32,0x95,0xb6,0x59,0x08,0x15,0xd4,
+  0xd0,0xb7,0x83,0xea,0x03,0xb8,0x7e,0xbc,0xe3,0x5b,0x9a,0x92,0xe1,0x61,0x75,0x7f,
+  0x77,0xb8,0xe9,0xde,0x24,0x3b,0xe2,0xac,0x07,0x55,0x51,0x60,0x27,0x44,0x8d,0x88,
+  0xe6,0x53,0x12,0x1d,0x28,0xf8,0x35,0xd6,0x0f,0x3b,0x25,0x7c,0x31,0xcb,0x58,0xbf,
+  0xb4,0x53,0x8f,0xb7,0xaa,0x65,0xec,0xb0,0x64,0x3f,0xff,0xbe,0xe2,0x38,0xcd,0xae,
+  0x22,0xca,0xcb,0xb7,0x1a,0x03,0xee,0x7c,0x17,0x80,0x6f,0x6d,0xf3,0xeb,0xc6,0x3e,
+  0xd8,0x05,0x25,0x6b,0xe5,0x77,0x64,0x7b,0xfd,0xf4,0x4c,0xa1,0xd9,0x2d,0x34,0x83,
+  0x9a,0x7c,0xc6,0x38,0xeb,0xce,0x17,0x85,0x07,0x70,0x21,0x9d,0xd5,0xa6,0xb6,0xa0,
+  0x70,0x4a,0xb6,0xf5,0xd9,0x53,0x30,0x0c,0x3f,0x87,0x85,0x46,0x60,0x50,0x1e,0x8e,
+  0x7b,0xf4,0xb3,0xd0,0x28,0x79,0x50,0xae,0x69,0x79,0x43,0xa9,0x34,0x82,0x9b,0xe4,
+  0x23,0xce,0xfa,0x99,0xaf,0xe1,0xbf,0xce,0x6a,0xa1,0x9b,0xb3,0x01,0xe8,0x86,0x5a,
+  0xf0,0x73,0x96,0x81,0x7d,0x50,0x2b,0xa9,0x9d,0x68,0x7f,0x06,0x20,0xac,0x6c,0x48,
+  0x24,0x9e,0x2b,0xb4,0xf5,0xa9,0x16,0xf4,0xd3,0x7c,0x6f,0x51,0xb5,0xa6,0x7e,0x4e,
+  0xf3,0x2d,0x12,0xf3,0x45,0x01,0xe7,0xab,0x74,0x6d,0xad,0xd0,0x0d,0x7f,0x39,0xce,
+  0xd7,0xbe,0x7f,0xa8,0x72,0x3b,0x3c,0x8a,0x6a,0x8c,0x24,0xf5,0xe1,0x1c,0x7d,0x1a,
+  0x6a,0xd2,0xa7,0xf0,0x87,0x60,0x05,0x5d,0x39,0xe2,0xd8,0x87,0x54,0xe5,0xb0,0xfa,
+  0x10,0xda,0x9f,0x25,0x49,0xe9,0x97,0xcc,0xf3,0xfc,0x53,0x0d,0xfc,0x7d,0x6b,0xe0,
+  0x4d,0x78,0x1c,0xaf,0x48,0x23,0x8e,0x7d,0x88,0x48,0xdb,0xf1,0x6e,0x0d,0x5f,0x08,
+  0x26,0x13,0xcf,0xe5,0xe8,0x67,0x51,0x50,0xc3,0x7f,0xe8,0x75,0x68,0x68,0x9a,0x94,
+  0xc4,0x85,0x68,0x7f,0x22,0x5a,0x8a,0xf4,0xaf,0xdd,0xc6,0x9b,0xef,0xe4,0xb6,0xfe,
+  0x25,0x5a,0x6f,0xc5,0xf4,0x43,0x0c,0xc0,0xe3,0xb0,0x91,0xcb,0xc7,0xdc,0xfb,0x17,
+  0x44,0xe0,0x40,0xf7,0xac,0x6e,0x35,0x93,0x78,0x9b,0xdf,0x8b,0xeb,0xd9,0x9f,0x62,
+  0x23,0x70,0x00,0x66,0xee,0x50,0x51,0x60,0xaf,0xf2,0xea,0x54,0x71,0xca,0x7b,0x7f,
+  0xb4,0x3f,0x0f,0xf0,0xda,0x51,0x9f,0xce,0x96,0x40,0xa7,0x14,0xed,0xb3,0xdf,0x97,
+  0x51,0xb4,0xd8,0x4b,0xe0,0xc1,0x78,0xfc,0x05,0x35,0x56,0x78,0xcc,0xb1,0x3f,0x29,
+  0x69,0x32,0x3c,0x06,0xb3,0xcc,0xd6,0x36,0x36,0x24,0xde,0x5f,0xd9,0x7a,0x7f,0xbf,
+  0x68,0xb6,0xb6,0x5f,0xf5,0x0a,0x54,0xaa,0xd7,0xc5,0x8b,0xee,0x2a,0x1c,0xd0,0xec,
+  0xf5,0xd6,0xab,0x4e,0x85,0xdf,0xd0,0x6e,0xd2,0x3a,0x69,0x99,0xf1,0x63,0x14,0xe4,
+  0x35,0x32,0xbd,0xb6,0x0b,0x33,0xc5,0x6b,0x3a,0x2f,0x29,0x3f,0xe6,0x77,0x65,0x02,
+  0x6b,0xe4,0x63,0x8e,0xfd,0x51,0xa7,0x08,0x7b,0x0b,0xa8,0x96,0xd7,0xd9,0x79,0x8f,
+  0xbd,0x35,0x83,0xbb,0xe4,0xd3,0x91,0x37,0x95,0x15,0x06,0x0a,0x87,0x1d,0xfb,0x63,
+  0xe0,0xfe,0x75,0x91,0x2f,0xd4,0x03,0x43,0x8c,0xb6,0x2d,0xda,0xbf,0xfe,0xe4,0x90,
+  0x46,0xfb,0x57,0xf1,0x58,0xe7,0xa5,0xaa,0xff,0xe6,0x73,0x32,0x81,0x0b,0xf2,0xa0,
+  0xf3,0xfe,0xf6,0xa2,0xfd,0x79,0x0c,0x66,0x2e,0x9f,0xd9,0xc6,0x06,0xbb,0xf6,0xe6,
+  0xda,0x1f,0xf6,0x4a,0xd5,0xda,0x78,0x15,0xf7,0xb5,0x87,0xdf,0x72,0xec,0x8f,0x06,
+  0x34,0x7e,0x96,0x11,0x6a,0x63,0x2f,0x40,0x76,0xbc,0xb0,0x60,0x66,0x51,0x3b,0xbb,
+  0x00,0xeb,0x40,0xef,0x57,0xef,0x62,0xa6,0xf3,0xbe,0xc7,0xd1,0xfe,0xe0,0xea,0xd2,
+  0x71,0x99,0x3d,0x65,0xec,0xf6,0xda,0x9f,0x48,0x3a,0xfc,0x9c,0xce,0x41,0xa7,0x1d,
+  0xf0,0x45,0xc5,0x5e,0x9f,0xbd,0xb8,0xdf,0x9d,0x25,0x6b,0x99,0xb4,0xa7,0x99,0x96,
+  0x85,0x06,0xcc,0xe2,0x51,0xf9,0x22,0xbc,0x0c,0xbb,0xcc,0xc0,0xa8,0xec,0x3e,0x0f,
+  0x87,0xd3,0xb4,0x5a,0x8e,0x93,0x7e,0xb8,0x57,0x3f,0x83,0x24,0xa8,0x67,0x0d,0x71,
+  0x25,0xe3,0xda,0x13,0xed,0x02,0x5c,0x84,0xc6,0x78,0xc9,0xa0,0xfc,0x0a,0x3c,0xef,
+  0xb5,0xe7,0xd1,0x51,0xb9,0x1e,0x2e,0x9a,0x0b,0x8d,0xdb,0xda,0xcb,0xa1,0xc5,0x1e,
+  0xdf,0xa1,0xac,0xa6,0xd5,0x5e,0xa1,0x7e,0x97,0x9d,0xe4,0xee,0xfe,0x25,0x45,0xdb,
+  0x8b,0xd3,0xbe,0x28,0xec,0x33,0x6a,0xe3,0xb8,0x35,0xa7,0xda,0x6c,0xfb,0xc3,0x71,
+  0xbf,0xdb,0xcf,0x6b,0x0d,0x5f,0x4f,0xd9,0x69,0x77,0xbf,0xfb,0x17,0xa8,0x3d,0x86,
+  0xc3,0xa2,0xf0,0xa8,0x52,0x9b,0xf1,0xa5,0x0b,0x75,0x67,0xfd,0xa8,0x4a,0x00,0xf5,
+  0x83,0x6f,0x93,0xd6,0x64,0xb2,0x1c,0xfb,0x5c,0x14,0x5b,0x46,0x5f,0x45,0x39,0x1a,
+  0xea,0x84,0x64,0xaf,0x07,0x5e,0xbc,0x5a,0x58,0x8f,0x12,0xd2,0xcf,0x06,0xef,0x7a,
+  0x58,0x32,0x5a,0x5d,0x8f,0xef,0x57,0x03,0x6d,0xdc,0xc0,0xec,0xe7,0x49,0x4d,0x11,
+  0xf3,0x85,0xe0,0xa0,0x3c,0x9a,0xb3,0xbf,0xf3,0x92,0x51,0xf6,0x8a,0x7a,0x41,0x5c,
+  0xa9,0x1e,0x61,0x0e,0xde,0x10,0xf8,0x67,0x61,0xaa,0xd8,0x82,0x3d,0xb8,0x7e,0xde,
+  0x23,0x01,0xd5,0x12,0x7d,0x4f,0xae,0x83,0x57,0x3a,0xae,0xd7,0xef,0x3b,0x2a,0x8f,
+  0xca,0xb9,0xf8,0xa7,0x36,0xe5,0xc0,0x1e,0x4b,0x80,0x92,0xf6,0xc0,0x59,0xc4,0x1b,
+  0xdd,0x3c,0x5c,0xd5,0x9a,0x40,0x8b,0x64,0xaf,0x07,0x0b,0xff,0x44,0x79,0x91,0x03,
+  0x7b,0x66,0xa3,0xf0,0xa0,0x1e,0x6d,0xc1,0x2b,0x35,0x15,0x49,0x16,0x96,0xd4,0x3a,
+  0x76,0x32,0x0f,0xff,0xe0,0x6b,0x6b,0xc3,0x06,0x5b,0x68,0xef,0x4e,0xb3,0x2f,0xa0,
+  0x06,0x56,0x80,0xca,0xd9,0xa8,0xb3,0x1e,0x0c,0x0b,0xff,0xe8,0xc5,0xe9,0x6a,0x7b,
+  0xfd,0x88,0xf1,0x0d,0xf1,0xe2,0x98,0x2c,0xc3,0xcb,0xe6,0xbc,0x8f,0x04,0x52,0xf2,
+  0x60,0x1e,0xfe,0x69,0xec,0xc5,0x33,0xc0,0xd7,0x2c,0xfd,0xa4,0xb3,0xeb,0xe1,0xfe,
+  0x51,0x79,0x0f,0x7c,0x7d,0xd1,0x47,0xab,0x8a,0xdf,0x93,0xd6,0xe4,0xe3,0x9f,0x64,
+  0x20,0xed,0xae,0xcf,0xa8,0x78,0x43,0x03,0xe9,0x9f,0xfe,0x0a,0xed,0xf9,0x0c,0x76,
+  0xdf,0x1e,0x7f,0x2e,0xfe,0xa1,0xe7,0x57,0x9d,0xe7,0x27,0xd8,0xf3,0x04,0x6a,0x60,
+  0xca,0x28,0x7b,0x47,0xd9,0xdd,0x16,0x5d,0xa3,0xee,0x6b,0xaa,0xcb,0xc7,0x3f,0xc6,
+  0x75,0x8e,0x7e,0x62,0xbe,0x00,0xec,0x56,0xa2,0xf1,0xd6,0x58,0xd8,0x44,0xc4,0xb8,
+  0x1a,0x70,0x87,0x5a,0xe3,0xac,0x1f,0x9d,0xf0,0x4f,0x62,0x96,0x2e,0x65,0x61,0x00,
+  0xe1,0x01,0xbc,0xc2,0x67,0x9d,0x2c,0xfa,0x2a,0xfb,0x99,0x8e,0x82,0x5e,0xb4,0x26,
+  0x91,0x8f,0x7f,0xbe,0x66,0x14,0x5b,0xb0,0x47,0xe0,0x1f,0x81,0x88,0x5a,0xd4,0xd9,
+  0x9d,0x7d,0x37,0xff,0xb4,0xac,0xde,0x98,0x94,0x96,0x97,0xd9,0xcb,0x0d,0x8c,0xe2,
+  0x83,0xf0,0x0d,0xf8,0x86,0x51,0x62,0xbf,0x26,0xf6,0xfa,0x79,0x3a,0xf8,0xfe,0x53,
+  0xb8,0x7a,0xa0,0xb1,0x65,0xea,0xbb,0xd5,0x49,0x47,0xff,0x36,0xfe,0x09,0x7a,0xf4,
+  0x93,0xbd,0xf2,0x38,0xda,0xff,0xff,0x4d,0x86,0x7a,0x9f,0x3c,0x83,0xe5,0xe1,0x1f,
+  0x70,0xcc,0x8e,0xff,0xab,0xb6,0x50,0x97,0xa8,0x10,0x5f,0x45,0xda,0x0b,0xcb,0x1c,
+  0xfd,0x67,0xf1,0x4f,0xfc,0x5a,0x67,0xbe,0xff,0xdb,0x12,0xe2,0x34,0xf1,0x2a,0x9c,
+  0x6f,0x26,0x34,0xc6,0x62,0x9a,0xad,0x7f,0xc4,0x3f,0x0a,0xaa,0xb1,0xdc,0xef,0xea,
+  0xd3,0x12,0x4e,0xa2,0x50,0x92,0xdc,0xbd,0x62,0xf5,0x40,0xd1,0x5c,0xc4,0x57,0x79,
+  0xf8,0xa7,0xc7,0x8f,0xb0,0x47,0x3d,0x80,0x68,0x27,0x8b,0x7f,0x1a,0x93,0xc1,0x94,
+  0x7f,0x01,0x1c,0x32,0x1b,0xf7,0x7f,0xea,0xad,0x5b,0x17,0x38,0xf3,0xb5,0xf1,0x8f,
+  0x03,0x7b,0x6c,0x41,0x21,0x41,0x19,0xbb,0xa3,0x01,0x4a,0xd6,0xc9,0x27,0x1c,0xfb,
+  0x93,0xc5,0x3f,0x1e,0x18,0x90,0x15,0x5a,0xee,0x2f,0x93,0x57,0x8a,0x2b,0x4b,0x10,
+  0xff,0x28,0x39,0xf8,0x07,0xcf,0x0b,0xce,0xb6,0x6b,0x0b,0x71,0xff,0x96,0xf0,0x74,
+  0x65,0x3f,0xcc,0x5f,0xa5,0x6e,0xc6,0xf7,0x2b,0x0f,0xff,0x98,0x7e,0x44,0x3b,0xf6,
+  0xf8,0x95,0xb6,0x50,0xd3,0xf6,0x44,0xbc,0x30,0x1e,0x7a,0xac,0x69,0x3c,0xfe,0xf1,
+  0x6b,0x61,0x0b,0x06,0xf8,0xcb,0x2c,0x3c,0xd0,0x7a,0x6d,0x1d,0xa3,0xaf,0x66,0x20,
+  0x34,0x42,0x3c,0x60,0xaf,0x87,0x2c,0xfe,0x71,0xe7,0xfb,0x3c,0xe2,0x0d,0x31,0xcd,
+  0x20,0xaf,0xd6,0x55,0xba,0x12,0x58,0x5b,0xfd,0x8e,0x64,0xaf,0x4f,0x0b,0xff,0x34,
+  0xe6,0xc0,0x1e,0x14,0x58,0xe3,0xcd,0xc1,0x07,0xfc,0x67,0xd0,0x34,0xdd,0x68,0xcc,
+  0x6a,0x93,0x4f,0x39,0xef,0x63,0xa8,0x60,0xbc,0x7e,0x48,0x2d,0x8d,0xb7,0x28,0x27,
+  0x3a,0x69,0xfc,0x6c,0xa3,0xf8,0x05,0xf9,0x88,0xe6,0xc5,0x3f,0xfb,0xc8,0x3e,0x64,
+  0x61,0x0f,0xe1,0x1f,0x1d,0xf6,0x29,0xb5,0x49,0xb5,0x0b,0xe8,0x4a,0x18,0xed,0x43,
+  0xd9,0x73,0x8e,0x7e,0xb2,0xf8,0x27,0x0b,0xf3,0x48,0xa8,0xa0,0x69,0x46,0xa2,0xc6,
+  0xf2,0x18,0xeb,0x47,0x7d,0xae,0x34,0xae,0xd5,0xf2,0xf0,0x0f,0x6a,0xaf,0xd5,0xab,
+  0xff,0x1a,0xd5,0xc2,0x3f,0xe1,0x61,0x7d,0xbf,0x3a,0xdd,0xf0,0x6f,0x61,0x47,0x9c,
+  0xf5,0x80,0xf8,0x87,0x1e,0x3b,0x1e,0xb4,0xc6,0x3b,0xcf,0xdf,0xd0,0x16,0x4d,0x36,
+  0xfd,0x12,0xce,0xb6,0xcd,0x5b,0xbd,0x34,0x29,0x8f,0x38,0xf3,0x25,0xfc,0x63,0x8d,
+  0xb7,0xe7,0xab,0xf9,0xb7,0x2b,0xb6,0x06,0xf8,0x59,0xe5,0x40,0x5c,0x4d,0x2e,0x3a,
+  0xe6,0xac,0xff,0x2c,0xfe,0xc9,0x59,0x6f,0x74,0x65,0x3e,0x22,0xd2,0xa7,0x5e,0x57,
+  0x46,0x8c,0xa9,0x50,0xbc,0x4e,0xbe,0xd7,0x39,0xff,0x0a,0xfc,0xe3,0xc2,0x1e,0x21,
+  0x58,0x57,0xd4,0x0c,0x5e,0x59,0xa7,0xce,0x4c,0x15,0x9f,0x66,0x3e,0x67,0x3d,0x44,
+  0x2c,0xfb,0x63,0x7a,0xdf,0x97,0x8d,0x28,0x44,0x32,0x68,0x9f,0x9f,0x03,0x39,0x1e,
+  0x7d,0xaf,0x5b,0x67,0xcf,0xe4,0xe0,0x9f,0x1c,0xd8,0x80,0xe3,0xf1,0x8a,0x36,0xd3,
+  0x28,0x6a,0xbf,0xea,0x35,0x79,0x9d,0x34,0x8b,0x15,0x1d,0x6f,0x5a,0xa5,0xd8,0xf7,
+  0x27,0xfc,0xf3,0x5b,0x44,0x23,0x41,0x82,0x3d,0x59,0x81,0xde,0xe8,0xf9,0xf1,0xe2,
+  0x35,0xcd,0xaf,0xc2,0x1b,0xb8,0xf5,0x2c,0x59,0xd5,0xfc,0x96,0xfd,0xf8,0x36,0xfe,
+  0xf1,0xc0,0x9e,0x74,0xf3,0x69,0xb4,0x3f,0x62,0x07,0x3c,0x8e,0xd0,0xb7,0x04,0x82,
+  0xba,0x9c,0x70,0xcf,0xbf,0x05,0x36,0xec,0x29,0xbf,0xa4,0x5a,0x82,0xfc,0x75,0xbc,
+  0xf2,0x8d,0x4c,0xf1,0x3f,0xfa,0x51,0x78,0xa0,0x51,0x5f,0x32,0x82,0xab,0xd9,0x8b,
+  0x7f,0xe8,0xb1,0x6f,0x6d,0x87,0xec,0xf3,0xdf,0xc5,0xc4,0x8c,0x8e,0x91,0xd0,0xf5,
+  0x78,0xc5,0x4c,0x35,0x62,0xb0,0xef,0x3b,0xfa,0x07,0xd8,0x92,0x37,0xdf,0x76,0xf6,
+  0x59,0x21,0x3c,0xd3,0xce,0x2a,0xa4,0xc7,0xb5,0xbf,0x83,0xd0,0xed,0x09,0x70,0xec,
+  0xbf,0x5e,0x61,0x59,0x1b,0xd9,0xa3,0xcf,0x00,0xda,0xff,0x9a,0xcc,0xb5,0x10,0x5e,
+  0xa2,0xa7,0x97,0x47,0x43,0xb8,0x35,0x74,0x2b,0xf6,0xfa,0x24,0xfc,0x83,0xa7,0xc5,
+  0xc3,0x7e,0x8f,0xfd,0x5c,0x8d,0xf3,0xa5,0x8d,0x4f,0xae,0xe5,0xe7,0x79,0x83,0xb4,
+  0x64,0x87,0xfc,0xf1,0x1c,0xfc,0x93,0xa7,0x1f,0xfb,0xbc,0xbf,0x07,0x81,0x13,0x9e,
+  0xd7,0x34,0xb1,0x54,0x6c,0x7b,0x22,0x69,0x96,0x19,0x0f,0x38,0xf6,0xdc,0xda,0xef,
+  0xe6,0xb4,0x20,0x2c,0xbc,0x00,0x97,0xa0,0x3c,0x15,0xcd,0x74,0xe6,0xe2,0x1f,0xda,
+  0xb6,0x7c,0x79,0xfb,0xef,0x36,0x43,0xdd,0x17,0x3e,0x65,0xa4,0xb9,0x5e,0x16,0xd8,
+  0x9a,0x87,0x7f,0x68,0x98,0x9a,0x37,0x7e,0xba,0xa9,0x6e,0x27,0xc1,0x9c,0x51,0x04,
+  0x29,0x7c,0x43,0xed,0xf5,0x40,0xf8,0x67,0x37,0xdd,0x3f,0xd7,0x3e,0x2b,0xba,0x19,
+  0xd1,0x0b,0x8f,0x4b,0x07,0x20,0x02,0xaa,0xee,0xc1,0x3f,0x80,0xf8,0x87,0xa6,0x19,
+  0xc8,0x99,0xef,0x13,0x50,0x47,0x88,0x71,0x18,0xe7,0xbb,0x00,0x50,0x00,0xc7,0xfe,
+  0x10,0xfe,0xc9,0x39,0xb6,0xbb,0x82,0x29,0x9f,0x81,0x0b,0xd2,0xf5,0x90,0x68,0x2f,
+  0x7f,0xd3,0x79,0x1f,0xcd,0xb5,0x88,0x9f,0x93,0x73,0x38,0xe2,0x9f,0x0b,0xae,0xff,
+  0x07,0x85,0xe3,0x81,0x56,0x7f,0x19,0x5c,0xe0,0xb3,0xf9,0xfa,0x21,0xb9,0xdd,0xb1,
+  0x0f,0x26,0xe2,0x9f,0x03,0x7a,0x75,0xbb,0xba,0x0f,0xf1,0xb6,0xe5,0xff,0x91,0x09,
+  0x08,0xcd,0x1a,0x54,0x77,0x25,0x66,0xc0,0x01,0x1e,0xde,0xac,0xf6,0x94,0xe9,0x0e,
+  0x9e,0x1f,0x80,0x8d,0xea,0x4e,0x08,0x27,0xaf,0x8e,0x95,0x1d,0xd7,0x1e,0xf4,0xbc,
+  0x68,0xcf,0x46,0x74,0x1c,0x75,0x00,0x74,0x8e,0xe7,0xd9,0x15,0x05,0xf6,0xfa,0x31,
+  0x11,0xcf,0xec,0x24,0xff,0x12,0xa9,0x31,0x8b,0x27,0x77,0x58,0x1a,0x9e,0x4f,0x2f,
+  0x72,0xdb,0x36,0xde,0xb3,0xb3,0xc9,0xfe,0xb5,0xc0,0xf2,0xff,0x98,0x73,0x32,0xc5,
+  0xa4,0x96,0x97,0x6d,0xfc,0x23,0x34,0xf6,0x43,0xb9,0xc6,0x78,0x0f,0xea,0x52,0x33,
+  0x43,0xcd,0x46,0x8b,0x17,0xff,0x5c,0x82,0x27,0x5b,0x26,0xd0,0xcf,0xa8,0x3c,0xa6,
+  0x5f,0x82,0x85,0xfd,0xc1,0x21,0x8f,0xff,0xa7,0x85,0xf0,0x8f,0x5a,0x37,0x30,0x33,
+  0x8d,0x6f,0x5f,0xce,0xc2,0xc3,0x5f,0x64,0x3b,0xbc,0x65,0x34,0x0c,0xe0,0xf9,0x74,
+  0xd0,0x59,0xff,0x43,0xb4,0x1e,0x54,0x7d,0x55,0x6f,0x1a,0x4f,0x07,0x9e,0xf5,0x30,
+  0x0b,0xf1,0x3f,0x3e,0x3f,0x9e,0xc8,0x86,0xd4,0x3d,0x89,0xf7,0x72,0xf0,0xcf,0x4e,
+  0xae,0xb7,0xf5,0xe6,0xed,0xd7,0x38,0x5f,0x9d,0x35,0x2b,0x5b,0x33,0xab,0x93,0xbe,
+  0xc9,0x6c,0xd4,0xb1,0xe7,0x69,0xc2,0x3f,0x5c,0x1f,0x56,0x3d,0xf8,0xc7,0x12,0x5a,
+  0xcf,0x5e,0x73,0xb7,0xbe,0x96,0xcf,0x9c,0xa6,0x2e,0xc7,0xa3,0x99,0x3d,0x1e,0xf1,
+  0x0f,0x1e,0x33,0x63,0x46,0x00,0xf1,0x4f,0x05,0x02,0x21,0xcb,0xff,0xf3,0x3e,0x34,
+  0xf4,0x93,0xff,0x27,0xf0,0x0b,0xb5,0xbe,0xab,0x50,0xc3,0xfd,0xda,0x1e,0x6f,0x4c,
+  0x39,0xd8,0x7a,0x59,0x6b,0xcc,0x20,0xfe,0xb9,0x9c,0xab,0x9f,0xa5,0xa3,0x72,0x0c,
+  0x2e,0xc0,0x47,0x95,0x92,0x9f,0xc8,0x83,0x15,0xb6,0x7e,0x22,0x0a,0xbd,0xbf,0x75,
+  0xad,0xa8,0x8d,0x77,0xb8,0xd7,0x3f,0x76,0x04,0x85,0x47,0xb4,0x3e,0xa8,0x83,0xc9,
+  0xb4,0xbf,0xdb,0xfa,0x19,0xd0,0xc8,0x9e,0x54,0xf5,0x47,0xda,0xf1,0x2c,0xea,0xf5,
+  0xff,0x0c,0xc8,0xa3,0x4c,0x63,0x6b,0xa1,0xca,0x88,0xb4,0xb1,0x13,0x8e,0x3d,0x37,
+  0x04,0xfe,0x89,0x93,0xbf,0xeb,0x39,0xf3,0x7b,0x9e,0xf9,0xbe,0xd9,0xb9,0xa6,0xf0,
+  0x67,0xd0,0xd5,0x17,0x59,0x11,0x5a,0xce,0x06,0x3c,0xfe,0x1f,0xb4,0xde,0x5c,0xff,
+  0x09,0x79,0x7b,0x94,0x9c,0xf3,0x85,0x3f,0x5a,0xb8,0x14,0xb8,0xf1,0xb7,0xf1,0xa2,
+  0x58,0xd9,0x4b,0xce,0xf3,0x10,0xfe,0xf9,0xa0,0x7b,0x77,0x32,0x40,0xb0,0xe7,0x2d,
+  0x17,0xff,0xa0,0x90,0xe9,0x3c,0x1b,0x3f,0x02,0x37,0x25,0x03,0xdb,0xe4,0x73,0xae,
+  0xff,0xca,0xc2,0x3f,0xea,0x38,0xfc,0x03,0xc1,0x84,0xbc,0x15,0xc6,0x94,0x47,0x58,
+  0x09,0x87,0x13,0xce,0xfa,0x41,0xfc,0xa3,0x9e,0x85,0x7d,0xed,0x81,0xbc,0xfd,0xbd,
+  0xde,0xc0,0x2b,0xd3,0xe1,0xec,0xc0,0x82,0x55,0xb7,0x3c,0xe0,0x39,0xbf,0x0b,0xfc,
+  0x23,0x85,0x97,0xa9,0xb9,0xf8,0x87,0xd5,0x12,0x2c,0xf9,0x18,0x1e,0xb5,0xc2,0xf1,
+  0x49,0x3d,0x89,0x91,0x1c,0xfc,0xf3,0x84,0xf1,0xfd,0x3e,0xef,0xf8,0x95,0x59,0x7f,
+  0x05,0xab,0x69,0xd9,0x0f,0xbe,0x26,0x9f,0xd7,0xff,0x13,0x50,0xba,0xf0,0xdb,0x48,
+  0xab,0x8a,0x78,0x80,0xcf,0xf6,0x00,0x83,0x56,0x35,0x59,0xd8,0x82,0x5f,0xe9,0xad,
+  0x1f,0xd7,0xd8,0xb1,0x02,0x5b,0xff,0x63,0x88,0x7f,0x46,0xdb,0x16,0x20,0x7e,0xa7,
+  0x69,0x32,0x31,0xdf,0x38,0xc2,0x8c,0x86,0xca,0xc0,0x5a,0x39,0x82,0x57,0x16,0x54,
+  0x94,0x70,0xf9,0x03,0xd9,0xb6,0x3f,0x1b,0x11,0xff,0x5c,0x84,0xbd,0x37,0xd3,0x6e,
+  0x9e,0xe3,0xdf,0x68,0x09,0x0e,0xfa,0x37,0x6b,0x78,0x34,0x43,0x41,0x3e,0x99,0x83,
+  0x7f,0x2e,0x6a,0x73,0xe2,0xa4,0x1f,0xdd,0x3b,0x7e,0x99,0xb2,0x19,0xed,0xd5,0xcf,
+  0xa1,0xf1,0xd6,0xe2,0x41,0xf9,0x54,0x81,0xad,0x4f,0xc2,0x3f,0xbb,0x52,0x61,0xad,
+  0x9b,0x97,0x39,0xf8,0x47,0x08,0x21,0x95,0x8e,0x5d,0xf7,0xb2,0x5a,0x0d,0xcf,0x47,
+  0x47,0x1c,0x3c,0xd9,0x8a,0xf8,0x07,0xe7,0xdb,0xd6,0xad,0x35,0xe5,0x01,0x21,0x9f,
+  0x86,0x88,0x11,0x8f,0xa2,0x4d,0x7e,0xad,0xf0,0x84,0x64,0xeb,0xbf,0x47,0xe0,0x9f,
+  0xef,0x9b,0x79,0xfa,0xc7,0xf1,0xdf,0x4f,0x86,0x7f,0x09,0x8f,0xd6,0xd4,0xb6,0xf9,
+  0x36,0x15,0x9e,0x72,0xf1,0x4f,0xc5,0x76,0x78,0xb7,0x6d,0x81,0x11,0x4d,0x96,0x0f,
+  0x6b,0x39,0x40,0xae,0x64,0x73,0xe7,0x1b,0x80,0xe7,0xf1,0x36,0xbc,0x32,0xe2,0xec,
+  0xbf,0xab,0x00,0xd1,0x0e,0x9f,0x3b,0x1e,0x0f,0x1b,0x9f,0xda,0x82,0xc2,0x8b,0xd0,
+  0xb0,0xa8,0xb8,0x47,0x3e,0x91,0x8b,0x7f,0xe2,0xbb,0xd4,0x68,0xee,0x7a,0x2b,0x40,
+  0xd8,0xd9,0x55,0x8d,0xc2,0xed,0x0d,0x5a,0x34,0x21,0x1f,0xb6,0x7f,0x2e,0x7c,0x1f,
+  0x23,0x08,0xda,0xab,0x93,0xdd,0x1e,0xfc,0x23,0x84,0x0e,0x2d,0xc5,0x5e,0x36,0x0e,
+  0x0d,0xce,0xec,0x86,0x93,0xec,0x98,0x8b,0x7f,0x14,0xc4,0x3f,0x49,0x3d,0x2e,0xde,
+  0x97,0x1c,0x20,0xd4,0x8d,0x16,0x1b,0xe6,0x40,0x74,0xa8,0xbb,0x3e,0xfc,0x8c,0xb3,
+  0xde,0x74,0xf8,0x2c,0xec,0x01,0xbd,0xa9,0xdb,0x83,0x07,0x84,0x70,0x5c,0xbd,0x8b,
+  0xbd,0xa2,0xef,0x91,0xa2,0xa6,0xda,0x56,0x97,0x71,0xf6,0xf7,0x48,0xf7,0xe7,0x10,
+  0xf6,0xcc,0xce,0x44,0xd7,0x7c,0xfe,0x55,0x2f,0x10,0xaa,0x1f,0x56,0xbf,0xda,0x29,
+  0xae,0xdc,0x19,0x68,0x95,0x4f,0x86,0x1d,0xbc,0x8a,0xf8,0x67,0x6c,0x82,0xfd,0xbd,
+  0x61,0x60,0x16,0x09,0xf8,0x15,0xfe,0x22,0x38,0x5f,0x5b,0x3f,0x46,0xc1,0x25,0xe3,
+  0x32,0x9f,0x1d,0x0f,0x9c,0x6d,0xb6,0x81,0x50,0xf6,0x20,0x1f,0x18,0x2b,0x9f,0x0a,
+  0xcf,0xf1,0x39,0x7a,0x60,0x44,0x1e,0xd4,0xed,0xdf,0xf7,0xfb,0xd2,0x16,0x38,0x18,
+  0xda,0xaa,0x14,0xdf,0xd5,0x94,0xfb,0xfc,0x66,0x09,0x09,0x5d,0x50,0x6d,0x14,0x1b,
+  0xec,0x24,0xb3,0xc7,0x23,0xfe,0xd1,0xd0,0x5e,0x99,0x45,0xe3,0xc6,0xab,0xed,0x89,
+  0x36,0x58,0x07,0x33,0x5b,0x7c,0x71,0x7c,0xbf,0xec,0xf1,0xe4,0xff,0xd9,0x67,0xa4,
+  0x56,0x7d,0x72,0x9c,0x3d,0xf7,0x2f,0x40,0x81,0xbf,0x50,0xfb,0x95,0x5b,0x81,0xbd,
+  0xe8,0x8c,0xef,0xa5,0xfd,0x8b,0xd7,0xdd,0xbd,0x36,0x5d,0x7e,0x5a,0xf1,0xcc,0x17,
+  0x11,0xcb,0x19,0x39,0xaa,0x3f,0xd3,0xd7,0x30,0x5a,0x3b,0x5f,0x7e,0xc7,0x79,0x5f,
+  0xb8,0x84,0xfa,0x51,0xeb,0xdb,0x96,0xe6,0xeb,0xc7,0x2c,0x21,0xe1,0x9c,0x5a,0xd7,
+  0x2c,0x1d,0xc4,0x15,0x62,0xeb,0x47,0xd2,0xf0,0xbc,0x9f,0x9a,0x63,0xd4,0xa2,0x19,
+  0x17,0xd1,0x0d,0xc7,0x9e,0x17,0x8f,0xca,0x97,0x74,0x14,0x0c,0xe5,0xb0,0x1c,0x71,
+  0xec,0x0f,0xe1,0x9f,0x83,0x99,0x70,0x7b,0x16,0xff,0x34,0xd0,0xfe,0x65,0x23,0xa2,
+  0xb2,0x5f,0xe8,0xfb,0x78,0x6d,0xdc,0xd7,0x13,0x8e,0x18,0x2e,0xfe,0x21,0x7f,0x51,
+  0x38,0x2e,0xc6,0xdf,0xe4,0x8d,0x77,0x14,0xa5,0xcb,0x4e,0x27,0x0f,0xf0,0x5a,0xfd,
+  0x96,0x3d,0xe1,0x5c,0xfc,0xb3,0x0b,0x52,0xc6,0x7c,0x54,0x8b,0x96,0xd5,0x8f,0x85,
+  0xc0,0x05,0x22,0xda,0x45,0x2f,0x66,0x8c,0x31,0x17,0xff,0x40,0x14,0x0f,0x59,0x75,
+  0x46,0xad,0x35,0xcd,0x05,0xf6,0x7c,0x17,0xd2,0xf3,0x67,0xc8,0x50,0x1b,0x25,0x29,
+  0x59,0x9f,0x64,0xdb,0x9f,0x6d,0x57,0x8b,0xd9,0x19,0xc1,0xd1,0x6a,0x12,0xc4,0x7c,
+  0xbf,0x66,0x6f,0x64,0xa3,0xf0,0x01,0xa3,0xaf,0xe4,0x91,0x42,0x07,0xcf,0x54,0x8a,
+  0xd5,0x62,0x16,0x8f,0x55,0x3b,0xeb,0x67,0xd4,0x78,0x15,0x66,0xa7,0x82,0xef,0xc9,
+  0xff,0x99,0x7a,0x96,0x5f,0x1f,0x0f,0x0c,0x94,0xb7,0x97,0x39,0xfa,0x0f,0x09,0xb7,
+  0xcf,0x19,0xd5,0xf5,0xff,0x34,0x65,0x10,0x08,0x85,0x33,0xea,0x16,0x58,0x08,0xeb,
+  0xd7,0x86,0xe3,0x03,0x3d,0x65,0x31,0x67,0xfd,0x64,0xfd,0x3f,0xe6,0xd5,0x9e,0xf5,
+  0x70,0x18,0xbe,0x03,0xdb,0x4c,0xff,0xec,0xf0,0x46,0xfe,0x28,0xd4,0x18,0x3e,0x58,
+  0x7c,0xb7,0x33,0x5f,0xb3,0x60,0x47,0x20,0x1f,0x4f,0x9e,0x44,0x20,0x14,0x36,0xbb,
+  0x93,0xcb,0x02,0xf0,0xa8,0x16,0x5e,0xee,0xeb,0x61,0x31,0x67,0xfd,0x80,0xf0,0x3f,
+  0xcc,0x34,0x8b,0x3d,0xeb,0xe1,0x1d,0x18,0x6a,0x8d,0xb5,0x06,0xb7,0x21,0x1e,0xee,
+  0x83,0x8a,0xf6,0xda,0xcd,0x92,0x61,0xd8,0xe3,0xb3,0xfe,0x9f,0x3e,0x0f,0xec,0x29,
+  0x1f,0x83,0x8b,0x46,0xe3,0x48,0x30,0x8e,0x77,0x40,0x7b,0x1b,0xff,0xe6,0x20,0x6a,
+  0xc0,0x1e,0x6f,0x80,0x38,0x8f,0x0c,0x08,0xb5,0x3b,0xfb,0xfb,0x80,0xd1,0x30,0x58,
+  0xbc,0xbd,0x39,0x4a,0xf6,0xea,0xcf,0x4a,0xf6,0x74,0xfe,0xdc,0x79,0x1e,0xcb,0xff,
+  0x33,0xeb,0x27,0x5e,0xff,0xd5,0x08,0x74,0xd0,0x8c,0x1e,0x66,0xf5,0xe4,0x51,0x6f,
+  0x53,0xeb,0x13,0xe7,0x9c,0x5f,0xd7,0x54,0xc4,0xaf,0x3f,0x28,0x5e,0x13,0x2b,0xfe,
+  0x55,0x78,0x1a,0x12,0x14,0xaf,0xa9,0x29,0x0b,0x50,0xc4,0xb0,0xcd,0xaf,0x14,0xba,
+  0xf8,0x27,0xae,0x7d,0x2e,0x17,0xf6,0xf8,0xd7,0x4c,0x7f,0x15,0xee,0xe1,0xb3,0x86,
+  0x23,0xad,0x6c,0x2a,0xac,0xe5,0x5f,0xcc,0x14,0xb5,0xb2,0x33,0xce,0xfd,0x5b,0xd5,
+  0x25,0xc6,0xfb,0x5a,0x36,0xec,0x95,0x8d,0x7f,0x8d,0xe0,0x2f,0x50,0xdf,0x5f,0x5c,
+  0x35,0x29,0x60,0xfc,0x04,0xea,0x9b,0x82,0x65,0x68,0x6f,0xed,0x8f,0x51,0x79,0x50,
+  0xbb,0xac,0xe4,0xc1,0x42,0x03,0x11,0x51,0x7f,0xd0,0x28,0xbf,0x80,0xfb,0xd7,0x37,
+  0xcc,0xfb,0x46,0x3d,0x78,0x4f,0x2d,0x18,0x7f,0x1e,0xf9,0xba,0xfa,0x16,0xa4,0xcd,
+  0x40,0x6a,0xd2,0x69,0x78,0x9f,0xd7,0xe1,0xd6,0xf6,0x31,0x17,0xff,0xb4,0x5e,0x4d,
+  0xf8,0xe7,0xc6,0x9c,0xf3,0xd4,0x2b,0x68,0x46,0xaa,0x4c,0x35,0xce,0x5e,0xe9,0xdb,
+  0x0b,0x5b,0xcd,0x5b,0xda,0x96,0xbd,0xe7,0xac,0x1f,0x1d,0xa6,0xe6,0xcf,0x97,0xdd,
+  0x06,0xdb,0x78,0xf5,0x68,0x64,0x15,0x7b,0xd5,0x78,0x8c,0x5f,0x17,0xbf,0x66,0x4d,
+  0x99,0xeb,0x7f,0x5e,0xa5,0xd0,0x6b,0x15,0xf1,0x9e,0x67,0xcb,0x06,0x8c,0xce,0x6e,
+  0x7d,0x54,0x9d,0x89,0x57,0x76,0x76,0x44,0xb9,0x6f,0x76,0xd3,0x09,0x4f,0xfc,0x2b,
+  0x8b,0x76,0x1c,0xd8,0x93,0x92,0xbf,0x0a,0xef,0x64,0xe6,0xa4,0xa3,0x99,0x66,0xbc,
+  0x92,0xba,0xa9,0xab,0xe4,0x57,0xf2,0xfb,0xee,0xf3,0x4b,0x56,0x3c,0xc2,0x83,0x7f,
+  0x70,0x7d,0x8e,0xc1,0x21,0x75,0x16,0xef,0xcc,0x28,0x63,0x4a,0x18,0x7e,0xc4,0x51,
+  0x9f,0x8e,0x7e,0x34,0x3a,0xef,0xd7,0xb7,0xd7,0x78,0xf7,0xbb,0xd0,0xbb,0x52,0x9d,
+  0x31,0x79,0x33,0x58,0xae,0x83,0xa5,0xdf,0x69,0x7e,0x2a,0x17,0xff,0x58,0xe8,0x85,
+  0xbe,0x75,0xf6,0xdf,0x94,0xf1,0x29,0x21,0x0c,0xd5,0xae,0xf4,0x6f,0xc1,0x15,0x65,
+  0x7f,0xe6,0x4b,0xe4,0xff,0xf9,0x12,0x81,0x9c,0x9c,0xfd,0x3a,0x6c,0xcc,0xb0,0x84,
+  0x2f,0x35,0xe1,0x0a,0x7c,0xce,0x19,0x1f,0xa9,0x50,0x60,0xa7,0x12,0x6d,0xf5,0x11,
+  0x0c,0xd8,0x9a,0xc5,0x03,0xc9,0x9d,0x7a,0xd8,0xf0,0x5d,0x53,0xd6,0xcf,0x77,0xb2,
+  0xd5,0x86,0x3f,0x54,0x76,0xd8,0xc1,0x9f,0xb6,0xff,0xa7,0x84,0xe6,0xbb,0xcf,0xda,
+  0x7f,0x5f,0x37,0xc6,0xd0,0x50,0xdd,0x8b,0xc2,0x92,0x31,0x2b,0xde,0x77,0xc9,0x59,
+  0x9f,0x3d,0x96,0x3f,0xa7,0xa5,0xd8,0x33,0xdf,0x33,0x2d,0x17,0xb5,0x46,0xa3,0xf8,
+  0x27,0x6c,0xd8,0xb8,0x08,0x0b,0x0d,0xc2,0x3f,0xce,0x79,0xaa,0xa7,0x80,0xf4,0xd3,
+  0x18,0xcf,0xc1,0x03,0xfa,0x59,0xb5,0xce,0x28,0x19,0xec,0x5c,0x89,0x50,0x6a,0xa7,
+  0x31,0x79,0xf0,0xf3,0x61,0xc7,0x5f,0x3d,0x3f,0x94,0xd1,0xc6,0xa0,0x56,0xf3,0xf8,
+  0x7f,0x96,0xbd,0x4e,0x6e,0x1f,0x09,0x61,0x4f,0x95,0xb1,0x4f,0x0a,0x83,0x9a,0x2a,
+  0x2b,0x71,0x7e,0xdf,0x56,0xc4,0x7b,0x3b,0xe9,0x25,0x72,0xfc,0x3f,0x28,0xa4,0xf0,
+  0x44,0x46,0x66,0xb6,0x45,0xdf,0x09,0xba,0x71,0x5d,0xd2,0x57,0x26,0xd9,0xfa,0x0f,
+  0x29,0x56,0xfc,0xcb,0xe3,0xff,0x09,0xbf,0x21,0xf4,0x49,0x78,0x12,0xf1,0x27,0x6b,
+  0xfa,0xb3,0x07,0xd8,0x74,0xe7,0xf7,0x22,0xff,0x0f,0x0d,0xf3,0x3e,0xff,0x1b,0xca,
+  0x59,0x3d,0xfd,0xf7,0x25,0x04,0x74,0xdf,0x85,0xba,0xb6,0xa2,0x64,0x73,0xc4,0xd9,
+  0x7f,0x5b,0x85,0xff,0x27,0x77,0xfc,0xb0,0xfa,0xae,0x70,0x04,0xd9,0xc0,0x29,0xd9,
+  0xe9,0x5d,0x3f,0x62,0xbd,0xb1,0x7c,0xbc,0x5d,0x67,0xc5,0xbf,0x86,0xa0,0x21,0xa6,
+  0x76,0xc9,0xc7,0x9c,0xf1,0x11,0x89,0xbc,0x3d,0xb3,0x78,0x49,0x1e,0xfe,0x09,0x73,
+  0x5f,0xa6,0x69,0x04,0xee,0x53,0x67,0xa6,0x8a,0x56,0x32,0x0f,0x5e,0xb2,0xfc,0x3f,
+  0xc9,0x7c,0x7f,0xa9,0x6e,0x16,0xc5,0xb6,0x1d,0x57,0x1e,0x84,0x95,0x99,0xa2,0x7a,
+  0xf6,0x94,0x33,0x9e,0x97,0x5a,0xfe,0x9f,0x6b,0x72,0xde,0xdf,0x27,0xa1,0xda,0x9c,
+  0xd1,0xc6,0x5e,0x4d,0x7e,0x1b,0x66,0x3e,0x55,0xd4,0xbe,0xce,0x34,0xec,0xf1,0xdd,
+  0x96,0xff,0x47,0xf7,0xfa,0x7f,0x5e,0xe5,0xbf,0xe5,0x3b,0x33,0x5f,0x5c,0x53,0x7e,
+  0x59,0xfd,0x6f,0xbe,0x30,0x1e,0x6d,0x95,0x9f,0xb2,0x1f,0x1f,0xed,0x89,0x15,0xff,
+  0x2a,0xf1,0xda,0x73,0x83,0x22,0xf8,0xa8,0xa8,0xd3,0xfa,0xdb,0xac,0xa1,0xaf,0x24,
+  0x07,0xff,0x28,0x87,0x10,0xff,0x34,0xa6,0xe4,0xb3,0x72,0x0e,0xfe,0xd9,0x8d,0xf8,
+  0x47,0xfe,0x3a,0xfc,0xe7,0x03,0x0b,0xe3,0x1b,0x07,0xca,0x07,0x5d,0x7f,0x75,0x68,
+  0x0b,0xfc,0x52,0xf3,0xfa,0x73,0xee,0x22,0x41,0xa9,0x32,0x8b,0xdb,0xd8,0xe4,0xd6,
+  0xc7,0xb4,0x99,0x6d,0xea,0x5d,0x4d,0x6f,0x39,0xf6,0x5f,0x33,0x08,0xff,0x78,0xfd,
+  0xd5,0x96,0x50,0x8d,0x30,0x8f,0x1c,0x41,0x65,0xb3,0x8c,0x22,0x83,0x0d,0x73,0x7b,
+  0x7c,0x5c,0xd9,0x48,0x66,0x1c,0x72,0xf4,0xc9,0x77,0xeb,0xfa,0x68,0x51,0x88,0x05,
+  0x60,0xb7,0x14,0x6d,0x2a,0x2a,0x4d,0x0c,0x76,0xd9,0xe3,0x2d,0xff,0x4f,0x94,0x7b,
+  0xfd,0x3f,0x17,0xe1,0xbc,0x51,0xf7,0x41,0x20,0xf6,0xe0,0xd7,0x94,0x73,0x1d,0x0d,
+  0xc6,0x7f,0x74,0xc9,0x27,0x9d,0xf1,0xdc,0xda,0x8f,0x06,0x27,0x8d,0xc3,0x3f,0x41,
+  0xf2,0x8f,0x9d,0x6b,0x6b,0xb8,0xe3,0xbe,0x2e,0x5c,0x48,0xce,0xfa,0xb4,0xfc,0x3f,
+  0xbc,0x38,0xe7,0xbc,0xff,0x3e,0xcc,0x31,0x03,0xfc,0xa6,0xaf,0xb1,0xe7,0x11,0x2a,
+  0x04,0xcc,0xe6,0x91,0x16,0x7b,0xfc,0x56,0x45,0xf8,0x73,0xd2,0x79,0xfe,0x1f,0xa6,
+  0x9b,0xbe,0x8d,0x89,0x28,0x6c,0x50,0xa3,0xf1,0xde,0x7b,0xd9,0x59,0xe7,0xf7,0xe5,
+  0x05,0x51,0x0d,0x87,0x6d,0x9e,0xc0,0xff,0xb3,0xaf,0x29,0x0a,0xdd,0x50,0x12,0x2f,
+  0xea,0x0e,0x67,0x9c,0xf5,0xa3,0xde,0x21,0xa2,0x1b,0x3c,0xcf,0xff,0x03,0xd3,0xfb,
+  0x7c,0x1c,0xf5,0xc3,0xa1,0x56,0xba,0x1a,0x3c,0xfe,0x67,0x6e,0xf9,0x7f,0x78,0x20,
+  0x6f,0xbe,0x8f,0x9b,0x4b,0x92,0x72,0x3d,0x31,0x2e,0xf0,0x45,0x28,0x77,0xef,0x9f,
+  0xaa,0xb4,0xa3,0x5d,0xb9,0xfe,0x8d,0x1b,0xcd,0x59,0xa6,0x75,0x05,0x4a,0xcc,0xe6,
+  0xcc,0x3a,0x07,0xff,0x14,0x08,0x6f,0x4f,0xa6,0xd8,0x72,0x1b,0xba,0xf8,0xf9,0x18,
+  0xfe,0xe1,0xd7,0xe1,0x79,0xfd,0xfa,0x4c,0x71,0x2b,0x02,0x27,0x27,0x3e,0xa5,0xbd,
+  0x03,0xcf,0xf0,0x68,0x9f,0xba,0x2f,0x5c,0xeb,0x89,0x7f,0xf1,0x59,0x83,0x25,0x67,
+  0x59,0x2d,0xdc,0x6f,0x86,0x53,0x6a,0xb7,0x1c,0x73,0xec,0xd5,0x00,0xe2,0x9f,0x07,
+  0x45,0x74,0x2f,0x67,0xbe,0x2c,0x40,0xc2,0x6a,0x78,0x58,0xdb,0x61,0x16,0x69,0xec,
+  0x6e,0x8f,0xff,0x67,0x07,0xa2,0x9d,0xa8,0x29,0xa2,0x87,0xde,0xf8,0x97,0x79,0x6d,
+  0x3a,0xbc,0x3a,0xfe,0x03,0x98,0x91,0x28,0xea,0x49,0xb8,0x7c,0x24,0x28,0x3d,0x2e,
+  0xdc,0x3e,0xc5,0xb1,0xf2,0xfc,0xf5,0x10,0x2b,0xbf,0x4d,0xec,0xf8,0xc5,0x01,0xd9,
+  0x30,0xbc,0xfe,0x9f,0x5f,0x5b,0xde,0x8c,0x0b,0xf8,0xda,0xe6,0xf0,0x7f,0xaa,0x0f,
+  0xc1,0x6b,0xec,0x06,0x5e,0x62,0xca,0x63,0x6e,0x7c,0x4d,0xdb,0x01,0x4f,0x48,0xf8,
+  0xd2,0xed,0x1c,0xb7,0xde,0x76,0x4d,0xfa,0x25,0xbc,0xcc,0xe7,0x2d,0x0f,0x6e,0x96,
+  0x2b,0x3d,0xf1,0xaf,0x99,0xb4,0x1e,0x06,0xd4,0x83,0xf2,0x8e,0x1c,0xff,0x4f,0x9f,
+  0xff,0x02,0x7b,0xc3,0xb8,0x1f,0xb6,0xa5,0x42,0x49,0xe6,0x8d,0x7f,0x7d,0xca,0x44,
+  0xb5,0x0c,0xf8,0xea,0xcd,0xdc,0x78,0x8d,0x25,0x3c,0x08,0xfa,0xa0,0xcf,0x07,0x31,
+  0xc7,0xbf,0x97,0x91,0xa6,0xf2,0x6f,0x93,0xb7,0x67,0x0d,0xfb,0x6e,0x0e,0x30,0x78,
+  0x03,0x85,0x4b,0xf0,0xe0,0xa6,0xaa,0xad,0xea,0x40,0x49,0xd4,0x59,0x0f,0xe4,0xff,
+  0x41,0xeb,0xd1,0x57,0x62,0xb9,0x7d,0xb2,0x40,0x48,0x20,0xa2,0xd9,0x89,0xe3,0xf0,
+  0x53,0x88,0xdd,0xeb,0xd3,0x3a,0x5d,0x52,0x9a,0x31,0xe5,0xe0,0x20,0xaa,0xa5,0x1f,
+  0xd5,0x72,0x30,0xc7,0xff,0xf3,0x54,0xf0,0x8c,0x3c,0xa4,0xfe,0x08,0x6e,0xe2,0xf7,
+  0xf5,0x79,0xf0,0x4f,0x6f,0xc1,0x3b,0x82,0xf6,0x93,0xbf,0x3e,0x1b,0x4e,0x6e,0xd9,
+  0x49,0x11,0x49,0x35,0xf6,0x2e,0x1a,0x6a,0x8f,0xff,0xa7,0x74,0x8b,0xa0,0x0d,0xa8,
+  0x79,0xf6,0x04,0x7f,0xf1,0xbb,0x51,0xd8,0x0d,0x55,0x09,0xd5,0x60,0xef,0x39,0xef,
+  0x6f,0x07,0x7c,0x57,0xd0,0x7e,0x22,0xf9,0xfe,0xae,0x11,0xf5,0xab,0x61,0xd4,0xc0,
+  0xae,0x1f,0xc4,0xaf,0xce,0xf5,0xff,0x1c,0x87,0x4e,0x66,0xb1,0x7d,0x72,0xf5,0xa9,
+  0x92,0x3f,0x7f,0xb7,0x12,0x49,0x21,0xfe,0xcc,0xf1,0xff,0xe0,0x69,0x98,0x48,0x3e,
+  0xf2,0x88,0x92,0x03,0x84,0x02,0x29,0x79,0x3f,0x1c,0x60,0x33,0x0e,0x16,0x0f,0x77,
+  0x9e,0x77,0xf1,0x8f,0xe5,0xff,0xd1,0x82,0x5d,0x62,0x1b,0x9a,0xea,0xe1,0xff,0x28,
+  0xf2,0xeb,0xf1,0x35,0xc6,0x74,0xed,0xbe,0x5c,0xfc,0x23,0x36,0xb5,0x95,0x1b,0xbf,
+  0x93,0x7f,0xde,0x0f,0x7e,0x47,0x5e,0x69,0x9c,0xe5,0xf3,0x06,0x96,0x6e,0x92,0xbd,
+  0xf8,0xe7,0xaf,0x68,0x3f,0x6d,0x57,0x93,0x89,0xdc,0xf8,0xd7,0x22,0xff,0x66,0xf6,
+  0x31,0xbe,0x73,0x53,0xb8,0xad,0x24,0xc9,0xdc,0xf7,0x3d,0x54,0x30,0x0d,0xf6,0xa3,
+  0x51,0xcd,0xf7,0x57,0xd8,0x8e,0x20,0x75,0x7a,0xd3,0xb5,0x49,0x9c,0xb8,0xbd,0xde,
+  0x5c,0xfe,0x0f,0xcb,0xf5,0x87,0xb4,0xfa,0xcb,0x16,0xe3,0x57,0xba,0x6e,0xf8,0x42,
+  0x1e,0xff,0x8f,0x85,0x7f,0xea,0x2b,0x27,0xe7,0xec,0xbf,0xe4,0xff,0xb9,0x3f,0x55,
+  0x4e,0x5f,0xcd,0x13,0xf8,0xc7,0x39,0x7f,0xf5,0x4c,0xe9,0x87,0xb3,0xd2,0x44,0xf1,
+  0xbe,0x2c,0xff,0x07,0xf7,0xf7,0x41,0xf9,0x2d,0xc7,0x1f,0xd2,0x5d,0x70,0x46,0x22,
+  0xda,0x0c,0xf1,0x7f,0xbc,0xe3,0x17,0xb4,0x06,0x4e,0xc8,0x7b,0xe0,0x62,0xe0,0x06,
+  0xfa,0xea,0x39,0xc9,0x7e,0x1f,0xc9,0xff,0x33,0xc4,0xa2,0x3e,0x95,0xf0,0xcf,0x98,
+  0xeb,0xff,0x29,0xa1,0x2b,0x3a,0xec,0x6b,0x9a,0xce,0xd1,0x90,0x2e,0x2e,0xf4,0xf8,
+  0x7f,0x54,0xa2,0xfd,0xa8,0x79,0xf3,0x8d,0xb4,0xa9,0x15,0x61,0x82,0x46,0x3a,0xe2,
+  0xbd,0xc5,0x27,0x24,0xc7,0x9f,0x56,0xb9,0x5d,0x79,0x88,0xc6,0x93,0x1a,0x1f,0xf5,
+  0xfa,0x7f,0x22,0x88,0x7f,0xb4,0xfd,0x30,0xbd,0x05,0xf5,0xf9,0x05,0xe7,0x79,0xb6,
+  0x55,0x12,0x4d,0xa8,0xc1,0x10,0xfe,0xbd,0xfd,0x9e,0xe7,0xc7,0x3b,0xc8,0x8f,0xc0,
+  0x59,0x16,0x5b,0x24,0x6f,0xf6,0xe0,0xd5,0x55,0x56,0xfc,0xeb,0xf0,0xac,0x71,0xfe,
+  0x1f,0x14,0x1e,0xe1,0x67,0xe1,0xc0,0xa2,0x92,0x4d,0x9d,0x27,0x5c,0x3e,0x4f,0x36,
+  0xfe,0x15,0x48,0xe4,0xfb,0x1b,0xf1,0x17,0xd1,0xcd,0xb1,0xb2,0x3a,0xba,0xe2,0xbe,
+  0x5f,0x91,0x82,0x90,0x21,0xa2,0x5d,0xa7,0x09,0xf6,0x28,0x9e,0x40,0x58,0x28,0x5e,
+  0x78,0x13,0xcc,0x4b,0x56,0x27,0xfd,0x99,0x1c,0xfc,0x63,0x08,0xb6,0x8f,0x3a,0x3f,
+  0xef,0x7d,0xe9,0xeb,0x8e,0x6c,0x2b,0x81,0x07,0x0d,0x3d,0x21,0xf0,0x8f,0xad,0x9f,
+  0xad,0xa8,0x29,0x7c,0x6d,0x93,0xea,0x57,0xf2,0xfc,0x3f,0x03,0xbe,0x0a,0x36,0x19,
+  0xff,0xf0,0x4e,0xe6,0x6f,0xa9,0x33,0xdd,0xf8,0x8e,0x5a,0x46,0xb0,0x67,0x38,0xba,
+  0x4a,0xce,0xf1,0xff,0x34,0x8e,0xa8,0x6b,0x7c,0x57,0xc1,0x0b,0x7c,0x76,0xaa,0x78,
+  0x95,0x7c,0xd8,0xe3,0xff,0x49,0x91,0xf5,0xb8,0x7a,0x9c,0xff,0xe7,0xb9,0x5f,0xa5,
+  0xf0,0x87,0xf8,0x2a,0x1c,0xe2,0x62,0xbe,0xb6,0xfe,0xcd,0x82,0xf7,0x08,0xff,0xe8,
+  0x81,0xe5,0x72,0x43,0x9e,0xff,0x67,0x08,0xff,0xa1,0xe7,0xf0,0xab,0xe7,0x5f,0xac,
+  0x1e,0xd2,0xed,0xf1,0xbd,0xa5,0xdf,0xa2,0xa7,0xed,0x2f,0xce,0x86,0xbd,0x3c,0xfe,
+  0x9c,0x65,0xec,0xbf,0x60,0x9d,0xf4,0x45,0xcd,0x7f,0x07,0x7b,0xcb,0x39,0x7f,0x69,
+  0xb0,0x59,0xe0,0x1f,0xb4,0x57,0x79,0xe3,0x8b,0x88,0x11,0xb4,0x4e,0x9b,0xa9,0xf9,
+  0xe2,0xd3,0xbd,0xfc,0x9f,0xfe,0x2c,0x9b,0x85,0xd0,0x8e,0xbb,0xdf,0xa1,0xfd,0xd1,
+  0xca,0xfa,0xe9,0x60,0x5b,0x73,0x6d,0x21,0x1b,0x74,0xf4,0x3f,0x22,0xf8,0x1e,0xc2,
+  0x7e,0x46,0x21,0xc7,0xff,0x33,0x93,0x84,0x7b,0x21,0x9a,0x2e,0xb9,0x17,0xdf,0x17,
+  0xfb,0xfd,0x4a,0xe2,0xa1,0x49,0xf0,0xa3,0xf6,0x8c,0xdb,0x8f,0x36,0xcb,0xa7,0xf9,
+  0x39,0xa3,0xa1,0x14,0xf5,0x33,0xe2,0xe8,0x67,0x50,0xbb,0x64,0xb1,0x7d,0x2e,0xe4,
+  0xe2,0x01,0x1c,0x3f,0x26,0x9f,0x81,0x4b,0xc9,0x46,0xbe,0xc4,0x2c,0x1f,0x70,0xf0,
+  0x4f,0x87,0xf2,0xd7,0x06,0x6e,0x5b,0x47,0xd4,0x83,0x79,0xfc,0x13,0xd3,0xbf,0x87,
+  0xfd,0x02,0x0e,0x98,0xb5,0x19,0xb5,0x8b,0x8d,0x78,0xfc,0x3f,0x82,0xdd,0x01,0x6a,
+  0x3a,0x91,0x3f,0xfe,0xdf,0xf1,0x60,0x78,0x40,0xad,0x45,0x3c,0x80,0xf8,0xc7,0xe5,
+  0xff,0x80,0xc3,0xc6,0xcc,0xdb,0xef,0xe8,0xc5,0xdc,0x05,0xab,0x41,0x85,0xb2,0xc3,
+  0x8e,0xfd,0xe1,0xc5,0xab,0x94,0xf3,0xac,0x7e,0xdc,0xfe,0xd2,0x88,0xff,0x50,0x75,
+  0xc6,0x32,0xd4,0x5c,0x36,0x75,0xc7,0xff,0x33,0x65,0x54,0x9a,0x20,0xfe,0xc5,0x50,
+  0xc8,0x20,0x8c,0xb9,0x84,0x07,0x09,0xbf,0x29,0x8f,0x14,0xb8,0xf8,0x47,0x84,0xbd,
+  0xda,0x83,0x4f,0x21,0x9a,0x7a,0x9e,0xcf,0xc9,0x90,0xbf,0x88,0x3f,0xcf,0x1b,0x87,
+  0x03,0xef,0x75,0xbe,0xa7,0xe1,0x57,0x55,0xc5,0x03,0xd5,0xa3,0x8e,0xbd,0x22,0xfc,
+  0xb3,0x81,0xd7,0x9a,0x6a,0x27,0xa2,0x9d,0x0d,0x7a,0x38,0x83,0xf3,0x5d,0x68,0xfc,
+  0x00,0xaf,0xf8,0x2e,0xb0,0x53,0xf4,0x95,0x1e,0xe8,0x66,0xa3,0x8a,0x8b,0x7f,0xfa,
+  0x71,0x13,0xaf,0x1d,0x90,0x58,0x59,0x40,0x7a,0x58,0xd5,0x89,0xbd,0xbc,0x04,0x3a,
+  0xd1,0x9e,0xb4,0xc6,0x0a,0x33,0xe4,0x18,0x84,0x87,0x34,0xf6,0x9e,0xb3,0xbf,0x9b,
+  0x95,0xdb,0x8d,0x0d,0xf0,0x25,0x33,0x94,0x42,0xfc,0xf3,0x03,0x08,0x9b,0x88,0xaf,
+  0x48,0xa8,0x35,0x10,0x91,0xe2,0xfd,0x59,0x6d,0xc5,0xf2,0x54,0x59,0xc6,0x8d,0xff,
+  0x96,0x9e,0xd6,0x5f,0x86,0xe8,0x9f,0x16,0x8f,0x34,0x47,0x11,0xed,0xd4,0x99,0xc1,
+  0x6e,0x79,0x35,0xed,0xc8,0xc3,0xa8,0xb1,0xc3,0x08,0x8d,0xea,0xf5,0x29,0xdf,0x97,
+  0x86,0x1d,0xfb,0x90,0x91,0x7e,0x88,0x6a,0xf9,0xa8,0x51,0x7c,0xa7,0x7c,0x9c,0xbd,
+  0x96,0xab,0xa8,0xce,0x51,0x85,0xf0,0xe1,0xd2,0x77,0xe5,0x21,0xc3,0xbe,0xbd,0xa1,
+  0xfd,0x47,0x13,0xde,0xad,0x0d,0x17,0x55,0xd6,0xff,0xd3,0x2b,0x6f,0x24,0xc4,0x65,
+  0x08,0x9a,0xd9,0x98,0xbe,0xe0,0xa1,0xe0,0xc1,0xf2,0x17,0x3c,0xf8,0x27,0x00,0x1b,
+  0xa4,0xda,0x25,0xf2,0xa3,0x88,0x1f,0x36,0x94,0xe2,0x32,0x98,0xcf,0xea,0x29,0x90,
+  0x67,0xf8,0x47,0xf1,0xf9,0x9e,0x30,0x58,0xa8,0x68,0x27,0x7b,0xcf,0xe1,0x07,0x66,
+  0x0a,0x96,0x56,0xa1,0x36,0x06,0x65,0x89,0xbc,0xcd,0x06,0x2e,0x83,0x79,0x8c,0xdc,
+  0x3e,0xf8,0x87,0xf5,0xec,0x30,0x42,0x23,0xbd,0xcd,0x3f,0x97,0x8d,0x39,0xeb,0x67,
+  0x54,0x9a,0x4a,0x78,0x20,0x75,0x2b,0xe1,0x1f,0x02,0x42,0x78,0xff,0x12,0x8b,0x18,
+  0xfc,0x8f,0x02,0x18,0x6c,0x9d,0xf6,0xc9,0xe5,0xe1,0x0b,0xba,0x7d,0x7f,0xc2,0x3f,
+  0x4f,0x69,0xf5,0x03,0x41,0xe6,0xe2,0x9f,0x00,0xc2,0x1e,0x12,0x3a,0x4d,0xe3,0xfd,
+  0xd2,0xf9,0x06,0x5e,0x39,0x91,0xcb,0x7f,0x2e,0x68,0x04,0x52,0x8b,0xfe,0x6b,0xa1,
+  0x16,0xbf,0xc3,0x8f,0xba,0x00,0xbf,0x55,0x66,0x01,0x1e,0x25,0x06,0x99,0xad,0xff,
+  0xde,0xca,0x5f,0xe9,0xc4,0xf6,0xc1,0xf3,0x7e,0xd4,0xd2,0x4f,0x4a,0xae,0x1d,0x41,
+  0x21,0x13,0xa8,0xeb,0x24,0x53,0x56,0x1f,0x0f,0xc4,0xaa,0x5d,0xfe,0x33,0xe2,0x1f,
+  0xbe,0x17,0x8a,0x73,0xec,0x49,0x16,0x11,0xfd,0x3d,0x43,0xd3,0x2a,0x09,0x53,0xb3,
+  0x6b,0xba,0x7d,0x7f,0x0e,0xff,0x66,0x10,0xdb,0xa7,0x68,0x32,0xfb,0x6e,0xd7,0xf7,
+  0xf8,0x17,0x33,0xfe,0x88,0xaf,0x04,0xbe,0xc7,0x67,0x65,0x7c,0x6b,0x9a,0x36,0xc1,
+  0x1e,0x12,0xc6,0xd0,0x5a,0xd9,0xfa,0x6f,0x55,0x9e,0x12,0x7c,0xaa,0x90,0x45,0x63,
+  0x40,0x7d,0xa6,0x13,0x1b,0x69,0xbd,0xf5,0x45,0x62,0x4d,0xc5,0xca,0x6e,0x58,0x7d,
+  0x62,0xcd,0x3c,0xb6,0xc9,0xf5,0xff,0x14,0x3c,0xa1,0x9e,0x63,0x0b,0xbb,0x8b,0x4f,
+  0xfb,0x7b,0xad,0xf8,0xd7,0xb0,0x1c,0x11,0x42,0x49,0x4a,0x3e,0xc0,0x2f,0xbd,0xd4,
+  0x98,0x2a,0xf9,0x92,0x3c,0xc3,0xcb,0xff,0xe1,0x63,0x93,0xf0,0x3c,0x0e,0x1d,0x59,
+  0x62,0x4c,0x87,0x67,0x63,0xe2,0x63,0x85,0x0d,0x15,0xc1,0xae,0x66,0x97,0xcf,0xac,
+  0xc2,0x1b,0x16,0xc9,0xe7,0x3b,0xb2,0xc2,0x8e,0xa6,0xc4,0x36,0x57,0x63,0xe3,0x9f,
+  0xe9,0x06,0xf1,0x9f,0x8b,0x7b,0xe4,0x84,0xcb,0xff,0xa9,0xf8,0x22,0xa1,0x97,0x36,
+  0x5f,0x0f,0xab,0x51,0xd6,0x73,0x5c,0x36,0x3d,0x72,0x96,0xcf,0x13,0x62,0x35,0xb0,
+  0x33,0xc4,0x5a,0x36,0xfc,0x6b,0x38,0xe2,0x8d,0x7f,0xe9,0xfb,0x85,0xbf,0x34,0x51,
+  0x23,0x09,0xbe,0xee,0x26,0x97,0xff,0xb3,0x03,0x05,0x76,0x7b,0xd1,0xe6,0xa6,0xfb,
+  0xec,0x9f,0x97,0xf0,0x4f,0x92,0xf8,0x87,0xc4,0xfe,0x15,0x7c,0x60,0x7f,0x19,0x6b,
+  0xe1,0x02,0x18,0xd4,0x35,0x51,0xa8,0x1a,0xf1,0x80,0x56,0xc6,0x4a,0xed,0xf1,0x16,
+  0xfe,0x89,0x6e,0x0e,0xac,0xf5,0xeb,0x30,0xd0,0x86,0xd3,0x5c,0x2b,0xdf,0x49,0xc4,
+  0xef,0x0a,0x34,0x24,0x29,0x85,0x1c,0x41,0x05,0x5c,0xfe,0xa1,0xc3,0x3f,0xec,0x29,
+  0x1e,0x36,0xce,0x4a,0x8d,0x46,0xf0,0x27,0xf2,0xb0,0x21,0xf0,0x00,0xb9,0x7d,0x88,
+  0xcf,0x1c,0x7c,0x80,0x7d,0x05,0xfe,0x49,0xb8,0xa6,0xe5,0xf7,0x9c,0xf5,0xd3,0x53,
+  0x70,0x46,0x3f,0xca,0xf0,0x10,0x3a,0xd8,0xb7,0x32,0xfc,0x2c,0x8d,0x1f,0xec,0x5c,
+  0xa9,0x13,0x22,0x2a,0x19,0xec,0x3c,0x53,0xf6,0x06,0x8e,0x5f,0x3a,0xd8,0x7c,0x32,
+  0x87,0xff,0x3c,0x24,0x35,0x00,0x1a,0xe1,0xd7,0x6d,0xfe,0xb3,0x0e,0xbd,0x28,0x08,
+  0x44,0xd4,0x8d,0x56,0xe9,0x56,0xce,0x5e,0xcd,0x89,0x7f,0xe1,0x34,0x9b,0x7c,0x5a,
+  0xa2,0x05,0x3a,0x54,0xe2,0x3f,0x27,0x5a,0x52,0x78,0xe5,0x16,0x9f,0xc6,0x8e,0xd0,
+  0x57,0x71,0x7f,0x2e,0xff,0x87,0x94,0x16,0xbd,0xd9,0xb7,0x09,0xb2,0xfc,0xe7,0x9d,
+  0xa8,0xf6,0x47,0x21,0x20,0x10,0x91,0xb1,0xbe,0xa0,0x36,0xbe,0xe1,0x01,0xf0,0xf2,
+  0x7f,0x7e,0x49,0xb4,0xf6,0xbb,0x6b,0x93,0xf1,0x95,0x02,0x08,0x89,0xf8,0xe6,0x51,
+  0x8b,0xff,0xfc,0x34,0xbc,0x39,0x84,0xa6,0xa3,0x07,0x11,0xb5,0xbd,0x3e,0x57,0x49,
+  0x5d,0xfc,0x45,0x44,0x47,0xf8,0xa3,0xf7,0x67,0x61,0x4f,0x67,0xbf,0x85,0x0f,0x93,
+  0xcd,0x16,0x10,0x9a,0xd4,0xe3,0xc1,0xcf,0x11,0x6d,0x2b,0xb7,0xd8,0x65,0xcd,0x64,
+  0x6d,0x2c,0xfe,0x8f,0x32,0x56,0x20,0x60,0xe7,0x0a,0x18,0x63,0x75,0x2c,0xb8,0xce,
+  0xeb,0xff,0x29,0x88,0xc0,0x02,0xb8,0x69,0xf3,0xa2,0xd3,0x89,0x11,0x38,0xd4,0x8d,
+  0xf8,0x27,0x93,0xe5,0xff,0xf8,0xdf,0xe0,0x0b,0xf8,0xa1,0x21,0x39,0xed,0x1f,0xf6,
+  0xf2,0x9f,0x25,0xa3,0x62,0x0e,0x44,0x33,0xfe,0x58,0x12,0xb7,0x21,0x33,0xda,0xe7,
+  0xef,0xf5,0xe1,0x8b,0xa3,0xd4,0x98,0xb7,0xce,0x37,0x96,0x68,0x78,0xc5,0xbc,0x76,
+  0x76,0xf8,0x98,0xb3,0xbf,0xa4,0xf0,0x78,0xbe,0x17,0xae,0x03,0xbf,0x91,0x8d,0x07,
+  0xc9,0x5f,0x61,0x93,0xe9,0x8d,0xee,0xf7,0xab,0x6c,0x72,0x45,0x03,0x9f,0x76,0xd8,
+  0x6f,0xb0,0x01,0xc3,0xb0,0xed,0x83,0xcd,0xff,0x69,0x95,0x5f,0xd5,0x48,0x98,0x34,
+  0xe2,0xff,0x37,0xe3,0xb7,0xfc,0xfa,0x4c,0x70,0xb9,0xfc,0x39,0xf8,0x87,0x8e,0x85,
+  0x99,0xa5,0xcb,0xcb,0x8f,0x85,0x9d,0xf5,0x39,0xa5,0x97,0xc2,0x1c,0x50,0x4c,0x7c,
+  0xd7,0xcb,0xd9,0xfd,0x8e,0x88,0xbe,0xc7,0x70,0xbe,0xb4,0xf5,0x1f,0x20,0x0d,0x1f,
+  0x76,0xd6,0x8f,0x51,0xf0,0x12,0xfc,0x9a,0x60,0xcf,0x88,0xfc,0x75,0xe5,0x12,0x09,
+  0x6b,0xaa,0xf1,0xd8,0x4e,0xf8,0x67,0x00,0x81,0xd0,0x6f,0xbb,0xbe,0xbc,0xf2,0xfe,
+  0xa3,0xb2,0xe6,0xf0,0x0f,0x7b,0x4b,0x7b,0xe0,0x9e,0xd2,0x99,0x40,0x6c,0x1f,0xe3,
+  0x71,0x61,0x7f,0xc2,0x93,0xe1,0x1e,0x36,0xd3,0x2c,0x36,0xca,0x5e,0x80,0xdf,0xaa,
+  0x55,0x37,0xfb,0x6f,0x66,0x1f,0x77,0xfc,0x4b,0x1a,0x62,0xeb,0xef,0xd1,0x30,0xf2,
+  0xf6,0x88,0xf1,0xef,0xa2,0x20,0xec,0x55,0x1b,0x1b,0x32,0x9e,0x84,0x69,0xca,0xad,
+  0x7d,0xec,0x0b,0x29,0x5b,0xff,0xf1,0x0a,0x53,0xef,0x84,0x5a,0xdd,0xff,0x1f,0x6c,
+  0x89,0x72,0x40,0xec,0xef,0xeb,0xa2,0xf0,0x30,0xbe,0xa1,0xc2,0xad,0xb1,0x9b,0xd7,
+  0xb4,0xf9,0x8b,0xd9,0x9f,0x75,0xb9,0xfc,0xe7,0x87,0xc9,0x6c,0x1e,0x0e,0x6e,0x97,
+  0x2c,0xa2,0x4b,0x70,0x9f,0xfc,0x35,0xdc,0x2f,0x1a,0xcd,0x40,0x8a,0xfd,0x92,0x9f,
+  0x1d,0x7c,0xfc,0xb4,0x7f,0x8b,0xfc,0xb7,0x1e,0xfe,0x4f,0xc6,0xc0,0x61,0x65,0xb2,
+  0x60,0xfb,0x10,0xdb,0x79,0x4b,0x79,0x96,0xf8,0x01,0xf2,0x1b,0x30,0x22,0x2d,0x30,
+  0xfd,0xc9,0xce,0xed,0x1e,0xfe,0xf3,0x20,0xe0,0x36,0x97,0x09,0x24,0x9f,0xaa,0x27,
+  0xda,0x8f,0x19,0x6c,0xc7,0x8d,0x89,0x88,0xd0,0xc5,0x2f,0xca,0x73,0xf5,0x5f,0x6b,
+  0x8d,0xe4,0x8f,0xcd,0x38,0xfc,0x1f,0xae,0x7c,0x1e,0x77,0xdb,0x59,0x11,0xdf,0x48,
+  0x22,0x0a,0x07,0xfa,0x67,0x98,0xfe,0x83,0x2c,0xaa,0x10,0x11,0x45,0xed,0x66,0x61,
+  0xfe,0x04,0xaf,0x9d,0xed,0xdf,0xc2,0x46,0x3d,0xf8,0x47,0x37,0xfe,0x05,0x6a,0xfb,
+  0xd5,0x7d,0x64,0x6d,0xcc,0xb0,0xe9,0x23,0x81,0xc6,0x17,0xa5,0xd8,0x76,0x8e,0x40,
+  0x68,0x85,0xbf,0xdb,0x73,0x5e,0xa3,0xf3,0x17,0x85,0x39,0x7c,0xe0,0x0b,0x40,0xda,
+  0x72,0xd4,0x07,0xc8,0x3e,0x9b,0xaa,0x8a,0xe7,0x11,0x32,0xdd,0x32,0x4c,0x77,0xf1,
+  0x39,0x47,0xfb,0xf3,0xb2,0x05,0x72,0x04,0xd1,0x82,0xd6,0xc3,0x16,0x78,0x46,0x5a,
+  0x68,0x7e,0x2a,0x39,0x69,0x3b,0xa9,0x4e,0x18,0x5e,0xdd,0xe5,0x3f,0x9f,0xb1,0xf2,
+  0x77,0x06,0x05,0xbb,0x49,0xb0,0x9d,0x1d,0xfe,0x4f,0xbb,0xf0,0xff,0xdc,0x6f,0x94,
+  0xbb,0x7c,0x3c,0x8b,0xff,0xdc,0x98,0x72,0x60,0xb3,0x10,0x5e,0xe9,0x9a,0xad,0x07,
+  0xce,0xca,0xef,0xc1,0x7f,0xf3,0x39,0x55,0xf7,0xaf,0x91,0x47,0xdd,0xf8,0x17,0x90,
+  0xb7,0xa7,0x24,0xe5,0xdf,0x57,0xf6,0x0e,0xbc,0x6d,0xfb,0x7f,0xe6,0xf3,0x70,0x6b,
+  0x60,0x97,0xc0,0x3f,0x33,0xe2,0x9f,0xec,0x61,0x2e,0xff,0xca,0x8a,0x7f,0x91,0xb7,
+  0x67,0xb1,0x07,0xef,0xf5,0x80,0x7e,0x38,0x14,0x2b,0xcb,0x68,0x0f,0x42,0x04,0xae,
+  0xd5,0xd8,0x5b,0x2e,0xbf,0xa8,0x74,0x87,0xf6,0x84,0xe2,0x85,0x91,0x69,0xb6,0x5a,
+  0xd9,0xdf,0xa6,0x0f,0x5d,0x97,0x06,0xbc,0xbf,0x32,0x23,0xfe,0x50,0xd2,0xc3,0x7f,
+  0x86,0x09,0xf9,0xb7,0x2f,0x9a,0xbb,0x62,0x81,0xf4,0x9c,0x01,0xfe,0x72,0xeb,0x82,
+  0x3a,0xff,0xfe,0x66,0x17,0x9f,0x67,0x4a,0x0f,0xda,0x6c,0x96,0x0b,0xf0,0x6b,0x1b,
+  0xff,0x5c,0xe4,0x8d,0xf1,0x12,0x0a,0x84,0x5d,0xbe,0x0e,0xed,0xed,0xd8,0x53,0x63,
+  0x0e,0x1e,0xb6,0xf8,0xcf,0xf3,0x68,0x59,0x7a,0xee,0x3f,0x62,0x08,0xc4,0x7e,0xa7,
+  0x7e,0x7e,0xf1,0x02,0xf0,0x27,0xe5,0x1c,0xfe,0xb3,0x42,0xde,0x3f,0xff,0x63,0x8c,
+  0x96,0x65,0x76,0x22,0x73,0x50,0x28,0x4e,0xe3,0xfa,0x49,0x18,0x65,0x71,0x5c,0x3f,
+  0x75,0xce,0xef,0x6b,0x0a,0x3e,0x58,0x94,0xe7,0xba,0x7d,0xb6,0x22,0xa2,0xbe,0x9a,
+  0x02,0x85,0x0f,0x4b,0x51,0x28,0x9f,0xef,0xbc,0xbd,0x76,0x3c,0xe8,0x8b,0x29,0xe1,
+  0x06,0x71,0xf2,0xa1,0x1e,0x13,0xb4,0xe7,0xc2,0xc7,0xe1,0x7e,0x5e,0x15,0xef,0x1c,
+  0x62,0xad,0xce,0xf8,0xd6,0x50,0xc0,0x70,0xdc,0x3e,0x16,0xff,0x99,0x89,0x40,0x98,
+  0x51,0x9c,0x96,0x4d,0xfe,0x0b,0xf8,0x5a,0xe1,0xd2,0x58,0xa7,0x87,0xff,0x3c,0xf9,
+  0xa0,0x76,0x19,0x6e,0xb0,0xd4,0xe2,0xc5,0x87,0xb8,0x6d,0x4d,0xba,0x03,0x7e,0x25,
+  0x89,0xf7,0x25,0xe9,0xc6,0xbf,0x04,0xff,0xbc,0xde,0x88,0xe6,0xe8,0xff,0x2c,0x5f,
+  0x60,0xf8,0xd3,0x68,0xf6,0xc5,0x51,0x25,0x3d,0xe9,0xb0,0x9b,0x3f,0x25,0x6d,0x71,
+  0xb2,0x2d,0xdc,0xf3,0xd4,0x63,0x50,0x65,0xa0,0x30,0x64,0xbb,0x9a,0x5f,0x72,0xfc,
+  0x15,0xba,0xe0,0xff,0xcc,0xca,0xe4,0xf2,0x9d,0x9e,0xe4,0xd7,0xc5,0xfd,0x6b,0xc2,
+  0x27,0x74,0xbc,0xa2,0x6f,0xa0,0xf8,0x97,0xfd,0x59,0xa5,0x08,0x35,0x66,0xf2,0xce,
+  0x17,0x6d,0x08,0x23,0x85,0xf0,0x00,0x5e,0x99,0xdf,0x74,0xc2,0xe5,0x3f,0x2b,0x82,
+  0xff,0xdc,0x1d,0xf0,0xc4,0xbf,0x46,0xf0,0x58,0x74,0x53,0x57,0x30,0x55,0x7e,0x96,
+  0xde,0xa0,0x24,0x22,0xde,0x73,0x2e,0xbe,0x82,0xd4,0x95,0xf8,0x3f,0xf4,0x1a,0xae,
+  0x89,0x0b,0x44,0xe4,0x9e,0xdf,0x55,0x10,0xe7,0x7d,0x23,0xda,0x33,0xc1,0x79,0x7f,
+  0x25,0xdf,0x0f,0x07,0x6e,0x41,0xc1,0xc3,0xff,0xa9,0xa8,0x11,0xde,0x06,0xb5,0x27,
+  0x31,0xce,0x9f,0x53,0xf7,0x31,0xbe,0x33,0x1e,0x8e,0x6f,0x48,0x7a,0xfc,0x09,0x59,
+  0xfe,0xb3,0xa1,0x3e,0x90,0xeb,0xff,0x99,0x41,0x8e,0x8e,0x95,0xd2,0x7e,0xb6,0x62,
+  0x91,0x3f,0x99,0x38,0xe2,0x8c,0xb7,0xfc,0x3f,0xb5,0xe3,0xfc,0x21,0xd1,0x45,0x7e,
+  0xad,0x89,0xbe,0x8a,0x1b,0xff,0x92,0xc3,0x7f,0x9e,0x62,0xc1,0xbc,0x40,0xde,0x7c,
+  0x17,0x54,0xf8,0xd7,0xca,0x71,0xda,0x7f,0xf1,0x4a,0xf3,0xa9,0x42,0xdb,0xfe,0xec,
+  0x2b,0xce,0xe7,0x3f,0x93,0xf0,0x1b,0x71,0xa5,0x9c,0x4c,0xd3,0x8f,0x0c,0xff,0xa0,
+  0x7c,0x0a,0xff,0xd4,0xfa,0xcc,0xa7,0x78,0x99,0x82,0xfa,0xc9,0xf3,0xff,0x20,0x6c,
+  0xd8,0x5c,0x7e,0x86,0x3d,0x0d,0xb3,0xcd,0xe0,0x60,0xb3,0xcf,0x59,0x3f,0x21,0x48,
+  0x15,0x50,0x18,0x4e,0xf5,0xf0,0x9f,0x85,0xa0,0xfa,0x89,0xff,0xd3,0x0d,0x61,0xbc,
+  0x22,0x2f,0xce,0x8b,0x7f,0xd1,0x7c,0x0b,0xf3,0x89,0xd0,0x16,0xfe,0xd1,0x71,0xe2,
+  0xcc,0xcd,0xd7,0x0b,0x55,0x6c,0x57,0x49,0x7b,0x13,0xfa,0xd3,0x86,0xa5,0xf5,0xca,
+  0x23,0x71,0x7f,0x0f,0x3b,0xe2,0xc6,0xbf,0x14,0xe2,0x0b,0x45,0x97,0x05,0x72,0xfd,
+  0x39,0x03,0x0d,0xad,0x42,0xe8,0x83,0xba,0x55,0x41,0x4d,0xee,0x75,0xf1,0x8f,0xb6,
+  0x5d,0xcd,0x41,0x3b,0xd6,0xf8,0x4d,0x0d,0x2b,0xef,0x17,0xfc,0xe7,0x6b,0x16,0x18,
+  0x28,0x2c,0xcb,0xf5,0xff,0x20,0xde,0x9b,0xc4,0x3b,0xf3,0xd6,0x9b,0xc5,0x08,0x32,
+  0xe6,0x51,0x68,0xd2,0x5d,0x3f,0xaa,0x42,0xf8,0x87,0x60,0x0f,0xe4,0xf2,0x7f,0xb8,
+  0x9a,0x62,0x43,0x70,0x68,0x7b,0x38,0xa5,0xbe,0xed,0xf1,0xff,0xa8,0x59,0xfe,0xf3,
+  0xad,0xd7,0x1b,0xe3,0xfd,0xa5,0xc7,0x8d,0x9d,0x92,0xde,0x9f,0x08,0x94,0x1d,0x76,
+  0xf0,0x8f,0x6e,0xf3,0x9f,0xdb,0xc4,0xfb,0x5b,0xec,0xf8,0x43,0x46,0xd4,0xbb,0xf1,
+  0xfe,0x7b,0xa0,0x3a,0xa3,0x22,0xfe,0x69,0xb3,0xdf,0xdf,0x48,0xe8,0xbb,0x08,0x42,
+  0xc8,0xed,0x53,0x9d,0xeb,0xff,0x39,0x1d,0xf8,0x27,0x14,0xce,0xac,0x9d,0x9d,0xb9,
+  0x0d,0xf1,0x4f,0xa1,0xf3,0x3c,0x53,0x76,0x68,0xd9,0xa4,0xdd,0x3c,0xfe,0xcf,0x5f,
+  0x5a,0xfc,0x9f,0x03,0x66,0x0e,0xfe,0x89,0x2b,0x87,0x68,0xdb,0x1a,0x2e,0xfe,0xb3,
+  0x1c,0xff,0x4f,0x72,0xe1,0x49,0xdc,0xbf,0x3e,0x30,0xce,0x24,0x6f,0xc8,0xdc,0xbf,
+  0xaa,0x2a,0xe4,0xfa,0xab,0x61,0x8b,0xb1,0x57,0x23,0xf4,0x22,0x7f,0x36,0x9f,0xcf,
+  0xa3,0x0f,0x69,0x7b,0xe6,0x55,0x99,0x25,0x6d,0x6c,0x9b,0xcb,0xaf,0x10,0xfc,0xe7,
+  0x59,0x87,0x1f,0xca,0xf5,0xff,0xa8,0x7f,0x87,0xe3,0xcb,0x5e,0x81,0x83,0x6c,0xda,
+  0x20,0x5e,0x89,0x3b,0xe3,0x8d,0x0a,0x71,0xec,0xca,0x80,0x2e,0x68,0x2d,0x81,0xac,
+  0x3e,0xe3,0x35,0x83,0x6a,0x9a,0x7d,0xaa,0x2a,0x5d,0x5a,0x93,0x41,0xe0,0x3d,0xe8,
+  0xc4,0x97,0x7b,0x0b,0x76,0x50,0x92,0x88,0x59,0x90,0xcc,0xf1,0xff,0x98,0x8d,0xfd,
+  0x91,0x51,0xf9,0x1d,0xfc,0xe1,0xe6,0x7d,0x12,0xe7,0xeb,0xe2,0x9f,0x94,0xe6,0x44,
+  0xbb,0xc6,0x13,0x0f,0xde,0x81,0x73,0xea,0x02,0xb3,0x70,0x0b,0xae,0xb7,0x7c,0xfe,
+  0xb3,0xc0,0x03,0x79,0x8e,0x91,0xe6,0x7a,0x34,0x74,0x73,0x32,0xf8,0x95,0x39,0x8e,
+  0xff,0x8c,0x8b,0xdc,0xa6,0xf1,0x58,0xf9,0x5c,0x66,0x49,0x9a,0x45,0xa5,0x5d,0x3c,
+  0xfc,0xb4,0xff,0x3b,0x39,0xf8,0x27,0x3b,0x7e,0xcb,0x38,0x7f,0x51,0xba,0x6c,0x1a,
+  0xaa,0x3b,0xdc,0x87,0x08,0x21,0xe3,0xae,0x37,0x10,0xa4,0x0e,0xf2,0xf6,0xd8,0x69,
+  0x5f,0xcc,0x8a,0x10,0x09,0x20,0x94,0xe6,0x3a,0x65,0x20,0xba,0xfe,0x1f,0x08,0xad,
+  0x76,0xe7,0xfb,0x44,0x8e,0xff,0x67,0xd4,0x1f,0xc5,0x35,0x2e,0x10,0x91,0x59,0x98,
+  0xcb,0x7f,0x5e,0xe8,0xce,0xb7,0xd8,0xde,0xc8,0x44,0x44,0xec,0x02,0x3c,0x49,0x1a,
+  0xf0,0xfa,0x7f,0x2e,0xc1,0xcf,0x89,0x9f,0xf6,0x94,0xbf,0x1d,0xb7,0x95,0xdd,0x94,
+  0xff,0xd5,0x40,0x19,0xe2,0x99,0x49,0x67,0xe5,0x0b,0xc6,0x05,0x7e,0xc3,0x70,0xf0,
+  0xac,0xec,0xfa,0x7f,0x38,0x9c,0x56,0x37,0x48,0xe1,0x01,0x75,0x2d,0x0b,0x2b,0x44,
+  0xfb,0xf1,0x5f,0x64,0x3f,0xc4,0x3f,0x44,0x21,0xc9,0x2e,0x9a,0xfb,0x78,0xd8,0xf4,
+  0x6f,0x63,0xa3,0x8e,0xff,0xb9,0xfb,0xe6,0xe3,0xda,0xbf,0x20,0xda,0x51,0x81,0x2d,
+  0x46,0xe0,0x27,0xb2,0xff,0x68,0xc7,0xaf,0x31,0xe5,0x30,0x3b,0xce,0xf7,0xf1,0x9a,
+  0x14,0xaa,0xc2,0x8d,0x77,0x98,0x95,0x1b,0x11,0x3d,0x6e,0x4b,0xe1,0x6a,0x09,0x0b,
+  0xda,0x8f,0x3f,0x0d,0x3b,0xa4,0x27,0x48,0xe0,0x85,0xa7,0x61,0x5f,0x22,0xdc,0xef,
+  0xe7,0x87,0x47,0xbd,0xfc,0x9f,0xc0,0x4f,0xa5,0xba,0xf7,0x02,0x23,0x78,0x1a,0x7a,
+  0x1b,0xb5,0x51,0x42,0x8e,0xc4,0xf7,0xd9,0x3c,0x91,0x2f,0xa9,0x8e,0xf2,0xbf,0xd7,
+  0x97,0x76,0x54,0x9b,0x2d,0x4e,0xfc,0x88,0xf0,0x4f,0x0a,0xb5,0xf7,0x7a,0xf5,0x00,
+  0x88,0x8d,0xde,0xe2,0xc3,0xdf,0x64,0x06,0xcf,0x21,0x50,0xbc,0x20,0xdd,0x94,0xda,
+  0x90,0xc9,0xcb,0x7f,0xa7,0xf8,0x4e,0xc9,0x66,0x19,0xd1,0xa6,0x8e,0xfa,0x9f,0x4f,
+  0x0b,0x55,0x45,0xb5,0xef,0x29,0x5f,0x0d,0x63,0x21,0xdc,0x1a,0x36,0xcb,0xff,0x95,
+  0x93,0xff,0xf5,0x03,0x8b,0xbf,0x14,0x85,0xce,0x38,0xe5,0x7f,0xc9,0xab,0xe1,0x49,
+  0x7d,0x9e,0xb9,0x21,0x1d,0xae,0x87,0xf9,0x26,0x1a,0x22,0xce,0x5c,0xfe,0xb3,0xa9,
+  0x14,0xf3,0x4e,0x3a,0x8f,0x27,0xcb,0xba,0x7c,0x9d,0x6e,0xfe,0x85,0x6e,0x11,0xc3,
+  0x76,0x1a,0x51,0x43,0x8b,0x79,0xf8,0xcf,0x84,0x7f,0xc8,0xfb,0xa1,0x5e,0x17,0x2e,
+  0x73,0xf0,0x8f,0xb2,0x97,0x4f,0xcb,0xf8,0x97,0xb3,0xcf,0xc1,0x1e,0x3e,0x93,0xa8,
+  0xc2,0x17,0x1c,0xff,0x73,0x6b,0x28,0x2a,0x3d,0xa5,0x45,0xcd,0xef,0x6a,0xac,0x4b,
+  0x79,0x8a,0xf0,0x4f,0x9d,0xbc,0x11,0xde,0x87,0x98,0x79,0x7f,0x4a,0x5e,0x02,0xef,
+  0xc7,0x10,0x5a,0xd7,0xc9,0x27,0x9c,0xf3,0x3b,0xe2,0x1f,0xb8,0xac,0x35,0x9a,0xb7,
+  0x8e,0x7e,0xc2,0xc9,0x1f,0xfc,0x1a,0xfc,0x36,0x44,0xc2,0xa4,0x83,0x70,0x49,0x6b,
+  0xec,0xff,0xc6,0xe8,0x24,0x37,0x9e,0xae,0x8a,0xf8,0x57,0xbd,0x81,0xfb,0xe3,0xd7,
+  0xe0,0x56,0x5a,0x9f,0xc2,0x31,0xdb,0x8b,0xfa,0x99,0xef,0x9f,0x69,0x65,0x7c,0x77,
+  0x57,0x33,0x0f,0x7f,0xe6,0x20,0x9d,0x9e,0xfa,0x8a,0xe3,0x65,0x93,0xad,0xfc,0xf7,
+  0xbf,0x4f,0xbc,0x02,0xbb,0xf5,0x2a,0xb2,0xa8,0x93,0x8d,0x17,0xa4,0x1b,0x0d,0x7f,
+  0xbc,0x69,0x97,0x9b,0x4f,0x01,0xdf,0x65,0xf7,0x74,0xcf,0xca,0x84,0x42,0xec,0x36,
+  0xc9,0xc1,0x7b,0xdf,0x4e,0x55,0x65,0xfc,0x23,0x4d,0x25,0xc6,0xb7,0x10,0xff,0xf8,
+  0x96,0x97,0xa9,0xee,0xfe,0x42,0xf1,0x2f,0x1e,0x1d,0x28,0x3a,0xc0,0x02,0xdc,0xe5,
+  0x3f,0x33,0xd4,0xe7,0xdc,0x44,0xa0,0xf4,0xc1,0xb6,0x88,0x79,0xed,0x42,0xf6,0x1d,
+  0x37,0xfe,0x85,0xf8,0xe7,0x5e,0xd6,0xc8,0x03,0x99,0x8e,0x35,0xca,0x61,0x85,0xf0,
+  0xcf,0xe7,0x47,0xe0,0x25,0xd8,0xc6,0x83,0x27,0xe5,0x08,0xbc,0x0a,0x8d,0x8f,0x97,
+  0x64,0xaa,0x6f,0x72,0xf9,0xcf,0x4e,0x3e,0x4e,0x73,0xaa,0xd0,0x12,0xa4,0x8c,0x36,
+  0x66,0x88,0x8d,0xc9,0x84,0x31,0x75,0x06,0x0a,0x9d,0x5e,0xfe,0xf3,0x76,0xe3,0x4d,
+  0x26,0xb2,0x57,0x5a,0xe0,0xa8,0x56,0x67,0x58,0x1b,0x9f,0xfe,0x75,0x4a,0x8b,0xde,
+  0x0e,0x47,0x6b,0x28,0x74,0x52,0xed,0x8d,0x7f,0x21,0x9e,0x61,0x51,0xa3,0x3b,0xc9,
+  0x6a,0xd8,0x7a,0x08,0x67,0xf7,0x5f,0xf3,0x4b,0x86,0xc8,0xf0,0x5a,0x6f,0x12,0x35,
+  0xa8,0x7a,0x5c,0xfe,0x97,0xe1,0x4b,0x97,0xd4,0x28,0x62,0x7c,0x0f,0x8d,0x37,0x6a,
+  0xb3,0xe3,0xd5,0xe8,0xa2,0xc8,0xf8,0xf8,0x17,0xde,0xc4,0xf2,0xff,0xa4,0x0c,0x7f,
+  0x59,0x19,0xe2,0x01,0xdd,0x02,0x06,0xc2,0x23,0x14,0xd2,0xca,0x3c,0xf1,0xaf,0x29,
+  0x77,0xb6,0x8e,0xb5,0x35,0x54,0x94,0xac,0x2d,0xd7,0xd9,0x80,0x52,0x87,0x47,0x6b,
+  0xd9,0xca,0x40,0x0f,0xae,0x95,0xb7,0xb6,0x0e,0x48,0x0d,0x15,0x93,0x0b,0xe4,0x4b,
+  0x0e,0xff,0x79,0xdf,0x94,0x61,0xf5,0x22,0x08,0xff,0xcf,0x1e,0xc1,0x7f,0xbe,0x5f,
+  0xe4,0x7f,0x69,0xe4,0xd8,0x91,0x87,0xff,0xfc,0xe7,0x52,0xe3,0x22,0x14,0xb6,0xb9,
+  0xf9,0x5c,0x05,0xbf,0x21,0x7e,0x54,0x9b,0x7f,0xd3,0xfa,0xd5,0xba,0xe5,0xff,0x69,
+  0x22,0x06,0xf5,0x3c,0x41,0xa4,0x81,0x67,0xf1,0x79,0x82,0xc9,0xea,0xe9,0x4e,0xbc,
+  0x29,0x44,0xf1,0xc7,0x30,0xc2,0x9e,0x75,0x3e,0x5d,0x1d,0x12,0xf8,0x27,0x6c,0xa5,
+  0x7d,0x95,0x24,0x98,0xae,0x76,0xe3,0x46,0x5f,0xc2,0x27,0x95,0x78,0xe2,0x5f,0x88,
+  0x7f,0x54,0x9c,0x5d,0xe8,0x91,0x16,0xa9,0xc3,0xca,0xff,0xc2,0xf9,0x1a,0x3a,0xea,
+  0x67,0xdd,0x5a,0xd8,0xca,0xa3,0xb7,0xf8,0x37,0x25,0x36,0x49,0xb6,0xfe,0x11,0xff,
+  0x58,0x61,0xaf,0x4d,0xac,0xa6,0xcc,0xca,0x7f,0x2f,0x24,0xfe,0x79,0xd8,0xf0,0x6d,
+  0x66,0x0a,0x7b,0x94,0xd5,0xb6,0xb2,0x07,0xca,0x1e,0xb1,0xd5,0x83,0xf8,0x47,0x84,
+  0xbd,0x3e,0x19,0xec,0x91,0x57,0xf2,0xf5,0x40,0x3f,0xab,0x20,0x6e,0xed,0x32,0x82,
+  0xa5,0xf2,0x76,0xf5,0xcd,0xfe,0xda,0xb6,0xa0,0xd6,0xd9,0x5b,0xe1,0xf0,0x9f,0x89,
+  0x0f,0xa6,0x35,0xb4,0x07,0x7b,0x9a,0xed,0x40,0x61,0xf9,0x30,0xbc,0x0b,0x0b,0x16,
+  0x95,0xf4,0xe0,0xf8,0x17,0x8f,0x36,0x2c,0x0a,0x26,0xfd,0xcb,0xf2,0xf2,0xbf,0xea,
+  0x08,0xe4,0xc4,0xd5,0x21,0x4e,0xcb,0x6c,0x11,0xc2,0x4e,0xad,0x41,0x9a,0x64,0x03,
+  0xa1,0xdb,0xbc,0xf1,0x2f,0x55,0x59,0x40,0x6c,0x9f,0x0e,0x35,0x15,0x8e,0xc0,0x7d,
+  0x50,0xdb,0x21,0xf2,0xbf,0x0e,0x0d,0xd6,0xf2,0x6b,0x09,0x08,0x1d,0xb2,0x80,0xd0,
+  0x31,0xc7,0xff,0xac,0x16,0xdc,0x22,0xac,0x8d,0x2f,0xcd,0x02,0x5a,0x82,0xf2,0xdf,
+  0x35,0xda,0xb8,0x4d,0xeb,0xc5,0xd1,0xe6,0xa0,0xf0,0x37,0x31,0x38,0xe6,0xda,0x1f,
+  0x69,0x0a,0xec,0x4d,0x56,0x0f,0xab,0x77,0xe3,0xf9,0x7d,0x1d,0xbd,0xbf,0x6b,0x12,
+  0x93,0x11,0xf6,0x88,0x7c,0xf0,0x57,0xf8,0x63,0x2d,0xb3,0x4e,0xfb,0xdb,0xeb,0x32,
+  0x15,0x0e,0xff,0x39,0x54,0x86,0xf6,0x76,0xe7,0x9b,0x25,0x97,0x9a,0xa7,0x6a,0xfd,
+  0x84,0x7f,0xe6,0xcb,0x9f,0x13,0x40,0xc8,0xbf,0xa6,0xfa,0x35,0x12,0x46,0x82,0xff,
+  0x94,0xc3,0x7f,0xde,0x03,0xe7,0x79,0x43,0x1f,0xa5,0x81,0xe3,0xf3,0x66,0xf3,0xc1,
+  0xcf,0x32,0x2b,0x11,0x2c,0x85,0x2b,0x6a,0xa0,0x6b,0x97,0x27,0xfe,0x15,0x57,0x76,
+  0x09,0xd8,0x73,0xcf,0x58,0x79,0x03,0x7c,0x82,0xe2,0x17,0xd9,0x40,0xd8,0x70,0xf0,
+  0xe2,0x06,0xca,0x56,0x5c,0x38,0xda,0xfa,0x8f,0xd5,0x5a,0xd8,0x1e,0xdf,0x0b,0x9b,
+  0xe1,0x97,0x16,0x8c,0x99,0x1c,0x5e,0x57,0x6a,0x99,0x1d,0xcb,0xb1,0xd3,0xce,0xea,
+  0xe1,0x05,0x75,0xe1,0x91,0xd0,0x5d,0x6c,0x86,0x87,0xff,0x9c,0x44,0xb4,0x33,0xb3,
+  0x5f,0xf8,0x8b,0xd6,0x42,0x95,0xf8,0x43,0x31,0xdf,0x6b,0xdb,0xa7,0x4f,0x86,0x6f,
+  0x69,0xb3,0x4c,0x75,0x94,0x29,0x1e,0xfc,0xd3,0x45,0xfe,0x8d,0xb1,0x6b,0x1b,0x59,
+  0x10,0xb8,0x30,0xe3,0xc2,0xd1,0x11,0x35,0xaf,0xbd,0x9e,0x05,0xd4,0x07,0xba,0xa3,
+  0x87,0xbb,0xd3,0x75,0x21,0x97,0xff,0x8c,0xf8,0xe7,0x32,0xff,0x68,0x26,0x38,0xea,
+  0xaf,0x35,0x8e,0xc1,0x2e,0xda,0xe8,0xb3,0x40,0xe8,0x8c,0x5c,0x0f,0x2f,0x1b,0xb3,
+  0x32,0x81,0xb3,0x9d,0xb5,0x8e,0xfd,0x49,0x59,0xf9,0xc8,0xfd,0x41,0xaa,0xbe,0x32,
+  0x66,0x64,0xf1,0x80,0xc3,0x18,0x3f,0x6b,0x2c,0x30,0x67,0xa5,0x73,0xf8,0xcf,0xc2,
+  0x1f,0x62,0x2e,0xc1,0x6d,0x51,0xb9,0xc0,0xe7,0x98,0xa8,0x1f,0x9b,0x0f,0xdc,0x79,
+  0x41,0xb9,0xcc,0x6e,0x22,0xc7,0xbe,0x97,0xff,0x3c,0x0d,0xcf,0xef,0x33,0x29,0x5b,
+  0x27,0x8a,0x68,0x64,0x9b,0xe9,0x47,0x6b,0x04,0xfb,0x6d,0x8f,0xc4,0x3e,0x6e,0x65,
+  0x24,0x79,0xf0,0xcf,0x5f,0x09,0xb4,0xd3,0x4a,0xe3,0x0f,0xc4,0x71,0x9b,0x4e,0x0a,
+  0xbe,0xf4,0x0c,0x6b,0xfc,0x7e,0x53,0x8c,0xd7,0x73,0xec,0x8f,0xc8,0xee,0xb1,0xd4,
+  0xa2,0x13,0x10,0x22,0x46,0xb4,0xb5,0xde,0x8a,0xd2,0x92,0x10,0x12,0x1d,0x8e,0xfa,
+  0x43,0x35,0x70,0x9e,0x65,0xe3,0x83,0x63,0x84,0x76,0x92,0xb8,0x9f,0x8e,0x11,0x11,
+  0xba,0x9d,0xe2,0xe9,0xd2,0x4d,0x7d,0xc1,0xd1,0x6a,0xdd,0x93,0xff,0x75,0xc6,0xa6,
+  0xf5,0x12,0xda,0xc9,0x02,0xbf,0x0b,0x59,0xe0,0xa7,0x5e,0x90,0xbe,0x41,0xc2,0x9b,
+  0x5d,0x0e,0xfe,0xf9,0x96,0xe5,0xf6,0x29,0x1e,0x42,0xd8,0x8c,0xa7,0xdd,0x8c,0xd7,
+  0x11,0xf4,0x39,0xe8,0x87,0xeb,0xf5,0x99,0x23,0x72,0xcc,0x13,0xff,0xfa,0x21,0xd1,
+  0x7e,0x5e,0x57,0x7b,0xd8,0x3b,0x14,0x5f,0x76,0xeb,0xff,0xf8,0xeb,0xf0,0x45,0xeb,
+  0x1e,0x0c,0xc7,0x8b,0xba,0x99,0xee,0xd8,0x9f,0x01,0x65,0xa3,0xea,0xc0,0x3c,0x6b,
+  0x9a,0x85,0xf6,0x41,0x23,0xb1,0x04,0xd5,0x5d,0x63,0xf8,0xf4,0x70,0xd8,0xb1,0x6f,
+  0x66,0x01,0xc2,0x3c,0xc5,0xe2,0x3f,0xab,0x07,0xb4,0x5c,0x47,0x50,0x04,0xed,0x5b,
+  0x38,0xee,0xef,0x66,0x2e,0xff,0xc7,0x28,0x38,0x1d,0x12,0xd5,0x12,0x92,0xe5,0xa7,
+  0xd5,0x73,0x1d,0xb9,0x78,0xb8,0x05,0x5f,0xdc,0xb9,0x77,0x07,0xa3,0xb2,0x96,0x9f,
+  0xff,0x6e,0x06,0x5f,0x20,0xb5,0xf0,0xbc,0x40,0xa1,0x7a,0x29,0xd9,0x68,0x04,0x08,
+  0xff,0xd8,0xbf,0x57,0x4b,0x96,0xff,0x2c,0xe2,0x8f,0xe7,0x72,0xf1,0xf6,0xa4,0x1a,
+  0xfe,0x76,0x68,0xd7,0xf2,0x29,0x8f,0x78,0xea,0xff,0x0c,0x55,0x8a,0x78,0xe8,0x10,
+  0x9e,0x1f,0x4f,0xd3,0xb1,0xcb,0xf4,0xef,0x73,0x03,0xa3,0x51,0x48,0x40,0x78,0x85,
+  0xba,0x3d,0x31,0x2e,0xff,0x3d,0x13,0x71,0xf4,0xe3,0x04,0xe2,0xd3,0xac,0x18,0xb6,
+  0x19,0x29,0x43,0x53,0x99,0xcb,0xff,0x11,0xf9,0x5f,0x89,0x99,0x96,0x3f,0xe4,0xf1,
+  0x3c,0x62,0xf0,0x02,0x63,0x1d,0xaf,0xce,0x84,0x8e,0x86,0x55,0x6f,0xfe,0x97,0x49,
+  0xfe,0x1f,0xca,0xff,0x32,0xde,0x73,0xf8,0x3f,0x96,0x23,0x28,0x00,0xbf,0x80,0x98,
+  0xa1,0x4e,0x93,0x3d,0xf5,0x7f,0x8a,0x0f,0xb6,0x09,0xfc,0x4c,0x6a,0xb9,0x64,0xe4,
+  0xe8,0xe7,0xe3,0x63,0xb8,0x42,0x66,0x99,0x25,0x8b,0x3c,0xf5,0x7f,0xac,0xfc,0xaf,
+  0xac,0x5a,0xce,0x19,0xb9,0xfa,0x5f,0xa7,0x9c,0xc0,0xfb,0x17,0x6b,0xd5,0x4d,0xce,
+  0xfa,0xb1,0xf2,0xbf,0xb2,0xc7,0xa8,0xc7,0xf3,0x12,0x4b,0x05,0x11,0xda,0xf0,0x1b,
+  0xac,0xec,0x2a,0xfb,0xfe,0x06,0x78,0x68,0x4e,0xf9,0xf3,0xfd,0x40,0xff,0x36,0xff,
+  0x78,0xdc,0xbf,0x9a,0xb5,0xe6,0xe6,0x7f,0x65,0xd5,0xa8,0xee,0x4a,0xe6,0xf2,0xa9,
+  0x9e,0xe3,0x09,0x84,0x46,0xfe,0x1a,0x76,0x4d,0x5e,0xfd,0x9f,0x5a,0x1e,0xec,0xed,
+  0x1c,0x4f,0x84,0x1e,0x83,0x9f,0xf1,0x1b,0x37,0x15,0x8f,0x34,0x7f,0x55,0xb1,0xf5,
+  0x6f,0xe7,0xbf,0xdf,0x3f,0x81,0xff,0x87,0xf2,0x71,0xda,0x76,0x69,0x4a,0x57,0x75,
+  0x7e,0xfe,0x57,0xf6,0x98,0x7f,0x7e,0x82,0x44,0xef,0x05,0xab,0x02,0xc9,0xa7,0xee,
+  0xcd,0xe7,0x3f,0x2f,0x73,0xd2,0xbe,0xbc,0x44,0xdc,0x1a,0x7d,0xbf,0x19,0x5e,0xa5,
+  0x5e,0xc5,0x22,0xf9,0xf8,0xa7,0xc5,0x9f,0x6c,0xca,0xf7,0x57,0x68,0x14,0x08,0x0b,
+  0x85,0x89,0xb8,0xb2,0xce,0x93,0xff,0xa5,0x64,0xbd,0x3d,0xcc,0x85,0x3d,0xb6,0x3f,
+  0x84,0xf8,0x3f,0x61,0xc4,0x3f,0xcc,0x57,0x61,0xaf,0x87,0xb1,0x9c,0xfc,0xf7,0xdb,
+  0x3d,0x13,0xf7,0xaf,0x95,0x11,0x1a,0xe1,0xd6,0xbc,0x91,0x57,0x3f,0x22,0xdb,0xcf,
+  0xb3,0x71,0x4a,0x76,0x76,0x83,0x36,0xec,0xf1,0xcc,0x77,0x0f,0x5c,0xd4,0xfe,0xcd,
+  0x58,0x3a,0x28,0x9f,0x72,0xe3,0x4d,0x05,0x54,0x04,0xc9,0xeb,0x2f,0xf2,0x38,0x82,
+  0xae,0x87,0x8b,0xea,0x6e,0x23,0xda,0x26,0x2f,0x76,0xc6,0x67,0xf3,0xdf,0xb3,0x6e,
+  0x1f,0xdd,0xf5,0xff,0xc0,0xad,0x09,0xd0,0xd5,0x7d,0xc6,0x02,0x50,0x79,0xb8,0xd0,
+  0xcb,0xff,0xa1,0xd9,0x59,0xec,0x82,0x9d,0xad,0x39,0xf3,0x4d,0x28,0x0a,0xc5,0xfb,
+  0xf0,0x55,0x5d,0xe6,0xd8,0x9f,0x9e,0xca,0xed,0x15,0xfb,0x2d,0xfc,0x83,0x6a,0xd4,
+  0xbd,0xf5,0x04,0xb4,0x6b,0x28,0x11,0x7e,0x46,0x9b,0xba,0x99,0x15,0x3a,0xfe,0x31,
+  0x8b,0xff,0x3c,0x01,0xdf,0xc9,0x0a,0x74,0xbe,0xab,0xef,0x5a,0x89,0xe7,0xa3,0x55,
+  0x2e,0xfe,0xb1,0xf8,0x3f,0xd9,0x61,0xdc,0x16,0x10,0x08,0x4d,0x22,0x22,0x34,0xae,
+  0x87,0x45,0xfe,0x4d,0xf9,0xf9,0x5f,0x16,0xc9,0xca,0x59,0x6f,0xba,0x10,0x3e,0xca,
+  0x27,0x65,0x60,0x24,0xb6,0x40,0x29,0xe9,0xf6,0xbb,0xe7,0x0b,0x2b,0xff,0x7d,0x56,
+  0x97,0x70,0xfb,0x7c,0xc7,0xf2,0xff,0xf4,0xda,0x8e,0xa0,0x31,0xb8,0xcf,0xa8,0x4a,
+  0x76,0xc7,0xbd,0xf9,0xef,0xde,0xfc,0x8b,0x2c,0x0d,0x23,0x60,0x1f,0xcc,0x8f,0xc0,
+  0x56,0xb3,0xf7,0xbd,0x88,0x8e,0xe3,0x9d,0xfd,0x05,0x84,0xdb,0xc4,0x10,0x6f,0xeb,
+  0xb7,0xe9,0xb5,0x5d,0x9e,0xad,0x87,0xe3,0xbf,0x9b,0xfd,0x2c,0xc2,0xd9,0xe7,0xcd,
+  0x90,0xc9,0xf4,0x0a,0xfb,0xfe,0xbd,0xdd,0x9f,0xcb,0xcb,0x7f,0x5f,0x2e,0x5b,0x11,
+  0x31,0xff,0xd7,0xb6,0xbd,0x07,0xa7,0x3a,0x6e,0x4c,0xd5,0xae,0x92,0x67,0xe4,0xd7,
+  0xff,0x31,0x82,0xe9,0xf2,0xd3,0xf0,0x9a,0xd6,0x40,0x85,0xa4,0x2c,0x7b,0xe2,0xdf,
+  0x23,0x9f,0x21,0x2a,0x5a,0x5f,0x0e,0xff,0x07,0x44,0xfe,0x97,0xb5,0x6d,0xa1,0x70,
+  0x93,0x83,0x7f,0xac,0x8d,0xec,0x4c,0xc7,0x6c,0x5d,0x19,0x91,0x4d,0xc7,0xdf,0xfb,
+  0xfd,0xd2,0x2d,0xc6,0x6f,0xed,0xe7,0xa7,0xc4,0x2e,0xc4,0x3f,0xb6,0x45,0x6a,0x7a,
+  0x05,0x81,0x4d,0x15,0xa8,0x46,0xd3,0x49,0x47,0x9f,0x00,0x5b,0xda,0x6c,0xeb,0x24,
+  0xed,0x86,0xeb,0x2c,0xbc,0x44,0x0c,0x22,0xf2,0x57,0xeb,0x07,0xa1,0x3a,0x59,0x14,
+  0xf7,0xd4,0xff,0xa1,0xfc,0x77,0xc4,0x3f,0x46,0xf9,0x8d,0xa8,0xcf,0x27,0x92,0x62,
+  0x7f,0xb7,0x03,0xf1,0xec,0x39,0x25,0x6d,0xa4,0x52,0x45,0x15,0xec,0x68,0x81,0x1b,
+  0xff,0xca,0xba,0x35,0xf6,0xe1,0x7c,0x2f,0xf3,0x05,0x2e,0xfe,0x91,0xa9,0x42,0xdd,
+  0x98,0x11,0x5b,0x35,0x33,0xea,0xad,0xff,0x23,0xd9,0xfa,0x41,0xb5,0xdc,0x24,0xe5,
+  0xda,0xdb,0x37,0xf8,0x98,0xd4,0x30,0x58,0xd2,0x9b,0x93,0xff,0x7e,0x50,0x11,0xec,
+  0x17,0xaa,0xf6,0x23,0xe2,0x5f,0x3f,0x71,0xec,0x79,0xf5,0xdf,0xc3,0x05,0xf5,0x26,
+  0x98,0x9a,0xe9,0x54,0x5b,0xec,0xf7,0xd7,0xf2,0xff,0x4c,0x6f,0xf7,0xc7,0xae,0xa1,
+  0x8d,0x4c,0xf0,0x4f,0x2c,0xff,0xcf,0xad,0x69,0x56,0xc3,0xd3,0x99,0xf0,0x60,0xf7,
+  0x0f,0x99,0x9e,0xc7,0xff,0xa9,0x3d,0xe9,0xb7,0xf8,0xba,0xd3,0x09,0xff,0x38,0xfb,
+  0xdd,0xb0,0xb1,0x8f,0xcf,0x58,0x7c,0x4d,0x2f,0xd3,0x5d,0xbc,0x6d,0xc5,0x3b,0x16,
+  0xf9,0xd3,0x4d,0x96,0x1b,0xc4,0xef,0xfa,0x7f,0x9a,0x14,0x44,0x44,0xdb,0x0c,0xc4,
+  0xe7,0x3e,0xd7,0xff,0xf3,0xcd,0xd5,0xf6,0x7c,0xa3,0xaa,0x08,0xc4,0xd8,0x8e,0xaf,
+  0xbf,0x14,0xfa,0xa1,0x42,0x64,0x29,0x3f,0xc8,0x2e,0xfe,0xa1,0xd9,0xdd,0x00,0xd9,
+  0x6d,0xeb,0xa6,0x9c,0xfd,0x9d,0xf2,0xdf,0x05,0x11,0xe8,0x4d,0x17,0xcf,0x14,0x7c,
+  0x00,0xcf,0x85,0xe7,0xe8,0x81,0xa3,0xf2,0x07,0xda,0x2b,0x16,0xff,0xe7,0x7a,0xfe,
+  0x6b,0x27,0x11,0x9e,0xed,0x36,0x03,0xad,0xfe,0x76,0xd7,0xff,0xa3,0x9d,0x82,0x0d,
+  0x26,0x15,0xd9,0x60,0x27,0x01,0xcf,0x9b,0x19,0xff,0xa8,0x5c,0x05,0x3f,0xc8,0x06,
+  0xc2,0xb4,0x0d,0xbe,0xea,0x3e,0x15,0xf1,0x8f,0xb3,0xde,0xba,0x11,0xcf,0x24,0x9a,
+  0x56,0x18,0x2a,0xe0,0x34,0x93,0xd9,0x78,0x5f,0x9f,0x7b,0x30,0xd7,0xf5,0x7e,0x1f,
+  0xb0,0x15,0xa5,0x6e,0x3e,0xda,0x0f,0x61,0x43,0x77,0xf8,0xdd,0x50,0x8a,0xbd,0x45,
+  0xff,0x90,0x45,0x93,0xfe,0xb8,0xed,0x58,0xdb,0xa0,0xe3,0x51,0x25,0x95,0xf0,0xd6,
+  0x3f,0xfc,0x25,0xf4,0x19,0xb1,0x58,0xb4,0x53,0xfe,0x25,0x3f,0x61,0x52,0x7e,0x9c,
+  0xbf,0x46,0x7a,0x46,0x24,0xee,0x49,0xcf,0xea,0x3f,0x4d,0xd5,0xf5,0x95,0xd4,0x48,
+  0x86,0xb3,0x7f,0x65,0xa4,0x3d,0x9a,0x38,0x9f,0x0e,0xc9,0xa3,0xca,0x45,0xcb,0x1b,
+  0xd6,0xab,0x64,0xf5,0x73,0x8e,0x5f,0xe4,0x0d,0x66,0x91,0x99,0xe7,0xff,0x39,0x1b,
+  0x9f,0x77,0x47,0xf1,0x46,0xda,0xdf,0x07,0x1a,0xc4,0xfd,0xe1,0x65,0xa5,0xc1,0x24,
+  0x46,0xb4,0x7e,0xde,0xa8,0x43,0x68,0xda,0xd9,0xe6,0xe5,0xff,0x70,0xdc,0xa4,0x32,
+  0x91,0xee,0xa6,0xa3,0x14,0x2d,0x35,0xfd,0xa3,0x65,0x51,0x2b,0x91,0xff,0xb1,0xb2,
+  0x37,0x71,0x61,0x54,0x23,0xb4,0x93,0xbd,0xf5,0x0f,0x5b,0xf4,0x5d,0x66,0x4d,0xe4,
+  0x3a,0x60,0xfd,0x1d,0x59,0x18,0x5c,0xa3,0x59,0xf9,0x80,0x85,0xc7,0x8d,0xdd,0xf1,
+  0xed,0x66,0x44,0x63,0xfb,0x72,0xea,0x1f,0xee,0xd9,0x3c,0x2d,0x5a,0xf4,0x59,0x76,
+  0x22,0x8b,0x07,0xc2,0x65,0x16,0x1e,0xf8,0xc7,0xe9,0x3f,0x43,0x68,0x34,0x2d,0xa3,
+  0xbe,0xc8,0x06,0x3c,0xf5,0x7f,0x8a,0xe1,0xbd,0xd0,0xbc,0xd6,0x62,0x19,0x61,0x8f,
+  0xc0,0x3f,0xe9,0xf2,0x80,0xf6,0x3e,0xde,0x9f,0x18,0xd1,0xfc,0x3c,0xcc,0xed,0x0f,
+  0x48,0xf2,0xa6,0x1c,0xfe,0xcf,0x19,0xed,0xa6,0x81,0xda,0xd7,0x11,0x0d,0x5e,0xd6,
+  0x3e,0x6a,0x06,0xdf,0xc5,0xf5,0x63,0x15,0xce,0x6a,0xa6,0x85,0x74,0xad,0xf9,0x6f,
+  0xaf,0x37,0xb7,0xb9,0xfc,0x1f,0xfc,0x7d,0x7b,0x89,0xed,0x99,0xa8,0xa6,0x6a,0x0c,
+  0x8c,0xdc,0x6e,0x35,0x56,0xa2,0xe2,0x7c,0x79,0x47,0xea,0x32,0x34,0x9c,0xf8,0xe8,
+  0x7c,0xf9,0x6f,0xdd,0xf8,0x57,0xe9,0x16,0x4a,0x32,0xa5,0xec,0xd1,0x21,0xcb,0xfe,
+  0xfc,0x2f,0x16,0xb2,0xf1,0x8f,0x38,0x88,0x0d,0xa1,0x85,0x71,0xeb,0x1f,0xf6,0xc1,
+  0x01,0x9d,0x9b,0xd7,0xc5,0xd5,0x56,0x84,0x3d,0x87,0x3a,0xb6,0x66,0xfc,0x0b,0xd8,
+  0x55,0x16,0xf1,0xc9,0x62,0x80,0x7f,0x31,0xe3,0x1f,0xcb,0xa9,0x7f,0xf8,0x6c,0x92,
+  0xeb,0xe1,0x31,0xb5,0x86,0x1d,0x43,0x6d,0xd3,0xf9,0xeb,0x96,0x12,0x1b,0xff,0xf8,
+  0xe0,0xc0,0x72,0xc1,0xc8,0xf2,0xd6,0xff,0xe9,0x81,0xe7,0xf8,0x13,0xe9,0x1d,0x3b,
+  0xe4,0xb3,0xf1,0x4b,0xa9,0x3a,0x3e,0x29,0x25,0x2f,0xe0,0x2f,0x59,0xf8,0xe7,0xfb,
+  0x70,0x89,0x37,0x74,0x04,0x87,0x9f,0xfa,0xaa,0x87,0xff,0xf3,0x3a,0x13,0x7c,0x8c,
+  0x0e,0xf9,0x75,0x75,0x8c,0xce,0xe3,0x60,0x6f,0x4c,0x5d,0x22,0x31,0xaa,0x01,0x8a,
+  0xbb,0x3a,0xbd,0xf5,0x7f,0xde,0x80,0x9f,0x98,0xbb,0x56,0x45,0xd3,0xa9,0x61,0xf8,
+  0xc7,0x14,0xf9,0x7f,0xaa,0xb3,0xfc,0x9f,0x87,0xd8,0x3b,0x3a,0xf1,0x7f,0xd4,0xef,
+  0x54,0x7b,0xeb,0xff,0xfc,0x35,0xc7,0xd7,0x2a,0x8e,0xe7,0x8b,0x61,0x63,0x3f,0x27,
+  0xff,0xcf,0x35,0x35,0x4e,0x22,0x52,0x17,0x25,0x22,0xc1,0x26,0x96,0x93,0xff,0xae,
+  0x3c,0x04,0xcc,0x68,0xfd,0xe7,0xc2,0x61,0x7d,0xbf,0xe5,0x2f,0xb2,0xc7,0x27,0x86,
+  0x39,0x5d,0x61,0x39,0xfe,0x9f,0x96,0x1a,0xad,0x53,0xd7,0xb3,0xf1,0x20,0xae,0x13,
+  0xff,0x47,0xe1,0x6e,0x60,0x48,0xd7,0x29,0x35,0x2c,0xa7,0xfe,0x8f,0x36,0x24,0xd5,
+  0x55,0x04,0xd6,0xca,0x02,0xdd,0xc1,0xf3,0x6b,0xe5,0x2a,0x4f,0xe1,0xc7,0xb6,0x5d,
+  0x94,0xff,0xfe,0x8e,0x63,0x7f,0x7a,0xa6,0xbc,0x00,0x17,0x4b,0x9f,0x34,0x96,0x26,
+  0xe5,0x33,0xea,0x6f,0x2c,0xff,0x8f,0x5d,0x08,0x51,0xa3,0x54,0xf7,0x86,0x96,0x99,
+  0xa3,0xf2,0x29,0x27,0xff,0xb4,0xbb,0xe0,0x0c,0x3c,0xab,0xde,0x44,0x24,0xe7,0x33,
+  0xf0,0x4d,0xd4,0x06,0xfe,0xe1,0x1b,0x5c,0x8c,0x6f,0x43,0xfb,0x76,0xf1,0xba,0xba,
+  0xe5,0x81,0x41,0x69,0xb1,0x87,0xff,0x33,0x02,0xdd,0x46,0xb8,0xbb,0x9b,0x37,0x65,
+  0x58,0x37,0x6c,0x03,0x0a,0x7b,0xf1,0x2c,0x22,0x1a,0x81,0x7d,0x2d,0xdb,0xd4,0x08,
+  0x2f,0x2b,0x71,0xf4,0xa9,0x0a,0xfe,0xcf,0xaa,0xa6,0x88,0x96,0x40,0x41,0xc5,0xf9,
+  0x56,0x24,0x9e,0x76,0xe7,0xbb,0x55,0x8d,0xb4,0xa9,0x5a,0x59,0x53,0xa9,0xfd,0xfc,
+  0xc4,0x7f,0x5e,0x0f,0x2b,0x5a,0xd5,0x6f,0xb1,0x53,0x50,0x64,0x84,0x3d,0x78,0x32,
+  0x7d,0x15,0xfe,0x22,0xda,0x0c,0xa3,0x7b,0x57,0xb8,0xd0,0xb1,0x0f,0xdb,0x2a,0x8f,
+  0xb0,0xa3,0x08,0x5a,0x02,0x3d,0xf2,0x30,0xff,0x24,0xaf,0x13,0x78,0xc6,0xcc,0x22,
+  0x9c,0x5f,0x6a,0x67,0xe1,0xab,0x46,0x54,0x93,0x57,0x79,0xf2,0xb3,0xbe,0x07,0xef,
+  0xaa,0xe4,0xe4,0xb1,0xc2,0x5e,0xb4,0x1e,0x4e,0xd9,0x88,0xe8,0x1d,0x1c,0x3f,0x97,
+  0x34,0x70,0xd8,0xcb,0xff,0x21,0x23,0x5f,0x24,0xe2,0x8f,0x23,0xba,0x60,0x3b,0xdf,
+  0x69,0x03,0xa1,0x2a,0x18,0xd1,0x1a,0xa4,0x40,0x4e,0xfe,0x57,0xc1,0x8d,0xc6,0x21,
+  0x5e,0xcd,0x23,0x99,0xc4,0xcb,0x35,0xf7,0x75,0x87,0x11,0xf6,0x94,0x65,0xf9,0x3f,
+  0x6f,0xde,0x1b,0x69,0x3f,0x64,0x96,0xf0,0x81,0x37,0x72,0xea,0x1f,0x2e,0xd5,0x76,
+  0x1a,0xb5,0xf1,0xd6,0x05,0x4d,0xc7,0xf9,0xf7,0x0d,0x11,0x7d,0xc8,0x56,0x04,0x9a,
+  0xcb,0x3e,0x01,0x07,0x06,0x02,0x66,0xd1,0x5c,0x76,0xcc,0xb1,0x9f,0x5b,0x17,0x4d,
+  0xd6,0x77,0x1a,0xff,0x7e,0x58,0xc4,0xaf,0x1f,0xa1,0xf7,0x77,0x8d,0x1d,0x18,0x5a,
+  0xc5,0xee,0xa0,0xf7,0x77,0xa0,0x28,0x7e,0x95,0x6b,0x7f,0x7a,0xd5,0xa9,0xea,0x19,
+  0xde,0x18,0x0f,0x20,0xfe,0xd1,0xde,0xe1,0x3b,0x71,0x5b,0x69,0x76,0x10,0xd1,0xa7,
+  0x63,0x1f,0xf0,0xfa,0xb7,0x66,0xe6,0xd6,0x3f,0x4c,0x59,0xa7,0xfb,0x64,0xf9,0x71,
+  0x78,0x89,0xb6,0xf5,0x43,0x9d,0xef,0xd8,0x11,0x90,0xad,0x54,0x8f,0x74,0xb0,0x30,
+  0xe5,0xa9,0x7f,0x68,0x16,0xbc,0x6a,0x1c,0xa7,0x24,0x65,0x3c,0xbf,0x9b,0xcf,0x51,
+  0xfc,0x62,0xac,0xf3,0x90,0x2e,0xf0,0xcf,0x90,0xfc,0x01,0x7c,0x90,0x9c,0x73,0x32,
+  0xb0,0x0a,0xd1,0xb9,0xcb,0xff,0xd9,0x0c,0x6b,0xf5,0xaa,0x63,0x08,0x72,0x5e,0x69,
+  0xb9,0x9f,0xdc,0xce,0x0e,0x11,0x7a,0x11,0xfb,0xf9,0x12,0x4a,0x04,0x53,0xef,0x64,
+  0x2e,0xdf,0x4f,0x83,0x2d,0x65,0x5d,0xea,0x5f,0x0f,0x86,0xda,0xd8,0x2b,0x5d,0xeb,
+  0xac,0xf9,0x6e,0xd1,0xf7,0xc2,0x34,0xd3,0x1f,0x67,0x2f,0xc0,0x21,0xa6,0x9b,0x6a,
+  0xdc,0x07,0x39,0xf9,0xef,0x3c,0xbe,0x2d,0x83,0xfb,0xe3,0x51,0x3d,0x91,0xd2,0x29,
+  0x0c,0x54,0x6c,0xe9,0x13,0xf0,0x8d,0xdb,0x9d,0xc1,0xf1,0x91,0xa6,0x90,0xb3,0x3e,
+  0xc7,0x2a,0x7f,0x04,0xa6,0x39,0xaf,0x2d,0xba,0x45,0xfe,0x35,0x3c,0x33,0x50,0x47,
+  0xdb,0xd0,0x93,0x16,0xe3,0x22,0x2d,0x0f,0xc4,0xc7,0x32,0x73,0xcc,0xe8,0xbe,0xce,
+  0x19,0x1e,0xfe,0xcf,0x29,0x72,0xfb,0x0c,0x2e,0xfd,0x96,0x7c,0xda,0xc8,0x9e,0x37,
+  0xa9,0x30,0xcb,0xd7,0xc9,0xf1,0x3e,0x6c,0x39,0x82,0x52,0xcd,0x2e,0xfe,0x19,0xd4,
+  0x2e,0xe8,0x63,0xdb,0xe7,0xe0,0xa1,0xbe,0xf3,0xeb,0xca,0x73,0xb8,0x9b,0x13,0x10,
+  0xd2,0x9f,0x27,0x18,0x70,0x46,0x1e,0x85,0x7e,0xf2,0x08,0xf5,0xcb,0xdc,0x13,0xff,
+  0xfa,0xa2,0xbe,0xaf,0x2a,0x7c,0x92,0x75,0x87,0x4b,0x8c,0x04,0x45,0x73,0xd2,0x16,
+  0xff,0x96,0xf8,0xcf,0xaf,0x1b,0xbd,0x7c,0x9e,0x79,0x6b,0x20,0x17,0xff,0xf0,0x03,
+  0x08,0x03,0x5a,0x7b,0xb6,0xad,0xd6,0xd6,0xb7,0x65,0xc7,0x3b,0x85,0x10,0xbf,0xaf,
+  0xe1,0x95,0x54,0x59,0xca,0xc3,0x7f,0x56,0xb4,0x7d,0x8a,0xce,0x71,0xd3,0x8f,0x52,
+  0xf4,0x99,0xf2,0x73,0x03,0x76,0xe1,0xdf,0xd3,0x28,0x28,0xa6,0x5f,0x07,0x37,0xff,
+  0x9d,0x17,0xaf,0xd6,0xc8,0xed,0x13,0xe5,0xf2,0x6a,0x65,0x80,0xfc,0x3f,0xed,0xf8,
+  0x87,0xd9,0x42,0xbb,0x54,0xb1,0x04,0x9f,0x9f,0xcb,0x3c,0xa7,0xfe,0xe1,0x05,0x78,
+  0x92,0x07,0x4d,0x79,0x30,0xcb,0xff,0xf1,0x24,0x32,0xdb,0x44,0xa0,0x11,0x67,0xfd,
+  0x1c,0x96,0x70,0x10,0xbf,0x3e,0x55,0xf2,0xd9,0xe6,0x85,0x70,0x51,0x99,0x43,0x69,
+  0x83,0x54,0x51,0xf3,0x86,0x4c,0xf0,0x6c,0xf5,0x20,0xbc,0x92,0xb8,0x5e,0x2f,0x1e,
+  0x92,0x63,0x2e,0x5f,0x48,0x3b,0x4d,0x66,0xb6,0x55,0x4d,0x86,0x71,0xa3,0x8f,0xcc,
+  0xc8,0x64,0x13,0xe1,0x67,0x64,0xfc,0xbb,0xf0,0xa7,0xe9,0xe6,0x61,0x1d,0x4d,0xb7,
+  0xee,0xe6,0x7f,0xc1,0x46,0x69,0xb7,0x1a,0x7e,0xaa,0xbb,0x8e,0x05,0x38,0x5a,0x57,
+  0xaa,0xbe,0x7b,0x1c,0x0f,0xb6,0x8a,0x79,0x6d,0x1d,0xda,0x9f,0x24,0xd4,0x40,0x91,
+  0xc6,0xc2,0x92,0xbd,0x7e,0xcc,0xd2,0xd3,0x15,0xbb,0xc9,0xfe,0x1f,0x64,0x33,0x61,
+  0x3f,0x9f,0x61,0x27,0xc2,0x0b,0xc5,0x12,0xe3,0x71,0x7a,0xaa,0xa8,0x87,0xa5,0x9d,
+  0xf7,0x57,0xf0,0x73,0xb4,0xba,0xbb,0x03,0xbd,0xfe,0xa8,0x71,0x99,0x14,0x95,0x96,
+  0x4f,0xc1,0xbb,0xb8,0x7e,0xfc,0x69,0xf9,0x17,0x30,0xa4,0xcf,0x8b,0x7f,0xf3,0xbb,
+  0x7e,0x70,0xf8,0x3c,0x19,0x38,0xa8,0x5c,0xe4,0x4f,0x1a,0x54,0xfd,0x40,0x84,0x11,
+  0x51,0x2d,0x1f,0xb4,0x5e,0x4e,0x0a,0xe1,0x7d,0xe5,0x42,0xea,0x26,0x28,0x19,0xec,
+  0x6c,0x77,0xf3,0xdf,0x85,0xbf,0xb1,0xae,0xad,0x38,0x2d,0xcf,0x84,0x67,0x34,0x11,
+  0x6d,0x1c,0xb6,0xf1,0xf6,0x08,0x8c,0x2c,0x5b,0x80,0xf8,0xc7,0xef,0xf2,0x61,0x86,
+  0x24,0xca,0x07,0xd4,0x8d,0x82,0xb4,0x7f,0x35,0xdc,0xca,0xeb,0x05,0x0c,0x86,0x27,
+  0x98,0x28,0xa4,0xd0,0x04,0xdc,0xd4,0xb9,0xaa,0x35,0xbb,0xfc,0x9f,0x91,0x82,0x25,
+  0x7c,0x37,0xa4,0x8c,0xa2,0x34,0x5a,0x73,0x7f,0x46,0x84,0xbd,0xfa,0xed,0xfd,0xda,
+  0xc4,0xd3,0x42,0x64,0x3b,0x42,0x47,0x37,0xfe,0xf5,0x9e,0x34,0x55,0xda,0xcb,0xab,
+  0x57,0xee,0x3f,0x1b,0x9e,0x6a,0xc7,0xbf,0x7e,0xa6,0xee,0xe5,0xd7,0x09,0xc7,0x88,
+  0x8a,0x67,0xf1,0x54,0xeb,0x8b,0x9e,0x1a,0xe6,0x54,0xff,0xf0,0x3c,0x39,0x61,0x62,
+  0x8c,0xb3,0xa7,0xf4,0x18,0x39,0x4e,0xfb,0xe1,0x5d,0x2d,0x4a,0x8e,0xa0,0x7e,0x3c,
+  0x4c,0xcf,0x4f,0x06,0x40,0x3e,0x71,0x95,0xa3,0x4f,0xab,0xfe,0xb3,0x81,0xb0,0xf6,
+  0x37,0x06,0xf1,0xa3,0xfc,0xef,0xe2,0xfe,0x95,0x5d,0x3f,0x6b,0x60,0x0f,0x6b,0xe4,
+  0xc1,0xb6,0xe6,0xa1,0x42,0x7b,0xbe,0xd9,0xfa,0x3f,0x46,0x71,0xda,0x5f,0xa5,0x5d,
+  0x86,0x3c,0xfd,0x24,0x4c,0xa9,0x2e,0x53,0x9c,0x94,0x9b,0xf2,0xeb,0xff,0x18,0x59,
+  0xfe,0xb3,0xf0,0x27,0x3b,0x85,0x55,0x8f,0xeb,0x6b,0xa1,0x8a,0xab,0x6d,0xbe,0x32,
+  0xa7,0x9e,0xe1,0x22,0xf8,0x2e,0xae,0xe6,0xaa,0x15,0xea,0x18,0xbb,0x46,0x17,0x61,
+  0x3e,0x9c,0xaf,0xe3,0x11,0xd2,0x37,0xf2,0xaa,0xad,0x45,0xaf,0xb0,0x45,0x79,0xfe,
+  0x1f,0x7d,0x45,0x64,0x3e,0xfb,0xb8,0x7d,0xbe,0x40,0x7d,0x72,0x3a,0xcf,0x16,0x3e,
+  0xc3,0x13,0x47,0xf5,0x94,0x7a,0x55,0xd9,0x32,0x27,0x3e,0x68,0xf9,0x7f,0x66,0x27,
+  0x03,0x5f,0x2a,0x9f,0x61,0x9c,0x43,0x44,0x49,0xfe,0x1f,0xe9,0x1c,0x17,0xf8,0xe7,
+  0x6d,0x78,0x0e,0xe6,0xec,0x2b,0x1e,0x91,0xef,0x76,0xea,0xcf,0x58,0xfe,0x9f,0x43,
+  0x52,0x09,0xef,0xcc,0xa8,0x74,0xfa,0xb8,0x5f,0x14,0x82,0xd6,0x68,0x3f,0x2a,0x37,
+  0x61,0x4c,0x3b,0x14,0x1a,0x57,0xff,0xf9,0x28,0xec,0xa2,0xfc,0xa0,0xa8,0xd2,0x87,
+  0x40,0x31,0x98,0xfc,0x13,0xba,0x22,0xf6,0xbb,0x28,0x9c,0x4d,0x7e,0x95,0x42,0x63,
+  0x2c,0xa7,0xfe,0x61,0x87,0x11,0x26,0x27,0xc3,0x34,0x58,0x6f,0xcc,0xa3,0xfd,0xb7,
+  0x1f,0xc7,0x13,0x9e,0x59,0xb1,0x9d,0x75,0x18,0xf3,0x96,0xdf,0xaa,0x79,0xbc,0xf3,
+  0x21,0x45,0x81,0xf5,0x8b,0xc2,0x6d,0x37,0xd2,0xf8,0x87,0x8c,0x19,0x38,0xac,0x6c,
+  0x25,0x3c,0xe4,0xf8,0x7f,0x60,0x46,0x8b,0x6f,0x13,0x73,0xe8,0x15,0x10,0x00,0x2a,
+  0x13,0x1d,0x36,0xae,0xa6,0x6a,0xc6,0x0f,0xe8,0xdb,0x69,0xd8,0x30,0xb3,0x0b,0x41,
+  0x23,0xf4,0xaa,0xa1,0x88,0x8f,0xec,0xe4,0x63,0x8e,0xa9,0x77,0x1a,0x03,0x6d,0xb1,
+  0x8a,0x4f,0x22,0xec,0x69,0x1a,0x5c,0xb6,0x80,0xf2,0xfd,0xe3,0x94,0x76,0x4d,0xf1,
+  0xaf,0x38,0xaa,0x6e,0x06,0x94,0x70,0xff,0x3c,0x87,0xff,0xb3,0xf1,0xea,0x61,0x46,
+  0x6c,0x9f,0x92,0x76,0x79,0xd8,0xf8,0x95,0xd6,0x40,0x6c,0x16,0x2a,0x63,0x28,0xe6,
+  0xbb,0xa3,0xed,0x32,0x5c,0x67,0x4c,0x6a,0x93,0x7f,0xe1,0xd8,0xf3,0xee,0x02,0xd2,
+  0x46,0x5d,0x5b,0x60,0xb3,0x5c,0x93,0x7c,0x26,0x73,0x23,0x0d,0xdb,0xee,0xfa,0x8b,
+  0x9e,0xa6,0x5b,0x0d,0xfa,0x99,0x9b,0xff,0xae,0x9d,0xec,0xea,0x4e,0x6d,0xd3,0x23,
+  0xf7,0xfa,0xaa,0xd9,0xc6,0xc1,0x6d,0xe0,0x2d,0x84,0x58,0x65,0x10,0x23,0xfa,0x56,
+  0x5e,0x56,0xe8,0xf2,0x7f,0xf0,0x7c,0xb1,0x56,0xad,0x6a,0x55,0x97,0xb1,0xca,0xd4,
+  0x5a,0xc1,0xee,0x76,0xfd,0x3f,0xfd,0xa1,0xec,0xc4,0xaf,0x91,0xec,0xf9,0xf6,0x54,
+  0x76,0x01,0x2e,0xc2,0x36,0xb5,0x2d,0x5c,0x81,0xab,0x31,0x8b,0x7f,0x6e,0x14,0xfa,
+  0x0c,0xaf,0x26,0x46,0x74,0x5c,0x7e,0x80,0x7d,0xc9,0xa9,0x7f,0x95,0xaa,0x1c,0x66,
+  0x47,0x11,0xf6,0xd0,0xf3,0xe3,0x44,0x16,0x64,0xfd,0x39,0x49,0x2b,0x11,0xbe,0xe9,
+  0xa8,0xd9,0xd0,0x84,0x82,0x9b,0xff,0x2e,0xfc,0x3f,0x3a,0x7e,0xbb,0xb9,0x7a,0x98,
+  0x8f,0xcb,0xff,0xaa,0x39,0x6b,0x0a,0x46,0xf4,0x26,0x0f,0xfe,0xb1,0xe2,0x5f,0x01,
+  0x72,0xfb,0x1c,0xb7,0x04,0x5a,0x81,0x5f,0x27,0xfc,0xb3,0x08,0x46,0x06,0xeb,0x62,
+  0xc5,0x1d,0x72,0x22,0x87,0xff,0x4c,0xd9,0xee,0xd9,0xf8,0x57,0x75,0x87,0xea,0x49,
+  0x84,0xbf,0x49,0xbb,0x0f,0xed,0xc3,0x86,0x55,0xe5,0x4d,0xce,0x7a,0x88,0x74,0x05,
+  0xa8,0x5e,0x56,0xc6,0x47,0x69,0x14,0x9b,0xb8,0xce,0xbd,0xc4,0xb9,0x4f,0x69,0x0f,
+  0x73,0xbd,0xff,0xea,0x48,0x5d,0xc2,0xb1,0x3f,0x55,0x80,0xa7,0x15,0xa3,0x6a,0xd0,
+  0xf7,0x15,0x36,0x05,0xfe,0xd9,0xa8,0x4a,0xd9,0x44,0xbe,0x3e,0x3a,0xbf,0xd0,0xfb,
+  0x48,0x2f,0x72,0xab,0xe1,0xdc,0xbf,0x7b,0xaa,0x76,0x89,0xef,0x4e,0xd5,0x8e,0xe0,
+  0xc1,0xe5,0x35,0xbe,0x33,0x15,0xb5,0x1c,0x41,0x33,0xe9,0x7c,0x7d,0x1b,0xbc,0xd1,
+  0x75,0x97,0x5e,0xbc,0x4a,0xde,0xe0,0x2c,0x68,0x75,0x72,0xaf,0xf0,0xbe,0x16,0x93,
+  0x1b,0xf6,0x6d,0x3a,0x86,0x38,0xfe,0x8d,0xbd,0xf2,0x69,0x8d,0x18,0x79,0x68,0xb8,
+  0xdc,0x78,0x9f,0x29,0xea,0x3f,0xcf,0x21,0xfc,0x33,0x0f,0x2e,0xf0,0x39,0x16,0x91,
+  0xf5,0x79,0x72,0x04,0x5d,0x90,0xeb,0xd8,0xb3,0x5d,0x73,0xaa,0x4a,0xc6,0xe4,0x41,
+  0xc7,0x9e,0xec,0x28,0xed,0x31,0x1e,0x83,0x6a,0x2a,0x32,0x56,0x41,0xde,0x1e,0x2e,
+  0x1c,0x41,0xdf,0x13,0xfe,0x1c,0x79,0x39,0xac,0xd5,0xaa,0xba,0x10,0x11,0xbd,0xe5,
+  0xec,0x17,0x3d,0x7c,0x0b,0x1c,0x54,0xc9,0x29,0x84,0x5b,0xec,0x63,0x5c,0x8c,0xbf,
+  0x60,0x17,0xae,0x87,0x38,0x2e,0x15,0xcd,0xf7,0x95,0x44,0xca,0xd1,0xff,0xca,0x8a,
+  0x01,0x0a,0xeb,0x84,0x01,0x98,0x4c,0xd9,0x85,0xdc,0x2e,0x6c,0xd2,0x87,0xf6,0xff,
+  0x93,0x5a,0x87,0xa6,0x4f,0xc3,0xf3,0xd7,0xa0,0x07,0xff,0xec,0xa0,0xfa,0x3f,0x27,
+  0x03,0x31,0xff,0x4c,0x9c,0xf8,0x2e,0x6b,0xbe,0xb8,0xbf,0x53,0x85,0x96,0x59,0x70,
+  0xd4,0xac,0x33,0x4b,0x0e,0xca,0x2e,0x1f,0x89,0x03,0xf1,0xc3,0x0f,0xa1,0x75,0xad,
+  0x3e,0x6e,0x9c,0x73,0xf4,0xc3,0x85,0xbd,0x7d,0x56,0x3f,0xab,0x0b,0x06,0x82,0x5b,
+  0x7f,0xb8,0x4f,0xa3,0x7a,0x77,0x8d,0x7c,0x49,0xa6,0x73,0xbe,0xfe,0x14,0xcc,0xe1,
+  0x5e,0x3c,0x50,0x0f,0xcf,0xf6,0xcf,0x21,0xaa,0xb0,0xe9,0xec,0x77,0x7d,0x5d,0xf3,
+  0xe1,0x10,0xcc,0x44,0xfc,0xdc,0x34,0x1f,0x7e,0x04,0x33,0x72,0x0a,0x11,0xff,0x07,
+  0x21,0x96,0x94,0x4a,0xfc,0x67,0xfb,0xf7,0x42,0xfc,0x23,0xaa,0x83,0x16,0xe1,0xb1,
+  0x4b,0xc1,0xdd,0x39,0x67,0x7c,0x0d,0xac,0x57,0xc3,0xba,0x6f,0x5f,0x22,0xe3,0xe4,
+  0x53,0xa8,0x8a,0x2a,0xe2,0xef,0x7e,0xb4,0x3f,0x90,0x72,0x88,0xaf,0x2c,0x4b,0xfc,
+  0x58,0x4f,0x4b,0x37,0xc6,0xdc,0xfa,0x1b,0x88,0x7f,0x44,0x91,0xd5,0x62,0xc0,0xf5,
+  0x7f,0x14,0xe6,0x79,0xd6,0x43,0x3b,0xa3,0x37,0xae,0x8e,0x4a,0x25,0x98,0x2e,0xfe,
+  0xf9,0xd7,0x31,0x38,0x03,0x8d,0x10,0x30,0xe5,0x51,0xf5,0x22,0xdc,0x44,0xf3,0x7d,
+  0xc5,0xf6,0x77,0x5d,0x40,0xd3,0xf4,0x64,0x47,0xc9,0xa8,0x9c,0x71,0xf1,0x8c,0x74,
+  0x0e,0x2e,0xf3,0x1b,0xe2,0x1b,0x96,0xcb,0x75,0xda,0xf3,0x75,0x73,0x86,0x03,0x19,
+  0x7f,0x8c,0xf8,0xf3,0x94,0x1f,0x77,0x0e,0x0f,0xfe,0xbb,0xe3,0x4b,0xc6,0x3c,0xfc,
+  0x1f,0x13,0xde,0x81,0x1b,0xf9,0x36,0x22,0x01,0xce,0x80,0xfb,0x5b,0x22,0xa6,0x2f,
+  0xdd,0x54,0x65,0x6c,0xe0,0xb3,0x32,0x88,0x37,0xbe,0x4f,0x1e,0x9b,0xb8,0x6f,0x9f,
+  0x87,0xff,0x33,0x20,0xf8,0xcf,0xc2,0xec,0xe8,0xf0,0x70,0x0c,0xd1,0x2f,0x2f,0xec,
+  0x2a,0xcb,0xfa,0x7f,0x46,0x60,0x83,0x16,0x01,0x9c,0xaf,0x87,0xff,0x53,0xfa,0x08,
+  0x3c,0x11,0x5f,0x61,0x6c,0xd8,0x52,0x16,0x09,0xff,0x00,0xe8,0xfe,0x6c,0x87,0x5d,
+  0x58,0x1b,0xef,0x0f,0x33,0xe2,0xf7,0xa6,0x57,0x8c,0x3a,0xef,0xaf,0x51,0xf1,0x23,
+  0x38,0x6f,0xe2,0xb1,0x6b,0xfe,0xc7,0x75,0xc1,0xff,0x89,0xfe,0x07,0x5a,0x83,0x2c,
+  0x3e,0x3c,0xa6,0x1f,0x63,0xf3,0xf5,0x8d,0xa8,0x1f,0xb7,0xfe,0x21,0x88,0xfd,0x7d,
+  0xe4,0x13,0x84,0x06,0x2d,0x7e,0xaf,0xbf,0xdd,0x5e,0x0f,0xfb,0xe0,0x92,0x71,0x83,
+  0x11,0xcc,0xeb,0x7f,0xa1,0xbe,0x4c,0x7c,0xc5,0x9d,0xfe,0x2a,0xe5,0x6d,0x86,0xab,
+  0x71,0x3b,0x1a,0x3a,0xab,0x10,0x50,0x67,0xaf,0xf1,0x16,0x34,0xe8,0xc1,0x74,0xf3,
+  0x4f,0xdc,0xfd,0x5d,0x89,0xc2,0x6e,0xa3,0x76,0xd0,0xff,0x18,0x93,0xe3,0xaf,0x21,
+  0x0c,0x53,0xe7,0xb0,0x28,0xdf,0x00,0xb3,0xe8,0xf9,0x67,0x40,0x02,0x4a,0x6a,0x4a,
+  0xf6,0xb1,0x0f,0xf2,0xe3,0x5f,0xad,0xa8,0x0d,0x40,0x98,0xad,0xf7,0xf9,0xe6,0xfa,
+  0x5a,0x6d,0x3c,0xec,0xc3,0x57,0xa9,0x86,0xfb,0x6e,0xf2,0xe0,0x9f,0x77,0x29,0xfe,
+  0x65,0xce,0x8c,0xff,0x3f,0x88,0x07,0xe0,0xc1,0xd4,0x34,0xdc,0x84,0xd9,0xa7,0x6d,
+  0x20,0x74,0x0d,0x6c,0xe6,0x33,0x6b,0x7c,0x6b,0xd8,0x05,0x27,0xfe,0xde,0x8a,0x2b,
+  0xe7,0x7d,0xb5,0x9e,0x60,0x0f,0x68,0xbf,0x80,0x18,0xb9,0x7d,0x56,0xe1,0xfd,0xeb,
+  0xcd,0xe0,0x6e,0x59,0x35,0x46,0x6f,0xaf,0x87,0xa9,0xb3,0xbd,0xfc,0x9f,0x29,0x7b,
+  0x04,0x6c,0x9e,0x34,0x2a,0xbf,0x68,0x5c,0x8e,0x34,0x5a,0xf9,0x02,0xa8,0x9f,0x13,
+  0xc1,0x77,0xfd,0x43,0xa5,0xa7,0x71,0x3f,0xfa,0xf3,0x77,0x65,0x4f,0x3d,0x8d,0x82,
+  0x53,0xf0,0x4c,0x1c,0xcf,0xb3,0xf3,0x65,0xe0,0xff,0x8f,0xf0,0x86,0xc9,0x11,0x10,
+  0xf9,0x5f,0x69,0x91,0x51,0x5e,0x9f,0x42,0xe8,0xe8,0xcd,0x7f,0xdf,0x0c,0x93,0xd4,
+  0x99,0xb8,0x3f,0xb2,0x10,0x74,0x6a,0x37,0x98,0xbe,0x76,0xb6,0x07,0xed,0x49,0x74,
+  0x00,0x0d,0xe9,0x20,0x9d,0x1f,0xa1,0xa4,0x3d,0xfc,0x9e,0x1b,0x0f,0xc2,0x4b,0xd6,
+  0xec,0x7c,0x57,0x55,0x11,0xed,0x47,0x9d,0x8f,0xd3,0xa4,0x42,0x88,0xea,0x9a,0x15,
+  0x2f,0x91,0x07,0x8c,0x0a,0x41,0x7b,0xf3,0xdf,0x9f,0x86,0x4e,0x33,0xda,0xff,0xe7,
+  0x35,0x8c,0x75,0x74,0xc2,0x74,0x5a,0x3f,0x1b,0xad,0xfc,0x82,0x34,0xfb,0x31,0xec,
+  0xba,0x85,0x4a,0x73,0x34,0x79,0xf3,0xdf,0xf7,0x19,0xc7,0x86,0x1a,0x52,0xc1,0xd7,
+  0x65,0x1f,0x9e,0x37,0x77,0x71,0x3c,0x28,0xcd,0xd7,0xde,0xb2,0xf2,0xdf,0xc7,0xba,
+  0x2e,0x99,0x8d,0x1d,0xf7,0xeb,0xd5,0xe7,0xbd,0xf5,0x0f,0x9b,0xf2,0x69,0xcf,0xaf,
+  0x5b,0xf9,0xef,0x5d,0x94,0xff,0xa5,0x11,0x35,0x57,0xce,0x89,0x7f,0xc1,0x79,0x4a,
+  0xfb,0xda,0x2c,0x9f,0xee,0x7a,0x1d,0x81,0x62,0x49,0x8f,0xac,0x50,0xd9,0x28,0xba,
+  0x22,0x1c,0x41,0xb8,0x3f,0x36,0x77,0xe6,0xc6,0xbf,0xcc,0xda,0xe5,0xfe,0x2d,0xe1,
+  0x53,0x2a,0xbe,0xef,0x86,0xfa,0x80,0x6f,0x9a,0x21,0x88,0x28,0xff,0x1c,0x9e,0x6e,
+  0x39,0x22,0xbe,0x83,0xaf,0x92,0xe3,0xff,0x01,0x51,0xff,0xa7,0xf5,0x5a,0x2b,0x5f,
+  0x3b,0x6c,0xf8,0xd2,0xbe,0x99,0xda,0x43,0x96,0x85,0xd9,0xce,0x45,0x69,0xe8,0x4d,
+  0x5e,0xff,0x0f,0x28,0x54,0xe6,0xce,0xb8,0x96,0x60,0x61,0x87,0x5e,0x63,0x13,0x81,
+  0x70,0x05,0x6a,0x85,0x5d,0x14,0x11,0xbb,0x53,0xd6,0xd8,0x2d,0x2e,0xff,0x47,0x75,
+  0xe2,0x5f,0x23,0xca,0x48,0xdb,0xae,0x8a,0xfb,0xc8,0xff,0x93,0xc5,0x3f,0x29,0x2d,
+  0xfb,0x95,0xcb,0xff,0xe9,0xb9,0xfa,0x05,0x38,0xab,0x88,0x24,0x2f,0x7c,0x1e,0x8a,
+  0x7f,0xfd,0xc4,0x2f,0xfc,0x3f,0x2d,0x4b,0x93,0x8b,0xbe,0x02,0x54,0x08,0x28,0x98,
+  0xac,0xde,0xe6,0xe8,0xb3,0x5b,0xf4,0xbf,0x68,0xa0,0xf3,0xc8,0x19,0x38,0xaa,0x2e,
+  0x68,0x53,0x06,0xfd,0x73,0xa9,0x10,0xe2,0x2d,0x81,0x9f,0xe0,0x95,0xb3,0x30,0xc7,
+  0xa0,0xfa,0x87,0x8e,0xfd,0xa1,0xf8,0xd7,0x48,0x36,0xdb,0x8b,0x75,0x2b,0xe4,0x88,
+  0xde,0x14,0xa1,0xfa,0xcf,0xa0,0x26,0x44,0x45,0x44,0x51,0x08,0xe8,0x39,0x07,0x9f,
+  0x8b,0xf8,0x17,0xaf,0x35,0x3e,0xa9,0x15,0xf6,0x4b,0x1d,0xbe,0x88,0xd1,0x5a,0x5a,
+  0xd2,0xa5,0x13,0xfe,0x29,0x12,0x85,0xaf,0x2b,0xc2,0xf8,0x15,0xf3,0xf0,0x7f,0x2a,
+  0x1f,0x89,0x3d,0x1a,0xae,0x35,0xd5,0x24,0x9c,0x36,0xd6,0x8b,0xb2,0x3f,0x25,0xdb,
+  0x0d,0xc2,0x3f,0xd7,0x25,0x57,0x50,0x21,0xa0,0x6d,0x14,0x2f,0x3b,0xe5,0xd6,0x57,
+  0xa9,0xf8,0xf7,0xc9,0x2f,0x76,0xd5,0xff,0x55,0xf1,0xe6,0xcf,0x0f,0x73,0xc2,0x3f,
+  0xd1,0xa4,0xff,0x11,0xed,0x1f,0x45,0x46,0x64,0x35,0xa5,0xfe,0xc5,0x5a,0x11,0xff,
+  0xf7,0x3a,0xf3,0x25,0xfc,0x73,0x1d,0x6f,0x38,0x19,0x4c,0x2e,0x72,0xcb,0x20,0x88,
+  0x7a,0x98,0x25,0x94,0xda,0xfc,0x6e,0xc1,0xd4,0x56,0x44,0x8c,0xde,0xf8,0x17,0xf9,
+  0x7f,0x1a,0x24,0x51,0x76,0x72,0x44,0x10,0x81,0xaa,0xf5,0xec,0x2f,0xd2,0x99,0xd1,
+  0x46,0x60,0x57,0x2c,0x2f,0xff,0x3d,0x42,0x24,0x9f,0x7d,0xfe,0xe1,0xc4,0xf2,0x8a,
+  0x7b,0xa5,0x70,0x87,0x9a,0x81,0x05,0x5c,0xe0,0x1f,0xaa,0xff,0x7c,0x0e,0xaa,0xbb,
+  0xfd,0xbf,0xf0,0xd6,0x3f,0x5c,0xbb,0x84,0xa2,0x0f,0xe0,0x9f,0xd1,0xb4,0xd8,0x7c,
+  0x82,0x85,0xfb,0x7c,0x8f,0x25,0x6e,0xeb,0x11,0xc4,0x5d,0x9d,0x1d,0x31,0x84,0xe9,
+  0xa6,0xfe,0x17,0x0e,0xfe,0x91,0x26,0xc3,0xe3,0xbe,0x99,0xdc,0x1f,0x67,0xcb,0xd5,
+  0x07,0xf5,0xaa,0x7e,0xd0,0x99,0x87,0x48,0xbc,0x9b,0xe2,0xd7,0x6d,0x65,0x9e,0xfa,
+  0x87,0xea,0x54,0xed,0x0c,0x5f,0x58,0x13,0x5c,0x45,0xb4,0x9f,0xd4,0xee,0x0c,0x5b,
+  0xe3,0xff,0x73,0x27,0x22,0x16,0xfa,0x65,0xc7,0x5d,0xf1,0xe0,0xf2,0xf1,0xf5,0x0f,
+  0x7b,0x82,0xa9,0xe6,0xe3,0xda,0xdb,0xbc,0xe1,0x44,0x30,0x55,0x8e,0x3b,0x3e,0x05,
+  0x7a,0x32,0xf2,0x69,0xe5,0x6d,0xf8,0xba,0x14,0x4c,0x96,0x1f,0xee,0xb2,0xf5,0x43,
+  0xf5,0x0f,0x7f,0x9b,0x2c,0xaf,0x81,0xbf,0x91,0xa7,0xc2,0xf3,0x1b,0xf1,0xfc,0x7e,
+  0xb6,0xfc,0xab,0x6d,0xbf,0x26,0xfe,0xcf,0x59,0xf9,0x55,0xe9,0xb5,0xe4,0x1c,0x3d,
+  0x78,0xd4,0x63,0xaf,0x76,0x94,0x6e,0x31,0xe6,0x85,0xa4,0x2e,0xf5,0x4e,0x16,0x62,
+  0xf7,0xe0,0xf9,0xcb,0xf7,0x0f,0x85,0x3d,0x16,0x9e,0xb9,0x8b,0xbd,0x22,0xdd,0x13,
+  0xab,0x52,0xfc,0x06,0x7b,0xcb,0xa9,0xb7,0x93,0x84,0x2d,0xca,0x66,0xa9,0x8a,0xb7,
+  0xde,0x89,0xe8,0xae,0x93,0xca,0x94,0xb5,0x17,0x9a,0x55,0xdf,0x13,0x15,0xa4,0xd9,
+  0x85,0xf8,0x3d,0x0a,0xc5,0xeb,0x9b,0x8e,0x38,0xf8,0x6a,0x75,0xc5,0x73,0x84,0x7f,
+  0x52,0xaa,0xce,0x8a,0xd4,0x0d,0x44,0xac,0x9a,0xcb,0x9e,0x01,0x3b,0xde,0x51,0xd2,
+  0x09,0x7a,0xcc,0x0f,0x6c,0xc8,0xc1,0xe7,0x54,0xff,0xe7,0x25,0x5e,0x57,0x84,0xe7,
+  0xa3,0x69,0xb4,0xdb,0x9a,0x81,0x83,0xf2,0xaf,0xed,0x42,0x73,0xbf,0xa2,0xfe,0x17,
+  0x03,0xf8,0xfb,0xba,0xf5,0x22,0x70,0x59,0xc6,0xcf,0xc5,0x1b,0x4a,0x67,0x6d,0xc6,
+  0x4d,0xfc,0xbc,0x82,0xc3,0x0e,0x48,0x3b,0xf8,0x79,0x87,0x78,0x89,0xf6,0x64,0xe9,
+  0x66,0x7c,0xf5,0xec,0xf9,0x76,0x68,0x17,0x34,0xb4,0xe7,0xb1,0x60,0x26,0x71,0x66,
+  0x3a,0xc5,0xbf,0xd0,0xfe,0x2f,0xe0,0x16,0x23,0x9a,0x5d,0x4a,0xbd,0x0d,0x8d,0x83,
+  0x88,0x7f,0xdc,0xfc,0x44,0xb3,0x6b,0x35,0x1c,0xe8,0xaf,0x6d,0x97,0xd7,0xb2,0xc3,
+  0x6c,0x83,0x14,0x36,0x5b,0x0f,0xb2,0x88,0xcd,0x88,0x7e,0x47,0x42,0xa1,0x0a,0x85,
+  0x11,0x6f,0xfd,0x67,0xf5,0x80,0x89,0xa7,0x8f,0x64,0xe2,0x94,0xf0,0xb7,0x6f,0xe8,
+  0x29,0xcc,0x8e,0xdf,0xc1,0x4e,0xab,0x4f,0xd0,0x79,0x64,0xe3,0xf4,0x8c,0x53,0x0f,
+  0x9c,0xe2,0x5f,0x69,0x5a,0x6f,0xc0,0x4c,0x54,0x8b,0xde,0xd7,0x1d,0x0b,0xab,0xb8,
+  0x6c,0x56,0x3b,0x44,0x05,0xfc,0x6a,0xb1,0x37,0xff,0x7d,0xb5,0xc5,0x46,0xe0,0xe5,
+  0xc3,0xea,0x79,0x98,0x6d,0xde,0x96,0xf6,0x47,0x5c,0x46,0xf4,0xdb,0xf4,0x06,0xa1,
+  0x29,0xee,0xf4,0xc6,0xbf,0x2e,0xc0,0x42,0x08,0x9a,0xd5,0xa3,0xe3,0xdc,0x3e,0x56,
+  0xfd,0x1f,0xfc,0x6a,0xa4,0x26,0x37,0xff,0x6b,0x56,0x3c,0x60,0x96,0xff,0xbd,0xfa,
+  0xbc,0x1d,0xf6,0xfa,0x39,0x0a,0x25,0x24,0x5c,0x80,0x39,0xf1,0xe2,0x8c,0xec,0xc6,
+  0xbf,0xcc,0xe4,0x3b,0x2a,0xb1,0x7d,0x22,0x1c,0x77,0xf3,0x6c,0xff,0xaf,0xe3,0xb0,
+  0x9e,0xd7,0x9a,0xb8,0xad,0x9f,0xd6,0xf6,0x51,0xe9,0xe6,0x1e,0xb4,0xcf,0x2e,0xfe,
+  0x11,0xd1,0x4f,0xc3,0xa7,0x35,0x19,0x62,0x19,0xf8,0x3c,0x7c,0xef,0xe3,0x90,0xc2,
+  0xf1,0xeb,0xf5,0xf0,0xdf,0xba,0xf9,0x5f,0x95,0xa7,0xa9,0x7e,0x0e,0xde,0xc4,0xe7,
+  0x71,0xa3,0x75,0xf3,0xac,0x40,0xf5,0x6f,0xd5,0x0e,0x4f,0xff,0x2f,0x0d,0xc7,0x9f,
+  0x97,0xea,0xbb,0xa3,0xdd,0xb2,0xc1,0xec,0xfe,0x53,0xd2,0x8b,0x3c,0x1b,0x18,0x7d,
+  0x93,0xa7,0xee,0x2e,0x8e,0xca,0x86,0x9b,0xff,0x25,0x51,0x7e,0x13,0x6a,0x23,0xe5,
+  0x7f,0xd7,0xa1,0xfd,0x28,0x97,0x6d,0x7e,0xf8,0x6f,0xa4,0x27,0x8d,0xa5,0x19,0x39,
+  0x3f,0xff,0xab,0x01,0x02,0x0f,0x88,0xb0,0x8e,0x1d,0x6f,0xe5,0x75,0x56,0x45,0xc4,
+  0x81,0x58,0x43,0xeb,0x6d,0xa9,0xa0,0x87,0xff,0x63,0xc5,0x43,0x5b,0xd5,0x07,0xd8,
+  0xa3,0x86,0xc3,0x87,0xbf,0xd7,0x0c,0x0f,0x0a,0x61,0x3d,0x95,0x06,0xea,0x95,0xef,
+  0xb6,0x7f,0x5e,0x1b,0xff,0xd4,0x5d,0x97,0xf6,0x49,0x90,0x2d,0xdc,0x77,0x5a,0x7a,
+  0x18,0x74,0x11,0x91,0x67,0x1d,0x66,0x4d,0xbb,0x2f,0x72,0x38,0xe6,0x8c,0x1f,0x15,
+  0xf5,0x9f,0x67,0x6e,0x57,0xff,0x86,0x7d,0xc7,0x71,0x83,0x28,0xf7,0xf7,0x57,0xa1,
+  0x50,0xf8,0xaa,0xb4,0x96,0xcf,0x5a,0x1d,0x09,0xb1,0x56,0xcd,0xc3,0xff,0x21,0xb6,
+  0x0f,0x04,0xae,0x97,0xc1,0xad,0xff,0xf3,0x65,0x5c,0xa8,0xc1,0x58,0xf3,0x69,0x78,
+  0x0a,0xea,0x5b,0x4b,0xa6,0x25,0xae,0x71,0x1c,0x04,0x96,0xff,0x67,0x61,0x69,0xf0,
+  0xdd,0x66,0xab,0xff,0xd7,0x47,0x49,0x2d,0x1f,0x48,0xb6,0x23,0x51,0x5b,0xd8,0x1a,
+  0x1c,0x9d,0x34,0x38,0xc9,0xd6,0x3f,0xf9,0x7f,0x10,0x1f,0xf6,0xe0,0xfb,0xcb,0x3c,
+  0xfd,0xbf,0x3a,0xe6,0x65,0xf9,0x78,0xb8,0x83,0x07,0xa8,0x3e,0x6d,0x1e,0xff,0x87,
+  0xab,0x99,0xf2,0xe5,0xde,0xfe,0x5f,0xe2,0xd8,0xf8,0x8a,0xf2,0x18,0xcc,0x06,0xb5,
+  0x7d,0x9b,0x6b,0xff,0x0d,0x98,0xaa,0xe1,0x34,0xc3,0xea,0x1a,0x56,0x27,0x7d,0xcf,
+  0xf2,0xff,0x10,0xff,0x67,0x5a,0xa6,0xc8,0x12,0xfe,0x7d,0x85,0xda,0x8a,0xaf,0x92,
+  0xfd,0xc9,0xf2,0x7f,0x22,0x91,0x34,0xbb,0xd5,0x31,0x3b,0xb0,0xab,0x4b,0xb7,0xfc,
+  0xab,0xbb,0x75,0xbd,0x0d,0xf1,0xf6,0x4b,0x39,0xfd,0x2f,0x5e,0x82,0xfa,0x64,0x20,
+  0xb3,0x61,0xc1,0xe1,0x63,0xd0,0xd0,0x61,0xe5,0x7f,0xa5,0xe6,0xf1,0x7b,0x52,0xe5,
+  0x23,0x1a,0xe2,0xe1,0xf4,0xea,0xde,0x4e,0x6f,0xfe,0x97,0x0d,0x7b,0xfc,0x96,0xb0,
+  0x34,0x9f,0x08,0x54,0x46,0xfc,0x67,0x97,0x8f,0x6a,0xd5,0xff,0xc9,0x44,0xbf,0xe3,
+  0xf7,0x10,0x3f,0xfe,0xd1,0xaa,0xe7,0x3f,0xcc,0xfa,0xb6,0x96,0xb5,0x07,0xbc,0xf8,
+  0x10,0xf1,0x8f,0x46,0xdd,0x2e,0xf0,0x25,0xaa,0xe1,0x36,0x9f,0x47,0x41,0x44,0xd4,
+  0x4a,0x19,0x49,0x4a,0x91,0xb9,0x2d,0x5e,0xfc,0x40,0x22,0xe3,0xcc,0x37,0x54,0x40,
+  0x45,0x69,0x6a,0x5b,0x7c,0x49,0xb4,0x1c,0xd6,0xf8,0x32,0x1c,0xaf,0xe1,0x1b,0x97,
+  0x5c,0x8c,0x08,0x44,0xed,0x6d,0x6a,0xa5,0xfa,0xcf,0xf6,0x47,0x6d,0xb1,0xea,0xff,
+  0xdc,0x52,0xc6,0x10,0xed,0x30,0x0f,0x1f,0x46,0x64,0x84,0x75,0xe8,0xbd,0x04,0x0c,
+  0xdc,0xf8,0x97,0xcd,0xff,0x29,0x59,0xeb,0xb7,0x88,0xdf,0x93,0xa8,0xfe,0xe1,0x01,
+  0x68,0xa8,0x60,0x28,0xb4,0x0e,0xb0,0x05,0x15,0x01,0x2e,0xbf,0xe3,0xac,0x9f,0x6e,
+  0xc1,0xff,0xa9,0x37,0x8a,0x7f,0x22,0x7f,0xc5,0x9b,0xff,0x65,0x09,0xca,0x6f,0xb4,
+  0xc7,0xcc,0x49,0x0f,0xc8,0xef,0xe4,0xf4,0xff,0x7a,0x11,0x44,0x91,0x1f,0xcf,0x78,
+  0x87,0xff,0x7c,0x11,0xae,0x6f,0x09,0x6c,0x92,0x7d,0x5e,0xfc,0xa3,0x8c,0x09,0xfc,
+  0xe3,0x8f,0x7b,0xf3,0xbf,0x28,0xed,0x0b,0x32,0x9a,0xd5,0xff,0x82,0x79,0xfd,0x3f,
+  0xfd,0x76,0xbd,0xa3,0x23,0x42,0xa0,0xfe,0x5f,0xa9,0xfd,0x50,0x73,0x8b,0x35,0x71,
+  0xad,0xc6,0x08,0x95,0x16,0xba,0xfe,0xc6,0x9e,0xca,0xed,0xca,0xa3,0x12,0xd9,0x1f,
+  0x58,0xe9,0xe1,0x53,0xa9,0x76,0x20,0x4c,0xb4,0x3e,0x4c,0x14,0x7a,0xeb,0x1f,0x2a,
+  0x0f,0x49,0x73,0x57,0x06,0xfe,0xb9,0x68,0xa5,0xfb,0xfc,0xef,0x1e,0xfe,0xb4,0x25,
+  0xec,0x57,0xe7,0x7d,0x25,0x90,0xf4,0x47,0x9c,0xfa,0x78,0x84,0x7f,0x6e,0x14,0xc3,
+  0xaa,0x7f,0xe9,0x21,0x02,0xe1,0xb1,0xdd,0x2f,0xfe,0x10,0x1a,0xe2,0x7f,0x97,0xee,
+  0x74,0xf1,0xb9,0x9d,0xff,0x35,0xb3,0x4b,0x76,0x1b,0x61,0x28,0x63,0x37,0x53,0x45,
+  0xc4,0xea,0x38,0x0c,0xc4,0xeb,0xb4,0x12,0x90,0xef,0xed,0xb2,0xf5,0x9f,0xe5,0xff,
+  0xf4,0xa8,0x19,0xdf,0x7e,0x82,0x3d,0x1d,0xfe,0x2c,0xed,0x39,0x4d,0x82,0x76,0x9f,
+  0x51,0xb5,0xb9,0x3b,0xe5,0xd2,0xfd,0x04,0xff,0x07,0xad,0x71,0x6f,0xd1,0x5e,0xdf,
+  0xf1,0x6e,0x37,0xff,0x6b,0x20,0x9a,0x16,0xf6,0x67,0x13,0xd7,0x93,0xfe,0x9a,0xc2,
+  0xc3,0xf9,0xfc,0x1f,0x3c,0xb4,0xfa,0xb6,0x88,0xb6,0x5f,0xd4,0xff,0x8b,0xef,0x55,
+  0x8b,0x29,0x0d,0xea,0x55,0x50,0xd4,0x2a,0xf8,0x64,0x5b,0x59,0xab,0x9b,0xff,0xde,
+  0xfd,0x39,0x4a,0x7b,0xd7,0x8b,0xd7,0xf8,0xbf,0x9b,0x85,0x3d,0xd2,0x6b,0xfc,0xb7,
+  0x7c,0xca,0x30,0xe2,0x9f,0xcb,0x70,0xa4,0x63,0xb6,0x3e,0x6b,0x7e,0x6e,0xfe,0x17,
+  0xe5,0x93,0xc2,0xac,0x9c,0xb4,0x26,0x14,0x86,0x48,0x50,0xde,0xc7,0xa9,0x94,0xec,
+  0x91,0x13,0x65,0xf1,0xec,0x78,0xc3,0xca,0x5f,0xd6,0x83,0x6f,0x35,0x4f,0x85,0xec,
+  0xfe,0x75,0x19,0xf6,0x26,0x6f,0xc8,0x2c,0x1d,0x6b,0xbe,0x24,0x5d,0xe2,0x0b,0x53,
+  0x4b,0x2e,0xc8,0x9e,0xfc,0xaf,0x52,0x91,0xff,0x05,0xfe,0x4f,0xb3,0x50,0xcb,0x3d,
+  0xd9,0x42,0x88,0xda,0x63,0xb6,0xfd,0xd9,0xa3,0xe3,0xd4,0x16,0xb1,0xef,0x3b,0xe3,
+  0x35,0xbe,0x85,0x68,0x4e,0x85,0xfe,0xcf,0xdf,0x67,0xe5,0x6b,0x14,0xd1,0x34,0xf7,
+  0xc2,0x34,0xcb,0x71,0xf4,0x88,0x31,0xab,0x30,0x12,0xf3,0xd4,0xdf,0x58,0x65,0xf5,
+  0xbf,0x08,0xf9,0x1f,0xf7,0x05,0xdc,0xfe,0x83,0xbb,0xb2,0x8e,0x20,0x05,0xb7,0x7e,
+  0x5d,0xbd,0x91,0xb9,0xf1,0x02,0xe2,0xff,0xbc,0x0c,0xf5,0x19,0x7f,0xaf,0xbf,0xd6,
+  0xde,0xbf,0x2e,0xc0,0xf9,0xb6,0x79,0x96,0x70,0x8e,0xea,0x87,0x74,0xf9,0xdd,0xf8,
+  0x57,0xd2,0xe2,0xff,0xc0,0xd2,0x94,0x7c,0xda,0x38,0xcf,0x6c,0xe2,0xa5,0xd6,0x98,
+  0x15,0xa0,0xb1,0x2c,0x58,0xd1,0x39,0xe2,0xc9,0x7f,0x3f,0xa8,0xa2,0x19,0x6f,0xc1,
+  0xd3,0x5c,0xbd,0xdb,0xff,0xeb,0x35,0xfd,0xa3,0x23,0x42,0xf8,0x00,0xe6,0x40,0x49,
+  0x46,0x1e,0xd7,0xff,0x62,0xbe,0xba,0x11,0xee,0x73,0xf7,0xdf,0xfd,0x1d,0xb5,0xef,
+  0x59,0x8e,0x1d,0x1e,0x8e,0x6d,0xdc,0xc3,0x62,0xde,0xf8,0x97,0x2a,0xfa,0x3d,0xf5,
+  0x96,0x7d,0x4f,0x8c,0xdf,0x20,0x86,0x51,0xfe,0x45,0xba,0xf0,0x34,0x1c,0xe0,0x2b,
+  0xc2,0xb7,0xf4,0x78,0xfc,0xd5,0x88,0x7f,0x14,0x2a,0x7a,0xa3,0x02,0xdb,0x2e,0xfa,
+  0x7f,0x89,0x46,0x21,0x69,0x72,0xc3,0x5a,0x42,0x98,0xbe,0x62,0x39,0xf8,0x47,0xec,
+  0xbf,0x29,0x79,0x3b,0x38,0xfa,0xf9,0x17,0xe2,0x1f,0x52,0xc7,0xab,0x73,0xc2,0xff,
+  0x83,0x60,0xca,0x59,0x9f,0xff,0x6a,0x81,0x9c,0x7f,0xa3,0x6e,0x17,0x4e,0xbe,0x1b,
+  0x35,0x6e,0x12,0xc2,0x41,0x78,0x12,0xee,0xcb,0xc9,0xff,0xa2,0xfa,0xcf,0xa5,0x37,
+  0xa8,0x1b,0x33,0xf2,0xd7,0x94,0xe7,0x7d,0x37,0x0c,0x2f,0x7d,0xaf,0xba,0xc1,0x6a,
+  0x84,0xb1,0x86,0x2a,0x22,0x42,0xa3,0xa8,0xff,0xec,0xe4,0x6b,0x50,0xff,0xaf,0xbd,
+  0xf1,0x70,0x8d,0xda,0xcd,0x1a,0xd9,0xfd,0xf1,0xde,0x01,0xff,0xbb,0x9d,0xb5,0xf0,
+  0x8c,0x05,0x84,0x6a,0xe1,0x49,0x3c,0x6a,0xe1,0x57,0x31,0x37,0xff,0x8b,0xfc,0x3f,
+  0x2b,0x6b,0xc0,0x97,0x2a,0x3c,0x6e,0x3c,0xac,0xd6,0x0c,0xf8,0xeb,0xac,0xfa,0x3f,
+  0xe6,0x86,0x18,0x5b,0x42,0xd4,0x68,0xa3,0x28,0xc5,0xee,0xf6,0xe4,0x7f,0xed,0x40,
+  0xfc,0xb3,0xad,0xd5,0xc7,0xd9,0x0e,0xf8,0x01,0xcc,0x30,0x6f,0x4d,0x37,0x45,0x05,
+  0xff,0xaa,0x28,0xcd,0x56,0x93,0xaa,0xe3,0x45,0xdb,0xf2,0xea,0x3f,0x5f,0x86,0x1b,
+  0xe6,0xd7,0xbe,0xd0,0x89,0x68,0x50,0x9a,0x67,0x2e,0xa5,0xc0,0x53,0x56,0x51,0xab,
+  0x39,0x1e,0x1c,0x46,0x8b,0x35,0xd9,0x70,0xf3,0xbf,0xa4,0x83,0xf0,0x5b,0x68,0xcc,
+  0x14,0x3f,0x24,0x2f,0xc1,0x85,0x47,0xcb,0xe6,0xda,0x0b,0x2c,0x9b,0x08,0x7f,0x90,
+  0x53,0x44,0xec,0xfb,0x43,0x9d,0x17,0x3c,0xfb,0xef,0x0e,0xf5,0x7c,0x2c,0x9d,0x0c,
+  0x24,0x3b,0x6b,0x6b,0x9e,0xa2,0x6e,0x74,0xe9,0x6a,0x27,0x51,0x31,0x1a,0x3f,0x2f,
+  0xd5,0x25,0x97,0x3c,0xe0,0xc9,0x07,0x1f,0xb8,0x39,0xaa,0x3c,0x09,0xe1,0xff,0x86,
+  0x6b,0xd8,0x3f,0x91,0xff,0x90,0xb2,0x03,0x02,0xf0,0x84,0x84,0x0b,0x29,0x56,0xfe,
+  0x77,0xa8,0xfd,0xb0,0xa9,0x6e,0x66,0xf3,0x3c,0xf9,0x5f,0x88,0x7f,0xfa,0xf4,0x51,
+  0xbd,0xde,0x20,0x43,0xa4,0xd3,0x34,0xb3,0x85,0xb3,0x1a,0x18,0xa3,0xc2,0x98,0x46,
+  0x2b,0xb0,0x7d,0x79,0xf5,0x9f,0xf5,0x95,0x2a,0x65,0x7b,0x51,0xd8,0xab,0xc8,0xea,
+  0xff,0x35,0x93,0x84,0x4f,0xf3,0xbd,0xfc,0x7b,0xf8,0x55,0xb8,0xde,0xcd,0xff,0x52,
+  0x97,0x50,0xb6,0x17,0x04,0xea,0xfc,0x01,0xe5,0xa7,0x7a,0xca,0x7c,0x36,0xe6,0x0f,
+  0x70,0x04,0x42,0xfd,0x41,0x7c,0x3d,0xe1,0x7d,0x65,0xee,0x60,0x40,0x97,0xbf,0xe3,
+  0xfa,0x7f,0x2a,0x11,0xff,0x2c,0x6a,0x34,0x26,0x0d,0xca,0x07,0xe1,0xd7,0x46,0x63,
+  0x7f,0xed,0x68,0x02,0x57,0x54,0x16,0xff,0x74,0x5c,0xfe,0xe4,0x6c,0x73,0x56,0xbb,
+  0xec,0xcd,0xff,0x22,0x33,0x35,0x97,0xea,0x73,0x06,0xe0,0x99,0xaa,0xba,0xcc,0x92,
+  0x7d,0x9d,0x8e,0x7e,0x06,0x44,0x6a,0x58,0x34,0xe5,0xe1,0x33,0x50,0xfd,0x67,0xca,
+  0xf6,0x2a,0x26,0x6f,0xf9,0x7f,0x1b,0xd7,0x99,0xea,0xdd,0x3e,0x27,0xb1,0x74,0x10,
+  0xfe,0x5b,0x17,0xf5,0x7f,0xde,0x73,0xce,0xef,0x22,0xff,0x3d,0x39,0x2d,0x75,0xcb,
+  0xfc,0xc2,0x57,0x0d,0xf2,0xff,0xf8,0xbe,0x9a,0x9d,0xef,0x86,0x35,0xec,0x32,0x7c,
+  0x9b,0xcf,0x3a,0x19,0x5a,0xe5,0xf1,0xff,0x58,0xf9,0xef,0xfa,0x0b,0xfe,0xfa,0xa6,
+  0x25,0xf0,0x2f,0x2c,0x22,0x12,0x0d,0xec,0x42,0xeb,0xcf,0xf2,0x07,0xc9,0xd1,0x34,
+  0x9f,0xb9,0xf5,0x55,0xac,0xfa,0xcf,0x37,0xa4,0xee,0x7b,0x0b,0x61,0xcf,0x4b,0x6c,
+  0x17,0xff,0x52,0xaa,0x3a,0x62,0xf3,0x9f,0x5f,0x46,0x68,0xb4,0x30,0xbd,0xf1,0xb4,
+  0xec,0xf1,0xff,0x58,0xf5,0x9f,0xa1,0xa8,0x6b,0x43,0x47,0x76,0x3f,0x9a,0x64,0xf5,
+  0x23,0xb0,0x2a,0x22,0x4a,0xc2,0x31,0x92,0x93,0xff,0x45,0x4e,0x80,0x65,0xb5,0x21,
+  0x11,0x1f,0xd9,0x45,0xfb,0xdd,0x29,0x2b,0xf0,0xb1,0x49,0x3e,0xd5,0xf6,0xa6,0x28,
+  0x9d,0xd7,0x99,0x53,0xff,0x59,0xdd,0xff,0x52,0xb8,0x1d,0xd1,0xce,0xc7,0xe2,0x8f,
+  0x32,0x8a,0x7f,0x55,0x9f,0x2a,0x15,0x1b,0xf1,0x96,0x6d,0x6f,0x20,0x7e,0x2e,0x31,
+  0x02,0x9b,0x3c,0xfd,0xbf,0xe6,0x17,0xd4,0xc0,0x56,0x08,0x1b,0xa1,0x7f,0x2e,0x5b,
+  0xa9,0xad,0x87,0xf0,0xa2,0x5b,0x11,0xff,0x58,0xf9,0xef,0x94,0xaf,0xfd,0x28,0x8e,
+  0x8f,0xec,0xf2,0xf8,0x7f,0xa8,0xfe,0xf3,0x6c,0x5d,0x1f,0x08,0x95,0x15,0xb6,0xf0,
+  0xad,0xe1,0x1a,0xab,0xff,0xd7,0x03,0x76,0x3e,0xb8,0xa4,0x7f,0x09,0x81,0x50,0xd9,
+  0xb1,0x9c,0xfa,0xcf,0x23,0x6d,0x61,0x08,0x20,0xde,0x50,0xcd,0xdb,0x63,0x15,0xcf,
+  0x17,0xc8,0x04,0x33,0xae,0xa1,0x34,0x73,0x72,0xc5,0x34,0x10,0xfe,0xb9,0xe4,0xf0,
+  0x9f,0x7b,0x4a,0x89,0xf6,0xfc,0x64,0xcb,0xd2,0x9f,0xc8,0xdb,0xdb,0x04,0xff,0xf9,
+  0x81,0x6a,0x1b,0xf8,0x95,0x9f,0xc1,0xaf,0x28,0x9e,0x25,0x9f,0x2c,0xf0,0xe2,0x9f,
+  0x8b,0x70,0x93,0x11,0x3c,0xf1,0xd4,0x5c,0x11,0x08,0x0b,0x6e,0x66,0x73,0xad,0xf8,
+  0xe0,0xa0,0x7c,0x86,0x1d,0xf5,0xc7,0x28,0x5f,0xcc,0xe5,0x4b,0xcf,0x0f,0x65,0x94,
+  0x74,0x38,0xcc,0x6f,0xed,0xaa,0xbe,0xb3,0x6d,0x48,0x9f,0x81,0x8f,0x81,0x6b,0xc5,
+  0x2a,0x04,0x54,0x3d,0x22,0x75,0x1b,0x61,0xbe,0x81,0xfc,0x3f,0x0e,0xfe,0x01,0x84,
+  0x79,0xad,0x7a,0x9b,0x5f,0x2b,0x54,0xa0,0xa3,0x55,0x17,0xfd,0xbf,0x9c,0x78,0x1f,
+  0xaa,0x4e,0x6f,0xba,0x45,0x63,0x27,0xdc,0xfc,0x32,0xca,0x67,0x97,0xc2,0x8b,0xd0,
+  0xda,0xaf,0x54,0x4b,0x85,0x1a,0x17,0xd7,0x88,0x42,0x40,0x45,0x49,0xb6,0xbd,0x75,
+  0x3d,0x3b,0x89,0x57,0xc0,0xeb,0xff,0xa1,0xd9,0xd5,0xdd,0x19,0x4c,0x2e,0xab,0xa9,
+  0x38,0xaa,0x10,0xff,0x07,0x8d,0xa3,0x15,0xdf,0x64,0x4f,0xc3,0x7a,0xa9,0xae,0x3d,
+  0x98,0xd4,0x47,0x3c,0xeb,0x87,0xc6,0x1f,0xba,0x3b,0x98,0xec,0xb4,0xc3,0x5e,0x3e,
+  0x12,0xbe,0x2e,0x16,0x06,0x01,0xe3,0xd6,0xe0,0xa6,0x9c,0xfc,0x41,0x5c,0x6f,0xba,
+  0xc8,0xff,0x02,0x91,0xd1,0x1e,0xe5,0xb2,0xe3,0x91,0x3b,0xa9,0x8e,0x8a,0xd6,0xa8,
+  0xf9,0xfe,0x1f,0xa3,0x3a,0xc9,0xe2,0xc7,0x0e,0xc0,0xbd,0xb0,0xad,0x43,0x4d,0x15,
+  0xfa,0xf8,0x01,0xa9,0x96,0xfb,0x4f,0x27,0xc6,0xf0,0xef,0xeb,0x38,0x9c,0x96,0xef,
+  0xf5,0xf6,0xff,0x92,0x9e,0x30,0xf5,0x8c,0xaa,0xb3,0x5b,0x13,0x0f,0xe2,0xf9,0x6b,
+  0xc0,0xb1,0x3f,0x81,0x04,0xbe,0x4a,0x05,0x51,0xf3,0x16,0x60,0xae,0xff,0x87,0x97,
+  0x4e,0xd6,0xf6,0x2e,0xaa,0xda,0x86,0x4a,0x7b,0x48,0xf9,0xb6,0x5e,0x75,0xda,0x29,
+  0xe4,0x55,0x64,0xb0,0xa1,0xaa,0xbd,0x50,0x3d,0xa2,0xb6,0xef,0xca,0xb8,0xfc,0x4f,
+  0x51,0xff,0x27,0x9d,0x09,0x2c,0x97,0x6f,0xc1,0x6d,0xe5,0xa6,0xe1,0xc0,0x8d,0xbe,
+  0xab,0x44,0xfc,0xcb,0xbf,0x5c,0x3e,0x41,0xd0,0xe8,0x4c,0x49,0x8e,0xff,0xa7,0xd2,
+  0xca,0xa7,0x90,0xd3,0x88,0xf7,0x9e,0xa1,0x68,0xce,0xe3,0xe1,0x1a,0x4d,0x38,0x3a,
+  0x28,0xad,0xe9,0x3c,0xcc,0x1b,0x42,0x45,0xb9,0xfd,0xbf,0x0c,0xe5,0x10,0x5c,0xec,
+  0xfa,0xf8,0x70,0x60,0x88,0xa2,0x15,0x03,0x37,0x64,0x36,0x8e,0xdd,0x73,0x95,0xf1,
+  0xbc,0x55,0x11,0xe8,0x6e,0xab,0x10,0xe2,0x80,0x5f,0x73,0xeb,0x1f,0x86,0xb6,0xc0,
+  0x7f,0x6a,0x55,0x1b,0x8b,0xef,0x66,0x43,0xca,0x3d,0x44,0x44,0xbc,0x8b,0x51,0x23,
+  0xe6,0x1b,0xcd,0x92,0xb6,0xa6,0x50,0xab,0x48,0x84,0xff,0x0a,0x9b,0xe1,0xd8,0x1f,
+  0x0d,0xb6,0x18,0x8f,0xc1,0x34,0x68,0x6d,0x0f,0x0f,0xe0,0xb0,0x69,0x54,0x16,0xc0,
+  0x69,0xdc,0xdc,0x66,0x97,0xf2,0x28,0x74,0xf9,0x3f,0xca,0x46,0x54,0x72,0x4d,0xb2,
+  0x28,0x84,0xbb,0x79,0x27,0x10,0xdf,0xa3,0x49,0xc1,0x8d,0x3e,0x42,0x44,0xe8,0x45,
+  0xa4,0xd8,0xc3,0x11,0x85,0x79,0xf2,0xbf,0x2a,0xa9,0x69,0xd7,0xbc,0xcc,0xc6,0x4d,
+  0xf2,0x08,0x7b,0x9e,0xdd,0x60,0x46,0x47,0xfd,0xd9,0x46,0xd2,0x49,0xf9,0x0b,0x9c,
+  0x1a,0x3d,0xa8,0x0a,0x73,0xeb,0xa7,0xe1,0xaf,0xa7,0x9d,0x33,0x0e,0xac,0xbb,0x7f,
+  0x8f,0xfc,0xa6,0x9a,0x55,0x8b,0xd5,0x18,0xa2,0xa4,0xab,0xf9,0xdf,0x75,0xcb,0x31,
+  0x52,0xed,0xfa,0x7f,0xa8,0xfe,0xf3,0x25,0x65,0xb6,0x19,0x18,0x95,0x43,0xb0,0x41,
+  0x9a,0x43,0x66,0x7c,0xae,0x05,0x84,0x8e,0xc9,0xbf,0x15,0x08,0x61,0xe3,0x60,0x67,
+  0xaf,0xb3,0x7e,0xb6,0x22,0xfe,0xf9,0xcf,0x50,0x38,0xe3,0xd3,0xca,0x3e,0xde,0x75,
+  0x5e,0x09,0xf7,0x89,0x30,0x96,0x00,0x42,0xdf,0x65,0x6f,0xe8,0x74,0xa2,0x9f,0xb5,
+  0xa5,0xda,0xd3,0xff,0x42,0x8a,0xc2,0x3e,0xb6,0xa2,0x5f,0xdd,0xc9,0x66,0xc0,0xc3,
+  0xb8,0xbb,0xdd,0x4a,0xfc,0x55,0x31,0x9e,0x0e,0x26,0xa2,0x95,0xc3,0x4e,0x96,0x72,
+  0xfd,0xcf,0x15,0xe4,0xff,0x89,0x73,0xbc,0x3f,0xb9,0x7d,0x52,0x94,0x1f,0xa7,0x58,
+  0x8d,0x50,0x75,0x66,0x4a,0xbb,0xc5,0x46,0x1f,0x6e,0xca,0xc1,0x3f,0x63,0x50,0xd7,
+  0x81,0xe7,0xeb,0x08,0x6e,0xd3,0x82,0xbf,0x64,0x3d,0x0f,0xea,0x87,0xd6,0xc3,0x42,
+  0x13,0xbf,0x4a,0xb9,0xfc,0xe7,0xca,0x0b,0xea,0x05,0xf8,0xcf,0x8e,0xe0,0x68,0xf5,
+  0x98,0x9a,0x2d,0x5b,0x97,0x05,0x42,0x6d,0xd9,0x8e,0xa8,0x1f,0x35,0xe4,0x5e,0x37,
+  0xff,0x6b,0xad,0xe8,0x7f,0x1a,0x0f,0x0e,0xc9,0x31,0x52,0xcb,0x40,0xc0,0xce,0xff,
+  0xca,0x76,0x44,0x9d,0x13,0x2f,0x5e,0x93,0x93,0xff,0xf5,0x8e,0xf2,0x04,0xaf,0x8d,
+  0xdf,0xba,0x8f,0xa9,0x6c,0x03,0x54,0xcf,0x2d,0xce,0x69,0x84,0x7a,0x80,0xf8,0x3f,
+  0xfb,0x58,0xcc,0xad,0x7f,0x08,0x22,0xff,0x8b,0xaa,0xb7,0xd1,0x34,0x6b,0xf3,0x0a,
+  0x3f,0xd2,0x79,0xad,0x28,0x56,0x56,0xe7,0xe1,0x3f,0x8b,0xe8,0x61,0xdc,0xbf,0xaf,
+  0x6c,0x16,0x74,0xe2,0xb1,0xab,0x28,0xa7,0xb0,0xf6,0x01,0x60,0x61,0x95,0xfa,0xbf,
+  0xdb,0xfa,0xe4,0xd9,0xfe,0xef,0xc1,0x1e,0x79,0x0e,0x3c,0xd3,0x46,0x61,0x17,0x96,
+  0x53,0x18,0x21,0xa6,0x17,0x1f,0x92,0x15,0xe7,0xf7,0x1d,0xb5,0xf3,0xbf,0x46,0xe5,
+  0x21,0x76,0x9e,0x37,0xe4,0x37,0x02,0xdb,0x8e,0x40,0xf1,0x5d,0x79,0xcc,0xb0,0xd7,
+  0x4f,0x5b,0xb6,0xff,0x3b,0xf1,0x1b,0xd5,0x67,0xda,0xea,0xfa,0x72,0x0b,0x51,0x9e,
+  0x85,0xbb,0xa9,0x14,0x67,0x45,0x4e,0xfe,0x3b,0x3e,0x6d,0x46,0x9d,0x2b,0xfa,0x97,
+  0xe9,0x46,0x6e,0x61,0xf0,0xdd,0x10,0x8e,0x75,0xd7,0xb1,0x3a,0xc9,0x7e,0xfe,0xac,
+  0xff,0x67,0xb1,0x1a,0x4b,0x98,0xc0,0xd5,0x94,0x91,0xab,0x9f,0x9d,0x3c,0xf2,0xc5,
+  0x48,0x88,0xdd,0xe8,0x9c,0xbf,0xac,0xfc,0xaf,0x59,0x2b,0x29,0xff,0x4b,0x59,0xc7,
+  0xab,0x52,0x9e,0xc2,0x38,0x40,0x19,0x52,0x1f,0xd7,0xd5,0x31,0x16,0xf5,0xf6,0x3f,
+  0xa5,0xfa,0x3f,0x6d,0x01,0xa2,0xfd,0x98,0x90,0x36,0xa2,0x39,0x85,0xa0,0xdf,0x55,
+  0x23,0x10,0xd0,0x9a,0xc7,0xf5,0x7f,0x37,0x66,0x8d,0x96,0x5f,0x60,0x97,0xb4,0xc6,
+  0x4c,0xae,0x7e,0x3e,0x80,0xeb,0xa1,0xf0,0x27,0xe5,0xf9,0xf9,0x5f,0xf5,0xa9,0xc0,
+  0xbe,0xf2,0x18,0xbe,0xb6,0xa2,0x11,0x98,0x57,0xff,0x46,0x43,0x1c,0xd7,0xa7,0xeb,
+  0xbf,0x1d,0x48,0x66,0xfd,0x3f,0x71,0x34,0x02,0xf7,0x40,0xd5,0xe1,0x48,0x6e,0x21,
+  0x68,0x6d,0x26,0x2f,0x36,0xd8,0x7b,0xae,0x7d,0xb3,0xfb,0xbf,0x8f,0x21,0xec,0xe9,
+  0xe4,0x7a,0x3c,0xb7,0x10,0xd0,0x63,0x7c,0x66,0x3b,0x42,0xc1,0x8c,0xa7,0xff,0xa9,
+  0xf0,0xff,0x0c,0xaa,0x73,0x9b,0x4a,0x36,0x75,0x66,0xf4,0xc1,0x71,0x85,0x46,0x43,
+  0x45,0x57,0xb1,0x13,0x39,0xfe,0x1f,0x3c,0x34,0x75,0x05,0x32,0xf2,0x02,0xfe,0x9c,
+  0xb9,0x9b,0xe7,0x16,0x02,0xa2,0x46,0xa8,0xca,0x5b,0xf2,0xb9,0xfc,0xfe,0xa7,0xd2,
+  0xdf,0xf1,0x8f,0x67,0xd8,0x98,0x36,0xae,0x31,0x81,0x29,0x4a,0x43,0x8f,0xeb,0x7f,
+  0xda,0x16,0xfc,0x4e,0x67,0x3f,0x1c,0x35,0xd3,0x86,0xb7,0x50,0xcc,0x76,0x2b,0x34,
+  0xb6,0xa9,0xfc,0x70,0x85,0x97,0xff,0x23,0xd0,0x4e,0x0f,0x7b,0x83,0xad,0xe7,0x61,
+  0x23,0xaf,0xb1,0x85,0x44,0x5f,0x85,0x73,0xf2,0xdf,0x35,0xdb,0xed,0xa3,0x77,0x58,
+  0x6d,0x1a,0x9c,0xf1,0xdb,0x71,0xe1,0x7d,0xa1,0xa9,0x28,0x59,0xe6,0xf6,0x27,0xca,
+  0xe6,0x7f,0xd1,0xfb,0xd8,0x7f,0xb8,0x03,0x74,0xab,0x11,0x86,0xcd,0x07,0xd6,0x76,
+  0xc2,0x6a,0x3a,0x88,0x1d,0x76,0xe2,0xf5,0x59,0xff,0x0f,0x15,0xdd,0xed,0x83,0x81,
+  0x35,0x75,0x6e,0x21,0x20,0x3f,0x35,0xe2,0x44,0xd3,0x4d,0x8d,0x18,0xde,0x71,0xf8,
+  0x39,0xc7,0xed,0xfe,0xa7,0x6d,0xf2,0x19,0x53,0x74,0xfb,0xca,0x49,0x8c,0x3a,0x4f,
+  0x15,0x63,0xbc,0xf5,0x7f,0xac,0xfe,0xa7,0x22,0x4d,0xf5,0x03,0xfe,0x49,0x95,0xba,
+  0xa5,0x78,0xc7,0x5f,0x86,0x39,0x08,0x84,0xaa,0x5d,0xff,0xe1,0x1a,0x6f,0xfe,0x17,
+  0x87,0xf0,0xe6,0xfc,0x42,0x40,0xe4,0x08,0x62,0xcf,0xe5,0xd4,0x3f,0xcc,0xe6,0x7f,
+  0x3d,0x1d,0x26,0xfe,0xb3,0x55,0xf8,0x48,0xb2,0x33,0xe0,0x20,0x4e,0x13,0x3f,0xe1,
+  0xf6,0xe3,0xb0,0xfa,0x9f,0xde,0x8e,0xda,0x3b,0x85,0x66,0x3c,0x3c,0xae,0x10,0x50,
+  0x98,0xe2,0x89,0x47,0x9c,0xfc,0x26,0x0b,0xff,0xe0,0xef,0xbb,0x49,0x7e,0x83,0x13,
+  0xbe,0x8d,0xe6,0x3c,0xff,0xbb,0x06,0xe2,0x1f,0xdc,0xda,0x1c,0xfb,0xb0,0xca,0xaa,
+  0x07,0x45,0xfc,0xe7,0x7e,0x6a,0xc3,0x97,0x9f,0x38,0xd6,0x73,0x88,0xfa,0x85,0xbd,
+  0x94,0xc7,0xff,0xb1,0xea,0x4d,0x25,0x06,0xe8,0x20,0x93,0xbb,0xde,0x0c,0x2a,0x44,
+  0xe9,0xed,0xff,0xae,0x08,0xff,0xcf,0x03,0xfe,0xb7,0xd8,0x39,0xb8,0x37,0x49,0x44,
+  0x20,0x46,0x8d,0x7d,0x05,0xff,0x67,0x15,0x1c,0xda,0x3a,0x0b,0x97,0x75,0xe2,0x98,
+  0x3d,0xdc,0xce,0xff,0xe2,0x7e,0x2d,0xf1,0xb4,0xd2,0x09,0xa9,0xbe,0x48,0xae,0xfd,
+  0x81,0xa8,0x24,0xcf,0x2f,0x73,0xfb,0xbf,0xeb,0x59,0xff,0xcf,0x86,0xb6,0xa6,0x17,
+  0xf4,0x7b,0x54,0x8a,0x07,0xe5,0x15,0x82,0xe6,0xfe,0xf6,0x3a,0x4f,0xfd,0x1f,0xcb,
+  0xff,0x53,0xb5,0x74,0x8d,0xfc,0x1e,0x7b,0x9a,0xc7,0xa8,0xdb,0xbb,0xa7,0x10,0xd0,
+  0x6f,0xa8,0x35,0xc6,0x2a,0xf9,0x98,0x53,0x80,0xde,0xee,0xff,0xbe,0x34,0xd9,0x9c,
+  0x61,0x67,0xd5,0xdc,0xfc,0x26,0xab,0x15,0xc2,0xa4,0x54,0x4e,0xfd,0xc3,0x6c,0xfd,
+  0xba,0xb3,0xf2,0x39,0xf6,0x33,0x9e,0xe5,0xaf,0x3a,0xf9,0x5f,0xa2,0x35,0xfc,0x1a,
+  0x4f,0xfe,0xaf,0xf0,0xff,0xc0,0x4c,0xcd,0xff,0xbf,0x9a,0x86,0xd8,0x3a,0xb8,0x9e,
+  0x0e,0x62,0xde,0xe7,0x0f,0xa1,0xfd,0xf9,0x0a,0xdb,0xe6,0xd8,0x37,0xe0,0xc2,0x5e,
+  0x75,0xf9,0xef,0x0a,0xff,0x9c,0x6d,0x41,0x3c,0x93,0x3b,0xdf,0x3d,0xa8,0x8a,0xa2,
+  0x4c,0x42,0x77,0xec,0x4f,0xdc,0xf2,0xff,0xc4,0xfd,0x37,0xb0,0xe3,0x4d,0x5c,0xab,
+  0x39,0x93,0xdb,0xf8,0x60,0x57,0x26,0x9a,0x94,0x74,0xd6,0xe3,0x89,0x7f,0x89,0xd9,
+  0xa5,0xe4,0x5e,0x7c,0x89,0x5e,0xe2,0x75,0x83,0x8e,0xfd,0xf4,0xa7,0x27,0x89,0x56,
+  0xef,0x6d,0x45,0xfb,0x3c,0xf5,0x57,0xb3,0xf9,0x5f,0x15,0xc1,0x2e,0xd1,0xef,0xa0,
+  0x7e,0x60,0x5c,0xa1,0x6c,0x25,0x98,0xee,0xcc,0xc9,0xff,0x52,0x45,0x3d,0xc0,0xd1,
+  0xf2,0xe7,0xe1,0x34,0xdc,0x60,0x06,0x72,0xf7,0x3b,0xde,0xc8,0x88,0xff,0x73,0x47,
+  0x9e,0xff,0x27,0x76,0xeb,0x46,0xf6,0x2b,0x4a,0xc4,0xb0,0xf9,0xb7,0xd3,0xb3,0x89,
+  0xd8,0x72,0xad,0xee,0x3f,0xe8,0xe1,0x63,0x64,0xeb,0xff,0xa4,0x44,0x9a,0xd8,0xc3,
+  0xda,0xf4,0xbc,0x46,0xa8,0xfb,0xf5,0x2f,0xc5,0xaf,0xdd,0xc7,0x32,0xce,0x7e,0x97,
+  0xcd,0xff,0x02,0x52,0x0b,0xe2,0x81,0x1a,0x33,0xe2,0xf0,0xed,0x63,0x56,0x47,0x30,
+  0x2e,0x3a,0x64,0x39,0x9f,0x6e,0x71,0x9a,0xe6,0x94,0x0f,0xc8,0xde,0x84,0x79,0xa6,
+  0x47,0x3f,0x4c,0x24,0xfe,0xc3,0x5f,0xa6,0x9b,0x4d,0xe7,0xfc,0x95,0xed,0x7f,0x0a,
+  0xc1,0x4c,0x75,0x4e,0xfe,0xd7,0x0d,0x56,0x20,0xe3,0x92,0x50,0x85,0x3c,0x32,0xc9,
+  0xe5,0xff,0x9c,0xa0,0x34,0xf0,0xe3,0xc5,0xef,0xc9,0x17,0x8c,0xe7,0x61,0xce,0xe8,
+  0x92,0xb1,0xea,0x0b,0xdd,0x97,0x29,0x11,0x2c,0xbb,0x90,0x86,0x83,0x39,0xfc,0x1f,
+  0xed,0x24,0xec,0xe3,0x37,0xbe,0xa2,0xfe,0x86,0xfd,0x9c,0xff,0x28,0x36,0x63,0x00,
+  0xd1,0x4e,0xc6,0x7c,0x82,0x12,0xc1,0x04,0x10,0x4a,0xd4,0x0e,0xa0,0x30,0xea,0xe9,
+  0x7f,0x61,0x8a,0x32,0x8f,0x45,0x75,0x89,0xe3,0x4d,0x9d,0xaa,0x2e,0xf0,0x8f,0x6e,
+  0x01,0x3f,0xb1,0x30,0x44,0xc4,0xc7,0xcb,0xff,0x79,0x14,0x0e,0x84,0x2c,0xda,0x73,
+  0x88,0xfc,0x3f,0xaa,0xe0,0x0f,0x5b,0xfc,0x67,0x47,0xb1,0x63,0x2e,0x1f,0xac,0xf2,
+  0x17,0x30,0xc6,0x6f,0x32,0xbf,0x39,0x2a,0x9f,0x56,0x9e,0x91,0x88,0xff,0x5c,0x7d,
+  0xda,0x2e,0x14,0xe9,0x2c,0x8c,0x7e,0xa7,0xff,0xc5,0xa8,0xb4,0x17,0x2e,0x90,0x5a,
+  0x84,0x9b,0x31,0x27,0x3e,0x68,0x2f,0x0c,0xff,0xa8,0xa7,0xff,0x45,0x1b,0x9e,0xdf,
+  0x07,0x40,0x74,0x97,0xa3,0x42,0x40,0xbb,0xac,0xdb,0x3e,0xa3,0x78,0xee,0x8f,0xbf,
+  0xc8,0xa0,0x07,0xff,0x4c,0xc3,0x63,0x17,0x15,0x85,0x48,0xd4,0xc3,0x6b,0x82,0x86,
+  0xcd,0x7e,0xad,0xff,0x00,0xb6,0x51,0xfd,0x28,0xeb,0xf9,0x8b,0xd3,0x39,0xfc,0x1f,
+  0x43,0xe7,0x50,0xdb,0xe7,0xab,0x4f,0xec,0x80,0x7f,0xa1,0x69,0xc6,0x0a,0x8f,0xf3,
+  0x0d,0x56,0xfd,0x1f,0xa7,0x10,0x99,0xcb,0x77,0x1a,0x95,0xae,0x82,0x2e,0xfe,0xc5,
+  0x4c,0x68,0x0d,0x9b,0x6a,0x7e,0xbb,0x43,0xc4,0x83,0x4e,0xc0,0xf7,0x92,0x55,0x19,
+  0x9f,0x0d,0x0c,0x8a,0xd6,0xb0,0xd3,0xce,0xf9,0x9d,0xe2,0x5f,0x7d,0xb1,0xfa,0xfe,
+  0x92,0x98,0xbc,0xf1,0xf0,0x83,0x90,0x36,0x45,0xe1,0x88,0x0d,0x10,0x13,0xf8,0xc7,
+  0x78,0x5f,0x6b,0xa0,0xd4,0xf8,0x13,0xde,0xf8,0x17,0xbb,0xd0,0x36,0xab,0x7f,0x12,
+  0x6a,0x63,0xe0,0x32,0x35,0xc2,0xf0,0xf0,0x9f,0x2f,0xa8,0xe2,0xca,0xe8,0x47,0x3c,
+  0xfd,0x2f,0x2a,0x33,0x74,0x5a,0x1f,0x08,0xee,0xea,0xfc,0x15,0x47,0xfc,0x93,0x59,
+  0x42,0xfa,0x7f,0x9b,0x3b,0xfa,0xf9,0xba,0x20,0x62,0xb9,0xfa,0x79,0x60,0x33,0x9e,
+  0xc8,0x67,0x9e,0x40,0xeb,0x71,0xb1,0xe9,0x7b,0xab,0xae,0x23,0x7b,0x32,0x44,0x40,
+  0x28,0x27,0x11,0xde,0xed,0xff,0xc5,0xf1,0xd2,0x3d,0x7c,0xe6,0x08,0x55,0xb7,0xe6,
+  0x9d,0xdb,0xab,0x28,0xf1,0xff,0x39,0x9c,0x66,0x55,0x36,0x10,0xd6,0x21,0x80,0x90,
+  0x9b,0x7f,0xda,0x5a,0xd1,0x0f,0x89,0x01,0xd1,0xf6,0xeb,0xb8,0xf2,0x30,0x44,0xac,
+  0xb6,0x17,0x9d,0xee,0x7a,0x13,0x2f,0x9a,0xbb,0xbf,0x8c,0x14,0xec,0x83,0xc3,0x19,
+  0x0b,0xed,0xe0,0x31,0xb7,0x8e,0x47,0x53,0xf2,0x39,0xfd,0x1c,0x0a,0xde,0x44,0x78,
+  0x6f,0xff,0x8b,0xd7,0xf1,0x18,0x5d,0x0f,0x4b,0x79,0x75,0x46,0x1b,0xf5,0xf2,0x7f,
+  0xbc,0x40,0xc8,0xd3,0xff,0x02,0x7e,0x09,0xcf,0x6c,0xae,0x33,0xee,0xa3,0x7a,0xbf,
+  0x6f,0x0a,0x7e,0x6c,0xf9,0x29,0xdb,0x3f,0x60,0x6d,0x7c,0xf7,0x27,0x73,0xfa,0x5f,
+  0xb4,0xc0,0xa3,0x19,0xdc,0x76,0xff,0x99,0x0d,0xb3,0xf5,0xc2,0xff,0x10,0x7e,0x83,
+  0xe7,0x75,0xa4,0xca,0xe9,0x7f,0x51,0x43,0x6e,0x1f,0xe3,0x96,0x07,0x04,0xff,0x47,
+  0xb8,0x7d,0xfa,0x2d,0xbe,0x90,0x67,0x7c,0x6e,0xfd,0x9f,0x47,0x11,0xf6,0xa8,0x65,
+  0xac,0x3f,0x41,0xd1,0x2e,0x41,0x7b,0xb6,0x1b,0x81,0xd9,0x40,0xc8,0xdb,0xff,0x62,
+  0x15,0xae,0xff,0xba,0x8a,0x92,0xb5,0xf2,0xeb,0xc6,0xc8,0xb2,0xf9,0x15,0xf7,0x53,
+  0xfc,0xcb,0x6c,0x73,0xe7,0x5b,0x91,0xd3,0xff,0x62,0x60,0xca,0x0b,0xca,0x79,0xf8,
+  0x61,0x8b,0xf4,0x40,0xf5,0xb0,0x71,0xb6,0xcc,0xe2,0x3f,0x7b,0x1a,0xa1,0x32,0x21,
+  0xbc,0xe5,0xec,0x47,0x3d,0xa5,0x67,0xe0,0x59,0x68,0x68,0x2a,0x3e,0xd1,0xb9,0x72,
+  0xdb,0xd1,0xc0,0xae,0xb6,0x40,0xb2,0xfa,0x8c,0xdb,0x18,0xeb,0xac,0xd5,0x5a,0xe2,
+  0x39,0x67,0xfc,0x1a,0xc4,0x9f,0x03,0x6c,0x81,0xd6,0xbd,0x8e,0x55,0xf1,0x6e,0x5d,
+  0x44,0xbb,0x5e,0x37,0xd3,0xde,0x42,0x88,0xc5,0xdc,0xd3,0x8f,0x52,0x45,0x7c,0x45,
+  0xd5,0x9e,0xa9,0xec,0xb3,0xbe,0x35,0x8b,0x7f,0x74,0xea,0xff,0x6e,0xcf,0xb7,0x49,
+  0x25,0xfc,0x63,0x8f,0x0f,0x95,0xee,0x48,0xad,0x2f,0x9c,0x41,0xf5,0x97,0x84,0xa2,
+  0x04,0xfe,0xb1,0x19,0x9e,0x56,0x23,0x0c,0x14,0x4e,0xe5,0xd4,0x3f,0x3c,0xda,0x46,
+  0x6c,0x9f,0xf2,0x95,0xec,0x4d,0xa9,0x4e,0xe0,0x9f,0x9c,0x46,0xae,0xf8,0xfc,0xe5,
+  0x23,0x15,0xf6,0xf8,0x55,0xd2,0x23,0x68,0xc6,0xe7,0x13,0xc9,0x79,0x58,0x79,0x11,
+  0xec,0x44,0x30,0x2b,0x22,0xe6,0x00,0x21,0x4f,0xfd,0x67,0xd8,0xca,0x07,0x8c,0x3a,
+  0x08,0x42,0xb3,0x8e,0xc6,0xba,0x8e,0xfc,0x3f,0xaf,0xc3,0x10,0xd4,0xb9,0xeb,0x2d,
+  0x40,0xfe,0x1f,0xfb,0xf7,0x8a,0x14,0x5c,0x03,0xf7,0xf1,0xb0,0x55,0xf6,0xf9,0xab,
+  0x30,0x8f,0xf8,0xcf,0x63,0x70,0xaf,0xb2,0xcd,0x2d,0x84,0xe8,0x4b,0xe5,0xf4,0xbf,
+  0x68,0x31,0x3a,0xda,0x4d,0xf3,0x5f,0xe6,0xb3,0x80,0x4a,0xf8,0x47,0xb5,0xf8,0x09,
+  0xba,0xe9,0x14,0x2a,0x21,0x3e,0xaa,0xb3,0xdf,0xa5,0xa4,0x0a,0x58,0xcb,0xef,0xec,
+  0xbf,0xb6,0x3d,0x31,0x99,0xef,0x8d,0x4d,0x3b,0xae,0x52,0xb5,0xd2,0x7b,0x92,0x9e,
+  0xf7,0xd7,0xd7,0x1e,0x76,0xf3,0xcd,0x7b,0xf9,0x54,0xe8,0xe7,0xb3,0xdf,0x08,0x86,
+  0xfc,0x0d,0xf0,0x14,0x9f,0x33,0xb2,0x71,0x8d,0xfc,0x1c,0xfc,0x77,0xef,0x6c,0xa7,
+  0x10,0xe2,0x19,0xc4,0x27,0x87,0xa7,0xbb,0xfc,0x9f,0xee,0x42,0x7c,0xad,0x8e,0xda,
+  0x69,0xce,0x83,0xc1,0xb4,0x84,0xb0,0x39,0xe3,0x16,0xbe,0x1b,0xf2,0xa7,0xe5,0x26,
+  0xf7,0x7c,0x54,0xf0,0x01,0xbf,0x64,0xed,0x56,0x97,0x23,0xaf,0xf1,0x39,0xa3,0xd9,
+  0x6d,0xeb,0xa6,0x9c,0x42,0x2e,0x6e,0xff,0x8b,0xef,0x97,0x6e,0x86,0xc7,0xe3,0xd7,
+  0xf7,0x97,0xdc,0xc1,0x5e,0x61,0xf7,0x50,0x3e,0x3b,0xd9,0x9f,0xbd,0x79,0xf6,0xc7,
+  0xdb,0xff,0xe2,0x5f,0x93,0x7b,0xe0,0xaf,0x4c,0xbf,0x81,0xe3,0x1f,0x84,0xad,0xd9,
+  0x61,0xfc,0xba,0x9c,0xf1,0xde,0xfe,0x17,0xc7,0x21,0xdd,0xb6,0xd2,0xbc,0x97,0x0b,
+  0xff,0xcf,0x0c,0x91,0x7f,0xc1,0x9f,0xf0,0xda,0x73,0x14,0x06,0x3d,0xfe,0x9f,0xef,
+  0xe1,0xfe,0x75,0x03,0x79,0x33,0xa8,0x4c,0xdf,0x6e,0x91,0xc6,0x0e,0x97,0x95,0xaf,
+  0x3a,0xf3,0x25,0xe1,0x2d,0x4f,0xfd,0xbd,0x53,0xd9,0x24,0xaf,0x6a,0xa7,0x1f,0xf7,
+  0x88,0x91,0x57,0x08,0x91,0xb9,0xfd,0x2f,0xb8,0x76,0x41,0xf9,0x79,0x40,0x9c,0x2f,
+  0xbe,0xc6,0x7e,0x0c,0x73,0xcc,0x1d,0x96,0x3f,0x64,0x4e,0x4e,0x62,0x94,0xdb,0xff,
+  0x82,0x2b,0x4b,0x61,0xbd,0x31,0xcb,0xf4,0x6f,0x0c,0x47,0xb5,0x97,0x89,0xbf,0x4a,
+  0x69,0xec,0x4e,0x3d,0x1f,0xbb,0xa3,0xa5,0xc7,0xff,0x33,0x5d,0x44,0x67,0xae,0xed,
+  0x61,0xab,0x45,0xbd,0xbe,0xec,0x7e,0x3d,0x3d,0x67,0xbc,0xb7,0xff,0x85,0x82,0x6a,
+  0x59,0x4d,0xd9,0x70,0x01,0xd4,0x67,0x0d,0xad,0xae,0x81,0x71,0x8d,0x9f,0xbc,0xfc,
+  0x9f,0x95,0xf0,0xa2,0xd4,0x68,0xa2,0xd9,0xf9,0x2c,0x7b,0x86,0xda,0x96,0x51,0x7e,
+  0xcd,0x6f,0x61,0x5e,0x8e,0x7e,0x4c,0x67,0xfd,0xa4,0xae,0x3e,0x43,0xd5,0x56,0x4d,
+  0xbf,0x99,0xa5,0xb5,0x04,0xad,0xf9,0xe6,0x26,0xc2,0xbb,0xfa,0x31,0x0b,0x2e,0x19,
+  0x4f,0xf3,0xd9,0xe9,0xc0,0x69,0xf9,0x8c,0xf2,0x3c,0x9f,0x95,0xc9,0x2d,0x04,0x6d,
+  0x77,0x44,0xf5,0xe0,0x9f,0xe3,0xd4,0xf6,0x82,0xab,0xb1,0xa6,0x53,0xca,0x06,0xee,
+  0xad,0xff,0x63,0x09,0x0b,0x32,0x25,0x88,0x88,0x3c,0xfd,0x2f,0x8e,0x43,0x87,0x1a,
+  0x5e,0xaf,0x32,0xb4,0x36,0x9d,0x79,0xd3,0x74,0x84,0x93,0x1e,0xfe,0xcf,0xc6,0xb2,
+  0x0e,0xd8,0x96,0x56,0x7b,0xca,0x46,0xdc,0xf8,0x23,0xaa,0xb1,0x2f,0x2b,0xcc,0x20,
+  0x46,0xab,0xa7,0xfe,0x33,0xe2,0xe7,0xf5,0xc9,0xba,0x54,0x60,0x9f,0x9c,0xe1,0xcf,
+  0x78,0x97,0x81,0xa7,0xa3,0x1c,0x33,0x3d,0xfd,0x2f,0x0e,0xc2,0x45,0xca,0x8f,0x1b,
+  0x6d,0xfe,0x8d,0x3a,0x41,0xa3,0x10,0xbb,0xe3,0xa7,0x3d,0x9e,0xf8,0x3f,0xeb,0x71,
+  0x37,0x2c,0x79,0x40,0xd6,0x99,0xa8,0x7f,0x98,0x8f,0xb7,0x49,0x18,0xcc,0xf1,0xff,
+  0x3c,0x4a,0x4d,0xed,0xbf,0xc5,0x54,0xd8,0x60,0xe6,0xd6,0x2f,0x72,0x84,0xf7,0xec,
+  0xa7,0x27,0xff,0x0f,0xc7,0x63,0x38,0xdc,0x12,0x61,0x81,0xb6,0x87,0x07,0x49,0x1b,
+  0xe1,0xf1,0xfa,0xc9,0xed,0x7f,0xf1,0x4d,0xfe,0xf0,0xeb,0x08,0x03,0x4a,0x34,0xa7,
+  0x1e,0x60,0x7e,0x87,0xd0,0x81,0x1c,0xff,0x4f,0x1f,0xc4,0xba,0x4b,0xc2,0xfe,0x00,
+  0xff,0x45,0x6e,0xfd,0x1f,0x57,0xc8,0xe9,0x7f,0x51,0x76,0xd1,0x02,0xc9,0x17,0x45,
+  0x21,0x44,0x91,0xff,0x9e,0xaf,0x1f,0xd7,0xff,0x43,0xf9,0xef,0x2f,0x4a,0x75,0x1d,
+  0x01,0xca,0x8f,0x7b,0x8a,0xd7,0x4d,0xac,0x1f,0x8f,0xff,0xa7,0x74,0x0b,0x55,0x7b,
+  0xe6,0x6a,0x7b,0x38,0x40,0xb0,0xa7,0x2f,0xbf,0xb1,0xa0,0x10,0x4e,0x78,0xf2,0x3d,
+  0xbf,0x0b,0x8f,0x99,0xd5,0x29,0x75,0xcc,0x37,0x95,0xdd,0xe3,0xc0,0x1e,0x9c,0xa6,
+  0xcf,0xd3,0x01,0x6d,0xd4,0x83,0x7f,0x8e,0xd3,0x21,0x7d,0x9f,0xba,0x85,0x15,0x0b,
+  0xff,0xf3,0x44,0xeb,0xad,0xe9,0xa7,0xb9,0xfe,0x1f,0x3e,0xa7,0x37,0x3a,0xdc,0x19,
+  0x81,0x63,0x94,0x7f,0x91,0xe7,0xff,0x11,0x42,0xbe,0xff,0xe7,0x90,0xc8,0xf6,0x62,
+  0x59,0x37,0xc8,0xf8,0x42,0xd0,0x79,0xfe,0x9f,0xd4,0x2e,0x63,0x49,0xf2,0xc1,0xda,
+  0x70,0xb6,0xff,0xc5,0xf8,0x42,0x31,0x87,0x73,0xf2,0xbf,0xf6,0x9b,0x22,0xff,0x0b,
+  0x81,0x0d,0xcf,0xab,0x3f,0xec,0xe2,0x1f,0x8f,0xff,0x07,0xf6,0x5b,0xf9,0x62,0xdb,
+  0x13,0xf9,0xb0,0xc7,0x11,0xf2,0xeb,0x3f,0xeb,0x46,0x44,0x0b,0x67,0xfb,0x5f,0xe4,
+  0x17,0x82,0x26,0xc1,0xdd,0x1f,0xf7,0x15,0xdf,0x69,0x8c,0xb6,0xed,0xaa,0x08,0x10,
+  0xff,0xe7,0x58,0x7e,0xbd,0x6b,0x5b,0x78,0xc7,0xed,0x7f,0x21,0xfa,0xbf,0x2f,0x24,
+  0xff,0xcf,0x69,0x01,0x7b,0x96,0xe6,0xce,0x57,0x11,0xc2,0x29,0xa7,0xa2,0x39,0xc5,
+  0xbf,0xfa,0xa0,0xae,0x25,0xb0,0x59,0x9e,0xcb,0x9e,0xbd,0x52,0x21,0x9d,0xc3,0x9e,
+  0xfc,0xf7,0xc3,0x5b,0xbb,0xf9,0x36,0x3d,0x72,0xcc,0xa7,0x2b,0x43,0x1e,0xd8,0xe3,
+  0x15,0xe4,0xfb,0x72,0xea,0xff,0x64,0xf3,0xbf,0x14,0xb8,0xf2,0x7c,0x1d,0xff,0x73,
+  0x28,0x9b,0xff,0xb5,0xaa,0x6d,0xf1,0x74,0x70,0xf5,0xe9,0x2d,0xc4,0x74,0x2d,0xd5,
+  0x53,0xb2,0xd7,0x03,0xe5,0x7f,0xad,0xa7,0xfc,0x2f,0xe2,0xaf,0xae,0xbf,0xc2,0xf3,
+  0x37,0x7b,0xfc,0x3f,0x56,0xfe,0xd7,0xca,0xe0,0x43,0xf2,0x70,0x24,0x7f,0x9a,0x8e,
+  0x70,0x2c,0xc7,0xff,0x33,0x40,0x69,0x5f,0x66,0x39,0xe0,0x6b,0xed,0x51,0xfb,0x24,
+  0x8f,0xfe,0x3d,0xfe,0x9f,0x82,0x08,0x9e,0xbf,0xd0,0x3e,0x67,0xd8,0x8d,0xda,0x7d,
+  0x71,0x4f,0xfd,0x67,0x8f,0x50,0xe6,0xf1,0xff,0x14,0x10,0x1b,0x41,0x7f,0x5d,0x8d,
+  0xb0,0x25,0x06,0x8f,0x5f,0xc1,0x3e,0xbb,0xfe,0x9f,0x94,0x14,0x82,0xfb,0xa1,0x6a,
+  0x50,0x5d,0xc9,0x3e,0x1b,0xea,0x1a,0x57,0xbf,0xcb,0x12,0xea,0x72,0xfb,0x5f,0xf4,
+  0xf3,0xdd,0xa9,0xe8,0x98,0xff,0x36,0x78,0x3a,0xa7,0x10,0x90,0x47,0xf0,0xe6,0xbf,
+  0xf7,0xb2,0x31,0xeb,0xbc,0x7f,0x85,0x46,0xf0,0x24,0xb8,0xf9,0xef,0xc2,0xff,0xd3,
+  0x31,0x3b,0x1e,0x18,0x90,0xcf,0x19,0xcf,0x52,0x21,0xc1,0x89,0xf6,0xaf,0x41,0x4f,
+  0xfe,0x7b,0x0f,0x3c,0x49,0xf9,0xa7,0x06,0x1b,0x34,0xaf,0xf0,0xfc,0x77,0xb1,0xb7,
+  0x9c,0xdf,0x97,0xea,0x3f,0xef,0x51,0xab,0x41,0xa5,0x26,0x83,0x6b,0x27,0x18,0x2f,
+  0x80,0x50,0xc6,0x83,0x7f,0x44,0xfe,0x97,0xa2,0x4e,0x49,0x1c,0x45,0xe3,0x75,0x05,
+  0x7d,0x0e,0xb9,0xf8,0xd0,0xca,0xff,0xca,0x44,0xb6,0xcb,0xd4,0x96,0x24,0xcb,0x5f,
+  0x1d,0x67,0x3f,0x3d,0xf6,0x70,0xc4,0xca,0xff,0x4a,0xc9,0x47,0x6a,0xf2,0xeb,0xad,
+  0x9d,0xb6,0x88,0xe2,0x69,0x4f,0xfd,0x1f,0xc4,0x3f,0x44,0xe2,0x4d,0x44,0xc9,0x7a,
+  0x3f,0x9b,0x9a,0x33,0xf1,0x7e,0xe7,0xd6,0x7f,0xe6,0xca,0x1a,0xd8,0x83,0x98,0x5b,
+  0x1d,0x65,0xbf,0x66,0xdc,0x08,0x4f,0xbc,0x7f,0x8d,0xe6,0xd5,0xff,0x09,0x1b,0x45,
+  0xbc,0xec,0x94,0x7e,0xaf,0xb1,0x62,0xe2,0xf1,0x19,0x47,0x9b,0x94,0xff,0x45,0xe3,
+  0x55,0x60,0xfd,0x1a,0xcf,0x3b,0x96,0x4e,0x88,0x7f,0x44,0xfc,0x0b,0x3e,0x85,0x78,
+  0x98,0x0d,0xc0,0x15,0xf6,0x17,0xd3,0xc9,0x3f,0x4d,0x4d,0x19,0x13,0x6c,0x9f,0x59,
+  0x83,0xe5,0x6e,0xd9,0xc3,0x71,0xf3,0x1d,0x71,0xf4,0x6f,0x16,0x8c,0xea,0xbf,0x59,
+  0x3b,0x27,0x1e,0x78,0x45,0x9e,0xc7,0x9e,0x8f,0x89,0xb4,0xaf,0xbc,0xf5,0xb3,0x74,
+  0xac,0x7c,0xd4,0x89,0x97,0xf1,0xd0,0xc9,0x8a,0x1b,0xf9,0xbc,0x0c,0x1e,0x8b,0xa6,
+  0xc3,0x86,0xf6,0xda,0xe3,0x45,0x79,0xf8,0x47,0x08,0x6e,0xff,0xaf,0xee,0x9b,0x4d,
+  0xa2,0x85,0x1b,0xea,0x26,0x56,0x03,0x0f,0xeb,0xd1,0xc3,0x13,0xce,0xd7,0xe3,0xff,
+  0x91,0xb6,0xc1,0x13,0x5d,0xe1,0xd1,0x48,0x0f,0x0b,0x8b,0xb2,0x03,0x45,0x13,0xea,
+  0xdf,0xe5,0xff,0x54,0xfe,0x82,0x9f,0xd5,0x53,0xed,0x81,0x2d,0x9d,0xd3,0xe1,0x6d,
+  0x76,0x85,0xf7,0xa5,0xcf,0xd3,0xff,0x34,0x8d,0xf6,0x39,0x5b,0x16,0xf2,0xdf,0xae,
+  0x88,0x7f,0x3c,0xf9,0x5f,0x5b,0xe1,0xbc,0xf1,0x38,0x0b,0x24,0x1f,0x9e,0x06,0xcf,
+  0xf0,0x09,0x1a,0x7d,0x0a,0xfc,0xe3,0x3c,0xcf,0x40,0xc1,0x34,0x73,0x4e,0x4d,0xdd,
+  0xa8,0xaf,0x10,0xed,0xed,0x5f,0xb6,0xcd,0x32,0xf3,0x1b,0xe3,0x96,0x90,0xe0,0xfa,
+  0x7f,0x4c,0xf8,0x84,0x36,0x27,0x1e,0x6f,0x57,0xb5,0x6b,0x94,0x84,0xcc,0xa2,0x26,
+  0x78,0xfd,0x81,0xb6,0x30,0xea,0xf0,0x79,0xe2,0xda,0xa7,0xe1,0xf1,0x74,0xd5,0x1b,
+  0xbe,0x21,0x36,0x4f,0xf9,0x76,0xd7,0xcc,0xbc,0xc6,0x10,0x59,0xe1,0x82,0x97,0xff,
+  0x53,0xf4,0xbe,0x1e,0x6b,0x9a,0x5c,0x26,0x17,0xf0,0xa7,0xaa,0x1a,0xcc,0xe8,0x78,
+  0xfc,0x93,0x93,0xff,0x45,0xfc,0x9f,0x9a,0x85,0xe6,0xfd,0xed,0xd2,0x0b,0xca,0xc4,
+  0xf8,0xf0,0xa3,0xa3,0x5e,0xfe,0x4f,0xe5,0x91,0xd0,0x9b,0x08,0x7b,0x26,0x27,0xcb,
+  0x87,0xd5,0x67,0xa4,0x05,0xe6,0x04,0x8d,0x89,0xbd,0xfc,0xde,0xd6,0xab,0xb7,0x28,
+  0x93,0x28,0x8d,0xa2,0x8d,0xbd,0xa0,0xdc,0xd3,0x52,0x35,0x54,0x34,0x11,0xfe,0x71,
+  0xfb,0xad,0xeb,0xb0,0x57,0xf9,0x58,0x57,0x55,0xa6,0x9b,0xd2,0xde,0x1f,0x4e,0x5d,
+  0x77,0x25,0xbc,0x67,0x8f,0x27,0xfe,0x4f,0xe2,0x75,0xfd,0xb0,0x5a,0xcf,0x8e,0x28,
+  0x0f,0x8b,0x36,0xd6,0x13,0xac,0xb7,0x97,0xdd,0xfc,0xaf,0x82,0x73,0xf0,0x4e,0xea,
+  0xe1,0xe4,0xc6,0xbf,0x95,0xcf,0x85,0xdf,0x92,0x16,0x5c,0x09,0xff,0xb8,0xfc,0x8d,
+  0x87,0x29,0xe8,0x00,0x3f,0x4a,0x94,0x67,0xf4,0x1e,0xc3,0xda,0x86,0x94,0xf1,0xf8,
+  0xc7,0xd1,0x8f,0x15,0xef,0x88,0x07,0x92,0x4d,0xd3,0xa1,0x4f,0x8f,0x19,0xf9,0x8d,
+  0x32,0xb3,0xfb,0xbb,0xfd,0x3c,0xa2,0xff,0x29,0x8f,0xc6,0xd5,0x87,0xd8,0xa4,0xae,
+  0x47,0x8d,0x6d,0x13,0x37,0x62,0xf0,0xf2,0x7f,0xa6,0x13,0x3b,0xb1,0xa5,0x08,0xf1,
+  0x4f,0xd7,0xfa,0x09,0xe2,0x35,0x24,0x40,0x0e,0xff,0x87,0xef,0x94,0x6a,0xcd,0xeb,
+  0x28,0x3a,0xf6,0x70,0x8d,0xde,0x3a,0xae,0x11,0xc6,0x78,0xff,0xcf,0x39,0xd6,0x00,
+  0xc5,0x6b,0x65,0xdc,0x88,0x6f,0xaf,0xab,0x88,0x4e,0x84,0x7f,0x3c,0xf9,0x5f,0x95,
+  0x17,0x8c,0xdf,0x2a,0xff,0xb4,0xe8,0xbe,0x41,0xdf,0x1d,0xca,0x59,0xad,0xa1,0x65,
+  0xc2,0xfd,0xdd,0xed,0xe7,0x45,0xfd,0xbf,0xe8,0xbc,0x36,0x73,0xb0,0xb9,0x02,0x9e,
+  0xad,0x69,0x58,0x1e,0x98,0x68,0xfc,0x29,0x17,0xff,0x84,0x52,0x2a,0x81,0x9c,0x56,
+  0x2e,0xc7,0xb5,0xa1,0x48,0xad,0x4a,0xf1,0x2f,0x2d,0x0f,0xff,0xb0,0xe7,0xdc,0xf5,
+  0x96,0xed,0x7f,0xb1,0x3e,0x99,0x78,0x44,0xd9,0x6a,0x44,0x97,0xfb,0xb4,0xf0,0xf8,
+  0xf9,0x7a,0xfc,0x3f,0xf0,0x88,0x08,0x32,0x2e,0xdf,0x5c,0x76,0x4a,0xdb,0xaf,0xd4,
+  0xe6,0xc7,0x1f,0x2d,0xfc,0xe3,0xf1,0xff,0x94,0x0a,0x1a,0x73,0x6b,0x71,0x48,0x5e,
+  0xa7,0xbe,0x29,0x35,0x18,0xb5,0x13,0x3c,0x7f,0xf9,0x88,0xa7,0xff,0xcb,0x76,0x55,
+  0x94,0xfd,0xd9,0x24,0xe3,0xc1,0xb6,0xa8,0x9e,0x1a,0xe7,0x0d,0x8f,0xeb,0x08,0xef,
+  0xe2,0x7f,0x55,0x4b,0x49,0x63,0xea,0x2e,0x98,0xc9,0x65,0x3d,0x32,0x30,0x41,0x23,
+  0x12,0x21,0x24,0x3c,0xf8,0x67,0xbe,0xde,0x60,0x54,0xad,0x55,0x47,0xca,0xbf,0x0a,
+  0x9f,0xe3,0xb5,0xfc,0xfe,0x71,0xf8,0x27,0x98,0xf2,0xe6,0x7f,0x15,0x2c,0x9a,0x56,
+  0xa7,0xc5,0x4d,0x75,0x9e,0x26,0x43,0x67,0x9f,0xb0,0x3f,0xe3,0xdf,0x97,0x7b,0x3d,
+  0xfc,0x9f,0x90,0x74,0x88,0xe3,0xf9,0x65,0x30,0x71,0x97,0xfa,0x6d,0x75,0xe6,0x71,
+  0x41,0x1b,0xce,0x7f,0x7f,0xdd,0xfc,0x2f,0xe2,0xff,0x3c,0xce,0x77,0x66,0xa2,0xab,
+  0xe4,0x32,0x04,0x42,0x8d,0x99,0xc0,0x9a,0x72,0x7a,0x6d,0x73,0xf1,0xcf,0x36,0x2f,
+  0xff,0x47,0x19,0x53,0xea,0xcd,0x92,0x58,0xb5,0x98,0x9d,0xf9,0xcd,0x71,0xf6,0xa4,
+  0x24,0xed,0xa9,0x7f,0x68,0x28,0x07,0xe0,0x97,0x7c,0x76,0x26,0x30,0x36,0x6d,0x13,
+  0x3c,0xdf,0x85,0xdb,0xd6,0xd9,0x89,0xf0,0x8f,0xc3,0x3f,0xef,0x0d,0xf5,0x50,0xfd,
+  0x9f,0x23,0xea,0x20,0xd3,0xba,0x1c,0xfc,0x63,0x55,0x84,0x96,0xad,0x42,0x88,0x25,
+  0xed,0xec,0x2d,0x0f,0xff,0xa7,0x47,0xff,0x9e,0x8a,0x78,0xef,0xf6,0x44,0x1a,0x97,
+  0x06,0x0d,0x2b,0x1c,0x6f,0xaf,0xfa,0x9d,0xfa,0x06,0x71,0x65,0x3d,0xa7,0xb2,0xcf,
+  0xf8,0x5a,0x81,0xde,0xab,0xe4,0xd4,0xfb,0xb5,0x0a,0x21,0xf6,0xf9,0x62,0xde,0xfc,
+  0xaf,0x8a,0x4e,0x78,0x2b,0xb9,0x6b,0x34,0x1a,0x95,0xbb,0xcb,0xde,0x92,0x1a,0x27,
+  0xde,0xbf,0xde,0xf1,0xf0,0x7f,0x44,0xd0,0xd3,0x5c,0xba,0x4e,0x7e,0x1b,0xae,0x41,
+  0x61,0x12,0x85,0x05,0xdf,0xce,0xd3,0xcf,0xeb,0x1e,0xfe,0xcf,0x76,0x2a,0xe2,0x61,
+  0x04,0x4c,0x79,0xbe,0x71,0x5c,0xc9,0x36,0x36,0x72,0x1a,0x3f,0xfd,0xda,0xc6,0x03,
+  0xf6,0xf3,0x6f,0x55,0x56,0x40,0x6a,0x7d,0x64,0xc4,0x77,0x2f,0xfb,0x21,0x55,0xb3,
+  0x99,0x18,0xcf,0x78,0xfb,0x9f,0x86,0x81,0xda,0x40,0xa8,0xbd,0xac,0x57,0xef,0x36,
+  0xb3,0x6e,0x9f,0x1f,0xe4,0x8e,0x2f,0xcc,0x78,0xf8,0x3f,0x61,0x78,0x14,0x22,0xd4,
+  0xed,0xbd,0x97,0xf1,0xec,0xf9,0x54,0x72,0x1b,0x85,0x8c,0xc7,0x3f,0x71,0xa2,0x55,
+  0x18,0x1b,0x29,0xda,0x3e,0x60,0xbb,0x7d,0x9c,0xf9,0x66,0x05,0x4f,0xfe,0x57,0xe5,
+  0x28,0xed,0xef,0x7d,0x41,0x53,0x1e,0x85,0xaf,0x5d,0x11,0xff,0xe4,0xf1,0x7f,0x88,
+  0x2d,0xc6,0xa8,0x6c,0x42,0xe3,0x70,0xc9,0x98,0x5c,0x9f,0xfa,0x5d,0xfe,0x9f,0x2c,
+  0xc8,0xe9,0x45,0x90,0xfc,0x72,0xa2,0x76,0xa0,0x3b,0xcd,0x3e,0x2e,0xae,0x04,0x3d,
+  0xf8,0x27,0xe3,0xac,0x9f,0x2c,0xff,0x87,0xd8,0x4d,0xc7,0x85,0xff,0x27,0x42,0x85,
+  0xaf,0x3d,0xeb,0x21,0x62,0xf9,0x7f,0xec,0xf1,0x66,0xe5,0xe9,0x0a,0xa1,0xb4,0x94,
+  0xe0,0xcf,0x50,0xda,0xb2,0x4f,0x30,0x6a,0xfa,0x7c,0x13,0xe2,0x1f,0xa5,0x32,0xbb,
+  0x48,0x52,0x72,0xc6,0xdc,0x80,0xc2,0x92,0x98,0xbf,0xd6,0xa0,0xb0,0x8b,0xdf,0x8b,
+  0x0f,0x73,0xfa,0xbf,0x0b,0x25,0x64,0xe4,0xf7,0xec,0xfe,0x20,0x63,0xe3,0xf1,0x8f,
+  0xb7,0xff,0x7b,0xc5,0x79,0x98,0x6a,0x06,0xb7,0xfe,0x74,0x44,0x13,0xfd,0x1d,0x76,
+  0xb9,0x8d,0x5a,0x1c,0xc1,0xf5,0xff,0x64,0xf3,0xbf,0x28,0xfb,0xef,0x19,0xbe,0x01,
+  0x28,0x1a,0x78,0x2f,0x5d,0x59,0x80,0xcf,0xe3,0x8b,0xba,0xfe,0x1f,0x7b,0x3d,0x64,
+  0xf9,0x3f,0xa6,0xbf,0x86,0x1d,0xe7,0x9d,0x52,0x74,0x08,0x8f,0xc1,0x8a,0xad,0x1f,
+  0x47,0x51,0xde,0xf8,0x97,0xc5,0xfe,0xf5,0xaf,0x62,0xe7,0xec,0xb6,0xa7,0xd7,0x40,
+  0xb6,0xfe,0xcf,0x54,0x07,0x0f,0x78,0xe3,0x5f,0x56,0xff,0x2f,0xd2,0xbf,0xe8,0x7f,
+  0xb1,0x53,0x56,0x6c,0xd8,0x13,0xb0,0x81,0xd0,0x4b,0x4e,0xfc,0xdd,0x98,0x92,0xcd,
+  0x8f,0xcb,0xc8,0xaf,0x58,0x61,0xaf,0x77,0xed,0x42,0x9a,0xed,0x1e,0xff,0x8f,0xa3,
+  0x1f,0xa7,0xfe,0x73,0x4a,0x3e,0x95,0xca,0x46,0x03,0x6b,0xc6,0xe3,0x1f,0xe7,0x7d,
+  0x74,0xea,0x3f,0xc7,0xd9,0x20,0xdc,0x43,0xec,0xb5,0x51,0xb7,0xfe,0xe1,0x2b,0xb6,
+  0xfd,0x79,0xc9,0xf1,0x3f,0x2f,0xb2,0xeb,0x3f,0xaf,0x2a,0xfc,0x99,0xf6,0x6d,0x2b,
+  0xba,0x77,0xd5,0x38,0xfc,0xd3,0x3d,0xbe,0xfe,0xb3,0x5e,0xf8,0x9c,0x41,0x6d,0x07,
+  0x23,0x69,0x57,0x8d,0xd6,0xfb,0xe5,0x8b,0x95,0x79,0xf9,0xcf,0xbd,0xaa,0x00,0x39,
+  0x71,0xe2,0x3f,0x8b,0xc2,0x23,0xfe,0xf9,0xe3,0xf1,0x8f,0x37,0xff,0xcb,0x42,0x3b,
+  0x5d,0xec,0x75,0x7d,0x08,0x16,0x68,0x56,0xdb,0x0b,0xef,0x7e,0x54,0xc2,0xe5,0x71,
+  0xf9,0x5f,0xb4,0xdf,0x45,0x35,0x4a,0x03,0x0f,0x24,0xfd,0x35,0x76,0xfd,0x1f,0xf7,
+  0xbc,0x9f,0x5f,0xff,0x99,0x76,0xdb,0x69,0x24,0xac,0x89,0x6c,0x0e,0x13,0xff,0x76,
+  0x41,0x0e,0xfe,0x19,0xdf,0xff,0xcb,0x8f,0xf8,0x4a,0x17,0x8d,0xc0,0x92,0x89,0x1a,
+  0xc8,0x77,0x04,0x1d,0x19,0xd7,0xff,0x1d,0x57,0xa3,0x62,0xa7,0x7d,0x91,0x23,0x28,
+  0x92,0x87,0x7f,0xec,0xe7,0x19,0x0b,0xd8,0xd9,0xd6,0x8c,0x84,0xfa,0x8a,0xe8,0x5a,
+  0x59,0xcf,0x75,0x44,0xa0,0xf0,0x81,0x13,0xff,0xea,0x16,0xfd,0xbf,0xa6,0x12,0x7b,
+  0xb9,0xdf,0x8e,0xee,0x79,0xe3,0x5f,0xd6,0x46,0x7f,0x32,0x27,0xff,0xfd,0x45,0x8b,
+  0x06,0x3c,0x17,0xa8,0x4d,0x6a,0xe0,0x27,0x76,0x7f,0x58,0x4f,0x21,0xe8,0xdc,0xfe,
+  0xef,0xfb,0xe0,0x4b,0xe4,0xe4,0xd1,0x09,0xed,0x44,0x54,0xee,0xd3,0x8d,0x7c,0xfc,
+  0x73,0xc4,0xeb,0xff,0x29,0xcd,0xb2,0xbb,0xbb,0xac,0x68,0x57,0xd9,0x2d,0x85,0xea,
+  0x4e,0x91,0x91,0x9a,0x9d,0xaf,0x8f,0xf0,0x8f,0x3d,0x3e,0xcb,0xff,0xa1,0x22,0x48,
+  0x96,0xa0,0x26,0x7d,0x35,0xe3,0xf0,0xe7,0x29,0xe7,0x79,0x52,0xdf,0xa2,0xe7,0xc7,
+  0x49,0x69,0xd2,0xbf,0x0b,0x5a,0x7b,0x54,0xb3,0x9f,0xdf,0xfe,0x7d,0x4b,0xe8,0xf7,
+  0xb2,0xf5,0xe9,0xd4,0x7f,0x4e,0x3f,0x5c,0x93,0x5b,0xff,0xc7,0xeb,0x28,0xfb,0x69,
+  0x6e,0xfe,0x97,0x57,0xdb,0x81,0x6e,0xa7,0xfe,0xb3,0xab,0xff,0x5c,0xfe,0xb3,0x40,
+  0x3b,0xdb,0x18,0xb1,0x9d,0x67,0xf1,0x4f,0xd9,0xfd,0x4f,0xaf,0xcd,0xb8,0x40,0xc8,
+  0x13,0xff,0x52,0x96,0xc0,0x1c,0xeb,0xed,0x38,0x1a,0xb7,0x1a,0x13,0x64,0xdf,0x97,
+  0x0d,0xba,0x67,0x3f,0x72,0xfb,0xbf,0xc3,0x67,0xdd,0xf7,0x97,0x0a,0x41,0x4b,0x4e,
+  0x63,0xac,0xb8,0x37,0x1e,0x64,0x8f,0xa7,0xfc,0xaf,0x2c,0xda,0xf9,0x19,0xa1,0x9d,
+  0x78,0x60,0xcc,0x9f,0xad,0xff,0xbc,0x0a,0xdf,0xdf,0xdf,0x52,0xff,0xd3,0x35,0xe5,
+  0x87,0x73,0xf2,0xdf,0xcf,0x5b,0x66,0x96,0xd8,0xad,0x0d,0x49,0xcb,0x8c,0x28,0xc2,
+  0xc2,0x4c,0xe0,0xff,0xc9,0xf6,0xaf,0xcc,0x04,0x5f,0x61,0xe7,0x8c,0xcb,0xc9,0xc6,
+  0xd1,0xc0,0x98,0x7c,0x08,0xb2,0xfc,0x67,0xa7,0x10,0xf4,0x90,0xa3,0xff,0x47,0x25,
+  0x91,0xff,0x25,0xaa,0x37,0x13,0x11,0xc8,0x50,0xbf,0xc2,0xb2,0x8d,0x78,0xe2,0x92,
+  0x93,0x88,0x71,0xd2,0x13,0xff,0xda,0x62,0x3b,0x85,0x86,0x2a,0xf6,0x2a,0x33,0xe3,
+  0xaa,0xdd,0xaf,0x19,0xe7,0xeb,0x8c,0x37,0xed,0xe1,0xa2,0xfe,0xb3,0xa3,0x34,0x62,
+  0xb3,0x40,0xcc,0x57,0x0c,0x59,0x7e,0xef,0x12,0x69,0x5c,0xfc,0x6b,0xcc,0xde,0xbf,
+  0x38,0x7b,0x5b,0x08,0xd1,0xb4,0xfc,0x1f,0x16,0xff,0x39,0x95,0xdd,0x5f,0xfc,0x39,
+  0xf1,0x2f,0x29,0xab,0x9f,0x3d,0xf2,0x88,0x99,0xad,0x27,0xff,0x9c,0x6d,0x81,0x9d,
+  0x52,0xfc,0xde,0xfe,0xef,0x07,0xad,0x30,0xc7,0x98,0xdc,0x40,0x86,0xdd,0x08,0x8c,
+  0xca,0xab,0x75,0xe2,0x3f,0xfb,0x33,0x13,0xc5,0xbf,0x9c,0xfe,0x5f,0xf3,0x13,0x7f,
+  0x2b,0xf2,0x97,0xbb,0x27,0xdb,0xf5,0x0c,0x53,0x13,0xe3,0x9f,0xec,0xa6,0xf6,0x40,
+  0xd3,0x2a,0x6a,0x7c,0x70,0x58,0xdd,0x27,0x02,0x61,0xce,0xf8,0x2f,0xe5,0xc7,0xbf,
+  0x28,0xff,0x8b,0xaa,0x61,0x5f,0xd3,0x2a,0x0a,0x71,0x44,0xb4,0x6c,0xff,0xd3,0x6b,
+  0xf5,0x09,0xf1,0xcf,0xbf,0xae,0xb6,0x27,0x45,0x69,0xef,0x68,0x1f,0xec,0xfc,0x26,
+  0xbf,0x67,0x3d,0xe4,0xf7,0xff,0xca,0x56,0xb3,0x11,0x82,0x61,0x4f,0x33,0x9e,0x15,
+  0x26,0x21,0xfe,0x71,0xe3,0x4d,0x05,0x1f,0xc0,0x71,0x3e,0x3b,0x15,0x58,0x25,0xcf,
+  0x6b,0xb9,0xb0,0x79,0xce,0x15,0xe2,0x5f,0xcc,0xc5,0x3f,0xa7,0xd8,0xbd,0x3c,0x9c,
+  0x52,0x7b,0x7d,0x35,0xc9,0x03,0x55,0xe1,0x71,0xf1,0x2f,0x21,0xb4,0x7b,0xf2,0xdf,
+  0x87,0xa9,0x0d,0x0a,0x8f,0xa4,0x98,0xa2,0x7e,0x1f,0xe2,0x56,0xfe,0xfb,0xef,0xf0,
+  0xff,0x54,0x6e,0x37,0xd6,0x53,0xff,0xaf,0xde,0x70,0x8d,0x76,0xa0,0xdb,0xc1,0x9f,
+  0x9e,0x78,0xe2,0x86,0x34,0x5b,0xe3,0xe1,0xff,0x3c,0x07,0x78,0x66,0x49,0x05,0x66,
+  0xc8,0x55,0xc6,0x39,0x63,0xd7,0xc4,0xf8,0x79,0xc0,0x89,0x67,0x65,0xa4,0x3d,0x70,
+  0x21,0xd5,0xc8,0x83,0x99,0xea,0x33,0xca,0xd7,0x7f,0x7f,0xfc,0xab,0x4d,0xc3,0xf3,
+  0x48,0x59,0x5d,0x4f,0xf1,0x23,0x72,0x55,0x7e,0xff,0x0b,0x47,0x28,0x7f,0xc1,0xe3,
+  0xff,0xf9,0x18,0x15,0xa1,0xdd,0xa6,0xee,0x28,0x9b,0x0e,0xbb,0xf9,0x95,0xe2,0x5f,
+  0x0e,0x7f,0x3b,0x53,0xd0,0xc2,0xd3,0xbc,0x26,0x5d,0x74,0x3d,0x6b,0xe6,0xbb,0xb4,
+  0xd5,0xe6,0x84,0xfe,0x31,0x17,0xff,0xec,0x93,0xae,0x6a,0x79,0x7c,0xf0,0x63,0xba,
+  0xfa,0x37,0xec,0xcf,0xe1,0x71,0xf3,0x8b,0x13,0xfb,0x43,0x2e,0x39,0xe3,0x5b,0x55,
+  0x45,0x1f,0xd5,0xe6,0xf2,0xe2,0x2a,0x79,0x51,0xfc,0xbd,0x89,0xe2,0x5f,0x54,0x1a,
+  0xe8,0x25,0x67,0xbc,0x31,0x65,0x8f,0xf4,0x1b,0xed,0xa6,0xae,0xe0,0xeb,0xc1,0x7d,
+  0x76,0x21,0x20,0x52,0xcb,0x37,0x6c,0xfd,0x7c,0xc3,0xc2,0x3f,0xf6,0x7c,0x7b,0xf1,
+  0xf7,0x1d,0x80,0x18,0x0f,0xc4,0x64,0x5d,0xbb,0x92,0x7e,0xf2,0xf8,0x3f,0x3f,0xa3,
+  0xf8,0x97,0x81,0xb0,0xe7,0x71,0xc9,0x81,0x3d,0x37,0x5e,0x91,0xff,0xf3,0xcf,0xb0,
+  0x91,0x57,0xa5,0xae,0x59,0xb5,0xad,0x6c,0x5c,0xff,0x0b,0x47,0xc8,0xe5,0xff,0x24,
+  0xb9,0x6e,0xfa,0x22,0x33,0x54,0x1d,0x8f,0x55,0xb6,0x1a,0x23,0x39,0xfa,0xcc,0xc1,
+  0x3f,0x70,0xa4,0x7b,0xf7,0x96,0xdb,0x32,0xf2,0x8d,0x70,0xc9,0x6c,0x98,0xd8,0xff,
+  0xf3,0xbe,0x37,0xfe,0x65,0x8c,0xc5,0x1b,0xe0,0xba,0x2c,0xfb,0xd4,0xe9,0x07,0x7a,
+  0x25,0xfe,0x8f,0x76,0x8a,0x1f,0xe5,0xf3,0x8c,0x25,0x49,0x79,0x3a,0x0a,0x57,0x88,
+  0x77,0xe4,0xf2,0x7f,0xd6,0xb7,0xea,0x71,0x84,0x25,0xeb,0xd4,0xf5,0x83,0x57,0x8c,
+  0x7f,0xd9,0x1f,0xc2,0x3f,0xeb,0xcb,0xb6,0x65,0xd4,0x64,0xd9,0xca,0xd9,0x7f,0x50,
+  0xfc,0x2b,0x20,0xda,0x84,0xa9,0xb1,0xa6,0xfe,0xdf,0x11,0x0f,0x72,0xd7,0x1b,0x9e,
+  0xbf,0x44,0xfc,0x85,0x37,0xdf,0xd9,0x74,0xac,0xed,0x0a,0xf1,0xaf,0x0f,0x9c,0xfd,
+  0x6e,0x60,0xca,0x0b,0xec,0x37,0x4a,0xa3,0x39,0x6b,0x90,0xba,0x5d,0x5c,0x29,0xbe,
+  0x73,0xd2,0xa9,0xff,0x1c,0x2a,0xe8,0x07,0x51,0x8f,0x7d,0x50,0xbe,0x1e,0xae,0x18,
+  0xff,0x3a,0xe9,0xd8,0x9f,0x35,0xd9,0xfa,0x3f,0x7e,0x1e,0xd6,0xf9,0xb1,0x48,0xad,
+  0x45,0xc3,0xf6,0xe0,0x9f,0x05,0x02,0xff,0x78,0xf8,0x3f,0xd9,0x49,0xc5,0x10,0xc6,
+  0x5c,0x69,0xbe,0x65,0x2f,0x49,0xf6,0x78,0xea,0xff,0xfe,0x28,0x45,0xbb,0xf6,0x30,
+  0x07,0x46,0x5a,0x40,0xa8,0xc8,0x69,0x2c,0x9b,0x64,0xef,0x38,0x7c,0x57,0xc1,0x7f,
+  0x4e,0x35,0xb4,0x07,0x2b,0x64,0x85,0x5d,0xf1,0xf7,0xf5,0xe0,0x1f,0xd8,0xa1,0xbe,
+  0x69,0x34,0x2c,0x0b,0x6e,0xea,0x1c,0x86,0x37,0x53,0x59,0x1a,0x7c,0xfe,0x78,0x6f,
+  0xff,0x77,0x71,0xec,0xd5,0x96,0x72,0xbf,0x0e,0x43,0x79,0x8d,0x30,0x5c,0xfc,0xe3,
+  0x8e,0x57,0x66,0xb0,0xfb,0x32,0x1f,0x4f,0xcb,0xc3,0xec,0x46,0xe3,0x3e,0x33,0x6c,
+  0xd1,0x9e,0x09,0xf6,0x14,0xd9,0xfe,0x9f,0x0d,0x88,0x7f,0x6a,0xec,0xdf,0x37,0x52,
+  0xf0,0x29,0xde,0xd9,0xaa,0x27,0x3b,0xe7,0x96,0x7d,0xaa,0xe5,0xc1,0x98,0x62,0x9f,
+  0xc7,0x3d,0xf6,0x47,0xf6,0xf2,0x51,0x75,0xe9,0xa3,0x78,0xec,0xba,0x2e,0x89,0x2f,
+  0xe9,0x67,0x61,0xad,0x55,0xed,0xf0,0xb3,0xe3,0xe2,0x5f,0x6e,0x3d,0xbd,0x48,0xf7,
+  0x54,0xf8,0x31,0x9f,0x4d,0x24,0xe7,0xaf,0xc3,0x6b,0x5d,0xd7,0xbf,0x3e,0x61,0xfc,
+  0xeb,0xb0,0x3d,0x9c,0xf0,0x4f,0xea,0x7d,0x9a,0x54,0xac,0x7c,0x07,0x69,0xc3,0xb4,
+  0x69,0xcf,0x66,0x71,0x8e,0x3d,0xb1,0xdf,0x47,0x43,0xf4,0xbf,0x98,0x93,0x8a,0x8e,
+  0x95,0x7f,0xa0,0x7a,0x69,0xab,0xb9,0xfe,0x1f,0xa7,0xff,0xd7,0xf7,0x4b,0x37,0x67,
+  0x1e,0xa3,0x26,0x17,0x6d,0xec,0x05,0xbe,0x57,0xab,0xea,0xcf,0x8b,0x67,0x29,0xc2,
+  0x10,0xbd,0xed,0xc6,0x17,0x60,0x8b,0xf6,0x18,0x54,0x83,0xda,0x9e,0x78,0x01,0xfe,
+  0x33,0x8f,0x26,0xe4,0x08,0xa7,0x73,0xf8,0x3f,0xbb,0xf1,0xbf,0xd4,0x50,0xa2,0x9f,
+  0xef,0xfc,0x64,0x7c,0x9c,0x3d,0x17,0x86,0xc8,0xc5,0xb7,0xbd,0x95,0x3f,0x84,0xf7,
+  0x43,0x75,0x89,0x8d,0x15,0xf2,0xb3,0x70,0x3e,0x75,0x85,0xf8,0x8e,0x9b,0x6f,0x48,
+  0xf1,0xaf,0xb3,0x46,0xc3,0xa6,0xe0,0x66,0x79,0xb8,0xed,0xec,0x04,0xf6,0x96,0x3a,
+  0x20,0x54,0xbb,0xf1,0x38,0xea,0x7f,0xfa,0x1c,0xcc,0xa9,0x09,0x0c,0xca,0xf3,0xdc,
+  0xfc,0xf7,0xfc,0xfd,0x2e,0x13,0x77,0xee,0x4f,0xfc,0x9f,0x44,0x44,0x53,0x7b,0xa8,
+  0xfe,0xea,0x15,0xf8,0x1b,0x65,0xde,0xfa,0x87,0xab,0xf9,0x86,0xee,0xe9,0x87,0x71,
+  0x7c,0x34,0x7e,0xa5,0xf1,0xde,0xf8,0x17,0x04,0xf0,0x35,0xac,0xe5,0x68,0xdf,0x6a,
+  0x28,0x0d,0xf3,0x0a,0xf1,0x2f,0x70,0xff,0x60,0x35,0x1c,0x65,0x64,0x3f,0xad,0x63,
+  0xe3,0xc4,0xfa,0x71,0xfd,0xe1,0x84,0x7f,0x7e,0xc3,0x6e,0x84,0xfb,0x07,0xe5,0x51,
+  0x2a,0x84,0x38,0xe1,0x7c,0xcb,0x33,0xae,0xff,0xa7,0xc0,0xb3,0x5a,0x50,0x3f,0x24,
+  0x4c,0x85,0xa7,0x79,0xe3,0x00,0x0a,0xf3,0xec,0x44,0xb0,0x09,0xfc,0x3f,0x84,0x76,
+  0x36,0x98,0xb5,0x99,0x5b,0x29,0xed,0x7d,0x03,0xaf,0x1d,0xc6,0x2b,0xd3,0xc5,0x57,
+  0xc4,0x88,0xf6,0xe0,0x01,0xcf,0xec,0x3a,0x8c,0x28,0xe5,0xb3,0x0b,0xbc,0xc7,0xf1,
+  0x8a,0xe5,0xe8,0x28,0xca,0xf5,0xff,0x50,0xfe,0xbb,0xa5,0x3d,0x86,0xf6,0xe7,0xe8,
+  0x86,0x9d,0x74,0x7f,0x2a,0x64,0x41,0x89,0x78,0x4f,0x58,0xad,0x45,0x47,0xdd,0xfe,
+  0x2c,0x95,0x8e,0x12,0x8e,0xc3,0x33,0xc9,0x06,0xab,0x3f,0xe9,0x33,0x5a,0x43,0xbf,
+  0x68,0x54,0x91,0x7d,0x71,0x4c,0x0f,0xfe,0x39,0xe8,0x6a,0xe3,0xbc,0x35,0x5f,0x54,
+  0x0b,0x6b,0xc8,0x04,0x47,0xdd,0x8a,0x01,0xa3,0x79,0xf5,0x9f,0x9d,0x6c,0xaf,0xac,
+  0xff,0xed,0x19,0x22,0xca,0x66,0x0b,0x1d,0x1f,0xc6,0x2b,0x43,0x9e,0xf9,0x46,0xdd,
+  0x5f,0x7f,0x3f,0x0b,0xf7,0x95,0xa4,0x9b,0x8e,0x13,0x31,0x8c,0xab,0xf3,0xc5,0x7a,
+  0x20,0xe8,0xcb,0xce,0x39,0x3f,0xaf,0xe3,0xff,0xb1,0xdc,0xa4,0x56,0xbd,0x62,0x89,
+  0x88,0x2b,0x91,0xd9,0x56,0x21,0xe8,0x17,0x26,0xf6,0xff,0x58,0xbb,0x7f,0x55,0xe6,
+  0xde,0x35,0xec,0x35,0xd1,0xf6,0x5d,0xfd,0x9a,0x5b,0x18,0xd9,0x74,0xc6,0xb7,0xaa,
+  0x01,0x75,0xb7,0x8b,0x76,0xe6,0x12,0xda,0x39,0xae,0x3c,0x05,0xe9,0x41,0x91,0x11,
+  0x66,0xf3,0x7f,0x5c,0xfe,0xf3,0xa7,0x0e,0x8e,0x7b,0x3b,0x2e,0xb4,0x5e,0xd6,0x1a,
+  0x5b,0x6c,0xfd,0xf4,0x0b,0xfe,0x8f,0xf3,0xfe,0x16,0xe4,0xae,0x46,0xe3,0x9e,0x74,
+  0xf3,0x29,0xc2,0xe7,0x99,0x80,0xa7,0x10,0xb4,0x6b,0x9f,0x89,0xff,0x63,0x5b,0x0f,
+  0x75,0x2f,0xcb,0x36,0x92,0xbe,0x07,0xb7,0x21,0xf0,0x14,0x82,0x3e,0xe1,0xd6,0xff,
+  0xf4,0xf6,0xff,0x42,0xe1,0xa4,0x40,0x77,0xf7,0x58,0x81,0xbf,0x9f,0x4d,0x84,0x7f,
+  0xf2,0xdf,0xa6,0x1b,0xcb,0x84,0xe3,0x31,0x27,0xb1,0xce,0xf5,0xcf,0x58,0xf9,0x5f,
+  0x2e,0xda,0x49,0x05,0x7b,0x89,0x08,0xcd,0x1b,0x89,0x08,0xfd,0x96,0x9e,0xfd,0xca,
+  0xc5,0xe7,0x6e,0xfd,0x1f,0xd9,0xdb,0x08,0x4c,0x6b,0xc0,0xa3,0xb6,0xb8,0x52,0x9b,
+  0x8f,0x7f,0xc6,0xef,0x86,0x56,0xbf,0xa7,0xe0,0x77,0x3c,0xf1,0x2f,0xd7,0xbe,0x39,
+  0xfe,0x9f,0xb0,0x40,0x2f,0x8b,0x5c,0xfe,0x49,0x8f,0x85,0x67,0x56,0x8e,0xc3,0x3f,
+  0x79,0x68,0xa7,0xe9,0xd4,0xef,0xe5,0xff,0x38,0xdd,0x2e,0x5c,0x18,0xd0,0x9a,0x83,
+  0x7f,0x72,0xf2,0xdf,0xdd,0xb2,0x33,0x57,0xe2,0xff,0x7c,0x90,0xc3,0xff,0x71,0xcb,
+  0xf8,0x50,0xb5,0xc3,0x41,0x3c,0x1d,0x64,0x13,0xc1,0x1c,0x62,0xb3,0x37,0xfe,0x95,
+  0xa3,0x9f,0xba,0x45,0x1b,0x5d,0xda,0x70,0x98,0xf8,0xcf,0x8d,0x96,0x7e,0xec,0xf3,
+  0x94,0xf0,0xff,0x48,0x9e,0x6c,0x2f,0x95,0x97,0x59,0x6e,0x1f,0xd5,0xf4,0xf8,0x7f,
+  0xc6,0xd5,0xff,0x11,0xb3,0xdb,0x6b,0x50,0xe3,0x95,0x26,0xb1,0xcc,0x06,0x59,0x9b,
+  0x3b,0x5f,0x2f,0xfe,0x41,0xb4,0x23,0x67,0xb5,0xf7,0x9f,0x50,0x1d,0x5f,0x35,0xc4,
+  0xce,0xa0,0x30,0xcb,0x98,0x31,0xe8,0xea,0xf3,0x1d,0x6f,0xfd,0x1f,0x6f,0x3f,0x2f,
+  0x91,0xdf,0x77,0x8a,0x1a,0x9f,0x2d,0x2b,0xf1,0xf8,0xbb,0x32,0xb9,0xf5,0x9f,0x9d,
+  0xec,0x30,0xdd,0x2a,0x13,0x8d,0x7f,0x58,0x6f,0x7c,0x2a,0x29,0x3b,0x15,0xa1,0x4f,
+  0x38,0xbf,0xd7,0x38,0xff,0x0f,0xf5,0xdb,0x25,0x41,0x2b,0x36,0x27,0xc4,0x3f,0x59,
+  0xff,0xcf,0xb5,0x59,0xb4,0x63,0xd5,0xff,0x39,0xc7,0x9c,0xf8,0xd7,0xac,0x54,0x30,
+  0x97,0xff,0x6c,0xd9,0x9f,0x0d,0xf6,0xdb,0x71,0x6b,0xac,0x29,0x0b,0x7b,0xb2,0xe7,
+  0xf1,0x44,0x91,0x77,0x3f,0x4a,0xb9,0x4e,0x12,0x7b,0xf7,0x6f,0x1a,0x52,0x45,0x3d,
+  0xc0,0xac,0xff,0x47,0xc3,0xaf,0x06,0x5a,0xec,0xf1,0xbd,0xaa,0xe5,0xed,0xb9,0xd5,
+  0x46,0x3b,0xf7,0x93,0x23,0x68,0x6f,0x02,0x61,0x4f,0xab,0x75,0x25,0x55,0x4c,0xfc,
+  0x67,0xe7,0x7d,0x99,0xe2,0xb1,0xb7,0x56,0x7d,0x9b,0xea,0x8c,0x95,0xff,0xce,0x2d,
+  0x0b,0xc3,0x4b,0xbc,0xf1,0xf4,0x6c,0xfe,0x57,0xc6,0x7f,0x56,0x64,0x7b,0xcd,0x59,
+  0x19,0x18,0x62,0x0d,0xad,0x17,0x79,0x79,0x3c,0x30,0x22,0x0a,0x41,0x37,0xc6,0x09,
+  0xff,0x38,0xe7,0xa9,0xde,0xd2,0x2d,0xca,0xde,0x6c,0xd9,0x1f,0x78,0x8c,0x55,0x19,
+  0xea,0xed,0x78,0x10,0x13,0x02,0x3e,0xbf,0xfe,0x3d,0xab,0xfe,0xea,0x49,0x2f,0xfe,
+  0x71,0xbb,0x83,0x21,0x70,0x32,0x80,0x0a,0x47,0x93,0xa0,0xb6,0x5a,0x85,0xa0,0x0d,
+  0x8a,0xf7,0xb9,0xf1,0x2f,0xcb,0xfe,0xf4,0xdd,0x6a,0x65,0xcf,0xc5,0x8d,0x1e,0x8d,
+  0x81,0x60,0xdc,0xa9,0xc0,0x9e,0xa3,0xc2,0xb6,0xf0,0x9d,0xd8,0x32,0x6f,0xfe,0xc8,
+  0x0e,0xdc,0x14,0xa6,0x0a,0xa7,0x0d,0xbc,0x47,0x07,0x49,0x5d,0xae,0x85,0xbb,0x21,
+  0xb6,0x2d,0x60,0x6d,0x34,0x0d,0xfc,0xfe,0xb4,0x7c,0xd2,0x83,0x7f,0x1c,0x7b,0x6b,
+  0xd9,0xab,0xa5,0x68,0xaf,0x0c,0x51,0xaf,0x3e,0x5b,0xff,0x50,0x2b,0x49,0x7b,0xea,
+  0x3f,0x73,0xcd,0x43,0xea,0xb8,0x04,0x73,0x78,0x20,0x23,0xcf,0xb5,0x84,0xc1,0x6c,
+  0x3d,0xc0,0xc0,0xa8,0x67,0x7f,0xe4,0xb6,0xff,0x27,0xcd,0xde,0xe4,0x56,0x21,0x71,
+  0xa6,0x2b,0x42,0xb0,0x1a,0x7b,0x89,0xd2,0x6a,0x39,0xf5,0x9f,0x1d,0xa7,0x50,0xf6,
+  0x7d,0x64,0x51,0x4b,0xd8,0x63,0xe1,0x1f,0x45,0x4d,0x7b,0xfc,0xd5,0x8e,0xff,0x27,
+  0x56,0x36,0xa0,0xa4,0xb9,0xae,0xab,0x2a,0x53,0xa9,0xed,0xbb,0xde,0x9a,0x5d,0x78,
+  0xd0,0x1d,0x63,0xc7,0xbc,0xfd,0x2f,0x4a,0x9d,0xf9,0x66,0x0b,0xa1,0xd7,0xc0,0x18,
+  0x43,0x21,0xcb,0x90,0x07,0x54,0x94,0xe9,0xae,0xcf,0x29,0x9e,0xf9,0x9e,0xa1,0x42,
+  0x88,0x86,0x00,0x42,0x0b,0x25,0x3c,0x61,0xbd,0x62,0xa5,0x86,0x21,0xde,0x83,0xf1,
+  0xf8,0xa7,0xb9,0x01,0x2e,0x26,0x45,0xb6,0xd7,0x04,0xfe,0x1f,0x37,0xfe,0x18,0x72,
+  0xf0,0x4f,0xad,0xf2,0x84,0x2e,0xb2,0xbd,0xac,0x2b,0x25,0x1e,0xff,0xcf,0x58,0x6e,
+  0xfd,0x1f,0x58,0x6d,0x5e,0x1b,0xf3,0x6d,0xb4,0xcb,0x5c,0xe3,0x15,0x25,0xcf,0xff,
+  0xe3,0xf1,0x47,0xed,0x10,0xfa,0xbc,0x36,0xcd,0x50,0xe8,0xbe,0x02,0x9e,0x74,0xf9,
+  0x39,0x50,0x9a,0x5d,0x0f,0xb1,0xe6,0x1d,0x76,0x19,0xf0,0x09,0xf8,0x51,0x39,0xfc,
+  0x67,0x4b,0x3f,0xcd,0x5f,0xcb,0xe5,0x3f,0x97,0x5c,0x91,0xff,0xec,0x44,0xbb,0x26,
+  0xe0,0x9b,0x09,0xbc,0x2d,0x7b,0xea,0x3f,0x53,0x3d,0x28,0xa9,0xd6,0x94,0xd3,0xd2,
+  0x97,0x6a,0x0e,0xc4,0xad,0xc7,0x56,0xf2,0x9e,0x1f,0xcf,0xcb,0xf6,0xc7,0x54,0x84,
+  0x53,0xb4,0x4f,0xc6,0x1f,0x14,0x76,0xeb,0xe3,0xf1,0x70,0xc4,0xf2,0xff,0xd8,0xfe,
+  0x3d,0xab,0xfe,0x8f,0xd8,0xf4,0x3f,0x67,0xe4,0xbb,0x41,0x5e,0x95,0x6c,0xfe,0x8f,
+  0x87,0xff,0xbc,0xc4,0x70,0xa3,0x5d,0x15,0xc2,0xdb,0x83,0x40,0xa8,0x22,0x9a,0x45,
+  0x44,0xda,0x7c,0x11,0xff,0x72,0xf9,0xcf,0x95,0xd9,0xf8,0xd7,0x5d,0xcd,0x17,0x0a,
+  0x10,0xf6,0x3c,0x6d,0xe9,0x47,0xb1,0x15,0x65,0x09,0x49,0xc7,0xff,0xac,0xba,0xf8,
+  0xe7,0x39,0x78,0xe6,0x4a,0xf8,0xfc,0xa4,0xcb,0x7f,0xb8,0x7a,0x8b,0x5d,0x2d,0xff,
+  0x15,0x51,0x4f,0x23,0x6b,0x48,0xbf,0x98,0xeb,0xff,0x71,0xce,0x77,0xba,0x17,0xff,
+  0x7c,0xaf,0x43,0x94,0xfd,0x19,0xef,0xff,0x71,0xdf,0x77,0xab,0xfe,0x4f,0x56,0x7b,
+  0x0f,0x53,0x3c,0x7a,0xdc,0x79,0xd6,0x9f,0x5b,0xff,0xd0,0xf5,0xf6,0xa8,0xef,0xe8,
+  0x57,0xf0,0xff,0x78,0xf8,0xcf,0xd9,0xfa,0x3f,0x44,0x7b,0x66,0x3d,0x6a,0xed,0xc4,
+  0x78,0xc0,0xcb,0x7f,0xce,0xee,0x77,0x9b,0x9b,0x71,0x9b,0xdb,0x56,0x67,0x4c,0xc8,
+  0x6f,0xc9,0xe3,0x3f,0xdb,0xe8,0x65,0xa7,0x39,0x2e,0xff,0x7d,0x3c,0xff,0x27,0x07,
+  0xff,0x4c,0xcc,0xff,0xf1,0xe0,0x1f,0x51,0xff,0xc7,0xaa,0x36,0x46,0x85,0x91,0x53,
+  0x6e,0x18,0x28,0x07,0xff,0x38,0xf6,0x67,0x5f,0x4e,0xff,0xd3,0xb6,0xba,0x8a,0x09,
+  0xf9,0x27,0xef,0x38,0xeb,0xa7,0xc7,0x8b,0x07,0x2e,0x2a,0x13,0xfb,0x43,0xca,0xdd,
+  0xfe,0x5f,0x0e,0xfe,0x19,0x14,0x6d,0x32,0xea,0xda,0xee,0x9f,0xd0,0xff,0xe3,0xd6,
+  0x3f,0x0c,0x65,0x54,0x0b,0xe4,0x34,0x11,0xda,0xd9,0xa6,0x4e,0xc4,0x7f,0xc6,0x8d,
+  0x26,0xa7,0xfe,0x0f,0x44,0x17,0x5d,0x4b,0xfd,0xce,0xf6,0xab,0xfa,0xa2,0x09,0xfd,
+  0x5d,0x6e,0xfe,0xbb,0xa8,0xff,0x63,0x91,0x7c,0x2c,0x7d,0x4e,0xec,0x4f,0x73,0xd6,
+  0x83,0x17,0xff,0x28,0x67,0x53,0x75,0x57,0xf0,0xff,0xb8,0x7c,0x24,0x69,0xbb,0xe2,
+  0xb2,0x7d,0x8c,0x09,0x81,0xb1,0x37,0xff,0x5d,0xb5,0xf1,0x4f,0x82,0xb4,0xdd,0x7a,
+  0x05,0xfc,0x79,0x6c,0x5c,0xfc,0xeb,0xd6,0x11,0xf6,0x16,0x3c,0x6e,0x4c,0xcc,0x7f,
+  0x66,0x39,0xfc,0x67,0xd5,0xe9,0x17,0xbc,0xdb,0x8c,0xf6,0xfd,0x1e,0xfe,0x33,0xbf,
+  0x3d,0x8b,0x7f,0x56,0xb2,0xff,0x82,0x3d,0xea,0x95,0xf8,0xcf,0x2d,0x46,0x76,0x7c,
+  0x77,0x16,0xff,0x88,0xf8,0xd7,0x07,0x57,0xe0,0x3f,0x7f,0xcc,0xed,0x47,0x66,0xd7,
+  0xff,0x09,0xa6,0x9b,0x87,0x7f,0x07,0xff,0xd9,0xe9,0x3f,0x42,0xf5,0x7f,0xb2,0xdd,
+  0xbe,0x2e,0xe1,0xdd,0xe6,0x9c,0xfc,0x7d,0xfc,0xe7,0x50,0x16,0xcf,0x18,0x08,0x83,
+  0xf7,0x5c,0xc9,0x9f,0xe3,0xf2,0x8d,0x9d,0xf8,0x97,0xe8,0xf6,0x75,0xa5,0xf1,0xc3,
+  0xce,0x7e,0x41,0xf5,0x7f,0xb2,0x7c,0x8f,0x7e,0x69,0x1f,0x0f,0x4f,0xe0,0xdf,0xd8,
+  0x30,0x8e,0xff,0x6c,0xcf,0xf7,0x3c,0xa5,0x65,0x4d,0xc8,0xff,0x71,0xea,0x5d,0x3b,
+  0xf8,0x27,0x85,0xab,0xe5,0x5c,0x5b,0x43,0xdf,0x15,0xfc,0x21,0xf6,0xfd,0x53,0x36,
+  0xfe,0x79,0x49,0xfe,0x0d,0x11,0xa1,0xcd,0xc0,0x04,0xfe,0x90,0x49,0xdb,0x1d,0xfe,
+  0xf3,0x56,0x1b,0xff,0x50,0x91,0xf3,0x7d,0x30,0x23,0x8f,0xbf,0x7a,0xde,0xda,0xbf,
+  0xbc,0xf9,0xef,0x51,0x7b,0xfc,0x69,0xd8,0x17,0x72,0xf2,0xe5,0x45,0xd8,0xeb,0xb4,
+  0x34,0xde,0xff,0x53,0x91,0x65,0x23,0x00,0xbe,0x7d,0x69,0x2b,0x3f,0x77,0x02,0xff,
+  0x8f,0x17,0xff,0x64,0xe3,0x83,0xf2,0xb0,0xe8,0xff,0x1e,0xb1,0xa6,0x59,0x9b,0xc3,
+  0x6f,0x49,0xb9,0xf5,0x0f,0x2b,0x2f,0xd8,0xd5,0x9e,0xcf,0x4c,0xc0,0x7f,0xfe,0x35,
+  0x51,0x83,0x46,0xe5,0xde,0x49,0x1e,0xfc,0x13,0x78,0x92,0xa1,0x5a,0x28,0x6c,0x7a,
+  0xd9,0x9c,0x33,0x80,0xfa,0x69,0xb0,0x84,0x31,0xaa,0x7f,0x98,0xc5,0x3f,0x92,0xd7,
+  0xff,0xb3,0x13,0xd1,0x60,0x77,0x9a,0xd5,0xc2,0x13,0x7a,0x38,0x83,0xf8,0xb0,0x96,
+  0x18,0xdd,0x2b,0x55,0x2f,0xff,0x27,0xc7,0xff,0xf3,0x00,0x88,0xb6,0x32,0x1b,0xa9,
+  0xfa,0x6e,0x8b,0x3a,0x5b,0xc4,0x97,0x6b,0xb8,0x97,0x98,0xfa,0x96,0x13,0x7f,0xb7,
+  0xfc,0x3f,0x7a,0x4a,0xa5,0x36,0x6a,0xbb,0x21,0xbc,0xa2,0xbb,0x57,0x08,0xd3,0xab,
+  0x1c,0x22,0xb4,0xec,0xcd,0xff,0x32,0x2a,0x76,0xc0,0x8b,0x5a,0x5d,0x2a,0x90,0xae,
+  0xa2,0x85,0x54,0x67,0x06,0xac,0xfe,0xb9,0x7f,0x9f,0xe3,0x2f,0x35,0x9d,0xf5,0x40,
+  0xfd,0x2f,0x2e,0x76,0x1f,0xe2,0xb3,0xac,0xb2,0xcf,0x0d,0x56,0xe2,0xe1,0x65,0x79,
+  0x81,0x61,0xe3,0x9f,0xc3,0x84,0x7f,0x72,0xea,0x3f,0xbf,0x2f,0x09,0x6f,0x0f,0xfe,
+  0x10,0x3c,0xd6,0x12,0xd0,0xe8,0xfe,0x3c,0x26,0x88,0xd0,0xfc,0x3c,0x88,0x15,0xe8,
+  0xc9,0xff,0x52,0x70,0x3d,0xa8,0xe1,0xb4,0x78,0xfe,0x27,0x34,0xd1,0xc8,0x52,0x30,
+  0xe4,0x97,0x87,0xd2,0xa4,0x1f,0x58,0x30,0x54,0x92,0x97,0xff,0x45,0xdb,0x10,0xcd,
+  0x17,0xb5,0xd1,0xa4,0x73,0x9f,0x15,0x7f,0xd7,0x47,0x42,0xb1,0xc2,0x67,0x49,0x3f,
+  0x99,0x1c,0xff,0xcf,0x49,0x69,0x2a,0x3c,0xc6,0xb7,0xee,0x52,0xd7,0x94,0x11,0x30,
+  0xa8,0x4a,0xf9,0x56,0x25,0xc8,0x23,0x24,0xd9,0x44,0xe8,0xeb,0x28,0x31,0x6a,0xc0,
+  0x19,0x6f,0xd5,0x7f,0x8e,0xd1,0xf3,0x53,0xbe,0x64,0xac,0xab,0x84,0xee,0xff,0x04,
+  0x5e,0x51,0x11,0xff,0xcc,0x7d,0x5f,0xb2,0xf8,0x3f,0x9e,0xfc,0x77,0xf1,0x3e,0x76,
+  0x65,0xdd,0xce,0x87,0x78,0xf1,0xd6,0xec,0xb1,0xcb,0x7d,0xbf,0x76,0x7a,0xcf,0x53,
+  0x05,0xa7,0x03,0x67,0x75,0x04,0x6f,0x34,0xdf,0xf3,0xbc,0xae,0xcf,0x01,0x42,0x5e,
+  0xa2,0xf8,0xe1,0x9c,0xfc,0xaf,0x9d,0x5a,0x15,0xa8,0xa3,0x6c,0xb2,0x7a,0x03,0x74,
+  0x58,0x66,0xe4,0x1e,0x36,0xd3,0xbc,0xc5,0xe3,0x48,0x77,0xf9,0xc3,0xc2,0xff,0xd3,
+  0xad,0xa7,0xa8,0xcc,0xa3,0xe6,0xa4,0xbd,0x13,0xf1,0x89,0x5f,0x21,0xfe,0x85,0x6a,
+  0xe4,0xe1,0x83,0xd9,0x32,0x92,0xba,0x30,0xec,0x6e,0xe1,0x71,0x82,0x9a,0xfe,0xfc,
+  0xfa,0xcf,0xe7,0x60,0x4e,0x72,0x66,0x4a,0xa6,0xb2,0x87,0xb3,0x79,0x30,0xd3,0x39,
+  0x02,0xc7,0xa0,0x91,0x07,0x52,0x92,0x8b,0x7f,0x1c,0xbe,0x87,0xf0,0xff,0x18,0x87,
+  0xa8,0xe9,0x95,0xd8,0x7d,0x62,0xc1,0x6e,0x04,0x42,0x63,0x50,0xaf,0x8b,0x0e,0x05,
+  0x36,0xfe,0x71,0xeb,0xbd,0x53,0xff,0x0b,0xa8,0x6b,0x8f,0x5a,0xdd,0xde,0x1b,0xda,
+  0x4b,0xec,0x34,0xe7,0x2c,0x10,0xa2,0xc2,0x77,0xd5,0xf9,0xf5,0x9f,0x71,0xd9,0x88,
+  0x36,0xa6,0xbc,0xe1,0x6e,0xc2,0x33,0xda,0x7e,0xa9,0x76,0x99,0x0d,0x6c,0x56,0xe6,
+  0xe6,0x7f,0x29,0x35,0xb0,0x53,0xdd,0x66,0xaa,0xa2,0x4d,0xb9,0xe6,0x6c,0xdc,0x44,
+  0x5c,0x61,0xd4,0xaf,0xa1,0xb6,0x29,0xd7,0xff,0x03,0x8a,0x68,0x72,0x3a,0x5f,0x74,
+  0x7b,0xe7,0xd1,0x56,0xab,0x0d,0x04,0x0a,0x5e,0x22,0xb4,0x27,0xfe,0x45,0xfd,0x2f,
+  0xda,0x44,0xff,0xd3,0xb8,0x36,0x7a,0x7b,0x03,0xf5,0x3f,0xc5,0x89,0x2f,0x6b,0x80,
+  0xa8,0xc7,0xdf,0xf5,0x8e,0x93,0x7f,0xd1,0x73,0x35,0xd5,0x3f,0x24,0x6f,0x4f,0x33,
+  0xcd,0xee,0xa6,0x96,0xfb,0x7e,0x22,0xa6,0xb9,0x30,0x87,0x08,0xfd,0x8e,0x13,0xcf,
+  0x22,0xfe,0xcf,0x45,0x7d,0x77,0x4b,0x80,0xc6,0x5f,0x34,0x1a,0x8d,0x80,0x05,0x84,
+  0xe6,0x34,0x05,0xc8,0x5f,0x74,0x54,0x5a,0x40,0x0c,0xe1,0x63,0x79,0xfc,0x9f,0xb0,
+  0xa2,0x26,0x12,0x56,0xb4,0x4b,0x4d,0x10,0xec,0xa9,0x99,0xa1,0x01,0x0f,0x67,0x44,
+  0x21,0x44,0x3c,0x81,0x1e,0xc9,0xad,0xff,0xb3,0x4a,0xa7,0x36,0x1f,0x02,0x08,0xb5,
+  0xa9,0x15,0x09,0xbc,0x62,0x25,0xc2,0x1f,0x17,0x11,0xb1,0xa2,0x1c,0xfe,0x73,0xe5,
+  0x76,0x15,0x4f,0xeb,0x83,0x6a,0xb2,0xc9,0x8a,0x76,0x75,0x0b,0x20,0x5a,0x30,0x63,
+  0x91,0xd0,0x7f,0xb6,0x10,0xe2,0x11,0xe7,0xf7,0xda,0x46,0xf8,0x87,0x8b,0xb2,0x45,
+  0x04,0x74,0xeb,0xe3,0xd9,0x9f,0xb5,0x6e,0x19,0xfe,0xe2,0xfd,0xec,0x28,0x08,0x86,
+  0xb3,0x7b,0xfe,0x5d,0x45,0xf8,0x47,0x6f,0x68,0xfd,0x91,0x35,0x6c,0x41,0xeb,0x2c,
+  0x4b,0xa8,0x37,0xec,0x7c,0x7f,0xb3,0x04,0xf1,0x4f,0x0e,0xff,0x67,0x04,0xee,0x56,
+  0xbd,0xb4,0x73,0x1d,0xc6,0x54,0x2a,0x33,0x7e,0x25,0xfc,0x73,0x48,0xad,0x4e,0xa9,
+  0x56,0xd9,0xe7,0x59,0x09,0x7f,0xaf,0xbc,0x0a,0xcf,0xfb,0xb3,0xd2,0xd7,0xa6,0xd8,
+  0xd8,0xe4,0x03,0xd0,0xd0,0x8d,0xeb,0x39,0xe1,0x3c,0x0f,0xf9,0x7f,0x76,0xc6,0xf5,
+  0x64,0x77,0xf6,0xed,0x78,0xcf,0xee,0xff,0xfe,0x15,0xdc,0xa6,0x4d,0x12,0x7a,0x68,
+  0x3f,0xd2,0xed,0xfd,0x45,0xf4,0xbf,0x00,0xfd,0xb0,0x7a,0xf7,0x0a,0xf2,0x87,0x90,
+  0xff,0x36,0x31,0x59,0xf9,0x77,0x51,0xf6,0x67,0xc5,0x90,0xfd,0xfe,0x76,0xbb,0xf5,
+  0x7f,0xd4,0xa9,0xca,0xe9,0xae,0x2a,0x3d,0xf2,0xf5,0xe6,0x57,0xe1,0x83,0x8e,0x85,
+  0xf1,0xfb,0x07,0x19,0x31,0xa2,0x67,0xea,0xfe,0x35,0xe5,0xa2,0xfe,0xe1,0x70,0x70,
+  0x4d,0xb5,0x37,0xff,0x0b,0xed,0x8f,0x7c,0xc8,0x98,0x65,0x5b,0x8f,0x49,0x83,0xf2,
+  0x69,0x65,0x4c,0x71,0xec,0xcf,0x02,0xf2,0x6f,0xe4,0xe4,0x7f,0x51,0xfc,0xcb,0x39,
+  0xb6,0x5b,0xfd,0xbf,0x2e,0x27,0x17,0xea,0xb8,0x7f,0xbd,0x44,0xfe,0x9f,0x54,0x0e,
+  0xff,0xa7,0x57,0xda,0xa2,0x3c,0xa9,0x6c,0x3d,0x4e,0xdd,0x2e,0xe8,0xf9,0xbb,0xfc,
+  0xb7,0x93,0x20,0xdd,0x08,0x54,0x88,0xc3,0x10,0x85,0x10,0xdb,0xc3,0x6f,0x39,0xfa,
+  0x4c,0xc2,0x16,0x6d,0xaf,0x56,0x65,0x6e,0x20,0x33,0x45,0xdd,0x79,0x6c,0xd8,0x03,
+  0xea,0x5d,0xa2,0x70,0x07,0x4d,0x3c,0x27,0xff,0x8b,0xda,0xbe,0x87,0x7f,0x62,0xef,
+  0xe6,0xe0,0xa7,0x65,0xb6,0x13,0x77,0x05,0x35,0x06,0x64,0x88,0x22,0xe0,0xf3,0xfa,
+  0x7f,0xf6,0x55,0x52,0x98,0xaf,0xee,0x85,0x49,0xa3,0x38,0xbb,0xff,0x4d,0xd6,0x72,
+  0xb3,0x35,0xf1,0x15,0x81,0xb4,0x9e,0x61,0xcf,0x48,0x62,0xe2,0x6f,0x79,0xec,0x21,
+  0x15,0x3d,0x3e,0xa4,0x65,0xe3,0x11,0x0d,0x83,0x4b,0x37,0x09,0x47,0xd9,0x02,0x10,
+  0x1e,0x12,0x14,0x92,0x25,0x69,0x4f,0x7e,0xd3,0x03,0x49,0xaa,0x07,0x38,0xe7,0x6f,
+  0x02,0xd9,0xea,0x37,0x86,0x48,0xfc,0xb9,0x94,0x6a,0xd4,0x70,0x9b,0xdb,0x23,0x4a,
+  0xbd,0xa1,0xd0,0xe7,0xe0,0x1f,0x53,0xe0,0x9f,0x70,0xd2,0x82,0x31,0x4a,0xed,0x89,
+  0x5b,0x93,0x75,0xa7,0xd5,0x03,0x0a,0x1e,0x2b,0xe8,0xca,0xdb,0x50,0x1b,0x98,0x20,
+  0xff,0x6b,0xdb,0xb8,0x34,0x9f,0x5a,0xd8,0x40,0x6e,0x9f,0x27,0x58,0xad,0x74,0x6d,
+  0x1e,0xfe,0x51,0xa8,0xfa,0x4d,0x84,0xea,0x93,0x64,0x0b,0x73,0x51,0xd9,0x9f,0xd5,
+  0x40,0x30,0x5b,0x25,0xff,0xd8,0xbf,0xc4,0x56,0x78,0xfa,0x7f,0x4d,0x59,0x6d,0x6d,
+  0xeb,0x34,0xdf,0x73,0x76,0xd9,0xe7,0xf3,0x52,0x03,0xdc,0x4f,0xf5,0x91,0xc8,0xff,
+  0x13,0xcc,0xe9,0xff,0x45,0xf8,0x87,0xb9,0xb0,0x07,0x82,0xb6,0x9b,0x8b,0xfa,0x7f,
+  0x91,0x20,0x09,0xbe,0xf7,0x38,0xff,0xcf,0x80,0x7c,0x29,0x64,0xa1,0x9d,0xf2,0x4b,
+  0x56,0xfd,0xe7,0xb1,0xe6,0x4b,0x9a,0xa8,0x9f,0xe9,0x8d,0x7f,0x71,0x3b,0xfe,0xd5,
+  0x5d,0x26,0xaa,0xfd,0x64,0x69,0x3f,0x1d,0x1e,0xfe,0x8f,0xea,0xcd,0x7f,0xef,0xb6,
+  0xe3,0x5f,0x9a,0x8b,0x7e,0x8f,0x57,0xb8,0x8e,0x20,0x10,0xf5,0x25,0xbc,0xf9,0xef,
+  0x3b,0x84,0xff,0xc4,0x9f,0x74,0xa3,0x8d,0xb6,0x00,0xa7,0xdd,0xf8,0x97,0xbd,0x1e,
+  0x9c,0xf8,0x57,0xb7,0x17,0x06,0xbf,0xec,0xe0,0x61,0xa9,0xc1,0x5c,0x92,0x6e,0x1e,
+  0x74,0xe6,0x6b,0xfb,0x7f,0x96,0x66,0xd3,0xba,0xfb,0xfc,0x59,0x45,0x21,0x2c,0x5c,
+  0x74,0x01,0xbe,0x01,0xb3,0xf2,0xf3,0xbf,0xf0,0x7d,0x2c,0x70,0xbd,0xaf,0xe2,0xb6,
+  0xda,0xef,0xce,0x7f,0xc7,0x65,0x93,0xcd,0xd6,0x97,0xac,0xc7,0xd6,0x3c,0x0b,0x23,
+  0x7a,0x05,0xfe,0xb3,0x87,0xfd,0xe5,0x6c,0xd3,0x13,0xe4,0xbf,0xeb,0xd2,0x54,0xcb,
+  0xed,0xf3,0x37,0x65,0xe3,0xdd,0x20,0x13,0xe7,0xbf,0x3b,0x6c,0x1f,0x23,0xcb,0xf6,
+  0x21,0xb7,0x8f,0x1d,0x11,0xab,0x18,0x9f,0xff,0x3e,0x3e,0xfe,0xe5,0x11,0x0a,0xc6,
+  0xe5,0xbf,0x67,0xdd,0x3e,0xaa,0x1c,0x1d,0x97,0xb6,0x69,0x09,0x1f,0xf5,0xf2,0xf7,
+  0x5a,0x4b,0xb7,0xb0,0x7b,0xec,0x6e,0xef,0xee,0x31,0x8a,0x5d,0x29,0xff,0xdd,0x84,
+  0xef,0x32,0x41,0xf3,0x5e,0x42,0xec,0xee,0xc4,0x04,0xf3,0x7d,0xdd,0xbf,0x26,0x9c,
+  0x9b,0xff,0x2e,0xd8,0x86,0xf5,0x2e,0xcd,0x7e,0xfc,0xf9,0x22,0xb7,0xfe,0xe1,0x31,
+  0x02,0x39,0xa7,0xe5,0xc8,0x38,0xb7,0xcf,0x08,0x7c,0x75,0xe2,0xfc,0xf7,0x06,0x58,
+  0x9a,0x90,0xaf,0xd0,0xff,0x62,0x82,0xfc,0x77,0xe1,0xff,0x99,0xc0,0x2d,0x20,0x84,
+  0x95,0x57,0xf6,0xff,0x90,0x20,0x4f,0x94,0xcf,0x95,0x97,0xff,0x7e,0x25,0xda,0xcf,
+  0xef,0xe2,0x3f,0xc7,0x26,0x70,0x83,0xfc,0x5e,0xff,0xcf,0x15,0xf3,0xdf,0x3d,0xfd,
+  0xdf,0x1d,0x7f,0x8e,0x25,0x14,0x4f,0x98,0xcf,0xe5,0xe1,0xff,0x9c,0x61,0x47,0xf3,
+  0xd8,0xce,0x39,0x82,0x88,0x7f,0x1d,0xc9,0xe9,0xff,0xd5,0x7d,0x85,0xb4,0x77,0x37,
+  0x11,0xcc,0xad,0x7f,0x48,0xfc,0x9f,0xfc,0xea,0x46,0x13,0xcd,0xd7,0xcd,0x7f,0xdf,
+  0x9e,0xa5,0xfd,0xc0,0x84,0xfa,0x94,0xf2,0xfd,0x3f,0x15,0xdb,0xb3,0xd5,0x9c,0x3a,
+  0x27,0x7c,0x7e,0x96,0xf5,0xff,0xd8,0xf7,0x8f,0x80,0xdd,0xff,0xe2,0x4a,0xeb,0x41,
+  0xf0,0xe1,0x3d,0xfd,0xbf,0x52,0x36,0xa9,0x5e,0x9f,0x40,0xff,0x23,0xe3,0xf0,0x8f,
+  0xa2,0x5a,0x61,0xaf,0xcc,0xbd,0x11,0x37,0xfe,0xe5,0xf5,0xff,0xa4,0xfc,0xb9,0xf9,
+  0x5f,0x96,0xfd,0xf1,0xcd,0x4f,0x6c,0x04,0x6f,0x1b,0x26,0x47,0x30,0x44,0xff,0x2f,
+  0xd7,0xfe,0x4c,0xd6,0xc4,0x4b,0x3a,0xc6,0x2c,0xc7,0x48,0x67,0xbe,0x3f,0xa4,0xc9,
+  0xdf,0x5e,0x36,0xe2,0xde,0x3f,0xeb,0xff,0x29,0x59,0x23,0x5b,0xfd,0x2f,0x26,0xe5,
+  0xf8,0x7f,0x7e,0x69,0x09,0x6f,0xe5,0xe2,0x1f,0xe1,0xcf,0x97,0x57,0xc3,0x04,0xf6,
+  0x04,0xed,0xf9,0xd2,0xf1,0xf9,0xef,0x8d,0x99,0xa5,0x23,0xe5,0x0d,0xb4,0x5b,0xbd,
+  0xbe,0x14,0xf7,0x2f,0xe5,0x72,0x97,0xe5,0xff,0x91,0x2e,0x27,0x45,0x23,0x30,0xd3,
+  0x93,0xff,0x2e,0xea,0x1f,0x92,0xff,0x6a,0x5c,0x20,0x8f,0xbd,0x22,0x8d,0xf3,0xff,
+  0x38,0xf1,0xaf,0xc1,0x89,0xc6,0xc3,0x5e,0x49,0x34,0x02,0xcb,0xad,0xff,0x23,0xb4,
+  0x57,0xd1,0x74,0x65,0xfb,0x53,0x36,0x30,0xde,0xff,0xb3,0x85,0x8e,0xd5,0xe3,0xf3,
+  0x97,0xa5,0x86,0x45,0xc1,0xb4,0xe4,0xcd,0x7f,0xcf,0x7e,0xfb,0xc0,0x86,0xf1,0x6e,
+  0x9f,0xd3,0xaa,0x60,0x44,0x7b,0xfd,0x3f,0x92,0xed,0xff,0x19,0x96,0xeb,0x27,0xb2,
+  0xe7,0x4a,0x5e,0xfe,0xbb,0xc3,0x7f,0x8e,0xb0,0x1d,0xe3,0xc2,0x2e,0x2e,0x9f,0xc7,
+  0x83,0x7f,0xb2,0xe3,0x29,0xec,0x75,0xd3,0xf8,0xf1,0x4a,0xd6,0xff,0x63,0xaf,0x07,
+  0xe2,0xff,0x64,0xfd,0x3f,0x1b,0xc7,0xeb,0x47,0x1b,0xe7,0xff,0x21,0xfe,0x4f,0xd6,
+  0xff,0x13,0x55,0x27,0xde,0x5f,0x08,0xff,0xb8,0xf5,0x9f,0xed,0xf8,0x97,0x31,0xd1,
+  0xfe,0xa5,0x5a,0x1b,0xbd,0x3c,0xe2,0xd8,0x1f,0x78,0xba,0x40,0xbe,0xcb,0x78,0xa5,
+  0xed,0x06,0x98,0xf2,0x34,0x09,0xda,0x0d,0x15,0xc5,0x4f,0x57,0xde,0x25,0x7d,0x16,
+  0x3e,0x51,0x51,0xd9,0x27,0xdd,0xb5,0xe8,0x15,0xed,0x23,0x4a,0xb1,0x39,0xdb,0x79,
+  0x9e,0xa7,0x3f,0xa1,0xcc,0x5e,0x14,0x30,0x9a,0xb5,0x7f,0xed,0x2f,0xb8,0xab,0xe3,
+  0x2f,0x8c,0x26,0xad,0xb2,0xbf,0x70,0x36,0x04,0x8c,0xcf,0x84,0xa0,0x1f,0x66,0x4b,
+  0x77,0x18,0x9f,0xd1,0x2a,0x78,0xa9,0xfd,0x3c,0xd0,0xc5,0xa4,0xbb,0xf8,0x67,0xe3,
+  0x1f,0x51,0x15,0x4e,0x6d,0xe4,0xf4,0xf2,0x90,0xb2,0x0e,0xaf,0x2c,0xd7,0xcb,0xd4,
+  0x9b,0x0f,0xa3,0xd0,0x8a,0x82,0xe2,0xa4,0x27,0xd2,0x06,0xd0,0x11,0xd7,0x97,0xab,
+  0x57,0x41,0x41,0x02,0x0f,0x7d,0xcb,0x59,0x21,0x14,0x10,0xb9,0xa5,0x15,0x3e,0x1d,
+  0x5b,0xcb,0xa7,0xe1,0x15,0xf8,0x34,0x5d,0x71,0x9f,0x67,0x79,0x41,0x5d,0xc7,0x5f,
+  0xf0,0x3f,0x89,0x15,0x0c,0x15,0xd4,0x49,0x28,0xac,0xaa,0x18,0x92,0xc2,0xa5,0x9f,
+  0xed,0xfa,0x48,0x5c,0x19,0x90,0xee,0x86,0xc9,0xfc,0x13,0x7a,0xa5,0x19,0x73,0x9e,
+  0xe7,0x69,0xea,0x05,0x16,0xd2,0x19,0x48,0x5c,0x47,0x41,0x61,0x12,0xf0,0x16,0xea,
+  0x6a,0x5c,0x28,0x69,0x1c,0x97,0x19,0x0a,0xf8,0x55,0xa9,0x7b,0x7f,0x43,0x89,0x4b,
+  0x2a,0x5f,0x1c,0x83,0x6e,0x65,0x05,0x09,0x7a,0x69,0x42,0xa9,0xea,0x50,0x0d,0x06,
+  0x1a,0xaf,0x08,0x73,0x55,0x6b,0xd2,0x35,0xef,0xf8,0x5b,0x0b,0x96,0xf5,0xb5,0xa5,
+  0xfe,0x34,0x52,0xe0,0x57,0x50,0xe0,0x7f,0x3a,0xbf,0xb2,0x49,0x82,0x8e,0xb6,0x98,
+  0x82,0x07,0x4e,0xa9,0xc9,0xd4,0xa0,0x22,0x52,0x09,0xb3,0x9d,0xe7,0xe1,0x93,0xa5,
+  0x8f,0xc0,0xcd,0xe6,0x47,0xda,0x0b,0x3e,0x4b,0x42,0xe6,0x23,0x6b,0x50,0xf8,0x0c,
+  0x2c,0x1a,0x2c,0x6d,0x57,0x26,0x4b,0x93,0xa4,0x16,0xb3,0xb2,0xbd,0xc0,0x88,0x19,
+  0xce,0x78,0x9d,0x6b,0x50,0xa8,0x2a,0x9a,0x44,0x4d,0x30,0x0b,0x0d,0x25,0x29,0x45,
+  0xa0,0x54,0xd2,0xe2,0x8b,0xb8,0xf8,0x5e,0x31,0x15,0x90,0x24,0x8f,0x7e,0x56,0xb1,
+  0x6b,0x60,0x9d,0xaa,0x53,0xb1,0xb8,0x10,0xac,0x93,0x50,0xa8,0x61,0x45,0x52,0x02,
+  0xaa,0x92,0x21,0xbd,0x50,0x85,0x75,0xe4,0x9c,0x93,0xdc,0xdf,0xeb,0xe9,0xb6,0x82,
+  0x95,0xd2,0x9f,0xa9,0x57,0x19,0x05,0x49,0x69,0x25,0xfc,0x99,0xef,0xd3,0x28,0x4c,
+  0xc2,0x2b,0xf0,0x69,0x63,0x4a,0x72,0x52,0x8d,0xb4,0x1c,0xfe,0xde,0xa8,0xe4,0xb3,
+  0x35,0x67,0xbc,0xe1,0x6f,0x87,0x57,0xe0,0x06,0x2a,0x03,0x4c,0x8d,0xc1,0x6f,0x80,
+  0x82,0x6e,0xa9,0x1d,0x87,0x5d,0x05,0x95,0x26,0x6e,0x2b,0x43,0xfc,0x2a,0xfc,0xca,
+  0xb3,0x7e,0x9a,0x94,0x78,0x47,0x28,0xbc,0xd8,0xa7,0x35,0x29,0xb1,0x8e,0x40,0x78,
+  0xb1,0x9a,0x3c,0xac,0x54,0xf1,0xee,0x3b,0x3f,0x1f,0x29,0x4a,0x40,0xbc,0x23,0xa0,
+  0x37,0xab,0x9a,0xe9,0x3e,0x0f,0xa7,0x18,0x98,0x0a,0x8c,0xa0,0x50,0x0c,0x5f,0x1e,
+  0x12,0x34,0x11,0x06,0x06,0xa3,0x1b,0xcd,0xbe,0x22,0xc9,0xf4,0x95,0xbb,0x7e,0x98,
+  0x14,0xe3,0x4b,0xf4,0x72,0x55,0x39,0xec,0x08,0x05,0x75,0x66,0x6b,0x1a,0x85,0x67,
+  0x0a,0xf0,0x4a,0xec,0x4f,0x54,0xc5,0x74,0xf5,0xf9,0x74,0x53,0x41,0xbc,0x63,0xb9,
+  0xfe,0x69,0xb5,0x32,0x81,0x42,0x48,0x5f,0x2c,0x84,0xbe,0xd6,0xd8,0x67,0x54,0xa5,
+  0x53,0xd2,0x3b,0x96,0xc7,0x16,0xab,0xa5,0x9e,0xf5,0x2c,0xd6,0x8f,0x78,0x1e,0xa2,
+  0xf5,0xa3,0xa0,0x42,0x82,0xbc,0x69,0xa4,0x4b,0xae,0xe0,0x15,0x5d,0x46,0xc1,0x33,
+  0xdf,0x65,0xca,0xca,0x8e,0xab,0xf5,0xc5,0xad,0xa5,0x9b,0x6c,0x21,0xa1,0xcc,0xed,
+  0x28,0xd2,0x9b,0x5a,0x61,0x93,0x52,0x83,0x57,0x9a,0xe9,0xfe,0xee,0xf8,0x78,0xc1,
+  0x72,0xe9,0xd3,0xf0,0xa7,0xbc,0xd2,0x15,0xa4,0x10,0x2c,0xc6,0x45,0x09,0xb8,0x10,
+  0xf1,0x4a,0x29,0xaf,0x34,0x3c,0xeb,0xa7,0x10,0x5f,0xa2,0xb6,0x78,0x65,0x4f,0x41,
+  0x56,0x08,0x15,0x2c,0x96,0x8a,0xf8,0xb2,0x78,0x45,0x48,0x29,0x94,0x16,0xe1,0x15,
+  0x25,0x54,0xe0,0xa1,0x33,0xf0,0x32,0x50,0xb8,0xa1,0x6b,0xad,0x0a,0x09,0x8b,0x74,
+  0x68,0xd5,0x58,0xa9,0x22,0x49,0xd0,0x86,0x57,0xa4,0x1a,0xbc,0xa2,0xa9,0xb8,0x82,
+  0x5c,0xfd,0x2c,0x66,0xa5,0xfc,0xbf,0xe2,0xd3,0x42,0xc5,0x96,0x50,0xd5,0xaa,0xb6,
+  0x30,0x49,0xea,0x8f,0xcf,0xd6,0x42,0x8b,0x4b,0x6f,0xe7,0x2f,0xc4,0xaf,0x0f,0x15,
+  0x7b,0x9e,0xe7,0xe9,0xc5,0x68,0x16,0x3e,0xab,0x7f,0x46,0x95,0x8e,0x14,0xe0,0x8b,
+  0x8f,0x42,0xe5,0x91,0x49,0x78,0x25,0xfe,0x27,0xa1,0x28,0x5e,0xe9,0x98,0x1c,0xff,
+  0x87,0x10,0x2e,0x0c,0xe7,0x79,0x6e,0x6e,0x82,0xbb,0xf8,0xcf,0xf5,0x1b,0x42,0x45,
+  0x87,0xe5,0xbb,0xf8,0x5f,0xe8,0x37,0x2c,0x2f,0x16,0x7f,0x18,0xff,0x4c,0x28,0x70,
+  0x04,0x67,0xf4,0x0a,0x0a,0xc5,0x66,0xa9,0xf3,0x3c,0x37,0x8b,0xfb,0xc7,0x3f,0xb3,
+  0xfc,0x4f,0x8f,0x08,0xa1,0x2c,0x54,0x79,0x44,0xb9,0xbe,0x6b,0x7d,0xfc,0xf3,0x21,
+  0x38,0x02,0xb3,0xf1,0x4a,0x33,0xde,0xdf,0xfd,0xbd,0x80,0xe1,0x92,0x17,0x46,0x26,
+  0x61,0x09,0x38,0x6b,0xa9,0x1d,0x05,0x06,0x2d,0x09,0xa0,0x2b,0x1f,0x51,0x5b,0x3c,
+  0xfa,0x47,0x3b,0x70,0x27,0x5f,0x7e,0xe7,0x55,0xa1,0x82,0x75,0x24,0xc4,0xb3,0x42,
+  0x2b,0xfe,0x43,0x15,0xeb,0x0a,0xaa,0xac,0x2b,0x1c,0xdc,0xe7,0x31,0xae,0x6f,0x47,
+  0x6b,0xf9,0x19,0xa8,0x30,0xbb,0x50,0x60,0xcb,0x50,0x90,0x74,0x58,0x02,0x1f,0x61,
+  0x8a,0x59,0xaa,0xe3,0x57,0x1f,0x01,0xef,0x7a,0xbe,0xb9,0x89,0xc7,0x79,0x28,0x82,
+  0xab,0x25,0x21,0x04,0xe6,0x43,0x41,0xef,0x50,0x75,0xc5,0xa7,0x25,0x70,0xfd,0x88,
+  0x97,0x92,0x7b,0xf5,0xd3,0x45,0xdf,0x36,0xa9,0xa5,0x09,0x12,0x22,0x4d,0xbe,0x52,
+  0x7c,0x6c,0xbc,0xc2,0x54,0xed,0x5e,0xc5,0x12,0x4a,0xb9,0xe4,0xb9,0x7f,0x81,0xd1,
+  0xd1,0x16,0xbe,0x43,0x2d,0x15,0xc2,0xec,0xb6,0x40,0x65,0xf3,0x34,0xe0,0x46,0x55,
+  0x61,0x40,0x29,0x2f,0x45,0x43,0xa4,0xdf,0x11,0xa8,0x34,0x24,0xaf,0x7e,0xda,0xf8,
+  0x1d,0xb1,0xca,0x00,0xbe,0x2f,0x96,0xb0,0xb6,0x19,0x85,0x16,0xbd,0x54,0x2d,0xb8,
+  0x25,0x7b,0xa5,0xc0,0x70,0xf5,0x0f,0xaa,0xb1,0x02,0x42,0x5d,0x78,0x40,0x6f,0x35,
+  0x9a,0x40,0x53,0x14,0x09,0x0c,0xc3,0x90,0x70,0x29,0xe1,0x1a,0x02,0xbc,0xd2,0x81,
+  0xab,0x07,0x3c,0xbf,0xd7,0xb2,0x26,0x85,0x77,0xe8,0xfa,0x75,0xdd,0x4d,0x09,0xe0,
+  0xfc,0x61,0x98,0xdf,0x3d,0x95,0x29,0xeb,0xbb,0xc2,0x55,0x7f,0x0e,0x65,0xeb,0xf0,
+  0x8a,0xae,0x47,0x54,0x70,0xfa,0x15,0xa2,0x3e,0x97,0xc6,0xaf,0x5e,0xae,0x5c,0xd5,
+  0x54,0x99,0x5c,0x14,0x97,0x7a,0xd4,0x4f,0x37,0x7f,0x8b,0x37,0xc7,0x67,0x2f,0x57,
+  0xff,0x59,0xaa,0xe4,0x93,0xc8,0xfe,0xcf,0x83,0x4a,0xcf,0xef,0xb5,0xd6,0x68,0x8e,
+  0x6b,0x43,0x30,0x8f,0x7d,0x93,0x2f,0xc2,0x6f,0xd5,0xbf,0x97,0x8b,0xf1,0xf7,0x9d,
+  0x1f,0x52,0xe7,0xe1,0x36,0x21,0xe9,0x52,0x0f,0x7c,0x02,0xed,0x0f,0x78,0x3e,0x35,
+  0xed,0x45,0x01,0x5f,0xb3,0xa1,0x0d,0xd6,0xa0,0x3d,0x51,0x9a,0x8d,0xa4,0x59,0x13,
+  0x57,0xbb,0xd5,0xb0,0x78,0x16,0x29,0x00,0x5f,0x80,0x36,0xd3,0x33,0xbc,0x02,0x6a,
+  0xa0,0xb8,0x15,0x8d,0xcc,0xcf,0xe0,0x7a,0x6a,0x43,0xfe,0x67,0xfc,0x05,0xbc,0x52,
+  0x14,0xc7,0x5f,0x3a,0x09,0xd3,0x78,0xb1,0x65,0x9a,0x3c,0xb7,0x97,0x6e,0x84,0xdb,
+  0x96,0x95,0x57,0x28,0xfd,0xd2,0x6c,0x7e,0x5b,0x5b,0xf9,0x55,0xca,0x1b,0xff,0x7e,
+  0x23,0xee,0x5f,0x65,0x9b,0x2a,0xb6,0x17,0x54,0x49,0x4b,0xda,0xe4,0x0a,0xc5,0x3b,
+  0x3e,0x5c,0xb0,0xaa,0xe3,0xcf,0xe3,0x9f,0xde,0x58,0x59,0x55,0xb0,0xaa,0xef,0xcf,
+  0xf5,0xab,0xbe,0x5b,0xf9,0xc8,0xda,0x55,0xfc,0x73,0xb1,0x4f,0xdf,0x2b,0x6d,0x93,
+  0xf0,0x4a,0xec,0xaa,0x8d,0x95,0x3c,0xe7,0x79,0xe6,0xd2,0x63,0xc4,0xe9,0x5f,0x87,
+  0x22,0xd4,0x0d,0xf4,0xc0,0x5c,0xe9,0x6a,0x60,0x77,0x68,0x83,0xca,0xf5,0x50,0x04,
+  0x4c,0x07,0xef,0x78,0xb5,0xa5,0x4e,0x0a,0x74,0x35,0x4b,0xa5,0xdd,0x2d,0x2b,0xa4,
+  0x90,0x82,0x42,0xd7,0xca,0x58,0x11,0x6e,0x64,0x92,0x66,0xe2,0x57,0xa1,0xae,0x42,
+  0xe9,0x76,0xef,0x78,0xe9,0x0d,0xad,0xb4,0xc5,0xb8,0x5d,0xaa,0x34,0xfe,0xaa,0xad,
+  0xf4,0x0e,0xe5,0x76,0xa8,0x34,0x16,0x69,0xb1,0x16,0xa5,0x52,0x6a,0x41,0x41,0xab,
+  0x40,0xa1,0xd2,0xf0,0xde,0xbf,0xaa,0x49,0x6d,0xbb,0xb7,0x42,0x2f,0x68,0x95,0xf0,
+  0xd7,0xe7,0x54,0xfb,0xa8,0x8a,0xa9,0x77,0x74,0x56,0x84,0xbb,0xd4,0xd9,0xcb,0x94,
+  0x36,0x5c,0xd4,0x6b,0xbd,0xe3,0x7d,0x12,0xeb,0x36,0x52,0x5a,0x44,0x41,0xa1,0xc3,
+  0xd8,0x46,0x42,0x9c,0x3d,0x00,0xbd,0xda,0x75,0x06,0x5e,0xe1,0xf4,0x95,0x77,0x38,
+  0x04,0xe4,0x3f,0x81,0x17,0xcc,0xeb,0x63,0x45,0x4b,0x50,0xb8,0xc3,0xac,0x8a,0xa9,
+  0x81,0xa6,0xf2,0xaa,0xae,0x81,0xca,0xd9,0xa1,0x25,0x20,0x8b,0xaf,0x54,0xef,0x1f,
+  0x14,0x49,0x77,0x4b,0x9f,0x4d,0x7e,0x46,0xff,0xd6,0xd1,0x49,0x28,0x6c,0xfe,0x74,
+  0x4d,0xc1,0x80,0x7c,0x77,0xd1,0x67,0x13,0x9f,0xd1,0xa7,0x0c,0xd0,0x95,0xee,0x7f,
+  0x40,0x3c,0xe0,0x19,0x5f,0xad,0x1a,0x87,0xcb,0x62,0x5d,0x81,0x45,0xd5,0x60,0x98,
+  0x38,0xd1,0x80,0x24,0x6b,0x2d,0x28,0x28,0x28,0xe0,0x95,0x32,0x14,0xee,0xf4,0x3e,
+  0x4f,0xe3,0xe5,0xa5,0x97,0x7f,0x7a,0xe9,0xcc,0xe5,0x9f,0x0b,0xe1,0xf2,0x99,0xcb,
+  0x17,0xc7,0x0b,0xf0,0x7f,0xf1,0x69,0x78,0x6d,0xe9,0x5e,0xbc,0xff,0xde,0x9f,0x93,
+  0x70,0xe2,0x35,0xbc,0x1b,0x0a,0x78,0xdb,0xf4,0xf9,0x7f,0x8a,0xbe,0x1c,0xc4,0x2b,
+  0xe9,0xdd,0xab,0x73,0x9e,0xa7,0x71,0xe9,0xf3,0x38,0xfe,0xf9,0x9f,0x0b,0xa1,0x91,
+  0x1e,0xa3,0x91,0xc6,0xf7,0x5f,0xb8,0x38,0xa7,0x9e,0xae,0xf4,0x1f,0x7f,0xd7,0x3b,
+  0xbe,0x3a,0x74,0xdb,0x91,0xb2,0x86,0xae,0x8d,0x7f,0x51,0xfd,0xd1,0xdb,0x7e,0xbc,
+  0xa9,0xb1,0xeb,0xfe,0x8b,0xd5,0x6b,0x5a,0x8f,0x94,0xef,0xec,0xda,0x78,0x27,0x7e,
+  0xf5,0xe3,0x07,0xf7,0x76,0x7d,0xf3,0xac,0x77,0xbc,0x04,0x77,0x19,0x5b,0xb4,0x49,
+  0x4a,0xd1,0xd3,0x0c,0x85,0xb6,0x49,0x15,0x28,0xb4,0x0b,0x41,0xa2,0x2b,0x93,0x51,
+  0x58,0xef,0xd5,0xa7,0x32,0x09,0xd1,0xa3,0xf1,0x0f,0x5a,0x01,0xe2,0x43,0x21,0x54,
+  0xda,0xc2,0x14,0x12,0x08,0x3a,0x16,0x78,0xc7,0x3b,0xf6,0x59,0xe0,0x43,0x40,0x81,
+  0x40,0x0a,0xda,0x5b,0xcb,0x62,0x23,0x74,0x54,0x14,0x9e,0xa3,0xa1,0x3b,0xb9,0x00,
+  0x69,0x88,0x16,0x10,0xc8,0x15,0x86,0x68,0x63,0x24,0xd8,0xa6,0x49,0x5d,0x70,0x67,
+  0x11,0x42,0x0b,0xda,0x2a,0xdd,0x8f,0xaa,0xdc,0x2d,0x11,0x08,0x94,0x06,0x94,0xbb,
+  0x3b,0x48,0x28,0x3d,0x46,0x57,0x52,0x9f,0x88,0x94,0x3e,0x23,0xae,0x34,0xcf,0x94,
+  0xcc,0x9c,0xfb,0x5b,0x20,0xb0,0x34,0x7b,0x5b,0x90,0x72,0x05,0x85,0xd1,0x57,0xee,
+  0x47,0x53,0xa6,0x4b,0x45,0xd0,0x64,0x68,0x3d,0x96,0x10,0x47,0x21,0x6c,0x5f,0xa9,
+  0xb1,0x04,0xef,0xf8,0x6a,0xb8,0xa5,0x0f,0x17,0x55,0x77,0xe9,0xc7,0x95,0x5b,0x3a,
+  0x50,0xe8,0x2d,0x9d,0xa1,0xdc,0x4a,0xc2,0x46,0x69,0x96,0xd2,0xca,0xcb,0x74,0xa5,
+  0xc7,0xb3,0x1b,0xa9,0x66,0x00,0xca,0x11,0xd4,0x49,0x84,0x7d,0xca,0xa9,0x3e,0x14,
+  0x09,0x7f,0x42,0x9b,0x4c,0x0c,0x37,0x99,0x6b,0x8d,0xab,0x92,0x05,0x31,0x70,0xdc,
+  0x21,0x04,0x8e,0x94,0x0a,0x28,0x80,0x45,0x06,0xda,0x87,0x0a,0xfc,0xf1,0x9a,0x0d,
+  0xfc,0x72,0x11,0x1a,0x4c,0xb4,0x78,0x77,0x20,0x28,0x2b,0xcd,0x28,0x68,0xfb,0x63,
+  0xee,0xfd,0x0d,0xa6,0x41,0x17,0x20,0x02,0xd6,0xc2,0x1a,0x1a,0x8e,0x2a,0x1b,0xdc,
+  0xa0,0x80,0x5f,0x19,0x5c,0x43,0x94,0x9c,0x33,0x5e,0xb1,0xf0,0x08,0xa1,0x65,0x49,
+  0xb5,0x05,0xba,0x52,0x4a,0x42,0x0f,0xda,0x4f,0x8d,0x3b,0xe3,0x35,0x44,0x12,0x64,
+  0xa1,0x0a,0xa1,0x28,0xc9,0xb2,0x02,0xcf,0x0a,0x12,0x67,0x2b,0x10,0x9f,0x4f,0x82,
+  0x22,0x37,0x1e,0x61,0xdc,0xdc,0x54,0x88,0xb0,0x50,0xff,0xbc,0x0a,0x87,0x15,0x4b,
+  0xd0,0x50,0x58,0x4f,0x42,0xe8,0xb0,0x32,0xb7,0xef,0x6a,0xc4,0x63,0xe0,0xee,0xa7,
+  0x06,0x3e,0xae,0x68,0x8a,0xa0,0x83,0x69,0xa0,0xd0,0x25,0x67,0x81,0xa2,0xb8,0x82,
+  0x82,0x4a,0xf6,0xd0,0xfd,0x7d,0x0d,0xf0,0x13,0xc9,0x92,0xd8,0x6c,0x87,0x2d,0x41,
+  0xb5,0x05,0x71,0x85,0xf0,0x67,0xd4,0x3b,0xfe,0xe6,0x66,0xa5,0xbd,0x23,0x14,0xfb,
+  0x44,0x00,0x12,0x04,0x5c,0x63,0x9f,0xc0,0x8d,0xd8,0x12,0x02,0xa5,0x87,0x95,0x78,
+  0x1f,0x22,0xc6,0x00,0xb8,0xf8,0xd0,0x40,0x23,0x18,0x17,0x68,0x50,0x13,0xf8,0x90,
+  0x76,0xf3,0x44,0x56,0xc0,0x15,0xab,0xe3,0x8f,0x27,0xab,0x9e,0xf5,0xd0,0x26,0x35,
+  0xe1,0x26,0x1e,0xc2,0xfd,0x5d,0x13,0xb7,0x15,0x1b,0x7d,0x56,0x10,0x57,0x04,0x1e,
+  0xe6,0x9e,0xe7,0xc1,0xdf,0x53,0xa2,0x1f,0x56,0x03,0xa5,0x4d,0x08,0xa5,0x46,0x56,
+  0x00,0x14,0x80,0x76,0x5f,0x44,0x74,0xf6,0xf3,0xb4,0xa2,0x9e,0x17,0x71,0x0d,0x41,
+  0xa0,0x74,0x25,0x01,0x42,0x2e,0xda,0xc0,0xf1,0xac,0x00,0xd1,0x82,0xde,0xa6,0x8a,
+  0x93,0x51,0x56,0xd0,0x85,0x50,0x61,0x5d,0xc1,0x37,0x0a,0x3c,0xcf,0xb3,0x58,0xb6,
+  0x40,0xe0,0x14,0x5b,0x28,0xce,0x13,0xaa,0x96,0x4f,0x31,0x5c,0xfc,0x23,0x2d,0x56,
+  0x08,0x04,0x7e,0x22,0x54,0x7a,0xc4,0x15,0xbe,0xe2,0x5e,0xd9,0x12,0xff,0x6b,0xb5,
+  0xd4,0xa3,0x7f,0x69,0x31,0xe2,0xc3,0x2d,0xf1,0x49,0xa1,0xe2,0xc3,0x0c,0x05,0x1d,
+  0x85,0x23,0xcc,0xba,0x52,0x70,0x04,0x11,0xe3,0x64,0xba,0xe2,0x8e,0x6f,0xbb,0x79,
+  0x71,0x21,0x81,0x40,0x42,0x83,0x02,0x1f,0x7e,0x3e,0x54,0x71,0xa4,0xe0,0x7f,0x09,
+  0xe1,0xea,0x23,0x05,0xb3,0xd7,0x06,0xee,0x6c,0x0e,0x49,0x87,0x3d,0xeb,0xa7,0x0c,
+  0x6a,0xf8,0x27,0x75,0xd6,0x5a,0xb0,0x49,0xca,0x0a,0x64,0x76,0x48,0x50,0x36,0x49,
+  0x2b,0xcd,0xbf,0x88,0x7d,0xa4,0x55,0xf1,0xe8,0x1f,0xf5,0x59,0xc5,0x43,0xd4,0xbd,
+  0x66,0x1d,0x19,0x22,0x14,0x24,0x5b,0xa0,0x2b,0x1d,0xa1,0xf8,0xe2,0x1e,0xef,0xfe,
+  0x7b,0x73,0x5c,0x59,0x23,0x4d,0x85,0x4f,0x70,0xc8,0xa0,0x50,0x82,0x82,0x96,0x51,
+  0xe6,0x8b,0x2b,0xa5,0x74,0xc5,0xa7,0x36,0x71,0xef,0x7a,0x96,0x96,0xc1,0x4a,0x7e,
+  0xb5,0x5e,0xd8,0xaa,0x6d,0x42,0xa1,0x08,0x05,0x5c,0x3f,0x35,0xe2,0x8a,0x64,0x5d,
+  0x61,0xad,0xde,0xf5,0x20,0xd6,0x8f,0x85,0x0f,0x95,0x30,0x2d,0x9b,0x88,0x58,0x3f,
+  0xaa,0xb5,0x7e,0xb2,0x5f,0x79,0xd7,0x4f,0x13,0x18,0x1d,0x9a,0xae,0x04,0x4a,0x9b,
+  0x14,0xa3,0xaf,0x82,0x84,0x66,0xa5,0x8d,0xae,0xa8,0x12,0x53,0x0c,0x7c,0x65,0x14,
+  0xb5,0xd4,0xf0,0xe8,0x87,0x41,0x1b,0xc7,0xdd,0x5d,0x95,0x9a,0xf4,0x65,0x78,0xe0,
+  0x2d,0x88,0x48,0xcd,0x08,0x90,0xac,0x2b,0x24,0xc4,0x0a,0x54,0x17,0x0d,0xd3,0xfb,
+  0xa8,0x10,0x0c,0x68,0x01,0x49,0x35,0x70,0xa9,0x76,0xb5,0x80,0x05,0x0b,0x79,0xa1,
+  0x2e,0xd1,0x40,0x44,0x8c,0xf4,0xd4,0x9e,0xe7,0x61,0x02,0x78,0xa9,0x21,0x96,0x15,
+  0x54,0x1f,0x83,0x6e,0x8b,0x19,0xcc,0x18,0xe7,0x29,0x5d,0xed,0x31,0x34,0x57,0x3f,
+  0x86,0x63,0x6d,0x6a,0x3c,0x66,0x27,0x84,0x66,0xe7,0x6a,0x14,0x8a,0x7a,0xd8,0x17,
+  0xc8,0x3e,0x6b,0xee,0x78,0x44,0x6b,0x0f,0x01,0x33,0x44,0x84,0x9c,0x84,0xa2,0x64,
+  0x21,0x09,0x85,0x86,0x46,0x57,0xa6,0xc0,0x24,0x43,0xf5,0xea,0x27,0x5e,0x18,0xc1,
+  0x9f,0x69,0x05,0x87,0x54,0xcd,0x7c,0x21,0x88,0xdf,0xcb,0xba,0xa2,0xcc,0x2f,0xba,
+  0x86,0x2d,0x5e,0x0b,0xdc,0x79,0x9e,0x36,0x44,0xbd,0x55,0x46,0xa0,0x8d,0x29,0x70,
+  0x0f,0xc4,0x2c,0xe1,0xc7,0x10,0x6b,0x15,0x42,0x27,0xcc,0x36,0x7c,0xcb,0xd9,0x55,
+  0x88,0xe7,0x9d,0xe7,0xc1,0x17,0x74,0x1a,0xb5,0x38,0x6a,0x83,0xcd,0x84,0x27,0xe3,
+  0x28,0xfc,0x97,0x72,0xbd,0x41,0x57,0x34,0xbc,0x72,0x67,0x71,0x5b,0xf3,0xa7,0x21,
+  0xe1,0xd1,0x4f,0xb3,0x72,0x67,0x5f,0x28,0xb6,0x38,0x20,0x7d,0x1b,0xad,0xcd,0xd5,
+  0xed,0x8b,0x03,0xa5,0x9d,0x10,0xb7,0xae,0xdc,0xa3,0xe0,0x7a,0x83,0x96,0x12,0x89,
+  0x7b,0xf5,0x93,0x3d,0x9f,0x92,0xfd,0xb1,0x6c,0xf9,0x46,0xf7,0xc4,0x4a,0x8d,0x0c,
+  0xe5,0x8a,0x9c,0xf5,0xd3,0x4a,0xb0,0x10,0xd1,0x60,0x69,0x8f,0x12,0x2f,0xbd,0x9a,
+  0x04,0x1e,0x17,0x57,0x74,0xa9,0x1b,0xaf,0x04,0x08,0x31,0x7a,0xf5,0x63,0x18,0x6d,
+  0xa5,0x15,0x4a,0x81,0x54,0x6a,0xb4,0xd8,0x42,0x1b,0xda,0x9f,0x40,0x81,0x24,0x19,
+  0x2d,0xb7,0xab,0x05,0x9a,0x84,0x57,0x34,0x8f,0x7d,0xd6,0xf1,0xd7,0xa7,0x95,0xd8,
+  0x8a,0xcb,0xa0,0x02,0x8f,0x2c,0x52,0x2b,0x2c,0xa3,0xb5,0x59,0xd5,0xa1,0x42,0x93,
+  0x8a,0x57,0xc2,0x1d,0x86,0xc7,0x02,0xf9,0x0a,0x08,0x04,0xb6,0x45,0x08,0x28,0x72,
+  0xd8,0x4e,0x82,0x26,0xae,0x5c,0xa7,0xf8,0x3a,0x58,0x37,0xa4,0xb5,0x8f,0xe7,0xd8,
+  0x9f,0x4f,0xc9,0x7f,0x62,0xbc,0x30,0x78,0xfd,0xdc,0x10,0x09,0x5d,0x2f,0x5c,0x3f,
+  0x57,0xfd,0x14,0x2b,0xa7,0x2b,0xd7,0x17,0x7c,0xea,0x61,0xbc,0x32,0x38,0xed,0x86,
+  0xab,0x3d,0xeb,0x59,0x6a,0x15,0x78,0x60,0x92,0x5e,0x8a,0x78,0x40,0x78,0x87,0x48,
+  0x10,0x08,0xe1,0xc6,0x01,0xb8,0x5b,0xda,0xc2,0xff,0x41,0xff,0x96,0xe9,0xfe,0x03,
+  0x60,0xc1,0xc2,0x2c,0x1a,0xd4,0x10,0x28,0x4a,0xe5,0x9a,0x71,0x58,0x9b,0xdd,0x15,
+  0xb8,0x3d,0x0b,0x14,0x97,0x54,0x79,0x86,0xc3,0xef,0x80,0x85,0xff,0x1f,0xc1,0x87,
+  0x04,0x02,0x7f,0xfa,0x2b,0x04,0x81,0x0d,0xaf,0xdd,0x7a,0xc3,0x4f,0x7f,0x75,0x66,
+  0xf7,0x3f,0x21,0x3e,0xbc,0xf4,0xd4,0xaf,0xce,0x9c,0xff,0xa7,0x09,0xef,0x2f,0x40,
+  0xe0,0xfb,0x08,0x02,0x1b,0x1b,0x97,0xa0,0x70,0xe6,0xb8,0xc0,0x87,0xe5,0xef,0x9f,
+  0xb9,0x30,0xf1,0xf3,0xdc,0x44,0x20,0x90,0xd0,0x60,0xe3,0x47,0x5b,0x7f,0xfc,0xe0,
+  0xbb,0x5d,0x1b,0xff,0xb1,0xfa,0xeb,0xb7,0x5d,0xc6,0x2b,0xa7,0xef,0xbc,0x69,0x6a,
+  0xeb,0xab,0x65,0x37,0xe0,0x57,0xde,0xf1,0xac,0x0b,0xb6,0x42,0xe4,0xcb,0xbe,0xc9,
+  0x87,0x85,0x40,0x84,0xda,0xcd,0x11,0x7d,0x49,0xe0,0x2e,0xfc,0xd5,0xbb,0xa0,0x63,
+  0x23,0x5d,0xf1,0x8e,0xb7,0x37,0x16,0xcd,0x15,0x0a,0x7c,0x60,0xf0,0xdb,0x0b,0x2a,
+  0x5a,0x15,0x56,0x2a,0xae,0xe4,0x4c,0xb8,0x2b,0x0b,0x45,0x1c,0x41,0x5a,0xa7,0x57,
+  0x2d,0x89,0xdc,0xed,0x9b,0xcc,0xbb,0xf0,0x05,0x13,0x5f,0x79,0x3f,0xb4,0x03,0xc2,
+  0x97,0x61,0xf2,0x00,0xdd,0x9f,0x2c,0x0e,0x9a,0xec,0x8e,0x66,0xfd,0x76,0x84,0x43,
+  0xf8,0xd5,0x46,0x71,0xc5,0xfb,0xe1,0x1e,0x87,0x0e,0xa8,0x73,0x50,0xe8,0x88,0xe9,
+  0x09,0x98,0xed,0x53,0x79,0xf6,0xab,0x80,0xe9,0x9d,0x6f,0xfe,0x5f,0xa0,0x10,0x13,
+  0x0f,0xad,0x24,0xec,0x2b,0xae,0x41,0x54,0xbd,0xa3,0x99,0x25,0xa8,0x1d,0xe1,0xd4,
+  0xa7,0x7a,0xeb,0x66,0xa8,0x26,0x67,0x31,0xe8,0xc6,0x97,0xd2,0xed,0xc7,0xad,0xe6,
+  0xde,0x38,0x2b,0x5c,0x85,0xfa,0x99,0x1d,0x51,0xbb,0xb3,0x57,0x02,0x87,0x3d,0xe3,
+  0x7d,0xf7,0xd4,0x6d,0x85,0x5e,0x63,0x86,0xe6,0xeb,0x62,0x24,0xf8,0x34,0xdf,0x91,
+  0x19,0x55,0xca,0x8e,0x3b,0xc3,0x93,0xef,0xc5,0x2b,0xc7,0xbb,0xbf,0x7c,0x9d,0xc6,
+  0x3c,0xcf,0x9f,0xaf,0x7f,0xd0,0xf4,0x02,0x45,0xfa,0x31,0x61,0xca,0x56,0xeb,0x4a,
+  0x95,0x47,0x3f,0xea,0x04,0xfa,0x87,0x23,0xfa,0xd6,0x4f,0xc2,0x0a,0xf5,0xb3,0xa4,
+  0x7f,0x88,0x00,0xf3,0xdc,0x5f,0xd5,0x60,0x52,0x4c,0x3a,0x8e,0x0a,0x98,0x6c,0x0a,
+  0xe1,0xcb,0x90,0xac,0x9a,0xa4,0xf5,0x05,0x94,0x2f,0xb7,0x4e,0x36,0xec,0xaf,0xdc,
+  0xf8,0x3e,0xde,0xff,0x9e,0x98,0xb8,0xed,0x64,0xb3,0x8b,0xb2,0x6a,0xbe,0xcc,0xb4,
+  0x78,0xbf,0x52,0xd5,0x1d,0x68,0xf2,0xfc,0x8b,0x09,0xcf,0xf3,0xa3,0x5d,0x15,0x4a,
+  0xa1,0x7f,0x14,0xf7,0x0b,0x83,0xf0,0x95,0x66,0x2c,0xd2,0x71,0x63,0x70,0xf4,0x95,
+  0xb7,0x7e,0x84,0x2e,0x09,0xdc,0xea,0xb4,0x5a,0x10,0x20,0xea,0xa9,0xa3,0x2a,0xf3,
+  0x09,0xe7,0x22,0x3d,0xbf,0x77,0xbf,0xce,0xc1,0xea,0xf8,0xac,0x73,0xe8,0xff,0x22,
+  0xfc,0x28,0xb0,0x56,0xf7,0xbe,0xdc,0xcd,0x3f,0x9d,0xe0,0xa3,0xf1,0xb8,0x18,0x94,
+  0xe4,0xe3,0xbf,0xab,0xaf,0x9f,0x68,0x3c,0x2e,0x34,0xd0,0xda,0x06,0x9d,0xf1,0xc1,
+  0xe0,0xef,0xb8,0x3d,0x7c,0xac,0xf3,0x29,0xc3,0x88,0xb4,0x7f,0xea,0x5e,0x33,0x7b,
+  0xe1,0xea,0x09,0xfe,0x21,0xcf,0x67,0x2a,0xbf,0x77,0x2e,0x44,0xff,0x73,0xc6,0x75,
+  0xbf,0x73,0x94,0xfb,0x61,0x65,0x0c,0xa1,0x77,0x17,0x1e,0xa7,0x26,0xfa,0x34,0x5e,
+  0xbe,0x7c,0xd9,0xcc,0x13,0xce,0xe7,0x5d,0xf9,0x7d,0xe3,0x2f,0x3f,0x69,0x09,0xbf,
+  0x7e,0xed,0x0f,0x1c,0x9f,0x15,0x5e,0xbb,0xfc,0xda,0xff,0x64,0xfc,0xc2,0x3f,0xf8,
+  0x79,0xac,0xdb,0x36,0x3e,0xf9,0x87,0x8e,0xff,0x1d,0xf3,0x65,0x5d,0xca,0x03,0xaa,
+  0x30,0x83,0x8e,0x3d,0x1c,0x27,0x78,0xc7,0xab,0x05,0x85,0xf9,0xf6,0xd0,0x31,0x5c,
+  0xf6,0x1b,0x9a,0xf3,0x0f,0xac,0x53,0xab,0x54,0xd5,0x28,0xd4,0x26,0x78,0x31,0x1d,
+  0xc1,0xfb,0x21,0x17,0x1d,0xee,0x7b,0x9a,0x65,0x18,0xc5,0x6d,0xc7,0x09,0xde,0x0f,
+  0xbe,0x26,0x2a,0xbe,0x2f,0xdc,0x1c,0x67,0xe6,0x5c,0xc1,0x3b,0x5f,0x3c,0xdd,0x00,
+  0x61,0xbb,0xc3,0x13,0x0d,0xcc,0x7f,0x1f,0x55,0x4a,0xd8,0xd4,0xd5,0x6e,0x46,0xee,
+  0x36,0x61,0x0f,0x29,0x65,0x0c,0x74,0x61,0x06,0x55,0xfb,0xcf,0xbc,0xf6,0x30,0x04,
+  0xf4,0xa2,0xb2,0x2a,0xa3,0x7b,0xe2,0x47,0x21,0xc1,0x3b,0xde,0x77,0xcf,0xf4,0x07,
+  0x94,0xde,0x45,0x96,0x3d,0x3c,0xee,0x31,0x8c,0x33,0x26,0x1f,0x13,0xc2,0x97,0x67,
+  0x4c,0xf6,0xe4,0xd7,0x43,0x68,0xd2,0x55,0xa5,0x2a,0x6f,0xae,0xd2,0x26,0xd8,0x98,
+  0x6c,0xc1,0xfb,0xfc,0x70,0x8f,0x5e,0xa5,0xa8,0xcd,0x88,0xdb,0xf2,0xd5,0x9e,0x35,
+  0x95,0x79,0xf6,0x50,0x9b,0x34,0x5f,0x42,0x60,0x81,0xc7,0x71,0xd4,0x36,0xd9,0x43,
+  0xc7,0x30,0x6a,0xd6,0x95,0x7c,0x7b,0xb8,0x96,0x6e,0xd2,0x34,0xe1,0xcf,0x6a,0x0b,
+  0xde,0x5f,0xa0,0x8c,0xcc,0x97,0x2e,0xe1,0xa9,0xfa,0x0f,0xd1,0x3f,0x7e,0xa8,0xdd,
+  0x04,0x42,0xeb,0x2b,0x8f,0xce,0xf9,0x7d,0xb5,0xa4,0xa4,0xc0,0xef,0xfd,0x78,0xec,
+  0xa1,0xc6,0xf3,0xf6,0xef,0xdf,0xf9,0xa9,0xaf,0xa7,0x2a,0xe0,0x00,0xbf,0xfb,0x4f,
+  0xbc,0xf6,0x90,0x2d,0x67,0xc6,0x1f,0x7e,0x7f,0xeb,0x4f,0xf8,0xff,0x60,0x70,0x28,
+  0x12,0x8e,0xc4,0x7e,0xff,0x30,0xe7,0xf3,0x3f,0xb5,0x0f,0xff,0xff,0x36,0xfe,0x7f,
+  0xf6,0x89,0xe1,0x52,0x66,0xe2,0xff,0x9b,0x03,0x00,0x05,0xf3,0x3f,0xf7,0x67,0x46,
+  0x63,0xc3,0xff,0xfe,0xb3,0xff,0xbb,0x9b,0x5e,0xf1,0x13,0xf9,0x31,0x44,0x8d,0xea,
+  0x16,0xa8,0x30,0x3f,0x9c,0xfb,0x2b,0xbe,0x55,0x0f,0x71,0x7f,0xe5,0x13,0xad,0x1f,
+  0xce,0xed,0xa1,0xf1,0x79,0x7a,0x7e,0x03,0x1a,0xcd,0x0f,0xe7,0xfe,0x8a,0xbe,0x79,
+  0xab,0x79,0xcd,0x0b,0xdf,0xec,0xfe,0x70,0x6e,0x0f,0xb1,0xe7,0x63,0xa7,0x8d,0xea,
+  0x76,0x33,0x66,0x7e,0x38,0xf7,0x2f,0xbe,0xe1,0x9f,0xd6,0x9a,0x93,0x7f,0xf4,0xf9,
+  0xa5,0x1f,0xce,0xed,0x51,0xff,0xd6,0xf3,0x7f,0x58,0xfa,0x0f,0x7c,0x6c,0x0b,0x87,
+  0xfa,0x8f,0xa4,0x3e,0x3c,0xfd,0x07,0x71,0xfd,0x2c,0x85,0x0f,0x4b,0xff,0x25,0xd3,
+  0xf7,0x8d,0xc2,0xb5,0x7f,0xfa,0xd8,0x27,0x3f,0x9c,0xdb,0xa3,0xfe,0xad,0xe7,0xff,
+  0xd0,0xd6,0x7f,0x6d,0xe5,0xf7,0x0d,0xff,0x97,0x37,0xab,0xbf,0x7f,0xe8,0xff,0xd1,
+  0x27,0xf6,0x7c,0x23,0xae,0x9f,0x6f,0x7c,0x78,0xeb,0x5f,0x93,0xe6,0xc1,0xb4,0xa2,
+  0xeb,0x3e,0xbc,0xf5,0x6f,0x3d,0xff,0x87,0xa5,0xff,0xe2,0xaa,0x96,0xc5,0x50,0x77,
+  0x66,0xfa,0x87,0xb5,0x7e,0x62,0x97,0x4d,0xb2,0x9f,0xb1,0x51,0xf3,0xc3,0xb9,0xbf,
+  0xa2,0xde,0xf5,0x2d,0x73,0xde,0xee,0xcd,0x1f,0x9a,0xfd,0xcf,0x3e,0xff,0xff,0xed,
+  0xae,0x7b,0xa5,0x8f,0x52,0xbd,0xf9,0x3f,0xcc,0xea,0x8f,0x6c,0xfa,0xd0,0xec,0xcf,
+  0xe5,0x51,0xb2,0x9f,0xa3,0x1f,0x96,0xfe,0x83,0x0d,0xbf,0xf8,0xb5,0x79,0xfd,0x4b,
+  0x9f,0x79,0xfe,0xc3,0xb9,0x3d,0xea,0xdf,0x7a,0xfe,0x0f,0x4d,0xff,0x0d,0x1b,0xbf,
+  0xcb,0xe7,0x7c,0x64,0x47,0xd1,0x87,0x73,0x7b,0xd4,0xff,0xf3,0x64,0x3f,0x3f,0xb4,
+  0xf5,0x5f,0x38,0xf5,0x3f,0xfe,0x96,0x4f,0xff,0xcf,0x97,0x5b,0x7e,0xff,0xd0,0xff,
+  0xa3,0x4f,0x63,0xf6,0xf9,0x3f,0x34,0xfd,0x4f,0xfb,0xd3,0xc7,0x41,0xaf,0xfc,0xd7,
+  0x0f,0xcf,0xfe,0x5c,0x26,0xfb,0xf9,0xe1,0xad,0xff,0x6b,0x0a,0xaa,0x8c,0x86,0x1d,
+  0xc5,0xcf,0x7c,0x38,0xb7,0x27,0xc0,0x2f,0x9e,0xff,0xc3,0xd2,0xff,0xff,0xec,0x23,
+  0xce,0x0e,0x4c,0x9c,0x1d,0xfe,0x7f,0xfd,0x28,0x7f,0xfc,0xfc,0xf1,0xf3,0xc7,0xcf,
+  0x1f,0x3f,0x7f,0xfc,0xfc,0xf1,0xf3,0xc7,0xcf,0x1f,0x3f,0x7f,0xfc,0xfc,0xf1,0xf3,
+  0xc7,0xcf,0xff,0x17,0x3f,0x31,0x22,0x2e,0xc3,0x5d,0x5d,0x31,0x2b,0x97,0x42,0x8e,
+  0x81,0x11,0xf8,0x9f,0xdf,0x43,0xfc,0x6d,0x41,0x0c,0x52,0x92,0x7b,0xcf,0xd7,0xff,
+  0x3c,0x7f,0xdc,0xff,0x0b,0xeb,0x72,0x85,0xbc,0x58,0x11,0x01,0x00,
index c52a430..eb81329 100644 (file)
-  0x1f,0x8b,0x08,0x08,0x85,0xd1,0x0f,0x40,0x00,0x03,0x61,0x62,0x67,0x5f,0x6c,0x6f,
-  0x67,0x6f,0x5f,0x36,0x34,0x30,0x5f,0x34,0x38,0x30,0x2e,0x62,0x6d,0x70,0x00,0xed,
-  0xd9,0xcb,0x91,0x25,0x3b,0x15,0x05,0xd0,0x02,0x03,0x08,0x86,0x98,0x80,0x05,0x18,
-  0xc0,0x1c,0x9f,0x30,0x05,0x53,0x18,0x60,0x08,0x9e,0x14,0x8f,0xe6,0x17,0x74,0xd5,
-  0xad,0xca,0x94,0xce,0x2f,0x33,0xd7,0x8a,0x7c,0x13,0x78,0x71,0xb4,0x25,0xdd,0xd6,
-  0x8e,0x86,0x3f,0xfe,0xe9,0x0f,0xbf,0xfd,0xcd,0xdb,0x3f,0xfd,0xe1,0x97,0x7f,0x7e,
-  0xff,0xcb,0x3f,0x7f,0xfe,0xf5,0xdb,0xdb,0xdf,0x7f,0xf5,0xf6,0xf6,0xab,0xb7,0xdf,
-  0xfd,0xf8,0xcf,0xdf,0x7e,0xf9,0xef,0xff,0xf6,0xcb,0xbf,0xf2,0xb7,0x7f,0xfd,0x6b,
-  0x3f,0xfc,0xf9,0x2f,0x7f,0xf9,0x2b,0x00,0x50,0xeb,0x0d,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x62,0xbc,0xbf,0xf8,0x00,0x80,0x35,0xaf,0xba,0x35,0xf0,
-  0x03,0x80,0x67,0x2a,0x28,0x59,0xed,0x0c,0x00,0x6f,0xdd,0xad,0xaa,0x94,0x01,0x78,
-  0x82,0xf6,0xc6,0xd4,0xc8,0x00,0x3c,0xca,0x25,0x4a,0x70,0x48,0x0c,0x00,0xd8,0x34,
-  0xad,0x61,0x5b,0x76,0x04,0x00,0x35,0xee,0x57,0xbb,0x9f,0xba,0x7a,0x7e,0x00,0x6e,
-  0xe3,0xf6,0x9d,0xfb,0xb5,0x5b,0x6e,0x0a,0x80,0xc9,0x1e,0xde,0xbc,0x1f,0x3d,0x64,
-  0x9b,0x00,0xb4,0x50,0xb8,0x07,0x3d,0x7c,0xfb,0x00,0x84,0xf0,0x57,0xdd,0x05,0x4e,
-  0x03,0x80,0x1d,0x9a,0x77,0x93,0x93,0x01,0xe0,0x2c,0xe5,0x1b,0xcb,0x11,0x01,0xf0,
-  0x35,0xb5,0x9b,0xca,0xa1,0x01,0xf0,0x13,0x7f,0xe7,0x2d,0xe6,0x00,0x01,0xd0,0xbc,
-  0x5d,0x1c,0x26,0xc0,0x63,0x29,0xdf,0x5e,0x4e,0x15,0xe0,0x81,0x34,0xef,0x10,0x4e,
-  0x18,0xe0,0x39,0x34,0xef,0x34,0x4e,0x1b,0xe0,0xde,0xfc,0x6f,0xce,0xf3,0x39,0x76,
-  0x80,0xfb,0x51,0xbe,0x57,0xe1,0xfc,0x01,0x6e,0x43,0xf9,0x5e,0x8b,0x5b,0x00,0xb8,
-  0x01,0xcd,0x0b,0x00,0xc5,0xfc,0xcd,0x17,0x00,0x8a,0x29,0x5f,0x00,0x28,0xa6,0x7c,
-  0x81,0x73,0xde,0x3f,0xe8,0x4e,0x04,0x97,0xa3,0x79,0x81,0xa3,0x3e,0xd6,0xee,0xa7,
-  0xba,0x63,0xc2,0x25,0x3c,0xa7,0x7f,0x43,0xfe,0x9a,0x7f,0xbf,0x63,0xb9,0xb3,0x83,
-  0x65,0xa1,0x3b,0x0e,0xda,0x39,0x4c,0xb7,0x00,0x1f,0xa4,0x16,0xcd,0xb4,0xca,0x1b,
-  0x15,0xe6,0xa2,0x09,0xaf,0x64,0xa1,0x2f,0x8e,0xbf,0xfc,0x6b,0xc3,0xdf,0x37,0x2a,
-  0x69,0x73,0xb9,0x96,0xc3,0xfc,0x6f,0x80,0xae,0xd8,0x30,0x55,0xf6,0x1b,0x5e,0xd9,
-  0x26,0x47,0xfe,0xc0,0x8e,0x0a,0x73,0xd1,0x84,0x57,0xb2,0xd3,0x17,0x49,0xc3,0xdf,
-  0xcb,0xfb,0xf7,0xe3,0xba,0x35,0xc7,0xf8,0xd3,0xd2,0x65,0x69,0xe1,0x0a,0x6e,0xd6,
-  0x77,0xd3,0xf2,0x74,0x5d,0x4a,0x76,0xc2,0x2b,0x59,0x2e,0x8b,0xbc,0xe1,0xef,0x7d,
-  0xfd,0xfb,0xbe,0x54,0x6a,0xf5,0x21,0x97,0xa3,0xc2,0x75,0xdc,0xac,0xef,0x0e,0xfe,
-  0x81,0x1d,0x15,0xa6,0xfd,0xd0,0x7e,0x5a,0xf7,0x6e,0x52,0x5f,0xfe,0xfd,0x66,0x59,
-  0x9e,0xb0,0x29,0xfb,0x00,0x8b,0x43,0xc2,0x05,0x15,0x54,0x4c,0x65,0x95,0x0c,0x8c,
-  0xd4,0x75,0x2f,0x6b,0x09,0x77,0x32,0xcf,0x95,0xf7,0xf2,0xef,0x37,0xcb,0xf2,0x84,
-  0x4d,0xd9,0x1b,0xac,0x0c,0x09,0x17,0x54,0x56,0x2e,0x95,0x6d,0x72,0x24,0xd5,0xa8,
-  0x30,0xa3,0x12,0x86,0x84,0x1f,0x27,0xef,0xf1,0xdf,0x9f,0xbc,0x36,0x21,0x4a,0xd2,
-  0x06,0xcb,0xe2,0xc1,0x65,0x95,0x35,0x4b,0x65,0x9b,0x1c,0x09,0x36,0x2a,0x4c,0x7b,
-  0xc8,0x6f,0x17,0xbd,0xbc,0xbc,0xc7,0x7f,0x7f,0xf2,0xda,0x84,0x40,0xe1,0xbb,0xab,
-  0xc9,0x06,0x57,0x56,0xd9,0x2c,0x95,0x7d,0x77,0x24,0xd8,0xa8,0x30,0xd3,0x42,0xc6,
-  0xee,0x62,0x84,0xbc,0xc7,0x7f,0x7f,0xf2,0xda,0x84,0x40,0xe1,0xbb,0xab,0xc9,0x06,
-  0x57,0x56,0x59,0x2b,0x95,0x55,0x72,0x30,0xde,0x9c,0x24,0xed,0x09,0xdf,0x8f,0xad,
-  0x7b,0x61,0x79,0x8f,0xff,0xfe,0xe4,0xb5,0x09,0xb1,0x62,0x77,0x57,0x10,0x0c,0x2e,
-  0xae,0xb2,0x56,0x2a,0xab,0xe4,0x60,0xbc,0x39,0x49,0xda,0x13,0xbe,0x1f,0x5e,0xf7,
-  0xc2,0x92,0x1e,0xff,0xfd,0x5a,0x59,0x9b,0x10,0x2b,0x70,0x6b,0xb1,0x02,0x2e,0x1e,
-  0x26,0x2a,0xee,0x94,0xca,0x36,0x39,0x92,0x70,0x54,0x98,0x69,0x09,0xc3,0xf7,0xd2,
-  0x2f,0xe9,0xf1,0xdf,0x1f,0xbb,0x30,0x21,0x5c,0xc8,0xbe,0x32,0x04,0x5c,0x3c,0x8c,
-  0x53,0x5f,0x28,0x95,0x6d,0x72,0x24,0xe1,0xa8,0x30,0xed,0x21,0x4f,0xad,0x7b,0x49,
-  0x19,0x8f,0x7f,0x48,0xa7,0xac,0x0d,0xc9,0x30,0x30,0x55,0xe4,0x2f,0x00,0xa6,0xa8,
-  0x2f,0x94,0xca,0xbe,0x3b,0x92,0x70,0x54,0x98,0x69,0x21,0xb3,0xf7,0xd5,0xa0,0xbb,
-  0x49,0xfe,0xe7,0x12,0xc1,0xba,0xb3,0xfc,0x5b,0xe1,0x0f,0x04,0xca,0xd4,0x17,0x4a,
-  0x65,0x95,0x1c,0x0c,0x39,0x27,0x49,0x7b,0xc2,0x8f,0x21,0xb3,0xb7,0x56,0xad,0xbb,
-  0x49,0xfe,0x27,0x24,0x58,0xc6,0x06,0xa3,0xa6,0x05,0x66,0x0b,0xfc,0x01,0xc0,0x18,
-  0xf5,0x85,0x52,0x59,0x25,0x07,0x43,0xce,0x49,0xd2,0x9e,0xf0,0x55,0xc8,0xd4,0xdd,
-  0x95,0xda,0x29,0x94,0x58,0x21,0xc1,0x32,0xf6,0x18,0x32,0x2a,0xf6,0xfc,0xf7,0xef,
-  0x1d,0xe6,0xb9,0x7d,0x9b,0x1c,0xc9,0x39,0x27,0x49,0x7b,0xc2,0x2f,0x42,0xa6,0x6e,
-  0xb0,0xd4,0x72,0xa7,0x04,0x8a,0x4a,0x95,0xb1,0xc7,0x90,0x39,0xb1,0xc1,0x76,0xae,
-  0x1b,0xa6,0xba,0x7d,0x9b,0x1c,0xc9,0x39,0x2a,0xcc,0xd8,0x84,0xd9,0xbf,0x8a,0x3a,
-  0xcb,0x9d,0x12,0x28,0x2a,0x55,0xc6,0x1e,0x43,0xe6,0xc4,0x06,0xdb,0xb9,0x6e,0x98,
-  0xaa,0xbe,0x4a,0x36,0x17,0xcd,0x88,0x3a,0x27,0xc9,0x84,0x84,0x5f,0x87,0x4c,0xfd,
-  0x61,0x14,0x59,0xee,0x94,0x40,0x51,0xa9,0x32,0xb6,0x19,0x3e,0x24,0x75,0x9b,0x70,
-  0x59,0xc5,0x3d,0xb2,0xb9,0x68,0x5e,0xda,0x39,0x49,0x26,0x9c,0xd8,0x7e,0x98,0xd1,
-  0x96,0x3b,0x25,0x50,0x54,0xaa,0x8c,0x6d,0x86,0x0f,0x49,0xdd,0x26,0x5c,0x56,0x71,
-  0x8f,0x6c,0x2e,0x9a,0x97,0x76,0x4e,0x92,0xf6,0x84,0x51,0xc7,0x35,0xd7,0x72,0xa7,
-  0x04,0x8a,0x4a,0x95,0xb1,0xcd,0xf0,0x21,0xa9,0xdb,0x84,0xcb,0xaa,0xef,0x91,0xcd,
-  0x75,0x1b,0x0b,0xa5,0x2c,0xcc,0xfc,0x84,0x35,0x3f,0x92,0x44,0xcb,0xb5,0x12,0x25,
-  0x2a,0x52,0xc6,0x36,0x43,0x0e,0x2a,0x2f,0x12,0xdc,0x45,0x71,0x89,0xec,0xaf,0xdb,
-  0x5b,0x28,0x35,0x61,0xae,0x12,0xb2,0xe0,0x77,0x92,0x65,0xb9,0x56,0x42,0x04,0x46,
-  0xca,0xd8,0x66,0xc8,0x41,0xe5,0x45,0x82,0xbb,0xa8,0x2f,0x91,0xcd,0x75,0x93,0x02,
-  0xcf,0x49,0x72,0xad,0x90,0x05,0x3f,0x95,0x14,0xcb,0xb5,0x12,0x22,0x30,0x52,0xc6,
-  0x36,0x43,0x0e,0x2a,0x2f,0x12,0xdc,0x45,0x7d,0x89,0x6c,0xae,0x9b,0x17,0x78,0x4e,
-  0x92,0xf6,0x84,0xa7,0x42,0x16,0xfc,0x5a,0xe2,0x2d,0xd7,0x4a,0x88,0xc0,0x48,0x19,
-  0xdb,0x0c,0x39,0xa8,0xbc,0x48,0x70,0x17,0xf5,0x25,0xb2,0xb9,0x6e,0x5e,0xe0,0x51,
-  0x61,0x2e,0x94,0xb0,0xe6,0x07,0x13,0x6c,0xb9,0x56,0x42,0x04,0x46,0xca,0xd8,0x66,
-  0xc8,0x41,0xe5,0x45,0x82,0x1b,0xa9,0x6c,0x90,0xfd,0x75,0xf3,0x0a,0x65,0x54,0x98,
-  0x6b,0x25,0x2c,0xfb,0xcd,0x84,0x59,0xae,0x95,0x10,0x81,0x91,0x32,0xf6,0x18,0x3e,
-  0x24,0x75,0x9b,0x70,0x65,0x95,0x0d,0xb2,0xbf,0x6e,0x5e,0xa1,0x8c,0x0a,0x73,0xb9,
-  0x84,0x65,0x3f,0x9b,0x30,0xcb,0xcd,0xb2,0x29,0x36,0x4f,0xc6,0x06,0xc3,0x87,0xa4,
-  0x6e,0x13,0xae,0xac,0xb2,0x41,0xf6,0xd7,0xcd,0xeb,0x94,0x39,0x49,0xae,0x98,0xb0,
-  0xf2,0x97,0x13,0x23,0xa4,0x02,0x02,0xab,0x64,0x61,0xd4,0x17,0xd3,0x96,0x07,0xbe,
-  0x27,0xf4,0xef,0xf2,0x90,0x4f,0xa7,0xc1,0x8d,0x54,0x36,0xc8,0xfe,0xba,0xa9,0x9d,
-  0x32,0x2a,0xcc,0x8d,0xe3,0x8d,0x10,0x52,0x01,0x81,0x55,0xb2,0x30,0x2a,0x7c,0xda,
-  0xc7,0x99,0xbd,0x43,0x3e,0x9d,0x06,0x37,0x52,0xf6,0x3e,0x87,0xac,0x9b,0xda,0x29,
-  0xa3,0xc2,0x5c,0x2e,0xde,0xa9,0x84,0xfd,0x42,0x2a,0x20,0xb0,0x4a,0x16,0x46,0x85,
-  0x4f,0xfb,0x38,0xb3,0x77,0xc8,0xa7,0xd3,0xe0,0x46,0x2a,0xdf,0xe7,0xfd,0x75,0x53,
-  0x3b,0x65,0x54,0x98,0xcb,0xc5,0x3b,0x9b,0xb0,0x59,0x48,0x05,0x04,0x56,0xc9,0xc2,
-  0xa8,0xc0,0x54,0xaf,0x06,0x86,0xcc,0xd9,0xc9,0xf3,0x69,0x2a,0xb8,0x8b,0xca,0xf7,
-  0x39,0x64,0xe9,0xbc,0x4e,0x19,0x15,0xa6,0xf1,0xa0,0x76,0xee,0xb7,0xfe,0x57,0xb4,
-  0x91,0x75,0xbb,0x02,0x02,0x7b,0xe4,0xec,0xa8,0x57,0x03,0xd7,0xe6,0x84,0x4f,0x8b,
-  0x8a,0xf4,0x2a,0x18,0xdc,0x45,0xe5,0xfb,0xbc,0xb9,0x6e,0x6a,0xad,0xcc,0x49,0x32,
-  0xfc,0xa0,0xa2,0xd2,0x36,0xdb,0xaf,0x80,0xc0,0x1e,0x39,0x3b,0x2a,0x43,0x60,0xaa,
-  0xd8,0xad,0xed,0xdc,0x32,0xcc,0x56,0xff,0x44,0xef,0xac,0x9b,0x5a,0x2b,0xf5,0x91,
-  0x66,0x7e,0x65,0xd7,0xda,0x69,0xbf,0x02,0x02,0x7b,0xe4,0xec,0xa8,0x0c,0x81,0xa9,
-  0x62,0xb7,0xb6,0x73,0xcb,0x30,0x5b,0xfd,0x13,0xbd,0xb3,0x6e,0x6a,0xad,0xb4,0x17,
-  0xdf,0x90,0xaf,0xf2,0x66,0xdb,0xec,0x57,0x40,0x60,0x8f,0x9c,0x1d,0x15,0x2e,0x36,
-  0x55,0xec,0xd6,0x96,0xaf,0x18,0xae,0xa0,0xfe,0x89,0x5e,0x5e,0x37,0xb5,0x56,0xda,
-  0x8b,0x6f,0xc8,0x57,0x7c,0xb3,0x3d,0x36,0x5b,0x20,0xb6,0x47,0x16,0xa6,0x05,0x0a,
-  0x4f,0x15,0xbb,0xb5,0x9d,0x5b,0x86,0xf1,0x5a,0x9e,0xe8,0xb5,0x75,0x53,0x6b,0xa5,
-  0xbd,0xf8,0x26,0x7c,0xf5,0x37,0xdb,0x63,0xb3,0x05,0x62,0x4b,0xe4,0xec,0xb4,0x40,
-  0x19,0xa9,0x62,0xb7,0xb6,0x76,0xbf,0x70,0x11,0x5d,0x0f,0xf5,0xb4,0x72,0x69,0xef,
-  0xbe,0x09,0x5f,0x94,0x96,0x45,0x4f,0x46,0xdc,0x68,0x81,0xd8,0x12,0x39,0x3b,0x2d,
-  0x4a,0x52,0xaa,0xd8,0xad,0x2d,0xdc,0x2c,0x5c,0x4a,0xcb,0x43,0x3d,0xb0,0x5c,0xda,
-  0xeb,0xaf,0xf7,0x0b,0xd4,0xb8,0xf4,0xe1,0x88,0x1b,0x2d,0x10,0x5b,0x22,0x67,0xa7,
-  0xed,0x0b,0x3f,0x9f,0x57,0xc3,0x6b,0xa2,0xc2,0xc5,0xd5,0x3f,0x98,0x03,0xfb,0xa5,
-  0xbd,0x01,0x1b,0xbf,0x58,0xed,0x01,0x0e,0x44,0xdc,0x68,0x81,0xd8,0x12,0x39,0x3b,
-  0x6d,0x53,0xc6,0xf9,0xbc,0x9a,0x5f,0x96,0x16,0xae,0xac,0xe5,0xb5,0x9c,0x56,0x31,
-  0xed,0x25,0xd8,0xf8,0x85,0x6b,0x0f,0xf0,0x5d,0xbe,0x8d,0x16,0x88,0x2d,0x91,0xb3,
-  0xd3,0xf6,0x85,0x9f,0xcf,0xab,0xe1,0x35,0x51,0xe1,0xe2,0x5a,0x5e,0xcb,0x69,0x15,
-  0xd3,0x5e,0x82,0x2d,0x5f,0x92,0x21,0x31,0x5e,0xe7,0xdb,0x68,0x81,0xd8,0x12,0x39,
-  0x3b,0x2d,0x4a,0x52,0xaa,0xd8,0xad,0x2d,0xdc,0x2c,0x5c,0x4d,0xcb,0xbb,0x3d,0xad,
-  0x6b,0xda,0xab,0x70,0xda,0x81,0x14,0xdf,0x6f,0xa9,0x9d,0x16,0x88,0x6d,0x90,0x53,
-  0xd3,0x62,0x65,0xa4,0xda,0xba,0x15,0x78,0xa8,0xfa,0xd7,0x7b,0x60,0xdd,0xb4,0x17,
-  0xe2,0x9c,0xa3,0xd8,0x37,0x30,0xd2,0xff,0xe7,0x5b,0xea,0x94,0xf0,0x3e,0x3a,0x3b,
-  0x30,0x56,0x78,0xaa,0x80,0x8b,0x81,0x27,0x2a,0x7e,0x30,0x07,0x96,0x4e,0x7b,0x2d,
-  0x4e,0x38,0x84,0x28,0x93,0xb3,0xfd,0xc8,0xb7,0x54,0x2b,0xe1,0x7d,0x74,0x76,0x60,
-  0xac,0xf0,0x54,0x31,0x77,0x03,0x4f,0x54,0xfc,0x5a,0x4e,0xab,0x9e,0xf6,0x72,0x6c,
-  0x3f,0x81,0x58,0xa3,0x13,0xae,0xd5,0x4a,0x78,0x1f,0x9d,0x1d,0xf8,0xe9,0xd8,0xb5,
-  0x21,0x5f,0x24,0x8c,0x9d,0x06,0x1c,0x50,0xfc,0x54,0x4e,0x2b,0xa0,0xf6,0x7e,0x1c,
-  0x72,0x0e,0x51,0xc6,0x06,0xfb,0x11,0x6e,0xa9,0x56,0xc2,0xfb,0xe8,0xec,0xc0,0x57,
-  0x63,0xd7,0xe6,0xbc,0x4a,0x18,0x3b,0x0d,0x38,0xa6,0xf2,0xb5,0x9c,0xd6,0x3b,0xed,
-  0xb5,0x38,0xed,0x40,0xea,0xef,0xb7,0xce,0x5a,0xad,0x84,0x97,0xd1,0xa9,0x81,0xdf,
-  0x4e,0x8e,0x9a,0xb6,0x36,0xe7,0x8b,0x60,0xc0,0x01,0x95,0x0f,0xe6,0xc0,0xba,0x69,
-  0x2f,0xc4,0x81,0x67,0x52,0x7c,0xbf,0x45,0xd6,0x6a,0x25,0xbc,0x8c,0x4e,0x0d,0xfc,
-  0x76,0x72,0xd4,0xb4,0xb5,0x39,0x05,0xc1,0xe0,0xee,0xca,0x5e,0xcb,0x81,0x5d,0xd3,
-  0xde,0x86,0x5d,0x5f,0x92,0x51,0x61,0x3e,0x84,0x3b,0x5f,0x04,0xe1,0xf5,0x71,0xb2,
-  0x91,0xbe,0x99,0x1c,0x35,0x6d,0x6d,0x4e,0x41,0x30,0x78,0x80,0xb2,0xd7,0x72,0x5a,
-  0xcb,0xb4,0xf7,0x60,0xe3,0x97,0x61,0x4e,0x92,0xcf,0xc2,0x9d,0x2f,0x82,0xf0,0xfa,
-  0x38,0xd9,0x48,0xdf,0x4c,0x8e,0x9a,0xb6,0x36,0xa7,0x20,0x18,0x3c,0x43,0xcd,0x83,
-  0x39,0xad,0x65,0xda,0x4b,0xb0,0xfd,0x8b,0x35,0x21,0xc3,0xeb,0x70,0xe7,0x8b,0x20,
-  0xbc,0x3e,0x4e,0x36,0xd2,0x37,0x93,0xa3,0xa6,0xad,0xcd,0x29,0x08,0x06,0x8f,0x51,
-  0xf0,0x60,0x4e,0xeb,0x97,0x51,0x61,0x66,0x1e,0xd1,0x29,0x13,0x32,0xbc,0x0e,0x77,
-  0xb2,0x0b,0x32,0xba,0xe3,0xd4,0xcc,0x6f,0x87,0x47,0x4d,0x5b,0x9b,0x53,0x10,0x0c,
-  0x1e,0xa3,0xe0,0xb5,0x1c,0x58,0x2e,0xa3,0xc2,0x74,0x1d,0x54,0x94,0xf6,0x00,0x5f,
-  0x86,0x3b,0xd9,0x05,0x19,0xdd,0x71,0x6a,0xe6,0xb7,0xc3,0xa3,0xa6,0xad,0xcd,0x29,
-  0x08,0x06,0x4f,0x92,0xfd,0x60,0x16,0xd7,0xca,0x91,0x9c,0xa3,0xc2,0x5c,0x28,0x5b,
-  0x6c,0xe6,0x0a,0x67,0xbb,0x20,0xa3,0x3b,0x4e,0xcd,0xfc,0x76,0x78,0xd4,0xb4,0xb5,
-  0x39,0x05,0xc1,0xe0,0x49,0x0a,0xde,0xcc,0xca,0x4e,0x39,0x12,0x72,0x54,0x98,0xc6,
-  0x78,0x51,0xda,0x03,0x7c,0x19,0xee,0x4c,0x17,0x64,0x74,0xc7,0xc9,0x46,0xfa,0x66,
-  0x78,0xd4,0xb4,0xb5,0x39,0x05,0xc1,0xe0,0x61,0x6e,0x53,0x28,0x07,0x43,0xce,0x49,
-  0xd2,0x9e,0x30,0x44,0xef,0xea,0xdf,0x85,0x3b,0xd3,0x05,0x19,0xdd,0x71,0xb2,0x91,
-  0xbe,0x19,0x1e,0x35,0x6d,0x6d,0x4e,0x41,0x30,0x78,0x9e,0xd4,0x37,0xb3,0xb2,0xef,
-  0x8e,0x84,0x1c,0x15,0xa6,0x3d,0xe1,0xbe,0xc6,0xa5,0x0f,0x84,0x3b,0xd3,0x05,0x19,
-  0xdd,0x71,0xb2,0x91,0xbe,0x19,0x1e,0x35,0x6d,0x6d,0x4e,0x41,0x30,0x78,0xa4,0xbc,
-  0x67,0xb3,0xb8,0xef,0x8e,0x24,0x1c,0x15,0xe6,0x72,0xf1,0xa2,0xd2,0x56,0x38,0xd5,
-  0x05,0x19,0xc5,0x71,0xbe,0x94,0xbe,0x9a,0x1f,0x35,0x6d,0x6d,0x4e,0x41,0x30,0x78,
-  0xa4,0xbc,0x97,0xb3,0xb2,0x4d,0x0e,0xc6,0x1b,0x15,0xa6,0x37,0xe1,0xbe,0xc6,0xa5,
-  0x0f,0x84,0x3b,0xd3,0x05,0x19,0xc5,0x71,0xbe,0x94,0x5e,0xce,0x5f,0x1b,0xf5,0xe9,
-  0xb4,0xc0,0x51,0xe1,0xd3,0xe0,0x91,0xf2,0x1e,0xcf,0xca,0xbe,0x3b,0x12,0x6f,0x4e,
-  0x92,0x09,0x21,0x37,0x75,0xad,0x7b,0x2c,0x5c,0x8e,0xec,0x00,0xb1,0x5b,0x08,0x3f,
-  0x99,0x8c,0x39,0xf0,0x78,0x49,0x8f,0x67,0x65,0xdf,0x1d,0x89,0x37,0x27,0xc9,0x84,
-  0x90,0x9b,0xba,0xd6,0x3d,0x9c,0x2f,0x41,0xef,0xea,0x67,0x5d,0x2b,0x18,0x3c,0x5b,
-  0xf8,0xfb,0x59,0xd9,0x77,0x47,0xb2,0x8d,0x0a,0x33,0x21,0xe4,0x8e,0xae,0x75,0x0f,
-  0xe7,0x6b,0x2d,0x8e,0x8c,0xd5,0xcf,0x1a,0x9b,0x2d,0xe2,0x7a,0xe1,0x7e,0x62,0xdf,
-  0xcf,0xe2,0xbe,0x3b,0x12,0x6c,0x54,0x98,0x8b,0x26,0xdc,0xcf,0x59,0xa1,0xb7,0x35,
-  0xc2,0x57,0x5f,0x30,0x36,0xdb,0xf6,0xdd,0xc2,0x5d,0xc5,0x3e,0xa1,0x95,0x6d,0x72,
-  0x24,0xd5,0xa8,0x30,0x17,0x4d,0xb8,0x9f,0xb3,0x42,0x6f,0x6b,0x84,0xaf,0x1e,0x9b,
-  0x76,0x6c,0x30,0x78,0xbc,0xc0,0x57,0xb4,0xb2,0x4d,0x8e,0xa4,0x9a,0x93,0xe4,0xba,
-  0x09,0xf7,0x73,0x56,0xe8,0x2d,0x8e,0xf0,0xd5,0x63,0xa3,0x4e,0xce,0x06,0x8f,0x17,
-  0xf5,0x90,0x56,0xb6,0xc9,0x91,0x48,0x73,0x92,0xb4,0xc7,0xdb,0x7c,0x09,0xbb,0xd6,
-  0x3d,0x9c,0xaf,0xb5,0x38,0xc2,0x57,0x0f,0x8f,0x3a,0x36,0x18,0x70,0xc1,0xbe,0x9b,
-  0x96,0x27,0xef,0xcc,0x1b,0x13,0x86,0x44,0x2d,0xd2,0xd8,0x1d,0xb1,0x4b,0x27,0x45,
-  0x1d,0x1b,0x0c,0x88,0x78,0x4e,0x8b,0x0b,0xe5,0xc8,0x1f,0xf0,0x39,0x49,0xe6,0x9f,
-  0x55,0x52,0xda,0x22,0x8d,0xc5,0x11,0xb8,0xf4,0x6d,0x72,0x9e,0xcd,0x06,0x6c,0x3f,
-  0xa7,0xd3,0x6a,0x65,0x4e,0x92,0xe1,0x07,0x95,0x17,0xb5,0x48,0x63,0x77,0x04,0x2e,
-  0x9d,0x9a,0xb3,0x2c,0xea,0x42,0x30,0xe0,0x87,0x9d,0x17,0x75,0x5a,0xad,0xcc,0x49,
-  0xd2,0x78,0x44,0x9b,0x3d,0xd8,0xb5,0xee,0xc9,0x94,0x7d,0xf5,0x11,0xb8,0x74,0x52,
-  0xc2,0xca,0xb4,0x3b,0xd9,0x80,0x8d,0x77,0x75,0x5a,0xad,0x74,0x95,0xdd,0xc0,0x2f,
-  0xf5,0xc7,0x90,0xb1,0xee,0xc9,0x94,0x7d,0x0d,0x12,0xb8,0x74,0x52,0xc2,0x9a,0xc0,
-  0x9b,0xa9,0x80,0xff,0x58,0x7b,0x5a,0xa7,0xd5,0x4a,0x7b,0xeb,0xcd,0xf9,0x52,0x7f,
-  0x09,0x19,0xeb,0x9e,0x4c,0xd9,0xd7,0x23,0x81,0x4b,0x87,0x67,0x2b,0x8b,0x1d,0x18,
-  0x0c,0x58,0x7a,0x5d,0xa7,0xd5,0x4a,0x7b,0xeb,0xcd,0xf9,0x52,0x7f,0x06,0x19,0xeb,
-  0x9e,0x4c,0xd9,0xd7,0x23,0x51,0x4b,0x87,0x07,0xab,0x49,0x9e,0x11,0x0c,0x58,0x7a,
-  0x5d,0xa7,0x35,0x4b,0x7b,0xf1,0x4d,0xf8,0x52,0x7f,0x03,0x49,0xeb,0x52,0x4a,0xe7,
-  0xc2,0x3c,0x67,0x1f,0xd8,0x69,0xe5,0xd2,0xde,0x7d,0x13,0xbe,0xa4,0xdb,0xcf,0x5b,
-  0x97,0x1e,0x9a,0x17,0xe6,0x39,0xfe,0xc0,0x4e,0x2b,0x97,0xf6,0xee,0x6b,0xff,0x32,
-  0xee,0xbd,0x60,0x69,0x00,0xfe,0xeb,0xc8,0x03,0x3b,0xad,0x5f,0xda,0xeb,0xaf,0xfd,
-  0x0b,0xbc,0xee,0xb2,0xa5,0x01,0xf8,0xc9,0x91,0x37,0x76,0x5a,0xc5,0xb4,0x37,0x60,
-  0xe3,0x17,0x7b,0xd7,0x95,0xab,0x03,0xf0,0xd1,0xd7,0x6f,0xec,0xb4,0x96,0x69,0x2f,
-  0xc1,0xae,0x2f,0xf0,0x96,0x5b,0x02,0x00,0xf0,0xd1,0x17,0x6f,0xec,0xb4,0xa2,0x69,
-  0xef,0xc1,0x96,0x2f,0xea,0x7e,0xbb,0x02,0x00,0xf0,0xca,0xab,0x67,0x76,0x5a,0xd7,
-  0xb4,0x57,0xe1,0xb4,0x03,0x39,0x78,0xb3,0x8d,0x01,0x00,0x58,0x30,0xb0,0x6e,0xda,
-  0x0b,0x71,0xd4,0x69,0x14,0x1c,0x17,0x00,0x2d,0xa6,0x95,0x4e,0x7b,0x27,0x4e,0x38,
-  0x84,0xca,0xbb,0x03,0xa0,0xc5,0xb4,0xea,0x69,0x6f,0xc6,0xc6,0xbd,0xb7,0xdc,0x1d,
-  0x00,0x2d,0xa6,0x75,0x50,0x7b,0x45,0xb6,0xec,0xba,0xeb,0xe2,0x00,0xe8,0x32,0xad,
-  0x89,0xda,0x8b,0xf2,0x12,0x8d,0x76,0xad,0xb4,0x00,0x7c,0x74,0xd7,0x86,0xba,0x31,
-  0x17,0x01,0x00,0xc5,0x94,0x2f,0x00,0x14,0x53,0xbe,0x00,0x50,0xcc,0xff,0x05,0x00,
-  0x00,0xc5,0x94,0x2f,0xc0,0xa3,0x78,0xcc,0x27,0x08,0x2c,0x5f,0x57,0x06,0x70,0x15,
-  0xde,0xf3,0x5e,0xca,0x17,0xe0,0xc9,0x3c,0xec,0x2d,0x94,0x2f,0x00,0xff,0xe2,0x79,
-  0xaf,0x11,0xdb,0xbc,0x6e,0x07,0xe0,0x1e,0xbc,0xf3,0xa9,0x94,0x2f,0x00,0x5f,0xf3,
-  0xe0,0x87,0x53,0xbe,0x00,0x1c,0xe4,0xf1,0x0f,0xa1,0x79,0x01,0x58,0xa0,0x0b,0x96,
-  0x85,0x37,0xaf,0x33,0x07,0x78,0x1a,0x8d,0x70,0x8a,0xda,0x05,0x20,0x8a,0x82,0x38,
-  0xc2,0xdf,0x79,0x01,0x48,0xa5,0x32,0x7e,0xa2,0x79,0x01,0x28,0xa3,0x3b,0xde,0xd2,
-  0x9a,0xf7,0x39,0x07,0x08,0xc0,0xb2,0xa7,0xb5,0x49,0x5e,0xe7,0xde,0xef,0xac,0x00,
-  0x28,0x70,0xfb,0x5a,0xd1,0xbc,0x00,0x8c,0x75,0xcb,0xc6,0x51,0xbb,0x00,0x5c,0xc5,
-  0x0d,0x3a,0xc8,0x5f,0x78,0x01,0xb8,0x81,0xc9,0xdd,0x94,0x5d,0xb5,0x3a,0x17,0x80,
-  0x76,0xed,0xcd,0x55,0xd6,0xb6,0x6a,0x17,0x80,0xb1,0xea,0xdb,0x50,0xf3,0x02,0xc0,
-  0x47,0xed,0xa5,0xa9,0x73,0x01,0x78,0xb2,0xf6,0x26,0x55,0xb5,0x00,0xd0,0xde,0xb6,
-  0x3a,0x17,0x00,0x3e,0xa5,0x5e,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xea,0xfc,0x03,0x26,
-  0x84,0x0a,0xd6,0x36,0x10,0x0e,0x00,
+  0x1f,0x8b,0x08,0x08,0x30,0x72,0x03,0x48,0x00,0x03,0x56,0x6f,0x6c,0x76,0x6f,0x5f,
+  0x53,0x74,0x61,0x72,0x74,0x6c,0x6f,0x67,0x6f,0x2e,0x62,0x6d,0x70,0x00,0xed,0x9d,
+  0x5f,0x70,0x14,0x47,0x7e,0xc7,0x25,0x7b,0x95,0x19,0xb6,0xdb,0x3a,0x9f,0x57,0xc7,
+  0x5d,0x24,0xee,0xb0,0x45,0x4c,0x59,0x96,0xcf,0x04,0x82,0xcf,0x10,0x0e,0xdb,0x01,
+  0xc7,0x94,0x75,0x18,0x9f,0x1d,0xc5,0x87,0x1c,0x22,0xaa,0x8c,0xb8,0x9c,0x51,0x91,
+  0x14,0x92,0xec,0x33,0xc1,0x50,0x8a,0x40,0x25,0x07,0x43,0x9d,0x0e,0x10,0xb7,0x1b,
+  0xa1,0xde,0x55,0x6f,0xf9,0xd1,0x55,0x79,0xc8,0x3d,0xfa,0x2d,0xe5,0x47,0x3f,0xfa,
+  0xd1,0x95,0x37,0x3f,0xfa,0xd1,0x8f,0x4e,0xf7,0xcc,0x74,0xf7,0xaf,0xe7,0xdf,0x4a,
+  0xe2,0x02,0xa2,0xf2,0xfd,0xc0,0x6c,0xcf,0xac,0x66,0x7a,0xfa,0xcf,0xaf,0x7f,0xfd,
+  0xeb,0x5f,0xf7,0xcc,0x1e,0x7a,0xed,0x67,0xff,0x55,0xe9,0xd2,0xfc,0x4c,0x05,0x4f,
+  0xa9,0x70,0xf6,0xa1,0xae,0xae,0xff,0xe9,0xee,0xea,0xea,0xee,0x0a,0xa3,0xef,0xbb,
+  0xfe,0xb3,0xd2,0xf5,0xdf,0xbd,0x5d,0xd1,0x66,0x38,0xf5,0xe8,0x13,0x5d,0x93,0x6a,
+  0x9b,0x56,0xdb,0xa9,0x1f,0xa9,0x7d,0xb5,0x4d,0xab,0xed,0xd4,0xa3,0x43,0xea,0xfb,
+  0x21,0xf5,0xfd,0x50,0xd7,0x05,0xb5,0x9d,0xfa,0x91,0x3a,0x56,0xdb,0xb4,0xda,0x4e,
+  0x3d,0xa1,0xf6,0xd5,0x36,0xad,0xc3,0x1f,0xed,0x56,0xdf,0xed,0x56,0xdf,0xed,0x56,
+  0xdf,0xa9,0x7d,0xb5,0x5d,0xd0,0xfb,0x43,0x6a,0x5f,0x6d,0x17,0x74,0xf8,0xc4,0x7e,
+  0x75,0xbc,0x5f,0x1d,0xef,0x57,0xc7,0xfb,0xbb,0xae,0xa8,0x6d,0x72,0xb7,0x3a,0x56,
+  0xdb,0x85,0xdd,0x7a,0xff,0x90,0xda,0x3f,0xa4,0xf6,0x0f,0x75,0x5d,0xd1,0xfb,0xfb,
+  0xd5,0xbe,0xde,0x76,0x8f,0xa8,0xfd,0x11,0xb5,0x3f,0xd2,0x75,0x45,0x87,0x87,0x54,
+  0xa8,0xb6,0x6b,0x87,0xf4,0xfe,0x9b,0x6a,0xff,0x4d,0xb5,0xff,0x66,0xd7,0x85,0x11,
+  0xb5,0xaf,0xb6,0x6b,0x51,0xf8,0xb6,0x0a,0xdf,0xee,0xba,0xa5,0xb6,0x2b,0x6f,0xaa,
+  0x7d,0xb5,0xdd,0x7a,0x53,0xef,0x9f,0x52,0xfb,0xa7,0xd4,0xbe,0x0a,0xdf,0x56,0xe1,
+  0xdb,0x3a,0x9c,0x54,0xe1,0x64,0xd7,0x1d,0xb5,0x5d,0x3b,0xa5,0xf6,0xd5,0x76,0x47,
+  0x87,0x93,0x7a,0x7f,0x5a,0xed,0x4f,0x77,0x7d,0xa2,0xb6,0x5b,0x93,0x6a,0x5f,0x6d,
+  0x9f,0x44,0xe1,0x05,0x15,0x5e,0xe8,0xba,0x33,0xad,0xc2,0x69,0x1d,0x5e,0x51,0xe1,
+  0x95,0xae,0x4f,0xd5,0x76,0xe7,0x82,0xda,0x57,0xdb,0xa7,0x51,0x78,0x4d,0x85,0xd7,
+  0xba,0x3e,0xb9,0xa2,0x42,0xb5,0xfd,0x51,0x87,0xd7,0xf4,0xfe,0x2d,0xb5,0x7f,0x4b,
+  0xed,0xab,0x50,0x6d,0x9f,0xde,0x52,0xa1,0xde,0xae,0xdd,0x51,0xfb,0x77,0xd4,0xfe,
+  0x9d,0xae,0xcf,0x74,0x78,0x47,0x85,0x77,0xf4,0xf1,0x27,0xea,0xf8,0x13,0x75,0xac,
+  0x42,0xb5,0x7d,0xae,0xc3,0x4f,0x54,0xf8,0x89,0x3e,0xfe,0x54,0x1d,0x7f,0xaa,0x8e,
+  0x55,0xa8,0xb7,0x4f,0xf5,0xf6,0xc7,0xae,0x2f,0xd4,0xf6,0xf9,0x1f,0x55,0xf8,0x47,
+  0x1d,0x7e,0xa6,0xc2,0xcf,0xba,0xbe,0xd4,0xe1,0x67,0x2a,0xfc,0x4c,0x87,0x9f,0xab,
+  0xf0,0xf3,0xae,0xaf,0x74,0xf8,0xb9,0x0a,0x3f,0xd7,0xe1,0x17,0x2a,0xfc,0xa2,0xeb,
+  0xcb,0x2f,0x54,0xf8,0x85,0x0e,0xbf,0x54,0xe1,0x97,0x5d,0x5f,0xab,0xed,0xcb,0x2f,
+  0xd5,0xbe,0xda,0xbe,0x8e,0xc2,0xaf,0x54,0xf8,0x55,0xd7,0x37,0x6a,0xfb,0xea,0x2b,
+  0xb5,0xaf,0xb6,0x6f,0xa2,0xf0,0x6b,0x15,0x7e,0xdd,0xf5,0xf5,0xd7,0x2a,0x8c,0xb6,
+  0x6f,0xba,0xbe,0x55,0xdb,0x37,0xdf,0xa8,0xf0,0x1b,0x1d,0x7e,0xab,0xc2,0x6f,0xbb,
+  0xbe,0x53,0xdb,0x37,0xdf,0xaa,0x7d,0xb5,0x7d,0x17,0x85,0xdf,0xa9,0xf0,0xbb,0xae,
+  0x6f,0xbf,0x53,0x21,0xb6,0x7b,0xbe,0xb5,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0x1f,0xa4,0x98,0xdc,0xd6,0x99,
+  0xc3,0x42,0xde,0xfd,0x9d,0xd4,0x26,0x64,0x4b,0x2c,0x5d,0x99,0x99,0x78,0xe3,0xa5,
+  0x9f,0x26,0x31,0xff,0xc5,0xfe,0x57,0x4f,0x4c,0x9e,0xbf,0xba,0x2c,0x5a,0x52,0xca,
+  0x76,0xa7,0xbb,0x34,0x4f,0xfc,0x78,0x0d,0xa9,0xdd,0x18,0x3f,0x2d,0xcb,0x63,0x6b,
+  0xf9,0x99,0xce,0x31,0x3c,0x3e,0xd7,0xba,0xeb,0x52,0x52,0x45,0x20,0xa5,0x90,0x62,
+  0xf9,0xea,0x85,0x7f,0x39,0xfe,0xea,0xcf,0x76,0xc4,0x31,0xef,0xf8,0xcb,0xbf,0x19,
+  0x9d,0x98,0x9e,0xbb,0xd1,0x54,0x65,0xd4,0x6e,0x76,0x2e,0xa7,0x07,0x07,0x59,0xdf,
+  0xce,0x18,0x0f,0xd4,0xc6,0x58,0x18,0x7d,0xaa,0x7d,0xfb,0x4d,0xb4,0xaf,0x83,0xf3,
+  0x77,0x7d,0x9f,0x76,0x4b,0x15,0xeb,0xe2,0xd4,0xb1,0xa7,0x75,0xe4,0x9c,0xeb,0x1b,
+  0xc4,0x77,0xe0,0xa1,0x0a,0xfa,0xfe,0x7a,0x6c,0xb6,0xa1,0xce,0xe8,0x14,0xcd,0x28,
+  0x4f,0xd2,0xe7,0x92,0x16,0x7d,0x72,0x73,0xc0,0x6d,0xda,0xb9,0x77,0x46,0x71,0x60,
+  0xb2,0xb9,0xa3,0xe4,0xe6,0x52,0x4c,0x70,0xff,0xda,0x74,0x02,0xa2,0xf2,0xdb,0xdb,
+  0x31,0xfd,0x9d,0x11,0x6d,0xd1,0x98,0x1d,0x3f,0x30,0x10,0xf0,0xb0,0x87,0x27,0x09,
+  0x54,0x9f,0x5b,0x2a,0xc1,0x16,0xc6,0x86,0x8e,0x4e,0xdd,0x10,0xb2,0x73,0x31,0x3d,
+  0x38,0x88,0xf1,0x9e,0xc0,0x2b,0x47,0x66,0x6b,0xce,0x96,0x33,0x67,0xe1,0xae,0xbb,
+  0xcf,0xf2,0xad,0xa9,0x23,0x3b,0x1f,0x8e,0xe3,0x56,0xe2,0x62,0x25,0x46,0x7f,0xa1,
+  0x04,0x3f,0xe4,0x95,0xbe,0x7d,0x27,0x3f,0xea,0xd4,0xb0,0x47,0x49,0xc3,0x88,0x93,
+  0x66,0x84,0x8f,0xc7,0x07,0xbe,0x58,0x18,0x29,0x8f,0x5b,0x56,0x12,0x24,0x67,0xba,
+  0x0b,0xe2,0xa3,0x32,0xf9,0x6b,0x2f,0x6d,0xb3,0xb2,0xca,0x4d,0xbb,0xa1,0xed,0x36,
+  0x11,0xfe,0x99,0xbb,0x2e,0x25,0x79,0x65,0xec,0x67,0xbd,0xac,0x27,0x29,0xa6,0x28,
+  0x6b,0x81,0xad,0x05,0xbd,0x53,0xd9,0xf9,0xda,0x6f,0xeb,0x77,0x7d,0x9b,0x4d,0xc3,
+  0x8d,0x3e,0xa7,0x3f,0x42,0xdb,0xae,0x13,0xf9,0xe0,0x4e,0x2a,0xff,0x59,0x6e,0xb0,
+  0x6f,0xd1,0x9d,0x45,0x53,0xde,0x3e,0xff,0x72,0x5f,0x54,0xe3,0x41,0x1c,0x9d,0x91,
+  0xf3,0xf8,0x0e,0x5a,0x1e,0x2b,0xd1,0x9f,0x7e,0xfa,0x8f,0x57,0x5b,0x2d,0x59,0x28,
+  0x85,0xab,0xa3,0x3c,0xa5,0x7f,0x9c,0xe6,0xa3,0xb2,0x64,0x02,0x5f,0x89,0xe7,0x06,
+  0x56,0x68,0x1f,0x2f,0x94,0x3f,0xa5,0xbb,0x47,0x55,0xe1,0x70,0xbf,0x95,0xfa,0x9f,
+  0x71,0x01,0x0e,0x2f,0x17,0xa7,0xbd,0x73,0x39,0x35,0x5b,0x57,0x4f,0x3e,0xad,0x23,
+  0xab,0x98,0x32,0x22,0xad,0x2d,0x8c,0x8b,0x29,0xfa,0xeb,0x0f,0x5e,0x79,0xaf,0xde,
+  0xd2,0xd6,0xcc,0x06,0xef,0xb5,0x79,0x10,0xc7,0x8c,0x1a,0x70,0x8d,0x98,0xd6,0x11,
+  0x37,0x7f,0x19,0x6c,0x28,0x31,0xda,0xd0,0x2d,0xe4,0x8a,0xb8,0x3c,0x32,0x10,0xc7,
+  0x69,0xb5,0x12,0x55,0x55,0xf6,0xce,0xb1,0x50,0x3d,0x73,0x62,0xa9,0x55,0x68,0xe0,
+  0x8c,0x72,0x7b,0x1e,0xf7,0x35,0x1f,0x67,0x59,0x05,0xc8,0x89,0x44,0x12,0x7d,0x95,
+  0x34,0x34,0xe6,0x72,0xae,0xc3,0x62,0xfd,0x27,0x9b,0x8b,0x7d,0x61,0x46,0xe5,0x59,
+  0x5d,0xe8,0xb4,0x70,0xc8,0xce,0x6c,0xd4,0x34,0x53,0xc6,0xc9,0xed,0x89,0x5d,0x44,
+  0xb1,0x52,0x69,0xe7,0x5e,0x61,0x45,0x37,0xda,0xfa,0xca,0x85,0xe6,0x86,0x65,0x7d,
+  0xd3,0x20,0xaf,0x7e,0xbf,0x27,0x34,0x22,0x60,0x1b,0x1b,0xad,0x15,0xa3,0x6c,0x7a,
+  0x4e,0xad,0xbf,0x07,0x96,0x5a,0x60,0xe5,0xf2,0x6f,0xf7,0x54,0x79,0x25,0x30,0xe2,
+  0xe2,0x2b,0x2e,0xee,0x14,0x61,0x52,0xd2,0xea,0xfb,0xbe,0xd1,0xeb,0x05,0x25,0xdb,
+  0x1a,0xf5,0x5a,0x87,0x8d,0x20,0x55,0x3d,0x4e,0xc0,0x3a,0x6a,0xbe,0xd0,0x7e,0x59,
+  0x22,0x7f,0x2b,0x23,0x41,0x36,0x86,0x1c,0xf5,0xc7,0xc2,0x9f,0x6c,0xa0,0x6b,0x8c,
+  0x4a,0x49,0x2e,0x8e,0xf6,0x25,0x11,0xf9,0x96,0x90,0x67,0x23,0xd8,0xa4,0x87,0xac,
+  0x87,0xed,0x9a,0x7e,0xd0,0x15,0xa0,0x14,0x87,0x3b,0xd5,0x8a,0x15,0x98,0x1f,0xdc,
+  0x5e,0x77,0xf4,0xcd,0xb6,0x6c,0xd5,0xcf,0x0c,0x71,0xd7,0xaf,0x5b,0x05,0xeb,0x0b,
+  0x5f,0x46,0x20,0x6b,0x23,0x0b,0x2d,0x91,0x37,0xcc,0x1b,0x4d,0xd4,0x0d,0xb7,0xba,
+  0x87,0x59,0x15,0xc4,0xd3,0x79,0xe1,0x44,0x55,0x19,0xbb,0x82,0x68,0x2e,0x77,0xeb,
+  0xe8,0xbb,0x6d,0x85,0xf2,0xd7,0x9a,0xaf,0x5a,0x93,0x84,0x5e,0x6f,0x74,0xb1,0x35,
+  0x65,0xd5,0xe7,0xd8,0x06,0xcc,0x14,0xd5,0xf1,0xce,0xbd,0x4a,0x93,0x9c,0x1a,0x40,
+  0x39,0x13,0xc3,0x53,0x0f,0x2c,0x7c,0xea,0xec,0xc6,0xfb,0xfb,0xcd,0x80,0xbc,0x54,
+  0xa1,0x55,0x44,0x3b,0x30,0x5a,0xa7,0xf1,0xdf,0x46,0x55,0x45,0xac,0x37,0xfe,0xe6,
+  0xcc,0x40,0x24,0x7d,0xae,0xa2,0xd2,0x5a,0x29,0x39,0xe0,0xbe,0x51,0x57,0x09,0xd9,
+  0xb1,0xdb,0x39,0x45,0xbb,0x1a,0xf7,0xbf,0x5e,0x67,0x9e,0x19,0x96,0x72,0x4f,0x28,
+  0xdc,0x87,0xaf,0x5a,0xec,0x85,0xa6,0x9a,0x8b,0xf4,0x9f,0x92,0x8e,0xe7,0xcd,0x88,
+  0x8c,0x74,0xf0,0xe9,0x51,0x70,0xfc,0x27,0x5e,0xbb,0xb9,0xee,0x5a,0x10,0xf2,0xe6,
+  0x21,0xed,0x04,0xf0,0x06,0xf1,0xa9,0xb6,0x64,0xeb,0x86,0x9a,0xbb,0xea,0xf3,0xc9,
+  0xf3,0x1b,0x35,0x8b,0x36,0x03,0x62,0x6f,0x0f,0xcb,0x64,0x95,0x76,0xbc,0xc4,0xf6,
+  0x08,0x6b,0xbf,0x5b,0x6f,0x0f,0x2c,0xff,0x30,0xa2,0x7d,0x2d,0x71,0x8c,0x39,0x9d,
+  0xa0,0x89,0x9c,0xbb,0x42,0x4f,0x64,0xa7,0xaa,0xae,0xd9,0xf1,0x61,0x2b,0x57,0xff,
+  0x69,0x2a,0xf1,0xa7,0x91,0x2e,0x62,0xda,0xa5,0xfa,0xc6,0xf8,0x44,0x13,0xb0,0xc8,
+  0xb0,0xaf,0x24,0x27,0xd0,0xe1,0x89,0xba,0x69,0x61,0xff,0x2b,0xcf,0x87,0xae,0xea,
+  0x13,0x5d,0x4e,0x2d,0x09,0x4e,0x2d,0x96,0xf0,0xf5,0xf6,0xfa,0x8a,0x49,0x69,0xf9,
+  0x7f,0xdd,0xae,0xa4,0xaf,0x1a,0x98,0xd2,0x77,0x41,0x60,0x9b,0x07,0x69,0x2a,0x9c,
+  0x28,0x76,0xf6,0x10,0x3f,0xd6,0x90,0xed,0x07,0x52,0x04,0xa5,0x94,0x33,0xa4,0x49,
+  0x85,0x34,0xfb,0x9e,0x61,0x6d,0xf2,0xfc,0xf2,0xfa,0x74,0xbd,0x14,0x73,0x43,0x29,
+  0x8d,0xe3,0x44,0x25,0x8c,0xdd,0x2e,0xd5,0x20,0xf2,0xfe,0xa5,0x07,0xb1,0xd1,0x1d,
+  0x43,0x36,0x5a,0x97,0xe9,0xca,0x1c,0xad,0x24,0xc2,0x54,0x49,0x62,0xf4,0xaf,0xf4,
+  0x92,0xcd,0x9d,0xd0,0x91,0x8f,0xaa,0x3e,0x21,0x74,0xf2,0x6a,0x75,0x72,0xc1,0xf8,
+  0x57,0xae,0x8a,0x61,0x6f,0x38,0xe0,0x8f,0xce,0x32,0x5e,0xc6,0xbe,0x85,0x75,0x15,
+  0x93,0x14,0xcb,0xa3,0x29,0xfb,0xce,0x06,0xaa,0x19,0xc6,0xc9,0x0c,0x74,0x27,0x42,
+  0xbd,0x62,0x34,0x78,0xea,0x92,0xee,0x97,0x1e,0x40,0x09,0x94,0x8d,0x21,0x93,0xa9,
+  0x8c,0xf0,0x51,0xc1,0xb1,0xed,0x7c,0x6e,0x3d,0x05,0xbb,0x2a,0x26,0x7a,0x8d,0xe1,
+  0xe7,0x1b,0xcf,0x11,0xd5,0x03,0x27,0x3f,0xb8,0x3e,0xfb,0x9b,0x91,0x3f,0xb7,0x46,
+  0x1c,0xb1,0xe1,0x92,0xaf,0x82,0x27,0x2f,0xa7,0x4c,0x40,0x59,0x5f,0x5a,0x5a,0xba,
+  0xb5,0x64,0x39,0x5f,0x75,0x62,0xed,0x27,0x5b,0x1f,0x54,0x2f,0x91,0x53,0xcd,0x85,
+  0x37,0xe6,0x26,0xdf,0xda,0x63,0xa5,0xdc,0xe9,0xfc,0xa2,0xfe,0x57,0x8a,0xb3,0xcc,
+  0x0c,0x9e,0x38,0x1d,0xe0,0x64,0x06,0xa5,0x49,0x3a,0x5e,0x6a,0xae,0xa7,0x98,0x9a,
+  0x1f,0xef,0xce,0x76,0xe8,0x46,0x2b,0x07,0x6c,0xe0,0x8d,0xc9,0xcb,0xd7,0x3f,0x38,
+  0x79,0xb0,0x4a,0x6f,0x64,0xd5,0x6f,0xa2,0x76,0x47,0x1f,0xcc,0x71,0xc8,0xca,0x99,
+  0x20,0x6b,0x8a,0xdb,0x5a,0xe4,0x44,0xf8,0xa2,0x12,0xaf,0xb0,0xe7,0xd7,0x3c,0xf3,
+  0xd3,0x94,0xb2,0x31,0x42,0xa6,0x53,0xfc,0xd1,0xaa,0xba,0xc7,0x91,0x79,0xd1,0x6a,
+  0x8b,0x55,0x29,0x96,0xc6,0x9f,0x08,0x79,0x85,0x9e,0x45,0xbb,0xea,0xbe,0x0f,0xd2,
+  0xb7,0x14,0x4a,0x21,0x29,0x93,0x2c,0xfe,0x68,0xcf,0x71,0x5a,0x79,0xb4,0x73,0x8c,
+  0xbe,0x59,0x90,0xed,0x55,0x35,0x08,0x97,0xf4,0x23,0x9a,0x03,0x5c,0x7c,0x67,0x27,
+  0xd1,0xed,0xf1,0xd5,0xdb,0x64,0xae,0x0e,0x91,0x8d,0x27,0x78,0xf1,0x54,0x0a,0xf7,
+  0xc7,0x6a,0x51,0xf7,0x3e,0xbb,0x76,0x33,0xb9,0x29,0x2f,0x0c,0xc4,0xe9,0x75,0x02,
+  0x9d,0x08,0x18,0x7f,0x98,0xf1,0x1d,0x67,0x1a,0x2d,0xd1,0x6e,0x35,0xa5,0x58,0x78,
+  0x29,0x5d,0x88,0x26,0xe3,0x5c,0x69,0xf5,0x97,0xea,0xeb,0x92,0xf9,0xcd,0x81,0x6c,
+  0x0c,0x30,0xaf,0xf4,0x78,0x46,0xf8,0x12,0xa7,0x67,0xf2,0xf7,0xb0,0x7a,0x7e,0xad,
+  0x5d,0x8b,0x5c,0x5d,0xdc,0x43,0x34,0x11,0xb7,0xae,0xb3,0x58,0xe0,0x07,0x2e,0x39,
+  0x5d,0xd3,0x5c,0x7a,0xc1,0x77,0x7c,0xd3,0xb1,0x50,0xd8,0x3b,0x51,0x3a,0xd9,0x34,
+  0xc7,0xec,0xa9,0x19,0xf5,0xc7,0x83,0xca,0xd5,0xa2,0xe6,0xd2,0x6c,0x37,0x8e,0x3f,
+  0xea,0x3c,0x86,0xd1,0x67,0x81,0xfe,0x13,0xe3,0xa4,0x48,0x9c,0xa4,0xd0,0xb1,0x54,
+  0x2a,0xa2,0xb5,0xcf,0xc2,0x49,0x31,0x51,0x73,0x96,0x9e,0x5f,0x1b,0x6a,0xff,0x17,
+  0x75,0xd7,0x24,0xc4,0x74,0x2d,0x4e,0x45,0x40,0x6e,0x68,0x47,0xe1,0xbb,0x6e,0x3d,
+  0x78,0x53,0x72,0xe2,0x44,0xe2,0xf6,0xa3,0xae,0x0c,0x7f,0x0e,0x98,0x9b,0xe2,0x48,
+  0x32,0x3b,0x2c,0xd6,0x98,0xcd,0x95,0x7f,0x1b,0x70,0xd7,0xb9,0x22,0x8d,0x5b,0x6e,
+  0xf7,0xee,0xdf,0x4b,0x57,0xb0,0x52,0x8a,0xb1,0x6a,0x56,0xf3,0x25,0xf7,0x55,0xc3,
+  0xee,0x52,0xf9,0xab,0x90,0x04,0x7a,0x52,0x12,0x45,0x51,0x28,0x7f,0xda,0xdd,0x7b,
+  0x79,0xc8,0xaf,0xf9,0x02,0xfb,0xef,0x66,0xbf,0xd2,0xfc,0xd6,0xe1,0x9d,0x4a,0x1f,
+  0x0d,0x6c,0x69,0xb2,0x99,0xb5,0xf6,0x12,0xcb,0xc7,0x2a,0xc6,0xc0,0x73,0x7a,0xcd,
+  0xcc,0xde,0xb0,0x77,0x49,0xb7,0xda,0x94,0xcd,0x85,0xa1,0x8a,0x57,0x4a,0xa4,0xc1,
+  0x85,0x7c,0x70,0xe1,0x41,0xd3,0x80,0x32,0xf2,0xe9,0x67,0xfb,0x2f,0xa3,0x3d,0xa2,
+  0xaf,0x46,0x76,0xd0,0x52,0x09,0xd8,0xe4,0x5a,0x32,0xa9,0x3a,0xc6,0x0b,0x35,0x6e,
+  0x86,0x98,0x9e,0xb3,0x2c,0x8a,0x7c,0x57,0x83,0xcc,0xe5,0xa9,0xee,0x55,0xb4,0x4e,
+  0xb2,0x8c,0xe6,0x63,0x66,0xea,0xb3,0xe7,0x68,0x89,0x75,0x33,0xeb,0x52,0x1d,0xa6,
+  0x84,0x4f,0xc7,0x77,0xb5,0xe8,0x4a,0x25,0xfd,0xab,0xf2,0xe6,0x4e,0xe3,0xad,0x89,
+  0x92,0x96,0xab,0xff,0x84,0x7c,0xc3,0x17,0x6c,0x9e,0x0e,0xd4,0x67,0xef,0xaf,0x88,
+  0x9d,0xa2,0x06,0x37,0x3b,0xff,0x63,0x4d,0xb2,0x20,0xc5,0xc1,0x90,0xa5,0xa4,0xd8,
+  0xf4,0xf4,0x2c,0x2e,0x6b,0x22,0x54,0x42,0xfe,0x7e,0x90,0x78,0x90,0x38,0xc9,0xb3,
+  0x9e,0x1e,0xe8,0x5f,0xc8,0x37,0x1f,0x36,0x2b,0xad,0xf6,0x51,0xaa,0x95,0xb8,0x27,
+  0x7c,0xc9,0x1f,0x7a,0xb6,0xde,0x9c,0x32,0x23,0xb0,0xf8,0x8f,0x3b,0xea,0x6b,0x28,
+  0x59,0x29,0x17,0xfb,0x73,0x5d,0xc2,0xba,0xb6,0x78,0xb8,0xfd,0x7a,0x5a,0x3d,0x48,
+  0x31,0x12,0xfa,0x0d,0x81,0xb4,0x6d,0x55,0x11,0xc5,0x13,0x13,0x46,0xff,0x71,0x92,
+  0x76,0xa2,0xcd,0xaf,0x96,0x25,0x53,0xb4,0x6f,0x3c,0x6d,0xee,0xa2,0x6b,0xf1,0xf1,
+  0x1c,0xb3,0x4d,0xca,0x8f,0x6b,0xdd,0xf9,0x63,0x5f,0x12,0x8c,0x35,0x86,0x7c,0xc3,
+  0xf9,0x9f,0xd6,0x62,0x01,0xca,0xe6,0xb8,0xeb,0xc6,0x5d,0x6f,0x1e,0x1f,0x85,0xec,
+  0x55,0xa1,0x6c,0x5c,0x8f,0x95,0xf9,0xa8,0xb3,0x4e,0x4f,0x98,0x26,0xee,0x8b,0xe1,
+  0x0d,0x4f,0x90,0xde,0x17,0xe4,0x7c,0x6f,0x40,0x73,0x91,0x12,0xbe,0xb8,0x0e,0xc7,
+  0xa5,0x78,0x96,0x9b,0xe3,0xe8,0xcc,0x7f,0x5c,0x4b,0x07,0xdc,0xd8,0x1b,0x79,0x55,
+  0x88,0xd4,0x11,0x8b,0xb2,0x77,0x36,0xe3,0xd6,0x13,0xb2,0xbe,0x27,0x74,0x86,0x5c,
+  0xaa,0x6d,0x87,0x7d,0xf3,0x85,0x37,0x9d,0x73,0x2a,0x23,0xe3,0x1b,0x66,0x25,0xf6,
+  0x5f,0x52,0x06,0x97,0x6b,0x64,0x7e,0x2b,0xb7,0xff,0x6d,0x1e,0xb6,0x91,0x73,0x3b,
+  0xad,0xe7,0x4f,0x1f,0x07,0x03,0xb7,0xda,0x33,0xe4,0x24,0x75,0xf3,0x81,0xfa,0x1a,
+  0x24,0x41,0x5e,0xee,0xf5,0x92,0xeb,0x75,0xf1,0xe1,0xce,0xdb,0xe9,0xa4,0x2b,0x9b,
+  0x65,0x9a,0xf1,0x3f,0x8b,0xcf,0xf5,0x84,0x2f,0xd6,0xa2,0x47,0x1e,0x24,0x13,0x50,
+  0x8a,0x97,0xfc,0x9a,0xe3,0xa9,0x7a,0xd7,0xdf,0x3f,0x79,0xbb,0x2d,0x3e,0x24,0xfa,
+  0x50,0xfd,0xb1,0xef,0x56,0xe7,0x75,0x30,0x62,0xd4,0xac,0x72,0xf1,0x4d,0xa6,0x58,
+  0xb8,0x46,0xf5,0x10,0x36,0x73,0xc9,0xbf,0xbb,0xee,0xd9,0x17,0x23,0x2d,0x94,0x83,
+  0xb7,0xda,0x05,0x82,0x94,0xd2,0x7f,0xb6,0x47,0x4c,0x64,0xb9,0x5c,0xfe,0x9a,0x32,
+  0x9a,0x4e,0x36,0x57,0xe7,0xf5,0xbf,0x62,0x8e,0x39,0x09,0x4f,0x69,0x3d,0xeb,0x29,
+  0x3e,0xad,0x2c,0x88,0xe7,0x38,0x4d,0x72,0xcf,0xaf,0x3a,0xc9,0x82,0x4a,0x57,0x7d,
+  0x28,0x8e,0x82,0x2e,0x6b,0x30,0xfd,0xd1,0xc3,0xec,0x52,0x36,0x06,0x35,0x80,0x3f,
+  0x14,0x92,0x06,0x47,0x8b,0x4a,0xd7,0xda,0xc4,0x6a,0xce,0x8d,0x36,0x29,0xf2,0x12,
+  0xeb,0xce,0xf1,0x1e,0x50,0x6d,0x18,0x56,0xcf,0xb6,0x54,0x27,0x71,0xd0,0x0d,0x46,
+  0xf5,0xb7,0x6f,0xe4,0x48,0x8f,0x47,0x53,0xce,0x54,0x2b,0xfe,0x44,0x26,0xd5,0xab,
+  0x03,0x4b,0xb9,0x97,0x8b,0x11,0x57,0xb0,0x21,0x51,0x32,0xb1,0x6f,0xe2,0xa5,0x4c,
+  0x5f,0x94,0x10,0xc9,0x5f,0x98,0x49,0xba,0xf9,0xec,0xa4,0xff,0x9a,0x8d,0x1d,0x6e,
+  0x54,0x9e,0xa7,0xff,0xc4,0x5e,0x2b,0x54,0x39,0x7d,0x65,0x9c,0xb5,0xc1,0x65,0x75,
+  0xde,0x2c,0x6d,0xc7,0x8c,0xd7,0x6e,0x74,0xe8,0x0b,0x95,0x8d,0xfc,0x9a,0x6d,0x95,
+  0x36,0xd1,0xb6,0x3e,0xc2,0x91,0xdc,0x61,0xbf,0xfc,0xa8,0xe6,0x8d,0x51,0x88,0xe3,
+  0x91,0xf1,0x6a,0xdf,0x5c,0xfb,0x81,0x91,0x40,0xf1,0x57,0xa1,0xad,0x28,0x32,0xb3,
+  0x6e,0x65,0x45,0x67,0x50,0xaf,0x39,0x5d,0x95,0xf3,0x55,0xaf,0x95,0x15,0xdb,0xf4,
+  0x86,0xfa,0x8e,0xf4,0xc4,0x39,0x77,0x02,0x52,0x79,0x27,0x5f,0xfc,0xda,0xbf,0xeb,
+  0x23,0xe7,0xa6,0x14,0x0d,0x0f,0x7e,0x9b,0xaf,0x74,0xe5,0x6c,0x4a,0x15,0xa5,0x5c,
+  0x13,0x1d,0xd2,0xaa,0x9a,0xd2,0x49,0x27,0x01,0x59,0xfd,0x27,0xdb,0xef,0x15,0xa4,
+  0xc9,0x0a,0x9f,0x62,0x4a,0xdd,0xa4,0x25,0x0f,0xd3,0xbf,0x2b,0xeb,0xad,0xd3,0x2c,
+  0x5c,0x6b,0x96,0x73,0xa7,0xfe,0xa8,0xdb,0x41,0x07,0x03,0x05,0xfe,0x14,0x79,0x2c,
+  0xe3,0x53,0xb0,0xc3,0xef,0x80,0xed,0x79,0x50,0x7a,0x60,0xd9,0x3e,0xc7,0x69,0x7b,
+  0x4d,0x09,0x5f,0xfc,0x55,0xe5,0x5f,0xb5,0xc3,0xb6,0xdd,0x1e,0xe1,0x4e,0xc1,0xa8,
+  0xed,0xa5,0x9c,0x59,0x59,0x1a,0xb5,0x98,0xd0,0x9a,0xd5,0x17,0x0a,0x73,0x97,0x90,
+  0x0d,0x34,0x72,0xaf,0x96,0x6d,0xf1,0x46,0x4f,0x95,0xce,0xb0,0x52,0x6d,0xc3,0x82,
+  0x5d,0x05,0x63,0x60,0xad,0xff,0xb8,0x9f,0x01,0x2a,0x31,0xa5,0xe3,0x0f,0x9d,0x37,
+  0x71,0xcd,0xd5,0x7e,0xd6,0xff,0x2c,0xc5,0x90,0x89,0x96,0xaa,0x3e,0xbf,0xe3,0xdb,
+  0xb3,0x12,0x9d,0xfa,0x51,0xaf,0x73,0x23,0xab,0xbf,0x54,0x17,0x3a,0x88,0xbe,0xd8,
+  0x13,0x64,0x1e,0x72,0x60,0xd6,0x58,0x9e,0x68,0xe6,0x6a,0xee,0xa6,0x5c,0xac,0x11,
+  0x9f,0x82,0xb5,0x41,0x79,0xb2,0x3a,0x7a,0xe6,0x01,0x59,0x0d,0x23,0x1b,0x4f,0xd2,
+  0xfa,0xf2,0x17,0xe1,0x99,0xfa,0x7f,0x21,0xae,0x73,0xb1,0x58,0x33,0x85,0x1a,0x17,
+  0x70,0xb9,0x7b,0x5f,0x2e,0x0d,0xb8,0x28,0xa9,0xe5,0x14,0x5f,0x3c,0x52,0x30,0x83,
+  0xd2,0x6c,0xcf,0x06,0xd5,0x8c,0x39,0xe0,0x22,0x99,0xca,0xbd,0xa9,0x9c,0x63,0x44,
+  0xde,0xa8,0xe6,0x8b,0x22,0xea,0x34,0xfe,0x50,0xdd,0x95,0xd8,0x65,0x6f,0x93,0xd1,
+  0x7f,0x52,0x4c,0xd2,0x86,0xe4,0x8f,0x15,0x6c,0xdb,0xbd,0xa4,0x6f,0xd1,0x94,0xe2,
+  0x97,0x64,0xb4,0x1f,0x32,0x7e,0xb0,0x7c,0x4e,0x4c,0x4e,0x5a,0xf3,0xd8,0x77,0xea,
+  0xc4,0xf7,0xb8,0x51,0x74,0x59,0xf3,0xb0,0x97,0x8c,0x54,0x71,0x0d,0x8b,0x07,0x63,
+  0x04,0x2c,0x27,0xf4,0x0a,0x46,0x6f,0x09,0x5d,0x26,0x43,0xbd,0xa6,0x05,0x8b,0x31,
+  0xd3,0x32,0xe3,0x82,0xdf,0x5b,0x6a,0x64,0x88,0x31,0xe7,0xad,0x35,0x03,0x69,0xdb,
+  0x67,0x84,0xec,0x82,0x9e,0x01,0xcb,0xbf,0x70,0x90,0x34,0x07,0x67,0x91,0x27,0x09,
+  0xdb,0xd1,0xc8,0xbd,0xc8,0xd9,0x7f,0x3c,0x2d,0x7c,0x6b,0xb0,0xff,0x74,0x49,0xbc,
+  0xd1,0x63,0xd4,0x59,0xc6,0xfe,0x13,0xf5,0xed,0x3c,0xd5,0xb5,0x73,0x17,0x24,0x19,
+  0x7a,0x21,0x76,0xd1,0xc9,0xe6,0x52,0x8d,0x2e,0xfb,0x67,0x95,0x8b,0xa5,0xb7,0x5e,
+  0x1a,0xe0,0x79,0xee,0x87,0x24,0xf6,0xbd,0x45,0x4d,0xbc,0x29,0x2f,0x55,0x79,0x95,
+  0xae,0xbf,0x31,0x5d,0x44,0x54,0x00,0x3d,0x93,0x7f,0x82,0x07,0xf0,0xee,0x01,0xb7,
+  0xfb,0x8d,0x34,0x59,0x05,0x43,0x85,0x2f,0xca,0xdc,0x51,0x53,0x1d,0x4a,0xa3,0x71,
+  0x57,0x3a,0xea,0xa4,0xf7,0xcb,0x5c,0xed,0xb7,0xcd,0x2a,0x5e,0xab,0x8e,0x48,0xd1,
+  0xb2,0x81,0xe5,0x62,0x89,0x78,0x23,0xb5,0x4c,0x95,0xa6,0xaf,0x87,0x9f,0xcb,0x5d,
+  0x7d,0x38,0xcb,0xb2,0x67,0x13,0x4b,0xa2,0xb3,0xfc,0xad,0xfe,0xda,0x9e,0xed,0xeb,
+  0x3f,0x75,0xa1,0x7c,0x3b,0xa7,0x6b,0x4f,0xb9,0xaa,0xd8,0x42,0x7c,0xb6,0xea,0x2f,
+  0xc7,0xe8,0x9f,0x2b,0xe1,0xee,0x62,0x63,0x4c,0x9f,0x9c,0xac,0x6d,0x31,0x31,0xf9,
+  0xeb,0x2e,0x26,0x0a,0x92,0xad,0x5a,0xbe,0x48,0xad,0x29,0xf2,0x6a,0xb0,0x7b,0xe8,
+  0x81,0xb0,0x00,0x57,0x8f,0x07,0x4e,0x57,0xa4,0x84,0xcf,0xc8,0x60,0xcd,0x75,0x01,
+  0x72,0xa2,0xe2,0xe9,0x97,0xa1,0xe5,0x92,0x5a,0x9d,0xf6,0x2c,0xc9,0x44,0x10,0xed,
+  0x88,0xf1,0x95,0xe2,0x0b,0x5b,0x97,0x9c,0x06,0x70,0x46,0x8d,0x19,0xdc,0x05,0x07,
+  0xf3,0x06,0x94,0xd2,0xcd,0xff,0xe6,0x38,0xd1,0x3b,0xfa,0xff,0xf4,0xf0,0xea,0x43,
+  0x9b,0xca,0x94,0xff,0xb9,0x29,0x6f,0xd6,0x3c,0xe5,0x92,0x09,0xf4,0x04,0xe5,0x51,
+  0x7b,0x03,0x59,0x7f,0xdc,0x24,0x3c,0xf2,0x5a,0x56,0xa7,0x0b,0x75,0x91,0x94,0xcd,
+  0x21,0xaa,0xea,0x19,0x15,0x3e,0x9d,0x85,0xeb,0xc5,0x29,0x96,0x63,0x46,0x6f,0x72,
+  0x7f,0xf8,0x1b,0xe5,0xba,0x7a,0xf9,0x01,0x30,0x00,0x5b,0xbf,0xaf,0x71,0x3a,0x2e,
+  0xf0,0xb2,0x60,0x3a,0x4e,0xb7,0x8e,0x5c,0xae,0x34,0x86,0x9c,0xb2,0x54,0x65,0xfe,
+  0xd0,0x99,0x02,0x6f,0x88,0x42,0xbc,0x1c,0x2f,0xec,0x63,0x8c,0x0a,0x9f,0xb9,0x38,
+  0x9c,0x28,0xee,0x1f,0x64,0xbd,0x46,0x2a,0x21,0x1d,0xf0,0xc7,0x6e,0xe5,0xc9,0x92,
+  0x9d,0xff,0x65,0x24,0x81,0x64,0xfc,0xdb,0xb9,0xff,0xbd,0x6a,0xaf,0x4c,0xf5,0xbf,
+  0xb2,0x79,0xac,0x70,0xc9,0x5d,0x12,0x04,0xac,0x76,0xc3,0x5d,0xb4,0x32,0x69,0xfe,
+  0x18,0x44,0x02,0x32,0x98,0x3f,0xd4,0x6a,0x6b,0xd1,0x9e,0x8f,0xce,0xf1,0x54,0x29,
+  0x69,0x3f,0x03,0x25,0x5a,0xac,0x35,0x93,0xb7,0x5a,0x32,0xb9,0x3c,0x64,0x6f,0x75,
+  0xc8,0xef,0x26,0x40,0x8a,0x5f,0xd8,0x64,0xa7,0xd7,0x55,0x1a,0x67,0x5d,0xb0,0xdd,
+  0xb3,0xb7,0xa6,0x9c,0xbf,0x4b,0x17,0xd0,0x8f,0x8b,0x66,0xe1,0x64,0xb3,0x5e,0xf3,
+  0x9c,0x2e,0xae,0x77,0x88,0x84,0xbc,0x72,0xa9,0x2c,0x5d,0xcf,0xbb,0xc7,0x39,0x3c,
+  0x4f,0x5b,0xec,0xb8,0x39,0x9b,0x37,0xee,0xb6,0xf6,0x9f,0x3f,0x85,0x6f,0x3e,0x3b,
+  0xca,0x9f,0x1a,0x50,0x56,0x8d,0x19,0x9c,0xea,0x7f,0xe5,0x47,0x8f,0x38,0xe3,0x35,
+  0x33,0xeb,0x9b,0xa4,0xcb,0x7b,0xda,0x43,0x0c,0xf9,0x73,0x63,0x13,0x45,0xcd,0x54,
+  0x46,0x7d,0xb5,0x3f,0x61,0x4d,0x4c,0x95,0x9e,0x7d,0x25,0x53,0xb9,0xf2,0x7a,0x85,
+  0x79,0x7d,0x04,0xb1,0xb0,0xf5,0xa2,0xf1,0x07,0xa0,0x03,0x9e,0xaf,0x9a,0x32,0x32,
+  0x99,0xe6,0xee,0x28,0x96,0x1e,0x7f,0xa1,0x41,0x33,0x72,0x16,0xd8,0x02,0x0a,0xab,
+  0x63,0x85,0x05,0x3b,0x45,0x84,0x8f,0xf4,0x0e,0xe6,0xda,0x7c,0xe7,0x73,0x7c,0x13,
+  0xf9,0x0f,0x44,0x09,0xa7,0xdb,0x37,0x67,0x07,0xf2,0x2e,0xcd,0xd1,0x7f,0x74,0x16,
+  0x64,0x0d,0xfa,0xef,0xfa,0xc3,0xe6,0x42,0x5f,0xff,0x49,0x71,0x38,0x24,0x71,0xe6,
+  0x69,0x9c,0x6a,0xc5,0x9b,0x67,0x93,0xcd,0x0f,0x48,0x47,0xaa,0x94,0x51,0x7f,0x66,
+  0x0a,0xcd,0x9e,0xb9,0x93,0x34,0x78,0x4f,0x13,0x44,0x05,0x37,0x5a,0x96,0x6a,0xf1,
+  0xc3,0xa2,0xf4,0x44,0x9f,0xb3,0x1d,0x32,0x7c,0xff,0xd1,0x33,0x1a,0xb4,0x9f,0xe3,
+  0xa9,0x3c,0x68,0x81,0x79,0x5a,0x78,0xee,0x03,0x79,0xd1,0x77,0x7e,0xf5,0xdd,0xcc,
+  0xaf,0x58,0x21,0x47,0x2b,0xd9,0x27,0xe8,0xb8,0xf5,0xe9,0x6c,0x2b,0xee,0xb8,0xf5,
+  0x63,0x16,0xf6,0x12,0xeb,0x49,0x23,0x9a,0xa1,0x96,0xa7,0x13,0x8c,0xfe,0xe3,0x9e,
+  0xd8,0xad,0x53,0xff,0x25,0x57,0x10,0xd5,0xa1,0x9f,0x98,0xbf,0xd4,0x5b,0x89,0xf3,
+  0x40,0x2c,0x4b,0x3f,0x60,0xfc,0x37,0x44,0x64,0x95,0xce,0x12,0xcf,0xb9,0x8e,0x54,
+  0x27,0x5c,0xc9,0x51,0x7e,0x7e,0x6f,0xb9,0xb1,0x2b,0x75,0x10,0x98,0xb4,0x9f,0x2d,
+  0x2b,0xa6,0x95,0x7d,0xdd,0x8c,0xf4,0x11,0x69,0x6f,0xe9,0x44,0x79,0x86,0xef,0x3f,
+  0x49,0x35,0xdb,0xb1,0xbe,0x13,0x42,0xa3,0xc5,0x15,0x1f,0xa4,0x0a,0x40,0xbc,0xc0,
+  0xb6,0xb8,0x46,0xc6,0x83,0x63,0x05,0xde,0x2d,0xf9,0x32,0x1d,0x2b,0xfa,0xcf,0x04,
+  0xa9,0x60,0xb8,0x64,0x56,0x40,0xb6,0xe7,0x49,0x1a,0x7c,0xf3,0x20,0xfa,0x2a,0xaf,
+  0xd3,0x37,0xfe,0x3f,0x1a,0x38,0xa7,0x44,0xe7,0xf1,0x47,0xbb,0x1d,0xe9,0xbf,0xe8,
+  0xca,0x41,0x92,0x27,0xa9,0x67,0xde,0x4c,0x63,0x2c,0xd0,0x34,0x01,0xdf,0xb9,0x9c,
+  0xca,0xc2,0x2c,0xab,0x90,0x16,0x10,0xd4,0x16,0xf3,0x9d,0x4d,0x72,0xc1,0xd7,0x00,
+  0xcc,0x0a,0x5f,0x6c,0x6a,0x7c,0x50,0x36,0x79,0x22,0x5f,0x28,0xea,0x23,0xa2,0x9c,
+  0x8f,0x75,0xca,0xf0,0xfd,0x46,0x3c,0x4b,0x47,0xfc,0xe9,0x1a,0x8f,0x67,0x39,0xfe,
+  0x3a,0x95,0xff,0x55,0x39,0xff,0x08,0x5d,0xfa,0x13,0xf4,0x16,0xbc,0xa8,0x45,0x3c,
+  0x47,0xcd,0x37,0x57,0x2a,0x71,0xc4,0x95,0xe7,0x4a,0xc4,0x41,0xb6,0x17,0xfd,0x2b,
+  0x52,0x23,0xe8,0xca,0xb5,0x9c,0x8b,0xf2,0xec,0x3f,0xd2,0xa5,0xad,0xc1,0xff,0x52,
+  0x3f,0x77,0x6e,0x2a,0xfe,0x37,0x43,0x32,0x2d,0xe4,0x4c,0xd5,0xb3,0x46,0x49,0xe0,
+  0xf4,0xfb,0x4c,0x6a,0x34,0x25,0xc4,0x61,0x2b,0x4a,0x91,0xe0,0x8e,0xe4,0xcb,0xd1,
+  0xea,0x79,0xd3,0xaa,0xe8,0xcc,0xba,0xab,0x8f,0xd9,0x32,0xdf,0xb5,0x1c,0xe9,0x31,
+  0xe9,0x22,0x5a,0xc3,0xa6,0xeb,0x48,0x87,0x0c,0xdf,0x67,0xa4,0x98,0xa6,0xb9,0x4d,
+  0x75,0xc3,0x89,0x4f,0xf4,0x91,0xb9,0x94,0xfa,0x53,0xea,0xe0,0x28,0xa7,0xd7,0xf0,
+  0x83,0xf9,0x4d,0x54,0x6e,0x27,0xad,0xd1,0x0d,0x22,0x8c,0x4c,0x1d,0x2c,0x29,0x57,
+  0xd1,0xbe,0xcd,0xa8,0x04,0x11,0x83,0x5c,0xef,0x76,0xf3,0x8b,0x39,0x17,0xe5,0xda,
+  0x7f,0xce,0xea,0xec,0xdc,0xff,0x46,0x93,0xc0,0xd1,0x26,0x05,0x71,0x30,0xca,0xfa,
+  0x10,0x4f,0x3d,0x63,0xe4,0x8d,0xb1,0xa3,0xd1,0x6f,0x7a,0xba,0xb5,0xa5,0x46,0xd3,
+  0x35,0x62,0x34,0xaa,0xdd,0xf9,0xfc,0x69,0x9b,0xc9,0xec,0x62,0x09,0x6a,0x2c,0xcf,
+  0x97,0x24,0xbb,0x29,0x47,0xbb,0xbd,0x36,0xe6,0x05,0x9c,0xed,0x2b,0xcf,0xf0,0xfd,
+  0xa6,0x55,0x7f,0x92,0xe6,0x97,0xda,0x67,0xe6,0x28,0x7f,0xf2,0xfc,0x46,0x9f,0xeb,
+  0xad,0x55,0x50,0xcd,0x93,0x86,0xb6,0x6c,0x6c,0xf5,0x1e,0x46,0xf3,0xfb,0xe1,0x80,
+  0xfd,0x6d,0x99,0x7b,0x5e,0xd6,0xfb,0x32,0xb6,0x38,0x35,0xe8,0xa6,0x4a,0xc6,0xbf,
+  0xbe,0x79,0x6a,0xac,0x84,0x35,0xe8,0xbf,0x7c,0x56,0xe5,0x24,0x91,0x0b,0x5f,0x05,
+  0x5a,0x57,0x40,0x30,0x9b,0x5d,0xb0,0xd0,0xfc,0xa5,0x37,0x6c,0xe7,0xe9,0x8e,0x24,
+  0x39,0x6d,0x2c,0x35,0x7e,0x4d,0xcd,0xf0,0x2d,0x96,0x16,0xd3,0x18,0x6d,0x63,0xb6,
+  0x8b,0x30,0x25,0xf5,0x17,0x1b,0xca,0xf0,0x3d,0x43,0x4c,0xb8,0x15,0x4b,0xe9,0x67,
+  0x68,0x4c,0x36,0x6a,0x8b,0x39,0xa5,0xb6,0x12,0xbb,0xf7,0xad,0x9b,0x3a,0xf7,0x21,
+  0x1b,0x29,0x6a,0x5e,0xc7,0x4b,0xba,0x79,0x7d,0x50,0x79,0xa5,0x74,0x60,0x57,0xef,
+  0x73,0xc2,0x94,0xd2,0x0f,0xfa,0xab,0x5c,0xf9,0xcb,0xea,0x26,0xd2,0xfd,0xad,0xc5,
+  0xfe,0xcb,0x25,0x99,0xf2,0xc9,0x9b,0x8c,0x36,0xe6,0xc4,0x9f,0xb1,0x17,0xf3,0xba,
+  0x80,0x1b,0x35,0x72,0xb2,0x4a,0x49,0xee,0x7b,0x13,0x57,0xc7,0xb3,0xfa,0x8f,0xae,
+  0x22,0x2b,0x7a,0xfb,0x4d,0x94,0x34,0x31,0xe6,0xab,0x65,0xda,0xd0,0x55,0xf0,0xf4,
+  0x86,0x32,0x7c,0xaf,0x50,0x05,0x5b,0x09,0xb3,0x09,0xf7,0x6c,0xe1,0xf0,0x78,0xde,
+  0xeb,0xa7,0xa2,0x75,0x05,0xa1,0x2d,0xa2,0x90,0xcd,0xe4,0x2c,0xf7,0x96,0xab,0x3b,
+  0xad,0xb8,0x38,0xab,0xd2,0x69,0xa5,0x17,0x4a,0xed,0xbf,0x25,0xe6,0xa5,0xc8,0x9a,
+  0x59,0x89,0x3c,0xe6,0xf9,0x0e,0xcd,0xfa,0x17,0xee,0x29,0xaa,0x75,0xd8,0x7f,0xf9,
+  0x29,0x69,0x1e,0xe7,0xcc,0x3e,0x89,0x9b,0x5a,0xf4,0x6c,0xfa,0x80,0xde,0x85,0xbc,
+  0xc8,0xa3,0xa7,0xe5,0xac,0x66,0x2a,0x78,0x6f,0xa2,0x98,0x0a,0x7d,0xfb,0x8f,0xce,
+  0xf3,0xa9,0xfd,0xf9,0xb2,0x54,0xcb,0xd7,0xc9,0x1d,0x78,0x26,0x8d,0x9b,0xbb,0xff,
+  0x15,0xe6,0xfd,0x29,0x64,0xdc,0x9b,0x1a,0x88,0xf0,0x81,0x5b,0x79,0x57,0xb6,0xe4,
+  0x84,0x2b,0x22,0x7d,0xc5,0xce,0xdc,0x67,0xe1,0xcc,0x0b,0x3d,0x8c,0x18,0x70,0x4f,
+  0x2b,0x3d,0x57,0x92,0x34,0xb9,0xba,0xe8,0x04,0x8e,0xd4,0x87,0x89,0xad,0xb2,0xb8,
+  0xe6,0xf1,0xaf,0xa9,0xd8,0x8d,0xe9,0xbf,0xd5,0xb6,0xb8,0xb1,0x35,0xcc,0xea,0x60,
+  0x1a,0x28,0xf1,0x1c,0xc9,0x77,0x12,0x37,0xb6,0xd3,0xd3,0x82,0xea,0xd9,0xbc,0x69,
+  0xeb,0x0b,0xd9,0x25,0x85,0x9c,0x7c,0x7e,0x58,0xda,0x4d,0x8c,0x14,0x18,0xa5,0xf1,
+  0xe7,0xc8,0xfa,0x33,0x7c,0x0f,0xb9,0x96,0x99,0xd2,0x24,0x26,0x5a,0x72,0xf4,0x9b,
+  0xfc,0x41,0x9b,0x6c,0x3c,0xe5,0x39,0xad,0x7a,0x26,0x72,0x9c,0x0b,0xf2,0x65,0xaa,
+  0xb9,0x9c,0xa9,0x94,0x0c,0x62,0x87,0xcb,0xdc,0x7f,0x91,0xff,0xc5,0x95,0xa9,0x91,
+  0x74,0xab,0xa6,0x73,0x06,0x85,0xb2,0xcc,0xfe,0xdb,0xb8,0xfe,0x13,0xc7,0xe8,0x92,
+  0x1a,0x9e,0x3b,0xce,0xec,0x2b,0x58,0x21,0xda,0x3a,0x4b,0x4c,0x3a,0x1e,0xf0,0xbc,
+  0x59,0xb8,0xd5,0x6b,0xcc,0x19,0xc5,0x4e,0x03,0x58,0x5f,0xcf,0xfb,0xa5,0xfa,0xef,
+  0x85,0x74,0x96,0xad,0x06,0xd5,0x3b,0x6f,0x6f,0x20,0xc3,0xf7,0x0a,0x29,0x5e,0xed,
+  0x76,0xf6,0x14,0xb3,0x7a,0xc9,0xeb,0x2e,0x87,0x1a,0xb9,0x8b,0x18,0xd5,0x20,0x71,
+  0x26,0xa0,0x4d,0x8e,0x0f,0x2c,0x65,0x4f,0x92,0x7f,0x4f,0x84,0xc7,0x13,0x86,0xe8,
+  0x9b,0xd2,0x57,0x2c,0x37,0x2f,0x32,0xbf,0x38,0xbd,0x34,0x56,0x1e,0xcf,0x9b,0x7f,
+  0xcb,0x5b,0xff,0x42,0x44,0x7e,0x43,0xf2,0xd7,0x94,0x0b,0xbd,0x41,0xda,0x3d,0x97,
+  0x09,0x8e,0x17,0x2c,0xf5,0x14,0xe2,0x2f,0x49,0x9b,0xe6,0xf9,0xef,0x4d,0xbc,0xdd,
+  0x9b,0x35,0x70,0x49,0x37,0x71,0xb6,0x6c,0xfc,0x21,0x9e,0xcf,0x7b,0xd2,0x20,0x89,
+  0x21,0x64,0x67,0xd7,0x9f,0xe1,0x7b,0x86,0x9c,0xfb,0x1e,0x15,0x3e,0x9e,0x36,0x5e,
+  0x75,0xb3,0xe5,0x33,0x85,0x2f,0x1c,0x10,0x7b,0xad,0x0e,0x88,0x64,0xe4,0x78,0x3b,
+  0xa3,0x01,0xc5,0x87,0x19,0xe1,0xb3,0x5e,0x05,0xfd,0x7d,0xd9,0x3b,0x04,0xe5,0xc9,
+  0x8a,0x5f,0x9c,0xbe,0xff,0x66,0x24,0x6f,0xd5,0x97,0x79,0xfe,0x2d,0xdf,0xfe,0xdb,
+  0xe0,0xf8,0x43,0xbc,0x68,0x6e,0x9b,0x5e,0xf1,0xe7,0xac,0xd1,0xed,0xb7,0x0b,0x17,
+  0xa1,0xbd,0xe7,0x8d,0xa1,0xc2,0xfe,0xa5,0x8c,0xd2,0x97,0xcd,0x3d,0xcc,0x59,0x7b,
+  0x46,0xf8,0xec,0x5d,0xca,0xe7,0xdf,0x56,0x7e,0x98,0x1a,0x36,0x5b,0x8b,0x25,0x8a,
+  0xa0,0x64,0xe9,0xcc,0x7d,0x47,0xec,0x73,0xba,0xce,0xf7,0xfc,0xd9,0x4e,0x93,0xef,
+  0x2d,0x9c,0xfb,0x91,0xf2,0x12,0xd5,0x01,0x21,0xaf,0xfd,0x2e,0x7b,0x4a,0x7d,0x80,
+  0xa8,0x20,0x2a,0xdc,0xb1,0x5f,0xec,0x52,0x49,0xcb,0x6e,0x3e,0x4f,0x9d,0x09,0xf4,
+  0x56,0x51,0x25,0xcd,0xe4,0x54,0x8a,0x2c,0xf4,0xff,0xc5,0xf7,0xdb,0x98,0xfd,0x77,
+  0x89,0xa7,0x62,0x4c,0x0d,0xd2,0xb4,0x78,0x4d,0x16,0x3f,0x85,0x20,0x0e,0xd8,0x12,
+  0xd0,0x89,0x78,0xe8,0xad,0xec,0x99,0xe2,0x64,0xd5,0x96,0x49,0xfa,0xe1,0x3a,0x65,
+  0x5a,0xee,0x2d,0x73,0x93,0x2e,0xc6,0xaf,0xf2,0xf2,0x46,0xcd,0xce,0x2c,0x7a,0x76,
+  0x13,0x2f,0x80,0x4e,0x66,0xde,0xb2,0x33,0xb3,0x2e,0x3b,0x0f,0x3d,0x32,0xd7,0x2c,
+  0x7a,0xd6,0xb1,0xbd,0x2a,0x0e,0x85,0x15,0x32,0x60,0x0b,0x72,0x1e,0xd2,0x12,0x47,
+  0x39,0x59,0xad,0xef,0x3f,0x2a,0xcd,0x82,0x9e,0x92,0xf5,0x57,0xed,0xc8,0xfd,0x42,
+  0xbd,0x0a,0x76,0x04,0xaa,0x3b,0x96,0xbe,0x7a,0x9e,0x5a,0xfe,0x3f,0xf0,0xff,0x49,
+  0xb1,0x27,0x6f,0xaa,0xd7,0xf8,0x5d,0xe2,0x76,0x34,0x5c,0xb8,0xb6,0x4a,0xf5,0x09,
+  0x73,0xbd,0x21,0x75,0x3b,0xd5,0x3e,0x4e,0x17,0x93,0xd4,0xab,0xbe,0xa8,0xfa,0xf3,
+  0x57,0x7f,0x04,0x65,0xeb,0xaf,0xe8,0x3b,0xf3,0x6c,0x14,0xa6,0xc1,0x84,0xfc,0xc4,
+  0xba,0xf3,0x7b,0xcf,0x90,0xcb,0xc3,0x4e,0x2b,0x65,0x47,0x1f,0x91,0x0a,0xe4,0x87,
+  0xcb,0xd6,0xef,0x88,0x8f,0xec,0x64,0x7d,0x14,0xf4,0x66,0x1e,0xb2,0x89,0x9f,0x18,
+  0xf3,0x5b,0x34,0xf1,0xf7,0x84,0x23,0x25,0xf2,0x77,0x91,0x75,0x53,0x55,0xec,0x39,
+  0x72,0x78,0xf8,0x62,0xee,0x35,0xb9,0xf6,0x9f,0xd3,0xee,0x1b,0x91,0x3f,0x31,0x5d,
+  0xe5,0xc4,0xd0,0xa5,0xc6,0x99,0xd1,0x83,0x8c,0xbd,0xb7,0x52,0x1c,0x81,0x14,0xaf,
+  0xc4,0x05,0x6a,0x0c,0xd1,0xc3,0x99,0x52,0x6a,0x36,0x87,0x83,0xac,0x92,0x75,0xd9,
+  0x2e,0x71,0x00,0xae,0x8e,0x25,0x4d,0xc0,0x1f,0x41,0x27,0x05,0x57,0x5d,0x58,0x77,
+  0x7e,0xef,0x19,0x7a,0x64,0x96,0x99,0x9b,0xf5,0x8e,0x18,0xeb,0xbd,0x56,0x52,0x61,
+  0xca,0xda,0x3b,0xca,0xac,0xbe,0xd1,0xa5,0xf0,0x42,0x56,0x5a,0xeb,0xb5,0xcc,0xb0,
+  0x8c,0x0c,0x89,0xfb,0x97,0x73,0xe2,0x8d,0x69,0x8e,0x6e,0x49,0x55,0x86,0x37,0x2c,
+  0x9a,0xca,0xbb,0x46,0x16,0xdb,0x7f,0x7c,0x83,0xf6,0x5f,0x6b,0x65,0x67,0xc8,0xd3,
+  0x33,0xbe,0x4e,0x97,0xc7,0xa2,0xb8,0xb7,0x6c,0x82,0x56,0xc8,0xeb,0x8f,0x6c,0xb1,
+  0x92,0xa5,0xa3,0x48,0xcf,0xc2,0x49,0xbd,0x00,0xd0,0x5f,0xba,0xe7,0x15,0x14,0x2f,
+  0x5a,0x7f,0xaf,0x58,0x1e,0x4a,0xbd,0x29,0xc0,0xd3,0x24,0xe9,0x15,0x11,0x9b,0x08,
+  0xd9,0x18,0xf4,0x5a,0x9c,0xd7,0xf7,0x26,0x43,0x85,0x60,0xb4,0xe4,0x01,0x3e,0x6d,
+  0x59,0x2c,0x6e,0x25,0x46,0x1d,0xaf,0xb0,0x8b,0xd9,0xe7,0x04,0x8f,0x9b,0xd7,0xdb,
+  0xa6,0xcd,0xa6,0x28,0xb8,0x58,0x78,0x03,0xb1,0xc3,0x89,0x9b,0x3f,0x2c,0xd2,0x5f,
+  0xee,0xc8,0x7f,0xaf,0x7c,0xb1,0xfd,0x17,0x3f,0xff,0xb1,0x7e,0xf5,0xd7,0x9c,0x48,
+  0x19,0xae,0xd9,0x20,0x64,0xb3,0xe5,0xef,0xfa,0x11,0xa3,0x5b,0xaa,0x56,0x30,0xd4,
+  0x15,0xfb,0xb2,0x13,0x75,0xf1,0x53,0x82,0x05,0xf6,0x65,0xb5,0xf0,0xf9,0x23,0xd9,
+  0xbe,0xe0,0x44,0xd5,0x4b,0x58,0xac,0x14,0xcf,0x6e,0xde,0xe5,0xa7,0x72,0x3c,0xb5,
+  0x54,0xcc,0x29,0x1a,0x13,0x84,0xfd,0x7f,0x28,0x7f,0xbb,0x81,0x14,0x63,0xa6,0xb1,
+  0xc6,0x31,0x3c,0x9b,0x51,0x04,0xad,0xa5,0xfe,0x9c,0xdb,0xd8,0x46,0xfa,0x5a,0xa1,
+  0xe6,0x98,0xf5,0xa6,0xa0,0xec,0xf5,0xc9,0x1a,0xbc,0x02,0x97,0x84,0x79,0xff,0x55,
+  0xc6,0xfe,0x8b,0x3f,0xcb,0x9f,0xff,0xcd,0xcb,0x60,0x7b,0xa9,0x7f,0x8b,0x6b,0x9c,
+  0x9c,0x28,0x19,0x66,0xa3,0x0f,0x0f,0x77,0x78,0xca,0x4c,0xde,0xec,0x7f,0x88,0xc8,
+  0x46,0xc8,0x3e,0xc8,0x88,0x6b,0x6b,0x32,0xe5,0x01,0xa4,0x96,0x50,0x95,0x2d,0x16,
+  0x44,0x2c,0x9a,0x87,0xe8,0xe0,0x8e,0x4e,0x23,0xeb,0xa3,0xe1,0xcd,0xab,0xfe,0xda,
+  0x37,0x33,0x2d,0xce,0x69,0xc0,0xd8,0x90,0xad,0x84,0xa7,0x4b,0x7e,0x7a,0x28,0x42,
+  0x2e,0x6d,0x67,0xd4,0x38,0xe2,0x53,0x19,0xdb,0x3a,0x9e,0x61,0x4e,0x19,0x26,0xe6,
+  0x28,0x18,0x28,0x58,0xba,0x2f,0xc4,0xeb,0x69,0x83,0x9c,0xa6,0x76,0xb8,0xe8,0xf9,
+  0xf3,0x1c,0x1d,0xe5,0x3e,0x37,0xd0,0xff,0x36,0x8f,0x87,0x99,0x08,0xd3,0x7a,0x3c,
+  0x6b,0xf6,0x66,0x72,0x73,0x92,0x9a,0x05,0x3c,0xcc,0x79,0x7c,0x7e,0x79,0x57,0xea,
+  0x0e,0xc4,0x4f,0x55,0xe5,0xef,0x14,0x44,0x2c,0x17,0xa3,0x17,0x70,0xe4,0x6a,0xc0,
+  0xa0,0xc2,0x8a,0x7d,0x67,0xf7,0x19,0x29,0xc5,0xdf,0x85,0xe9,0xe7,0x2a,0xa8,0xe6,
+  0x8e,0xa7,0xd4,0x8a,0x47,0x75,0x86,0xe6,0x99,0x2a,0x55,0x0a,0x95,0x9c,0x67,0xe1,
+  0xea,0x83,0x41,0xe8,0x0f,0x7b,0x93,0x1b,0xe8,0xef,0x2a,0x13,0xf9,0xef,0x2f,0xd2,
+  0x0f,0xf6,0xe7,0xb9,0x5d,0x62,0x3d,0x16,0xbe,0x5f,0xe0,0xee,0xc8,0x9d,0xff,0x75,
+  0xb6,0xe7,0x7a,0xe5,0x4f,0xae,0x2c,0xfe,0x80,0x5e,0xcf,0xbd,0x54,0x18,0x05,0x7b,
+  0xac,0x63,0x34,0xb2,0x3e,0xc8,0x9c,0x9c,0xa8,0x62,0x9a,0x4c,0xe7,0x5a,0x4a,0xf3,
+  0xc6,0x18,0xee,0xdb,0x1b,0x71,0x19,0x6c,0xbd,0x99,0x9b,0xf0,0x55,0x79,0x8c,0x11,
+  0x2f,0x24,0x27,0xa9,0xd3,0x25,0xb0,0x77,0xf3,0x3a,0x5f,0xe4,0xd5,0xef,0x33,0x7f,
+  0xf0,0x6a,0xab,0xd8,0xd6,0x7b,0x65,0xba,0xfc,0xd5,0x1a,0x51,0x3c,0x77,0x9e,0xf2,
+  0xa4,0x24,0x98,0xc8,0xda,0x36,0x33,0xd1,0x9d,0xa8,0xf7,0xc4,0xf8,0x44,0x38,0x0b,
+  0xb7,0x66,0x1f,0x01,0xd1,0x36,0x64,0xf4,0xfe,0xa1,0xec,0xc8,0x25,0xfe,0x92,0x1f,
+  0x2e,0xfa,0xa9,0xa9,0x7c,0xfb,0xcf,0x7e,0xae,0x5b,0xff,0xe9,0x64,0xe4,0x5b,0x7f,
+  0xce,0xc6,0xaf,0xdd,0xe8,0xdc,0x4a,0xe5,0x59,0x5f,0x47,0x6d,0x4f,0xb7,0x6c,0xb9,
+  0x2a,0x5f,0x4f,0x2f,0x3b,0x25,0xae,0x23,0x36,0x92,0xab,0xf0,0xe5,0xc7,0x8f,0xd2,
+  0x87,0x86,0x53,0x36,0xd4,0xf7,0xaf,0xac,0xfb,0x07,0x5a,0xee,0x15,0x52,0x1c,0x4e,
+  0x7c,0x2c,0xb6,0x15,0xfb,0x12,0xa2,0x0b,0x60,0x77,0xe7,0xd7,0xa8,0x2b,0x51,0x79,
+  0xcf,0xf8,0xdb,0xe3,0x02,0xc8,0x99,0x85,0x13,0xe3,0x01,0x29,0x15,0x6f,0x89,0xbf,
+  0xea,0x24,0x46,0xbd,0xb7,0x7a,0xc6,0xac,0xca,0x8f,0x1e,0xc9,0x79,0xcd,0x23,0x4f,
+  0x74,0xc8,0xd3,0xf5,0x22,0xbb,0xa0,0xc0,0xff,0x67,0x26,0x20,0xd6,0x2b,0x7f,0xad,
+  0x79,0xc6,0x72,0x4a,0x89,0x0e,0x87,0x02,0xf6,0x76,0xc7,0x4e,0x4e,0xff,0x94,0xe0,
+  0xb3,0x5b,0x48,0xdb,0xeb,0xe6,0x27,0xd3,0x66,0x4a,0x53,0xd6,0xe3,0x37,0x64,0xfb,
+  0xab,0x5c,0xcd,0x51,0xef,0xc5,0xbc,0xc7,0x9d,0x9b,0x87,0x43,0x6f,0x90,0xef,0x2b,
+  0xcf,0x73,0x9b,0xb4,0xf3,0x55,0xb4,0xe6,0x0a,0x1b,0xb5,0x69,0xa7,0x61,0x6f,0xce,
+  0x2b,0xe7,0xb2,0xc8,0xe6,0x1e,0xba,0xa4,0x8f,0xe9,0x21,0x73,0xaa,0x92,0xa3,0x65,
+  0xe8,0x9e,0x65,0x49,0xab,0xf0,0xd1,0xcc,0xfb,0x63,0x94,0x50,0x37,0xec,0xdb,0xca,
+  0x3d,0xf9,0xd1,0x0a,0x93,0xf1,0x6d,0x1f,0x17,0x4a,0x51,0x99,0xfe,0xdb,0xc0,0xf8,
+  0x37,0x9a,0xba,0xc8,0xd5,0x80,0xc6,0xfb,0xc2,0xc2,0xc1,0xfc,0x37,0x81,0xa4,0x63,
+  0x3a,0x6f,0x9b,0x5e,0xfc,0xc4,0xd6,0xad,0xcc,0xbc,0x92,0xbc,0xfe,0x23,0x4f,0x83,
+  0x71,0x7a,0x4b,0x3e,0x58,0xcf,0x1a,0x2a,0xe2,0x9c,0x9b,0x2d,0x49,0x0f,0x5a,0x54,
+  0x45,0x6c,0x5e,0xf1,0x6b,0x8b,0x7d,0x61,0xae,0xa2,0xa0,0x7a,0xf0,0xc5,0xb5,0xbc,
+  0x3c,0x4e,0xc6,0xaf,0xba,0x33,0xed,0x94,0x55,0x83,0x9c,0xd5,0xaa,0xb2,0xbe,0x8b,
+  0xcc,0x6b,0xba,0xa6,0x1a,0x69,0xce,0x70,0x7b,0xc6,0xbb,0x2a,0x45,0xf4,0xfb,0x7e,
+  0x9c,0x76,0x2a,0x81,0x13,0xc1,0x0b,0xc5,0x8f,0x83,0xcd,0xb2,0x7c,0xfb,0x6f,0x43,
+  0xe3,0xdf,0x66,0xfb,0x3c,0xf3,0x8a,0xc7,0x1f,0x5e,0x26,0x06,0xc7,0x64,0xd9,0xc3,
+  0x69,0x24,0x4b,0x07,0x9c,0xf0,0xe9,0xc4,0xfd,0x32,0xa3,0xf4,0xa5,0x98,0x21,0xb6,
+  0xb7,0x6b,0x7c,0x41,0x9c,0xf6,0x97,0xd3,0xbd,0x51,0x53,0x5e,0xae,0xb9,0x47,0x3f,
+  0xbc,0x2b,0x74,0x12,0xf5,0x0b,0x8f,0x36,0xed,0xeb,0xff,0x3e,0xc8,0x5b,0xca,0xeb,
+  0x37,0xf0,0x6a,0xb1,0x96,0x21,0xac,0xea,0xae,0xdc,0x8d,0x80,0x55,0x59,0x05,0x23,
+  0x69,0xab,0x51,0xb6,0x9b,0x8b,0x3b,0x6c,0xe9,0xa4,0x9f,0x68,0x63,0x6c,0x57,0xea,
+  0x4d,0xc5,0x52,0x9c,0xee,0x76,0x23,0x6a,0x2a,0x3f,0x51,0xcd,0x9d,0x29,0x76,0xb6,
+  0x15,0xcc,0xff,0xda,0xcf,0xf5,0xf5,0xbf,0x52,0x3c,0x1b,0x66,0xa3,0xf3,0x86,0x69,
+  0xec,0xa1,0xe1,0xb2,0x97,0x8f,0x10,0xc4,0x15,0x77,0x91,0xca,0x55,0xf0,0xd8,0xd5,
+  0xac,0x75,0x23,0x8e,0xbb,0x0e,0x88,0x0a,0x5f,0xfc,0x39,0xe9,0xbd,0xaa,0xa9,0xa5,
+  0x86,0x68,0x83,0x3d,0x2c,0x34,0xf2,0xe6,0x64,0x3b,0x36,0x52,0x76,0xdd,0xde,0xbc,
+  0xef,0x1f,0x97,0x8d,0xe1,0x48,0x61,0x65,0x15,0x05,0xf1,0x72,0xbd,0xbe,0xd6,0xaa,
+  0x6a,0xc6,0x0f,0xd9,0xd8,0x71,0x42,0x6f,0xce,0xcf,0x22,0x89,0xa5,0x5d,0x9e,0x75,
+  0x4d,0x06,0x94,0xbc,0x1a,0xec,0xa1,0x6f,0x20,0x97,0xf2,0xce,0x71,0xd3,0xa8,0x3d,
+  0x41,0x8d,0x8b,0xf8,0x7b,0x53,0x9d,0x7e,0xff,0x83,0xa8,0xf5,0xd4,0xb3,0x70,0xeb,
+  0xf3,0xbf,0xac,0xaa,0x41,0x83,0x93,0x84,0xbc,0xe9,0x09,0x9d,0xa8,0xf7,0xd7,0x68,
+  0xe2,0x4b,0x71,0xa4,0x4a,0x17,0x29,0x57,0x32,0x4e,0x43,0xfd,0xc0,0xf0,0x19,0x66,
+  0xa7,0xcb,0x19,0xcd,0x82,0xbe,0x55,0xed,0xd7,0xd4,0xea,0x95,0x62,0xe1,0x49,0xba,
+  0x4c,0xda,0x33,0x6d,0x42,0xb6,0xaf,0xe4,0xc9,0xfe,0xfb,0x8e,0x9c,0xec,0x66,0x74,
+  0x4e,0x33,0x2f,0xe8,0xbf,0xb9,0xe6,0x77,0x17,0xea,0x57,0xdd,0x11,0x2d,0x13,0x1e,
+  0xc8,0x4a,0x88,0x94,0x8d,0x83,0x56,0x88,0xd2,0xeb,0xd5,0x42,0xfe,0x93,0x4b,0xb6,
+  0x37,0x6a,0xca,0xa5,0x83,0xd1,0x19,0xb4,0x0f,0x4a,0x4a,0x58,0x57,0xc2,0x4c,0xe9,
+  0x8b,0x44,0x3d,0xfd,0x97,0x5d,0x54,0xbc,0x3e,0xfd,0xd7,0xd8,0x99,0xf5,0xa9,0xd9,
+  0xcf,0x28,0x55,0xbc,0x7c,0xe6,0xcd,0x2b,0x81,0xd6,0xe2,0x63,0xd4,0x95,0x18,0xb2,
+  0x7f,0xcb,0x59,0x3f,0x2b,0xde,0xab,0x71,0x2f,0xcf,0x44,0xc2,0x42,0x76,0x6c,0xd9,
+  0xa9,0x34,0x31,0xdd,0x47,0x7f,0xc7,0xd6,0xae,0x87,0x88,0xd3,0x76,0xb0,0xb1,0x26,
+  0xab,0xe0,0x5e,0xa1,0x86,0x04,0xaa,0xed,0x58,0x6e,0x6f,0x8f,0x66,0x34,0x53,0xde,
+  0x3f,0xee,0x54,0x85,0xca,0xc5,0x3b,0xc2,0x9e,0xde,0x8a,0x46,0x14,0xd2,0x8f,0x50,
+  0xb8,0x38,0x57,0x6e,0xd4,0xa8,0x1d,0xc9,0xd8,0xf9,0xf8,0x2f,0x2d,0x73,0x79,0x34,
+  0xbc,0x13,0xaf,0x9b,0xe1,0xab,0x53,0x51,0xa6,0x8b,0x09,0x7a,0x5f,0x99,0x5f,0x95,
+  0xaa,0x7f,0x91,0xcd,0xdb,0x27,0x7f,0x92,0x7a,0xc3,0x80,0xab,0x82,0x90,0x6f,0xbd,
+  0xe8,0x0f,0x36,0x5b,0xf4,0x36,0x32,0x76,0xa2,0xd1,0x89,0xdf,0x90,0x8e,0x5f,0x78,
+  0x75,0x41,0x7a,0xf8,0x1d,0x54,0xd3,0xfd,0x21,0x8a,0x6b,0xe5,0xa4,0x6f,0x1c,0xe7,
+  0x4c,0x4f,0x84,0xd5,0x39,0x41,0xae,0x49,0x19,0x1e,0x4d,0xfd,0xdb,0x5e,0x0e,0x31,
+  0xea,0x15,0x72,0x65,0xaf,0x70,0xf7,0xd2,0xe8,0xa7,0x3e,0x9b,0x72,0x6e,0x7b,0x48,
+  0xd5,0x1f,0x1d,0xdc,0x86,0x95,0x9d,0x93,0x8d,0x96,0x7e,0x61,0x67,0x6b,0x75,0xfe,
+  0x25,0x53,0x42,0x01,0x29,0x24,0x53,0x54,0x47,0x36,0x97,0xf8,0xb5,0xdf,0x9b,0x99,
+  0x9a,0x51,0xff,0xcd,0xbf,0xa3,0x45,0x4a,0xcf,0xb5,0xce,0xde,0x49,0x77,0xba,0xfa,
+  0x7f,0xce,0x5f,0xed,0x24,0xae,0x46,0xdf,0xda,0xbf,0x1e,0xe8,0xf6,0xb2,0x3f,0x6c,
+  0xaf,0x8b,0x83,0xc8,0x25,0xd3,0x12,0x13,0xb5,0x2d,0xde,0xd8,0xd7,0x99,0x36,0xea,
+  0xa0,0xba,0xef,0xef,0xde,0x39,0xfb,0xee,0xd8,0x91,0xad,0x69,0x63,0xd4,0x75,0xa5,
+  0x9c,0x3d,0x73,0x39,0xa5,0x6e,0xc4,0x95,0x99,0xe9,0x19,0x72,0xb7,0x13,0xa5,0x39,
+  0x7b,0xf8,0x9d,0x73,0xa4,0x14,0xa6,0xa6,0xbd,0x79,0x0b,0x29,0xaf,0xd2,0x1c,0xab,
+  0x5c,0x0d,0x10,0x7d,0x55,0x10,0xe5,0x4e,0xaf,0x94,0xa6,0x52,0xcf,0x49,0xaf,0xd8,
+  0xc4,0x45,0x27,0x9c,0x4e,0xe9,0xb4,0x13,0xd3,0xb4,0x98,0xa6,0x2e,0x6a,0xc9,0x6a,
+  0x8a,0x6b,0x7f,0xc5,0x42,0x96,0xee,0x24,0xe2,0x46,0xc4,0x59,0xb5,0xff,0xb5,0xf1,
+  0x77,0xcf,0xbe,0x33,0x7a,0xd0,0xfe,0xd5,0x3a,0x75,0xdc,0x5a,0xe0,0x47,0xc7,0x3a,
+  0xcf,0x1b,0xdc,0x5b,0xb6,0x25,0x15,0x1d,0x1b,0x7d,0x9c,0x0c,0x2e,0xf3,0x1e,0x66,
+  0x88,0x83,0xe4,0xbc,0x30,0x2e,0x0a,0x7f,0x8a,0x49,0xfe,0x03,0xab,0xc4,0x3f,0x59,
+  0x1a,0x1a,0xe9,0x20,0x11,0xb9,0x3b,0x25,0x77,0x9b,0xd5,0x17,0x2b,0x05,0x70,0x7d,
+  0x8f,0xad,0x3a,0x7f,0xa4,0xa7,0x8e,0xb6,0xe8,0xcb,0x02,0xce,0xa9,0xc1,0x66,0x17,
+  0x00,0xc7,0xa7,0xd5,0x4e,0x64,0x7f,0xdd,0x5b,0xff,0xfe,0x6a,0x48,0xfe,0xa7,0x2e,
+  0x4e,0xa9,0xf7,0xb8,0x2a,0x13,0xdd,0xcf,0xd9,0x98,0x27,0x7f,0xca,0xf8,0x72,0x05,
+  0xa4,0xff,0x9b,0xbc,0x15,0x94,0x91,0x1d,0x69,0xc6,0x07,0xba,0x30,0x0e,0xfb,0x89,
+  0xab,0x6f,0xad,0x24,0x25,0xc9,0xcc,0xf3,0x4b,0x4e,0x21,0x87,0xc9,0x02,0x79,0x53,
+  0xd0,0x2c,0x32,0x5b,0xf4,0x73,0xef,0xef,0x3c,0xe6,0x5a,0x66,0xea,0x05,0x0e,0x3c,
+  0x8c,0x52,0xa5,0x2f,0x76,0x0d,0x99,0xbb,0x22,0xd2,0x9f,0x7b,0x16,0x72,0x7f,0x29,
+  0xfe,0x7e,0xb2,0x2d,0xa9,0x9e,0x30,0x12,0x8e,0xa0,0x5c,0xf7,0x25,0x86,0x61,0x18,
+  0x95,0x5a,0x74,0x99,0x2a,0x04,0xff,0xfd,0x1a,0x62,0xdc,0xd4,0x92,0x29,0x7a,0x72,
+  0x71,0xb4,0xd8,0x32,0xfe,0x99,0xe9,0xf8,0xac,0x4a,0x24,0x7f,0xfa,0x97,0x26,0xc5,
+  0xe9,0x5a,0xf4,0x23,0xd1,0x99,0xc5,0xd6,0x2c,0xa9,0x89,0xec,0x90,0xd5,0xb6,0x1b,
+  0xf6,0xfc,0xc7,0xab,0x69,0x33,0x20,0xfa,0xfd,0xe9,0x24,0x89,0xb6,0x8e,0x8b,0x15,
+  0x56,0x92,0xda,0xe4,0xdc,0x6e,0x3e,0xe6,0x37,0xaa,0xd3,0x8c,0xa6,0x9a,0x07,0xac,
+  0x68,0xea,0x97,0xc8,0x83,0x89,0x32,0x4e,0x42,0xea,0x75,0x9a,0x8d,0x3e,0x73,0x42,
+  0x68,0xfb,0x4a,0x7b,0x75,0x68,0xaf,0x8a,0x3f,0x83,0xfd,0x51,0x6a,0x94,0x15,0xd0,
+  0xbc,0xba,0x97,0xf5,0xf8,0x36,0x70,0x22,0xf7,0xd6,0x82,0xb1,0x7f,0x4c,0x4d,0x7f,
+  0x70,0xb6,0xf5,0x5d,0xfd,0xdb,0x14,0x9b,0x4b,0xfc,0xda,0xdb,0xb8,0xf3,0x7a,0x98,
+  0x01,0x98,0x6b,0x40,0xd6,0xe3,0xee,0xfe,0x94,0xf1,0x06,0x5e,0xf5,0x46,0x6b,0xab,
+  0xe3,0xce,0x8f,0x42,0x7c,0xc3,0xf9,0x11,0x87,0xb1,0xfc,0x45,0x88,0x8f,0x0f,0xc6,
+  0x0d,0x9f,0x98,0x36,0xe4,0x36,0xce,0x8b,0x40,0xfd,0x2e,0x3a,0xe8,0x1e,0xfc,0xe7,
+  0xbc,0xa5,0x38,0xab,0xa3,0xc4,0x39,0x63,0x8d,0x76,0x9b,0x59,0x4e,0xd2,0x16,0x66,
+  0xf3,0x7a,0xc2,0xd3,0x7f,0xcd,0x49,0x6a,0xcd,0xe7,0x14,0x8d,0x1b,0x77,0xa4,0xf3,
+  0x9d,0x74,0x96,0xfc,0xb0,0x9f,0xba,0xe5,0x9a,0x73,0x7b,0x96,0x5c,0x97,0xd8,0xb9,
+  0xfb,0x6d,0xfe,0x84,0xf8,0xf5,0x80,0xb9,0xc8,0x5b,0x73,0x48,0x7a,0x5c,0x27,0x7b,
+  0xa4,0x6a,0xc3,0xde,0x43,0x79,0xef,0x0a,0xb8,0xef,0x6c,0x33,0xa3,0x5d,0x93,0x07,
+  0xda,0xf3,0xb1,0xf4,0x9f,0x68,0x93,0x32,0x39,0xf6,0x1f,0xae,0x6e,0x8e,0xd3,0x81,
+  0x19,0x2d,0x9c,0x74,0xc4,0xd1,0x01,0x99,0xe1,0x90,0xe2,0xb2,0xf9,0xed,0x64,0xa2,
+  0xdf,0xfc,0x28,0xb2,0x03,0xd7,0xe0,0x27,0x13,0xf9,0x4f,0xe1,0xb5,0x47,0x43,0x77,
+  0xb5,0x57,0x2b,0xa4,0x5b,0xf2,0xc6,0x30,0x24,0x67,0x39,0xf2,0x67,0xc5,0x25,0xe7,
+  0x74,0x96,0x89,0x29,0x75,0x5b,0x9e,0xee,0x7f,0x97,0xfb,0x9c,0xd0,0x16,0x5d,0xe7,
+  0x1c,0xb1,0x3f,0x4f,0x8a,0x58,0x3f,0xf0,0x20,0x1a,0xe3,0xfd,0xae,0x08,0x48,0x12,
+  0x5c,0xdb,0xf4,0x23,0x8e,0xb3,0xfb,0xa2,0x1e,0xc5,0xfd,0x89,0x64,0xe6,0x4f,0x49,
+  0xa4,0xff,0x6c,0xda,0x5d,0x73,0xb2,0x46,0x98,0xfb,0x53,0x40,0xbe,0x21,0x23,0xd0,
+  0xab,0x5e,0xb3,0x5a,0x1d,0xb7,0x15,0x5c,0x16,0x71,0x52,0xce,0x3d,0x4e,0xff,0xb5,
+  0xf5,0x10,0xf7,0xca,0xcf,0x59,0xd5,0x99,0x4e,0x54,0x20,0xbc,0xf1,0x9e,0x51,0x39,
+  0x0f,0xb1,0x1f,0x8e,0x37,0x8a,0x56,0x42,0x8c,0x72,0x5b,0x0d,0x24,0xf9,0x7e,0xda,
+  0x82,0x6c,0x5e,0xe3,0x9c,0x65,0xe5,0xaf,0xa0,0x68,0xbc,0x25,0x26,0x7e,0xe6,0xdc,
+  0x6d,0x8b,0xf4,0x5f,0xc9,0x75,0xde,0x4d,0x9c,0xfe,0xd3,0xbf,0xb1,0x2d,0x1a,0x13,
+  0x03,0x15,0xce,0x42,0xee,0x37,0x24,0xda,0x2c,0x9d,0x0c,0x46,0xe1,0xc3,0x07,0x66,
+  0x57,0x37,0xa9,0xcf,0xd9,0xea,0x3f,0x56,0x10,0x14,0xdb,0x4c,0x49,0x90,0x63,0xff,
+  0xad,0x3d,0xc6,0xd4,0x0c,0xaf,0x90,0x57,0x7e,0xa1,0x5a,0xf7,0x16,0xaa,0x94,0xad,
+  0x39,0x9f,0xd4,0x76,0x72,0x14,0xf0,0x1e,0x36,0x3c,0x7e,0xbb,0xd0,0xc9,0x26,0x47,
+  0x4b,0x66,0x28,0xca,0x73,0x16,0xe4,0xca,0xdf,0x7a,0xb2,0x95,0x8e,0x2e,0x33,0xfe,
+  0x58,0xee,0xe3,0x6b,0xbc,0x5a,0x07,0x3f,0xf7,0x3d,0x9b,0x4a,0x02,0xcf,0xec,0xa9,
+  0x52,0xa1,0x0d,0xdc,0xa8,0x2a,0x70,0xc2,0xa7,0x3e,0xc3,0x2d,0xbc,0x5a,0xfb,0xdb,
+  0x8b,0x9b,0xb1,0xe7,0x8d,0x31,0xf6,0x9f,0x31,0xe5,0x6d,0x3e,0xd8,0x1a,0xbf,0x4f,
+  0x8d,0x7f,0x23,0xfd,0xb7,0xe6,0x98,0x88,0xfd,0x97,0x5c,0x2e,0x45,0xfd,0xfc,0xa1,
+  0xc7,0xe8,0x9a,0x2a,0xe6,0xf0,0xea,0x65,0xd7,0x89,0x85,0x48,0x1b,0x14,0x09,0xa0,
+  0xb1,0xff,0x36,0x90,0x33,0x16,0x8e,0xd3,0x76,0x91,0xd8,0x7f,0x1b,0x2c,0xa0,0x58,
+  0xa5,0x1d,0xf6,0x13,0xb7,0x5c,0x5b,0x4f,0xb1,0xef,0xf7,0x4c,0x1c,0x21,0xb5,0x33,
+  0xe6,0xfa,0xc9,0xa1,0x74,0xf1,0xd0,0x23,0xd3,0x85,0xf7,0xbf,0xf2,0xfe,0x1f,0xe4,
+  0x26,0xfe,0xc1,0xe9,0x6d,0xb1,0x15,0x75,0x17,0x9b,0x6f,0xff,0x29,0xfd,0xb7,0x9e,
+  0xab,0x73,0x7e,0x21,0x49,0x15,0x6e,0x7d,0x6a,0x64,0xb8,0xd7,0x9c,0xa3,0x7f,0xa0,
+  0x35,0x72,0x4a,0x24,0x8e,0x0f,0x35,0x24,0xac,0x6c,0x3f,0x38,0xfe,0x71,0x2b,0x3a,
+  0xb5,0x38,0x67,0xa3,0xe1,0xc6,0x33,0x15,0x8e,0xfb,0xbe,0xec,0x7f,0xba,0xbb,0x32,
+  0x0a,0xd8,0x96,0xf4,0xf8,0xb7,0xb6,0x9e,0x18,0x7e,0x9e,0x32,0xdd,0xa2,0x07,0x5f,
+  0x45,0x7b,0x7e,0xec,0xc0,0x40,0x45,0x97,0x49,0xc0,0xad,0xb3,0x26,0x2a,0xa6,0x64,
+  0x10,0xdc,0xbb,0xeb,0xd8,0x7b,0x0d,0x99,0x7d,0xf4,0x7f,0x33,0xb1,0x4d,0x25,0x38,
+  0xbc,0xab,0x7f,0xbe,0xfe,0x6b,0x8d,0x6b,0xcb,0x64,0xad,0xff,0x32,0xfa,0x4f,0xa3,
+  0x17,0x2e,0x28,0x35,0x38,0x77,0xfa,0xe8,0x33,0xfd,0x55,0x5d,0xa2,0xba,0x78,0x43,
+  0x16,0xf9,0xb7,0x58,0x6d,0x60,0xdf,0x5b,0x33,0xbf,0x17,0x5a,0xed,0x75,0xf8,0xd9,
+  0xc8,0xd1,0xf5,0x24,0xc4,0xff,0xc7,0xc3,0x13,0xbe,0x51,0x31,0x79,0x97,0x65,0xc4,
+  0xc2,0x43,0x7e,0xea,0x96,0x6b,0x6c,0x1d,0x97,0xa7,0xe5,0xcf,0x24,0x4b,0x0a,0xb1,
+  0x38,0x33,0x76,0x60,0x30,0xfa,0x39,0x8a,0xe8,0x59,0xbc,0xb8,0xb0,0x58,0xb5,0x7f,
+  0x68,0xe4,0xf4,0x5c,0x5d,0xc8,0x4e,0xbf,0x6d,0x78,0xdf,0x79,0x66,0xdb,0xc0,0xb6,
+  0x6d,0xd1,0xb6,0xc1,0x8f,0xc1,0x94,0xfd,0x77,0x7a,0xdb,0x7a,0x62,0xc8,0x59,0x90,
+  0xa0,0x23,0x91,0xed,0x96,0x92,0xb0,0x96,0x10,0x37,0x17,0x66,0x4e,0xbf,0x35,0xf2,
+  0xea,0x91,0x91,0x23,0xaf,0xbe,0xf2,0xfa,0xc9,0x73,0x17,0xaf,0xdf,0x16,0x2d,0x3d,
+  0x2d,0x55,0xb4,0xca,0xd9,0x21,0x4f,0xdc,0x45,0xae,0x7e,0xec,0x3f,0xfd,0x2e,0xa6,
+  0xee,0xa2,0x80,0xf4,0xc7,0xc0,0x8f,0x8f,0xf9,0x8a,0xbe,0xb1,0x63,0x3d,0xc5,0xf4,
+  0x72,0xc1,0x93,0x08,0xda,0xfe,0x50,0xa5,0xd4,0xbc,0x7d,0xfd,0xe2,0xb9,0x93,0x47,
+  0x47,0x74,0x29,0x1d,0x79,0xf5,0x57,0xef,0xfe,0x76,0xe1,0xc6,0xb2,0x68,0xe9,0x39,
+  0x3f,0xb1,0x29,0xc7,0xbc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0xe0,0x4f,0xc5,0xff,0x02,0x04,0xc4,0x15,0x0c,0x36,0xb4,
+  0x04,0x00,
diff --git a/board/esd/apc405/strataflash.c b/board/esd/apc405/strataflash.c
deleted file mode 100644 (file)
index ad7a71d..0000000
+++ /dev/null
@@ -1,789 +0,0 @@
-/*
- * (C) Copyright 2002
- * Brad Kemp, Seranoa Networks, Brad.Kemp@seranoa.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/processor.h>
-
-#undef  DEBUG_FLASH
-/*
- * This file implements a Common Flash Interface (CFI) driver for ppcboot.
- * The width of the port and the width of the chips are determined at initialization.
- * These widths are used to calculate the address for access CFI data structures.
- * It has been tested on an Intel Strataflash implementation.
- *
- * References
- * JEDEC Standard JESD68 - Common Flash Interface (CFI)
- * JEDEC Standard JEP137-A Common Flash Interface (CFI) ID Codes
- * Intel Application Note 646 Common Flash Interface (CFI) and Command Sets
- * Intel 290667-008 3 Volt Intel StrataFlash Memory datasheet
- *
- * TODO
- * Use Primary Extended Query table (PRI) and Alternate Algorithm Query Table (ALT) to determine if protection is available
- * Add support for other command sets Use the PRI and ALT to determine command set
- * Verify erase and program timeouts.
- */
-
-#define FLASH_CMD_CFI                  0x98
-#define FLASH_CMD_READ_ID              0x90
-#define FLASH_CMD_RESET                        0xff
-#define FLASH_CMD_BLOCK_ERASE          0x20
-#define FLASH_CMD_ERASE_CONFIRM                0xD0
-#define FLASH_CMD_WRITE                        0x40
-#define FLASH_CMD_PROTECT              0x60
-#define FLASH_CMD_PROTECT_SET          0x01
-#define FLASH_CMD_PROTECT_CLEAR                0xD0
-#define FLASH_CMD_CLEAR_STATUS         0x50
-#define FLASH_CMD_WRITE_TO_BUFFER       0xE8
-#define FLASH_CMD_WRITE_BUFFER_CONFIRM  0xD0
-
-#define FLASH_STATUS_DONE              0x80
-#define FLASH_STATUS_ESS               0x40
-#define FLASH_STATUS_ECLBS             0x20
-#define FLASH_STATUS_PSLBS             0x10
-#define FLASH_STATUS_VPENS             0x08
-#define FLASH_STATUS_PSS               0x04
-#define FLASH_STATUS_DPS               0x02
-#define FLASH_STATUS_R                 0x01
-#define FLASH_STATUS_PROTECT           0x01
-
-#define FLASH_OFFSET_CFI               0x55
-#define FLASH_OFFSET_CFI_RESP          0x10
-#define FLASH_OFFSET_WTOUT             0x1F
-#define FLASH_OFFSET_WBTOUT             0x20
-#define FLASH_OFFSET_ETOUT             0x21
-#define FLASH_OFFSET_CETOUT             0x22
-#define FLASH_OFFSET_WMAX_TOUT         0x23
-#define FLASH_OFFSET_WBMAX_TOUT         0x24
-#define FLASH_OFFSET_EMAX_TOUT         0x25
-#define FLASH_OFFSET_CEMAX_TOUT         0x26
-#define FLASH_OFFSET_SIZE              0x27
-#define FLASH_OFFSET_INTERFACE          0x28
-#define FLASH_OFFSET_BUFFER_SIZE        0x2A
-#define FLASH_OFFSET_NUM_ERASE_REGIONS 0x2C
-#define FLASH_OFFSET_ERASE_REGIONS     0x2D
-#define FLASH_OFFSET_PROTECT           0x02
-#define FLASH_OFFSET_USER_PROTECTION    0x85
-#define FLASH_OFFSET_INTEL_PROTECTION   0x81
-
-#define FLASH_MAN_CFI                  0x01000000
-
-typedef union {
-       unsigned char c;
-       unsigned short w;
-       unsigned long l;
-} cfiword_t;
-
-typedef union {
-       unsigned char * cp;
-       unsigned short *wp;
-       unsigned long *lp;
-} cfiptr_t;
-
-#define NUM_ERASE_REGIONS 4
-
-flash_info_t   flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips        */
-
-/*-----------------------------------------------------------------------
- * Functions
- */
-
-static void flash_add_byte(flash_info_t *info, cfiword_t * cword, uchar c);
-static void flash_make_cmd(flash_info_t * info, uchar cmd, void * cmdbuf);
-static void flash_write_cmd(flash_info_t * info, int sect, uchar offset, uchar cmd);
-static int flash_isequal(flash_info_t * info, int sect, uchar offset, uchar cmd);
-static int flash_isset(flash_info_t * info, int sect, uchar offset, uchar cmd);
-static int flash_detect_cfi(flash_info_t * info);
-static ulong flash_get_size (ulong base, int banknum);
-static int flash_write_cfiword (flash_info_t *info, ulong dest, cfiword_t cword);
-static int flash_full_status_check(flash_info_t * info, ulong sector, ulong tout, char * prompt);
-#ifdef CFG_FLASH_USE_BUFFER_WRITE
-static int flash_write_cfibuffer(flash_info_t * info, ulong dest, uchar * cp, int len);
-#endif
-/*-----------------------------------------------------------------------
- * create an address based on the offset and the port width
- */
-inline uchar * flash_make_addr(flash_info_t * info, int sect, int offset)
-{
-       return ((uchar *)(info->start[sect] + (offset * info->portwidth)));
-}
-/*-----------------------------------------------------------------------
- * read a character at a port width address
- */
-inline uchar flash_read_uchar(flash_info_t * info, uchar offset)
-{
-       uchar *cp;
-       cp = flash_make_addr(info, 0, offset);
-       return (cp[info->portwidth - 1]);
-}
-
-/*-----------------------------------------------------------------------
- * read a short word by swapping for ppc format.
- */
-ushort flash_read_ushort(flash_info_t * info, int sect,  uchar offset)
-{
-    uchar * addr;
-
-    addr = flash_make_addr(info, sect, offset);
-    return ((addr[(2*info->portwidth) - 1] << 8) | addr[info->portwidth - 1]);
-
-}
-
-/*-----------------------------------------------------------------------
- * read a long word by picking the least significant byte of each maiximum
- * port size word. Swap for ppc format.
- */
-ulong flash_read_long(flash_info_t * info, int sect,  uchar offset)
-{
-    uchar * addr;
-
-    addr = flash_make_addr(info, sect, offset);
-    return ( (addr[(2*info->portwidth) - 1] << 24 ) | (addr[(info->portwidth) -1] << 16) |
-           (addr[(4*info->portwidth) - 1] << 8) | addr[(3*info->portwidth) - 1]);
-
-}
-
-/*-----------------------------------------------------------------------
- */
-unsigned long flash_init (void)
-{
-       unsigned long size;
-       int i;
-       unsigned long  address;
-
-
-       /* The flash is positioned back to back, with the demultiplexing of the chip
-        * based on the A24 address line.
-        *
-        */
-
-       address = CFG_FLASH_BASE;
-       size = 0;
-
-       /* Init: no FLASHes known */
-       for (i=0; i<CFG_MAX_FLASH_BANKS; ++i) {
-               flash_info[i].flash_id = FLASH_UNKNOWN;
-               size += flash_info[i].size = flash_get_size(address, i);
-               address += CFG_FLASH_INCREMENT;
-               if (flash_info[0].flash_id == FLASH_UNKNOWN) {
-                       printf ("## Unknown FLASH on Bank %d - Size = 0x%08lx = %ld MB\n",i,
-                               flash_info[0].size, flash_info[i].size<<20);
-               }
-       }
-
-#if 0 /* test-only */
-       /* Monitor protection ON by default */
-#if (CFG_MONITOR_BASE >= CFG_FLASH_BASE)
-       for(i=0; flash_info[0].start[i] < CFG_MONITOR_BASE+CFG_MONITOR_LEN-1; i++)
-               (void)flash_real_protect(&flash_info[0], i, 1);
-#endif
-#else
-       /* monitor protection ON by default */
-       flash_protect (FLAG_PROTECT_SET,
-                      - CFG_MONITOR_LEN,
-                      - 1, &flash_info[1]);
-#endif
-
-       return (size);
-}
-
-/*-----------------------------------------------------------------------
- */
-int flash_erase (flash_info_t *info, int s_first, int s_last)
-{
-       int rcode = 0;
-       int prot;
-       int sect;
-
-       if( info->flash_id != FLASH_MAN_CFI) {
-               printf ("Can't erase unknown flash type - aborted\n");
-               return 1;
-       }
-       if ((s_first < 0) || (s_first > s_last)) {
-               printf ("- no sectors to erase\n");
-               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");
-       }
-
-
-       for (sect = s_first; sect<=s_last; sect++) {
-               if (info->protect[sect] == 0) { /* not protected */
-                       flash_write_cmd(info, sect, 0, FLASH_CMD_CLEAR_STATUS);
-                       flash_write_cmd(info, sect, 0, FLASH_CMD_BLOCK_ERASE);
-                       flash_write_cmd(info, sect, 0, FLASH_CMD_ERASE_CONFIRM);
-
-                       if(flash_full_status_check(info, sect, info->erase_blk_tout, "erase")) {
-                               rcode = 1;
-                       } else
-                               printf(".");
-               }
-       }
-       printf (" done\n");
-       return rcode;
-}
-
-/*-----------------------------------------------------------------------
- */
-void flash_print_info  (flash_info_t *info)
-{
-       int i;
-
-       if (info->flash_id != FLASH_MAN_CFI) {
-               printf ("missing or unknown FLASH type\n");
-               return;
-       }
-
-       printf("CFI conformant FLASH (%d x %d)",
-              (info->portwidth  << 3 ), (info->chipwidth  << 3 ));
-       printf ("  Size: %ld MB in %d Sectors\n",
-               info->size >> 20, info->sector_count);
-       printf(" Erase timeout %ld ms, write timeout %ld ms, buffer write timeout %ld ms, buffer size %d\n",
-              info->erase_blk_tout, info->write_tout, info->buffer_write_tout, info->buffer_size);
-
-       printf ("  Sector Start Addresses:");
-       for (i=0; i<info->sector_count; ++i) {
-#ifdef CFG_FLASH_EMPTY_INFO
-               int k;
-               int size;
-               int erased;
-               volatile unsigned long *flash;
-
-               /*
-                * Check if whole sector is erased
-                */
-               if (i != (info->sector_count-1))
-                 size = info->start[i+1] - info->start[i];
-               else
-                 size = info->start[0] + info->size - info->start[i];
-               erased = 1;
-               flash = (volatile unsigned long *)info->start[i];
-               size = size >> 2;        /* divide by 4 for longword access */
-               for (k=0; k<size; k++)
-                 {
-                   if (*flash++ != 0xffffffff)
-                     {
-                       erased = 0;
-                       break;
-                     }
-                 }
-
-               if ((i % 5) == 0)
-                       printf ("\n   ");
-               /* print empty and read-only info */
-               printf (" %08lX%s%s",
-                       info->start[i],
-                       erased ? " E" : "  ",
-                       info->protect[i] ? "RO " : "   ");
-#else
-               if ((i % 5) == 0)
-                       printf ("\n   ");
-               printf (" %08lX%s",
-                       info->start[i],
-                       info->protect[i] ? " (RO)" : "     ");
-#endif
-       }
-       printf ("\n");
-       return;
-}
-
-/*-----------------------------------------------------------------------
- * 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)
-{
-       ulong wp;
-       ulong cp;
-       int aln;
-       cfiword_t cword;
-       int i, rc;
-
-       /* get lower aligned address */
-       wp = (addr & ~(info->portwidth - 1));
-
-       /* handle unaligned start */
-       if((aln = addr - wp) != 0) {
-               cword.l = 0;
-               cp = wp;
-               for(i=0;i<aln; ++i, ++cp)
-                       flash_add_byte(info, &cword, (*(uchar *)cp));
-
-               for(; (i< info->portwidth) && (cnt > 0) ; i++) {
-                       flash_add_byte(info, &cword, *src++);
-                       cnt--;
-                       cp++;
-               }
-               for(; (cnt == 0) && (i < info->portwidth); ++i, ++cp)
-                       flash_add_byte(info, &cword, (*(uchar *)cp));
-               if((rc = flash_write_cfiword(info, wp, cword)) != 0)
-                       return rc;
-               wp = cp;
-       }
-
-#ifdef CFG_FLASH_USE_BUFFER_WRITE
-       while(cnt >= info->portwidth) {
-               i = info->buffer_size > cnt? cnt: info->buffer_size;
-               if((rc = flash_write_cfibuffer(info, wp, src,i)) != ERR_OK)
-                       return rc;
-               wp += i;
-               src += i;
-               cnt -=i;
-       }
-#else
-       /* handle the aligned part */
-       while(cnt >= info->portwidth) {
-               cword.l = 0;
-               for(i = 0; i < info->portwidth; i++) {
-                       flash_add_byte(info, &cword, *src++);
-               }
-               if((rc = flash_write_cfiword(info, wp, cword)) != 0)
-                       return rc;
-               wp += info->portwidth;
-               cnt -= info->portwidth;
-       }
-#endif /* CFG_FLASH_USE_BUFFER_WRITE */
-       if (cnt == 0) {
-               return (0);
-       }
-
-       /*
-        * handle unaligned tail bytes
-        */
-       cword.l = 0;
-       for (i=0, cp=wp; (i<info->portwidth) && (cnt>0); ++i, ++cp) {
-               flash_add_byte(info, &cword, *src++);
-               --cnt;
-       }
-       for (; i<info->portwidth; ++i, ++cp) {
-               flash_add_byte(info, & cword, (*(uchar *)cp));
-       }
-
-       return flash_write_cfiword(info, wp, cword);
-}
-
-/*-----------------------------------------------------------------------
- */
-int flash_real_protect(flash_info_t *info, long sector, int prot)
-{
-       int retcode = 0;
-
-       flash_write_cmd(info, sector, 0, FLASH_CMD_CLEAR_STATUS);
-       flash_write_cmd(info, sector, 0, FLASH_CMD_PROTECT);
-       if(prot)
-               flash_write_cmd(info, sector, 0, FLASH_CMD_PROTECT_SET);
-       else
-               flash_write_cmd(info, sector, 0, FLASH_CMD_PROTECT_CLEAR);
-
-       if((retcode = flash_full_status_check(info, sector, info->erase_blk_tout,
-                                        prot?"protect":"unprotect")) == 0) {
-
-               info->protect[sector] = prot;
-               /* Intel's unprotect unprotects all locking */
-               if(prot == 0) {
-                       int i;
-                       for(i = 0 ; i<info->sector_count; i++) {
-                               if(info->protect[i])
-                                       flash_real_protect(info, i, 1);
-                       }
-               }
-       }
-
-       return retcode;
-}
-/*-----------------------------------------------------------------------
- *  wait for XSR.7 to be set. Time out with an error if it does not.
- *  This routine does not set the flash to read-array mode.
- */
-static int flash_status_check(flash_info_t * info, ulong sector, ulong tout, char * prompt)
-{
-       ulong start;
-
-       /* Wait for command completion */
-       start = get_timer (0);
-       while(!flash_isset(info, sector, 0, FLASH_STATUS_DONE)) {
-               if (get_timer(start) > info->erase_blk_tout) {
-                       printf("Flash %s timeout at address %lx\n", prompt, info->start[sector]);
-                       flash_write_cmd(info, sector, 0, FLASH_CMD_RESET);
-                       return ERR_TIMOUT;
-               }
-       }
-       return ERR_OK;
-}
-/*-----------------------------------------------------------------------
- * Wait for XSR.7 to be set, if it times out print an error, otherwise do a full status check.
- * This routine sets the flash to read-array mode.
- */
-static int flash_full_status_check(flash_info_t * info, ulong sector, ulong tout, char * prompt)
-{
-       int retcode;
-       retcode = flash_status_check(info, sector, tout, prompt);
-       if((retcode == ERR_OK) && !flash_isequal(info,sector, 0, FLASH_STATUS_DONE)) {
-               retcode = ERR_INVAL;
-               printf("Flash %s error at address %lx\n", prompt,info->start[sector]);
-               if(flash_isset(info, sector, 0, FLASH_STATUS_ECLBS | FLASH_STATUS_PSLBS)){
-                       printf("Command Sequence Error.\n");
-               } else if(flash_isset(info, sector, 0, FLASH_STATUS_ECLBS)){
-                       printf("Block Erase Error.\n");
-                       retcode = ERR_NOT_ERASED;
-               } else if (flash_isset(info, sector, 0, FLASH_STATUS_PSLBS)) {
-                       printf("Locking Error\n");
-               }
-               if(flash_isset(info, sector, 0, FLASH_STATUS_DPS)){
-                       printf("Block locked.\n");
-                       retcode = ERR_PROTECTED;
-               }
-               if(flash_isset(info, sector, 0, FLASH_STATUS_VPENS))
-                       printf("Vpp Low Error.\n");
-       }
-       flash_write_cmd(info, sector, 0, FLASH_CMD_RESET);
-       return retcode;
-}
-/*-----------------------------------------------------------------------
- */
-static void flash_add_byte(flash_info_t *info, cfiword_t * cword, uchar c)
-{
-       switch(info->portwidth) {
-       case FLASH_CFI_8BIT:
-               cword->c = c;
-               break;
-       case FLASH_CFI_16BIT:
-               cword->w = (cword->w << 8) | c;
-               break;
-       case FLASH_CFI_32BIT:
-               cword->l = (cword->l << 8) | c;
-       }
-}
-
-
-/*-----------------------------------------------------------------------
- * make a proper sized command based on the port and chip widths
- */
-static void flash_make_cmd(flash_info_t * info, uchar cmd, void * cmdbuf)
-{
-       int i;
-       uchar *cp = (uchar *)cmdbuf;
-       for(i=0; i< info->portwidth; i++)
-               *cp++ = ((i+1) % info->chipwidth) ? '\0':cmd;
-}
-
-/*
- * Write a proper sized command to the correct address
- */
-static void flash_write_cmd(flash_info_t * info, int sect, uchar offset, uchar cmd)
-{
-
-       volatile cfiptr_t addr;
-       cfiword_t cword;
-       addr.cp = flash_make_addr(info, sect, offset);
-       flash_make_cmd(info, cmd, &cword);
-       switch(info->portwidth) {
-       case FLASH_CFI_8BIT:
-               *addr.cp = cword.c;
-               break;
-       case FLASH_CFI_16BIT:
-               *addr.wp = cword.w;
-               break;
-       case FLASH_CFI_32BIT:
-               *addr.lp = cword.l;
-               break;
-       }
-}
-
-/*-----------------------------------------------------------------------
- */
-static int flash_isequal(flash_info_t * info, int sect, uchar offset, uchar cmd)
-{
-       cfiptr_t cptr;
-       cfiword_t cword;
-       int retval;
-       cptr.cp = flash_make_addr(info, sect, offset);
-       flash_make_cmd(info, cmd, &cword);
-       switch(info->portwidth) {
-       case FLASH_CFI_8BIT:
-               retval = (cptr.cp[0] == cword.c);
-               break;
-       case FLASH_CFI_16BIT:
-               retval = (cptr.wp[0] == cword.w);
-               break;
-       case FLASH_CFI_32BIT:
-               retval = (cptr.lp[0] == cword.l);
-               break;
-       default:
-               retval = 0;
-               break;
-       }
-       return retval;
-}
-/*-----------------------------------------------------------------------
- */
-static int flash_isset(flash_info_t * info, int sect, uchar offset, uchar cmd)
-{
-       cfiptr_t cptr;
-       cfiword_t cword;
-       int retval;
-       cptr.cp = flash_make_addr(info, sect, offset);
-       flash_make_cmd(info, cmd, &cword);
-       switch(info->portwidth) {
-       case FLASH_CFI_8BIT:
-               retval = ((cptr.cp[0] & cword.c) == cword.c);
-               break;
-       case FLASH_CFI_16BIT:
-               retval = ((cptr.wp[0] & cword.w) == cword.w);
-               break;
-       case FLASH_CFI_32BIT:
-               retval = ((cptr.lp[0] & cword.l) == cword.l);
-               break;
-       default:
-               retval = 0;
-               break;
-       }
-       return retval;
-}
-
-/*-----------------------------------------------------------------------
- * detect if flash is compatible with the Common Flash Interface (CFI)
- * http://www.jedec.org/download/search/jesd68.pdf
- *
-*/
-static int flash_detect_cfi(flash_info_t * info)
-{
-
-       for(info->portwidth=FLASH_CFI_8BIT; info->portwidth <= FLASH_CFI_32BIT;
-           info->portwidth <<= 1) {
-               for(info->chipwidth =FLASH_CFI_BY8;
-                   info->chipwidth <= info->portwidth;
-                   info->chipwidth <<= 1) {
-                       flash_write_cmd(info, 0, 0, FLASH_CMD_RESET);
-                       flash_write_cmd(info, 0, FLASH_OFFSET_CFI, FLASH_CMD_CFI);
-                       if(flash_isequal(info, 0, FLASH_OFFSET_CFI_RESP,'Q') &&
-                          flash_isequal(info, 0, FLASH_OFFSET_CFI_RESP + 1, 'R') &&
-                          flash_isequal(info, 0, FLASH_OFFSET_CFI_RESP + 2, 'Y'))
-                               return 1;
-               }
-       }
-       return 0;
-}
-/*
- * The following code cannot be run from FLASH!
- *
- */
-static ulong flash_get_size (ulong base, int banknum)
-{
-       flash_info_t * info = &flash_info[banknum];
-       int i, j;
-       int sect_cnt;
-       unsigned long sector;
-       unsigned long tmp;
-       int size_ratio;
-       uchar num_erase_regions;
-       int  erase_region_size;
-       int  erase_region_count;
-
-       info->start[0] = base;
-
-       if(flash_detect_cfi(info)){
-#ifdef DEBUG_FLASH
-               printf("portwidth=%d chipwidth=%d\n", info->portwidth, info->chipwidth); /* test-only */
-#endif
-               size_ratio = info->portwidth / info->chipwidth;
-               num_erase_regions = flash_read_uchar(info, FLASH_OFFSET_NUM_ERASE_REGIONS);
-#ifdef DEBUG_FLASH
-               printf("found %d erase regions\n", num_erase_regions);
-#endif
-               sect_cnt = 0;
-               sector = base;
-               for(i = 0 ; i < num_erase_regions; i++) {
-                       if(i > NUM_ERASE_REGIONS) {
-                               printf("%d erase regions found, only %d used\n",
-                                      num_erase_regions, NUM_ERASE_REGIONS);
-                               break;
-                       }
-                       tmp = flash_read_long(info, 0, FLASH_OFFSET_ERASE_REGIONS);
-                       erase_region_size = (tmp & 0xffff)? ((tmp & 0xffff) * 256): 128;
-                       tmp >>= 16;
-                       erase_region_count = (tmp & 0xffff) +1;
-                       for(j = 0; j< erase_region_count; j++) {
-                               info->start[sect_cnt] = sector;
-                               sector += (erase_region_size * size_ratio);
-                               info->protect[sect_cnt] = flash_isset(info, sect_cnt, FLASH_OFFSET_PROTECT, FLASH_STATUS_PROTECT);
-                               sect_cnt++;
-                       }
-               }
-
-               info->sector_count = sect_cnt;
-               /* multiply the size by the number of chips */
-               info->size = (1 << flash_read_uchar(info, FLASH_OFFSET_SIZE)) * size_ratio;
-               info->buffer_size = (1 << flash_read_ushort(info, 0, FLASH_OFFSET_BUFFER_SIZE));
-               tmp = 1 << flash_read_uchar(info, FLASH_OFFSET_ETOUT);
-               info->erase_blk_tout = (tmp * (1 << flash_read_uchar(info, FLASH_OFFSET_EMAX_TOUT)));
-               tmp = 1 << flash_read_uchar(info, FLASH_OFFSET_WBTOUT);
-               info->buffer_write_tout = (tmp * (1 << flash_read_uchar(info, FLASH_OFFSET_WBMAX_TOUT)));
-               tmp = 1 << flash_read_uchar(info, FLASH_OFFSET_WTOUT);
-               info->write_tout = (tmp * (1 << flash_read_uchar(info, FLASH_OFFSET_WMAX_TOUT)))/ 1000;
-               info->flash_id = FLASH_MAN_CFI;
-       }
-
-       flash_write_cmd(info, 0, 0, FLASH_CMD_RESET);
-       return(info->size);
-}
-
-
-/*-----------------------------------------------------------------------
- */
-static int flash_write_cfiword (flash_info_t *info, ulong dest, cfiword_t cword)
-{
-
-       cfiptr_t ctladdr;
-       cfiptr_t cptr;
-       int flag;
-
-       ctladdr.cp = flash_make_addr(info, 0, 0);
-       cptr.cp = (uchar *)dest;
-
-
-       /* Check if Flash is (sufficiently) erased */
-       switch(info->portwidth) {
-       case FLASH_CFI_8BIT:
-               flag = ((cptr.cp[0] & cword.c) == cword.c);
-               break;
-       case FLASH_CFI_16BIT:
-               flag = ((cptr.wp[0] & cword.w) == cword.w);
-               break;
-       case FLASH_CFI_32BIT:
-               flag = ((cptr.lp[0] & cword.l)  == cword.l);
-               break;
-       default:
-               return 2;
-       }
-       if(!flag)
-               return 2;
-
-       /* Disable interrupts which might cause a timeout here */
-       flag = disable_interrupts();
-
-       flash_write_cmd(info, 0, 0, FLASH_CMD_CLEAR_STATUS);
-       flash_write_cmd(info, 0, 0, FLASH_CMD_WRITE);
-
-       switch(info->portwidth) {
-       case FLASH_CFI_8BIT:
-               cptr.cp[0] = cword.c;
-               break;
-       case FLASH_CFI_16BIT:
-               cptr.wp[0] = cword.w;
-               break;
-       case FLASH_CFI_32BIT:
-               cptr.lp[0] = cword.l;
-               break;
-       }
-
-       /* re-enable interrupts if necessary */
-       if(flag)
-               enable_interrupts();
-
-       return flash_full_status_check(info, 0, info->write_tout, "write");
-}
-
-#ifdef CFG_FLASH_USE_BUFFER_WRITE
-
-/* loop through the sectors from the highest address
- * when the passed address is greater or equal to the sector address
- * we have a match
- */
-static int find_sector(flash_info_t *info, ulong addr)
-{
-       int sector;
-       for(sector = info->sector_count - 1; sector >= 0; sector--) {
-               if(addr >= info->start[sector])
-                       break;
-       }
-       return sector;
-}
-
-static int flash_write_cfibuffer(flash_info_t * info, ulong dest, uchar * cp, int len)
-{
-
-       int sector;
-       int cnt;
-       int retcode;
-       volatile cfiptr_t src;
-       volatile cfiptr_t dst;
-
-       src.cp = cp;
-       dst.cp = (uchar *)dest;
-       sector = find_sector(info, dest);
-       flash_write_cmd(info, sector, 0, FLASH_CMD_CLEAR_STATUS);
-       flash_write_cmd(info, sector, 0, FLASH_CMD_WRITE_TO_BUFFER);
-       if((retcode = flash_status_check(info, sector, info->buffer_write_tout,
-                                        "write to buffer")) == ERR_OK) {
-               switch(info->portwidth) {
-               case FLASH_CFI_8BIT:
-                       cnt = len;
-                       break;
-               case FLASH_CFI_16BIT:
-                       cnt = len >> 1;
-                       break;
-               case FLASH_CFI_32BIT:
-                       cnt = len >> 2;
-                       break;
-               default:
-                       return ERR_INVAL;
-                       break;
-               }
-               flash_write_cmd(info, sector, 0, (uchar)cnt-1);
-               while(cnt-- > 0) {
-                       switch(info->portwidth) {
-                       case FLASH_CFI_8BIT:
-                               *dst.cp++ = *src.cp++;
-                               break;
-                       case FLASH_CFI_16BIT:
-                               *dst.wp++ = *src.wp++;
-                               break;
-                       case FLASH_CFI_32BIT:
-                               *dst.lp++ = *src.lp++;
-                               break;
-                       default:
-                               return ERR_INVAL;
-                               break;
-                       }
-               }
-               flash_write_cmd(info, sector, 0, FLASH_CMD_WRITE_BUFFER_CONFIRM);
-               retcode = flash_full_status_check(info, sector, info->buffer_write_tout,
-                                            "buffer write");
-       }
-       flash_write_cmd(info, sector, 0, FLASH_CMD_CLEAR_STATUS);
-       return retcode;
-}
-#endif /* CFG_USE_FLASH_BUFFER_WRITE */
index 9dad748..f5daaef 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index ec1c2a0..f4b5e3a 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index bea9524..1c5d891 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index cf37735..07e8110 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 9dad748..f5daaef 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index a76b00f..7e6eea0 100644 (file)
 extern au_image_t au_image[];
 extern int N_AU_IMAGES;
 
-#define AU_DEBUG
-#undef AU_DEBUG
-
-#undef debug
-#ifdef AU_DEBUG
-#define debug(fmt,args...)     printf (fmt ,##args)
-#else
-#define debug(fmt,args...)
-#endif /* AU_DEBUG */
-
-
-#define LOAD_ADDR ((unsigned char *)0x100000)   /* where to load files into memory */
-#define MAX_LOADSZ 0x1e00000
+/* where to load files into memory */
+#define LOAD_ADDR ((unsigned char *)0x100000)
+#define MAX_LOADSZ 0x1c00000
 
 /* externals */
 extern int fat_register_device(block_dev_desc_t *, int);
 extern int file_fat_detectfs(void);
 extern long file_fat_read(const char *, void *, unsigned long);
-long do_fat_read (const char *filename, void *buffer, unsigned long maxsize, int dols);
-#ifdef CONFIG_VFD
-extern int trab_vfd (ulong);
-extern int transfer_pic(unsigned char, unsigned char *, int, int);
-#endif
+long do_fat_read (const char *filename, void *buffer,
+                 unsigned long maxsize, int dols);
 extern int flash_sect_erase(ulong, ulong);
 extern int flash_sect_protect (int, ulong, ulong);
 extern int flash_write (char *, ulong, ulong);
@@ -78,105 +65,91 @@ extern int flash_write (char *, ulong, ulong);
 #define NANDRW_JFFS2   0x02
 #define NANDRW_JFFS2_SKIP      0x04
 extern struct nand_chip nand_dev_desc[];
-extern int nand_legacy_rw(struct nand_chip* nand, int cmd, size_t start, size_t len,
-                  size_t * retlen, u_char * buf);
-extern int nand_legacy_erase(struct nand_chip* nand, size_t ofs, size_t len, int clean);
+extern int nand_legacy_rw(struct nand_chip* nand, int cmd,
+                         size_t start, size_t len,
+                         size_t * retlen, u_char * buf);
+extern int nand_legacy_erase(struct nand_chip* nand, size_t ofs,
+                            size_t len, int clean);
 #endif
 
 extern block_dev_desc_t ide_dev_desc[CFG_IDE_MAXDEVICE];
 
-
 int au_check_cksum_valid(int i, long nbytes)
 {
        image_header_t *hdr;
-       unsigned long checksum;
 
        hdr = (image_header_t *)LOAD_ADDR;
+#if defined(CONFIG_FIT)
+       if (genimg_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+               puts ("Non legacy image format not supported\n");
+               return -1;
+       }
+#endif
 
-       if ((au_image[i].type == AU_FIRMWARE) && (au_image[i].size != ntohl(hdr->ih_size))) {
+       if ((au_image[i].type == AU_FIRMWARE) &&
+           (au_image[i].size != image_get_data_size (hdr))) {
                printf ("Image %s has wrong size\n", au_image[i].name);
                return -1;
        }
 
-       if (nbytes != (sizeof(*hdr) + ntohl(hdr->ih_size))) {
+       if (nbytes != (image_get_image_size (hdr))) {
                printf ("Image %s bad total SIZE\n", au_image[i].name);
                return -1;
        }
-       /* check the data CRC */
-       checksum = ntohl(hdr->ih_dcrc);
 
-       if (crc32 (0, (uchar *)(LOAD_ADDR + sizeof(*hdr)), ntohl(hdr->ih_size))
-               != checksum) {
+       /* check the data CRC */
+       if (!image_check_dcrc (hdr)) {
                printf ("Image %s bad data checksum\n", au_image[i].name);
                return -1;
        }
        return 0;
 }
 
-
 int au_check_header_valid(int i, long nbytes)
 {
        image_header_t *hdr;
        unsigned long checksum;
 
        hdr = (image_header_t *)LOAD_ADDR;
-       /* check the easy ones first */
-#undef CHECK_VALID_DEBUG
-#ifdef CHECK_VALID_DEBUG
-       printf("magic %#x %#x ", ntohl(hdr->ih_magic), IH_MAGIC);
-       printf("arch %#x %#x ", hdr->ih_arch, IH_CPU_PPC);
-       printf("size %#x %#lx ", ntohl(hdr->ih_size), nbytes);
-       printf("type %#x %#x ", hdr->ih_type, IH_TYPE_KERNEL);
+#if defined(CONFIG_FIT)
+       if (genimg_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+               puts ("Non legacy image format not supported\n");
+               return -1;
+       }
 #endif
-       if (nbytes < sizeof(*hdr))
-       {
+
+       /* check the easy ones first */
+       if (nbytes < image_get_header_size ()) {
                printf ("Image %s bad header SIZE\n", au_image[i].name);
                return -1;
        }
-       if (ntohl(hdr->ih_magic) != IH_MAGIC || hdr->ih_arch != IH_CPU_PPC)
-       {
+       if (!image_check_magic (hdr) || !image_check_arch (hdr, IH_ARCH_PPC)) {
                printf ("Image %s bad MAGIC or ARCH\n", au_image[i].name);
                return -1;
        }
-       /* check the hdr CRC */
-       checksum = ntohl(hdr->ih_hcrc);
-       hdr->ih_hcrc = 0;
-
-       if (crc32 (0, (uchar *)hdr, sizeof(*hdr)) != checksum) {
+       if (!image_check_hcrc (hdr)) {
                printf ("Image %s bad header checksum\n", au_image[i].name);
                return -1;
        }
-       hdr->ih_hcrc = htonl(checksum);
 
        /* check the type - could do this all in one gigantic if() */
-       if ((au_image[i].type == AU_FIRMWARE) && (hdr->ih_type != IH_TYPE_FIRMWARE)) {
+       if (((au_image[i].type & AU_TYPEMASK) == AU_FIRMWARE) &&
+           !image_check_type (hdr, IH_TYPE_FIRMWARE)) {
                printf ("Image %s wrong type\n", au_image[i].name);
                return -1;
        }
-       if ((au_image[i].type == AU_SCRIPT) && (hdr->ih_type != IH_TYPE_SCRIPT)) {
+       if (((au_image[i].type & AU_TYPEMASK) == AU_SCRIPT) &&
+           !image_check_type (hdr, IH_TYPE_SCRIPT)) {
                printf ("Image %s wrong type\n", au_image[i].name);
                return -1;
        }
 
        /* recycle checksum */
-       checksum = ntohl(hdr->ih_size);
-
-#if 0 /* test-only */
-       /* for kernel and app the image header must also fit into flash */
-       if (idx != IDX_DISK)
-               checksum += sizeof(*hdr);
-       /* check the size does not exceed space in flash. HUSH scripts */
-       /* all have ausize[] set to 0 */
-       if ((ausize[idx] != 0) && (ausize[idx] < checksum)) {
-               printf ("Image %s is bigger than FLASH\n", au_image[i].name);
-               return -1;
-       }
-#endif
+       checksum = image_get_data_size (hdr);
 
        return 0;
 }
 
-
 int au_do_update(int i, long sz)
 {
        image_header_t *hdr;
@@ -190,17 +163,23 @@ int au_do_update(int i, long sz)
 #endif
 
        hdr = (image_header_t *)LOAD_ADDR;
+#if defined(CONFIG_FIT)
+       if (genimg_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+               puts ("Non legacy image format not supported\n");
+               return -1;
+       }
+#endif
 
-       switch (au_image[i].type) {
+       switch (au_image[i].type & AU_TYPEMASK) {
        case AU_SCRIPT:
                printf("Executing script %s\n", au_image[i].name);
 
                /* execute a script */
-               if (hdr->ih_type == IH_TYPE_SCRIPT) {
-                       addr = (char *)((char *)hdr + sizeof(*hdr));
+               if (image_check_type (hdr, IH_TYPE_SCRIPT)) {
+                       addr = (char *)((char *)hdr + image_get_header_size ());
                        /* stick a NULL at the end of the script, otherwise */
                        /* parse_string_outer() runs off the end. */
-                       addr[ntohl(hdr->ih_size)] = 0;
+                       addr[image_get_data_size (hdr)] = 0;
                        addr += 8;
 
                        /*
@@ -231,38 +210,43 @@ int au_do_update(int i, long sz)
                 */
                if (au_image[i].type == AU_FIRMWARE) {
                        char *orig = (char*)start;
-                       char *new  = (char *)((char *)hdr + sizeof(*hdr));
-                       nbytes = ntohl(hdr->ih_size);
+                       char *new  = (char *)((char *)hdr +
+                                             image_get_header_size ());
+                       nbytes = image_get_data_size (hdr);
 
-                       while(--nbytes) {
+                       while (--nbytes) {
                                if (*orig++ != *new++) {
                                        break;
                                }
                        }
                        if (!nbytes) {
-                               printf("Skipping firmware update - images are identical\n");
+                               printf ("Skipping firmware update - "
+                                       "images are identical\n");
                                break;
                        }
                }
 
                /* unprotect the address range */
-               /* this assumes that ONLY the firmware is protected! */
-               if (au_image[i].type == AU_FIRMWARE) {
-                       flash_sect_protect(0, start, end);
+               if (((au_image[i].type & AU_FLAGMASK) == AU_PROTECT) ||
+                   (au_image[i].type == AU_FIRMWARE)) {
+                       flash_sect_protect (0, start, end);
                }
 
                /*
                 * erase the address range.
                 */
                if (au_image[i].type != AU_NAND) {
-                       printf("Updating NOR FLASH with image %s\n", au_image[i].name);
+                       printf ("Updating NOR FLASH with image %s\n",
+                               au_image[i].name);
                        debug ("flash_sect_erase(%lx, %lx);\n", start, end);
-                       flash_sect_erase(start, end);
+                       flash_sect_erase (start, end);
                } else {
 #if defined(CONFIG_CMD_NAND) && defined(CFG_NAND_LEGACY)
-                       printf("Updating NAND FLASH with image %s\n", au_image[i].name);
+                       printf ("Updating NAND FLASH with image %s\n",
+                               au_image[i].name);
                        debug ("nand_legacy_erase(%lx, %lx);\n", start, end);
-                       rc = nand_legacy_erase (nand_dev_desc, start, end - start + 1, 0);
+                       rc = nand_legacy_erase (nand_dev_desc, start,
+                                               end - start + 1, 0);
                        debug ("nand_legacy_erase returned %x\n", rc);
 #endif
                }
@@ -272,32 +256,38 @@ int au_do_update(int i, long sz)
                /* strip the header - except for the kernel and ramdisk */
                if (au_image[i].type != AU_FIRMWARE) {
                        addr = (char *)hdr;
-                       off = sizeof(*hdr);
-                       nbytes = sizeof(*hdr) + ntohl(hdr->ih_size);
+                       off = image_get_header_size ();
+                       nbytes = image_get_image_size (hdr);
                } else {
-                       addr = (char *)((char *)hdr + sizeof(*hdr));
+                       addr = (char *)((char *)hdr + image_get_header_size ());
                        off = 0;
-                       nbytes = ntohl(hdr->ih_size);
+                       nbytes = image_get_data_size (hdr);
                }
 
                /*
                 * copy the data from RAM to FLASH
                 */
                if (au_image[i].type != AU_NAND) {
-                       debug ("flash_write(%p, %lx %x)\n", addr, start, nbytes);
-                       rc = flash_write((char *)addr, start, nbytes);
+                       debug ("flash_write(%p, %lx, %x)\n",
+                              addr, start, nbytes);
+                       rc = flash_write ((char *)addr, start,
+                                         (nbytes + 1) & ~1);
                } else {
 #if defined(CONFIG_CMD_NAND) && defined(CFG_NAND_LEGACY)
-                       debug ("nand_legacy_rw(%p, %lx %x)\n", addr, start, nbytes);
-                       rc = nand_legacy_rw(nand_dev_desc, NANDRW_WRITE | NANDRW_JFFS2,
-                                    start, nbytes, (size_t *)&total, (uchar *)addr);
-                       debug ("nand_legacy_rw: ret=%x total=%d nbytes=%d\n", rc, total, nbytes);
+                       debug ("nand_legacy_rw(%p, %lx, %x)\n",
+                              addr, start, nbytes);
+                       rc = nand_legacy_rw (nand_dev_desc,
+                                            NANDRW_WRITE | NANDRW_JFFS2,
+                                            start, nbytes, (size_t *)&total,
+                                            (uchar *)addr);
+                       debug ("nand_legacy_rw: ret=%x total=%d nbytes=%d\n",
+                              rc, total, nbytes);
 #else
                        rc = -1;
 #endif
                }
                if (rc != 0) {
-                       printf("Flashing failed due to error %d\n", rc);
+                       printf ("Flashing failed due to error %d\n", rc);
                        return -1;
                }
 
@@ -305,23 +295,30 @@ int au_do_update(int i, long sz)
                 * check the dcrc of the copy
                 */
                if (au_image[i].type != AU_NAND) {
-                       rc = crc32 (0, (uchar *)(start + off), ntohl(hdr->ih_size));
+                       rc = crc32 (0, (uchar *)(start + off),
+                                   image_get_data_size (hdr));
                } else {
 #if defined(CONFIG_CMD_NAND) && defined(CFG_NAND_LEGACY)
-                       rc = nand_legacy_rw(nand_dev_desc, NANDRW_READ | NANDRW_JFFS2 | NANDRW_JFFS2_SKIP,
-                                    start, nbytes, (size_t *)&total, (uchar *)addr);
-                       rc = crc32 (0, (uchar *)(addr + off), ntohl(hdr->ih_size));
+                       rc = nand_legacy_rw (nand_dev_desc,
+                                            NANDRW_READ | NANDRW_JFFS2 |
+                                            NANDRW_JFFS2_SKIP,
+                                            start, nbytes, (size_t *)&total,
+                                            (uchar *)addr);
+                       rc = crc32 (0, (uchar *)(addr + off),
+                                   image_get_data_size (hdr));
 #endif
                }
-               if (rc != ntohl(hdr->ih_dcrc)) {
-                       printf ("Image %s Bad Data Checksum After COPY\n", au_image[i].name);
+               if (rc != image_get_dcrc (hdr)) {
+                       printf ("Image %s Bad Data Checksum After COPY\n",
+                               au_image[i].name);
                        return -1;
                }
 
                /* protect the address range */
                /* this assumes that ONLY the firmware is protected! */
-               if (au_image[i].type == AU_FIRMWARE) {
-                       flash_sect_protect(1, start, end);
+               if (((au_image[i].type & AU_FLAGMASK) == AU_PROTECT) ||
+                   (au_image[i].type == AU_FIRMWARE)) {
+                       flash_sect_protect (1, start, end);
                }
 
                break;
@@ -333,7 +330,6 @@ int au_do_update(int i, long sz)
        return 0;
 }
 
-
 static void process_macros (const char *input, char *output)
 {
        char c, prev;
@@ -347,16 +343,17 @@ static void process_macros (const char *input, char *output)
 #ifdef DEBUG_PARSER
        char *output_start = output;
 
-       printf ("[PROCESS_MACROS] INPUT len %d: \"%s\"\n", strlen(input), input);
+       printf ("[PROCESS_MACROS] INPUT len %d: \"%s\"\n",
+               strlen(input), input);
 #endif
 
-       prev = '\0';                    /* previous character   */
+       prev = '\0';                    /* previous character */
 
        while (inputcnt && outputcnt) {
            c = *input++;
            inputcnt--;
 
-           if (state!=3) {
+           if (state != 3) {
            /* remove one level of escape characters */
            if ((c == '\\') && (prev != '\\')) {
                if (inputcnt-- == 0)
@@ -367,7 +364,7 @@ static void process_macros (const char *input, char *output)
            }
 
            switch (state) {
-           case 0:                     /* Waiting for (unescaped) $    */
+           case 0:                     /* Waiting for (unescaped) $ */
                if ((c == '\'') && (prev != '\\')) {
                        state = 3;
                        break;
@@ -379,7 +376,7 @@ static void process_macros (const char *input, char *output)
                        outputcnt--;
                }
                break;
-           case 1:                     /* Waiting for (        */
+           case 1:                     /* Waiting for ( */
                if (c == '(' || c == '{') {
                        state++;
                        varname_start = input;
@@ -398,7 +395,8 @@ static void process_macros (const char *input, char *output)
                if (c == ')' || c == '}') {
                        int i;
                        char envname[CFG_CBSIZE], *envval;
-                       int envcnt = input-varname_start-1; /* Varname # of chars */
+                       /* Varname # of chars */
+                       int envcnt = input - varname_start - 1;
 
                        /* Get the varname */
                        for (i = 0; i < envcnt; i++) {
@@ -436,11 +434,10 @@ static void process_macros (const char *input, char *output)
 
 #ifdef DEBUG_PARSER
        printf ("[PROCESS_MACROS] OUTPUT len %d: \"%s\"\n",
-               strlen(output_start), output_start);
+               strlen (output_start), output_start);
 #endif
 }
 
-
 /*
  * this is called from board_init() after the hardware has been set up
  * and is usable. That seems like a good time to do this.
@@ -448,84 +445,84 @@ static void process_macros (const char *input, char *output)
  */
 int do_auto_update(void)
 {
-       block_dev_desc_t *stor_dev;
+       block_dev_desc_t *stor_dev = NULL;
        long sz;
        int i, res, cnt, old_ctrlc, got_ctrlc;
        char buffer[32];
        char str[80];
+       int n;
 
-       /*
-        * Check whether a CompactFlash is inserted
-        */
-       if (ide_dev_desc[0].type == DEV_TYPE_UNKNOWN) {
-               return -1;       /* no disk detected! */
+       if  (ide_dev_desc[0].type != DEV_TYPE_UNKNOWN) {
+               stor_dev = get_dev ("ide", 0);
+               if (stor_dev == NULL) {
+                       debug ("ide: unknown device\n");
+                       return -1;
+               }
        }
 
-       /* check whether it has a partition table */
-       stor_dev = get_dev("ide", 0);
-       if (stor_dev == NULL) {
-               debug ("Uknown device type\n");
-               return -1;
-       }
-       if (fat_register_device(stor_dev, 1) != 0) {
-               debug ("Unable to register ide disk 0:1 for fatls\n");
+       if (fat_register_device (stor_dev, 1) != 0) {
+               debug ("Unable to register ide disk 0:1\n");
                return -1;
        }
 
        /*
         * Check if magic file is present
         */
-       if (do_fat_read(AU_MAGIC_FILE, buffer, sizeof(buffer), LS_NO) <= 0) {
+       if ((n = do_fat_read (AU_MAGIC_FILE, buffer,
+                             sizeof(buffer), LS_NO)) <= 0) {
+               debug ("No auto_update magic file (n=%d)\n", n);
                return -1;
        }
 
 #ifdef CONFIG_AUTO_UPDATE_SHOW
-       board_auto_update_show(1);
+       board_auto_update_show (1);
 #endif
        puts("\nAutoUpdate Disk detected! Trying to update system...\n");
 
        /* make sure that we see CTRL-C and save the old state */
-       old_ctrlc = disable_ctrlc(0);
+       old_ctrlc = disable_ctrlc (0);
 
        /* just loop thru all the possible files */
        for (i = 0; i < N_AU_IMAGES; i++) {
                /*
                 * Try to expand the environment var in the fname
                 */
-               process_macros(au_image[i].name, str);
-               strcpy(au_image[i].name, str);
+               process_macros (au_image[i].name, str);
+               strcpy (au_image[i].name, str);
 
                printf("Reading %s ...", au_image[i].name);
                /* just read the header */
-               sz = do_fat_read(au_image[i].name, LOAD_ADDR, sizeof(image_header_t), LS_NO);
+               sz = do_fat_read (au_image[i].name, LOAD_ADDR,
+                                 image_get_header_size (), LS_NO);
                debug ("read %s sz %ld hdr %d\n",
-                       au_image[i].name, sz, sizeof(image_header_t));
-               if (sz <= 0 || sz < sizeof(image_header_t)) {
+                       au_image[i].name, sz, image_get_header_size ());
+               if (sz <= 0 || sz < image_get_header_size ()) {
                        puts(" not found\n");
                        continue;
                }
-               if (au_check_header_valid(i, sz) < 0) {
+               if (au_check_header_valid (i, sz) < 0) {
                        puts(" header not valid\n");
                        continue;
                }
-               sz = do_fat_read(au_image[i].name, LOAD_ADDR, MAX_LOADSZ, LS_NO);
+               sz = do_fat_read (au_image[i].name, LOAD_ADDR,
+                                 MAX_LOADSZ, LS_NO);
                debug ("read %s sz %ld hdr %d\n",
-                       au_image[i].name, sz, sizeof(image_header_t));
-               if (sz <= 0 || sz <= sizeof(image_header_t)) {
+                       au_image[i].name, sz, image_get_header_size ());
+               if (sz <= 0 || sz <= image_get_header_size ()) {
                        puts(" not found\n");
                        continue;
                }
-               if (au_check_cksum_valid(i, sz) < 0) {
+               if (au_check_cksum_valid (i, sz) < 0) {
                        puts(" checksum not valid\n");
                        continue;
                }
                puts(" done\n");
 
                do {
-                       res = au_do_update(i, sz);
+                       res = au_do_update (i, sz);
                        /* let the user break out of the loop */
-                       if (ctrlc() || had_ctrlc()) {
-                               clear_ctrlc();
+                       if (ctrlc() || had_ctrlc ()) {
+                               clear_ctrlc ();
                                if (res < 0)
                                        got_ctrlc = 1;
                                break;
@@ -535,17 +532,16 @@ int do_auto_update(void)
        }
 
        /* restore the old state */
-       disable_ctrlc(old_ctrlc);
+       disable_ctrlc (old_ctrlc);
 
        puts("AutoUpdate finished\n\n");
 #ifdef CONFIG_AUTO_UPDATE_SHOW
-       board_auto_update_show(0);
+       board_auto_update_show (0);
 #endif
 
        return 0;
 }
 
-
 int auto_update(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        do_auto_update();
index e2af3c7..3ed0e16 100644 (file)
 
 #define AU_MAGIC_FILE   "__auto_update"
 
-#define AU_SCRIPT       1
-#define AU_FIRMWARE     2
-#define AU_NOR          3
-#define AU_NAND         4
+#define AU_TYPEMASK     0x000000ff
+#define AU_FLAGMASK     0xffff0000
+
+#define AU_PROTECT      0x80000000
+
+#define AU_SCRIPT       0x01
+#define AU_FIRMWARE     (0x02 | AU_PROTECT)
+#define AU_NOR          0x03
+#define AU_NAND         0x04
 
 struct au_image_s {
        char name[80];
        ulong start;
        ulong size;
-       int type;
+       ulong type;
 };
 
 typedef struct au_image_s au_image_t;
index ed50def..c23dc81 100644 (file)
@@ -44,37 +44,57 @@ void lcd_setup(int lcd, int config)
                /*
                 * Set endianess and reset lcd controller 0 (small)
                 */
-               out_be32((void*)GPIO0_OR, in_be32((void*)GPIO0_OR) & ~CFG_LCD0_RST); /* set reset to low */
+
+               /* set reset to low */
+               out_be32((void*)GPIO0_OR,
+                        in_be32((void*)GPIO0_OR) & ~CFG_LCD0_RST);
                udelay(10); /* wait 10us */
-               if (config == 1)
-                       out_be32((void*)GPIO0_OR, in_be32((void*)GPIO0_OR) | CFG_LCD_ENDIAN); /* big-endian */
-               else
-                       out_be32((void*)GPIO0_OR, in_be32((void*)GPIO0_OR) & ~CFG_LCD_ENDIAN); /* little-endian */
+               if (config == 1) {
+                       /* big-endian */
+                       out_be32((void*)GPIO0_OR,
+                                in_be32((void*)GPIO0_OR) | CFG_LCD_ENDIAN);
+               } else {
+                       /* little-endian */
+                       out_be32((void*)GPIO0_OR,
+                                in_be32((void*)GPIO0_OR) & ~CFG_LCD_ENDIAN);
+               }
                udelay(10); /* wait 10us */
-               out_be32((void*)GPIO0_OR, in_be32((void*)GPIO0_OR) | CFG_LCD0_RST); /* set reset to high */
+               /* set reset to high */
+               out_be32((void*)GPIO0_OR,
+                        in_be32((void*)GPIO0_OR) | CFG_LCD0_RST);
        } else {
                /*
                 * Set endianess and reset lcd controller 1 (big)
                 */
-               out_be32((void*)GPIO0_OR, in_be32((void*)GPIO0_OR) & ~CFG_LCD1_RST); /* set reset to low */
+
+               /* set reset to low */
+               out_be32((void*)GPIO0_OR,
+                        in_be32((void*)GPIO0_OR) & ~CFG_LCD1_RST);
                udelay(10); /* wait 10us */
-               if (config == 1)
-                       out_be32((void*)GPIO0_OR, in_be32((void*)GPIO0_OR) | CFG_LCD_ENDIAN); /* big-endian */
-               else
-                       out_be32((void*)GPIO0_OR, in_be32((void*)GPIO0_OR) & ~CFG_LCD_ENDIAN); /* little-endian */
+               if (config == 1) {
+                       /* big-endian */
+                       out_be32((void*)GPIO0_OR,
+                                in_be32((void*)GPIO0_OR) | CFG_LCD_ENDIAN);
+               } else {
+                       /* little-endian */
+                       out_be32((void*)GPIO0_OR,
+                                in_be32((void*)GPIO0_OR) & ~CFG_LCD_ENDIAN);
+               }
                udelay(10); /* wait 10us */
-               out_be32((void*)GPIO0_OR, in_be32((void*)GPIO0_OR) | CFG_LCD1_RST); /* set reset to high */
+               /* set reset to high */
+               out_be32((void*)GPIO0_OR,
+                        in_be32((void*)GPIO0_OR) | CFG_LCD1_RST);
        }
 
        /*
         * CFG_LCD_ENDIAN may also be FPGA_RESET, so set inactive
         */
-       out_be32((void*)GPIO0_OR, in_be32((void*)GPIO0_OR) | CFG_LCD_ENDIAN); /* set reset high again */
+       out_be32((void*)GPIO0_OR, in_be32((void*)GPIO0_OR) | CFG_LCD_ENDIAN);
 }
 #endif /* CFG_LCD_ENDIAN */
 
 
-void lcd_bmp(uchar *logo_bmp)
+int lcd_bmp(uchar *logo_bmp)
 {
        int i;
        uchar *ptr;
@@ -99,13 +119,18 @@ void lcd_bmp(uchar *logo_bmp)
                len = CFG_VIDEO_LOGO_MAX_SIZE;
                dst = malloc(CFG_VIDEO_LOGO_MAX_SIZE);
                if (dst == NULL) {
-                       printf("Error: malloc in gunzip failed!\n");
-                       return;
+                       printf("Error: malloc for gunzip failed!\n");
+                       return 1;
+               }
+               if (gunzip(dst, CFG_VIDEO_LOGO_MAX_SIZE,
+                          (uchar *)logo_bmp, &len) != 0) {
+                       free(dst);
+                       return 1;
+               }
+               if (len == CFG_VIDEO_LOGO_MAX_SIZE) {
+                       printf("Image could be truncated"
+                              " (increase CFG_VIDEO_LOGO_MAX_SIZE)!\n");
                }
-               if (gunzip(dst, CFG_VIDEO_LOGO_MAX_SIZE, (uchar *)logo_bmp, &len) != 0)
-                       return;
-               if (len == CFG_VIDEO_LOGO_MAX_SIZE)
-                       printf("Image could be truncated (increase CFG_VIDEO_LOGO_MAX_SIZE)!\n");
 
                /*
                 * Check for bmp mark 'BM'
@@ -113,7 +138,7 @@ void lcd_bmp(uchar *logo_bmp)
                if (*(ushort *)dst != 0x424d) {
                        printf("LCD: Unknown image format!\n");
                        free(dst);
-                       return;
+                       return 1;
                }
        } else {
                /*
@@ -150,7 +175,7 @@ void lcd_bmp(uchar *logo_bmp)
                printf("LCD: Unknown bpp (%d) im image!\n", bpp);
                if ((dst != NULL) && (dst != (uchar *)logo_bmp))
                        free(dst);
-               return;
+               return 1;
        }
        printf(" (%d*%d, %dbpp)\n", width, height, bpp);
 
@@ -180,23 +205,28 @@ void lcd_bmp(uchar *logo_bmp)
                        if (bpp == 24) {
                                for (x = 0; x < width; x++) {
                                        /*
-                                        * Generate epson 16bpp fb-format from 24bpp image
+                                        * Generate epson 16bpp fb-format
+                                        * from 24bpp image
                                         */
                                        b = *bmp++ >> 3;
                                        g = *bmp++ >> 2;
                                        r = *bmp++ >> 3;
-                                       val = ((r & 0x1f) << 11) | ((g & 0x3f) << 5) | (b & 0x1f);
+                                       val = ((r & 0x1f) << 11) |
+                                               ((g & 0x3f) << 5) |
+                                               (b & 0x1f);
                                        *ptr2++ = val;
                                }
                        } else if (bpp == 8) {
                                for (x = 0; x < line_size; x++) {
                                        /* query rgb value from palette */
-                                       ptr = (unsigned char *)(dst + 14 + 40) ;
+                                       ptr = (unsigned char *)(dst + 14 + 40);
                                        ptr += (*bmp++) << 2;
                                        b = *ptr++ >> 3;
                                        g = *ptr++ >> 2;
                                        r = *ptr++ >> 3;
-                                       val = ((r & 0x1f) << 11) | ((g & 0x3f) << 5) | (b & 0x1f);
+                                       val = ((r & 0x1f) << 11) |
+                                               ((g & 0x3f) << 5) |
+                                               (b & 0x1f);
                                        *ptr2++ = val;
                                }
                        }
@@ -208,11 +238,12 @@ void lcd_bmp(uchar *logo_bmp)
 
        if ((dst != NULL) && (dst != (uchar *)logo_bmp))
                free(dst);
+       return 0;
 }
 
 
-void lcd_init(uchar *lcd_reg, uchar *lcd_mem, S1D_REGS *regs, int reg_count,
-             uchar *logo_bmp, ulong len)
+int lcd_init(uchar *lcd_reg, uchar *lcd_mem, S1D_REGS *regs, int reg_count,
+            uchar *logo_bmp, ulong len)
 {
        int i;
        ushort s1dReg;
@@ -263,8 +294,22 @@ void lcd_init(uchar *lcd_reg, uchar *lcd_mem, S1D_REGS *regs, int reg_count,
                lcd_reg += 0x10000; /* add offset for 705 regs */
                puts("LCD:   S1D13705");
        } else {
-               puts("LCD:   No controller detected!\n");
-               return;
+               out_8(&lcd_reg[0x1a], 0x00);
+               udelay(1000);
+               if (in_8(&lcd_reg[1]) == 0x0c) {
+                       /*
+                        * S1D13505 detected
+                        */
+                       reg_byte_swap = TRUE;
+                       palette_index = 0x25;
+                       palette_value = 0x27;
+                       lcd_depth = 16;
+
+                       puts("LCD:   S1D13505");
+               } else {
+                       puts("LCD:   No controller detected!\n");
+                       return 1;
+               }
        }
 
        /*
@@ -279,7 +324,7 @@ void lcd_init(uchar *lcd_reg, uchar *lcd_mem, S1D_REGS *regs, int reg_count,
                                s1dReg &= ~0x0001;
                }
                s1dValue = regs[i].Value;
-               lcd_reg[s1dReg] = s1dValue;
+               out_8(&lcd_reg[s1dReg], s1dValue);
        }
 
        /*
@@ -291,15 +336,15 @@ void lcd_init(uchar *lcd_reg, uchar *lcd_mem, S1D_REGS *regs, int reg_count,
        /*
         * Display bmp image
         */
-       lcd_bmp(logo_bmp);
+       return lcd_bmp(logo_bmp);
 }
 
-#if defined(CONFIG_VIDEO_SM501)
 int do_esdbmp(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        ulong addr;
+#ifdef CONFIG_VIDEO_SM501
        char *str;
-
+#endif
        if (argc != 2) {
                printf ("Usage:\n%s\n", cmdtp->usage);
                return 1;
@@ -307,19 +352,22 @@ int do_esdbmp(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
        addr = simple_strtoul(argv[1], NULL, 16);
 
+#ifdef CONFIG_VIDEO_SM501
        str = getenv("bd_type");
        if ((strcmp(str, "ppc221") == 0) || (strcmp(str, "ppc231") == 0)) {
                /*
                 * SM501 available, use standard bmp command
                 */
-               return (video_display_bitmap(addr, 0, 0));
+               return video_display_bitmap(addr, 0, 0);
        } else {
                /*
                 * No SM501 available, use esd epson bmp command
                 */
-               lcd_bmp((uchar *)addr);
-               return 0;
+               return lcd_bmp((uchar *)addr);
        }
+#else
+       return lcd_bmp((uchar *)addr);
+#endif
 }
 
 U_BOOT_CMD(
@@ -327,4 +375,3 @@ U_BOOT_CMD(
        "esdbmp   - display BMP image\n",
        "<imageAddr> - display image\n"
 );
-#endif
diff --git a/board/esd/common/s1d13505_640_480_16bpp.h b/board/esd/common/s1d13505_640_480_16bpp.h
new file mode 100644 (file)
index 0000000..02b3b92
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * (C) Copyright 2008
+ * Matthias Fuchs, esd gmbh germany, matthias.fuchs@esd-electronics.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
+ */
+
+/*
+ * Panel:  640x480 50Hz TFT Single 18-bit (PCLK=20.000 MHz)
+ * Memory:  DRAM (MCLK=40.000 MHz)
+ */
+static S1D_REGS regs_13505_640_480_16bpp[] =
+{
+       {0x1B,0x00},   /* Miscellaneous Register */
+       {0x23,0x20},   /* Performance Enhancement Register 1 */
+       {0x01,0x30},   /* Memory Configuration Register */
+       {0x22,0x24},   /* Performance Enhancement Register 0 */
+       {0x02,0x25},   /* Panel Type Register */
+       {0x03,0x00},   /* MOD Rate Register */
+       {0x04,0x4F},   /* Horizontal Display Width Register */
+       {0x05,0x0c},   /* Horizontal Non-Display Period Register */
+       {0x06,0x00},   /* HRTC/FPLINE Start Position Register */
+       {0x07,0x01},   /* HRTC/FPLINE Pulse Width Register */
+       {0x08,0xDF},   /* Vertical Display Height Register 0 */
+       {0x09,0x01},   /* Vertical Display Height Register 1 */
+       {0x0A,0x3E},   /* Vertical Non-Display Period Register */
+       {0x0B,0x00},   /* VRTC/FPFRAME Start Position Register */
+       {0x0C,0x01},   /* VRTC/FPFRAME Pulse Width Register */
+       {0x0E,0xFF},   /* Screen 1 Line Compare Register 0 */
+       {0x0F,0x03},   /* Screen 1 Line Compare Register 1 */
+       {0x10,0x00},   /* Screen 1 Display Start Address Register 0 */
+       {0x11,0x00},   /* Screen 1 Display Start Address Register 1 */
+       {0x12,0x00},   /* Screen 1 Display Start Address Register 2 */
+       {0x13,0x00},   /* Screen 2 Display Start Address Register 0 */
+       {0x14,0x00},   /* Screen 2 Display Start Address Register 1 */
+       {0x15,0x00},   /* Screen 2 Display Start Address Register 2 */
+       {0x16,0x80},   /* Memory Address Offset Register 0 */
+       {0x17,0x02},   /* Memory Address Offset Register 1 */
+       {0x18,0x00},   /* Pixel Panning Register */
+       {0x19,0x01},   /* Clock Configuration Register */
+       {0x1A,0x00},   /* Power Save Configuration Register */
+       {0x1C,0x00},   /* MD Configuration Readback Register 0 */
+       {0x1E,0x06},   /* General IO Pins Configuration Register 0 */
+       {0x1F,0x00},   /* General IO Pins Configuration Register 1 */
+       {0x20,0x00},   /* General IO Pins Control Register 0 */
+       {0x21,0x00},   /* General IO Pins Control Register 1 */
+       {0x23,0x20},   /* Performance Enhancement Register 1 */
+       {0x0D,0x15},   /* Display Mode Register */
+};
index 9dad748..f5daaef 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 9dad748..f5daaef 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 0f9a157..25e16de 100644 (file)
@@ -26,7 +26,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 9dad748..f5daaef 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 22d7128..2b5e33d 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 3f23050..196f88c 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index e156202..71ab63d 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index ceb128c..3dbb2e1 100644 (file)
@@ -67,12 +67,12 @@ int board_early_init_f(void)
        out_be32((void*)GPIO1_OR, 0x00000000);
        out_be32((void*)GPIO1_TCR, 0xc2000000 |
                 CFG_GPIO1_IORSTN |
+                CFG_GPIO1_IORST2N |
                 CFG_GPIO1_LEDUSR1 |
                 CFG_GPIO1_LEDUSR2 |
                 CFG_GPIO1_LEDPOST |
                 CFG_GPIO1_LEDDU);
        out_be32((void*)GPIO1_ODR, CFG_GPIO1_LEDDU);
-
        out_be32((void*)GPIO1_OSRL, 0x5c280000);
        out_be32((void*)GPIO1_OSRH, 0x00000000);
        out_be32((void*)GPIO1_TSRL, 0x0c000000);
@@ -243,7 +243,8 @@ int misc_init_r(void)
         * release IO-RST#
         * We have to wait at least 560ms until we may call usbhub_init
         */
-       out_be32((void*)GPIO1_OR, in_be32((void*)GPIO1_OR) | CFG_GPIO1_IORSTN);
+       out_be32((void*)GPIO1_OR, in_be32((void*)GPIO1_OR) |
+                CFG_GPIO1_IORSTN | CFG_GPIO1_IORST2N);
 
        /*
         * flash USR1/2 LEDs (600ms)
index 5c362e4..83fdac7 100644 (file)
@@ -24,6 +24,7 @@
 #define CFG_GPIO1_DCF77                (0x80000000 >> (42-32))  /* GPIO1_42 */
 
 #define CFG_GPIO1_IORSTN       (0x80000000 >> (55-32))  /* GPIO1_55 */
+#define CFG_GPIO1_IORST2N      (0x80000000 >> (47-32))  /* GPIO1_47 */
 
 #define CFG_GPIO1_HWVER_MASK   0x000000f0 /* GPIO1_56-59 */
 #define CFG_GPIO1_HWVER_SHIFT  4
index e140737..da2a400 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 9dad748..f5daaef 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 193e8b2..46e8f3e 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 508c5d2..eca720c 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 9dad748..f5daaef 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 3f23050..196f88c 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index f75fe0a..5b9321e 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 350af48..ca5c177 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2007
+ * (C) Copyright 2007-2008
  * Matthias Fuchs, esd Gmbh, matthias.fuchs@esd-electronics.com.
  *
  * See file CREDITS for list of people who contributed to this
@@ -21,7 +21,6 @@
  * MA 02111-1307 USA
  *
  */
-
 #include <common.h>
 #include <command.h>
 #include <asm/io.h>
@@ -31,7 +30,8 @@
 #include "pmc440.h"
 
 int is_monarch(void);
-int bootstrap_eeprom_write(unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt);
+int bootstrap_eeprom_write(unsigned dev_addr, unsigned offset,
+                          uchar *buffer, unsigned cnt);
 int eeprom_write_enable(unsigned dev_addr, int state);
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -64,7 +64,6 @@ int fpga_interrupt(u32 arg)
        return rc;
 }
 
-
 int do_waithci(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        pmc440_fpga_t *fpga = (pmc440_fpga_t *)FPGA_BA;
@@ -100,7 +99,6 @@ U_BOOT_CMD(
        NULL
        );
 
-
 void dump_fifo(pmc440_fpga_t *fpga, int f, int *n)
 {
        u32 ctrl;
@@ -117,7 +115,6 @@ void dump_fifo(pmc440_fpga_t *fpga, int f, int *n)
        }
 }
 
-
 int do_fifo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        pmc440_fpga_t *fpga = (pmc440_fpga_t *)FPGA_BA;
@@ -200,7 +197,8 @@ int do_fifo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                                        got_fifoirq = 0;
                                        /* unmask global fifo irq */
                                        FPGA_OUT32(&fpga->hostctrl,
-                                                  HOSTCTRL_FIFOIE_GATE | HOSTCTRL_FIFOIE_FLAG);
+                                                  HOSTCTRL_FIFOIE_GATE |
+                                                  HOSTCTRL_FIFOIE_FLAG);
                                }
                        }
 
@@ -237,7 +235,8 @@ int do_fifo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                                for (i=0; i<n; i++)
                                        FPGA_OUT32(&fpga->fifo[f].data, data);
                        } else {
-                               printf("writing %d x %08x to fifo port at address %08x\n",
+                               printf("writing %d x %08x to fifo port at "
+                                      "address %08x\n",
                                       n, data, f);
                                for (i=0; i<n; i++)
                                        out32(f, data);
@@ -263,10 +262,10 @@ U_BOOT_CMD(
        "  - without arguments: print all fifo's status\n"
        "  - with 'wait' argument: interrupt driven read from all fifos\n"
        "  - with 'read' argument: read current contents from all fifos\n"
-       "  - with 'write' argument: write 'data' 'cnt' times to 'fifo' or 'address'\n"
+       "  - with 'write' argument: write 'data' 'cnt' times to "
+       "'fifo' or 'address'\n"
        );
 
-
 int do_setup_bootstrap_eeprom(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        ulong sdsdp[5];
@@ -294,18 +293,9 @@ int do_setup_bootstrap_eeprom(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]
                        sdsdp[2]=0x40082350;
                        sdsdp[3]=0x0d050000;
                } else if (!strcmp(argv[1], "667")) {
-                       /* PLB=133MHz, PLB/PCI=4 */
+                       /* PLB=133MHz, PLB/PCI=3 */
                        printf("Bootstrapping for 667MHz\n");
                        sdsdp[0]=0x8778a256;
-                       sdsdp[1]=0x0947a030;
-                       sdsdp[2]=0x40082350;
-                       sdsdp[3]=0x0d050000;
-               } else if (!strcmp(argv[1], "test")) {
-                       /* TODO: this will replace the 667 MHz config above.
-                        * But it needs some more testing on a real 667 MHz CPU.
-                        */
-                       printf("Bootstrapping for test (667MHz PLB=133PLB PLB/PCI=3)\n");
-                       sdsdp[0]=0x8778a256;
                        sdsdp[1]=0x095fa030;
                        sdsdp[2]=0x40082350;
                        sdsdp[3]=0x0d050000;
@@ -347,7 +337,6 @@ U_BOOT_CMD(
        "<cpufreq:400|533|667> [<console-uart:0|1> [<bringup delay (0..20s)>]]"
        );
 
-
 #if defined(CONFIG_PRAM)
 #include <environment.h>
 extern env_t *env_ptr;
@@ -394,7 +383,6 @@ U_BOOT_CMD(
        );
 #endif /* CONFIG_PRAM */
 
-
 int do_selfreset(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        if (argc > 1) {
@@ -423,7 +411,6 @@ U_BOOT_CMD(
        NULL
        );
 
-
 int do_resetout(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        pmc440_fpga_t *fpga = (pmc440_fpga_t *)FPGA_BA;
@@ -444,7 +431,8 @@ int do_resetout(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                        /* deassert */
                        printf("PMC-RESETOUT# deasserted\n");
                        FPGA_OUT32(&fpga->hostctrl,
-                                  HOSTCTRL_PMCRSTOUT_GATE | HOSTCTRL_PMCRSTOUT_FLAG);
+                                  HOSTCTRL_PMCRSTOUT_GATE |
+                                  HOSTCTRL_PMCRSTOUT_FLAG);
                }
        } else {
                printf("PMC-RESETOUT# is %s\n",
@@ -460,7 +448,6 @@ U_BOOT_CMD(
        NULL
        );
 
-
 int do_inta(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        if (is_monarch()) {
@@ -481,7 +468,9 @@ int do_inta(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                                 in_be32((void*)GPIO1_TCR) & ~GPIO1_INTA_FAKE);
                }
        } else {
-               printf("inta# is %s\n", in_be32((void*)GPIO1_TCR) & GPIO1_INTA_FAKE ? "active" : "inactive");
+               printf("inta# is %s\n",
+                      in_be32((void*)GPIO1_TCR) & GPIO1_INTA_FAKE ?
+                      "active" : "inactive");
        }
        return 0;
 }
@@ -491,7 +480,6 @@ U_BOOT_CMD(
        NULL
        );
 
-
 /* test-only */
 int do_pmm(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
@@ -503,11 +491,17 @@ int do_pmm(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                pciaddr &= 0xf0000000;
 
                /* map PCI address at 0xc0000000 in PLB space */
-               out32r(PCIX0_PMM1MA, 0x00000000); /* PMM1 Mask/Attribute - disabled b4 setting */
-               out32r(PCIX0_PMM1LA, 0xc0000000); /* PMM1 Local Address */
-               out32r(PCIX0_PMM1PCILA, pciaddr); /* PMM1 PCI Low Address */
-               out32r(PCIX0_PMM1PCIHA, 0x00000000); /* PMM1 PCI High Address */
-               out32r(PCIX0_PMM1MA, 0xf0000001); /* 256MB + No prefetching, and enable region */
+
+               /* PMM1 Mask/Attribute - disabled b4 setting */
+               out32r(PCIX0_PMM1MA, 0x00000000);
+               /* PMM1 Local Address */
+               out32r(PCIX0_PMM1LA, 0xc0000000);
+               /* PMM1 PCI Low Address */
+               out32r(PCIX0_PMM1PCILA, pciaddr);
+               /* PMM1 PCI High Address */
+               out32r(PCIX0_PMM1PCIHA, 0x00000000);
+               /* 256MB + No prefetching, and enable region */
+               out32r(PCIX0_PMM1MA, 0xf0000001);
        } else {
                printf("Usage:\npmm %s\n", cmdtp->help);
        }
index edf3a14..5b811bb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2007
+ * (C) Copyright 2007-2008
  * Matthias Fuchs, esd gmbh, matthias.fuchs@esd-electronics.com.
  * Based on board/amcc/sequoia/sequoia.c
  *
@@ -32,6 +32,7 @@
 #include <ppc440.h>
 #include <asm/processor.h>
 #include <asm/io.h>
+#include <asm/bitops.h>
 #include <command.h>
 #include <i2c.h>
 #ifdef CONFIG_RESET_PHY_R
 
 DECLARE_GLOBAL_DATA_PTR;
 
-extern flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips   */
+extern flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
 
 ulong flash_get_size(ulong base, int banknum);
 int pci_is_66mhz(void);
-int bootstrap_eeprom_read(unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt);
-
+int bootstrap_eeprom_read(unsigned dev_addr, unsigned offset,
+                         uchar *buffer, unsigned cnt);
 
 struct serial_device *default_serial_console(void)
 {
@@ -70,7 +71,8 @@ struct serial_device *default_serial_console(void)
                /* mark scratchreg valid */
                scratchreg = (scratchreg & 0xffffff00) | 0x80;
 
-               i = bootstrap_eeprom_read(CFG_I2C_BOOT_EEPROM_ADDR, 0x10, buf, 4);
+               i = bootstrap_eeprom_read(CFG_I2C_BOOT_EEPROM_ADDR,
+                                         0x10, buf, 4);
                if ((i != -1) && (buf[0] == 0x19) && (buf[1] == 0x75)) {
                        scratchreg |= buf[2];
 
@@ -99,10 +101,10 @@ int board_early_init_f(void)
        mtdcr(ebccfga, xbcfg);
        mtdcr(ebccfgd, 0xf8400000);
 
-       /*--------------------------------------------------------------------
+       /*
         * Setup the GPIO pins
         * TODO: setup GPIOs via CFG_4xx_GPIO_TABLE in board's config file
-        *-------------------------------------------------------------------*/
+        */
        out32(GPIO0_OR,    0x40000002);
        out32(GPIO0_TCR,   0x4c90011f);
        out32(GPIO0_OSRL,  0x28011400);
@@ -141,9 +143,9 @@ int board_early_init_f(void)
                mtspr(dbcr0, 0x20000000); /* do chip reset */
        }
 
-       /*--------------------------------------------------------------------
+       /*
         * Setup the interrupt controller polarities, triggers, etc.
-        *-------------------------------------------------------------------*/
+        */
        mtdcr(uic0sr, 0xffffffff);      /* clear all */
        mtdcr(uic0er, 0x00000000);      /* disable all */
        mtdcr(uic0cr, 0x00000005);      /* ATI & UIC1 crit are critical */
@@ -170,9 +172,11 @@ int board_early_init_f(void)
 
        /* select Ethernet pins */
        mfsdr(SDR0_PFC1, sdr0_pfc1);
-       sdr0_pfc1 = (sdr0_pfc1 & ~SDR0_PFC1_SELECT_MASK) | SDR0_PFC1_SELECT_CONFIG_4;
+       sdr0_pfc1 = (sdr0_pfc1 & ~SDR0_PFC1_SELECT_MASK) |
+               SDR0_PFC1_SELECT_CONFIG_4;
        mfsdr(SDR0_PFC2, sdr0_pfc2);
-       sdr0_pfc2 = (sdr0_pfc2 & ~SDR0_PFC2_SELECT_MASK) | SDR0_PFC2_SELECT_CONFIG_4;
+       sdr0_pfc2 = (sdr0_pfc2 & ~SDR0_PFC2_SELECT_MASK) |
+               SDR0_PFC2_SELECT_CONFIG_4;
 
        /* enable 2nd IIC */
        sdr0_pfc1 = (sdr0_pfc1 & ~SDR0_PFC1_SIS_MASK) | SDR0_PFC1_SIS_IIC1_SEL;
@@ -192,9 +196,9 @@ int board_early_init_f(void)
        return 0;
 }
 
-/*---------------------------------------------------------------------------+
 | misc_init_r.
 +---------------------------------------------------------------------------*/
+/*
* misc_init_r.
+ */
 int misc_init_r(void)
 {
        uint pbcr;
@@ -221,32 +225,7 @@ int misc_init_r(void)
        mtdcr(ebccfga, pb0cr);
 #endif
        pbcr = mfdcr(ebccfgd);
-       switch (gd->bd->bi_flashsize) {
-       case 1 << 20:
-               size_val = 0;
-               break;
-       case 2 << 20:
-               size_val = 1;
-               break;
-       case 4 << 20:
-               size_val = 2;
-               break;
-       case 8 << 20:
-               size_val = 3;
-               break;
-       case 16 << 20:
-               size_val = 4;
-               break;
-       case 32 << 20:
-               size_val = 5;
-               break;
-       case 64 << 20:
-               size_val = 6;
-               break;
-       case 128 << 20:
-               size_val = 7;
-               break;
-       }
+       size_val = ffs(gd->bd->bi_flashsize) - 21;
        pbcr = (pbcr & 0x0001ffff) | gd->bd->bi_flashstart | (size_val << 17);
 #if defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_NAND_SPL)
        mtdcr(ebccfga, pb2cr);
@@ -286,20 +265,22 @@ int misc_init_r(void)
                mfsdr(SDR0_USB2H0CR, usb2h0cr);
 
                usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_XOCLK_MASK;
-               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_XOCLK_EXTERNAL;       /*0*/
+               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_XOCLK_EXTERNAL;
                usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_WDINT_MASK;
-               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_WDINT_16BIT_30MHZ;    /*1*/
+               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_WDINT_16BIT_30MHZ;
                usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_DVBUS_MASK;
-               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DVBUS_PURDIS;         /*0*/
+               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DVBUS_PURDIS;
                usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_DWNSTR_MASK;
-               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DWNSTR_HOST;          /*1*/
+               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DWNSTR_HOST;
                usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_UTMICN_MASK;
-               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_UTMICN_HOST;          /*1*/
+               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_UTMICN_HOST;
 
-               /* An 8-bit/60MHz interface is the only possible alternative
-                  when connecting the Device to the PHY */
+               /*
+                * An 8-bit/60MHz interface is the only possible alternative
+                * when connecting the Device to the PHY
+                */
                usb2h0cr   = usb2h0cr &~SDR0_USB2H0CR_WDINT_MASK;
-               usb2h0cr   = usb2h0cr | SDR0_USB2H0CR_WDINT_16BIT_30MHZ;        /*1*/
+               usb2h0cr   = usb2h0cr | SDR0_USB2H0CR_WDINT_16BIT_30MHZ;
 
                usb2d0cr = usb2d0cr &~SDR0_USB2D0CR_USB2DEV_EBC_SEL_MASK;
                sdr0_pfc1 = sdr0_pfc1 &~SDR0_PFC1_UES_MASK;
@@ -309,7 +290,7 @@ int misc_init_r(void)
                mtsdr(SDR0_USB2PHY0CR, usb2phy0cr);
                mtsdr(SDR0_USB2H0CR, usb2h0cr);
 
-               /*clear resets*/
+               /* clear resets */
                udelay(1000);
                mtsdr(SDR0_SRST1, 0x00000000);
                udelay(1000);
@@ -317,18 +298,18 @@ int misc_init_r(void)
 
                printf("USB:   Host\n");
 
-       } else if ((strcmp(act, "dev") == 0) || (in_be32((void*)GPIO0_IR) & GPIO0_USB_PRSNT)) {
-               /*-------------------PATCH-------------------------------*/
+       } else if ((strcmp(act, "dev") == 0) ||
+                  (in_be32((void*)GPIO0_IR) & GPIO0_USB_PRSNT)) {
                mfsdr(SDR0_USB2PHY0CR, usb2phy0cr);
 
                usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_XOCLK_MASK;
-               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_XOCLK_EXTERNAL;       /*0*/
+               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_XOCLK_EXTERNAL;
                usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_DVBUS_MASK;
-               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DVBUS_PURDIS;         /*0*/
+               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DVBUS_PURDIS;
                usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_DWNSTR_MASK;
-               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DWNSTR_HOST;          /*1*/
+               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DWNSTR_HOST;
                usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_UTMICN_MASK;
-               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_UTMICN_HOST;          /*1*/
+               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_UTMICN_HOST;
                mtsdr(SDR0_USB2PHY0CR, usb2phy0cr);
 
                udelay (1000);
@@ -344,7 +325,6 @@ int misc_init_r(void)
 
                udelay (1000);
                mtsdr(SDR0_SRST1, 0x60306000);
-               /*-------------------PATCH-------------------------------*/
 
                /* SDR Setting */
                mfsdr(SDR0_USB2PHY0CR, usb2phy0cr);
@@ -353,23 +333,23 @@ int misc_init_r(void)
                mfsdr(SDR0_PFC1, sdr0_pfc1);
 
                usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_XOCLK_MASK;
-               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_XOCLK_EXTERNAL;       /*0*/
+               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_XOCLK_EXTERNAL;
                usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_WDINT_MASK;
-               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_WDINT_8BIT_60MHZ;     /*0*/
+               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_WDINT_8BIT_60MHZ;
                usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_DVBUS_MASK;
-               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DVBUS_PUREN;          /*1*/
+               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DVBUS_PUREN;
                usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_DWNSTR_MASK;
-               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DWNSTR_DEV;           /*0*/
+               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DWNSTR_DEV;
                usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_UTMICN_MASK;
-               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_UTMICN_DEV;           /*0*/
+               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_UTMICN_DEV;
 
                usb2h0cr   = usb2h0cr &~SDR0_USB2H0CR_WDINT_MASK;
-               usb2h0cr   = usb2h0cr | SDR0_USB2H0CR_WDINT_8BIT_60MHZ;         /*0*/
+               usb2h0cr   = usb2h0cr | SDR0_USB2H0CR_WDINT_8BIT_60MHZ;
 
                usb2d0cr = usb2d0cr &~SDR0_USB2D0CR_USB2DEV_EBC_SEL_MASK;
 
                sdr0_pfc1 = sdr0_pfc1 &~SDR0_PFC1_UES_MASK;
-               sdr0_pfc1 = sdr0_pfc1 | SDR0_PFC1_UES_EBCHR_SEL;                /*1*/
+               sdr0_pfc1 = sdr0_pfc1 | SDR0_PFC1_UES_EBCHR_SEL;
 
                mtsdr(SDR0_USB2H0CR, usb2h0cr);
                mtsdr(SDR0_USB2PHY0CR, usb2phy0cr);
@@ -453,43 +433,42 @@ void pmc440_pci_fixup_irq(struct pci_controller *hose, pci_dev_t dev)
 }
 #endif
 
-/*************************************************************************
- *  pci_pre_init
- *
- *  This routine is called just prior to registering the hose and gives
- *  the board the opportunity to check things. Returning a value of zero
- *  indicates that things are bad & PCI initialization should be aborted.
+/*
+ * pci_pre_init
  *
- *     Different boards may wish to customize the pci controller structure
- *     (add regions, override default access routines, etc) or perform
- *     certain pre-initialization actions.
+ * This routine is called just prior to registering the hose and gives
+ * the board the opportunity to check things. Returning a value of zero
+ * indicates that things are bad & PCI initialization should be aborted.
  *
- ************************************************************************/
+ * Different boards may wish to customize the pci controller structure
+ * (add regions, override default access routines, etc) or perform
+ * certain pre-initialization actions.
+ */
 #if defined(CONFIG_PCI)
 int pci_pre_init(struct pci_controller *hose)
 {
        unsigned long addr;
 
-       /*-------------------------------------------------------------------------+
-         | Set priority for all PLB3 devices to 0.
-         | Set PLB3 arbiter to fair mode.
-         +-------------------------------------------------------------------------*/
+       /*
+        * Set priority for all PLB3 devices to 0.
+        * Set PLB3 arbiter to fair mode.
+        */
        mfsdr(sdr_amp1, addr);
        mtsdr(sdr_amp1, (addr & 0x000000FF) | 0x0000FF00);
        addr = mfdcr(plb3_acr);
        mtdcr(plb3_acr, addr | 0x80000000);
 
-       /*-------------------------------------------------------------------------+
-         | Set priority for all PLB4 devices to 0.
-         +-------------------------------------------------------------------------*/
+       /*
+        * Set priority for all PLB4 devices to 0.
+        */
        mfsdr(sdr_amp0, addr);
        mtsdr(sdr_amp0, (addr & 0x000000FF) | 0x0000FF00);
        addr = mfdcr(plb4_acr) | 0xa0000000;    /* Was 0x8---- */
        mtdcr(plb4_acr, addr);
 
-       /*-------------------------------------------------------------------------+
-         | Set Nebula PLB4 arbiter to fair mode.
-         +-------------------------------------------------------------------------*/
+       /*
+        * Set Nebula PLB4 arbiter to fair mode.
+        */
        /* Segment0 */
        addr = (mfdcr(plb0_acr) & ~plb0_acr_ppm_mask) | plb0_acr_ppm_fair;
        addr = (addr & ~plb0_acr_hbu_mask) | plb0_acr_hbu_enabled;
@@ -512,64 +491,84 @@ int pci_pre_init(struct pci_controller *hose)
 }
 #endif /* defined(CONFIG_PCI) */
 
-/*************************************************************************
- *  pci_target_init
- *
- *     The bootstrap configuration provides default settings for the pci
- *     inbound map (PIM). But the bootstrap config choices are limited and
- *     may not be sufficient for a given board.
+/*
+ * pci_target_init
  *
- ************************************************************************/
+ * The bootstrap configuration provides default settings for the pci
+ * inbound map (PIM). But the bootstrap config choices are limited and
+ * may not be sufficient for a given board.
+ */
 #if defined(CONFIG_PCI) && defined(CFG_PCI_TARGET_INIT)
 void pci_target_init(struct pci_controller *hose)
 {
-       /*--------------------------------------------------------------------------+
+       char *ptmla_str, *ptmms_str;
+
+       /*
         * Set up Direct MMIO registers
-        *--------------------------------------------------------------------------*/
-       /*--------------------------------------------------------------------------+
-         | PowerPC440EPX PCI Master configuration.
-         | Map one 1Gig range of PLB/processor addresses to PCI memory space.
-         |   PLB address 0x80000000-0xBFFFFFFF ==> PCI address 0x80000000-0xBFFFFFFF
-         |   Use byte reversed out routines to handle endianess.
-         | Make this region non-prefetchable.
-         +--------------------------------------------------------------------------*/
-       out32r(PCIX0_PMM0MA, 0x00000000);       /* PMM0 Mask/Attribute - disabled b4 setting */
+        */
+       /*
+        * PowerPC440EPX PCI Master configuration.
+        * Map one 1Gig range of PLB/processor addresses to PCI memory space.
+        * PLB address 0x80000000-0xBFFFFFFF
+        *     ==> PCI address 0x80000000-0xBFFFFFFF
+        * Use byte reversed out routines to handle endianess.
+        * Make this region non-prefetchable.
+        */
+       out32r(PCIX0_PMM0MA, 0x00000000);       /* PMM0 Mask/Attribute */
+                                               /* - disabled b4 setting */
        out32r(PCIX0_PMM0LA, CFG_PCI_MEMBASE);  /* PMM0 Local Address */
-       out32r(PCIX0_PMM0PCILA, CFG_PCI_MEMBASE);       /* PMM0 PCI Low Address */
+       out32r(PCIX0_PMM0PCILA, CFG_PCI_MEMBASE); /* PMM0 PCI Low Address */
        out32r(PCIX0_PMM0PCIHA, 0x00000000);    /* PMM0 PCI High Address */
-       out32r(PCIX0_PMM0MA, 0xc0000001);       /* 1G + No prefetching, and enable region */
+       out32r(PCIX0_PMM0MA, 0xc0000001);       /* 1G + No prefetching, */
+                                               /* and enable region */
 
        if (!is_monarch()) {
-               /* BAR1: top 64MB of RAM */
-               out32r(PCIX0_PTM1MS, 0xfc000001);       /* Memory Size/Attribute */
-               out32r(PCIX0_PTM1LA, 0x0c000000);       /* Local Addr. Reg */
+               ptmla_str = getenv("ptm1la");
+               ptmms_str = getenv("ptm1ms");
+               if(NULL != ptmla_str && NULL != ptmms_str ) {
+                       out32r(PCIX0_PTM1MS,
+                              simple_strtoul(ptmms_str, NULL, 16));
+                       out32r(PCIX0_PTM1LA,
+                              simple_strtoul(ptmla_str, NULL, 16));
+               } else {
+                       /* BAR1: default top 64MB of RAM */
+                       out32r(PCIX0_PTM1MS, 0xfc000001);
+                       out32r(PCIX0_PTM1LA, 0x0c000000);
+               }
        } else {
-               /* BAR1: complete 256MB RAM (TODO: make dynamic) */
-               out32r(PCIX0_PTM1MS, 0xf0000001);       /* Memory Size/Attribute */
-               out32r(PCIX0_PTM1LA, 0x00000000);       /* Local Addr. Reg */
+               /* BAR1: default: complete 256MB RAM */
+               out32r(PCIX0_PTM1MS, 0xf0000001);
+               out32r(PCIX0_PTM1LA, 0x00000000);
        }
 
-       /* BAR2: 16 MB FPGA registers */
-       out32r(PCIX0_PTM2MS, 0xff000001);       /* Memory Size/Attribute */
-       out32r(PCIX0_PTM2LA, 0xef000000);       /* Local Addr. Reg */
+       ptmla_str = getenv("ptm2la");           /* Local Addr. Reg */
+       ptmms_str = getenv("ptm2ms");           /* Memory Size/Attribute */
+       if(NULL != ptmla_str && NULL != ptmms_str ) {
+               out32r(PCIX0_PTM2MS, simple_strtoul(ptmms_str, NULL, 16));
+               out32r(PCIX0_PTM2LA, simple_strtoul(ptmla_str, NULL, 16));
+       } else {
+               /* BAR2: default: 16 MB FPGA + registers */
+               out32r(PCIX0_PTM2MS, 0xff000001); /* Memory Size/Attribute */
+               out32r(PCIX0_PTM2LA, 0xef000000); /* Local Addr. Reg */
+       }
 
        if (is_monarch()) {
                /* BAR2: map FPGA registers behind system memory at 1GB */
                pci_write_config_dword(0, PCI_BASE_ADDRESS_2, 0x40000008);
        }
 
-       /*--------------------------------------------------------------------------+
+       /*
         * Set up Configuration registers
-        *--------------------------------------------------------------------------*/
+        */
 
        /* Program the board's vendor id */
        pci_write_config_word(0, PCI_SUBSYSTEM_VENDOR_ID,
                              CFG_PCI_SUBSYS_VENDORID);
 
-#if 0   /* disabled for PMC405 backward compatibility */
+       /* disabled for PMC405 backward compatibility */
        /* Configure command register as bus master */
-       pci_write_config_word(0, PCI_COMMAND, PCI_COMMAND_MASTER);
-#endif
+       /* pci_write_config_word(0, PCI_COMMAND, PCI_COMMAND_MASTER); */
+
 
        /* 240nS PCI clock */
        pci_write_config_word(0, PCI_LATENCY_TIMER, 1);
@@ -587,8 +586,10 @@ void pci_target_init(struct pci_controller *hose)
                                      CFG_PCI_CLASSCODE_NONMONARCH);
 
                /* PCI configuration done: release ERREADY */
-               out_be32((void*)GPIO1_OR,  in_be32((void*)GPIO1_OR)  | GPIO1_PPC_EREADY);
-               out_be32((void*)GPIO1_TCR, in_be32((void*)GPIO1_TCR) | GPIO1_PPC_EREADY);
+               out_be32((void*)GPIO1_OR,
+                        in_be32((void*)GPIO1_OR) | GPIO1_PPC_EREADY);
+               out_be32((void*)GPIO1_TCR,
+                        in_be32((void*)GPIO1_TCR) | GPIO1_PPC_EREADY);
        } else {
                /* Program the board's subsystem id/classcode */
                pci_write_config_word(0, PCI_SUBSYSTEM_ID,
@@ -599,20 +600,19 @@ void pci_target_init(struct pci_controller *hose)
 }
 #endif /* defined(CONFIG_PCI) && defined(CFG_PCI_TARGET_INIT) */
 
-/*************************************************************************
- *  pci_master_init
- *
- ************************************************************************/
+/*
+ * pci_master_init
+ */
 #if defined(CONFIG_PCI) && defined(CFG_PCI_MASTER_INIT)
 void pci_master_init(struct pci_controller *hose)
 {
        unsigned short temp_short;
 
-       /*--------------------------------------------------------------------------+
-         | Write the PowerPC440 EP PCI Configuration regs.
-         |   Enable PowerPC440 EP to be a master on the PCI bus (PMM).
-         |   Enable PowerPC440 EP to act as a PCI memory target (PTM).
-         +--------------------------------------------------------------------------*/
+       /*
+        * Write the PowerPC440 EP PCI Configuration regs.
+        * Enable PowerPC440 EP to be a master on the PCI bus (PMM).
+        * Enable PowerPC440 EP to act as a PCI memory target (PTM).
+        */
        if (is_monarch()) {
                pci_read_config_word(0, PCI_COMMAND, &temp_short);
                pci_write_config_word(0, PCI_COMMAND,
@@ -622,7 +622,6 @@ void pci_master_init(struct pci_controller *hose)
 }
 #endif /* defined(CONFIG_PCI) && defined(CFG_PCI_MASTER_INIT) */
 
-
 static void wait_for_pci_ready(void)
 {
        int i;
@@ -649,22 +648,19 @@ static void wait_for_pci_ready(void)
        }
 }
 
-
-/*************************************************************************
- *  is_pci_host
- *
- *     This routine is called to determine if a pci scan should be
- *     performed. With various hardware environments (especially cPCI and
- *     PPMC) it's insufficient to depend on the state of the arbiter enable
- *     bit in the strap register, or generic host/adapter assumptions.
- *
- *     Rather than hard-code a bad assumption in the general 440 code, the
- *     440 pci code requires the board to decide at runtime.
+/*
+ * is_pci_host
  *
- *     Return 0 for adapter mode, non-zero for host (monarch) mode.
+ * This routine is called to determine if a pci scan should be
+ * performed. With various hardware environments (especially cPCI and
+ * PPMC) it's insufficient to depend on the state of the arbiter enable
+ * bit in the strap register, or generic host/adapter assumptions.
  *
+ * Rather than hard-code a bad assumption in the general 440 code, the
+ * 440 pci code requires the board to decide at runtime.
  *
- ************************************************************************/
+ * Return 0 for adapter mode, non-zero for host (monarch) mode.
+ */
 #if defined(CONFIG_PCI)
 int is_pci_host(struct pci_controller *hose)
 {
@@ -681,6 +677,7 @@ int is_pci_host(struct pci_controller *hose)
        return 0;
 }
 #endif /* defined(CONFIG_PCI) */
+
 #if defined(CONFIG_POST)
 /*
  * Returns 1 if keys pressed to start the power-on long-running tests
@@ -692,7 +689,6 @@ int post_hotkeys_pressed(void)
 }
 #endif /* CONFIG_POST */
 
-
 #ifdef CONFIG_RESET_PHY_R
 void reset_phy(void)
 {
@@ -713,17 +709,19 @@ void reset_phy(void)
 #endif
 
 #if defined(CFG_EEPROM_WREN)
-/* Input: <dev_addr>  I2C address of EEPROM device to enable.
- *         <state>     -1: deliver current state
+/*
+ *  Input: <dev_addr> I2C address of EEPROM device to enable.
+ *         <state>    -1: deliver current state
  *                    0: disable write
  *                    1: enable write
- *  Returns:           -1: wrong device address
- *                      0: dis-/en- able done
+ *  Returns:          -1: wrong device address
+ *                     0: dis-/en- able done
  *                  0/1: current state if <state> was -1.
  */
 int eeprom_write_enable(unsigned dev_addr, int state)
 {
-       if ((CFG_I2C_EEPROM_ADDR != dev_addr) && (CFG_I2C_BOOT_EEPROM_ADDR != dev_addr)) {
+       if ((CFG_I2C_EEPROM_ADDR != dev_addr) &&
+           (CFG_I2C_BOOT_EEPROM_ADDR != dev_addr)) {
                return -1;
        } else {
                switch (state) {
@@ -747,9 +745,9 @@ int eeprom_write_enable(unsigned dev_addr, int state)
 }
 #endif /* #if defined(CFG_EEPROM_WREN) */
 
-
 #define CFG_BOOT_EEPROM_PAGE_WRITE_BITS 3
-int bootstrap_eeprom_write(unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt)
+int bootstrap_eeprom_write(unsigned dev_addr, unsigned offset,
+                          uchar *buffer, unsigned cnt)
 {
        unsigned end = offset + cnt;
        unsigned blk_off;
@@ -758,7 +756,8 @@ int bootstrap_eeprom_write(unsigned dev_addr, unsigned offset, uchar *buffer, un
 #if defined(CFG_EEPROM_WREN)
        eeprom_write_enable(dev_addr, 1);
 #endif
-       /* Write data until done or would cross a write page boundary.
+       /*
+        * Write data until done or would cross a write page boundary.
         * We must write the address again when changing pages
         * because the address counter only increments within a page.
         */
@@ -780,7 +779,8 @@ int bootstrap_eeprom_write(unsigned dev_addr, unsigned offset, uchar *buffer, un
 #define        BOOT_EEPROM_PAGE_SIZE      (1 << CFG_BOOT_EEPROM_PAGE_WRITE_BITS)
 #define        BOOT_EEPROM_PAGE_OFFSET(x) ((x) & (BOOT_EEPROM_PAGE_SIZE - 1))
 
-               maxlen = BOOT_EEPROM_PAGE_SIZE - BOOT_EEPROM_PAGE_OFFSET(blk_off);
+               maxlen = BOOT_EEPROM_PAGE_SIZE -
+                       BOOT_EEPROM_PAGE_OFFSET(blk_off);
                if (maxlen > I2C_RXTX_LEN)
                        maxlen = I2C_RXTX_LEN;
 
@@ -803,14 +803,15 @@ int bootstrap_eeprom_write(unsigned dev_addr, unsigned offset, uchar *buffer, un
        return rcode;
 }
 
-
-int bootstrap_eeprom_read (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt)
+int bootstrap_eeprom_read (unsigned dev_addr, unsigned offset,
+                          uchar *buffer, unsigned cnt)
 {
        unsigned end = offset + cnt;
        unsigned blk_off;
        int rcode = 0;
 
-       /* Read data until done or would cross a page boundary.
+       /*
+        * Read data until done or would cross a page boundary.
         * We must write the address again when changing pages
         * because the next page may be in a different device.
         */
@@ -844,7 +845,6 @@ int bootstrap_eeprom_read (unsigned dev_addr, unsigned offset, uchar *buffer, un
        return rcode;
 }
 
-
 #if defined(CONFIG_USB_OHCI_NEW) && defined(CFG_USB_OHCI_BOARD_INIT)
 int usb_board_init(void)
 {
@@ -854,7 +854,8 @@ int usb_board_init(void)
        if ((act == NULL || strcmp(act, "hostdev") == 0) &&
            !(in_be32((void*)GPIO0_IR) & GPIO0_USB_PRSNT))
                /* enable power on USB socket */
-               out_be32((void*)GPIO1_OR, in_be32((void*)GPIO1_OR) & ~GPIO1_USB_PWR_N);
+               out_be32((void*)GPIO1_OR,
+                        in_be32((void*)GPIO1_OR) & ~GPIO1_USB_PWR_N);
 
        for (i=0; i<1000; i++)
                udelay(1000);
index e0b5113..94dd754 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 SECTIONS
 {
   /* Read-only sections, merged into text segment: */
index e140737..da2a400 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 4f47323..d21ecd4 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(m68k)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 3f23050..196f88c 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 9dad748..f5daaef 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index bea9524..1c5d891 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 9fa7604..2a8d9e2 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 18ab500..263da6b 100644 (file)
@@ -182,7 +182,7 @@ static int get_century_flag(void)
        return flag;
 }
 
-void rtc_get( struct rtc_time *tmp)
+int rtc_get( struct rtc_time *tmp)
 {
        if (phantom_flag < 0)
                phantom_flag = get_phantom_flag();
@@ -250,6 +250,8 @@ void rtc_get( struct rtc_time *tmp)
                tmp->tm_yday = 0;
                tmp->tm_isdst= 0;
        }
+
+       return 0;
 }
 
 void rtc_set( struct rtc_time *tmp )
index c231d82..0e7bd37 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index e4d8b10..a0121ce 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 0f9a157..25e16de 100644 (file)
@@ -26,7 +26,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index ec9dd02..99068e7 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index dea8a0d..ffa72cb 100644 (file)
@@ -96,6 +96,7 @@
 
 #ifdef CONFIG_FEC_ENET
 #define CFG_DISCOVER_PHY
+#define CONFIG_MII_INIT                1
 #endif
 
 
 */
 #define NR_8259_INTS   0
 
-/* Machine type
-*/
-#define _MACH_8xx (_MACH_fads)
-
 /*-----------------------------------------------------------------------
  * PCMCIA stuff
  *-----------------------------------------------------------------------
index 650572d..96c4e22 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 8ac0176..ca8ffb0 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 3165d56..1a25a98 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 6665e7f..6340b41 100644 (file)
@@ -29,10 +29,18 @@ endif
 
 LIB    = $(obj)lib$(VENDOR).a
 
-COBJS-${CONFIG_PQ_MDS_PIB}     += pq-mds-pib.o
-COBJS-${CONFIG_ID_EEPROM}      += sys_eeprom.o
+COBJS-${CONFIG_FSL_CADMUS}     += cadmus.o
+COBJS-${CONFIG_FSL_CDS_EEPROM} += cds_eeprom.o
+COBJS-${CONFIG_FSL_VIA}                += cds_via.o
 COBJS-${CONFIG_FSL_DIU_FB}     += fsl_diu_fb.o fsl_logo_bmp.o
 COBJS-${CONFIG_FSL_PIXIS}      += pixis.o
+COBJS-${CONFIG_PQ_MDS_PIB}     += pq-mds-pib.o
+COBJS-${CONFIG_ID_EEPROM}      += sys_eeprom.o
+
+COBJS-${CONFIG_MPC8541CDS}     += cds_pci_ft.o
+COBJS-${CONFIG_MPC8548CDS}     += cds_pci_ft.o
+COBJS-${CONFIG_MPC8555CDS}     += cds_pci_ft.o
+
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS-y))
index 9125bfc..9fda0ca 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(m68k)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 8ffd326..c8c215c 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(m68k)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 9b72f66..95b10c7 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(m68k)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index c13dd20..ba07426 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(m68k)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 4f47323..d21ecd4 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(m68k)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index ef28583..089dc10 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(m68k)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
diff --git a/board/freescale/m5275evb/Makefile b/board/freescale/m5275evb/Makefile
new file mode 100644 (file)
index 0000000..9a0fa80
--- /dev/null
@@ -0,0 +1,40 @@
+#
+# (C) Copyright 2000-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 $(TOPDIR)/config.mk
+
+LIB    = lib$(BOARD).a
+
+OBJS   = $(BOARD).o mii.o
+
+$(LIB):        .depend $(OBJS)
+       $(AR) crv $@ $(OBJS)
+
+#########################################################################
+
+.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
+               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+
+sinclude .depend
+
+#########################################################################
similarity index 97%
rename from board/r5200/config.mk
rename to board/freescale/m5275evb/config.mk
index 8fc5319..ccb2cf7 100644 (file)
@@ -22,4 +22,4 @@
 # MA 02111-1307 USA
 #
 
-TEXT_BASE = 0x10000000
+TEXT_BASE = 0xffe00000
diff --git a/board/freescale/m5275evb/m5275evb.c b/board/freescale/m5275evb/m5275evb.c
new file mode 100644 (file)
index 0000000..a1b2902
--- /dev/null
@@ -0,0 +1,112 @@
+/*
+ * (C) Copyright 2000-2003
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * Copyright (C) 2005-2008 Arthur Shipkowski (art@videon-central.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/immap.h>
+
+#define PERIOD         13      /* system bus period in ns */
+#define SDRAM_TREFI    7800    /* in ns */
+
+int checkboard(void)
+{
+       puts("Board: ");
+       puts("Freescale MCF5275 EVB\n");
+       return 0;
+};
+
+long int initdram(int board_type)
+{
+       volatile sdramctrl_t *sdp = (sdramctrl_t *)(MMAP_SDRAM);
+       volatile gpio_t *gpio_reg = (gpio_t *)(MMAP_GPIO);
+
+       gpio_reg->par_sdram = 0x3FF; /* Enable SDRAM */
+
+       /* Set up chip select */
+       sdp->sdbar0 = CFG_SDRAM_BASE;
+       sdp->sdbmr0 = MCF_SDRAMC_SDMRn_BAM_32M | MCF_SDRAMC_SDMRn_V;
+
+       /* Set up timing */
+       sdp->sdcfg1 = 0x83711630;
+       sdp->sdcfg2 = 0x46770000;
+
+       /* Enable clock */
+       sdp->sdcr = MCF_SDRAMC_SDCR_MODE_EN | MCF_SDRAMC_SDCR_CKE;
+
+       /* Set precharge */
+       sdp->sdcr |= MCF_SDRAMC_SDCR_IPALL;
+
+       /* Dummy write to start SDRAM */
+       *((volatile unsigned long *)CFG_SDRAM_BASE) = 0xa5a59696;
+
+       /* Send LEMR */
+       sdp->sdmr = MCF_SDRAMC_SDMR_BNKAD_LEMR
+                       | MCF_SDRAMC_SDMR_AD(0x0)
+                       | MCF_SDRAMC_SDMR_CMD;
+       *((volatile unsigned long *)CFG_SDRAM_BASE) = 0xa5a59696;
+
+       /* Send LMR */
+       sdp->sdmr = 0x058d0000;
+       *((volatile unsigned long *)CFG_SDRAM_BASE) = 0xa5a59696;
+
+       /* Stop sending commands */
+       sdp->sdmr &= ~(MCF_SDRAMC_SDMR_CMD);
+
+       /* Set precharge */
+       sdp->sdcr |= MCF_SDRAMC_SDCR_IPALL;
+       *((volatile unsigned long *)CFG_SDRAM_BASE) = 0xa5a59696;
+
+       /* Stop manual precharge, send 2 IREF */
+       sdp->sdcr &= ~(MCF_SDRAMC_SDCR_IPALL);
+       sdp->sdcr |= MCF_SDRAMC_SDCR_IREF;
+       *((volatile unsigned long *)CFG_SDRAM_BASE) = 0xa5a59696;
+       *((volatile unsigned long *)CFG_SDRAM_BASE) = 0xa5a59696;
+
+       /* Write mode register, clear reset DLL */
+       sdp->sdmr = 0x018d0000;
+       *((volatile unsigned long *)CFG_SDRAM_BASE) = 0xa5a59696;
+
+       /* Stop sending commands */
+       sdp->sdmr &= ~(MCF_SDRAMC_SDMR_CMD);
+       sdp->sdcr &= ~(MCF_SDRAMC_SDCR_MODE_EN);
+
+       /* Turn on auto refresh, lock SDMR */
+       sdp->sdcr =
+               MCF_SDRAMC_SDCR_CKE
+               | MCF_SDRAMC_SDCR_REF
+               | MCF_SDRAMC_SDCR_MUX(1)
+               /* 1 added to round up */
+               | MCF_SDRAMC_SDCR_RCNT((SDRAM_TREFI/(PERIOD*64)) - 1 + 1)
+               | MCF_SDRAMC_SDCR_DQS_OE(0x3);
+
+       return CFG_SDRAM_SIZE * 1024 * 1024;
+};
+
+int testdram(void)
+{
+       /* TODO: XXX XXX XXX */
+       printf("DRAM test not implemented!\n");
+
+       return (0);
+}
similarity index 92%
rename from board/r5200/mii.c
rename to board/freescale/m5275evb/mii.c
index 706c90f..6c7ace9 100644 (file)
@@ -36,10 +36,26 @@ DECLARE_GLOBAL_DATA_PTR;
 
 int fecpin_setclear(struct eth_device *dev, int setclear)
 {
+       struct fec_info_s *info = (struct fec_info_s *) dev->priv;
+       volatile gpio_t *gpio = (gpio_t *)MMAP_GPIO;
+
        if (setclear) {
                /* Enable Ethernet pins */
-               mbar_writeByte(MCF_GPIO_PAR_FECI2C, CFG_FECI2C);
+               if (info->iobase == CFG_FEC0_IOBASE) {
+                       gpio->par_feci2c |= 0x0F00;
+                       gpio->par_fec0hl |= 0xC0;
+               } else {
+                       gpio->par_feci2c |= 0x00A0;
+                       gpio->par_fec1hl |= 0xC0;
+               }
        } else {
+               if (info->iobase == CFG_FEC0_IOBASE) {
+                       gpio->par_feci2c &= ~0x0F00;
+                       gpio->par_fec0hl &= ~0xC0;
+               } else {
+                       gpio->par_feci2c &= ~0x00A0;
+                       gpio->par_fec1hl &= ~0xC0;
+               }
        }
 
        return 0;
@@ -131,7 +147,7 @@ uint mii_send(uint mii_cmd)
 
        return (mii_reply & 0xffff);    /* data read from phy */
 }
-#endif                         /* CFG_DISCOVER_PHY || (CONFIG_CMD_MII) */
+#endif /* CFG_DISCOVER_PHY || (CONFIG_COMMANDS & CONFIG_CMD_MII) */
 
 #if defined(CFG_DISCOVER_PHY)
 int mii_discover_phy(struct eth_device *dev)
@@ -200,7 +216,7 @@ int mii_discover_phy(struct eth_device *dev)
 }
 #endif                         /* CFG_DISCOVER_PHY */
 
-int mii_init(void) __attribute__((weak,alias("__mii_init")));
+void mii_init(void) __attribute__((weak,alias("__mii_init")));
 
 void __mii_init(void)
 {
diff --git a/board/freescale/m5275evb/u-boot.lds b/board/freescale/m5275evb/u-boot.lds
new file mode 100644 (file)
index 0000000..51c008f
--- /dev/null
@@ -0,0 +1,140 @@
+/*
+ * (C) Copyright 2000-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
+ */
+
+OUTPUT_ARCH(m68k)
+/* 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      :
+  {
+    /* WARNING - the following is hand-optimized to fit within */
+    /* the sector layout of our flash chips!   XXX FIXME XXX   */
+
+    cpu/mcf52x2/start.o                (.text)
+    common/dlmalloc.o          (.text)
+    lib_generic/string.o       (.text)
+    lib_generic/zlib.o         (.text)
+
+    . = DEFINED(env_offset) ? env_offset : .;
+    common/environment.o(.text)
+
+    *(.text)
+    *(.fixup)
+    *(.got1)
+  }
+  _etext = .;
+  PROVIDE (etext = .);
+  .rodata    :
+  {
+    *(.rodata)
+    *(.rodata1)
+  }
+  .fini      : { *(.fini)    } =0
+  .ctors     : { *(.ctors)   }
+  .dtors     : { *(.dtors)   }
+
+  /* Read-write section, merged into data segment: */
+  . = (. + 0x00FF) & 0xFFFFFF00;
+  _erotext = .;
+  PROVIDE (erotext = .);
+    .reloc   :
+  {
+    __got_start = .;
+    *(.got)
+    __got_end = .;
+    _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       :
+  {
+   _sbss = .;
+   *(.sbss) *(.scommon)
+   *(.dynbss)
+   *(.bss)
+   *(COMMON)
+   . = ALIGN(4);
+   _ebss = .;
+  }
+  _end = . ;
+  PROVIDE (end = .);
+}
index e48d1bc..cf9730d 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(m68k)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 9b994a0..47e1f67 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(m68k)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index de2cca8..6b50e8d 100644 (file)
@@ -95,6 +95,11 @@ typedef volatile unsigned char FLASH_PORT_WIDTHV;
 #define FLASH_28F256P30T       0x00BD  /* Intel 28F256P30T  ( 256M = 16M x 16 )        */
 #define FLASH_28F256P30B       0x00BE  /* Intel 28F256P30B  ( 256M = 16M x 16 )        */
 
+#if defined(CONFIG_SERIAL_FLASH) && defined(CONFIG_CF_DSPI)
+#define STM_ID_M25P16          0x20152015
+#define FLASH_M25P16           0x0055
+#endif
+
 #define SYNC                   __asm__("nop")
 
 /*-----------------------------------------------------------------------
@@ -111,6 +116,12 @@ void inline spin_wheel(void);
 void flash_sync_real_protect(flash_info_t * info);
 uchar intel_sector_protected(flash_info_t * info, ushort sector);
 
+#if defined(CONFIG_SERIAL_FLASH) && defined(CONFIG_CF_DSPI)
+int write_ser_data(flash_info_t * info, ulong dest, uchar * data, ulong cnt);
+int serial_flash_read_status(int chipsel);
+static int ser_flash_cs = 0;
+#endif
+
 flash_info_t flash_info[CFG_MAX_FLASH_BANKS];
 
 ulong flash_init(void)
@@ -119,6 +130,10 @@ ulong flash_init(void)
        ulong size = 0;
        ulong fbase = 0;
 
+#if defined(CONFIG_SERIAL_FLASH) && defined(CONFIG_CF_DSPI)
+       dspi_init();
+#endif
+
        for (i = 0; i < CFG_MAX_FLASH_BANKS; i++) {
                memset(&flash_info[i], 0, sizeof(flash_info_t));
 
@@ -129,6 +144,11 @@ ulong flash_init(void)
                case 1:
                        fbase = (ulong) CFG_FLASH1_BASE;
                        break;
+#if defined(CONFIG_SERIAL_FLASH) && defined(CONFIG_CF_DSPI)
+               case 2:
+                       fbase = (ulong) CFG_FLASH2_BASE;
+                       break;
+#endif
                }
 
                flash_get_size((FPWV *) fbase, &flash_info[i]);
@@ -152,7 +172,6 @@ int flash_get_offsets(ulong base, flash_info_t * info)
 {
        int i, j, k;
        int sectors, bs, banks;
-       ulong start;
 
        if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_ATM) {
                int sect[] = CFG_ATMEL_SECT;
@@ -196,6 +215,15 @@ int flash_get_offsets(ulong base, flash_info_t * info)
 
                *addr16 = (FPW) INTEL_RESET;    /* restore read mode */
        }
+#if defined(CONFIG_SERIAL_FLASH) && defined(CONFIG_CF_DSPI)
+       if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_STM) {
+               info->start[0] = CFG_FLASH2_BASE;
+               for (k = 0, i = 0; i < CFG_STM_SECT; i++, k++) {
+                       info->start[k + 1] = info->start[k] + CFG_STM_SECTSZ;
+                       info->protect[k] = 0;
+               }
+       }
+#endif
 
        return ERR_OK;
 }
@@ -211,6 +239,11 @@ void flash_print_info(flash_info_t * info)
        case FLASH_MAN_ATM:
                printf("ATMEL ");
                break;
+#if defined(CONFIG_SERIAL_FLASH) && defined(CONFIG_CF_DSPI)
+       case FLASH_MAN_STM:
+               printf("ST ");
+               break;
+#endif
        default:
                printf("Unknown Vendor ");
                break;
@@ -221,8 +254,13 @@ void flash_print_info(flash_info_t * info)
                printf("AT49BV040A\n");
                break;
        case FLASH_28F128J3A:
-               printf("Intel 28F128J3A\n");
+               printf("28F128J3A\n");
+               break;
+#if defined(CONFIG_SERIAL_FLASH) && defined(CONFIG_CF_DSPI)
+       case FLASH_M25P16:
+               printf("M25P16\n");
                break;
+#endif
        default:
                printf("Unknown Chip Type\n");
                return;
@@ -267,6 +305,45 @@ ulong flash_get_size(FPWV * addr, flash_info_t * info)
        u16 value;
        int i;
 
+#if defined(CONFIG_SERIAL_FLASH) && defined(CONFIG_CF_DSPI)
+       if ((ulong) addr == CFG_FLASH2_BASE) {
+               int manufactId = 0;
+               int deviceId = 0;
+
+               ser_flash_cs = 1;
+
+               dspi_tx(ser_flash_cs, 0x80, SER_RDID);
+               dspi_tx(ser_flash_cs, 0x80, 0);
+               dspi_tx(ser_flash_cs, 0x80, 0);
+               dspi_tx(ser_flash_cs, 0x80, 0);
+
+               dspi_rx();
+               manufactId = dspi_rx();
+               deviceId = dspi_rx() << 8;
+               deviceId |= dspi_rx();
+
+               dspi_tx(ser_flash_cs, 0x00, 0);
+               dspi_rx();
+
+               switch (manufactId) {
+               case (u8) STM_MANUFACT:
+                       info->flash_id = FLASH_MAN_STM;
+                       break;
+               }
+
+               switch (deviceId) {
+               case (u16) STM_ID_M25P16:
+                       info->flash_id += FLASH_M25P16;
+                       break;
+               }
+
+               info->sector_count = CFG_STM_SECT;
+               info->size = CFG_STM_SECT * CFG_STM_SECTSZ;
+
+               return (info->size);
+       }
+#endif
+
        addr[FLASH_CYCLE1] = (FPWV) 0x00AA00AA; /* for Atmel, Intel ignores this */
        addr[FLASH_CYCLE2] = (FPWV) 0x00550055; /* for Atmel, Intel ignores this */
        addr[FLASH_CYCLE1] = (FPWV) 0x00900090; /* selects Intel or Atmel */
@@ -383,6 +460,21 @@ int flash_cmd_rd(volatile u16 * addr, int index)
        return (int)addr[index];
 }
 
+#if defined(CONFIG_SERIAL_FLASH) && defined(CONFIG_CF_DSPI)
+int serial_flash_read_status(int chipsel)
+{
+       u16 status;
+
+       dspi_tx(chipsel, 0x80, SER_RDSR);
+       dspi_rx();
+
+       dspi_tx(chipsel, 0x00, 0);
+       status = dspi_rx();
+
+       return status;
+}
+#endif
+
 /*
  * This function gets the u-boot flash sector protection status
  * (flash_info_t.protect[]) in sync with the sector protection
@@ -462,8 +554,11 @@ int flash_erase(flash_info_t * info, int s_first, int s_last)
 {
        int flag, prot, sect;
        ulong type, start, last;
-       int rcode = 0, intel = 0;
-
+       int rcode = 0, flashtype = 0;
+#if defined(CONFIG_SERIAL_FLASH) && defined(CONFIG_CF_DSPI)
+       int count;
+       u16 status;
+#endif
        if ((s_first < 0) || (s_first > s_last)) {
                if (info->flash_id == FLASH_UNKNOWN)
                        printf("- missing\n");
@@ -474,19 +569,25 @@ int flash_erase(flash_info_t * info, int s_first, int s_last)
 
        type = (info->flash_id & FLASH_VENDMASK);
 
-       if (type != (FLASH_MAN_INTEL & FLASH_VENDMASK)) {
-               if (type != (FLASH_MAN_ATM & FLASH_VENDMASK)) {
-                       type = (info->flash_id & FLASH_VENDMASK);
-                       printf
-                           ("Can't erase unknown flash type %08lx - aborted\n",
-                            info->flash_id);
-                       return 1;
-               }
+       switch (type) {
+       case FLASH_MAN_ATM:
+               flashtype = 1;
+               break;
+       case FLASH_MAN_INTEL:
+               flashtype = 2;
+               break;
+#if defined(CONFIG_SERIAL_FLASH) && defined(CONFIG_CF_DSPI)
+       case FLASH_MAN_STM:
+               flashtype = 3;
+               break;
+#endif
+       default:
+               type = (info->flash_id & FLASH_VENDMASK);
+               printf("Can't erase unknown flash type %08lx - aborted\n",
+                      info->flash_id);
+               return 1;
        }
 
-       if (type == FLASH_MAN_INTEL)
-               intel = 1;
-
        prot = 0;
        for (sect = s_first; sect <= s_last; ++sect) {
                if (info->protect[sect]) {
@@ -503,6 +604,51 @@ int flash_erase(flash_info_t * info, int s_first, int s_last)
        start = get_timer(0);
        last = start;
 
+#if defined(CONFIG_SERIAL_FLASH) && defined(CONFIG_CF_DSPI)
+       /* Perform bulk erase */
+       if (flashtype == 3) {
+               if ((s_last - s_first) == (CFG_STM_SECT - 1)) {
+                       if (prot == 0) {
+                               dspi_tx(ser_flash_cs, 0x00, SER_WREN);
+                               dspi_rx();
+
+                               status = serial_flash_read_status(ser_flash_cs);
+                               if (((status & 0x9C) != 0)
+                                   && ((status & 0x02) != 0x02)) {
+                                       printf("Can't erase flash\n");
+                                       return 1;
+                               }
+
+                               dspi_tx(ser_flash_cs, 0x00, SER_BULK_ERASE);
+                               dspi_rx();
+
+                               count = 0;
+                               start = get_timer(0);
+                               do {
+                                       status =
+                                           serial_flash_read_status
+                                           (ser_flash_cs);
+
+                                       if (count++ > 0x10000) {
+                                               spin_wheel();
+                                               count = 0;
+                                       }
+
+                                       if (get_timer(start) >
+                                           CFG_FLASH_ERASE_TOUT) {
+                                               printf("Timeout\n");
+                                               return 1;
+                                       }
+                               } while (status & 0x01);
+
+                               printf("\b. done\n");
+                               return 0;
+                       } else if (prot == CFG_STM_SECT) {
+                               return 1;
+                       }
+               }
+       }
+#endif
        /* Start erase on unprotected sectors */
        for (sect = s_first; sect <= s_last; sect++) {
                if (info->protect[sect] == 0) { /* not protected */
@@ -515,65 +661,116 @@ int flash_erase(flash_info_t * info, int s_first, int s_last)
                        /* arm simple, non interrupt dependent timer */
                        start = get_timer(0);
 
-                       if (intel) {
-                               *addr = (FPW) INTEL_READID;
-                               min = addr[INTEL_CFI_TERB] & 0xff;
-                               min = 1 << min; /* ms */
-                               min = (min / info->sector_count) * 1000;
-
-                               /* start erase block */
-                               *addr = (FPW) INTEL_CLEAR;      /* clear status register */
-                               *addr = (FPW) INTEL_ERASE;      /* erase setup */
-                               *addr = (FPW) INTEL_CONFIRM;    /* erase confirm */
-
-                               while ((*addr & (FPW) INTEL_FINISHED) !=
-                                      (FPW) INTEL_FINISHED) {
-
-                                       if (get_timer(start) >
-                                           CFG_FLASH_ERASE_TOUT) {
-                                               printf("Timeout\n");
-                                               *addr = (FPW) INTEL_SUSERASE;   /* suspend erase     */
-                                               *addr = (FPW) INTEL_RESET;      /* reset to read mode */
-
-                                               rcode = 1;
-                                               break;
+                       switch (flashtype) {
+                       case 1:
+                               {
+                                       FPWV *base;     /* first address in bank */
+                                       FPWV *atmeladdr;
+
+                                       flag = disable_interrupts();
+
+                                       atmeladdr = (FPWV *) addr;      /* concatenate to 8 bit */
+                                       base = (FPWV *) (CFG_ATMEL_BASE);       /* First sector */
+
+                                       base[FLASH_CYCLE1] = (u8) 0x00AA00AA;   /* unlock */
+                                       base[FLASH_CYCLE2] = (u8) 0x00550055;   /* unlock */
+                                       base[FLASH_CYCLE1] = (u8) 0x00800080;   /* erase mode */
+                                       base[FLASH_CYCLE1] = (u8) 0x00AA00AA;   /* unlock */
+                                       base[FLASH_CYCLE2] = (u8) 0x00550055;   /* unlock */
+                                       *atmeladdr = (u8) 0x00300030;   /* erase sector */
+
+                                       if (flag)
+                                               enable_interrupts();
+
+                                       while ((*atmeladdr & (u8) 0x00800080) !=
+                                              (u8) 0x00800080) {
+                                               if (get_timer(start) >
+                                                   CFG_FLASH_ERASE_TOUT) {
+                                                       printf("Timeout\n");
+                                                       *atmeladdr = (u8) 0x00F000F0;   /* reset to read mode */
+
+                                                       rcode = 1;
+                                                       break;
+                                               }
                                        }
-                               }
-
-                               *addr = (FPW) INTEL_RESET;      /* resest to read mode          */
-                       } else {
-                               FPWV *base;     /* first address in bank */
-                               FPWV *atmeladdr;
-
-                               flag = disable_interrupts();
 
-                               atmeladdr = (FPWV *) addr;      /* concatenate to 8 bit */
-                               base = (FPWV *) (CFG_ATMEL_BASE);       /* First sector */
-
-                               base[FLASH_CYCLE1] = (u8) 0x00AA00AA;   /* unlock */
-                               base[FLASH_CYCLE2] = (u8) 0x00550055;   /* unlock */
-                               base[FLASH_CYCLE1] = (u8) 0x00800080;   /* erase mode */
-                               base[FLASH_CYCLE1] = (u8) 0x00AA00AA;   /* unlock */
-                               base[FLASH_CYCLE2] = (u8) 0x00550055;   /* unlock */
-                               *atmeladdr = (u8) 0x00300030;   /* erase sector */
+                                       *atmeladdr = (u8) 0x00F000F0;   /* reset to read mode */
+                                       break;
+                               }
 
-                               if (flag)
-                                       enable_interrupts();
+                       case 2:
+                               {
+                                       *addr = (FPW) INTEL_READID;
+                                       min = addr[INTEL_CFI_TERB] & 0xff;
+                                       min = 1 << min; /* ms */
+                                       min = (min / info->sector_count) * 1000;
+
+                                       /* start erase block */
+                                       *addr = (FPW) INTEL_CLEAR;      /* clear status register */
+                                       *addr = (FPW) INTEL_ERASE;      /* erase setup */
+                                       *addr = (FPW) INTEL_CONFIRM;    /* erase confirm */
+
+                                       while ((*addr & (FPW) INTEL_FINISHED) !=
+                                              (FPW) INTEL_FINISHED) {
+
+                                               if (get_timer(start) >
+                                                   CFG_FLASH_ERASE_TOUT) {
+                                                       printf("Timeout\n");
+                                                       *addr = (FPW) INTEL_SUSERASE;   /* suspend erase     */
+                                                       *addr = (FPW) INTEL_RESET;      /* reset to read mode */
+
+                                                       rcode = 1;
+                                                       break;
+                                               }
+                                       }
 
-                               while ((*atmeladdr & (u8) 0x00800080) !=
-                                      (u8) 0x00800080) {
-                                       if (get_timer(start) >
-                                           CFG_FLASH_ERASE_TOUT) {
-                                               printf("Timeout\n");
-                                               *atmeladdr = (u8) 0x00F000F0;   /* reset to read mode */
+                                       *addr = (FPW) INTEL_RESET;      /* resest to read mode          */
+                                       break;
+                               }
 
-                                               rcode = 1;
-                                               break;
+#if defined(CONFIG_SERIAL_FLASH) && defined(CONFIG_CF_DSPI)
+                       case 3:
+                               {
+                                       u8 sec = ((ulong) addr >> 16) & 0xFF;
+
+                                       dspi_tx(ser_flash_cs, 0x00, SER_WREN);
+                                       dspi_rx();
+                                       status =
+                                           serial_flash_read_status
+                                           (ser_flash_cs);
+                                       if (((status & 0x9C) != 0)
+                                           && ((status & 0x02) != 0x02)) {
+                                               printf("Error Programming\n");
+                                               return 1;
                                        }
-                               }
 
-                               *atmeladdr = (u8) 0x00F000F0;   /* reset to read mode */
-                       }       /* Atmel or Intel */
+                                       dspi_tx(ser_flash_cs, 0x80,
+                                               SER_SECT_ERASE);
+                                       dspi_tx(ser_flash_cs, 0x80, sec);
+                                       dspi_tx(ser_flash_cs, 0x80, 0);
+                                       dspi_tx(ser_flash_cs, 0x00, 0);
+
+                                       dspi_rx();
+                                       dspi_rx();
+                                       dspi_rx();
+                                       dspi_rx();
+
+                                       do {
+                                               status =
+                                                   serial_flash_read_status
+                                                   (ser_flash_cs);
+
+                                               if (get_timer(start) >
+                                                   CFG_FLASH_ERASE_TOUT) {
+                                                       printf("Timeout\n");
+                                                       return 1;
+                                               }
+                                       } while (status & 0x01);
+
+                                       break;
+                               }
+#endif
+                       }       /* switch (flashtype) */
                }
        }
        printf(" done\n");
@@ -583,6 +780,8 @@ int flash_erase(flash_info_t * info, int s_first, int s_last)
 
 int write_buff(flash_info_t * info, uchar * src, ulong addr, ulong cnt)
 {
+       int count;
+
        if (info->flash_id == FLASH_UNKNOWN)
                return 4;
 
@@ -623,7 +822,7 @@ int write_buff(flash_info_t * info, uchar * src, ulong addr, ulong cnt)
                {
                        ulong cp, wp;
                        u16 data;
-                       int count, i, l, rc, port_width;
+                       int i, l, rc, port_width;
 
                        /* get lower word aligned address */
                        wp = addr;
@@ -724,6 +923,51 @@ int write_buff(flash_info_t * info, uchar * src, ulong addr, ulong cnt)
 
                }               /* case FLASH_MAN_INTEL */
 
+#if defined(CONFIG_SERIAL_FLASH) && defined(CONFIG_CF_DSPI)
+       case FLASH_MAN_STM:
+               {
+                       ulong wp;
+                       u8 *data = (u8 *) src;
+                       int left;       /* number of bytes left to program */
+
+                       wp = addr;
+
+                       /* page align, each page is 256 bytes */
+                       if ((wp % 0x100) != 0) {
+                               left = (0x100 - (wp & 0xFF));
+                               write_ser_data(info, wp, data, left);
+                               cnt -= left;
+                               wp += left;
+                               data += left;
+                       }
+
+                       /* page program - 256 bytes at a time */
+                       if (cnt > 255) {
+                               count = 0;
+                               while (cnt >= 0x100) {
+                                       write_ser_data(info, wp, data, 0x100);
+                                       cnt -= 0x100;
+                                       wp += 0x100;
+                                       data += 0x100;
+
+                                       if (count++ > 0x400) {
+                                               spin_wheel();
+                                               count = 0;
+                                       }
+                               }
+                       }
+
+                       /* remainint bytes */
+                       if (cnt && (cnt < 256)) {
+                               write_ser_data(info, wp, data, cnt);
+                               wp += cnt;
+                               data += cnt;
+                               cnt -= cnt;
+                       }
+
+                       printf("\b.");
+               }
+#endif
        }                       /* switch */
 
        return ERR_OK;
@@ -844,6 +1088,75 @@ int write_data(flash_info_t * info, ulong dest, FPW data)
        return (0);
 }
 
+#if defined(CONFIG_SERIAL_FLASH) && defined(CONFIG_CF_DSPI)
+int write_ser_data(flash_info_t * info, ulong dest, uchar * data, ulong cnt)
+{
+       ulong start;
+       int status, i;
+       u8 flashdata;
+
+       /* Check if Flash is (sufficiently) erased */
+       dspi_tx(ser_flash_cs, 0x80, SER_READ);
+       dspi_tx(ser_flash_cs, 0x80, (dest >> 16) & 0xFF);
+       dspi_tx(ser_flash_cs, 0x80, (dest >> 8) & 0xFF);
+       dspi_tx(ser_flash_cs, 0x80, dest & 0xFF);
+       dspi_rx();
+       dspi_rx();
+       dspi_rx();
+       dspi_rx();
+       dspi_tx(ser_flash_cs, 0x80, 0);
+       flashdata = dspi_rx();
+       dspi_tx(ser_flash_cs, 0x00, 0);
+       dspi_rx();
+
+       if ((flashdata & *data) != *data) {
+               printf("not erased at %08lx (%lx)\n", (ulong) dest,
+                      (ulong) flashdata);
+               return (2);
+       }
+
+       dspi_tx(ser_flash_cs, 0x00, SER_WREN);
+       dspi_rx();
+
+       status = serial_flash_read_status(ser_flash_cs);
+       if (((status & 0x9C) != 0) && ((status & 0x02) != 0x02)) {
+               printf("Error Programming\n");
+               return 1;
+       }
+
+       start = get_timer(0);
+
+       dspi_tx(ser_flash_cs, 0x80, SER_PAGE_PROG);
+       dspi_tx(ser_flash_cs, 0x80, ((dest & 0xFF0000) >> 16));
+       dspi_tx(ser_flash_cs, 0x80, ((dest & 0xFF00) >> 8));
+       dspi_tx(ser_flash_cs, 0x80, (dest & 0xFF));
+       dspi_rx();
+       dspi_rx();
+       dspi_rx();
+       dspi_rx();
+
+       for (i = 0; i < (cnt - 1); i++) {
+               dspi_tx(ser_flash_cs, 0x80, *data);
+               dspi_rx();
+               data++;
+       }
+
+       dspi_tx(ser_flash_cs, 0x00, *data);
+       dspi_rx();
+
+       do {
+               status = serial_flash_read_status(ser_flash_cs);
+
+               if (get_timer(start) > CFG_FLASH_ERASE_TOUT) {
+                       printf("Timeout\n");
+                       return 1;
+               }
+       } while (status & 0x01);
+
+       return (0);
+}
+#endif
+
 /*-----------------------------------------------------------------------
  * Write a word to Flash for ATMEL FLASH
  * A word is 16 bits, whichever the bus width of the flash bank
index bda68e4..6562fd1 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(m68k)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index e480c29..70cb7e2 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(m68k)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index d76bc73..c0ca451 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(m68k)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 0286084..539da78 100644 (file)
@@ -43,6 +43,9 @@ long int initdram(int board_type)
        volatile siu_t *siu = (siu_t *) (MMAP_SIU);
        volatile sdram_t *sdram = (volatile sdram_t *)(MMAP_SDRAM);
        u32 dramsize, i;
+#ifdef CFG_DRAMSZ1
+       u32 temp;
+#endif
 
        siu->drv = CFG_SDRAM_DRVSTRENGTH;
 
index c10472a..f87e4be 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(m68k)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index c10472a..f87e4be 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(m68k)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
similarity index 96%
rename from board/mpc7448hpc2/u-boot.lds
rename to board/freescale/mpc7448hpc2/u-boot.lds
index 05f0269..77dfad6 100644 (file)
@@ -26,7 +26,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 42019fb..7cbdb7b 100644 (file)
@@ -28,6 +28,7 @@
 #endif
 #include <pci.h>
 #include <mpc83xx.h>
+#include <vsc7385.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -98,6 +99,26 @@ void pci_init_board(void)
        mpc83xx_pci_init(1, reg, warmboot);
 }
 
+/*
+ * Miscellaneous late-boot configurations
+ *
+ * If a VSC7385 microcode image is present, then upload it.
+*/
+int misc_init_r(void)
+{
+       int rc = 0;
+
+#ifdef CONFIG_VSC7385_IMAGE
+       if (vsc7385_upload_firmware((void *) CONFIG_VSC7385_IMAGE,
+               CONFIG_VSC7385_IMAGE_SIZE)) {
+               puts("Failure uploading VSC7385 microcode.\n");
+               rc = 1;
+       }
+#endif
+
+       return rc;
+}
+
 #if defined(CONFIG_OF_BOARD_SETUP)
 void ft_board_setup(void *blob, bd_t *bd)
 {
index 88d5e8f..afc0eee 100644 (file)
@@ -185,3 +185,37 @@ void ft_board_setup(void *blob, bd_t *bd)
 #endif
 }
 #endif
+
+#if defined(CFG_I2C_MAC_OFFSET)
+int mac_read_from_eeprom(void)
+{
+       uchar buf[28];
+       char str[18];
+       int i = 0;
+       unsigned int crc = 0;
+       unsigned char enetvar[32];
+
+       /* Read MAC addresses from EEPROM */
+       if (eeprom_read(CFG_I2C_EEPROM_ADDR, CFG_I2C_MAC_OFFSET, buf, 28)) {
+               printf("\nEEPROM @ 0x%02x read FAILED!!!\n",
+                      CFG_I2C_EEPROM_ADDR);
+       } else {
+               if (crc32(crc, buf, 24) == *(unsigned int *)&buf[24]) {
+                       printf("Reading MAC from EEPROM\n");
+                       for (i = 0; i < 4; i++) {
+                               if (memcmp(&buf[i * 6], "\0\0\0\0\0\0", 6)) {
+                                       sprintf(str,
+                                               "%02X:%02X:%02X:%02X:%02X:%02X",
+                                               buf[i * 6], buf[i * 6 + 1],
+                                               buf[i * 6 + 2], buf[i * 6 + 3],
+                                               buf[i * 6 + 4], buf[i * 6 + 5]);
+                                       sprintf((char *)enetvar,
+                                               i ? "eth%daddr" : "ethaddr", i);
+                                       setenv((char *)enetvar, str);
+                               }
+                       }
+               }
+       }
+       return 0;
+}
+#endif                         /* CONFIG_I2C_MAC_OFFSET */
index 972361f..704f963 100644 (file)
@@ -25,6 +25,7 @@
 #include <mpc83xx.h>
 #include <i2c.h>
 #include <miiphy.h>
+#include <vsc7385.h>
 #ifdef CONFIG_PCI
 #include <asm/mpc8349_pci.h>
 #include <pci.h>
@@ -177,7 +178,7 @@ int checkboard(void)
  */
 int misc_init_f(void)
 {
-#ifdef CONFIG_VSC7385
+#ifdef CONFIG_VSC7385_ENET
        volatile u32 *vsc7385_cpuctrl;
 
        /* 0x1c0c0 is the VSC7385 CPU Control (CPUCTRL) Register.  The power up
@@ -239,6 +240,8 @@ int misc_init_f(void)
 }
 
 /*
+ * Miscellaneous late-boot configurations
+ *
  * Make sure the EEPROM has the HRCW correctly programmed.
  * Make sure the RTC is correctly programmed.
  *
@@ -250,6 +253,8 @@ int misc_init_f(void)
  *
  * This function makes sure that the I2C EEPROM is programmed
  * correctly.
+ *
+ * If a VSC7385 microcode image is present, then upload it.
  */
 int misc_init_r(void)
 {
@@ -375,6 +380,14 @@ int misc_init_r(void)
        i2c_set_bus_num(orig_bus);
 #endif
 
+#ifdef CONFIG_VSC7385_IMAGE
+       if (vsc7385_upload_firmware((void *) CONFIG_VSC7385_IMAGE,
+               CONFIG_VSC7385_IMAGE_SIZE)) {
+               puts("Failure uploading VSC7385 microcode.\n");
+               rc = 1;
+       }
+#endif
+
        return rc;
 }
 
index d90cdb3..2119320 100644 (file)
@@ -98,11 +98,8 @@ int board_early_init_f(void)
        /* Enable flash write */
        bcsr[0xa] &= ~0x04;
 
-       /* Disable G1TXCLK, G2TXCLK h/w buffers (rev.2 h/w bug workaround) */
-       if (immr->sysconf.spridr == SPR_8360_REV20 ||
-           immr->sysconf.spridr == SPR_8360E_REV20 ||
-           immr->sysconf.spridr == SPR_8360_REV21 ||
-           immr->sysconf.spridr == SPR_8360E_REV21)
+       /* Disable G1TXCLK, G2TXCLK h/w buffers (rev.2.x h/w bug workaround) */
+       if (REVID_MAJOR(immr->sysconf.spridr) == 2)
                bcsr[0xe] = 0x30;
 
        /* Enable second UART */
@@ -308,8 +305,8 @@ void ft_board_setup(void *blob, bd_t *bd)
         * if on mpc8360ea rev. 2.1,
         * change both ucc phy-connection-types from rgmii-id to rgmii-rxid
         */
-       if (immr->sysconf.spridr == SPR_8360_REV21 ||
-           immr->sysconf.spridr == SPR_8360E_REV21) {
+       if ((REVID_MAJOR(immr->sysconf.spridr) == 2) &&
+           (REVID_MINOR(immr->sysconf.spridr) == 1)) {
                int nodeoffset;
                const char *prop;
                int path;
index acc9544..53e0c48 100644 (file)
@@ -25,8 +25,10 @@ include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(BOARD).a
 
-COBJS  := $(BOARD).o
+COBJS-y += $(BOARD).o
+COBJS-$(CONFIG_CMD_NAND) += nand.o
 
+COBJS  := $(COBJS-y)
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
 SOBJS  := $(addprefix $(obj),$(SOBJS))
index 8005a50..3bcdda7 100644 (file)
@@ -186,6 +186,23 @@ const qe_iop_conf_t qe_iop_conf_tab[] = {
        {1,  7, 1, 0, 0}, /* LVDS_BKLT_CTR */
        {2, 16, 1, 0, 0}, /* LVDS_BKLT_EN */
 
+       /* AD7843 ADC/Touchscreen controller */
+       {4, 14, 1, 0, 0}, /* SPI_nCS0 */
+       {4, 28, 3, 0, 3}, /* SPI_MOSI */
+       {4, 29, 3, 0, 3}, /* SPI_MISO */
+       {4, 30, 3, 0, 3}, /* SPI_CLK */
+
+       /* Freescale QUICC Engine USB Host Controller (FHCI) */
+       {1,  2, 1, 0, 3}, /* USBOE */
+       {1,  3, 1, 0, 3}, /* USBTP */
+       {1,  8, 1, 0, 1}, /* USBTN */
+       {1,  9, 2, 1, 3}, /* USBRP */
+       {1, 10, 2, 0, 3}, /* USBRXD */
+       {1, 11, 2, 1, 3}, /* USBRN */
+       {2, 20, 2, 0, 1}, /* CLK21 */
+       {4, 20, 1, 0, 0}, /* SPEED */
+       {4, 21, 1, 0, 0}, /* SUSPND */
+
        /* END of table */
        {0,  0, 0, 0, QE_IOP_TAB_END},
 };
diff --git a/board/freescale/mpc8360erdk/nand.c b/board/freescale/mpc8360erdk/nand.c
new file mode 100644 (file)
index 0000000..e1e790b
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * MPC8360E-RDK support for the NAND on FSL UPM
+ *
+ * Copyright (C) 2007 MontaVista Software, Inc.
+ *                    Anton Vorontsov <avorontsov@ru.mvista.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_83xx.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/fsl_upm.h>
+#include <nand.h>
+
+static struct immap *im = (struct immap *)CFG_IMMR;
+
+static const u32 upm_array[] = {
+       0x0ff03c30, 0x0ff03c30, 0x0ff03c34, 0x0ff33c30, /* Words  0 to  3 */
+       0xfff33c31, 0xfffffc30, 0xfffffc30, 0xfffffc30, /* Words  4 to  7 */
+       0x0faf3c30, 0x0faf3c30, 0x0faf3c30, 0x0fff3c34, /* Words  8 to 11 */
+       0xffff3c31, 0xfffffc30, 0xfffffc30, 0xfffffc30, /* Words 12 to 15 */
+       0x0fa3fc30, 0x0fa3fc30, 0x0fa3fc30, 0x0ff3fc34, /* Words 16 to 19 */
+       0xfff3fc31, 0xfffffc30, 0xfffffc30, 0xfffffc30, /* Words 20 to 23 */
+       0x0ff33c30, 0x0fa33c30, 0x0fa33c34, 0x0ff33c30, /* Words 24 to 27 */
+       0xfff33c31, 0xfff0fc30, 0xfff0fc30, 0xfff0fc30, /* Words 28 to 31 */
+       0xfff3fc30, 0xfff3fc30, 0xfff6fc30, 0xfffcfc30, /* Words 32 to 35 */
+       0xfffcfc30, 0xfffcfc30, 0xfffcfc30, 0xfffcfc30, /* Words 36 to 39 */
+       0xfffcfc30, 0xfffcfc30, 0xfffcfc30, 0xfffcfc30, /* Words 40 to 43 */
+       0xfffdfc30, 0xfffffc30, 0xfffffc30, 0xfffffc31, /* Words 44 to 47 */
+       0xfffffc30, 0xfffffc00, 0xfffffc00, 0xfffffc00, /* Words 48 to 51 */
+       0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc00, /* Words 52 to 55 */
+       0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc01, /* Words 56 to 59 */
+       0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc01, /* Words 60 to 63 */
+};
+
+static int dev_ready(void)
+{
+       if (in_be32(&im->qepio.ioport[4].pdat) & 0x00002000) {
+               debug("nand ready\n");
+               return 1;
+       }
+
+       debug("nand busy\n");
+       return 0;
+}
+
+static struct fsl_upm_nand fun = {
+       .upm = {
+               .array = upm_array,
+               .io_addr = (void *)CFG_NAND_BASE,
+       },
+       .width = 1,
+       .upm_cmd_offset = 8,
+       .upm_addr_offset = 16,
+       .dev_ready = dev_ready,
+       .wait_pattern = 1,
+       .chip_delay = 50,
+};
+
+int board_nand_init(struct nand_chip *nand)
+{
+       fun.upm.mxmr = &im->lbus.mamr;
+       fun.upm.mdr = &im->lbus.mdr;
+       fun.upm.mar = &im->lbus.mar;
+       return fsl_upm_nand_init(nand, &fun);
+}
index e57a53f..40a505b 100644 (file)
@@ -12,6 +12,8 @@
 
 #include <common.h>
 #include <i2c.h>
+#include <asm/io.h>
+#include <asm/fsl_serdes.h>
 #include <spd_sdram.h>
 #if defined(CONFIG_OF_LIBFDT)
 #include <libfdt.h>
@@ -29,6 +31,34 @@ int board_early_init_f(void)
        /* Clear all of the interrupt of BCSR */
        bcsr[0xe] = 0xff;
 
+#ifdef CONFIG_FSL_SERDES
+       immap_t *immr = (immap_t *)CFG_IMMR;
+       u32 spridr = in_be32(&immr->sysconf.spridr);
+
+       /* we check only part num, and don't look for CPU revisions */
+       switch (PARTID_NO_E(spridr)) {
+       case SPR_8377:
+               fsl_setup_serdes(CONFIG_FSL_SERDES1, FSL_SERDES_PROTO_SATA,
+                                FSL_SERDES_CLK_100, FSL_SERDES_VDD_1V);
+               fsl_setup_serdes(CONFIG_FSL_SERDES2, FSL_SERDES_PROTO_PEX,
+                                FSL_SERDES_CLK_100, FSL_SERDES_VDD_1V);
+               break;
+       case SPR_8378:
+               fsl_setup_serdes(CONFIG_FSL_SERDES1, FSL_SERDES_PROTO_PEX,
+                                FSL_SERDES_CLK_100, FSL_SERDES_VDD_1V);
+               break;
+       case SPR_8379:
+               fsl_setup_serdes(CONFIG_FSL_SERDES1, FSL_SERDES_PROTO_SATA,
+                                FSL_SERDES_CLK_100, FSL_SERDES_VDD_1V);
+               fsl_setup_serdes(CONFIG_FSL_SERDES2, FSL_SERDES_PROTO_SATA,
+                                FSL_SERDES_CLK_100, FSL_SERDES_VDD_1V);
+               break;
+       default:
+               printf("serdes not configured: unknown CPU part number: "
+                      "%04x\n", spridr >> 16);
+               break;
+       }
+#endif /* CONFIG_FSL_SERDES */
        return 0;
 }
 
index bed0fc3..f73fd5a 100644 (file)
 #include <common.h>
 #include <i2c.h>
 #include <asm/io.h>
+#include <asm/fsl_serdes.h>
+#include <fdt_support.h>
 #include <spd_sdram.h>
+#include <vsc7385.h>
 
 #if defined(CFG_DRAM_TEST)
 int
@@ -56,11 +59,6 @@ testdram(void)
 }
 #endif
 
-int board_early_init_f(void)
-{
-       return 0;
-}
-
 #if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRC)
 void ddr_enable_ecc(unsigned int dram_size);
 #endif
@@ -135,6 +133,59 @@ int checkboard(void)
        return 0;
 }
 
+int board_early_init_f(void)
+{
+#ifdef CONFIG_FSL_SERDES
+       immap_t *immr = (immap_t *)CFG_IMMR;
+       u32 spridr = in_be32(&immr->sysconf.spridr);
+
+       /* we check only part num, and don't look for CPU revisions */
+       switch (PARTID_NO_E(spridr)) {
+       case SPR_8377:
+               fsl_setup_serdes(CONFIG_FSL_SERDES1, FSL_SERDES_PROTO_SATA,
+                                FSL_SERDES_CLK_100, FSL_SERDES_VDD_1V);
+               fsl_setup_serdes(CONFIG_FSL_SERDES2, FSL_SERDES_PROTO_PEX,
+                                FSL_SERDES_CLK_100, FSL_SERDES_VDD_1V);
+               break;
+       case SPR_8378:
+               fsl_setup_serdes(CONFIG_FSL_SERDES1, FSL_SERDES_PROTO_PEX,
+                                FSL_SERDES_CLK_100, FSL_SERDES_VDD_1V);
+               break;
+       case SPR_8379:
+               fsl_setup_serdes(CONFIG_FSL_SERDES1, FSL_SERDES_PROTO_SATA,
+                                FSL_SERDES_CLK_100, FSL_SERDES_VDD_1V);
+               fsl_setup_serdes(CONFIG_FSL_SERDES2, FSL_SERDES_PROTO_SATA,
+                                FSL_SERDES_CLK_100, FSL_SERDES_VDD_1V);
+               break;
+       default:
+               printf("serdes not configured: unknown CPU part number: "
+                      "%04x\n", spridr >> 16);
+               break;
+       }
+#endif /* CONFIG_FSL_SERDES */
+       return 0;
+}
+
+/*
+ * Miscellaneous late-boot configurations
+ *
+ * If a VSC7385 microcode image is present, then upload it.
+*/
+int misc_init_r(void)
+{
+       int rc = 0;
+
+#ifdef CONFIG_VSC7385_IMAGE
+       if (vsc7385_upload_firmware((void *) CONFIG_VSC7385_IMAGE,
+               CONFIG_VSC7385_IMAGE_SIZE)) {
+               puts("Failure uploading VSC7385 microcode.\n");
+               rc = 1;
+       }
+#endif
+
+       return rc;
+}
+
 #if defined(CONFIG_OF_BOARD_SETUP)
 
 void ft_board_setup(void *blob, bd_t *bd)
@@ -143,5 +194,6 @@ void ft_board_setup(void *blob, bd_t *bd)
        ft_pci_setup(blob, bd);
 #endif
        ft_cpu_setup(blob, bd);
+       fdt_fixup_dr_usb(blob, bd);
 }
 #endif /* CONFIG_OF_BOARD_SETUP */
index 3eaff01..4fe2862 100644 (file)
@@ -87,7 +87,7 @@ struct fsl_e_tlb_entry tlb_table[] = {
         * 0xe000_0000  1M      CCSRBAR
         * 0xe200_0000  16M     PCI1 IO
         */
-       SET_TLB_ENTRY(1, CFG_CCSRBAR, CFG_CCSRBAR,
+       SET_TLB_ENTRY(1, CFG_CCSRBAR, CFG_CCSRBAR_PHYS,
                      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
                      0, 5, BOOKE_PAGESZ_64M, 1),
 
index 86f8f13..075d8f3 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index d1a585a..3ae2e97 100644 (file)
 #
 
 include $(TOPDIR)/config.mk
-ifneq ($(OBJTREE),$(SRCTREE))
-$(shell mkdir -p $(obj)../common)
-endif
 
 LIB    = $(obj)lib$(BOARD).a
 
-COBJS  := $(BOARD).o law.o tlb.o \
-          ../common/cadmus.o \
-          ../common/eeprom.o \
-          ../common/ft_board.o \
-          ../common/via.o
+COBJS-y        += $(BOARD).o
+COBJS-y        += law.o
+COBJS-y        += tlb.o
 
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS))
-SOBJS  := $(addprefix $(obj),$(SOBJS))
+SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS-y))
 
 $(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) $(ARFLAGS) $@ $(OBJS)
index 92f759b..c5434a0 100644 (file)
@@ -88,7 +88,7 @@ struct fsl_e_tlb_entry tlb_table[] = {
         * 0xe200_0000  16M     PCI1 IO
         * 0xe300_0000  16M     PCI2 IO
         */
-       SET_TLB_ENTRY(1, CFG_CCSRBAR, CFG_CCSRBAR,
+       SET_TLB_ENTRY(1, CFG_CCSRBAR, CFG_CCSRBAR_PHYS,
                      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
                      0, 5, BOOKE_PAGESZ_64M, 1),
 
index 1cbadf2..d0ba43c 100644 (file)
@@ -21,7 +21,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 34cfb38..61fc609 100644 (file)
@@ -75,7 +75,7 @@ struct fsl_e_tlb_entry tlb_table[] = {
         * 0xe000_0000  1M      CCSRBAR
         * 0xe100_0000  255M    PCI IO range
         */
-       SET_TLB_ENTRY(1, CFG_CCSRBAR, CFG_CCSRBAR,
+       SET_TLB_ENTRY(1, CFG_CCSRBAR, CFG_CCSRBAR_PHYS,
                      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
                      0, 4, BOOKE_PAGESZ_64M, 1),
 
index 17db8c0..b551339 100644 (file)
@@ -21,7 +21,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index d1a585a..3ae2e97 100644 (file)
 #
 
 include $(TOPDIR)/config.mk
-ifneq ($(OBJTREE),$(SRCTREE))
-$(shell mkdir -p $(obj)../common)
-endif
 
 LIB    = $(obj)lib$(BOARD).a
 
-COBJS  := $(BOARD).o law.o tlb.o \
-          ../common/cadmus.o \
-          ../common/eeprom.o \
-          ../common/ft_board.o \
-          ../common/via.o
+COBJS-y        += $(BOARD).o
+COBJS-y        += law.o
+COBJS-y        += tlb.o
 
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS))
-SOBJS  := $(addprefix $(obj),$(SOBJS))
+SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS-y))
 
 $(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) $(ARFLAGS) $@ $(OBJS)
index b21f71b..ab99af7 100644 (file)
@@ -80,7 +80,7 @@ struct fsl_e_tlb_entry tlb_table[] = {
         * 0xe210_0000  1M      PCI2 IO
         * 0xe300_0000  1M      PCIe IO
         */
-       SET_TLB_ENTRY(1, CFG_CCSRBAR, CFG_CCSRBAR,
+       SET_TLB_ENTRY(1, CFG_CCSRBAR, CFG_CCSRBAR_PHYS,
                      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
                      0, 5, BOOKE_PAGESZ_64M, 1),
 
index d701096..03f62b8 100644 (file)
@@ -21,7 +21,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index d1a585a..3ae2e97 100644 (file)
 #
 
 include $(TOPDIR)/config.mk
-ifneq ($(OBJTREE),$(SRCTREE))
-$(shell mkdir -p $(obj)../common)
-endif
 
 LIB    = $(obj)lib$(BOARD).a
 
-COBJS  := $(BOARD).o law.o tlb.o \
-          ../common/cadmus.o \
-          ../common/eeprom.o \
-          ../common/ft_board.o \
-          ../common/via.o
+COBJS-y        += $(BOARD).o
+COBJS-y        += law.o
+COBJS-y        += tlb.o
 
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS))
-SOBJS  := $(addprefix $(obj),$(SOBJS))
+SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS-y))
 
 $(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) $(ARFLAGS) $@ $(OBJS)
index 92f759b..c5434a0 100644 (file)
@@ -88,7 +88,7 @@ struct fsl_e_tlb_entry tlb_table[] = {
         * 0xe200_0000  16M     PCI1 IO
         * 0xe300_0000  16M     PCI2 IO
         */
-       SET_TLB_ENTRY(1, CFG_CCSRBAR, CFG_CCSRBAR,
+       SET_TLB_ENTRY(1, CFG_CCSRBAR, CFG_CCSRBAR_PHYS,
                      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
                      0, 5, BOOKE_PAGESZ_64M, 1),
 
index 1cbadf2..d0ba43c 100644 (file)
@@ -21,7 +21,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 3eaff01..4fe2862 100644 (file)
@@ -87,7 +87,7 @@ struct fsl_e_tlb_entry tlb_table[] = {
         * 0xe000_0000  1M      CCSRBAR
         * 0xe200_0000  16M     PCI1 IO
         */
-       SET_TLB_ENTRY(1, CFG_CCSRBAR, CFG_CCSRBAR,
+       SET_TLB_ENTRY(1, CFG_CCSRBAR, CFG_CCSRBAR_PHYS,
                      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
                      0, 5, BOOKE_PAGESZ_64M, 1),
 
index e2474e5..31412e3 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index d9f20f9..8294d3b 100644 (file)
@@ -23,9 +23,6 @@
 #
 
 include $(TOPDIR)/config.mk
-ifneq ($(OBJTREE),$(SRCTREE))
-$(shell mkdir -p $(obj)../common)
-endif
 
 LIB    = $(obj)lib$(BOARD).a
 
index 225fc94..a866c52 100644 (file)
@@ -74,7 +74,7 @@ struct fsl_e_tlb_entry tlb_table[] = {
         * 0xe200_0000  8M      PCI1 IO
         * 0xe280_0000  8M      PCIe IO
         */
-       SET_TLB_ENTRY(1, CFG_CCSRBAR, CFG_CCSRBAR,
+       SET_TLB_ENTRY(1, CFG_CCSRBAR, CFG_CCSRBAR_PHYS,
                      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
                      0, 3, BOOKE_PAGESZ_64M, 1),
 
index 6b30f15..40f6d3b 100644 (file)
@@ -21,7 +21,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 
index 489689e..e17a9cb 100644 (file)
 
 include $(TOPDIR)/config.mk
 
-ifneq ($(OBJTREE),$(SRCTREE))
-$(shell mkdir -p $(obj)../common)
-endif
-
 LIB    = $(obj)lib$(BOARD).a
 
 COBJS  := $(BOARD).o law.o
index 3f23050..196f88c 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
diff --git a/board/gaisler/gr_cpci_ax2000/Makefile b/board/gaisler/gr_cpci_ax2000/Makefile
new file mode 100644 (file)
index 0000000..d58f50d
--- /dev/null
@@ -0,0 +1,52 @@
+
+#
+# (C) Copyright 2003-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).a
+
+COBJS  := $(BOARD).o
+
+#flash.o
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
+       $(AR) $(ARFLAGS) $@ $(OBJS)
+
+clean:
+       rm -f $(SOBJS) $(OBJS)
+
+distclean:     clean
+       rm -f $(LIB) core *.bak .depend
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/gaisler/gr_cpci_ax2000/config.mk b/board/gaisler/gr_cpci_ax2000/config.mk
new file mode 100644 (file)
index 0000000..6c4d56b
--- /dev/null
@@ -0,0 +1,37 @@
+#
+# (C) Copyright 2008
+# Daniel Hellstrom, Gaisler Research, daniel@gaisler.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
+#
+
+#
+# GR-CPCI-AX2000 board
+#
+
+# U-BOOT IN FLASH
+TEXT_BASE = 0x00000000
+
+# U-BOOT IN RAM or SDRAM with -nosram flag set when starting GRMON
+#TEXT_BASE = 0x40000000
+
+# U-BOOT IN SDRAM
+#TEXT_BASE = 0x60000000
+
+PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -I$(TOPDIR)/board
diff --git a/board/gaisler/gr_cpci_ax2000/gr_cpci_ax2000.c b/board/gaisler/gr_cpci_ax2000/gr_cpci_ax2000.c
new file mode 100644 (file)
index 0000000..d99b455
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * (C) Copyright 2008
+ * Daniel Hellstrom, daniel@gaisler.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 <config.h>
+#include <asm/leon.h>
+
+long int initdram(int board_type)
+{
+       return 1;
+}
+
+int checkboard(void)
+{
+       puts("Board: GR-CPCI-AX2000\n");
+       return 0;
+}
+
+int misc_init_r(void)
+{
+       return 0;
+}
diff --git a/board/gaisler/gr_cpci_ax2000/u-boot.lds b/board/gaisler/gr_cpci_ax2000/u-boot.lds
new file mode 100644 (file)
index 0000000..3958670
--- /dev/null
@@ -0,0 +1,160 @@
+/* Linker script for Gaisler Research AB's GR-CPCI-AX2000 board
+ * with template design.
+ *
+ * (C) Copyright 2008
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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
+ *
+ */
+
+OUTPUT_FORMAT("elf32-sparc", "elf32-sparc", "elf32-sparc")
+OUTPUT_ARCH(sparc)
+ENTRY(_start)
+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 : {
+               _load_addr = .;
+               _text = .;
+
+               *(.start)
+               cpu/leon3/start.o (.text)
+/* 8k is the same as the PROM offset from end of main memory, (CFG_PROM_SIZE) */
+               . = ALIGN(8192);
+/* PROM CODE, Will be relocated to the end of memory,
+ * no global data accesses please.
+ */
+               __prom_start = .;
+               *(.prom.pgt)
+               *(.prom.data)
+               *(.prom.text)
+               . = ALIGN(16);
+               __prom_end = .;
+               *(.text)
+               *(.fixup)
+               *(.gnu.warning)
+/*             *(.got1)*/
+               . = ALIGN(16);
+               *(.rodata)
+               *(.rodata1)
+               *(.rodata.*)
+               *(.eh_frame)
+       }
+       . = ALIGN(4);
+       _etext = .;
+
+       /* CMD Table */
+
+       __u_boot_cmd_start = .;
+       .u_boot_cmd : { *(.u_boot_cmd) }
+       . = ALIGN(4);
+       __u_boot_cmd_end = .;
+
+       .data   :
+       {
+               *(.data)
+               *(.data1)
+               *(.data.rel)
+               *(.data.rel.*)
+               *(.sdata)
+               *(.sdata2)
+               *(.dynamic)
+               CONSTRUCTORS
+       }
+       _edata  =       .;
+       PROVIDE (edata = .);
+
+       . = ALIGN(4);
+       __got_start = .;
+       .got : {
+               *(.got)
+/*             *(.data.rel)
+               *(.data.rel.local)*/
+               . = ALIGN(16);
+       }
+       __got_end = .;
+
+/*     .data.rel : { } */
+
+       . = ALIGN(4096);
+       __init_begin = .;
+       .text.init : { *(.text.init) }
+       .data.init : { *(.data.init) }
+       . = ALIGN(4096);
+       __init_end = .;
+
+       __bss_start = .;
+       .bss            :
+       {
+        *(.sbss) *(.scommon)
+        *(.dynbss)
+        *(.bss)
+        *(COMMON)
+       . = ALIGN(16); /* to speed clearing of bss up */
+       }
+       __bss_end = . ;
+       _end = . ;
+       PROVIDE (end = .);
+
+/* Relocated into main memory */
+
+       /* Start of main memory */
+       /*. = 0x40000000;*/
+
+       .stack (NOLOAD) : { *(.stack) }
+
+       /* PROM CODE */
+
+       /* global data in RAM passed to kernel after booting */
+
+  .stab 0              : { *(.stab) }
+  .stabstr 0           : { *(.stabstr) }
+  .stab.excl 0         : { *(.stab.excl) }
+  .stab.exclstr 0      : { *(.stab.exclstr) }
+  .stab.index 0                : { *(.stab.index) }
+  .stab.indexstr 0     : { *(.stab.indexstr) }
+  .comment 0           : { *(.comment) }
+
+}
diff --git a/board/gaisler/gr_ep2s60/Makefile b/board/gaisler/gr_ep2s60/Makefile
new file mode 100644 (file)
index 0000000..d58f50d
--- /dev/null
@@ -0,0 +1,52 @@
+
+#
+# (C) Copyright 2003-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).a
+
+COBJS  := $(BOARD).o
+
+#flash.o
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
+       $(AR) $(ARFLAGS) $@ $(OBJS)
+
+clean:
+       rm -f $(SOBJS) $(OBJS)
+
+distclean:     clean
+       rm -f $(LIB) core *.bak .depend
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/gaisler/gr_ep2s60/config.mk b/board/gaisler/gr_ep2s60/config.mk
new file mode 100644 (file)
index 0000000..2ee0957
--- /dev/null
@@ -0,0 +1,35 @@
+#
+# (C) Copyright 2008
+# Daniel Hellstrom, Gaisler Research, daniel@gaisler.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
+#
+
+#
+# Altera NIOS delopment board Stratix II edition, FPGA device EP2S60,
+# with GRLIB Template design (GPL Open Source SPARC/LEON3)
+#
+
+# U-BOOT IN FLASH
+TEXT_BASE = 0x00000000
+
+# U-BOOT IN SDRAM
+#TEXT_BASE = 0x40000000
+
+PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -I$(TOPDIR)/board
diff --git a/board/gaisler/gr_ep2s60/gr_ep2s60.c b/board/gaisler/gr_ep2s60/gr_ep2s60.c
new file mode 100644 (file)
index 0000000..e8617f0
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * (C) Copyright 2008
+ * Daniel Hellstrom, daniel@gaisler.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 <config.h>
+#include <asm/leon.h>
+
+long int initdram(int board_type)
+{
+       return 1;
+}
+
+int checkboard(void)
+{
+       puts("Board: EP2S60 GRLIB\n");
+       return 0;
+}
+
+int misc_init_r(void)
+{
+       return 0;
+}
diff --git a/board/gaisler/gr_ep2s60/u-boot.lds b/board/gaisler/gr_ep2s60/u-boot.lds
new file mode 100644 (file)
index 0000000..100350d
--- /dev/null
@@ -0,0 +1,160 @@
+/* Linker script for Gaisler Research AB's Template design
+ * for Altera NIOS Development board Stratix II Edition, EP2S60 FPGA.
+ *
+ * (C) Copyright 2008
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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
+ *
+ */
+
+OUTPUT_FORMAT("elf32-sparc", "elf32-sparc", "elf32-sparc")
+OUTPUT_ARCH(sparc)
+ENTRY(_start)
+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 : {
+               _load_addr = .;
+               _text = .;
+
+               *(.start)
+               cpu/leon3/start.o (.text)
+/* 8k is the same as the PROM offset from end of main memory, (CFG_PROM_SIZE) */
+               . = ALIGN(8192);
+/* PROM CODE, Will be relocated to the end of memory,
+ * no global data accesses please.
+ */
+               __prom_start = .;
+               *(.prom.pgt)
+               *(.prom.data)
+               *(.prom.text)
+               . = ALIGN(16);
+               __prom_end = .;
+               *(.text)
+               *(.fixup)
+               *(.gnu.warning)
+/*             *(.got1)*/
+               . = ALIGN(16);
+               *(.rodata)
+               *(.rodata1)
+               *(.rodata.*)
+               *(.eh_frame)
+       }
+       . = ALIGN(4);
+       _etext = .;
+
+       /* CMD Table */
+
+       __u_boot_cmd_start = .;
+       .u_boot_cmd : { *(.u_boot_cmd) }
+       . = ALIGN(4);
+       __u_boot_cmd_end = .;
+
+       .data   :
+       {
+               *(.data)
+               *(.data1)
+               *(.data.rel)
+               *(.data.rel.*)
+               *(.sdata)
+               *(.sdata2)
+               *(.dynamic)
+               CONSTRUCTORS
+       }
+       _edata  =       .;
+       PROVIDE (edata = .);
+
+       . = ALIGN(4);
+       __got_start = .;
+       .got : {
+               *(.got)
+/*             *(.data.rel)
+               *(.data.rel.local)*/
+               . = ALIGN(16);
+       }
+       __got_end = .;
+
+/*     .data.rel : { } */
+
+       . = ALIGN(4096);
+       __init_begin = .;
+       .text.init : { *(.text.init) }
+       .data.init : { *(.data.init) }
+       . = ALIGN(4096);
+       __init_end = .;
+
+       __bss_start = .;
+       .bss            :
+       {
+        *(.sbss) *(.scommon)
+        *(.dynbss)
+        *(.bss)
+        *(COMMON)
+       . = ALIGN(16); /* to speed clearing of bss up */
+       }
+       __bss_end = . ;
+       _end = . ;
+       PROVIDE (end = .);
+
+/* Relocated into main memory */
+
+       /* Start of main memory */
+       /*. = 0x40000000;*/
+
+       .stack (NOLOAD) : { *(.stack) }
+
+       /* PROM CODE */
+
+       /* global data in RAM passed to kernel after booting */
+
+  .stab 0              : { *(.stab) }
+  .stabstr 0           : { *(.stabstr) }
+  .stab.excl 0         : { *(.stab.excl) }
+  .stab.exclstr 0      : { *(.stab.exclstr) }
+  .stab.index 0                : { *(.stab.index) }
+  .stab.indexstr 0     : { *(.stab.indexstr) }
+  .comment 0           : { *(.comment) }
+
+}
diff --git a/board/gaisler/gr_xc3s_1500/Makefile b/board/gaisler/gr_xc3s_1500/Makefile
new file mode 100644 (file)
index 0000000..d58f50d
--- /dev/null
@@ -0,0 +1,52 @@
+
+#
+# (C) Copyright 2003-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).a
+
+COBJS  := $(BOARD).o
+
+#flash.o
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
+       $(AR) $(ARFLAGS) $@ $(OBJS)
+
+clean:
+       rm -f $(SOBJS) $(OBJS)
+
+distclean:     clean
+       rm -f $(LIB) core *.bak .depend
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/gaisler/gr_xc3s_1500/config.mk b/board/gaisler/gr_xc3s_1500/config.mk
new file mode 100644 (file)
index 0000000..35cbc1b
--- /dev/null
@@ -0,0 +1,34 @@
+#
+# (C) Copyright 2007
+# Daniel Hellstrom, Gaisler Research, daniel@gaisler.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
+#
+
+#
+# GR-XC3S-1500 board
+#
+
+# U-BOOT IN FLASH
+TEXT_BASE = 0x00000000
+
+# U-BOOT IN RAM
+#TEXT_BASE = 0x40000000
+
+PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -I$(TOPDIR)/board
diff --git a/board/gaisler/gr_xc3s_1500/gr_xc3s_1500.c b/board/gaisler/gr_xc3s_1500/gr_xc3s_1500.c
new file mode 100644 (file)
index 0000000..1ee7024
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * (C) Copyright 2007
+ * Daniel Hellstrom, daniel@gaisler.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 <config.h>
+#include <asm/leon.h>
+
+long int initdram(int board_type)
+{
+       return 1;
+}
+
+int checkboard(void)
+{
+       puts("Board: GR-XC3S-1500\n");
+       return 0;
+}
+
+int misc_init_r(void)
+{
+       return 0;
+}
diff --git a/board/gaisler/gr_xc3s_1500/u-boot.lds b/board/gaisler/gr_xc3s_1500/u-boot.lds
new file mode 100644 (file)
index 0000000..3848c68
--- /dev/null
@@ -0,0 +1,162 @@
+/* Linker script for Gaisler Research AB's GR-XC3S-1500 board
+ * with template design.
+ *
+ * (C) Copyright 2007
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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
+ *
+ */
+
+OUTPUT_FORMAT("elf32-sparc", "elf32-sparc", "elf32-sparc")
+OUTPUT_ARCH(sparc)
+ENTRY(_start)
+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 : {
+               _load_addr = .;
+               _text = .;
+
+               *(.start)
+               cpu/leon3/start.o (.text)
+/* 8k is the same as the PROM offset from end of main memory, (CFG_PROM_SIZE) */
+               . = ALIGN(8192);
+/* PROM CODE, Will be relocated to the end of memory,
+ * no global data accesses please.
+ */
+               __prom_start = .;
+               *(.prom.pgt)
+               *(.prom.data)
+               *(.prom.text)
+               . = ALIGN(16);
+               __prom_end = .;
+               *(.text)
+               *(.fixup)
+               *(.gnu.warning)
+/*             *(.got1)*/
+               . = ALIGN(16);
+               *(.rodata)
+               *(.rodata1)
+               *(.rodata.*)
+               *(.eh_frame)
+       }
+       . = ALIGN(4);
+       _etext = .;
+
+       /* CMD Table */
+
+       __u_boot_cmd_start = .;
+       .u_boot_cmd : { *(.u_boot_cmd) }
+       . = ALIGN(4);
+       __u_boot_cmd_end = .;
+
+       .data   :
+       {
+               *(.data)
+               *(.data1)
+               *(.data.rel)
+               *(.data.rel.*)
+               *(.sdata)
+               *(.sdata2)
+               *(.dynamic)
+               CONSTRUCTORS
+       }
+       _edata  =       .;
+       PROVIDE (edata = .);
+
+       . = ALIGN(4);
+       __got_start = .;
+       .got : {
+               *(.got)
+/*             *(.data.rel)
+               *(.data.rel.local)*/
+               . = ALIGN(16);
+       }
+       __got_end = .;
+
+/*     .data.rel : { } */
+
+
+       . = ALIGN(4096);
+       __init_begin = .;
+       .text.init : { *(.text.init) }
+       .data.init : { *(.data.init) }
+       . = ALIGN(4096);
+       __init_end = .;
+
+       __bss_start = .;
+       .bss            :
+       {
+        *(.sbss) *(.scommon)
+        *(.dynbss)
+        *(.bss)
+        *(COMMON)
+       . = ALIGN(16); /* to speed clearing of bss up */
+       }
+       __bss_end = . ;
+       _end = . ;
+       PROVIDE (end = .);
+
+/* Relocated into main memory */
+
+       /* Start of main memory */
+       /*. = 0x40000000;*/
+
+       .stack (NOLOAD) : { *(.stack) }
+
+       /* PROM CODE */
+
+       /* global data in RAM passed to kernel after booting */
+
+
+  .stab 0              : { *(.stab) }
+  .stabstr 0           : { *(.stabstr) }
+  .stab.excl 0         : { *(.stab.excl) }
+  .stab.exclstr 0      : { *(.stab.exclstr) }
+  .stab.index 0                : { *(.stab.index) }
+  .stab.indexstr 0     : { *(.stab.indexstr) }
+  .comment 0           : { *(.comment) }
+
+}
similarity index 90%
rename from board/r5200/Makefile
rename to board/gaisler/grsim/Makefile
index 2ec71ee..6295109 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2006
+# (C) Copyright 2003-2004
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(BOARD).a
 
-COBJS  = $(BOARD).o mii.o
+COBJS  := $(BOARD).o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
@@ -34,6 +34,12 @@ SOBJS        := $(addprefix $(obj),$(SOBJS))
 $(LIB):        $(obj).depend $(OBJS)
        $(AR) $(ARFLAGS) $@ $(OBJS)
 
+clean:
+       rm -f $(SOBJS) $(OBJS)
+
+distclean:     clean
+       rm -f $(LIB) core *.bak .depend
+
 #########################################################################
 
 # defines $(obj).depend target
diff --git a/board/gaisler/grsim/config.mk b/board/gaisler/grsim/config.mk
new file mode 100644 (file)
index 0000000..81cd415
--- /dev/null
@@ -0,0 +1,34 @@
+#
+# (C) Copyright 2007
+# Daniel Hellstrom, Gaisler Research, daniel@gaisler.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
+#
+
+#
+# GRSIM simulating a LEON3 GR-XC3S-1500 board
+#
+
+# U-BOOT IN FLASH
+TEXT_BASE = 0x00000000
+
+# U-BOOT IN RAM
+#TEXT_BASE = 0x40000000
+
+PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -I$(TOPDIR)/board
diff --git a/board/gaisler/grsim/grsim.c b/board/gaisler/grsim/grsim.c
new file mode 100644 (file)
index 0000000..70a2f23
--- /dev/null
@@ -0,0 +1,43 @@
+/* GRSIM/TSIM board
+ *
+ * (C) Copyright 2007
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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/leon.h>
+
+long int initdram(int board_type)
+{
+       return 1;
+}
+
+int checkboard(void)
+{
+       puts("Board: GRSIM/TSIM\n");
+       return 0;
+}
+
+int misc_init_r(void)
+{
+       return 0;
+}
diff --git a/board/gaisler/grsim/u-boot.lds b/board/gaisler/grsim/u-boot.lds
new file mode 100644 (file)
index 0000000..1e8bb69
--- /dev/null
@@ -0,0 +1,161 @@
+/* Linker script for Gaisler Research AB's GRSIM LEON3 simulator.
+ *
+ * (C) Copyright 2007
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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
+ *
+ */
+
+OUTPUT_FORMAT("elf32-sparc", "elf32-sparc", "elf32-sparc")
+OUTPUT_ARCH(sparc)
+ENTRY(_start)
+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 : {
+               _load_addr = .;
+               _text = .;
+
+               *(.start)
+               cpu/leon3/start.o (.text)
+/* 8k is the same as the PROM offset from end of main memory, (CFG_PROM_SIZE) */
+               . = ALIGN(8192);
+/* PROM CODE, Will be relocated to the end of memory,
+ * no global data accesses please.
+ */
+               __prom_start = .;
+               *(.prom.pgt)
+               *(.prom.data)
+               *(.prom.text)
+               . = ALIGN(16);
+               __prom_end = .;
+               *(.text)
+               *(.fixup)
+               *(.gnu.warning)
+/*             *(.got1)*/
+               . = ALIGN(16);
+               *(.rodata)
+               *(.rodata1)
+               *(.rodata.*)
+               *(.eh_frame)
+       }
+       . = ALIGN(4);
+       _etext = .;
+
+       /* CMD Table */
+
+       __u_boot_cmd_start = .;
+       .u_boot_cmd : { *(.u_boot_cmd) }
+       . = ALIGN(4);
+       __u_boot_cmd_end = .;
+
+       .data   :
+       {
+               *(.data)
+               *(.data1)
+               *(.data.rel)
+               *(.data.rel.*)
+               *(.sdata)
+               *(.sdata2)
+               *(.dynamic)
+               CONSTRUCTORS
+       }
+       _edata  =       .;
+       PROVIDE (edata = .);
+
+       . = ALIGN(4);
+       __got_start = .;
+       .got : {
+               *(.got)
+/*             *(.data.rel)
+               *(.data.rel.local)*/
+               . = ALIGN(16);
+       }
+       __got_end = .;
+
+/*     .data.rel : { } */
+
+
+       . = ALIGN(4096);
+       __init_begin = .;
+       .text.init : { *(.text.init) }
+       .data.init : { *(.data.init) }
+       . = ALIGN(4096);
+       __init_end = .;
+
+       __bss_start = .;
+       .bss    :
+       {
+        *(.sbss) *(.scommon)
+        *(.dynbss)
+        *(.bss)
+        *(COMMON)
+       . = ALIGN(16); /* to speed clearing of bss up */
+       }
+       __bss_end = . ;
+       _end = . ;
+       PROVIDE (end = .);
+
+/* Relocated into main memory */
+
+       /* Start of main memory */
+       /*. = 0x40000000;*/
+
+       .stack (NOLOAD) : { *(.stack) }
+
+       /* PROM CODE */
+
+       /* global data in RAM passed to kernel after booting */
+
+
+       .stab 0         : { *(.stab) }
+       .stabstr 0              : { *(.stabstr) }
+       .stab.excl 0            : { *(.stab.excl) }
+       .stab.exclstr 0 : { *(.stab.exclstr) }
+       .stab.index 0           : { *(.stab.index) }
+       .stab.indexstr 0        : { *(.stab.indexstr) }
+       .comment 0              : { *(.comment) }
+
+}
diff --git a/board/gaisler/grsim_leon2/Makefile b/board/gaisler/grsim_leon2/Makefile
new file mode 100644 (file)
index 0000000..6295109
--- /dev/null
@@ -0,0 +1,50 @@
+#
+# (C) Copyright 2003-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., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB    = $(obj)lib$(BOARD).a
+
+COBJS  := $(BOARD).o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
+       $(AR) $(ARFLAGS) $@ $(OBJS)
+
+clean:
+       rm -f $(SOBJS) $(OBJS)
+
+distclean:     clean
+       rm -f $(LIB) core *.bak .depend
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/gaisler/grsim_leon2/config.mk b/board/gaisler/grsim_leon2/config.mk
new file mode 100644 (file)
index 0000000..65eba1b
--- /dev/null
@@ -0,0 +1,34 @@
+#
+# (C) Copyright 2007
+# Daniel Hellstrom, Gaisler Research, daniel@gaisler.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
+#
+
+#
+# GRSIM simulating a LEON2 board
+#
+
+# RUN U-BOOT FROM PROM
+TEXT_BASE = 0x00000000
+
+# RUN U-BOOT FROM RAM
+#TEXT_BASE = 0x40000000
+
+PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -I$(TOPDIR)/board
diff --git a/board/gaisler/grsim_leon2/grsim_leon2.c b/board/gaisler/grsim_leon2/grsim_leon2.c
new file mode 100644 (file)
index 0000000..55dfe82
--- /dev/null
@@ -0,0 +1,43 @@
+/* GRSIM/TSIM board
+ *
+ * (C) Copyright 2007
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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/leon.h>
+
+long int initdram(int board_type)
+{
+       return 1;
+}
+
+int checkboard(void)
+{
+       puts("Board: GRSIM/TSIM LEON2\n");
+       return 0;
+}
+
+int misc_init_r(void)
+{
+       return 0;
+}
diff --git a/board/gaisler/grsim_leon2/u-boot.lds b/board/gaisler/grsim_leon2/u-boot.lds
new file mode 100644 (file)
index 0000000..2a22082
--- /dev/null
@@ -0,0 +1,159 @@
+/* Linker script for Gaisler Research AB's GRSIM LEON2 simulator.
+ *
+ * (C) Copyright 2007
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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
+ *
+ */
+
+OUTPUT_FORMAT("elf32-sparc", "elf32-sparc", "elf32-sparc")
+OUTPUT_ARCH(sparc)
+ENTRY(_start)
+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 : {
+               _load_addr = .;
+               _text = .;
+
+               *(.start)
+               cpu/leon2/start.o (.text)
+/* 8k is the same as the PROM offset from end of main memory, (CFG_PROM_SIZE) */
+               . = ALIGN(8192);
+/* PROM CODE, Will be relocated to the end of memory,
+ * no global data accesses please.
+ */
+               __prom_start = .;
+               *(.prom.pgt)
+               *(.prom.data)
+               *(.prom.text)
+               . = ALIGN(16);
+               __prom_end = .;
+               *(.text)
+               *(.fixup)
+               *(.gnu.warning)
+/*             *(.got1)*/
+               . = ALIGN(16);
+               *(.rodata)
+               *(.rodata1)
+               *(.rodata.*)
+               *(.eh_frame)
+       }
+       . = ALIGN(4);
+       _etext = .;
+
+       /* CMD Table */
+
+       __u_boot_cmd_start = .;
+       .u_boot_cmd : { *(.u_boot_cmd) }
+       . = ALIGN(4);
+       __u_boot_cmd_end = .;
+
+       .data   :
+       {
+               *(.data)
+               *(.data1)
+               *(.data.rel)
+               *(.data.rel.*)
+               *(.sdata)
+               *(.sdata2)
+               *(.dynamic)
+               CONSTRUCTORS
+       }
+       _edata  =       .;
+       PROVIDE (edata = .);
+
+       . = ALIGN(4);
+       __got_start = .;
+       .got : {
+               *(.got)
+/*             *(.data.rel)
+               *(.data.rel.local)*/
+               . = ALIGN(16);
+       }
+       __got_end = .;
+
+/*     .data.rel : { } */
+
+       . = ALIGN(4096);
+       __init_begin = .;
+       .text.init : { *(.text.init) }
+       .data.init : { *(.data.init) }
+       . = ALIGN(4096);
+       __init_end = .;
+
+       __bss_start = .;
+       .bss    :
+       {
+        *(.sbss) *(.scommon)
+        *(.dynbss)
+        *(.bss)
+        *(COMMON)
+       . = ALIGN(16); /* to speed clearing of bss up */
+       }
+       __bss_end = . ;
+       _end = . ;
+       PROVIDE (end = .);
+
+/* Relocated into main memory */
+
+       /* Start of main memory */
+       /*. = 0x40000000;*/
+
+       .stack (NOLOAD) : { *(.stack) }
+
+       /* PROM CODE */
+
+       /* global data in RAM passed to kernel after booting */
+
+       .stab 0         : { *(.stab) }
+       .stabstr 0              : { *(.stabstr) }
+       .stab.excl 0            : { *(.stab.excl) }
+       .stab.exclstr 0 : { *(.stab.exclstr) }
+       .stab.index 0           : { *(.stab.index) }
+       .stab.indexstr 0        : { *(.stab.indexstr) }
+       .comment 0              : { *(.comment) }
+
+}
index 668aa0d..aa124f9 100644 (file)
@@ -25,7 +25,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 SECTIONS
 {
   /*
index 6dc1cdc..ce1ffe0 100644 (file)
@@ -24,7 +24,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 SECTIONS
 {
   /*
index 5eb8076..0c6417f 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index e843df6..3251ec3 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 9978f40..facb88a 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index eea378a..bf615c1 100644 (file)
@@ -450,7 +450,7 @@ mtc:        sw      zero, 0(t0)
        nop
        nop
 memtestend:
-       j       ra
+       jr      ra
        nop
 
 memhang:
index f3e3cf0..45e812c 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index a961fa4..f87bd07 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 2c15c3f..6189149 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index ddd4678..753411f 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 17f7b84..cd388d0 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 87f228b..452c6c0 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 235ec42..bc83534 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(m68k)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 GROUP(libgcc.a)
diff --git a/board/imx31_litekit/Makefile b/board/imx31_litekit/Makefile
new file mode 100644 (file)
index 0000000..ea8c889
--- /dev/null
@@ -0,0 +1,51 @@
+#
+# (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).a
+
+COBJS  := imx31_litekit.o
+SOBJS  := lowlevel_init.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+
+clean:
+       rm -f $(SOBJS) $(OBJS)
+
+distclean:     clean
+       rm -f $(LIB) core *.bak .depend
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/imx31_litekit/config.mk b/board/imx31_litekit/config.mk
new file mode 100644 (file)
index 0000000..d34dc02
--- /dev/null
@@ -0,0 +1 @@
+TEXT_BASE = 0x87f00000
diff --git a/board/imx31_litekit/imx31_litekit.c b/board/imx31_litekit/imx31_litekit.c
new file mode 100644 (file)
index 0000000..e0fbf25
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ *
+ * (c) 2007 Pengutronix, Sascha Hauer <s.hauer@pengutronix.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/arch/mx31.h>
+#include <asm/arch/mx31-regs.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int dram_init (void)
+{
+       gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
+       gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+
+       return 0;
+}
+
+int board_init (void)
+{
+       __REG(CSCR_U(0)) = 0x0000cf03; /* CS0: Nor Flash */
+       __REG(CSCR_L(0)) = 0xa0330d01;
+       __REG(CSCR_A(0)) = 0x00220800;
+
+       __REG(CSCR_U(4)) = 0x0000dcf6; /* CS4: Network Controller */
+       __REG(CSCR_L(4)) = 0x444a4541;
+       __REG(CSCR_A(4)) = 0x44443302;
+
+       /* setup pins for UART1 */
+       mx31_gpio_mux(MUX_RXD1__UART1_RXD_MUX);
+       mx31_gpio_mux(MUX_TXD1__UART1_TXD_MUX);
+       mx31_gpio_mux(MUX_RTS1__UART1_RTS_B);
+       mx31_gpio_mux(MUX_RTS1__UART1_CTS_B);
+
+       gd->bd->bi_arch_number = MACH_TYPE_MX31LITE; /* board id for linux */
+       gd->bd->bi_boot_params = (0x80000100);  /* adress of boot parameters */
+
+       return 0;
+}
+
+int checkboard (void)
+{
+       printf("Board: i.MX31 Litekit\n");
+       return 0;
+}
diff --git a/board/imx31_litekit/lowlevel_init.S b/board/imx31_litekit/lowlevel_init.S
new file mode 100644 (file)
index 0000000..88b5261
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ *
+ * (c) 2007 Pengutronix, Sascha Hauer <s.hauer@pengutronix.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 <asm/arch/mx31-regs.h>
+
+.macro REG reg, val
+       ldr r2, =\reg
+       ldr r3, =\val
+       str r3, [r2]
+.endm
+
+.macro REG8 reg, val
+       ldr r2, =\reg
+       ldr r3, =\val
+       strb r3, [r2]
+.endm
+
+.macro DELAY loops
+       ldr r2, =\loops
+1:
+       subs    r2, r2, #1
+       nop
+       bcs 1b
+.endm
+
+.globl lowlevel_init
+lowlevel_init:
+
+       REG     IPU_CONF, IPU_CONF_DI_EN
+       REG     CCM_CCMR, 0x074B0BF5
+
+       DELAY 0x40000
+
+       REG     CCM_CCMR, 0x074B0BF5 | CCMR_MPE
+       REG     CCM_CCMR, (0x074B0BF5 | CCMR_MPE) & ~CCMR_MDS
+
+       REG     CCM_PDR0, PDR0_CSI_PODF(0x1ff) | PDR0_PER_PODF(7) | PDR0_HSP_PODF(2) | PDR0_NFC_PODF(6) | PDR0_IPG_PODF(1) | PDR0_MAX_PODF(2) | PDR0_MCU_PODF(0)
+
+       REG     CCM_MPCTL, PLL_PD(0) | PLL_MFD(0x33) | PLL_MFI(7) | PLL_MFN(0x23)
+       REG     CCM_SPCTL, PLL_PD(1) | PLL_MFD(4) | PLL_MFI(12) | PLL_MFN(1)
+
+       REG     0x43FAC26C, 0 /* SDCLK */
+       REG     0x43FAC270, 0 /* CAS */
+       REG     0x43FAC274, 0 /* RAS */
+       REG     0x43FAC27C, 0x1000 /* CS2       CSD0) */
+       REG     0x43FAC284, 0 /* DQM3 */
+       REG     0x43FAC288, 0 /* DQM2, DQM1, DQM0, SD31-SD0, A25-A0, MA10       0x288..0x2DC) */
+       REG     0x43FAC28C, 0
+       REG     0x43FAC290, 0
+       REG     0x43FAC294, 0
+       REG     0x43FAC298, 0
+       REG     0x43FAC29C, 0
+       REG     0x43FAC2A0, 0
+       REG     0x43FAC2A4, 0
+       REG     0x43FAC2A8, 0
+       REG     0x43FAC2AC, 0
+       REG     0x43FAC2B0, 0
+       REG     0x43FAC2B4, 0
+       REG     0x43FAC2B8, 0
+       REG     0x43FAC2BC, 0
+       REG     0x43FAC2C0, 0
+       REG     0x43FAC2C4, 0
+       REG     0x43FAC2C8, 0
+       REG     0x43FAC2CC, 0
+       REG     0x43FAC2D0, 0
+       REG     0x43FAC2D4, 0
+       REG     0x43FAC2D8, 0
+       REG     0x43FAC2DC, 0
+       REG     0xB8001010, 0x00000004
+       REG     0xB8001004, 0x006ac73a
+       REG     0xB8001000, 0x92100000
+       REG     0x80000f00, 0x12344321
+       REG     0xB8001000, 0xa2100000
+       REG     0x80000000, 0x12344321
+       REG     0x80000000, 0x12344321
+       REG     0xB8001000, 0xb2100000
+       REG8    0x80000033, 0xda
+       REG8    0x81000000, 0xff
+       REG     0xB8001000, 0x82226080
+       REG     0x80000000, 0xDEADBEEF
+       REG     0xB8001010, 0x0000000c
+
+       mov     pc, lr
diff --git a/board/imx31_litekit/u-boot.lds b/board/imx31_litekit/u-boot.lds
new file mode 100644 (file)
index 0000000..1460adc
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * January 2004 - Changed to support H4 device
+ * Copyright (c) 2004 Texas Instruments
+ *
+ * (C) Copyright 2002
+ * Gary Jennejohn, DENX Software Engineering, <gj@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-littlearm", "elf32-littlearm", "elf32-littlearm")
+OUTPUT_ARCH(arm)
+ENTRY(_start)
+SECTIONS
+{
+       . = 0x00000000;
+
+       . = ALIGN(4);
+       .text      :
+       {
+         cpu/arm1136/start.o   (.text)
+         *(.text)
+       }
+
+       . = ALIGN(4);
+       .rodata : { *(.rodata) }
+
+       . = ALIGN(4);
+       .data : { *(.data) }
+
+       . = ALIGN(4);
+       .got : { *(.got) }
+
+       . = .;
+       __u_boot_cmd_start = .;
+       .u_boot_cmd : { *(.u_boot_cmd) }
+       __u_boot_cmd_end = .;
+
+       . = ALIGN(4);
+       __bss_start = .;
+       .bss : { *(.bss) }
+       _end = .;
+}
diff --git a/board/imx31_phycore/Makefile b/board/imx31_phycore/Makefile
new file mode 100644 (file)
index 0000000..cb0e8e8
--- /dev/null
@@ -0,0 +1,51 @@
+#
+# (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).a
+
+COBJS  := imx31_phycore.o
+SOBJS  := lowlevel_init.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+
+clean:
+       rm -f $(SOBJS) $(OBJS)
+
+distclean:     clean
+       rm -f $(LIB) core *.bak .depend
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/imx31_phycore/config.mk b/board/imx31_phycore/config.mk
new file mode 100644 (file)
index 0000000..d34dc02
--- /dev/null
@@ -0,0 +1 @@
+TEXT_BASE = 0x87f00000
diff --git a/board/imx31_phycore/imx31_phycore.c b/board/imx31_phycore/imx31_phycore.c
new file mode 100644 (file)
index 0000000..42ecb1e
--- /dev/null
@@ -0,0 +1,73 @@
+/*
+ *
+ * (c) 2007 Pengutronix, Sascha Hauer <s.hauer@pengutronix.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/arch/mx31.h>
+#include <asm/arch/mx31-regs.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int dram_init (void)
+{
+       gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
+       gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+
+       return 0;
+}
+
+int board_init (void)
+{
+       __REG(CSCR_U(0)) = 0x0000cf03; /* CS0: Nor Flash */
+       __REG(CSCR_L(0)) = 0x10000d03;
+       __REG(CSCR_A(0)) = 0x00720900;
+
+       __REG(CSCR_U(1)) = 0x0000df06; /* CS1: Network Controller */
+       __REG(CSCR_L(1)) = 0x444a4541;
+       __REG(CSCR_A(1)) = 0x44443302;
+
+       __REG(CSCR_U(4)) = 0x0000d843; /* CS4: SRAM */
+       __REG(CSCR_L(4)) = 0x22252521;
+       __REG(CSCR_A(4)) = 0x22220a00;
+
+       /* setup pins for UART1 */
+       mx31_gpio_mux(MUX_RXD1__UART1_RXD_MUX);
+       mx31_gpio_mux(MUX_TXD1__UART1_TXD_MUX);
+       mx31_gpio_mux(MUX_RTS1__UART1_RTS_B);
+       mx31_gpio_mux(MUX_RTS1__UART1_CTS_B);
+
+       /* setup pins for I2C2 (for EEPROM, RTC) */
+       mx31_gpio_mux(MUX_CSPI2_MOSI__I2C2_SCL);
+       mx31_gpio_mux(MUX_CSPI2_MISO__I2C2_SCL);
+
+       gd->bd->bi_arch_number = 447;           /* board id for linux */
+       gd->bd->bi_boot_params = (0x80000100);  /* adress of boot parameters */
+
+       return 0;
+}
+
+int checkboard (void)
+{
+       printf("Board: Phytec phyCore i.MX31\n");
+       return 0;
+}
diff --git a/board/imx31_phycore/lowlevel_init.S b/board/imx31_phycore/lowlevel_init.S
new file mode 100644 (file)
index 0000000..4895b6a
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ *
+ * (c) 2007 Pengutronix, Sascha Hauer <s.hauer@pengutronix.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 <asm/arch/mx31-regs.h>
+
+.macro REG reg, val
+       ldr r2, =\reg
+       ldr r3, =\val
+       str r3, [r2]
+.endm
+
+.macro REG8 reg, val
+       ldr r2, =\reg
+       ldr r3, =\val
+       strb r3, [r2]
+.endm
+
+.macro DELAY loops
+       ldr r2, =\loops
+1:
+       subs    r2, r2, #1
+       nop
+       bcs 1b
+.endm
+
+.globl lowlevel_init
+lowlevel_init:
+
+       REG     IPU_CONF, IPU_CONF_DI_EN
+       REG     CCM_CCMR, 0x074B0BF5
+
+       DELAY 0x40000
+
+       REG     CCM_CCMR, 0x074B0BF5 | CCMR_MPE
+       REG     CCM_CCMR, (0x074B0BF5 | CCMR_MPE) & ~CCMR_MDS
+
+       REG     CCM_PDR0, PDR0_CSI_PODF(0xff1) | PDR0_PER_PODF(7) | PDR0_HSP_PODF(3) | PDR0_NFC_PODF(5) | PDR0_IPG_PODF(1) | PDR0_MAX_PODF(3) | PDR0_MCU_PODF(0)
+
+       REG     CCM_MPCTL, PLL_PD(0) | PLL_MFD(0xe) | PLL_MFI(9) | PLL_MFN(0xd)
+
+       REG     CCM_SPCTL, PLL_PD(1) | PLL_MFD(0x43) | PLL_MFI(12) | PLL_MFN(1)
+
+       REG     0x43FAC26C, 0 /* SDCLK */
+       REG     0x43FAC270, 0 /* CAS */
+       REG     0x43FAC274, 0 /* RAS */
+       REG     0x43FAC27C, 0x1000 /* CS2       CSD0) */
+       REG     0x43FAC284, 0 /* DQM3 */
+       REG     0x43FAC288, 0 /* DQM2, DQM1, DQM0, SD31-SD0, A25-A0, MA10       0x288..0x2DC) */
+       REG     0x43FAC28C, 0
+       REG     0x43FAC290, 0
+       REG     0x43FAC294, 0
+       REG     0x43FAC298, 0
+       REG     0x43FAC29C, 0
+       REG     0x43FAC2A0, 0
+       REG     0x43FAC2A4, 0
+       REG     0x43FAC2A8, 0
+       REG     0x43FAC2AC, 0
+       REG     0x43FAC2B0, 0
+       REG     0x43FAC2B4, 0
+       REG     0x43FAC2B8, 0
+       REG     0x43FAC2BC, 0
+       REG     0x43FAC2C0, 0
+       REG     0x43FAC2C4, 0
+       REG     0x43FAC2C8, 0
+       REG     0x43FAC2CC, 0
+       REG     0x43FAC2D0, 0
+       REG     0x43FAC2D4, 0
+       REG     0x43FAC2D8, 0
+       REG     0x43FAC2DC, 0
+       REG     0xB8001010, 0x00000004
+       REG     0xB8001004, 0x006ac73a
+       REG     0xB8001000, 0x92100000
+       REG     0x80000f00, 0x12344321
+       REG     0xB8001000, 0xa2100000
+       REG     0x80000000, 0x12344321
+       REG     0x80000000, 0x12344321
+       REG     0xB8001000, 0xb2100000
+       REG8    0x80000033, 0xda
+       REG8    0x81000000, 0xff
+       REG     0xB8001000, 0x82226080
+       REG     0x80000000, 0xDEADBEEF
+       REG     0xB8001010, 0x0000000c
+
+       mov     pc, lr
diff --git a/board/imx31_phycore/u-boot.lds b/board/imx31_phycore/u-boot.lds
new file mode 100644 (file)
index 0000000..1460adc
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * January 2004 - Changed to support H4 device
+ * Copyright (c) 2004 Texas Instruments
+ *
+ * (C) Copyright 2002
+ * Gary Jennejohn, DENX Software Engineering, <gj@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-littlearm", "elf32-littlearm", "elf32-littlearm")
+OUTPUT_ARCH(arm)
+ENTRY(_start)
+SECTIONS
+{
+       . = 0x00000000;
+
+       . = ALIGN(4);
+       .text      :
+       {
+         cpu/arm1136/start.o   (.text)
+         *(.text)
+       }
+
+       . = ALIGN(4);
+       .rodata : { *(.rodata) }
+
+       . = ALIGN(4);
+       .data : { *(.data) }
+
+       . = ALIGN(4);
+       .got : { *(.got) }
+
+       . = .;
+       __u_boot_cmd_start = .;
+       .u_boot_cmd : { *(.u_boot_cmd) }
+       __u_boot_cmd_end = .;
+
+       . = ALIGN(4);
+       __bss_start = .;
+       .bss : { *(.bss) }
+       _end = .;
+}
index dbf0ecc..c624b3d 100644 (file)
 #include <asm/addrspace.h>
 #include <asm/inca-ip.h>
 #include <asm/io.h>
+#include <asm/reboot.h>
 
 extern uint incaip_get_cpuclk(void);
 
+void _machine_restart(void)
+{
+       *INCA_IP_WDT_RST_REQ = 0x3f;
+}
+
 static ulong max_sdram_size(void)
 {
        /* The only supported SDRAM data width is 16bit.
index 14d738a..08f7f21 100644 (file)
@@ -105,7 +105,7 @@ __ebu_init:
        li      t2, 0x684143FD
        sw      t2, EBU_BUSCON1(t1)
 3:
-       j       ra
+       jr      ra
        nop
 
        .end    ebu_init
@@ -170,7 +170,7 @@ __cgu_init:
        li      t2, 0x80000001
        sw      t2, CGU_MUXCR(t1)
 5:
-       j       ra
+       jr      ra
        nop
 
        .end    cgu_init
@@ -266,7 +266,7 @@ __sdram_init:
        li      t2, 0x00000001
        sw      t2, MC_CTRLENA(t1)
 
-       j       ra
+       jr      ra
        nop
 
        .end    sdram_init
@@ -276,6 +276,12 @@ __sdram_init:
        .ent    lowlevel_init
 lowlevel_init:
 
+       /* Disable Watchdog.
+        */
+       la      t9, disable_incaip_wdt
+       jalr    t9
+       nop
+
        /* EBU, CGU and SDRAM Initialization.
         */
        li      a0, CPU_CLOCK_RATE
@@ -292,7 +298,7 @@ lowlevel_init:
        nop
        move    ra, t0
 
-       j       ra
+       jr      ra
        nop
 
        .end    lowlevel_init
index 1a8dc97..6556ed5 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 43d2b3b..f571350 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 2fd5c87..bbd93ee 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 3214f3f..c6f2ad5 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 4bd9418..96101ec 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 39966e0..fa8374f 100644 (file)
 # Korat (PPC440EPx) board
 #
 
-TEXT_BASE = 0xFFFA0000
-
 PLATFORM_CPPFLAGS += -DCONFIG_440=1
 
 ifeq ($(debug),1)
 PLATFORM_CPPFLAGS += -DDEBUG
 endif
 
+ifeq ($(emul),1)
+PLATFORM_CPPFLAGS += -fno-schedule-insns -fno-schedule-insns2
+endif
+
 ifeq ($(dbcr),1)
-PLATFORM_CPPFLAGS += -DCFG_INIT_DBCR=0x8cff0000
+PLATFORM_CPPFLAGS += -DCFG_INIT_DBCR=0x8CFF0000
+endif
+
+ifeq ($(perm),1)
+PLATFORM_CPPFLAGS += -DCONFIG_KORAT_PERMANENT
+TEXT_BASE = 0xFFFA0000
+else
+TEXT_BASE = 0xF7F60000
+LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-F7FC.lds
 endif
index bd0e8b4..bf8b2c8 100644 (file)
@@ -43,7 +43,7 @@ tlbtab:
         * BOOT_CS (FLASH) must be first. Before relocation SA_I can be off to use the
         * speed up boot process. It is patched after relocation to enable SA_I
         */
-       tlbentry( CFG_BOOT_BASE_ADDR, SZ_256M, CFG_BOOT_BASE_ADDR, 1, AC_R|AC_W|AC_X|SA_G )
+       tlbentry( 0xF0000000, SZ_256M, 0xF0000000, 1, AC_R|AC_W|AC_X|SA_G )
 
        /*
         * TLB entries for SDRAM are not needed on this platform.  They are
@@ -52,24 +52,32 @@ tlbtab:
 
 #ifdef CFG_INIT_RAM_DCACHE
        /* TLB-entry for init-ram in dcache (SA_I must be turned off!) */
-       tlbentry( CFG_INIT_RAM_ADDR, SZ_64K, CFG_INIT_RAM_ADDR, 0, AC_R|AC_W|AC_X|SA_G )
+       tlbentry( CFG_INIT_RAM_ADDR, SZ_64K, CFG_INIT_RAM_ADDR, 0,
+                 AC_R|AC_W|AC_X|SA_G )
 #endif
 
        /* TLB-entry for PCI Memory */
-       tlbentry( CFG_PCI_MEMBASE, SZ_256M, CFG_PCI_MEMBASE, 1, AC_R|AC_W|SA_G|SA_I )
-       tlbentry( CFG_PCI_MEMBASE1, SZ_256M, CFG_PCI_MEMBASE1, 1, AC_R|AC_W|SA_G|SA_I )
-       tlbentry( CFG_PCI_MEMBASE2, SZ_256M, CFG_PCI_MEMBASE2, 1, AC_R|AC_W|SA_G|SA_I )
-       tlbentry( CFG_PCI_MEMBASE3, SZ_256M, CFG_PCI_MEMBASE3, 1, AC_R|AC_W|SA_G|SA_I )
+       tlbentry( CFG_PCI_MEMBASE + 0x00000000, SZ_256M,
+                 CFG_PCI_MEMBASE + 0x00000000, 1, AC_R|AC_W|SA_G|SA_I )
+
+       tlbentry( CFG_PCI_MEMBASE + 0x10000000, SZ_256M,
+                 CFG_PCI_MEMBASE + 0x10000000, 1, AC_R|AC_W|SA_G|SA_I )
+
+       tlbentry( CFG_PCI_MEMBASE + 0x20000000, SZ_256M,
+                 CFG_PCI_MEMBASE + 0x20000000, 1, AC_R|AC_W|SA_G|SA_I )
+
+       tlbentry( CFG_PCI_MEMBASE + 0x30000000, SZ_256M,
+                 CFG_PCI_MEMBASE + 0x30000000, 1, AC_R|AC_W|SA_G|SA_I )
 
        /* TLB-entry for EBC */
        tlbentry( CFG_CPLD_BASE, SZ_1K, CFG_CPLD_BASE, 1, AC_R|AC_W|SA_G|SA_I )
 
        /* TLB-entry for Internal Registers & OCM */
        /* I wonder why this must be executable -- lrj@acm.org 2007-10-08 */
-       tlbentry( 0xE0000000, SZ_16M, 0xE0000000, 0,  AC_R|AC_W|AC_X|SA_I )
+       tlbentry( 0xE0000000, SZ_16M, 0xE0000000, 0, AC_R|AC_W|AC_X|SA_I )
 
        /*TLB-entry PCI registers*/
-       tlbentry( 0xEEC00000, SZ_1K, 0xEEC00000, 1,  AC_R|AC_W|SA_G|SA_I )
+       tlbentry( 0xEEC00000, SZ_1K, 0xEEC00000, 1, AC_R|AC_W|SA_G|SA_I )
 
        /* TLB-entry for peripherals */
        tlbentry( 0xEF000000, SZ_16M, 0xEF000000, 1, AC_R|AC_W|SA_G|SA_I)
@@ -78,3 +86,10 @@ tlbtab:
        tlbentry(0xE8000000, SZ_64K, 0xE8000000, 1, AC_R|AC_W|SA_G|SA_I)
 
        tlbtab_end
+
+#if defined(CONFIG_KORAT_PERMANENT)
+       .globl  korat_branch_absolute
+korat_branch_absolute:
+       mtlr    r3
+       blr
+#endif
index 90fd0a7..a7b4b27 100644 (file)
@@ -2,12 +2,12 @@
  * (C) Copyright 2007-2008
  * Larry Johnson, lrj@acm.org
  *
- * (C) Copyright 2006-2008
+ * (C) Copyright 2006-2007
  * Stefan Roese, DENX Software Engineering, sr@denx.de.
  *
  * (C) Copyright 2006
  * Jacqueline Pira-Ferriol, AMCC/IBM, jpira-ferriol@fr.ibm.com
- * Alain Saurel,            AMCC/IBM, alain.saurel@fr.ibm.com
+ * Alain Saurel,           AMCC/IBM, alain.saurel@fr.ibm.com
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -39,12 +39,45 @@ extern flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
 
 ulong flash_get_size(ulong base, int banknum);
 
+#if defined(CONFIG_KORAT_PERMANENT)
+void korat_buzzer(int const on)
+{
+       if (on) {
+               out_8((u8 *) CFG_CPLD_BASE + 0x05,
+                     in_8((u8 *) CFG_CPLD_BASE + 0x05) | 0x80);
+       } else {
+               out_8((u8 *) CFG_CPLD_BASE + 0x05,
+                     in_8((u8 *) CFG_CPLD_BASE + 0x05) & ~0x80);
+       }
+}
+#endif
+
 int board_early_init_f(void)
 {
-       u32 sdr0_pfc1, sdr0_pfc2;
-       u32 reg;
+       uint32_t sdr0_pfc1, sdr0_pfc2;
+       uint32_t reg;
        int eth;
 
+#if defined(CONFIG_KORAT_PERMANENT)
+       unsigned mscount;
+
+       extern void korat_branch_absolute(uint32_t addr);
+
+       for (mscount = 0;  mscount < CFG_KORAT_MAN_RESET_MS; ++mscount) {
+               udelay(1000);
+               if (gpio_read_in_bit(CFG_GPIO_RESET_PRESSED_)) {
+                       /* This call does not return. */
+                       korat_branch_absolute(
+                               CFG_FLASH1_TOP - 2 * CFG_ENV_SECT_SIZE - 4);
+               }
+       }
+       korat_buzzer(1);
+       while (!gpio_read_in_bit(CFG_GPIO_RESET_PRESSED_))
+               udelay(1000);
+
+       korat_buzzer(0);
+#endif
+
        mtdcr(ebccfga, xbcfg);
        mtdcr(ebccfgd, 0xb8400000);
 
@@ -75,8 +108,11 @@ int board_early_init_f(void)
        mtdcr(uic2vr, 0x00000000);      /* int31 highest, base=0x000 */
        mtdcr(uic2sr, 0xffffffff);      /* clear all */
 
-       /* take sim card reader and CF controller out of reset */
-       out_8((u8 *) CFG_CPLD_BASE + 0x04, 0x80);
+       /*
+        * Take sim card reader and CF controller out of reset.  Also enable PHY
+        * auto-detect until board-specific PHY resets are available.
+        */
+       out_8((u8 *) CFG_CPLD_BASE + 0x02, 0xC0);
 
        /* Configure the two Ethernet PHYs.  For each PHY, configure for fiber
         * if the SFP module is present, and for copper if it is not present.
@@ -85,8 +121,8 @@ int board_early_init_f(void)
                if (gpio_read_in_bit(CFG_GPIO_SFP0_PRESENT_ + eth)) {
                        /* SFP module not present: configure PHY for copper. */
                        /* Set PHY to autonegotate 10 MB, 100MB, or 1 GB */
-                       out_8((u8 *) CFG_CPLD_BASE + 0x06,
-                             in_8((u8 *) CFG_CPLD_BASE + 0x06) |
+                       out_8((u8 *) CFG_CPLD_BASE + 0x03,
+                             in_8((u8 *) CFG_CPLD_BASE + 0x03) |
                              0x06 << (4 * eth));
                } else {
                        /* SFP module present: configure PHY for fiber and
@@ -99,10 +135,18 @@ int board_early_init_f(void)
        gpio_write_bit(CFG_GPIO_PHY0_EN, 1);
        gpio_write_bit(CFG_GPIO_PHY1_EN, 1);
 
-       /* select Ethernet pins */
+       /* Wait 1 ms, then enable Fiber signal detect to PHYs. */
+       udelay(1000);
+       out_8((u8 *) CFG_CPLD_BASE + 0x03,
+             in_8((u8 *) CFG_CPLD_BASE + 0x03) | 0x88);
+
+       /* select Ethernet (and optionally IIC1) pins */
        mfsdr(SDR0_PFC1, sdr0_pfc1);
        sdr0_pfc1 = (sdr0_pfc1 & ~SDR0_PFC1_SELECT_MASK) |
                SDR0_PFC1_SELECT_CONFIG_4;
+#ifdef CONFIG_I2C_MULTI_BUS
+       sdr0_pfc1 |= ((sdr0_pfc1 & ~SDR0_PFC1_SIS_MASK) | SDR0_PFC1_SIS_IIC1_SEL);
+#endif
        mfsdr(SDR0_PFC2, sdr0_pfc2);
        sdr0_pfc2 = (sdr0_pfc2 & ~SDR0_PFC2_SELECT_MASK) |
                SDR0_PFC2_SELECT_CONFIG_4;
@@ -116,6 +160,58 @@ int board_early_init_f(void)
        return 0;
 }
 
+/*
+ * The boot flash on CS0 normally has its write-enable pin disabled, and so will
+ * not respond to CFI commands.  This routine therefore fills in the flash
+ * information for the boot flash.  (The flash at CS1 operates normally.)
+ */
+ulong board_flash_get_legacy (ulong base, int banknum, flash_info_t * info)
+{
+       uint32_t addr;
+       int i;
+
+       if (1 != banknum)
+               return 0;
+
+       info->size              = CFG_FLASH0_SIZE;
+       info->sector_count      = CFG_FLASH0_SIZE / 0x20000;
+       info->flash_id          = 0x01000000;
+       info->portwidth         = 2;
+       info->chipwidth         = 2;
+       info->buffer_size       = 32;
+       info->erase_blk_tout    = 16384;
+       info->write_tout        = 2;
+       info->buffer_write_tout = 5;
+       info->vendor            = 2;
+       info->cmd_reset         = 0x00F0;
+       info->interface         = 2;
+       info->legacy_unlock     = 0;
+       info->manufacturer_id   = 1;
+       info->device_id         = 0x007E;
+
+#if CFG_FLASH0_SIZE == 0x01000000
+       info->device_id2        = 0x2101;
+#elif CFG_FLASH0_SIZE == 0x04000000
+       info->device_id2        = 0x2301;
+#else
+#error Unable to set device_id2 for current CFG_FLASH0_SIZE
+#endif
+
+       info->ext_addr          = 0x0040;
+       info->cfi_version       = 0x3133;
+       info->cfi_offset        = 0x0055;
+       info->addr_unlock1      = 0x00000555;
+       info->addr_unlock2      = 0x000002AA;
+       info->name              = "CFI conformant";
+       for (i = 0, addr = -info->size;
+            i < info->sector_count;
+            ++i, addr += 0x20000) {
+               info->start[i] = addr;
+               info->protect[i] = 0x00;
+       }
+       return 1;
+}
+
 static int man_data_read(unsigned int addr)
 {
        /*
@@ -189,12 +285,20 @@ static void set_serial_number(void)
         * If the environmental variable "serial#" is not set, try to set it
         * from the manufacturer's information serial EEPROM.
         */
-       char s[MAN_SERIAL_NO_LENGTH + 1];
+       char s[MAN_INFO_LENGTH + MAN_MAC_ADDR_LENGTH + 2];
+
+       if (getenv("serial#"))
+               return;
+
+       if (!man_data_read_field(s, MAN_INFO_FIELD, MAN_INFO_LENGTH))
+               return;
+
+       s[MAN_INFO_LENGTH] = '-';
+       if (!man_data_read_field(s + MAN_INFO_LENGTH + 1, MAN_MAC_ADDR_FIELD,
+                                MAN_MAC_ADDR_LENGTH))
+               return;
 
-       if (0 == getenv("serial#") &&
-           0 != man_data_read_field(s, MAN_SERIAL_NO_FIELD,
-                                    MAN_SERIAL_NO_LENGTH))
-               setenv("serial#", s);
+       setenv("serial#", s);
 }
 
 static void set_mac_addresses(void)
@@ -204,45 +308,58 @@ static void set_mac_addresses(void)
         * set, try to set them from the manufacturer's information serial
         * EEPROM.
         */
-       char s[MAN_MAC_ADDR_LENGTH + 1];
+
+#if MAN_MAC_ADDR_LENGTH % 2 != 0
+#error MAN_MAC_ADDR_LENGTH must be an even number
+#endif
+
+       char s[(3 * MAN_MAC_ADDR_LENGTH) / 2];
+       char *src;
+       char *dst;
 
        if (0 != getenv("ethaddr") && 0 != getenv("eth1addr"))
                return;
 
-       if (0 == man_data_read_field(s, MAN_MAC_ADDR_FIELD,
-                                    MAN_MAC_ADDR_LENGTH))
+       if (0 == man_data_read_field(s + (MAN_MAC_ADDR_LENGTH / 2) - 1,
+                                    MAN_MAC_ADDR_FIELD, MAN_MAC_ADDR_LENGTH))
                return;
 
+       for (src = s + (MAN_MAC_ADDR_LENGTH / 2) - 1, dst = s; src != dst;) {
+               *dst++ = *src++;
+               *dst++ = *src++;
+               *dst++ = ':';
+       }
        if (0 == getenv("ethaddr"))
                setenv("ethaddr", s);
 
        if (0 == getenv("eth1addr")) {
-               ++s[MAN_MAC_ADDR_LENGTH - 1];
+               ++s[((3 * MAN_MAC_ADDR_LENGTH) / 2) - 2];
                setenv("eth1addr", s);
        }
 }
 
 int misc_init_r(void)
 {
-       uint pbcr;
-       int size_val = 0;
-       u32 reg;
+       uint32_t pbcr;
+       int size_val;
+       uint32_t reg;
        unsigned long usb2d0cr = 0;
        unsigned long usb2phy0cr, usb2h0cr = 0;
        unsigned long sdr0_pfc1;
-       char *act = getenv("usbact");
-
-       /* Re-do flash sizing to get full correct info */
+       uint32_t const flash1_size = gd->bd->bi_flashsize - CFG_FLASH0_SIZE;
+       char const *const act = getenv("usbact");
 
-       /* adjust flash start and offset */
-       gd->bd->bi_flashstart = 0 - gd->bd->bi_flashsize;
+       /*
+        * Re-do FLASH1 sizing and adjust flash start and offset.
+        */
+       gd->bd->bi_flashstart = CFG_FLASH1_TOP - flash1_size;
        gd->bd->bi_flashoffset = 0;
 
-       mtdcr(ebccfga, pb0cr);
+       mtdcr(ebccfga, pb1cr);
        pbcr = mfdcr(ebccfgd);
-       size_val = ffs(gd->bd->bi_flashsize) - 21;
+       size_val = ffs(flash1_size) - 21;
        pbcr = (pbcr & 0x0001ffff) | gd->bd->bi_flashstart | (size_val << 17);
-       mtdcr(ebccfga, pb0cr);
+       mtdcr(ebccfga, pb1cr);
        mtdcr(ebccfgd, pbcr);
 
        /*
@@ -250,14 +367,37 @@ int misc_init_r(void)
         */
        flash_get_size(gd->bd->bi_flashstart, 0);
 
-       /* Monitor protection ON by default */
-       (void)flash_protect(FLAG_PROTECT_SET, -CFG_MONITOR_LEN, 0xffffffff,
-                           &flash_info[0]);
+       /*
+        * Re-do FLASH1 sizing and adjust flash offset to reserve space for
+        * environment
+        */
+       gd->bd->bi_flashoffset =
+               CFG_ENV_ADDR_REDUND + CFG_ENV_SECT_SIZE - CFG_FLASH1_ADDR;
 
+       mtdcr(ebccfga, pb1cr);
+       pbcr = mfdcr(ebccfgd);
+       size_val = ffs(gd->bd->bi_flashsize - CFG_FLASH0_SIZE) - 21;
+       pbcr = (pbcr & 0x0001ffff) | gd->bd->bi_flashstart | (size_val << 17);
+       mtdcr(ebccfga, pb1cr);
+       mtdcr(ebccfgd, pbcr);
+
+       /* Monitor protection ON by default */
+#if defined(CONFIG_KORAT_PERMANENT)
+       (void)flash_protect(FLAG_PROTECT_SET, CFG_MONITOR_BASE,
+                           CFG_MONITOR_BASE + CFG_MONITOR_LEN - 1,
+                           flash_info + 1);
+#else
+       (void)flash_protect(FLAG_PROTECT_SET, CFG_MONITOR_BASE,
+                           CFG_MONITOR_BASE + CFG_MONITOR_LEN - 1,
+                           flash_info);
+#endif
        /* Env protection ON by default */
+       (void)flash_protect(FLAG_PROTECT_SET, CFG_ENV_ADDR,
+                           CFG_ENV_ADDR + CFG_ENV_SECT_SIZE - 1,
+                           flash_info);
        (void)flash_protect(FLAG_PROTECT_SET, CFG_ENV_ADDR_REDUND,
-                           CFG_ENV_ADDR_REDUND + 2 * CFG_ENV_SECT_SIZE - 1,
-                           &flash_info[0]);
+                           CFG_ENV_ADDR_REDUND + CFG_ENV_SECT_SIZE - 1,
+                           flash_info);
 
        /*
         * USB suff...
@@ -393,6 +533,8 @@ int misc_init_r(void)
 
        set_serial_number();
        set_mac_addresses();
+       gpio_write_bit(CFG_GPIO_ATMEGA_RESET_, 1);
+
        return 0;
 }
 
@@ -402,10 +544,10 @@ int checkboard(void)
        u8 const rev = in_8((u8 *) CFG_CPLD_BASE + 0);
 
        printf("Board: Korat, Rev. %X", rev);
-       if (s != NULL)
+       if (s)
                printf(", serial# %s", s);
 
-       printf(", Ethernet PHY 0: ");
+       printf(".\n       Ethernet PHY 0: ");
        if (gpio_read_out_bit(CFG_GPIO_PHY0_FIBER_SEL))
                printf("fiber");
        else
@@ -418,7 +560,10 @@ int checkboard(void)
                printf("copper");
 
        printf(".\n");
-       return (0);
+#if defined(CONFIG_KORAT_PERMANENT)
+       printf("       Executing permanent copy of U-Boot.\n");
+#endif
+       return 0;
 }
 
 #if defined(CFG_DRAM_TEST)
@@ -529,23 +674,26 @@ void pci_target_init(struct pci_controller *hose)
        /*
         * PowerPC440EPX PCI Master configuration.
         * Map one 1Gig range of PLB/processor addresses to PCI memory space.
-        * PLB address 0xA0000000-0xDFFFFFFF
-        *     ==> PCI address 0xA0000000-0xDFFFFFFF
+        * PLB address 0x80000000-0xBFFFFFFF
+        *     ==> PCI address 0x80000000-0xBFFFFFFF
         * Use byte reversed out routines to handle endianess.
         * Make this region non-prefetchable.
         */
        out32r(PCIX0_PMM0MA, 0x00000000);       /* PMM0 Mask/Attribute */
                                                /* - disabled b4 setting */
        out32r(PCIX0_PMM0LA, CFG_PCI_MEMBASE);  /* PMM0 Local Address */
-       out32r(PCIX0_PMM0PCILA, CFG_PCI_MEMBASE); /* PMM0 PCI Low Address */
+       out32r(PCIX0_PMM0PCILA,
+              CFG_PCI_MEMBASE);                /* PMM0 PCI Low Address */
        out32r(PCIX0_PMM0PCIHA, 0x00000000);    /* PMM0 PCI High Address */
        out32r(PCIX0_PMM0MA, 0xE0000001);       /* 512M + No prefetching, */
                                                /* and enable region */
 
        out32r(PCIX0_PMM1MA, 0x00000000);       /* PMM0 Mask/Attribute */
                                                /* - disabled b4 setting */
-       out32r(PCIX0_PMM1LA, CFG_PCI_MEMBASE2); /* PMM0 Local Address */
-       out32r(PCIX0_PMM1PCILA, CFG_PCI_MEMBASE2); /* PMM0 PCI Low Address */
+       out32r(PCIX0_PMM1LA,
+              CFG_PCI_MEMBASE + 0x20000000);   /* PMM0 Local Address */
+       out32r(PCIX0_PMM1PCILA,
+              CFG_PCI_MEMBASE + 0x20000000);   /* PMM0 PCI Low Address */
        out32r(PCIX0_PMM1PCIHA, 0x00000000);    /* PMM0 PCI High Address */
        out32r(PCIX0_PMM1MA, 0xE0000001);       /* 512M + No prefetching, */
                                                /* and enable region */
similarity index 87%
rename from board/r5200/u-boot.lds
rename to board/korat/u-boot-F7FC.lds
index 29fe589..174060e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2000
+ * (C) Copyright 2002
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
  * See file CREDITS for list of people who contributed to this
  * MA 02111-1307 USA
  */
 
-OUTPUT_ARCH(m68k)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib);
+OUTPUT_ARCH(powerpc)
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
 {
+  .resetvec 0xF7FBFFFC :
+  {
+    *(.resetvec)
+  } = 0xffff
+
+  .bootpg 0xF7FBF000 :
+  {
+    cpu/ppc4xx/start.o (.bootpg)
+  } = 0xffff
+
   /* Read-only sections, merged into text segment: */
   . = + SIZEOF_HEADERS;
   .interp : { *(.interp) }
@@ -56,14 +65,7 @@ SECTIONS
     /* WARNING - the following is hand-optimized to fit within */
     /* the sector layout of our flash chips!   XXX FIXME XXX   */
 
-    cpu/mcf52x2/start.o                (.text)
-    lib_m68k/traps.o           (.text)
-    cpu/mcf52x2/interrupts.o   (.text)
-    common/dlmalloc.o          (.text)
-    lib_generic/zlib.o         (.text)
-
-    . = DEFINED(env_offset) ? env_offset : .;
-    common/environment.o       (.text)
+    cpu/ppc4xx/start.o (.text)
 
     *(.text)
     *(.fixup)
@@ -75,6 +77,7 @@ SECTIONS
   {
     *(.rodata)
     *(.rodata1)
+    *(.rodata.str1.4)
   }
   .fini      : { *(.fini)    } =0
   .ctors     : { *(.ctors)   }
@@ -84,12 +87,9 @@ SECTIONS
   . = (. + 0x00FF) & 0xFFFFFF00;
   _erotext = .;
   PROVIDE (erotext = .);
-
   .reloc   :
   {
-    __got_start = .;
     *(.got)
-    __got_end = .;
     _GOT2_TABLE_ = .;
     *(.got2)
     _FIXUP_TABLE_ = .;
@@ -131,14 +131,12 @@ SECTIONS
   __bss_start = .;
   .bss (NOLOAD)       :
   {
-   _sbss = .;
    *(.sbss) *(.scommon)
    *(.dynbss)
    *(.bss)
    *(COMMON)
-   . = ALIGN(4);
-   _ebss = .;
   }
+
   _end = . ;
   PROVIDE (end = .);
 }
index e140737..da2a400 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 5f6e269..e0ae224 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index c0cf1cb..4942c42 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 5f6e269..e0ae224 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index c0cf1cb..4942c42 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index a1b869d..688846b 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 65b25b9..a39ee9d 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
diff --git a/board/linkstation/Makefile b/board/linkstation/Makefile
new file mode 100644 (file)
index 0000000..57c84de
--- /dev/null
@@ -0,0 +1,40 @@
+#
+# (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
+#
+
+include $(TOPDIR)/config.mk
+
+LIB    = lib$(BOARD).a
+
+OBJS   = $(BOARD).o ide.o hwctl.o avr.o
+
+$(LIB):        .depend $(OBJS) $(SOBJS)
+       $(AR) crv $@ $(OBJS) $(SOBJS)
+
+#########################################################################
+
+.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
+               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+
+sinclude .depend
+
+#########################################################################
diff --git a/board/linkstation/avr.c b/board/linkstation/avr.c
new file mode 100644 (file)
index 0000000..68bc545
--- /dev/null
@@ -0,0 +1,293 @@
+/*
+ * avr.c
+ *
+ * AVR functions
+ *
+ * Copyright (C) 2006 Mihai Georgian <u-boot@linuxnotincluded.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+#include <common.h>
+#include <ns16550.h>
+#include <console.h>
+
+/* Button codes from the AVR */
+#define PWRR                   0x20            /* Power button release */
+#define PWRP                   0x21            /* Power button push    */
+#define RESR                   0x22            /* Reset button release */
+#define RESP                   0x23            /* Reset button push    */
+#define AVRINIT                        0x33            /* Init complete        */
+#define AVRRESET               0x31            /* Reset request        */
+
+/* LED commands */
+#define PWRBLINKSTRT           '['             /* Blink power LED      */
+#define PWRBLINKSTOP           'Z'             /* Solid power LED      */
+#define HDDLEDON               'W'             /* HDD LED on           */
+#define HDDLEDOFF              'V'             /* HDD LED off          */
+#define HDDBLINKSTRT           'Y'             /* HDD LED start blink  */
+#define HDDBLINKSTOP           'X'             /* HDD LED stop blink   */
+
+/* Timings for LEDs blinking to show choice */
+#define PULSETIME              250             /* msecs                */
+#define LONGPAUSE              (5 * PULSETIME)
+
+/* Button press times */
+#define PUSHHOLD               1000            /* msecs                */
+#define NOBUTTON               (6 * (LONGPAUSE+PULSETIME))
+
+/* Boot and console choices */
+#define MAX_BOOT_CHOICE                3
+
+static char *consoles[] = {
+       "serial",
+#if defined(CONFIG_NETCONSOLE)
+       "nc",
+#endif
+};
+#define MAX_CONS_CHOICE        (sizeof(consoles)/sizeof(char *))
+
+#if !defined(CONFIG_NETCONSOLE)
+#define DEF_CONS_CHOICE                0
+#else
+#define DEF_CONS_CHOICE                1
+#endif
+
+#define perror(fmt, args...) printf("%s: " fmt, __FUNCTION__ , ##args)
+
+extern void miconCntl_SendCmd(unsigned char dat);
+extern void miconCntl_DisWDT(void);
+
+static int boot_stop;
+
+static int boot_choice = 1;
+static int cons_choice = DEF_CONS_CHOICE;
+
+static char envbuffer[16];
+
+void init_AVR_DUART (void)
+{
+       NS16550_t AVR_port = (NS16550_t) CFG_NS16550_COM2;
+       int clock_divisor = CFG_NS16550_CLK / 16 / 9600;
+
+       /*
+        * AVR port init sequence taken from
+        * the original Linkstation init code
+        * Normal U-Boot serial reinit doesn't
+        * work because the AVR uses even parity
+        */
+       AVR_port->lcr = 0x00;
+       AVR_port->ier = 0x00;
+       AVR_port->lcr = LCR_BKSE;
+       AVR_port->dll = clock_divisor & 0xff;
+       AVR_port->dlm = (clock_divisor >> 8) & 0xff;
+       AVR_port->lcr = LCR_WLS_8 | LCR_PEN | LCR_EPS;
+       AVR_port->mcr = 0x00;
+       AVR_port->fcr = FCR_FIFO_EN | FCR_RXSR | FCR_TXSR;
+
+       miconCntl_DisWDT();
+
+       boot_stop = 0;
+       miconCntl_SendCmd(PWRBLINKSTRT);
+}
+
+static inline int avr_tstc(void)
+{
+       return (NS16550_tstc((NS16550_t)CFG_NS16550_COM2));
+}
+
+static inline char avr_getc(void)
+{
+       return (NS16550_getc((NS16550_t)CFG_NS16550_COM2));
+}
+
+static int push_timeout(char button_code)
+{
+       ulong push_start = get_timer(0);
+       while (get_timer(push_start) <= PUSHHOLD)
+               if (avr_tstc() && avr_getc() == button_code)
+                       return 0;
+       return 1;
+}
+
+static void next_boot_choice(void)
+{
+       ulong return_start;
+       ulong pulse_start;
+       int on_times;
+       int button_on;
+       int led_state;
+       char c;
+
+       button_on = 0;
+       return_start = get_timer(0);
+
+       on_times = boot_choice;
+       led_state = 0;
+       miconCntl_SendCmd(HDDLEDOFF);
+       pulse_start = get_timer(0);
+
+       while (get_timer(return_start) <= NOBUTTON || button_on) {
+               if (avr_tstc()) {
+                       c = avr_getc();
+                       if (c == PWRP)
+                               button_on = 1;
+                       else if (c == PWRR) {
+                               button_on = 0;
+                               return_start = get_timer(0);
+                               if (++boot_choice > MAX_BOOT_CHOICE)
+                                       boot_choice = 1;
+                               sprintf(envbuffer, "bootcmd%d", boot_choice);
+                               if (getenv(envbuffer)) {
+                                       sprintf(envbuffer, "run bootcmd%d", boot_choice);
+                                       setenv("bootcmd", envbuffer);
+                               }
+                               on_times = boot_choice;
+                               led_state = 1;
+                               miconCntl_SendCmd(HDDLEDON);
+                               pulse_start = get_timer(0);
+                       } else {
+                               perror("Unexpected code: 0x%02X\n", c);
+                       }
+               }
+               if (on_times && get_timer(pulse_start) > PULSETIME) {
+                       if (led_state == 1) {
+                               --on_times;
+                               led_state = 0;
+                               miconCntl_SendCmd(HDDLEDOFF);
+                       } else {
+                               led_state = 1;
+                               miconCntl_SendCmd(HDDLEDON);
+                       }
+                       pulse_start = get_timer(0);
+               }
+               if (!on_times && get_timer(pulse_start) > LONGPAUSE) {
+                       on_times = boot_choice;
+                       led_state = 1;
+                       miconCntl_SendCmd(HDDLEDON);
+                       pulse_start = get_timer(0);
+               }
+       }
+       if (led_state)
+               miconCntl_SendCmd(HDDLEDOFF);
+}
+
+void next_cons_choice(int console)
+{
+       ulong return_start;
+       ulong pulse_start;
+       int on_times;
+       int button_on;
+       int led_state;
+       char c;
+
+       button_on = 0;
+       cons_choice = console;
+       return_start = get_timer(0);
+
+       on_times = cons_choice+1;
+       led_state = 1;
+       miconCntl_SendCmd(HDDLEDON);
+       pulse_start = get_timer(0);
+
+       while (get_timer(return_start) <= NOBUTTON || button_on) {
+               if (avr_tstc()) {
+                       c = avr_getc();
+                       if (c == RESP)
+                               button_on = 1;
+                       else if (c == RESR) {
+                               button_on = 0;
+                               return_start = get_timer(0);
+                               cons_choice = (cons_choice + 1) % MAX_CONS_CHOICE;
+                               console_assign(stdin, consoles[cons_choice]);
+                               console_assign(stdout, consoles[cons_choice]);
+                               console_assign(stderr, consoles[cons_choice]);
+                               on_times = cons_choice+1;
+                               led_state = 0;
+                               miconCntl_SendCmd(HDDLEDOFF);
+                               pulse_start = get_timer(0);
+                       } else {
+                               perror("Unexpected code: 0x%02X\n", c);
+                       }
+               }
+               if (on_times && get_timer(pulse_start) > PULSETIME) {
+                       if (led_state == 0) {
+                               --on_times;
+                               led_state = 1;
+                               miconCntl_SendCmd(HDDLEDON);
+                       } else {
+                               led_state = 0;
+                               miconCntl_SendCmd(HDDLEDOFF);
+                       }
+                       pulse_start = get_timer(0);
+               }
+               if (!on_times && get_timer(pulse_start) > LONGPAUSE) {
+                       on_times = cons_choice+1;
+                       led_state = 0;
+                       miconCntl_SendCmd(HDDLEDOFF);
+                       pulse_start = get_timer(0);
+               }
+       }
+       if (led_state);
+       miconCntl_SendCmd(HDDLEDOFF);
+}
+
+int avr_input(void)
+{
+       char avr_button;
+
+       if (!avr_tstc())
+               return 0;
+
+       avr_button = avr_getc();
+       switch (avr_button) {
+       case PWRP:
+               if (push_timeout(PWRR)) {
+                       /* Timeout before power button release */
+                       boot_stop = ~boot_stop;
+                       if (boot_stop)
+                               miconCntl_SendCmd(PWRBLINKSTOP);
+                       else
+                               miconCntl_SendCmd(PWRBLINKSTRT);
+                       /* Wait for power button release */
+                       while (avr_getc() != PWRR)
+                               ;
+               } else
+                       /* Power button released */
+                       next_boot_choice();
+               break;
+       case RESP:
+               /* Wait for Reset button release */
+               while (avr_getc() != RESR)
+                       ;
+               next_cons_choice(cons_choice);
+               break;
+       case AVRINIT:
+               return 0;
+       default:
+               perror("Unexpected code: 0x%02X\n", avr_button);
+               return 0;
+       }
+       if (boot_stop)
+               return (-3);
+       else
+               return (-2);
+}
+
+void avr_StopBoot(void)
+{
+       boot_stop = ~0;
+       miconCntl_SendCmd(PWRBLINKSTOP);
+}
diff --git a/board/linkstation/config.mk b/board/linkstation/config.mk
new file mode 100644 (file)
index 0000000..bdf611d
--- /dev/null
@@ -0,0 +1,50 @@
+#
+# (C) Copyright 2001-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
+#
+
+# LinkStation/LinkStation-HG:
+#
+#       Valid values for TEXT_BASE are:
+#
+#      Standard configuration - all models
+#       0xFFF00000   boot from flash
+#
+#      Test configuration (boot from RAM using uloader.o)
+#      LinkStation HD-HLAN and KuroBox Standard
+#       0x03F00000   boot from RAM
+#      LinkStation HD-HGLAN and KuroBox HG
+#       0x07F00000   boot from RAM
+#
+
+sinclude $(TOPDIR)/board/$(BOARDDIR)/config.tmp
+
+ifndef TEXT_BASE
+# For flash image - all models
+TEXT_BASE = 0xFFF00000
+# For RAM image
+# HLAN and LAN
+#TEXT_BASE = 0x03F00000
+# HGLAN and HGTL
+#TEXT_BASE = 0x07F00000
+endif
+
+PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE)
diff --git a/board/linkstation/hwctl.c b/board/linkstation/hwctl.c
new file mode 100644 (file)
index 0000000..9db128a
--- /dev/null
@@ -0,0 +1,135 @@
+/*
+ * hwctl.c
+ *
+ * LinkStation HW Control Driver
+ *
+ * Copyright (C) 2001-2004  BUFFALO INC.
+ *
+ * This software may be used and distributed according to the terms of
+ * the GNU General Public License (GPL), incorporated herein by reference.
+ * Drivers based on or derived from this code fall under the GPL and must
+ * retain the authorship, copyright and license notice.  This file is not
+ * a complete program and may only be used when the entire operating
+ * system is licensed under the GPL.
+ *
+ */
+
+#include <config.h>
+#include <common.h>
+#include <command.h>
+#include <asm/io.h>
+
+#define mdelay(n)      udelay((n)*1000)
+
+#define AVR_PORT CFG_NS16550_COM2
+
+/* 2005.5.10 BUFFALO add */
+/*--------------------------------------------------------------*/
+static inline void miconCntl_SendUart(unsigned char dat)
+{
+       out_8((char *)AVR_PORT, dat);
+       mdelay(1);
+}
+
+/*--------------------------------------------------------------*/
+void miconCntl_SendCmd(unsigned char dat)
+{
+       int i;
+
+       for (i=0; i<4; i++){
+               miconCntl_SendUart(dat);
+       }
+}
+
+/*--------------------------------------------------------------*/
+void miconCntl_FanLow(void)
+{
+#ifdef CONFIG_HTGL
+       miconCntl_SendCmd(0x5C);
+#endif
+}
+
+/*--------------------------------------------------------------*/
+void miconCntl_FanHigh(void)
+{
+#ifdef CONFIG_HTGL
+       miconCntl_SendCmd(0x5D);
+#endif
+}
+
+/*--------------------------------------------------------------*/
+/* 1000Mbps */
+void miconCntl_Eth1000M(int up)
+{
+#ifdef CONFIG_HTGL
+       if (up)
+               miconCntl_SendCmd(0x93);
+       else
+               miconCntl_SendCmd(0x92);
+#else
+       if (up)
+               miconCntl_SendCmd(0x5D);
+       else
+               miconCntl_SendCmd(0x5C);
+#endif
+}
+
+/*--------------------------------------------------------------*/
+/* 100Mbps */
+void miconCntl_Eth100M(int up)
+{
+#ifdef CONFIG_HTGL
+       if (up)
+               miconCntl_SendCmd(0x91);
+       else
+               miconCntl_SendCmd(0x90);
+#else
+       if (up)
+               miconCntl_SendCmd(0x5C);
+#endif
+}
+
+/*--------------------------------------------------------------*/
+/* 10Mbps */
+void miconCntl_Eth10M(int up)
+{
+#ifdef CONFIG_HTGL
+       if (up)
+               miconCntl_SendCmd(0x8F);
+       else
+               miconCntl_SendCmd(0x8E);
+#else
+       if (up)
+               miconCntl_SendCmd(0x5C);
+#endif
+}
+
+/*--------------------------------------------------------------*/
+/*  */
+void miconCntl_5f(void)
+{
+       miconCntl_SendCmd(0x5F);
+       mdelay(100);
+}
+
+/*--------------------------------------------------------------*/
+/* "reboot start" signal */
+void miconCntl_Reboot(void)
+{
+       miconCntl_SendCmd(0x43);
+}
+
+/*--------------------------------------------------------------*/
+/* Disable watchdog timer */
+void miconCntl_DisWDT(void)
+{
+       miconCntl_SendCmd(0x41); /* A */
+       miconCntl_SendCmd(0x46); /* F */
+       miconCntl_SendCmd(0x4A); /* J */
+       miconCntl_SendCmd(0x3E); /* > */
+       miconCntl_SendCmd(0x56); /* V */
+       miconCntl_SendCmd(0x3E); /* > */
+       miconCntl_SendCmd(0x5A); /* Z */
+       miconCntl_SendCmd(0x56); /* V */
+       miconCntl_SendCmd(0x4B); /* K */
+}
diff --git a/board/linkstation/ide.c b/board/linkstation/ide.c
new file mode 100644 (file)
index 0000000..02086a0
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * (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
+ *
+ */
+/* ide.c - ide support functions */
+
+
+#include <common.h>
+
+#ifdef CONFIG_CMD_IDE
+#include <ata.h>
+#include <ide.h>
+#include <pci.h>
+
+#define IT8212_PCI_CpuCONTROL          0x5e
+#define IT8212_PCI_PciModeCONTROL      0x50
+#define IT8212_PCI_IdeIoCONFIG         0x40
+#define IT8212_PCI_IdeBusSkewCONTROL   0x4c
+#define IT8212_PCI_IdeDrivingCURRENT   0x42
+
+extern ulong ide_bus_offset[CFG_IDE_MAXBUS];
+extern struct pci_controller hose;
+
+int ide_preinit (void)
+{
+       int status;
+       pci_dev_t devbusfn;
+       int l;
+
+       status = 1;
+       for (l = 0; l < CFG_IDE_MAXBUS; l++) {
+               ide_bus_offset[l] = -ATA_STATUS;
+       }
+       devbusfn = pci_find_device(PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_SII_680, 0);
+       if (devbusfn == -1)
+               devbusfn = pci_find_device(PCI_VENDOR_ID_ITE,PCI_DEVICE_ID_ITE_8212,0);
+       if (devbusfn != -1) {
+               status = 0;
+
+               pci_read_config_dword (devbusfn, PCI_BASE_ADDRESS_0,
+                                                          (u32 *) &ide_bus_offset[0]);
+               ide_bus_offset[0] &= 0xfffffffe;
+               ide_bus_offset[0] = pci_hose_bus_to_phys(&hose,
+                                                        ide_bus_offset[0] & 0xfffffffe,
+                                                        PCI_REGION_IO);
+               pci_read_config_dword(devbusfn, PCI_BASE_ADDRESS_2,
+                                     (u32 *) &ide_bus_offset[1]);
+               ide_bus_offset[1] &= 0xfffffffe;
+               ide_bus_offset[1] = pci_hose_bus_to_phys(&hose,
+                                                        ide_bus_offset[1] & 0xfffffffe,
+                                                        PCI_REGION_IO);
+       }
+
+       if (pci_find_device (PCI_VENDOR_ID_ITE, PCI_DEVICE_ID_ITE_8212, 0) != -1) {
+               pci_write_config_byte(devbusfn, IT8212_PCI_CpuCONTROL, 0x01);
+               pci_write_config_byte(devbusfn, IT8212_PCI_PciModeCONTROL, 0x00);
+               pci_write_config_word(devbusfn, PCI_COMMAND, 0x0047);
+#ifdef CONFIG_IT8212_SECONDARY_ENABLE
+               pci_write_config_word(devbusfn, IT8212_PCI_IdeIoCONFIG, 0xA0F3);
+#else
+               pci_write_config_word(devbusfn, IT8212_PCI_IdeIoCONFIG, 0x8031);
+#endif
+               pci_write_config_dword(devbusfn, IT8212_PCI_IdeBusSkewCONTROL, 0x02040204);
+/* __LS_COMMENT__ BUFFALO changed 2004.11.10  changed for EMI */
+               pci_write_config_byte(devbusfn, IT8212_PCI_IdeDrivingCURRENT, 0x36); /* 10mA */
+/*             pci_write_config_byte(dev, IT8212_PCI_IdeDrivingCURRENT, 0x09); */ /* 4mA */
+/*             pci_write_config_byte(dev, IT8212_PCI_IdeDrivingCURRENT, 0x12); */ /* 6mA */
+/*             pci_write_config_byte(dev, IT8212_PCI_IdeDrivingCURRENT, 0x24); */ /* 6mA,2mA */
+/*             pci_write_config_byte(dev, IT8212_PCI_IdeDrivingCURRENT, 0x2D); */ /* 8mA,4mA */
+               pci_write_config_byte(devbusfn, PCI_LATENCY_TIMER, 0x00);
+       }
+
+       return (status);
+}
+
+void ide_set_reset (int flag) {
+       return;
+}
+
+#endif /* CONFIG_CMD_IDE */
diff --git a/board/linkstation/linkstation.c b/board/linkstation/linkstation.c
new file mode 100644 (file)
index 0000000..f6bc0a9
--- /dev/null
@@ -0,0 +1,130 @@
+/*
+ * linkstation.c
+ *
+ * Misc LinkStation specific functions
+ *
+ * Copyright (C) 2006 Mihai Georgian <u-boot@linuxnotincluded.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <version.h>
+#include <common.h>
+#include <mpc824x.h>
+#include <asm/io.h>
+#include <ns16550.h>
+
+#ifdef CONFIG_PCI
+#include <pci.h>
+#endif
+
+extern void init_AVR_DUART(void);
+
+int checkboard (void)
+{
+       DECLARE_GLOBAL_DATA_PTR;
+       char *p;
+       bd_t *bd = gd->bd;
+
+       init_AVR_DUART();
+
+       if ((p = getenv ("console_nr")) != NULL) {
+               unsigned long con_nr = simple_strtoul (p, NULL, 10) & 3;
+
+               bd->bi_baudrate &= ~3;
+               bd->bi_baudrate |= con_nr & 3;
+       }
+       return 0;
+}
+
+long int initdram (int board_type)
+{
+       return (get_ram_size(CFG_SDRAM_BASE, CFG_MAX_RAM_SIZE));
+}
+
+/*
+ * Initialize PCI Devices
+ */
+#ifdef CONFIG_PCI
+
+#ifndef CONFIG_PCI_PNP
+
+static struct pci_config_table pci_linkstation_config_table[] = {
+       /* vendor, device, class */
+       /* bus, dev, func */
+       { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
+         PCI_ANY_ID, 0x0b, 0,          /* AN983B or RTL8110S  */
+                                                               /* ethernet controller */
+         pci_cfgfunc_config_device, { PCI_ETH_IOADDR,
+                                      PCI_ETH_MEMADDR,
+                                      PCI_COMMAND_IO |
+                                      PCI_COMMAND_MEMORY |
+                                      PCI_COMMAND_MASTER }},
+       { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
+         PCI_ANY_ID, 0x0c, 0,          /* SII680 or IT8211AF */
+                                                               /* ide controller     */
+         pci_cfgfunc_config_device, { PCI_IDE_IOADDR,
+                                      PCI_IDE_MEMADDR,
+                                      PCI_COMMAND_IO |
+                                      PCI_COMMAND_MEMORY |
+                                      PCI_COMMAND_MASTER }},
+       { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
+         PCI_ANY_ID, 0x0e, 0,          /* D720101 USB controller, 1st USB 1.1 */
+         pci_cfgfunc_config_device, { PCI_USB0_IOADDR,
+                                      PCI_USB0_MEMADDR,
+                                      PCI_COMMAND_MEMORY |
+                                      PCI_COMMAND_MASTER }},
+       { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
+         PCI_ANY_ID, 0x0e, 1,          /* D720101 USB controller, 2nd USB 1.1 */
+         pci_cfgfunc_config_device, { PCI_USB1_IOADDR,
+                                      PCI_USB1_MEMADDR,
+                                      PCI_COMMAND_MEMORY |
+                                      PCI_COMMAND_MASTER }},
+       { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
+         PCI_ANY_ID, 0x0e, 2,          /* D720101 USB controller, USB 2.0 */
+         pci_cfgfunc_config_device, { PCI_USB2_IOADDR,
+                                      PCI_USB2_MEMADDR,
+                                      PCI_COMMAND_MEMORY |
+                                      PCI_COMMAND_MASTER }},
+       { }
+};
+#endif
+
+struct pci_controller hose = {
+#ifndef CONFIG_PCI_PNP
+       config_table:pci_linkstation_config_table,
+#endif
+};
+
+void pci_init_board (void)
+{
+       pci_mpc824x_init (&hose);
+
+       /* Reset USB 1.1 */
+       /* Haven't seen any change without these on a HG, maybe it is
+        * needed on other models */
+       out_le32((volatile unsigned*)(PCI_USB0_MEMADDR + 8), 1);
+       out_le32((volatile unsigned*)(PCI_USB1_MEMADDR + 8), 1);
+}
+#endif /* CONFIG_PCI */
+
+#define UART_DCR       0x80004511
+int board_early_init_f (void)
+{
+       /* set DUART mode */
+       out_8((volatile u8*)UART_DCR, 1);
+       return 0;
+}
index 77bf818..9301571 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 828afbb..44bae70 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index affaeff..7c3cf49 100644 (file)
@@ -6,7 +6,7 @@
  * Alain Saurel,           AMCC/IBM, alain.saurel@fr.ibm.com
  * Robert Snyder,          AMCC/IBM, rob.snyder@fr.ibm.com
  *
- * (C) Copyright 2007
+ * (C) Copyright 2007-2008
  * Stefan Roese, DENX Software Engineering, sr@denx.de.
  *
  * This program is free software; you can redistribute it and/or
@@ -35,6 +35,7 @@
 #include <asm/mmu.h>
 #include <asm/io.h>
 #include <ppc440.h>
+#include <watchdog.h>
 
 /*
  * This DDR2 setup code can dynamically setup the TLB entries for the DDR2 memory
@@ -99,87 +100,37 @@ static void wait_ddr_idle(void)
         */
 }
 
-static void blank_string(int size)
-{
-       int i;
-
-       for (i=0; i<size; i++)
-               putc('\b');
-       for (i=0; i<size; i++)
-               putc(' ');
-       for (i=0; i<size; i++)
-               putc('\b');
-}
-
 static void program_ecc(u32 start_address,
                        u32 num_bytes,
                        u32 tlb_word2_i_value)
 {
-       u32 current_address;
-       u32 end_address;
-       u32 address_increment;
        u32 val;
-       char str[] = "ECC generation -";
-       char slash[] = "\\|/-\\|/-";
-       int loop = 0;
-       int loopi = 0;
-
-       current_address = start_address;
+       u32 current_addr = start_address;
+       int bytes_remaining;
 
        sync();
-       eieio();
        wait_ddr_idle();
 
-       if (tlb_word2_i_value == TLB_WORD2_I_ENABLE) {
-               /* ECC bit set method for non-cached memory */
-               address_increment = 4;
-               end_address = current_address + num_bytes;
-
-               puts(str);
-
-               while (current_address < end_address) {
-                       *((u32 *)current_address) = 0x00000000;
-                       current_address += address_increment;
-
-                       if ((loop++ % (2 << 20)) == 0) {
-                               putc('\b');
-                               putc(slash[loopi++ % 8]);
-                       }
-               }
+       /*
+        * Because of 440EPx errata CHIP 11, we don't touch the last 256
+        * bytes of SDRAM.
+        */
+       bytes_remaining = num_bytes - CFG_MEM_TOP_HIDE;
 
-               blank_string(strlen(str));
-       } else {
-               /* ECC bit set method for cached memory */
-#if 0 /* test-only: will remove this define later, when ECC problems are solved! */
-               /*
-                * Some boards (like lwmon5) need to preserve the memory
-                * content upon ECC generation (for the log-buffer).
-                * Therefore we don't fill the memory with a pattern or
-                * just zero it, but write the same values back that are
-                * already in the memory cells.
-                */
-               address_increment = CFG_CACHELINE_SIZE;
-               end_address = current_address + num_bytes;
-
-               current_address = start_address;
-               while (current_address < end_address) {
-                       /*
-                        * TODO: Th following sequence doesn't work correctly.
-                        * Just invalidating and flushing the cache doesn't
-                        * seem to trigger the re-write of the memory.
-                        */
-                       ppcDcbi(current_address);
-                       ppcDcbf(current_address);
-                       current_address += CFG_CACHELINE_SIZE;
-               }
-#else
-               dcbz_area(start_address, num_bytes);
-               dflush();
-#endif
+       /*
+        * We have to write the ECC bytes by zeroing and flushing in smaller
+        * steps, since the whole 256MByte takes too long for the external
+        * watchdog.
+        */
+       while (bytes_remaining > 0) {
+               dcbz_area(current_addr, min((64 << 20), bytes_remaining));
+               current_addr += 64 << 20;
+               bytes_remaining -= 64 << 20;
+               WATCHDOG_RESET();
        }
+       dflush();
 
        sync();
-       eieio();
        wait_ddr_idle();
 
        /* Clear error status */
@@ -191,7 +142,6 @@ static void program_ecc(u32 start_address,
        mtsdram(DDR0_01, ((val &~ DDR0_01_INT_MASK_MASK) | DDR0_01_INT_MASK_ALL_OFF));
 
        sync();
-       eieio();
        wait_ddr_idle();
 }
 #endif
index e140737..da2a400 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 9e174b5..6aea723 100644 (file)
@@ -52,8 +52,8 @@
 #define MC_AASR_VAL 0x00000000
 #define EBI_CFGR 0xFFFFFF64
 #define EBI_CFGR_VAL 0x00000000
-#define SMC2_CSR 0xFFFFFF70
-#define SMC2_CSR_VAL 0x00003284 /* 16bit, 2 TDF, 4 WS */
+#define SMC_CSR0 0xFFFFFF70
+#define SMC_CSR0_VAL 0x00003284 /* 16bit, 2 TDF, 4 WS */
 
 /* clocks */
 #define PLLAR 0xFFFFFC28
@@ -141,8 +141,8 @@ SMRDATA:
        .word MC_AASR_VAL
        .word EBI_CFGR
        .word EBI_CFGR_VAL
-       .word SMC2_CSR
-       .word SMC2_CSR_VAL
+       .word SMC_CSR0
+       .word SMC_CSR0_VAL
        .word PLLAR
        .word PLLAR_VAL
        .word PLLBR
index 235ec42..bc83534 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(m68k)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 GROUP(libgcc.a)
index 29fe589..884ff2d 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(m68k)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 9542598..eea3230 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(m68k)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 1d98973..3ccdd33 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 650572d..96c4e22 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 28e4c87..5580c11 100644 (file)
@@ -141,18 +141,21 @@ extern void lcd_enable(void);
 int au_check_cksum_valid(int idx, long nbytes)
 {
        image_header_t *hdr;
-       unsigned long checksum;
 
        hdr = (image_header_t *)LOAD_ADDR;
+#if defined(CONFIG_FIT)
+       if (genimg_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+               puts ("Non legacy image format not supported\n");
+               return -1;
+       }
+#endif
 
-       if (nbytes != (sizeof(*hdr) + ntohl(hdr->ih_size))) {
+       if (nbytes != image_get_image_size (hdr)) {
                printf ("Image %s bad total SIZE\n", aufile[idx]);
                return -1;
        }
        /* check the data CRC */
-       checksum = ntohl(hdr->ih_dcrc);
-
-       if (crc32 (0, (uchar *)(LOAD_ADDR + sizeof(*hdr)), ntohl(hdr->ih_size)) != checksum) {
+       if (!image_check_dcrc (hdr)) {
                printf ("Image %s bad data checksum\n", aufile[idx]);
                return -1;
        }
@@ -165,59 +168,62 @@ int au_check_header_valid(int idx, long nbytes)
        unsigned long checksum, fsize;
 
        hdr = (image_header_t *)LOAD_ADDR;
+#if defined(CONFIG_FIT)
+       if (genimg_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+               puts ("Non legacy image format not supported\n");
+               return -1;
+       }
+#endif
+
        /* check the easy ones first */
 #undef CHECK_VALID_DEBUG
 #ifdef CHECK_VALID_DEBUG
-       printf("magic %#x %#x ", ntohl(hdr->ih_magic), IH_MAGIC);
-       printf("arch %#x %#x ", hdr->ih_arch, IH_CPU_ARM);
-       printf("size %#x %#lx ", ntohl(hdr->ih_size), nbytes);
-       printf("type %#x %#x ", hdr->ih_type, IH_TYPE_KERNEL);
+       printf("magic %#x %#x ", image_get_magic (hdr), IH_MAGIC);
+       printf("arch %#x %#x ", image_get_arch (hdr), IH_ARCH_ARM);
+       printf("size %#x %#lx ", image_get_data_size (hdr), nbytes);
+       printf("type %#x %#x ", image_get_type (hdr), IH_TYPE_KERNEL);
 #endif
-       if (nbytes < sizeof(*hdr)) {
+       if (nbytes < image_get_header_size ()) {
                printf ("Image %s bad header SIZE\n", aufile[idx]);
                ausize[idx] = 0;
                return -1;
        }
-       if (ntohl(hdr->ih_magic) != IH_MAGIC || hdr->ih_arch != IH_CPU_PPC) {
+       if (!image_check_magic (hdr) || !image_check_arch (hdr, IH_ARCH_PPC)) {
                printf ("Image %s bad MAGIC or ARCH\n", aufile[idx]);
                ausize[idx] = 0;
                return -1;
        }
        /* check the hdr CRC */
-       checksum = ntohl(hdr->ih_hcrc);
-       hdr->ih_hcrc = 0;
-
-       if (crc32 (0, (uchar *)hdr, sizeof(*hdr)) != checksum) {
+       if (!image_check_hcrc (hdr)) {
                printf ("Image %s bad header checksum\n", aufile[idx]);
                ausize[idx] = 0;
                return -1;
        }
-       hdr->ih_hcrc = htonl(checksum);
        /* check the type - could do this all in one gigantic if() */
-       if ((idx == IDX_FIRMWARE) && (hdr->ih_type != IH_TYPE_FIRMWARE)) {
+       if ((idx == IDX_FIRMWARE) && !image_check_type (hdr, IH_TYPE_FIRMWARE)) {
                printf ("Image %s wrong type\n", aufile[idx]);
                ausize[idx] = 0;
                return -1;
        }
-       if ((idx == IDX_KERNEL) && (hdr->ih_type != IH_TYPE_KERNEL)) {
+       if ((idx == IDX_KERNEL) && !image_check_type (hdr, IH_TYPE_KERNEL)) {
                printf ("Image %s wrong type\n", aufile[idx]);
                ausize[idx] = 0;
                return -1;
        }
        if ((idx == IDX_ROOTFS) &&
-               ( (hdr->ih_type != IH_TYPE_RAMDISK) && (hdr->ih_type != IH_TYPE_FILESYSTEM) )
-          ) {
+                       (!image_check_type (hdr, IH_TYPE_RAMDISK) &&
+                       !image_check_type (hdr, IH_TYPE_FILESYSTEM))) {
                printf ("Image %s wrong type\n", aufile[idx]);
                ausize[idx] = 0;
                return -1;
        }
        /* recycle checksum */
-       checksum = ntohl(hdr->ih_size);
+       checksum = image_get_data_size (hdr);
 
-       fsize = checksum + sizeof(*hdr);
+       fsize = checksum + image_get_header_size ();
        /* for kernel and ramdisk the image header must also fit into flash */
-       if (idx == IDX_KERNEL || hdr->ih_type == IH_TYPE_RAMDISK)
-               checksum += sizeof(*hdr);
+       if (idx == IDX_KERNEL || image_check_type (hdr, IH_TYPE_RAMDISK))
+               checksum += image_get_header_size ();
 
        /* check the size does not exceed space in flash. HUSH scripts */
        if ((ausize[idx] != 0) && (ausize[idx] < checksum)) {
@@ -240,13 +246,19 @@ int au_do_update(int idx, long sz)
        uint nbytes;
 
        hdr = (image_header_t *)LOAD_ADDR;
+#if defined(CONFIG_FIT)
+       if (genimg_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+               puts ("Non legacy image format not supported\n");
+               return -1;
+       }
+#endif
 
        /* execute a script */
-       if (hdr->ih_type == IH_TYPE_SCRIPT) {
-               addr = (char *)((char *)hdr + sizeof(*hdr));
+       if (image_check_type (hdr, IH_TYPE_SCRIPT)) {
+               addr = (char *)((char *)hdr + image_get_header_size ());
                /* stick a NULL at the end of the script, otherwise */
                /* parse_string_outer() runs off the end. */
-               addr[ntohl(hdr->ih_size)] = 0;
+               addr[image_get_data_size (hdr)] = 0;
                addr += 8;
                parse_string_outer(addr, FLAG_PARSE_SEMICOLON);
                return 0;
@@ -278,19 +290,20 @@ int au_do_update(int idx, long sz)
 #endif
 
        /* strip the header - except for the kernel and ramdisk */
-       if (hdr->ih_type == IH_TYPE_KERNEL || hdr->ih_type == IH_TYPE_RAMDISK) {
+       if (image_check_type (hdr, IH_TYPE_KERNEL) ||
+                       image_check_type (hdr, IH_TYPE_RAMDISK)) {
                addr = (char *)hdr;
-               off = sizeof(*hdr);
-               nbytes = sizeof(*hdr) + ntohl(hdr->ih_size);
+               off = image_get_header_size ();
+               nbytes = image_get_image_size (hdr);
        } else {
-               addr = (char *)((char *)hdr + sizeof(*hdr));
+               addr = (char *)((char *)hdr + image_get_header_size ());
 #ifdef AU_UPDATE_TEST
                /* copy it to where Linux goes */
                if (idx == IDX_FIRMWARE)
                        start = aufl_layout[1].start;
 #endif
                off = 0;
-               nbytes = ntohl(hdr->ih_size);
+               nbytes = image_get_data_size (hdr);
        }
 
        /* copy the data from RAM to FLASH */
@@ -306,7 +319,8 @@ int au_do_update(int idx, long sz)
 #endif
 
        /* check the data CRC of the copy */
-       if (crc32 (0, (uchar *)(start + off), ntohl(hdr->ih_size)) != ntohl(hdr->ih_dcrc)) {
+       if (crc32 (0, (uchar *)(start + off), image_get_data_size (hdr)) !=
+           image_get_dcrc (hdr)) {
                printf ("Image %s Bad Data Checksum after COPY\n", aufile[idx]);
                return -1;
        }
@@ -442,10 +456,10 @@ int do_auto_update(void)
        for (i = 0; i < AU_MAXFILES; i++) {
                ulong imsize;
                /* just read the header */
-               sz = file_fat_read(aufile[i], LOAD_ADDR, sizeof(image_header_t));
+               sz = file_fat_read(aufile[i], LOAD_ADDR, image_get_header_size ());
                debug ("read %s sz %ld hdr %d\n",
-                       aufile[i], sz, sizeof(image_header_t));
-               if (sz <= 0 || sz < sizeof(image_header_t)) {
+                       aufile[i], sz, image_get_header_size ());
+               if (sz <= 0 || sz < image_get_header_size ()) {
                        debug ("%s not found\n", aufile[i]);
                        ausize[i] = 0;
                        continue;
@@ -474,14 +488,14 @@ int do_auto_update(void)
                sz = file_fat_read(aufile[i], LOAD_ADDR, ausize[i]);
 
                debug ("read %s sz %ld hdr %d\n",
-                       aufile[i], sz, sizeof(image_header_t));
+                       aufile[i], sz, image_get_header_size ());
 
                if (sz != ausize[i]) {
                        printf ("%s: size %d read %d?\n", aufile[i], ausize[i], sz);
                        continue;
                }
 
-               if (sz <= 0 || sz <= sizeof(image_header_t)) {
+               if (sz <= 0 || sz <= image_get_header_size ()) {
                        debug ("%s not found\n", aufile[i]);
                        continue;
                }
index bb9fcab..7ab29ef 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 6b3addf..9a05a61 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 1608f8c..88dcaf9 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 37a6244..2c1e6cf 100644 (file)
@@ -278,7 +278,7 @@ void m48_watchdog_arm(int usec)
 /*
  * U-Boot RTC support.
  */
-void
+int
 rtc_get( struct rtc_time *tmp )
 {
        m48_tod_get(&tmp->tm_year,
@@ -295,6 +295,8 @@ rtc_get( struct rtc_time *tmp )
                tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
                tmp->tm_hour, tmp->tm_min, tmp->tm_sec );
 #endif
+
+       return 0;
 }
 
 void
index fb24399..4e3b89d 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index eb47ae6..68c4cca 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 
 MEMORY {
        ram  (!rx) : org = 0x00000000 , LENGTH = 8M
index 5a5722e..952bf01 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index f041236..1003bf6 100644 (file)
@@ -27,7 +27,7 @@
 #include <asm/mmu.h>
 
 struct fsl_e_tlb_entry tlb_table[] = {
-       SET_TLB_ENTRY(1, CFG_CCSRBAR, CFG_CCSRBAR,
+       SET_TLB_ENTRY(1, CFG_CCSRBAR, CFG_CCSRBAR_PHYS,
                      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
                      0, 1, BOOKE_PAGESZ_1M, 1),
 
index 9bbba30..ef4ea97 100644 (file)
@@ -25,7 +25,6 @@
  * Boot page and reset vector is put at that end of the 512K block. */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 8d4cbe8..785d204 100644 (file)
@@ -57,9 +57,6 @@ extern int mem_test(ulong start, ulong ramsize, int quiet);
 
 extern flash_info_t flash_info[];      /* info for FLASH chips */
 
-static image_header_t header;
-
-
 static int
 mpl_prg(uchar *src, ulong size)
 {
@@ -77,7 +74,7 @@ mpl_prg(uchar *src, ulong size)
        info = &flash_info[0];
 
 #if defined(CONFIG_PIP405) || defined(CONFIG_MIP405) || defined(CONFIG_PATI)
-       if (ntohl(magic[0]) != IH_MAGIC) {
+       if (uimage_to_cpu (magic[0]) != IH_MAGIC) {
                puts("Bad Magic number\n");
                return -1;
        }
@@ -179,44 +176,46 @@ mpl_prg(uchar *src, ulong size)
 static int
 mpl_prg_image(uchar *ld_addr)
 {
-       unsigned long len, checksum;
+       unsigned long len;
        uchar *data;
-       image_header_t *hdr = &header;
+       image_header_t *hdr = (image_header_t *)ld_addr;
        int rc;
 
-       /* Copy header so we can blank CRC field for re-calculation */
-       memcpy (&header, (char *)ld_addr, sizeof(image_header_t));
-       if (ntohl(hdr->ih_magic)  != IH_MAGIC) {
+#if defined(CONFIG_FIT)
+       if (genimg_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+               puts ("Non legacy image format not supported\n");
+               return -1;
+       }
+#endif
+
+       if (!image_check_magic (hdr)) {
                puts("Bad Magic Number\n");
                return 1;
        }
-       print_image_hdr(hdr);
-       if (hdr->ih_os  != IH_OS_U_BOOT) {
+       image_print_contents (hdr);
+       if (!image_check_os (hdr, IH_OS_U_BOOT)) {
                puts("No U-Boot Image\n");
                return 1;
        }
-       if (hdr->ih_type  != IH_TYPE_FIRMWARE) {
+       if (!image_check_type (hdr, IH_TYPE_FIRMWARE)) {
                puts("No Firmware Image\n");
                return 1;
        }
-       data = (uchar *)&header;
-       len  = sizeof(image_header_t);
-       checksum = ntohl(hdr->ih_hcrc);
-       hdr->ih_hcrc = 0;
-       if (crc32 (0, (uchar *)data, len) != checksum) {
+       if (!image_check_hcrc (hdr)) {
                puts("Bad Header Checksum\n");
                return 1;
        }
-       data = ld_addr + sizeof(image_header_t);
-       len  = ntohl(hdr->ih_size);
        puts("Verifying Checksum ... ");
-       if (crc32 (0, (uchar *)data, len) != ntohl(hdr->ih_dcrc)) {
+       if (!image_check_dcrc (hdr)) {
                puts("Bad Data CRC\n");
                return 1;
        }
        puts("OK\n");
 
-       if (hdr->ih_comp != IH_COMP_NONE) {
+       data = (uchar *)image_get_data (hdr);
+       len = image_get_data_size (hdr);
+
+       if (image_get_comp (hdr) != IH_COMP_NONE) {
                uchar *buf;
                /* reserve space for uncompressed image */
                if ((buf = malloc(IMAGE_SIZE)) == NULL) {
@@ -224,7 +223,7 @@ mpl_prg_image(uchar *ld_addr)
                        return 1;
                }
 
-               switch (hdr->ih_comp) {
+               switch (image_get_comp (hdr)) {
                case IH_COMP_GZIP:
                        puts("Uncompressing (GZIP) ... ");
                        rc = gunzip ((void *)(buf), IMAGE_SIZE, data, &len);
@@ -253,7 +252,8 @@ mpl_prg_image(uchar *ld_addr)
                        break;
 #endif
                default:
-                       printf ("Unimplemented compression type %d\n", hdr->ih_comp);
+                       printf ("Unimplemented compression type %d\n",
+                               image_get_comp (hdr));
                        free(buf);
                        return 1;
                }
index 8460abe..ffdf467 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index ed65830..c7ae4d0 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 1608f8c..88dcaf9 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
diff --git a/board/mpr2/Makefile b/board/mpr2/Makefile
new file mode 100644 (file)
index 0000000..17ca17e
--- /dev/null
@@ -0,0 +1,54 @@
+#
+# Copyright (C) 2007
+# Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
+#
+# Copyright (C) 2007
+# Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+#
+# Copyright (C) 2007
+# Kenati Technologies, Inc.
+#
+# (C) Copyright 2008
+# Mark Jonas <mark.jonas@de.bosch.com>
+#
+# board/mpr2/Makefile
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the 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    = lib$(BOARD).a
+
+OBJS   := mpr2.o
+SOBJS  := lowlevel_init.o
+
+$(LIB):        $(OBJS) $(SOBJS)
+       $(AR) crv $@ $(OBJS) $(SOBJS)
+
+clean:
+       rm -f $(SOBJS) $(OBJS)
+
+distclean:     clean
+       rm -f $(LIB) core *.bak .depend
+
+#########################################################################
+
+.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
+               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+
+-include .depend
+
+#########################################################################
diff --git a/board/mpr2/config.mk b/board/mpr2/config.mk
new file mode 100644 (file)
index 0000000..6d41d97
--- /dev/null
@@ -0,0 +1,37 @@
+#
+# Copyright (C) 2007
+# Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
+#
+# Copyright (C) 2007
+# Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+#
+# Copyright (C) 2007
+# Kenati Technologies, Inc.
+#
+# Copyright (C) 2008
+# Mark Jonas <mark.jonas@de.bosch.com>
+#
+# board/mpr2/config.mk
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the 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
+
+#
+# TEXT_BASE refers to image _after_ relocation.
+#
+# NOTE: Must match value used in u-boot.lds (in this directory).
+#
+
+TEXT_BASE = 0x8FFC0000
diff --git a/board/mpr2/lowlevel_init.S b/board/mpr2/lowlevel_init.S
new file mode 100644 (file)
index 0000000..060957a
--- /dev/null
@@ -0,0 +1,148 @@
+/*
+ * (C) Copyright 2008
+ * Mark Jonas <mark.jonas@de.bosch.com>
+ *
+ * (C) Copyright 2007
+ * Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
+ *
+ * board/mpr2/lowlevel_init.S
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the 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
+ */
+
+       .global lowlevel_init
+
+       .text
+       .align  2
+
+lowlevel_init:
+
+/*
+ * Set frequency multipliers and dividers in FRQCR.
+ */
+       mov.l   WTCSR_A,r1
+       mov.l   WTCSR_D,r0
+       mov.w   r0,@r1
+
+       mov.l   WTCNT_A,r1
+       mov.l   WTCNT_D,r0
+       mov.w   r0,@r1
+
+       mov.l   FRQCR_A,r1
+       mov.l   FRQCR_D,r0
+       mov.w   r0,@r1
+
+/*
+ * Setup CS0 (Flash).
+ */
+       mov.l   CS0BCR_A, r1
+       mov.l   CS0BCR_D, r0
+       mov.l   r0, @r1
+
+       mov.l   CS0WCR_A, r1
+       mov.l   CS0WCR_D, r0
+       mov.l   r0, @r1
+
+/*
+ * Setup CS3 (SDRAM).
+ */
+       mov.l   CS3BCR_A, r1
+       mov.l   CS3BCR_D, r0
+       mov.l   r0, @r1
+
+       mov.l   CS3WCR_A, r1
+       mov.l   CS3WCR_D, r0
+       mov.l   r0, @r1
+
+       mov.l   SDCR_A, r1
+       mov.l   SDCR_D1, r0
+       mov.l   r0, @r1
+
+       mov.l   RTCSR_A, r1
+       mov.l   RTCSR_D, r0
+       mov.l   r0, @r1
+
+       mov.l   RTCNT_A, r1
+       mov.l   RTCNT_D, r0
+       mov.l   r0, @r1
+
+       mov.l   RTCOR_A, r1
+       mov.l   RTCOR_D, r0
+       mov.l   r0, @r1
+
+       mov.l   SDCR_A, r1
+       mov.l   SDCR_D2, r0
+       mov.l   r0, @r1
+
+       mov.l   SDMR3_A, r1
+       mov.l   SDMR3_D, r0
+       add     r0, r1
+       mov     #0, r0
+       mov.w   r0, @r1
+
+       rts
+       nop
+
+       .align 4
+
+/*
+ * Configuration for MPR2 A.3 through A.7
+ */
+
+/*
+ * PLL Settings
+ */
+FRQCR_D:       .long   0x1103          /* I:B:P=8:4:2 */
+WTCNT_D:       .long   0x5A00          /* start counting at zero */
+WTCSR_D:       .long   0xA507          /* divide by 4096 */
+
+/*
+ * Spansion S29GL256N11 @ 48 MHz
+ */
+CS0BCR_D:      .long   0x12490400  /* 1 idle cycle inserted, normal space, 16 bit */
+CS0WCR_D:      .long   0x00000340  /* tSW=0.5ck, 6 wait cycles, NO external wait, tHW=0.5ck */
+
+/*
+ * Samsung K4S511632B-UL75 @ 48 MHz
+ * Micron MT48LC32M16A2-75 @ 48 MHz
+ */
+CS3BCR_D:      .long   0x10004400  /* CS3BCR = 0x10004400, minimum idle cycles, SDRAM, 16 bit */
+CS3WCR_D:      .long   0x00000091  /* tRP=1ck, tRCD=1ck, CL=2, tRWL=2ck, tRC=4ck */
+SDCR_D1:       .long   0x00000012  /* no refresh, 13 rows, 10 cols, NO bank active mode */
+SDCR_D2:       .long   0x00000812  /* refresh */
+RTCSR_D:       .long   0xA55A0008  /* 1/4, once */
+RTCNT_D:       .long   0xA55A005D  /* count 93 */
+RTCOR_D:       .long   0xa55a005d  /* count 93 */
+SDMR3_D:       .long   0x440       /* mode register CL2, burst read and SINGLE WRITE */
+
+/*
+ * Registers
+ */
+
+FRQCR_A:       .long   0xA415FF80
+WTCNT_A:       .long   0xA415FF84
+WTCSR_A:       .long   0xA415FF86
+
+#define BSC_BASE       0xA4FD0000
+CS0BCR_A:      .long   BSC_BASE + 0x04
+CS3BCR_A:      .long   BSC_BASE + 0x0C
+CS0WCR_A:      .long   BSC_BASE + 0x24
+CS3WCR_A:      .long   BSC_BASE + 0x2C
+SDCR_A:                .long   BSC_BASE + 0x44
+RTCSR_A:       .long   BSC_BASE + 0x48
+RTCNT_A:       .long   BSC_BASE + 0x4C
+RTCOR_A:       .long   BSC_BASE + 0x50
+SDMR3_A:       .long   BSC_BASE + 0x5000
diff --git a/board/mpr2/mpr2.c b/board/mpr2/mpr2.c
new file mode 100644 (file)
index 0000000..98557b4
--- /dev/null
@@ -0,0 +1,161 @@
+/*
+ * Copyright (C) 2008
+ * Mark Jonas <mark.jonas@de.bosch.com>
+ *
+ * board/mpr2/mpr2.c
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the 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/processor.h>
+
+int checkboard(void)
+{
+       puts("BOARD: MPR2\n");
+       return 0;
+}
+
+int board_init(void)
+{
+       /*
+        * For MPR2 A.3 through A.7
+        */
+
+       /* CS2: Ethernet (0xA8000000 - 0xABFFFFFF) */
+       __raw_writel(0x36db0400, CS2BCR);    /* 4 idle cycles, normal space, 16 bit data bus */
+       __raw_writel(0x000003c0, CS2WCR);    /* (WR:8), no ext. wait */
+
+       /* CS4: CAN1 (0xB0000000 - 0xB3FFFFFF) */
+       __raw_writel(0x00000200, CS4BCR);    /* no idle cycles, normal space, 8 bit data bus */
+       __raw_writel(0x00100981, CS4WCR);    /* (SW:1.5 WR:3 HW:1.5), ext. wait */
+
+       /* CS5a: CAN2 (0xB4000000 - 0xB5FFFFFF) */
+       __raw_writel(0x00000200, CS5ABCR);   /* no idle cycles, normal space, 8 bit data bus */
+       __raw_writel(0x00100981, CS5AWCR);   /* (SW:1.5 WR:3 HW:1.5), ext. wait */
+
+       /* CS5b: CAN3 (0xB6000000 - 0xB7FFFFFF) */
+       __raw_writel(0x00000200, CS5BBCR);   /* no idle cycles, normal space, 8 bit data bus */
+       __raw_writel(0x00100981, CS5BWCR);   /* (SW:1.5 WR:3 HW:1.5), ext. wait */
+
+       /* CS6a: Rotary (0xB8000000 - 0xB9FFFFFF) */
+       __raw_writel(0x00000200, CS6ABCR);   /* no idle cycles, normal space, 8 bit data bus */
+       __raw_writel(0x001009C1, CS6AWCR);   /* (SW:1.5 WR:3 HW:1.5), no ext. wait */
+
+       /* set Pin Select Register A: /PCC_CD1, /PCC_CD2, PCC_BVD1, PCC_BVD2, /IOIS16, IRQ4, IRQ5, USB1d_SUSPEND */
+       __raw_writew(0xAABC, PSELA);  /*    10        10        10        10       10    11    11             00 */
+
+       /* set Pin Select Register B: /SCIF0_RTS, /SCIF0_CTS, LCD_VCPWC, LCD_VEPWC, IIC_SDA, IIC_SCL, Reserved */
+       __raw_writew(0x3C00, PSELB);  /*       0           0         11         11        0        0  00000000 */
+
+       /* set Pin Select Register C: SIOF1_SCK, SIOF1_RxD, SCIF1_RxD, SCIF1_TxD, Reserved */
+       __raw_writew(0x0000, PSELC);  /*     00         00         00         00  00000000 */
+
+       /* set Pin Select Register D: Reserved, SIOF1_TxD, Reserved, SIOF1_MCLK, Reserved, SIOF1_SYNC, Reserved, SCIF1_SCK, Reserved */
+       __raw_writew(0x0000, PSELD);  /*     0         00        00          00        00          00        00         00         0 */
+
+       /* OTH:  (00) Other fuction
+        * GPO:  (01) General Purpose Output
+        * GPI:  (11) General Purpose Input
+        * GPI+: (10) General Purpose Input with internal pull-up
+        *-------------------------------------------------------
+        * A7 GPO(LED8);     A6 GPO(LED7);     A5 GPO(LED6);        A4 GPO(LED5);
+        * A3 GPO(LED4);     A2 GPO(LED3);     A1 GPO(LED2);        A0 GPO(LED1); */
+       __raw_writew(0x5555, PACR);   /* 01 01 01 01 01 01 01 01 */
+
+       /* B7 GPO(RST4);     B6 GPO(RST3);     B5 GPO(RST2);        B4 GPO(RST1);
+        * B3 GPO(PB3);      B2 GPO(PB2);      B1 GPO(PB1);         B0 GPO(PB0); */
+       __raw_writew(0x5555, PBCR);   /* 01 01 01 01 01 01 01 01 */
+
+       /* C7 GPO(PC7);      C6 GPO(PC6);      C5 GPO(PC5);         C4 GPO(PC4);
+        * C3 LCD_DATA3;     C2 LCD_DATA2;     C1 LCD_DATA1;        C0 LCD_DATA0; */
+       __raw_writew(0x5500, PCCR);   /* 01 01 01 01 00 00 00 00 */
+
+       /* D7 GPO(PD7);      D6 GPO(PD6);      D5 GPO(PD5);         D4 GPO(PD4);
+        * D3 GPO(PD3);      D2 GPO(PD2);      D1 GPO(PD1);         D0 GPO(PD0); */
+       __raw_writew(0x5555, PDCR);   /* 01 01 01 01 01 01 01 01 */
+
+       /* E7 (x);           E6 GPI(nu);       E5 GPI(nu);          E4 LCD_M_DISP;
+        * E3 LCD_CL1;       E2 LCD_CL2;       E1 LCD_DON;          E0 LCD_FLM; */
+       __raw_writew(0x2800, PECR);   /* 00 10 10 00 00 00 00 00 */
+
+       /* F7 (x);           F6 DA1(VLCD);     F5 DA0(nc);          F4 AN3;
+        * F3 AN2(MID_AD);   F2 AN1(EARTH_AD); F1 AN0(TEMP);        F0 GPI+(nc); */
+       __raw_writew(0x0002, PFCR);   /* 00 00 00 00 00 00 00 10 */
+
+       /* G7 (x);          G6 IRQ5(TOUCH_BUSY); G5 IRQ4(TOUCH_IRQ);G4 GPI(KEY2);
+        * G3 GPI(KEY1);     G2 GPO(LED11);      G1 GPO(LED10);     G0 GPO(LED9); */
+       __raw_writew(0x03D5, PGCR);   /* 00 00 00 11 11 01 01 01 */
+
+       /* H7 (x);            H6 /RAS(BRAS);      H5 /CAS(BCAS);    H4 CKE(BCKE);
+        * H3 GPO(EARTH_OFF); H2 GPO(EARTH_TEST); H1 USB2_PWR;      H0 USB1_PWR; */
+       __raw_writew(0x0050, PHCR);   /* 00 00 00 00 01 01 00 00 */
+
+       /* J7 (x);           J6 AUDCK;         J5 ASEBRKAK;         J4 AUDATA3;
+        * J3 AUDATA2;       J2 AUDATA1;       J1 AUDATA0;          J0 AUDSYNC; */
+       __raw_writew(0x0000, PJCR);   /* 00 00 00 00 00 00 00 00 */
+
+       /* K7 (x);           K6 (x);           K5 (x);              K4 (x)
+        * K3 PINT7(/PWR2);  K2 PINT6(/PWR1);  K1 PINT5(nc);        K0 PINT4(FLASH_READY); */
+       __raw_writew(0x00FB, PKCR);   /* 00 00 00 00 11 11 10 11 */
+
+       /* L7 TRST;          L6 TMS;           L5 TDO;              L4 TDI;
+        * L3 TCK;           L2 (x);           L1 (x);              L0 (x); */
+       __raw_writew(0x0000, PLCR);    /* 00 00 00 00 00 00 00 00 */
+
+       /* M7 GPO(CURRENT_SINK);M6 GPO(PWR_SWITCH);  M5 GPO(LAN_SPEED);   M4 GPO(LAN_RESET);
+        * M3 GPO(BUZZER);      M2 GPO(LCD_BL);      M1 CS5B(CAN3_CS);    M0 GPI+(nc); */
+       __raw_writew(0x5552, PMCR);   /* 01 01 01 01 01 01 00 10 */
+       __raw_writeb(0xF0, PMDR);     /* CURRENT_SINK=off, PWR_SWITCH=off, LAN_SPEED=100MBit, LAN_RESET=off, BUZZER=off, LCD_BL=off */
+
+       /* P7 (x);           P6 (x);           P5 (x);              P4 GPO(on pullup);
+        * P3 IRQ3(LAN_IRQ); P2 IRQ2(CAN3_IRQ);P1 IRQ1(CAN2_IRQ);   P0 IRQ0(CAN1_IRQ); */
+       __raw_writew(0x0100, PPCR);   /* 00 00 00 01 00 00 00 00 */
+       __raw_writeb(0x10, PPDR);     /* no current flow through pullup */
+
+       /* R7 A25;           R6 A24;           R5 A23;              R4 A22;
+        * R3 A21;           R2 A20;           R1 A19;              R0 A0; */
+       __raw_writew(0x0000, PRCR);   /* 00 00 00 00 00 00 00 00 */
+
+       /* S7 (x);              S6 (x);        S5 (x);              S4 GPO(EEPROM_CS2);
+        * S3 GPO(EEPROM_CS1);  S2 SIOF0_TXD;  S1 SIOF0_RXD;        S0 SIOF0_SCK; */
+       __raw_writew(0x0140, PSCR);   /* 00 00 00 01 01 00 00 00 */
+
+       /* T7 (x);           T6 (x);           T5 (x);              T4 COM1_CTS;
+        * T3 COM1_RTS;      T2 COM1_TXD;      T1 COM1_RXD;         T0 GPO(WDOG); */
+       __raw_writew(0x0001, PTCR);   /* 00 00 00 00 00 00 00 01 */
+
+       /* U7 (x);           U6 (x);           U5 (x);              U4 GPI+(/AC_FAULT);
+        * U3 GPO(TOUCH_CS); U2 TOUCH_TXD;     U1 TOUCH_RXD;        U0 TOUCH_SCK; */
+       __raw_writew(0x0240, PUCR);   /* 00 00 00 10 01 00 00 00 */
+
+       /* V7 (x);           V6 (x);           V5 (x);              V4 GPO(MID2);
+        * V3 GPO(MID1);     V2 CARD_TxD;      V1 CARD_RxD;         V0 GPI+(/BAT_FAULT); */
+       __raw_writew(0x0142, PVCR);   /* 00 00 00 01 01 00 00 10 */
+
+       return 0;
+}
+
+int dram_init(void)
+{
+       DECLARE_GLOBAL_DATA_PTR;
+
+       gd->bd->bi_memstart = CFG_SDRAM_BASE;
+       gd->bd->bi_memsize = CFG_SDRAM_SIZE;
+       printf("SDRAM: %dMB\n", CFG_SDRAM_SIZE / (1024 * 1024));
+       return 0;
+}
diff --git a/board/mpr2/u-boot.lds b/board/mpr2/u-boot.lds
new file mode 100644 (file)
index 0000000..eda6b44
--- /dev/null
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2007
+ * Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
+ *
+ * Copyright (C) 2007
+ * Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+ *
+ * Copyright (C) 2008
+ * Mark Jonas <mark.jonas@de.bosch.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
+ */
+
+OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux")
+OUTPUT_ARCH(sh)
+ENTRY(_start)
+
+SECTIONS
+{
+       /*
+          Base address of internal SDRAM is 0x8C000000.
+          U-Boot resides in the last 256 kB of the 64 MB.
+
+          NOTE: This address must match with the definition of
+          TEXT_BASE in config.mk (in this directory).
+
+       */
+       . = 0x8C000000 + (64*1024*1024) - (256*1024);
+
+       PROVIDE (reloc_dst = .);
+
+       PROVIDE (_ftext = .);
+       PROVIDE (_fcode = .);
+       PROVIDE (_start = .);
+
+       .text :
+       {
+               cpu/sh3/start.o         (.text)
+               . = ALIGN(8192);
+               common/environment.o    (.ppcenv)
+               . = ALIGN(8192);
+               common/environment.o    (.ppcenvr)
+               . = ALIGN(8192);
+               *(.text)
+               . = ALIGN(4);
+       } =0xFF
+       PROVIDE (_ecode = .);
+       .rodata :
+       {
+               *(.rodata)
+               . = ALIGN(4);
+       }
+       PROVIDE (_etext = .);
+
+
+       PROVIDE (_fdata = .);
+       .data :
+       {
+               *(.data)
+               . = ALIGN(4);
+       }
+       PROVIDE (_edata = .);
+
+       PROVIDE (_fgot = .);
+       .got :
+       {
+               *(.got)
+               . = ALIGN(4);
+       }
+       PROVIDE (_egot = .);
+
+       PROVIDE (__u_boot_cmd_start = .);
+       .u_boot_cmd :
+       {
+               *(.u_boot_cmd)
+               . = ALIGN(4);
+       }
+       PROVIDE (__u_boot_cmd_end = .);
+
+       PROVIDE (reloc_dst_end = .);
+       /* _reloc_dst_end = .; */
+
+       PROVIDE (bss_start = .);
+       PROVIDE (__bss_start = .);
+       .bss :
+       {
+               *(.bss)
+               . = ALIGN(4);
+       }
+       PROVIDE (bss_end = .);
+
+       PROVIDE (_end = .);
+}
index 20d000c..6fe615b 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 85eadbe..76dfeba 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index ddd4678..753411f 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
diff --git a/board/mx31ads/Makefile b/board/mx31ads/Makefile
new file mode 100644 (file)
index 0000000..dfadd96
--- /dev/null
@@ -0,0 +1,47 @@
+#
+# Copyright (C) 2008, Guennadi Liakhovetski <lg@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.
+#
+# 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).a
+
+COBJS  := mx31ads.o
+SOBJS  := lowlevel_init.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+
+clean:
+       rm -f $(SOBJS) $(OBJS)
+
+distclean:     clean
+       rm -f $(LIB) core *.bak .depend
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/mx31ads/config.mk b/board/mx31ads/config.mk
new file mode 100644 (file)
index 0000000..d34dc02
--- /dev/null
@@ -0,0 +1 @@
+TEXT_BASE = 0x87f00000
diff --git a/board/mx31ads/lowlevel_init.S b/board/mx31ads/lowlevel_init.S
new file mode 100644 (file)
index 0000000..099a7ca
--- /dev/null
@@ -0,0 +1,281 @@
+/*
+ * Copyright (C) 2008, Guennadi Liakhovetski <lg@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.
+ *
+ * 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/arch/mx31-regs.h>
+
+.macro REG reg, val
+       ldr r2, =\reg
+       ldr r3, =\val
+       str r3, [r2]
+.endm
+
+.macro REG8 reg, val
+       ldr r2, =\reg
+       ldr r3, =\val
+       strb r3, [r2]
+.endm
+
+.macro DELAY loops
+       ldr r2, =\loops
+1:
+       subs    r2, r2, #1
+       nop
+       bcs 1b
+.endm
+
+/* RedBoot: AIPS setup - Only setup MPROTx registers.
+ * The PACR default values are good.*/
+.macro init_aips
+       /*
+        * Set all MPROTx to be non-bufferable, trusted for R/W,
+        * not forced to user-mode.
+        */
+       ldr r0, =0x43F00000
+       ldr r1, =0x77777777
+       str r1, [r0, #0x00]
+       str r1, [r0, #0x04]
+       ldr r0, =0x53F00000
+       str r1, [r0, #0x00]
+       str r1, [r0, #0x04]
+
+       /*
+        * Clear the on and off peripheral modules Supervisor Protect bit
+        * for SDMA to access them. Did not change the AIPS control registers
+        * (offset 0x20) access type
+        */
+       ldr r0, =0x43F00000
+       ldr r1, =0x0
+       str r1, [r0, #0x40]
+       str r1, [r0, #0x44]
+       str r1, [r0, #0x48]
+       str r1, [r0, #0x4C]
+       ldr r1, [r0, #0x50]
+       and r1, r1, #0x00FFFFFF
+       str r1, [r0, #0x50]
+
+       ldr r0, =0x53F00000
+       ldr r1, =0x0
+       str r1, [r0, #0x40]
+       str r1, [r0, #0x44]
+       str r1, [r0, #0x48]
+       str r1, [r0, #0x4C]
+       ldr r1, [r0, #0x50]
+       and r1, r1, #0x00FFFFFF
+       str r1, [r0, #0x50]
+.endm /* init_aips */
+
+/* RedBoot: MAX (Multi-Layer AHB Crossbar Switch) setup */
+.macro init_max
+       ldr r0, =0x43F04000
+       /* MPR - priority is M4 > M2 > M3 > M5 > M0 > M1 */
+       ldr r1, =0x00302154
+       str r1, [r0, #0x000]        /* for S0 */
+       str r1, [r0, #0x100]        /* for S1 */
+       str r1, [r0, #0x200]        /* for S2 */
+       str r1, [r0, #0x300]        /* for S3 */
+       str r1, [r0, #0x400]        /* for S4 */
+       /* SGPCR - always park on last master */
+       ldr r1, =0x10
+       str r1, [r0, #0x010]        /* for S0 */
+       str r1, [r0, #0x110]        /* for S1 */
+       str r1, [r0, #0x210]        /* for S2 */
+       str r1, [r0, #0x310]        /* for S3 */
+       str r1, [r0, #0x410]        /* for S4 */
+       /* MGPCR - restore default values */
+       ldr r1, =0x0
+       str r1, [r0, #0x800]        /* for M0 */
+       str r1, [r0, #0x900]        /* for M1 */
+       str r1, [r0, #0xA00]        /* for M2 */
+       str r1, [r0, #0xB00]        /* for M3 */
+       str r1, [r0, #0xC00]        /* for M4 */
+       str r1, [r0, #0xD00]        /* for M5 */
+.endm /* init_max */
+
+/* RedBoot: M3IF setup */
+.macro init_m3if
+       /* Configure M3IF registers */
+       ldr r1, =0xB8003000
+       /*
+       * M3IF Control Register (M3IFCTL)
+       * MRRP[0] = L2CC0 not on priority list (0 << 0) = 0x00000000
+       * MRRP[1] = L2CC1 not on priority list (0 << 0) = 0x00000000
+       * MRRP[2] = MBX not on priority list (0 << 0)   = 0x00000000
+       * MRRP[3] = MAX1 not on priority list (0 << 0)  = 0x00000000
+       * MRRP[4] = SDMA not on priority list (0 << 0)  = 0x00000000
+       * MRRP[5] = MPEG4 not on priority list (0 << 0) = 0x00000000
+       * MRRP[6] = IPU1 on priority list (1 << 6)      = 0x00000040
+       * MRRP[7] = IPU2 not on priority list (0 << 0)  = 0x00000000
+       *                                               ------------
+       *                                                 0x00000040
+       */
+       ldr r0, =0x00000040
+       str r0, [r1]  /* M3IF control reg */
+.endm /* init_m3if */
+
+/* RedBoot: To support 133MHz DDR */
+.macro  init_drive_strength
+       /*
+        * Disable maximum drive strength SDRAM/DDR lines by clearing DSE1 bits
+        * in SW_PAD_CTL registers
+        */
+
+       /* SDCLK */
+       ldr r1, =0x43FAC200
+       ldr r0, [r1, #0x6C]
+       bic r0, r0, #(1 << 12)
+       str r0, [r1, #0x6C]
+
+       /* CAS */
+       ldr r0, [r1, #0x70]
+       bic r0, r0, #(1 << 22)
+       str r0, [r1, #0x70]
+
+       /* RAS */
+       ldr r0, [r1, #0x74]
+       bic r0, r0, #(1 << 2)
+       str r0, [r1, #0x74]
+
+       /* CS2 (CSD0) */
+       ldr r0, [r1, #0x7C]
+       bic r0, r0, #(1 << 22)
+       str r0, [r1, #0x7C]
+
+       /* DQM3 */
+       ldr r0, [r1, #0x84]
+       bic r0, r0, #(1 << 22)
+       str r0, [r1, #0x84]
+
+       /* DQM2, DQM1, DQM0, SD31-SD0, A25-A0, MA10 (0x288..0x2DC) */
+       ldr r2, =22     /* (0x2E0 - 0x288) / 4 = 22 */
+pad_loop:
+       ldr r0, [r1, #0x88]
+       bic r0, r0, #(1 << 22)
+       bic r0, r0, #(1 << 12)
+       bic r0, r0, #(1 << 2)
+       str r0, [r1, #0x88]
+       add r1, r1, #4
+       subs r2, r2, #0x1
+       bne pad_loop
+.endm /* init_drive_strength */
+
+/* CPLD on CS4 setup */
+.macro init_cs4
+       ldr r0, =WEIM_BASE
+       ldr r1, =0x0000D843
+       str r1, [r0, #0x40]
+       ldr r1, =0x22252521
+       str r1, [r0, #0x44]
+       ldr r1, =0x22220A00
+       str r1, [r0, #0x48]
+.endm /* init_cs4 */
+
+.globl lowlevel_init
+lowlevel_init:
+
+       /* Redboot initializes very early AIPS, what for?
+        * Then it also initializes Multi-Layer AHB Crossbar Switch,
+        * M3IF */
+       /* Also setup the Peripheral Port Remap register inside the core */
+       ldr r0, =0x40000015        /* start from AIPS 2GB region */
+       mcr p15, 0, r0, c15, c2, 4
+
+       init_aips
+
+       init_max
+
+       init_m3if
+
+       init_drive_strength
+
+       init_cs4
+
+       /* Image Processing Unit: */
+       /* Too early to switch display on? */
+       REG     IPU_CONF, IPU_CONF_DI_EN        /* Switch on Display Interface */
+       /* Clock Control Module: */
+       REG     CCM_CCMR, 0x074B0BF5            /* Use CKIH, MCU PLL off */
+
+       DELAY 0x40000
+
+       REG     CCM_CCMR, 0x074B0BF5 | CCMR_MPE                 /* MCU PLL on */
+       REG     CCM_CCMR, (0x074B0BF5 | CCMR_MPE) & ~CCMR_MDS   /* Switch to MCU PLL */
+
+       /* PBC CPLD on CS4 */
+       mov     r1, #CS4_BASE
+       ldrh    r1, [r1, #0x2]
+       /* Is 27MHz switch set? */
+       ands    r1, r1, #0x16
+
+       /* 532-133-66.5 */
+       ldr     r0, =CCM_BASE
+       ldr     r1, =0xFF871D58
+       /* PDR0 */
+       str     r1, [r0, #0x4]
+       ldreq   r1, MPCTL_PARAM_532
+       ldrne   r1, MPCTL_PARAM_532_27
+       /* MPCTL */
+       str     r1, [r0, #0x10]
+
+       /* Set UPLL=240MHz, USB=60MHz */
+       ldr     r1, =0x49FCFE7F
+       /* PDR1 */
+       str     r1, [r0, #0x8]
+       ldreq   r1, UPCTL_PARAM_240
+       ldrne   r1, UPCTL_PARAM_240_27
+       /* UPCTL */
+       str     r1, [r0, #0x14]
+       /* default CLKO to 1/8 of the ARM core */
+       mov     r1, #0x000002C0
+       add     r1, r1, #0x00000006
+       /* COSR */
+       str     r1, [r0, #0x1c]
+
+       /* RedBoot sets 0x1ff, 7, 3, 5, 1, 3, 0 */
+/*     REG     CCM_PDR0, PDR0_CSI_PODF(0x1ff) | PDR0_PER_PODF(7) | PDR0_HSP_PODF(2) | PDR0_NFC_PODF(6) | PDR0_IPG_PODF(1) | PDR0_MAX_PODF(2) | PDR0_MCU_PODF(0)*/
+
+       /* Redboot: 0, 51, 10, 12 / 0, 14, 9, 13 */
+/*     REG     CCM_MPCTL, PLL_PD(0) | PLL_MFD(0x33) | PLL_MFI(7) | PLL_MFN(0x23)*/
+       /* Default: 1, 4, 12, 1 */
+       REG     CCM_SPCTL, PLL_PD(1) | PLL_MFD(4) | PLL_MFI(12) | PLL_MFN(1)
+
+       /* B8xxxxxx - NAND, 8xxxxxxx - CSD0 RAM */
+       REG     0xB8001010, 0x00000004
+       REG     0xB8001004, 0x006ac73a
+       REG     0xB8001000, 0x92100000
+       REG     0x80000f00, 0x12344321
+       REG     0xB8001000, 0xa2100000
+       REG     0x80000000, 0x12344321
+       REG     0x80000000, 0x12344321
+       REG     0xB8001000, 0xb2100000
+       REG8    0x80000033, 0xda
+       REG8    0x81000000, 0xff
+       REG     0xB8001000, 0x82226080
+       REG     0x80000000, 0xDEADBEEF
+       REG     0xB8001010, 0x0000000c
+
+       mov     pc, lr
+
+MPCTL_PARAM_532:
+       .word (((1-1) << 26) + ((52-1) << 16) + (10 << 10) + (12 << 0))
+MPCTL_PARAM_532_27:
+       .word (((1-1) << 26) + ((15-1) << 16) + (9  << 10) + (13 << 0))
+UPCTL_PARAM_240:
+       .word (((2-1) << 26) + ((13-1) << 16) + (9  << 10) + (3  << 0))
+UPCTL_PARAM_240_27:
+       .word (((2-1) << 26) + ((9 -1) << 16) + (8  << 10) + (8  << 0))
diff --git a/board/mx31ads/mx31ads.c b/board/mx31ads/mx31ads.c
new file mode 100644 (file)
index 0000000..dd0e150
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2008, Guennadi Liakhovetski <lg@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/io.h>
+#include <asm/arch/mx31.h>
+#include <asm/arch/mx31-regs.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int dram_init (void)
+{
+       gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
+       gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+
+       return 0;
+}
+
+int board_init (void)
+{
+       int i;
+
+       /* CS0: Nor Flash */
+       /*
+        * CS0L and CS0A values are from the RedBoot sources by Freescale
+        * and are also equal to those used by Sascha Hauer for the Phytec
+        * i.MX31 board. CS0U is just a slightly optimized hardware default:
+        * the only non-zero field "Wait State Control" is set to half the
+        * default value.
+        */
+       __REG(CSCR_U(0)) = 0x00000f00;
+       __REG(CSCR_L(0)) = 0x10000D03;
+       __REG(CSCR_A(0)) = 0x00720900;
+
+       /* setup pins for UART1 */
+       mx31_gpio_mux(MUX_RXD1__UART1_RXD_MUX);
+       mx31_gpio_mux(MUX_TXD1__UART1_TXD_MUX);
+       mx31_gpio_mux(MUX_RTS1__UART1_RTS_B);
+       mx31_gpio_mux(MUX_RTS1__UART1_CTS_B);
+
+       /* SPI2 */
+       mx31_gpio_mux((MUX_CTL_FUNC << 8) | MUX_CTL_CSPI2_SS2);
+       mx31_gpio_mux((MUX_CTL_FUNC << 8) | MUX_CTL_CSPI2_SCLK);
+       mx31_gpio_mux((MUX_CTL_FUNC << 8) | MUX_CTL_CSPI2_SPI_RDY);
+       mx31_gpio_mux((MUX_CTL_FUNC << 8) | MUX_CTL_CSPI2_MOSI);
+       mx31_gpio_mux((MUX_CTL_FUNC << 8) | MUX_CTL_CSPI2_MISO);
+       mx31_gpio_mux((MUX_CTL_FUNC << 8) | MUX_CTL_CSPI2_SS0);
+       mx31_gpio_mux((MUX_CTL_FUNC << 8) | MUX_CTL_CSPI2_SS1);
+
+       /* start SPI2 clock */
+       __REG(CCM_CGR2) = __REG(CCM_CGR2) | (3 << 4);
+
+       /* PBC setup */
+       /* Enable UART transceivers also reset the Ethernet/external UART */
+       readw(CS4_BASE + 4);
+
+       writew(0x8023, CS4_BASE + 4);
+
+       /* RedBoot also has an empty loop with 100000 iterations here -
+        * clock doesn't run yet */
+       for (i = 0; i < 100000; i++)
+               ;
+
+       /* Clear the reset, toggle the LEDs */
+       writew(0xDF, CS4_BASE + 6);
+
+       /* clock still doesn't run */
+       for (i = 0; i < 100000; i++)
+               ;
+
+       /* See 1.5.4 in IMX31ADSE_PERI_BUS_CNTRL_CPLD_RM.pdf */
+       readb(CS4_BASE + 8);
+       readb(CS4_BASE + 7);
+       readb(CS4_BASE + 8);
+       readb(CS4_BASE + 7);
+
+       gd->bd->bi_arch_number = MACH_TYPE_MX31ADS;     /* board id for linux */
+       gd->bd->bi_boot_params = 0x80000100;    /* adress of boot parameters */
+
+       return 0;
+}
+
+int checkboard (void)
+{
+       printf("Board: MX31ADS\n");
+       return 0;
+}
diff --git a/board/mx31ads/u-boot.lds b/board/mx31ads/u-boot.lds
new file mode 100644 (file)
index 0000000..49713d4
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * January 2004 - Changed to support H4 device
+ * Copyright (c) 2004 Texas Instruments
+ *
+ * (C) Copyright 2002
+ * Gary Jennejohn, DENX Software Engineering, <gj@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-littlearm", "elf32-littlearm", "elf32-littlearm")
+OUTPUT_ARCH(arm)
+ENTRY(_start)
+SECTIONS
+{
+       . = 0x00000000;
+
+       . = ALIGN(4);
+       .text      :
+       {
+         /* WARNING - the following is hand-optimized to fit within    */
+         /* the sector layout of our flash chips!      XXX FIXME XXX   */
+
+         cpu/arm1136/start.o           (.text)
+         board/mx31ads/libmx31ads.a    (.text)
+         lib_arm/libarm.a              (.text)
+         net/libnet.a                  (.text)
+         drivers/mtd/libmtd.a          (.text)
+
+         . = DEFINED(env_offset) ? env_offset : .;
+         common/environment.o(.text)
+
+         *(.text)
+       }
+
+       . = ALIGN(4);
+       .rodata : { *(.rodata) }
+
+       . = ALIGN(4);
+       .data : { *(.data) }
+
+       . = ALIGN(4);
+       .got : { *(.got) }
+
+       . = .;
+       __u_boot_cmd_start = .;
+       .u_boot_cmd : { *(.u_boot_cmd) }
+       __u_boot_cmd_end = .;
+
+       . = ALIGN(4);
+       __bss_start = .;
+       .bss : { *(.bss) }
+       _end = .;
+}
index 8562046..159224f 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 2228a20..40e4bd0 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 9584c33..ea39cd9 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 004e7fd..80bcbfc 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index e7f2863..ab0b18a 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 2c48316..6c0ebbb 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 
 SECTIONS
 {
index b6e28f8..a9532c4 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 9584c33..ea39cd9 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 004e7fd..80bcbfc 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 9584c33..ea39cd9 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 004e7fd..80bcbfc 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 6c7e68d..79399f8 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 96569bf..dda52a9 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index b055c90..94ab745 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 3165d56..1a25a98 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index e851e2f..98bb394 100644 (file)
@@ -388,5 +388,5 @@ skip_memsetup:
        */
        sync
 
-       j       ra
+       jr      ra
        nop
index 63cf648..1959807 100644 (file)
@@ -29,7 +29,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index a4d1bdb..0a8ed67 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 5d87537..a7f3813 100644 (file)
@@ -87,7 +87,7 @@ struct fsl_e_tlb_entry tlb_table[] = {
         * 0xe000_0000  1M      CCSRBAR
         * 0xe200_0000  16M     PCI1 IO
         */
-       SET_TLB_ENTRY(1, CFG_CCSRBAR, CFG_CCSRBAR,
+       SET_TLB_ENTRY(1, CFG_CCSRBAR, CFG_CCSRBAR_PHYS,
                      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
                      0, 5, BOOKE_PAGESZ_64M, 1),
 
index 86f8f13..075d8f3 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 5d87537..a7f3813 100644 (file)
@@ -87,7 +87,7 @@ struct fsl_e_tlb_entry tlb_table[] = {
         * 0xe000_0000  1M      CCSRBAR
         * 0xe200_0000  16M     PCI1 IO
         */
-       SET_TLB_ENTRY(1, CFG_CCSRBAR, CFG_CCSRBAR,
+       SET_TLB_ENTRY(1, CFG_CCSRBAR, CFG_CCSRBAR_PHYS,
                      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
                      0, 5, BOOKE_PAGESZ_64M, 1),
 
index 6cfddea..d52a325 100644 (file)
@@ -23,7 +23,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index ffa20cd..3f53e4b 100644 (file)
@@ -157,8 +157,15 @@ int do_loadpci (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        char *s;
 
        if (((s = getenv("autoscript")) != NULL) && (strcmp(s,"yes") == 0)) {
-           printf("Running autoscript at addr 0x%08lX ...\n", load_addr);
-           rcode = autoscript (bd, load_addr);
+               printf ("Running autoscript at addr 0x%08lX", load_addr);
+
+               s = getenv ("autoscript_uname");
+               if (s)
+                       printf (":%s ...\n", s);
+               else
+                       puts (" ...\n");
+
+               rcode = autoscript (load_addr, s);
        }
     }
 #endif
index 23cb273..3231325 100644 (file)
@@ -26,7 +26,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index b764499..287f32e 100644 (file)
 
 
 #include <common.h>
-#include <asm/processor.h>
+#include <libfdt.h>
+#include <fdt_support.h>
 #include <spd_sdram.h>
 #include <ppc4xx_enet.h>
 #include <miiphy.h>
+#include <asm/processor.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -315,3 +317,24 @@ int post_hotkeys_pressed(void)
        return (ctrlc());
 }
 #endif
+
+#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
+void ft_board_setup(void *blob, bd_t *bd)
+{
+       u32 val[4];
+       int rc;
+
+       ft_cpu_setup(blob, bd);
+
+       /* Fixup NOR mapping */
+       val[0] = 0;                             /* chip select number */
+       val[1] = 0;                             /* always 0 */
+       val[2] = gd->bd->bi_flashstart;
+       val[3] = gd->bd->bi_flashsize;
+       rc = fdt_find_and_setprop(blob, "/plb/opb/ebc", "ranges",
+                                 val, sizeof(val), 1);
+       if (rc)
+               printf("Unable to update property NOR mapping, err=%s\n",
+                      fdt_strerror(rc));
+}
+#endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
index 135674c..76164ce 100644 (file)
@@ -90,7 +90,16 @@ tlbtab:
        tlbentry( CFG_PERIPHERAL_BASE, SZ_256M, 0x40000000, 1, AC_R|AC_W|SA_G|SA_I )
        tlbentry( CFG_ISRAM_BASE, SZ_4K, 0x80000000, 0, AC_R|AC_W|AC_X )
        tlbentry( CFG_ISRAM_BASE + 0x1000, SZ_4K, 0x80001000, 0, AC_R|AC_W|AC_X )
+#ifdef CONFIG_4xx_DCACHE
+       tlbentry( CFG_SDRAM_BASE, SZ_256M, 0x00000000, 0, AC_R|AC_W|AC_X|SA_G)
+#else
        tlbentry( CFG_SDRAM_BASE, SZ_256M, 0x00000000, 0, AC_R|AC_W|AC_X|SA_G|SA_I )
+#endif
+
+#ifdef CFG_INIT_RAM_DCACHE
+       /* TLB-entry for init-ram in dcache (SA_I must be turned off!) */
+       tlbentry( CFG_INIT_RAM_ADDR, SZ_64K, CFG_INIT_RAM_ADDR, 0, AC_R|AC_W|AC_X|SA_G )
+#endif
        tlbentry( CFG_PCI_BASE, SZ_256M, 0x00000000, 2, AC_R|AC_W|SA_G|SA_I )
 
        /* PCI */
index 0ad5c53..9b1d91c 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 0f9a157..25e16de 100644 (file)
@@ -26,7 +26,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 7d1099e..2843642 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 668124a..b9d03fc 100644 (file)
@@ -33,5 +33,5 @@ lowlevel_init:
        li      t0, MC_IOGP
        li      t1, 0xf24
        sw      t1, 0(t0)
-       j       ra
+       jr      ra
        nop
index 74718af..13a1455 100644 (file)
@@ -29,6 +29,7 @@
 #include <asm/io.h>
 #include <asm/addrspace.h>
 #include <asm/cacheops.h>
+#include <asm/reboot.h>
 
 #include "sconsole.h"
 
@@ -52,6 +53,13 @@ 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;
index 28166bc..836e027 100644 (file)
@@ -37,5 +37,5 @@ lowlevel_init:
        mtc0    zero, CP0_WIRED
        nop
 
-       j       ra
+       jr      ra
        nop
index 618a10c..dbea90c 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 894b9bd..5cedcb1 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
diff --git a/board/r2dplus/Makefile b/board/r2dplus/Makefile
new file mode 100644 (file)
index 0000000..ed609ea
--- /dev/null
@@ -0,0 +1,43 @@
+#
+# Copyright (C) 2007,2008
+# Nobuhiro Iwamatsu <iwamatsu@nigauri.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 $(TOPDIR)/config.mk
+
+LIB    = lib$(BOARD).a
+
+OBJS   := r2dplus.o
+SOBJS  := lowlevel_init.o
+
+$(LIB):        $(OBJS) $(SOBJS)
+       $(AR) crv $@ $(OBJS) $(SOBJS)
+
+clean:
+       rm -f $(SOBJS) $(OBJS)
+
+distclean:     clean
+       rm -f $(LIB) core *.bak .depend
+
+#################################################################
+
+.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
+       $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+
+-include .depend
+
+#################################################################
diff --git a/board/r2dplus/config.mk b/board/r2dplus/config.mk
new file mode 100644 (file)
index 0000000..1ec7dcc
--- /dev/null
@@ -0,0 +1,23 @@
+#
+# Copyright (C) 2007,2008
+# Nobuhiro Iwamatsu <iwamatsu@nigauri.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
+#
+#
+# NOTE: Must match value used in u-boot.lds (in this directory).
+#
+TEXT_BASE = 0x0FFC0000
diff --git a/board/r2dplus/lowlevel_init.S b/board/r2dplus/lowlevel_init.S
new file mode 100644 (file)
index 0000000..5755de8
--- /dev/null
@@ -0,0 +1,154 @@
+/*
+ * modified from SH-IPL+g (init-r0p751rlc0011rl.S)
+ * Initial Register Data for R0P751RLC0011RL (SH7751R 240MHz/120MHz/60MHz)
+ * Coyright (c) 2007,2008 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+*/
+
+#include <config.h>
+#include <version.h>
+
+#include <asm/processor.h>
+
+       .global lowlevel_init
+       .text
+       .align  2
+
+lowlevel_init:
+
+       mov.l   CCR_A, r1
+       mov.l   CCR_D_D, r0
+       mov.l   r0,@r1
+
+       mov.l   MMUCR_A,r1
+       mov.l   MMUCR_D,r0
+       mov.w   r0,@r1
+
+       mov.l   BCR1_A,r1
+       mov.l   BCR1_D,r0
+       mov.l   r0,@r1
+
+       mov.l   BCR2_A,r1
+       mov.l   BCR2_D,r0
+       mov.w   r0,@r1
+
+       mov.l   BCR3_A,r1
+       mov.l   BCR3_D,r0
+       mov.w   r0,@r1
+
+       mov.l   BCR4_A,r1
+       mov.l   BCR4_D,r0
+       mov.l   r0,@r1
+
+       mov.l   WCR1_A,r1
+       mov.l   WCR1_D,r0
+       mov.l   r0,@r1
+
+       mov.l   WCR2_A,r1
+       mov.l   WCR2_D,r0
+       mov.l   r0,@r1
+
+       mov.l   WCR3_A,r1
+       mov.l   WCR3_D,r0
+       mov.l   r0,@r1
+
+       mov.l   PCR_A,r1
+       mov.l   PCR_D,r0
+       mov.w   r0,@r1
+
+       mov.l   LED_A,r1
+       mov     #0xff,r0
+       mov.w   r0,@r1
+
+       mov.l   MCR_A,r1
+       mov.l   MCR_D1,r0
+       mov.l   r0,@r1
+
+       mov.l   RTCNT_A,r1
+       mov.l   RTCNT_D,r0
+       mov.w   r0,@r1
+
+       mov.l   RTCOR_A,r1
+       mov.l   RTCOR_D,r0
+       mov.w   r0,@r1
+
+       mov.l   RFCR_A,r1
+       mov.l   RFCR_D,r0
+       mov.w   r0,@r1
+
+       mov.l   RTCSR_A,r1
+       mov.l   RTCSR_D,r0
+       mov.w   r0,@r1
+
+       mov.l   SDMR3_A,r1
+       mov     #0x55,r0
+       mov.b   r0,@r1
+
+       /* Wait DRAM refresh 30 times */
+       mov.l   RFCR_A,r1
+       mov     #30,r3
+1:
+       mov.w   @r1,r0
+       extu.w  r0,r2
+       cmp/hi  r3,r2
+       bf      1b
+
+       mov.l   MCR_A,r1
+       mov.l   MCR_D2,r0
+       mov.l   r0,@r1
+
+       mov.l   SDMR3_A,r1
+       mov     #0,r0
+       mov.b   r0,@r1
+
+       mov.l   IRLMASK_A,r1
+       mov.l   IRLMASK_D,r0
+       mov.l   r0,@r1
+
+       mov.l   CCR_A, r1
+       mov.l   CCR_D_E, r0
+       mov.l   r0, @r1
+
+       rts
+       nop
+
+       .align  2
+CCR_A:         .long   CCR             /* Cache Control Register */
+CCR_D_D:       .long   0x0808          /* Flush the cache, disable */
+CCR_D_E:       .long   0x8000090B
+
+FRQCR_A:       .long   FRQCR           /* FRQCR Address */
+FRQCR_D:       .long   0x00000e0a      /* 03/07/15 modify */
+BCR1_A:        .long   BCR1            /* BCR1 Address */
+BCR1_D:        .long   0x00180008
+BCR2_A:        .long   BCR2            /* BCR2 Address */
+BCR2_D:        .long   0xabe8
+BCR3_A:        .long   BCR3            /* BCR3 Address */
+BCR3_D:        .long   0x0000
+BCR4_A:        .long   BCR4            /* BCR4 Address */
+BCR4_D:        .long   0x00000010
+WCR1_A:        .long   WCR1            /* WCR1 Address */
+WCR1_D:        .long   0x33343333
+WCR2_A:        .long   WCR2            /* WCR2 Address */
+WCR2_D:        .long   0xcff86fbf
+WCR3_A:        .long   WCR3            /* WCR3 Address */
+WCR3_D:        .long   0x07777707
+LED_A:         .long   0x04000036      /* LED Address */
+RTCNT_A:       .long   RTCNT           /* RTCNT Address */
+RTCNT_D:       .long   0xA500          /* RTCNT Write Code A5h Data 00h */
+RTCOR_A:       .long   RTCOR           /* RTCOR Address */
+RTCOR_D:       .long   0xA534          /* RTCOR Write Code  */
+RTCSR_A:       .long   RTCSR           /* RTCSR Address */
+RTCSR_D:       .long   0xA510          /* RTCSR Write Code */
+SDMR3_A:       .long   0xFF9400CC      /* SDMR3 Address */
+SDMR3_D:       .long   0x55
+MCR_A:         .long   MCR             /* MCR Address */
+MCR_D1:        .long   0x081901F4      /* MRSET:'0' */
+MCR_D2:        .long   0x481901F4      /* MRSET:'1' */
+RFCR_A:        .long   RFCR            /* RFCR Address */
+RFCR_D:        .long   0xA400          /* RFCR Write Code A4h Data 00h */
+PCR_A:         .long   PCR             /* PCR Address */
+PCR_D:         .long   0x0000
+MMUCR_A:       .long   MMUCR           /* MMUCCR Address */
+MMUCR_D:       .long   0x00000000      /* MMUCCR Data */
+IRLMASK_A:     .long   0xA4000000      /* IRLMASK Address */
+IRLMASK_D:     .long   0x00000000      /* IRLMASK Data */
diff --git a/board/r2dplus/r2dplus.c b/board/r2dplus/r2dplus.c
new file mode 100644 (file)
index 0000000..2ee3ea2
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2007,2008
+ * Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+ *
+ * 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 <ide.h>
+#include <asm/processor.h>
+#include <asm/pci.h>
+
+int checkboard(void)
+{
+       puts("BOARD: Renesas Solutions R2D Plus\n");
+       return 0;
+}
+
+int board_init(void)
+{
+       return 0;
+}
+
+int dram_init (void)
+{
+       DECLARE_GLOBAL_DATA_PTR;
+
+       gd->bd->bi_memstart = CFG_SDRAM_BASE;
+       gd->bd->bi_memsize = CFG_SDRAM_SIZE;
+       printf("DRAM:  %dMB\n", CFG_SDRAM_SIZE / (1024 * 1024));
+       return 0;
+}
+
+int board_late_init(void)
+{
+       return 0;
+}
+
+#define FPGA_BASE          0xA4000000
+#define FPGA_CFCTL         (FPGA_BASE + 0x04)
+#define FPGA_CFPOW         (FPGA_BASE + 0x06)
+#define FPGA_CFCDINTCLR    (FPGA_BASE + 0x2A)
+
+void ide_set_reset (int idereset)
+{
+       /* if reset = 1 IDE reset will be asserted */
+       if (idereset){
+               (*(vu_short *)FPGA_CFCTL) = 0x432;
+               (*(vu_short *)FPGA_CFPOW) |= 0x02;
+               (*(vu_short *)FPGA_CFCDINTCLR) = 0x01;
+       }
+}
+
+#if defined(CONFIG_PCI)
+static struct pci_controller hose;
+void pci_init_board(void)
+{
+       pci_sh7751_init( &hose );
+}
+#endif /* CONFIG_PCI */
diff --git a/board/r2dplus/u-boot.lds b/board/r2dplus/u-boot.lds
new file mode 100644 (file)
index 0000000..96d8d81
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * Copyrigth (c) 2007,2008
+ * Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+ *
+ * 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-sh-linux", "elf32-sh-linux", "elf32-sh-linux")
+OUTPUT_ARCH(sh)
+ENTRY(_start)
+
+SECTIONS
+{
+       /*
+          Base address of internal SDRAM is 0x0C000000.
+          Although size of SDRAM can be either 16 or 32 MBytes,
+          we assume 16 MBytes (ie ignore upper half if the full
+          32 MBytes is present).
+
+          NOTE: This address must match with the definition of
+          TEXT_BASE in config.mk (in this directory).
+
+       */
+       . = 0x0C000000 + (64*1024*1024) - (256*1024);
+
+       PROVIDE (reloc_dst = .);
+
+       PROVIDE (_ftext = .);
+       PROVIDE (_fcode = .);
+       PROVIDE (_start = .);
+
+       .text :
+       {
+               cpu/sh4/start.o         (.text)
+               . = ALIGN(8192);
+               common/environment.o    (.ppcenv)
+               . = ALIGN(8192);
+               common/environment.o    (.ppcenvr)
+               . = ALIGN(8192);
+               *(.text)
+               . = ALIGN(4);
+       } =0xFF
+       PROVIDE (_ecode = .);
+       .rodata :
+       {
+               *(.rodata)
+               . = ALIGN(4);
+       }
+       PROVIDE (_etext = .);
+
+
+       PROVIDE (_fdata = .);
+       .data :
+       {
+               *(.data)
+               . = ALIGN(4);
+       }
+       PROVIDE (_edata = .);
+
+       PROVIDE (_fgot = .);
+       .got :
+       {
+               *(.got)
+               . = ALIGN(4);
+       }
+       PROVIDE (_egot = .);
+
+       PROVIDE (__u_boot_cmd_start = .);
+       .u_boot_cmd :
+       {
+               *(.u_boot_cmd)
+               . = ALIGN(4);
+       }
+       PROVIDE (__u_boot_cmd_end = .);
+
+       PROVIDE (reloc_dst_end = .);
+       /* _reloc_dst_end = .; */
+
+       PROVIDE (bss_start = .);
+       PROVIDE (__bss_start = .);
+       .bss :
+       {
+               *(.bss)
+               . = ALIGN(4);
+       }
+       PROVIDE (bss_end = .);
+
+       PROVIDE (_end = .);
+}
index aaec718..c3708bf 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
diff --git a/board/r5200/r5200.c b/board/r5200/r5200.c
deleted file mode 100644 (file)
index 69f3a76..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * (C) Copyright 2000-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/m5271.h>
-#include <asm/immap_5271.h>
-
-
-int checkboard (void) {
-       puts ("Board: R5200 Ethernet Module\n");
-       return 0;
-};
-
-long int initdram (int board_type) {
-       int i;
-
-       /*
-        *  Set CS2 pin to be SD_CS0
-        */
-       mbar_writeByte(MCF_GPIO_PAR_CS, mbar_readByte(MCF_GPIO_PAR_CS)
-                       | MCF_GPIO_PAR_CS_PAR_CS2);
-
-       mbar_writeByte(MCF_GPIO_PAR_SDRAM, mbar_readByte(MCF_GPIO_PAR_SDRAM)
-                       | MCF_GPIO_PAR_SDRAM_PAR_CSSDCS(0x01));
-
-       /*
-        * Check to see if the SDRAM has already been initialized
-        * by a run control tool
-        */
-       if (!(mbar_readLong(MCF_SDRAMC_DACR0) & MCF_SDRAMC_DACRn_RE)) {
-               /*
-                * Initialize DRAM Control Register: DCR
-                */
-               mbar_writeShort(MCF_SDRAMC_DCR, MCF_SDRAMC_DCR_RTIM(0x01)
-                               | MCF_SDRAMC_DCR_RC(0x30));
-
-               /*
-                * Initialize DACR0
-                */
-               mbar_writeLong(MCF_SDRAMC_DACR0,
-                               MCF_SDRAMC_DACRn_BA(CFG_SDRAM_BASE>>18)
-                               | MCF_SDRAMC_DACRn_CASL(0)
-                               | MCF_SDRAMC_DACRn_CBM(3)
-                               | MCF_SDRAMC_DACRn_PS(2));
-
-               /*
-                * Initialize DMR0
-                */
-               mbar_writeLong(MCF_SDRAMC_DMR0,
-                               MCF_SDRAMC_DMRn_BAM_8M
-                               | MCF_SDRAMC_DMRn_V);
-
-               /*
-                * Set IP bit in DACR
-                */
-               mbar_writeLong(MCF_SDRAMC_DACR0, mbar_readLong(MCF_SDRAMC_DACR0)
-                               | MCF_SDRAMC_DACRn_IP);
-
-               /*
-                * Wait at least 20ns to allow banks to precharge
-                */
-               for (i = 0; i < 5; i++)
-                       asm(" nop");
-
-               /*
-                * Write to this block to initiate precharge
-                */
-               *(u16 *)(CFG_SDRAM_BASE) = 0x9696;
-
-               /*
-                * Set RE bit in DACR
-                */
-               mbar_writeLong(MCF_SDRAMC_DACR0, mbar_readLong(MCF_SDRAMC_DACR0)
-                               | MCF_SDRAMC_DACRn_RE);
-
-
-               /*
-                * Wait for at least 8 auto refresh cycles to occur
-                */
-               for (i = 0; i < 2000; i++)
-                       asm(" nop");
-
-               /*
-                * Finish the configuration by issuing the MRS.
-                */
-               mbar_writeLong(MCF_SDRAMC_DACR0, mbar_readLong(MCF_SDRAMC_DACR0)
-                               | MCF_SDRAMC_DACRn_MRS);
-
-
-               /*
-                * Write to the SDRAM Mode Register
-                */
-               *(u16 *)(CFG_SDRAM_BASE + 0x1000) = 0x9696;
-       }
-
-       return CFG_SDRAM_SIZE * 1024 * 1024;
-};
-
-int testdram (void) {
-       /* TODO: XXX XXX XXX */
-       printf ("DRAM test not implemented!\n");
-
-       return (0);
-}
diff --git a/board/r7780mp/Makefile b/board/r7780mp/Makefile
new file mode 100644 (file)
index 0000000..554dca1
--- /dev/null
@@ -0,0 +1,44 @@
+#
+# Copyright (C) 2007,2008 Nobuhiro Iwamatsu
+#
+# board/r7780mp/Makefile
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the 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    = lib$(BOARD).a
+
+OBJS   := r7780mp.o
+SOBJS  := lowlevel_init.o
+
+$(LIB):        $(OBJS) $(SOBJS)
+       $(AR) crv $@ $(OBJS) $(SOBJS)
+
+clean:
+       rm -f $(SOBJS) $(OBJS)
+
+distclean:     clean
+       rm -f $(LIB) core *.bak .depend
+
+#########################################################################
+
+.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
+               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+
+-include .depend
+
+#########################################################################
diff --git a/board/r7780mp/config.mk b/board/r7780mp/config.mk
new file mode 100644 (file)
index 0000000..6a045a1
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# Copyright (C) 2007,2008 Nobuhiro Iwamatsu
+#
+# board/r77870mp/config.mk
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the 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
+
+#
+# TEXT_BASE refers to image _after_ relocation.
+#
+# NOTE: Must match value used in u-boot.lds (in this directory).
+#
+
+TEXT_BASE = 0x0FFC0000
diff --git a/board/r7780mp/lowlevel_init.S b/board/r7780mp/lowlevel_init.S
new file mode 100644 (file)
index 0000000..eb5d8b7
--- /dev/null
@@ -0,0 +1,428 @@
+/*
+ * Copyright (C) 2007,2008 Nobuhiro Iwamatsu
+ *
+ * u-boot/board/r7780mp/lowlevel_init.S
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the 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>
+#include <asm/processor.h>
+
+/*
+ *  Board specific low level init code, called _very_ early in the
+ *  startup sequence. Relocation to SDRAM has not happened yet, no
+ *  stack is available, bss section has not been initialised, etc.
+ *
+ *  (Note: As no stack is available, no subroutines can be called...).
+ */
+
+       .global lowlevel_init
+
+       .text
+       .align  2
+
+lowlevel_init:
+
+       mov.l   CCR_A, r1       /* Address of Cache Control Register */
+       mov.l   CCR_D, r0       /* Instruction Cache Invalidate */
+       mov.l   r0, @r1
+
+       mov.l   FRQCR_A, r1     /* Frequency control register */
+       mov.l   FRQCR_D, r0
+       mov.l   r0, @r1
+
+       /* pin_multi_setting */
+       mov.l   BBG_PMMR_A,r1
+       mov.l   BBG_PMMR_D_PMSR1,r0
+       mov.l   r0,@r1
+
+       mov.l   BBG_PMSR1_A,r1
+       mov.l   BBG_PMSR1_D,r0
+       mov.l   r0,@r1
+
+       mov.l   BBG_PMMR_A,r1
+       mov.l   BBG_PMMR_D_PMSR2,r0
+       mov.l   r0,@r1
+
+       mov.l   BBG_PMSR2_A,r1
+       mov.l   BBG_PMSR2_D,r0
+       mov.l   r0,@r1
+
+       mov.l   BBG_PMMR_A,r1
+       mov.l   BBG_PMMR_D_PMSR3,r0
+       mov.l   r0,@r1
+
+       mov.l   BBG_PMSR3_A,r1
+       mov.l   BBG_PMSR3_D,r0
+       mov.l   r0,@r1
+
+       mov.l   BBG_PMMR_A,r1
+       mov.l   BBG_PMMR_D_PMSR4,r0
+       mov.l   r0,@r1
+
+       mov.l   BBG_PMSR4_A,r1
+       mov.l   BBG_PMSR4_D,r0
+       mov.l   r0,@r1
+
+       mov.l   BBG_PMMR_A,r1
+       mov.l   BBG_PMMR_D_PMSRG,r0
+       mov.l   r0,@r1
+
+       mov.l   BBG_PMSRG_A,r1
+       mov.l   BBG_PMSRG_D,r0
+       mov.l   r0,@r1
+
+       /* cpg_setting */
+       mov.l   FRQCR_A,r1
+       mov.l   FRQCR_D,r0
+       mov.l   r0,@r1
+
+       mov.l   DLLCSR_A,r1
+       mov.l   DLLCSR_D,r0
+       mov.l   r0,@r1
+
+       nop
+       nop
+       nop
+       nop
+       nop
+       nop
+       nop
+       nop
+       nop
+       nop
+
+       /* wait 200us */
+       mov.l   REPEAT0_R3,r3
+       mov     #0,r2
+repeat0:
+       add     #1,r2
+       cmp/hs  r3,r2
+       bf      repeat0
+       nop
+
+       /* bsc_setting */
+       mov.l   MMSELR_A,r1
+       mov.l   MMSELR_D,r0
+       mov.l   r0,@r1
+
+       mov.l   BCR_A,r1
+       mov.l   BCR_D,r0
+       mov.l   r0,@r1
+
+       mov.l   CS0BCR_A,r1
+       mov.l   CS0BCR_D,r0
+       mov.l   r0,@r1
+
+       mov.l   CS1BCR_A,r1
+       mov.l   CS1BCR_D,r0
+       mov.l   r0,@r1
+
+       mov.l   CS2BCR_A,r1
+       mov.l   CS2BCR_D,r0
+       mov.l   r0,@r1
+
+       mov.l   CS4BCR_A,r1
+       mov.l   CS4BCR_D,r0
+       mov.l   r0,@r1
+
+       mov.l   CS5BCR_A,r1
+       mov.l   CS5BCR_D,r0
+       mov.l   r0,@r1
+
+       mov.l   CS6BCR_A,r1
+       mov.l   CS6BCR_D,r0
+       mov.l   r0,@r1
+
+       mov.l   CS0WCR_A,r1
+       mov.l   CS0WCR_D,r0
+       mov.l   r0,@r1
+
+       mov.l   CS1WCR_A,r1
+       mov.l   CS1WCR_D,r0
+       mov.l   r0,@r1
+
+       mov.l   CS2WCR_A,r1
+       mov.l   CS2WCR_D,r0
+       mov.l   r0,@r1
+
+       mov.l   CS4WCR_A,r1
+       mov.l   CS4WCR_D,r0
+       mov.l   r0,@r1
+
+       mov.l   CS5WCR_A,r1
+       mov.l   CS5WCR_D,r0
+       mov.l   r0,@r1
+
+       mov.l   CS6WCR_A,r1
+       mov.l   CS6WCR_D,r0
+       mov.l   r0,@r1
+
+       mov.l   CS5PCR_A,r1
+       mov.l   CS5PCR_D,r0
+       mov.l   r0,@r1
+
+       mov.l   CS6PCR_A,r1
+       mov.l   CS6PCR_D,r0
+       mov.l   r0,@r1
+
+       /* ddr_setting */
+       /* wait 200us */
+       mov.l   REPEAT0_R3,r3
+       mov     #0,r2
+repeat1:
+       add     #1,r2
+       cmp/hs  r3,r2
+       bf      repeat1
+       nop
+
+       mov.l   MIM_U_A,r0
+       mov.l   MIM_U_D,r1
+       synco
+       mov.l   r1,@r0
+       synco
+
+       mov.l   MIM_L_A,r0
+       mov.l   MIM_L_D0,r1
+       synco
+       mov.l   r1,@r0
+       synco
+
+       mov.l   STR_L_A,r0
+       mov.l   STR_L_D,r1
+       synco
+       mov.l   r1,@r0
+       synco
+
+       mov.l   SDR_L_A,r0
+       mov.l   SDR_L_D,r1
+       synco
+       mov.l   r1,@r0
+       synco
+
+       nop
+       nop
+       nop
+       nop
+
+       mov.l   SCR_L_A,r0
+       mov.l   SCR_L_D0,r1
+       synco
+       mov.l   r1,@r0
+       synco
+
+       mov.l   SCR_L_A,r0
+       mov.l   SCR_L_D1,r1
+       synco
+       mov.l   r1,@r0
+       synco
+
+       nop
+       nop
+       nop
+
+       mov.l   EMRS_A,r0
+       mov.l   EMRS_D,r1
+       synco
+       mov.l   r1,@r0
+       synco
+
+       nop
+       nop
+       nop
+
+       mov.l   MRS1_A,r0
+       mov.l   MRS1_D,r1
+       synco
+       mov.l   r1,@r0
+       synco
+
+       nop
+       nop
+       nop
+
+       mov.l   SCR_L_A,r0
+       mov.l   SCR_L_D2,r1
+       synco
+       mov.l   r1,@r0
+       synco
+
+       nop
+       nop
+       nop
+
+       mov.l   SCR_L_A,r0
+       mov.l   SCR_L_D3,r1
+       synco
+       mov.l   r1,@r0
+       synco
+
+       nop
+       nop
+       nop
+
+       mov.l   SCR_L_A,r0
+       mov.l   SCR_L_D4,r1
+       synco
+       mov.l   r1,@r0
+       synco
+
+       nop
+       nop
+       nop
+
+       mov.l   MRS2_A,r0
+       mov.l   MRS2_D,r1
+       synco
+       mov.l   r1,@r0
+       synco
+
+       nop
+       nop
+       nop
+
+       mov.l   SCR_L_A,r0
+       mov.l   SCR_L_D5,r1
+       synco
+       mov.l   r1,@r0
+       synco
+
+       /* wait 200us */
+       mov.l   REPEAT0_R1,r3
+       mov     #0,r2
+repeat2:
+       add     #1,r2
+       cmp/hs  r3,r2
+       bf      repeat2
+
+       synco
+
+       mov.l   MIM_L_A,r0
+       mov.l   MIM_L_D1,r1
+       synco
+       mov.l   r1,@r0
+       synco
+
+       rts
+       nop
+       .align  4
+
+RWTCSR_D_1:                            .word   0xA507
+RWTCSR_D_2:                            .word   0xA507
+RWTCNT_D:                              .word   0x5A00
+
+BBG_PMMR_A:                    .long   0xFF800010
+BBG_PMSR1_A:                   .long   0xFF800014
+BBG_PMSR2_A:                   .long   0xFF800018
+BBG_PMSR3_A:                   .long   0xFF80001C
+BBG_PMSR4_A:                   .long   0xFF800020
+BBG_PMSRG_A:                   .long   0xFF800024
+
+BBG_PMMR_D_PMSR1:       .long  0xffffbffd
+BBG_PMSR1_D:            .long  0x00004002
+BBG_PMMR_D_PMSR2:       .long  0xfc21a7ff
+BBG_PMSR2_D:            .long  0x03de5800
+BBG_PMMR_D_PMSR3:       .long  0xfffffff8
+BBG_PMSR3_D:            .long  0x00000007
+BBG_PMMR_D_PMSR4:       .long  0xdffdfff9
+BBG_PMSR4_D:            .long  0x20020006
+BBG_PMMR_D_PMSRG:       .long  0xffffffff
+BBG_PMSRG_D:            .long  0x00000000
+
+FRQCR_A:                               .long   FRQCR
+DLLCSR_A:                              .long   0xffc40010
+FRQCR_D:                               .long   0x40233035
+DLLCSR_D:                              .long   0x00000000
+
+/* for DDR-SDRAM */
+MIM_U_A:                               .long   MIM_1
+MIM_L_A:                               .long   MIM_2
+SCR_U_A:                               .long   SCR_1
+SCR_L_A:                               .long   SCR_2
+STR_U_A:                               .long   STR_1
+STR_L_A:                               .long   STR_2
+SDR_U_A:                               .long   SDR_1
+SDR_L_A:                               .long   SDR_2
+
+EMRS_A:                                        .long   0xFEC02000
+MRS1_A:                                        .long   0xFEC00B08
+MRS2_A:                                        .long   0xFEC00308
+
+MIM_U_D:                               .long   0x00004000
+MIM_L_D0:                              .long   0x03e80009
+MIM_L_D1:                              .long   0x03e80209
+SCR_L_D0:                              .long   0x3
+SCR_L_D1:                              .long   0x2
+SCR_L_D2:                              .long   0x2
+SCR_L_D3:                              .long   0x4
+SCR_L_D4:                              .long   0x4
+SCR_L_D5:                              .long   0x0
+STR_L_D:                               .long   0x000f0000
+SDR_L_D:                               .long   0x00000400
+EMRS_D:                                        .long   0x0
+MRS1_D:                                        .long   0x0
+MRS2_D:                                        .long   0x0
+
+/* Cache Controller */
+CCR_A:         .long   CCR
+MMUCR_A:       .long   MMUCR
+RWTCNT_A:      .long   WTCNT
+
+CCR_D:         .long   0x0000090b
+CCR_D_2:       .long   0x00000103
+MMUCR_D:       .long   0x00000004
+MSTPCR0_D:     .long   0x00001001
+MSTPCR2_D:     .long   0xffffffff
+
+/* local Bus State Controller */
+MMSELR_A:   .long   MMSELR
+BCR_A:      .long   BCR
+CS0BCR_A:   .long   CS0BCR
+CS1BCR_A:   .long   CS1BCR
+CS2BCR_A:   .long   CS2BCR
+CS4BCR_A:   .long   CS4BCR
+CS5BCR_A:   .long   CS5BCR
+CS6BCR_A:   .long   CS6BCR
+CS0WCR_A:   .long   CS0WCR
+CS1WCR_A:   .long   CS1WCR
+CS2WCR_A:   .long   CS2WCR
+CS4WCR_A:   .long   CS4WCR
+CS5WCR_A:   .long   CS5WCR
+CS6WCR_A:   .long   CS6WCR
+CS5PCR_A:   .long   CS5PCR
+CS6PCR_A:   .long   CS6PCR
+
+MMSELR_D:              .long   0xA5A50003
+BCR_D:                 .long   0x00000000
+CS0BCR_D:              .long   0x77777770
+CS1BCR_D:              .long   0x77777670
+CS2BCR_D:              .long   0x77777770
+CS4BCR_D:              .long   0x77777770
+CS5BCR_D:              .long   0x77777670
+CS6BCR_D:              .long   0x77777770
+CS0WCR_D:              .long   0x00020006
+CS1WCR_D:              .long   0x00232304
+CS2WCR_D:              .long   0x7777770F
+CS4WCR_D:              .long   0x7777770F
+CS5WCR_D:              .long   0x00101006
+CS6WCR_D:              .long   0x77777703
+CS5PCR_D:              .long   0x77000000
+CS6PCR_D:              .long   0x77000000
+
+REPEAT0_R3:    .long   0x00002000
+REPEAT0_R1:    .long   0x0000200
diff --git a/board/r7780mp/r7780mp.c b/board/r7780mp/r7780mp.c
new file mode 100644 (file)
index 0000000..1a37711
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2007,2008 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+ * Copyright (C) 2008 Yusuke Goda <goda.yusuke@renesas.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 <ide.h>
+#include <asm/processor.h>
+#include <asm/io.h>
+#include <asm/pci.h>
+#include "r7780mp.h"
+
+int checkboard(void)
+{
+#if defined(CONFIG_R7780MP)
+       puts("BOARD: Renesas Solutions R7780MP\n");
+#else
+       puts("BOARD: Renesas Solutions R7780RP\n");
+#endif
+       return 0;
+}
+
+int board_init(void)
+{
+       /* SCIF Enable */
+       *(vu_short*)PHCR = 0x0000;
+
+       return 0;
+}
+
+int dram_init (void)
+{
+       DECLARE_GLOBAL_DATA_PTR;
+
+       gd->bd->bi_memstart = CFG_SDRAM_BASE;
+       gd->bd->bi_memsize = CFG_SDRAM_SIZE;
+       printf("DRAM:  %dMB\n", CFG_SDRAM_SIZE / (1024 * 1024));
+       return 0;
+}
+
+void led_set_state (unsigned short value)
+{
+
+}
+
+void ide_set_reset (int idereset)
+{
+       /* if reset = 1 IDE reset will be asserted */
+       if (idereset){
+               (*(vu_short *)FPGA_CFCTL) = 0x432;
+#if defined(CONFIG_R7780MP)
+               (*(vu_short *)FPGA_CFPOW) |= 0x01;
+#else
+               (*(vu_short *)FPGA_CFPOW) |= 0x02;
+#endif
+               (*(vu_short *)FPGA_CFCDINTCLR) = 0x01;
+       }
+}
+
+#if defined(CONFIG_PCI)
+static struct pci_controller hose;
+void pci_init_board(void)
+{
+       pci_sh7780_init( &hose );
+}
+#endif
diff --git a/board/r7780mp/r7780mp.h b/board/r7780mp/r7780mp.h
new file mode 100644 (file)
index 0000000..476a413
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2007 Nobuhiro Iwamatsu
+ * Copyright (C) 2008 Yusuke Goda <goda.yusuke@renesas.com>
+ *
+ * u-boot/board/r7780mp/r7780mp.h
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * 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 _BOARD_R7780MP_R7780MP_H_
+#define _BOARD_R7780MP_R7780MP_H_
+
+/* R7780MP's FPGA register map */
+#define FPGA_BASE          0xa4000000
+#define FPGA_IRLMSK        (FPGA_BASE + 0x00)
+#define FPGA_IRLMON        (FPGA_BASE + 0x02)
+#define FPGA_IRLPRI1       (FPGA_BASE + 0x04)
+#define FPGA_IRLPRI2       (FPGA_BASE + 0x06)
+#define FPGA_IRLPRI3       (FPGA_BASE + 0x08)
+#define FPGA_IRLPRI4       (FPGA_BASE + 0x0A)
+#define FPGA_RSTCTL        (FPGA_BASE + 0x0C)
+#define FPGA_PCIBD         (FPGA_BASE + 0x0E)
+#define FPGA_PCICD         (FPGA_BASE + 0x10)
+#define FPGA_EXTGIO        (FPGA_BASE + 0x16)
+#define FPGA_IVDRMON       (FPGA_BASE + 0x18)
+#define FPGA_IVDRCR        (FPGA_BASE + 0x1A)
+#define FPGA_OBLED         (FPGA_BASE + 0x1C)
+#define FPGA_OBSW          (FPGA_BASE + 0x1E)
+#define FPGA_TPCTL         (FPGA_BASE + 0x100)
+#define FPGA_TPDCKCTL      (FPGA_BASE + 0x102)
+#define FPGA_TPCLR         (FPGA_BASE + 0x104)
+#define FPGA_TPXPOS        (FPGA_BASE + 0x106)
+#define FPGA_TPYPOS        (FPGA_BASE + 0x108)
+#define FPGA_DBSW          (FPGA_BASE + 0x200)
+#define FPGA_VERSION       (FPGA_BASE + 0x700)
+#define FPGA_CFCTL         (FPGA_BASE + 0x300)
+#define FPGA_CFPOW         (FPGA_BASE + 0x302)
+#define FPGA_CFCDINTCLR    (FPGA_BASE + 0x304)
+#define FPGA_PMR           (FPGA_BASE + 0x900)
+
+#endif /* _BOARD_R7780RP_R7780RP_H_ */
diff --git a/board/r7780mp/u-boot.lds b/board/r7780mp/u-boot.lds
new file mode 100644 (file)
index 0000000..e7499e5
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * Copyrigth (c) 2007,2008
+ * Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+ *
+ * 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-sh-linux", "elf32-sh-linux", "elf32-sh-linux")
+OUTPUT_ARCH(sh)
+ENTRY(_start)
+
+SECTIONS
+{
+       /*
+          Base address of internal SDRAM is 0x0C000000.
+          Although size of SDRAM can be either 16 or 32 MBytes,
+          we assume 16 MBytes (ie ignore upper half if the full
+          32 MBytes is present).
+
+          NOTE: This address must match with the definition of
+          TEXT_BASE in config.mk (in this directory).
+
+       */
+       . = 0x08000000 + (128*1024*1024) - (256*1024);
+
+       PROVIDE (reloc_dst = .);
+
+       PROVIDE (_ftext = .);
+       PROVIDE (_fcode = .);
+       PROVIDE (_start = .);
+
+       .text :
+       {
+               cpu/sh4/start.o         (.text)
+               . = ALIGN(8192);
+               common/environment.o    (.ppcenv)
+               . = ALIGN(8192);
+               common/environment.o    (.ppcenvr)
+               . = ALIGN(8192);
+               *(.text)
+               . = ALIGN(4);
+       } =0xFF
+       PROVIDE (_ecode = .);
+       .rodata :
+       {
+               *(.rodata)
+               . = ALIGN(4);
+       }
+       PROVIDE (_etext = .);
+
+
+       PROVIDE (_fdata = .);
+       .data :
+       {
+               *(.data)
+               . = ALIGN(4);
+       }
+       PROVIDE (_edata = .);
+
+       PROVIDE (_fgot = .);
+       .got :
+       {
+               *(.got)
+               . = ALIGN(4);
+       }
+       PROVIDE (_egot = .);
+
+       PROVIDE (__u_boot_cmd_start = .);
+       .u_boot_cmd :
+       {
+               *(.u_boot_cmd)
+               . = ALIGN(4);
+       }
+       PROVIDE (__u_boot_cmd_end = .);
+
+       PROVIDE (reloc_dst_end = .);
+       /* _reloc_dst_end = .; */
+
+       PROVIDE (bss_start = .);
+       PROVIDE (__bss_start = .);
+       .bss :
+       {
+               *(.bss)
+               . = ALIGN(4);
+       }
+       PROVIDE (bss_end = .);
+
+       PROVIDE (_end = .);
+}
index d207b80..8350eda 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 618a10c..dbea90c 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 894b9bd..5cedcb1 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 5bcb112..63dda1f 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 7776ec9..bc628d9 100644 (file)
@@ -23,7 +23,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index b934c89..a2352a3 100644 (file)
@@ -23,7 +23,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index c64c523..ebc44d9 100644 (file)
@@ -23,7 +23,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 914ff9c..8f4c6d7 100644 (file)
@@ -23,7 +23,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 642495a..a969673 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 8d6625e..6314005 100644 (file)
@@ -81,7 +81,7 @@ struct fsl_e_tlb_entry tlb_table[] = {
         * 0xe0000000   1M      CCSRBAR
         * 0xe2000000   16M     PCI1 IO
         */
-       SET_TLB_ENTRY(1, CFG_CCSRBAR, CFG_CCSRBAR,
+       SET_TLB_ENTRY(1, CFG_CCSRBAR, CFG_CCSRBAR_PHYS,
                      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
                      0, 4, BOOKE_PAGESZ_64M, 1),
 
index d701096..03f62b8 100644 (file)
@@ -21,7 +21,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 155ff64..d073399 100644 (file)
@@ -28,7 +28,7 @@
 
 struct fsl_e_tlb_entry tlb_table[] = {
 /* TLB for CCSRBAR (IMMR) */
-       SET_TLB_ENTRY(1, CFG_CCSRBAR, CFG_CCSRBAR,
+       SET_TLB_ENTRY(1, CFG_CCSRBAR, CFG_CCSRBAR_PHYS,
                      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
                      0, 1, BOOKE_PAGESZ_1M, 1),
 
index f3dbf26..4b31797 100644 (file)
@@ -25,7 +25,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index a61e862..24cf46c 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 7b86670..ee598c2 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 3b50272..d799f93 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index ce55b1c..6a1e718 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index f022ed6..ac0022e 100644 (file)
@@ -131,45 +131,44 @@ static int fpga_reset (fpga_t* fpga)
 static int fpga_load (fpga_t* fpga, ulong addr, int checkall)
 {
     volatile uchar *fpga_addr = (volatile uchar *)fpga->conf_base;
-    image_header_t hdr;
-    ulong len, checksum;
-    uchar *data = (uchar *)&hdr;
-    char *s, msg[32];
+    image_header_t *hdr = (image_header_t *)addr;
+    ulong len;
+    uchar *data;
+    char msg[32];
     int verify, i;
 
+#if defined(CONFIG_FIT)
+    if (genimg_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+       puts ("Non legacy image format not supported\n");
+       return -1;
+    }
+#endif
+
     /*
      * Check the image header and data of the net-list
      */
-    memcpy (&hdr, (char *)addr, sizeof(image_header_t));
-
-    if (hdr.ih_magic != IH_MAGIC) {
+    if (!image_check_magic (hdr)) {
        strcpy (msg, "Bad Image Magic Number");
        goto failure;
     }
 
-    len  = sizeof(image_header_t);
-
-    checksum = hdr.ih_hcrc;
-    hdr.ih_hcrc = 0;
-
-    if (crc32 (0, data, len) != checksum) {
+    if (!image_check_hcrc (hdr)) {
        strcpy (msg, "Bad Image Header CRC");
        goto failure;
     }
 
-    data = (uchar*)(addr + sizeof(image_header_t));
-    len  = hdr.ih_size;
+    data = (uchar*)image_get_data (hdr);
+    len  = image_get_data_size (hdr);
 
-    s = getenv ("verify");
-    verify = (s && (*s == 'n')) ? 0 : 1;
+    verify = getenv_yesno ("verify");
     if (verify) {
-       if (crc32 (0, data, len) != hdr.ih_dcrc) {
+       if (!image_check_dcrc (hdr)) {
            strcpy (msg, "Bad Image Data CRC");
            goto failure;
        }
     }
 
-    if (checkall && fpga_get_version(fpga, (char *)(hdr.ih_name)) < 0)
+    if (checkall && fpga_get_version(fpga, image_get_name (hdr)) < 0)
        return 1;
 
     /* align length */
@@ -184,7 +183,7 @@ static int fpga_load (fpga_t* fpga, ulong addr, int checkall)
        goto failure;
     }
 
-    printf ("(%s)... ", hdr.ih_name);
+    printf ("(%s)... ", image_get_name (hdr));
     /*
      * Copy data to FPGA
      */
@@ -341,7 +340,14 @@ int fpga_init (void)
        }
 
        hdr = (image_header_t *)addr;
-       if ((new_id = fpga_get_version(fpga, (char *)(hdr->ih_name))) == -1)
+#if defined(CONFIG_FIT)
+       if (genimg_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+          puts ("Non legacy image format not supported\n");
+          return -1;
+       }
+#endif
+
+       if ((new_id = fpga_get_version(fpga, image_get_name (hdr))) == -1)
            return 1;
 
        do_load = 1;
index 77bf818..9301571 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 828afbb..44bae70 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 6af5a5c..343c4d7 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index eb94279..ba6f388 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index eb94279..ba6f388 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index bb9fcab..7ab29ef 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 2338f10..16e2cd0 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 650572d..96c4e22 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 529f230..d410416 100644 (file)
@@ -87,7 +87,7 @@ struct fsl_e_tlb_entry tlb_table[] = {
         * 0xe000_0000  1M      CCSRBAR
         * 0xe200_0000  16M     PCI1 IO
         */
-       SET_TLB_ENTRY(1, CFG_CCSRBAR, CFG_CCSRBAR,
+       SET_TLB_ENTRY(1, CFG_CCSRBAR, CFG_CCSRBAR_PHYS,
                      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
                      0, 5, BOOKE_PAGESZ_64M, 1),
 
index 4a9a103..8c590b9 100644 (file)
@@ -27,7 +27,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 46b1440..86cbd11 100644 (file)
@@ -88,7 +88,7 @@ struct fsl_e_tlb_entry tlb_table[] = {
         * 0xe200_0000  16M     PCI1 IO
         * 0xe300_0000  16M     PCI2 IO
         */
-       SET_TLB_ENTRY(1, CFG_CCSRBAR, CFG_CCSRBAR,
+       SET_TLB_ENTRY(1, CFG_CCSRBAR, CFG_CCSRBAR_PHYS,
                      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
                      0, 5, BOOKE_PAGESZ_64M, 1),
 
index 99a8a8b..9381688 100644 (file)
@@ -27,7 +27,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 9584c33..ea39cd9 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 004e7fd..80bcbfc 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index b6c8601..35267dc 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 894b9bd..5cedcb1 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 61c2e9b..d08b422 100644 (file)
 #include <common.h>
 #include <command.h>
 #include <asm/addrspace.h>
-#include <asm/inca-ip.h>
 #include <asm/io.h>
+#include <asm/reboot.h>
 #include <pci.h>
 
+void _machine_restart(void)
+{
+       void (*f)(void) = (void *) 0xbfc00000;
+
+       f();
+}
+
 #if defined(CONFIG_PCI)
 static struct pci_controller hose;
 
index e67145e..f9891db 100644 (file)
@@ -316,6 +316,9 @@ void init_ide_reset (void)
        /* Configure PSC1_4 as GPIO output for ATA reset */
        *(vu_long *) MPC5XXX_WU_GPIO_ENABLE |= GPIO_PSC1_4;
        *(vu_long *) MPC5XXX_WU_GPIO_DIR    |= GPIO_PSC1_4;
+
+       /* by default the ATA reset is de-asserted */
+       *(vu_long *) MPC5XXX_WU_GPIO_DATA_O |=  GPIO_PSC1_4;
 #endif
 }
 
index a178cfe..ad26cae 100644 (file)
@@ -91,7 +91,7 @@ struct fsl_e_tlb_entry tlb_table[] = {
         * 0xe000_0000  1M      CCSRBAR
         * 0xe200_0000  16M     PCI1 IO
         */
-       SET_TLB_ENTRY(1, CFG_CCSRBAR, CFG_CCSRBAR,
+       SET_TLB_ENTRY(1, CFG_CCSRBAR, CFG_CCSRBAR_PHYS,
                      MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
                      0, 6, BOOKE_PAGESZ_64M, 1),
 
index 6c1f904..8cb551a 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index bb9fcab..7ab29ef 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index ddd4678..753411f 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 54d3645..46110cc 100644 (file)
@@ -209,21 +209,21 @@ int
 au_check_cksum_valid(int idx, long nbytes)
 {
        image_header_t *hdr;
-       unsigned long checksum;
 
        hdr = (image_header_t *)LOAD_ADDR;
+#if defined(CONFIG_FIT)
+       if (genimg_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+               puts ("Non legacy image format not supported\n");
+               return -1;
+       }
+#endif
 
-       if (nbytes != (sizeof(*hdr) + ntohl(hdr->ih_size)))
-       {
+       if (nbytes != image_get_image_size (hdr)) {
                printf ("Image %s bad total SIZE\n", aufile[idx]);
                return -1;
        }
        /* check the data CRC */
-       checksum = ntohl(hdr->ih_dcrc);
-
-       if (crc32 (0, (uchar *)(LOAD_ADDR + sizeof(*hdr)), ntohl(hdr->ih_size))
-               != checksum)
-       {
+       if (!image_check_dcrc (hdr)) {
                printf ("Image %s bad data checksum\n", aufile[idx]);
                return -1;
        }
@@ -238,54 +238,55 @@ au_check_header_valid(int idx, long nbytes)
        unsigned char buf[4];
 
        hdr = (image_header_t *)LOAD_ADDR;
+#if defined(CONFIG_FIT)
+       if (genimg_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+               puts ("Non legacy image format not supported\n");
+               return -1;
+       }
+#endif
+
        /* check the easy ones first */
 #undef CHECK_VALID_DEBUG
 #ifdef CHECK_VALID_DEBUG
-       printf("magic %#x %#x ", ntohl(hdr->ih_magic), IH_MAGIC);
-       printf("arch %#x %#x ", hdr->ih_arch, IH_CPU_ARM);
-       printf("size %#x %#lx ", ntohl(hdr->ih_size), nbytes);
-       printf("type %#x %#x ", hdr->ih_type, IH_TYPE_KERNEL);
+       printf("magic %#x %#x ", image_get_magic (hdr), IH_MAGIC);
+       printf("arch %#x %#x ", image_get_arch (hdr), IH_ARCH_ARM);
+       printf("size %#x %#lx ", image_get_data_size (hdr), nbytes);
+       printf("type %#x %#x ", image_get_type (hdr), IH_TYPE_KERNEL);
 #endif
-       if (nbytes < sizeof(*hdr))
-       {
+       if (nbytes < image_get_header_size ()) {
                printf ("Image %s bad header SIZE\n", aufile[idx]);
                return -1;
        }
-       if (ntohl(hdr->ih_magic) != IH_MAGIC || hdr->ih_arch != IH_CPU_ARM)
-       {
+       if (!image_check_magic (hdr) || !image_check_arch (hdr, IH_ARCH_ARM)) {
                printf ("Image %s bad MAGIC or ARCH\n", aufile[idx]);
                return -1;
        }
        /* check the hdr CRC */
-       checksum = ntohl(hdr->ih_hcrc);
-       hdr->ih_hcrc = 0;
-
-       if (crc32 (0, (uchar *)hdr, sizeof(*hdr)) != checksum) {
+       if (!image_check_hcrc (hdr)) {
                printf ("Image %s bad header checksum\n", aufile[idx]);
                return -1;
        }
-       hdr->ih_hcrc = htonl(checksum);
        /* check the type - could do this all in one gigantic if() */
-       if ((idx == IDX_FIRMWARE) && (hdr->ih_type != IH_TYPE_FIRMWARE)) {
+       if ((idx == IDX_FIRMWARE) &&
+               !image_check_type (hdr, IH_TYPE_FIRMWARE)) {
                printf ("Image %s wrong type\n", aufile[idx]);
                return -1;
        }
-       if ((idx == IDX_KERNEL) && (hdr->ih_type != IH_TYPE_KERNEL)) {
+       if ((idx == IDX_KERNEL) && !image_check_type (hdr, IH_TYPE_KERNEL)) {
                printf ("Image %s wrong type\n", aufile[idx]);
                return -1;
        }
-       if ((idx == IDX_DISK) && (hdr->ih_type != IH_TYPE_FILESYSTEM)) {
+       if ((idx == IDX_DISK) && !image_check_type (hdr, IH_TYPE_FILESYSTEM)) {
                printf ("Image %s wrong type\n", aufile[idx]);
                return -1;
        }
-       if ((idx == IDX_APP) && (hdr->ih_type != IH_TYPE_RAMDISK)
-           && (hdr->ih_type != IH_TYPE_FILESYSTEM)) {
+       if ((idx == IDX_APP) && !image_check_type (hdr, IH_TYPE_RAMDISK)
+               && !image_check_type (hdr, IH_TYPE_FILESYSTEM)) {
                printf ("Image %s wrong type\n", aufile[idx]);
                return -1;
        }
        if ((idx == IDX_PREPARE || idx == IDX_PREINST || idx == IDX_POSTINST)
-               && (hdr->ih_type != IH_TYPE_SCRIPT))
-       {
+               && !image_check_type (hdr, IH_TYPE_SCRIPT)) {
                printf ("Image %s wrong type\n", aufile[idx]);
                return -1;
        }
@@ -293,10 +294,10 @@ au_check_header_valid(int idx, long nbytes)
        if (idx == IDX_PREPARE)
                return 0;
        /* recycle checksum */
-       checksum = ntohl(hdr->ih_size);
+       checksum = image_get_data_size (hdr);
        /* for kernel and app the image header must also fit into flash */
        if ((idx != IDX_DISK) && (idx != IDX_FIRMWARE))
-               checksum += sizeof(*hdr);
+               checksum += image_get_header_size ();
        /* check the size does not exceed space in flash. HUSH scripts */
        /* all have ausize[] set to 0 */
        if ((ausize[idx] != 0) && (ausize[idx] < checksum)) {
@@ -310,10 +311,10 @@ au_check_header_valid(int idx, long nbytes)
        printf ("buf[0] %#x buf[1] %#x buf[2] %#x buf[3] %#x "
                "as int %#x time %#x\n",
                buf[0], buf[1], buf[2], buf[3],
-               *((unsigned int *)buf), ntohl(hdr->ih_time));
+               *((unsigned int *)buf), image_get_time (hdr));
 #endif
        /* check it */
-       if (*((unsigned int *)buf) >= ntohl(hdr->ih_time)) {
+       if (*((unsigned int *)buf) >= image_get_time (hdr)) {
                printf ("Image %s is too old\n", aufile[idx]);
                return -1;
        }
@@ -335,16 +336,22 @@ au_do_update(int idx, long sz)
        uint nbytes;
 
        hdr = (image_header_t *)LOAD_ADDR;
+#if defined(CONFIG_FIT)
+       if (genimg_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+               puts ("Non legacy image format not supported\n");
+               return -1;
+       }
+#endif
 
        /* disable the power switch */
        *CPLD_VFD_BK |= POWER_OFF;
 
        /* execute a script */
-       if (hdr->ih_type == IH_TYPE_SCRIPT) {
-               addr = (char *)((char *)hdr + sizeof(*hdr));
+       if (image_check_type (hdr, IH_TYPE_SCRIPT)) {
+               addr = (char *)((char *)hdr + image_get_header_size ());
                /* stick a NULL at the end of the script, otherwise */
                /* parse_string_outer() runs off the end. */
-               addr[ntohl(hdr->ih_size)] = 0;
+               addr[image_get_data_size (hdr)] = 0;
                addr += 8;
                parse_string_outer(addr, FLAG_PARSE_SEMICOLON);
                return 0;
@@ -372,19 +379,20 @@ au_do_update(int idx, long sz)
        flash_sect_erase(start, end);
        wait_ms(100);
        /* strip the header - except for the kernel and ramdisk */
-       if (hdr->ih_type == IH_TYPE_KERNEL || hdr->ih_type == IH_TYPE_RAMDISK) {
+       if (image_check_type (hdr, IH_TYPE_KERNEL) ||
+                       image_check_type (hdr, IH_TYPE_RAMDISK)) {
                addr = (char *)hdr;
-               off = sizeof(*hdr);
-               nbytes = sizeof(*hdr) + ntohl(hdr->ih_size);
+               off = image_get_header_size ();
+               nbytes = image_get_image_size (hdr);
        } else {
-               addr = (char *)((char *)hdr + sizeof(*hdr));
+               addr = (char *)((char *)hdr + image_get_header_size ());
 #ifdef AU_UPDATE_TEST
                /* copy it to where Linux goes */
                if (idx == IDX_FIRMWARE)
                        start = aufl_layout[1].start;
 #endif
                off = 0;
-               nbytes = ntohl(hdr->ih_size);
+               nbytes = image_get_data_size (hdr);
        }
 
        /* copy the data from RAM to FLASH */
@@ -396,7 +404,8 @@ au_do_update(int idx, long sz)
        }
 
        /* check the dcrc of the copy */
-       if (crc32 (0, (uchar *)(start + off), ntohl(hdr->ih_size)) != ntohl(hdr->ih_dcrc)) {
+       if (crc32 (0, (uchar *)(start + off), image_get_data_size (hdr)) !=
+           image_get_dcrc (hdr)) {
                printf ("Image %s Bad Data Checksum After COPY\n", aufile[idx]);
                return -1;
        }
@@ -423,17 +432,24 @@ au_update_eeprom(int idx)
        }
 
        hdr = (image_header_t *)LOAD_ADDR;
+#if defined(CONFIG_FIT)
+       if (genimg_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+               puts ("Non legacy image format not supported\n");
+               return -1;
+       }
+#endif
+
        /* write the time field into EEPROM */
        off = auee_off[idx].time;
-       val = ntohl(hdr->ih_time);
+       val = image_get_time (hdr);
        i2c_write_multiple(0x54, off, 1, &val, sizeof(val));
        /* write the size field into EEPROM */
        off = auee_off[idx].size;
-       val = ntohl(hdr->ih_size);
+       val = image_get_data_size (hdr);
        i2c_write_multiple(0x54, off, 1, &val, sizeof(val));
        /* write the dcrc field into EEPROM */
        off = auee_off[idx].dcrc;
-       val = ntohl(hdr->ih_dcrc);
+       val = image_get_dcrc (hdr);
        i2c_write_multiple(0x54, off, 1, &val, sizeof(val));
        /* enable the power switch */
        *CPLD_VFD_BK &= ~POWER_OFF;
@@ -577,10 +593,10 @@ do_auto_update(void)
        /* just loop thru all the possible files */
        for (i = 0; i < AU_MAXFILES; i++) {
                /* just read the header */
-               sz = file_fat_read(aufile[i], LOAD_ADDR, sizeof(image_header_t));
+               sz = file_fat_read(aufile[i], LOAD_ADDR, image_get_header_size ());
                debug ("read %s sz %ld hdr %d\n",
-                       aufile[i], sz, sizeof(image_header_t));
-               if (sz <= 0 || sz < sizeof(image_header_t)) {
+                       aufile[i], sz, image_get_header_size ());
+               if (sz <= 0 || sz < image_get_header_size ()) {
                        debug ("%s not found\n", aufile[i]);
                        continue;
                }
@@ -590,8 +606,8 @@ do_auto_update(void)
                }
                sz = file_fat_read(aufile[i], LOAD_ADDR, MAX_LOADSZ);
                debug ("read %s sz %ld hdr %d\n",
-                       aufile[i], sz, sizeof(image_header_t));
-               if (sz <= 0 || sz <= sizeof(image_header_t)) {
+                       aufile[i], sz, image_get_header_size ());
+               if (sz <= 0 || sz <= image_get_header_size ()) {
                        debug ("%s not found\n", aufile[i]);
                        continue;
                }
index 3bf25f3..2554abc 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index d9bb868..5aede10 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index e68ac01..8253a25 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index a9c0536..c88bfd1 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index a0c72c9..834d68d 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 7b86670..ee598c2 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 87f228b..452c6c0 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 521078c..815d81d 100644 (file)
@@ -23,7 +23,6 @@
 
 OUTPUT_ARCH(powerpc)
 ENTRY(_start)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 1608f8c..88dcaf9 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 9ab5633..ee9b6d5 100644 (file)
 #
 
 include $(TOPDIR)/config.mk
-ifneq ($(OBJTREE),$(SRCTREE))
-$(shell mkdir -p $(obj)../common)
-$(shell mkdir -p $(obj)../xilinx_enet)
-endif
-
-INCS           := -I../common -I../xilinx_enet
-CFLAGS         += $(INCS)
-HOST_CFLAGS    += $(INCS)
 
 LIB    = $(obj)lib$(BOARD).a
 
-COBJS  = $(BOARD).o \
-         ../xilinx_enet/emac_adapter.o  ../xilinx_enet/xemac.o \
-         ../xilinx_enet/xemac_options.o ../xilinx_enet/xemac_polled.o \
-         ../xilinx_enet/xemac_intr.o ../xilinx_enet/xemac_g.o \
-         ../xilinx_enet/xemac_intr_dma.o ../common/xipif_v1_23_b.o \
-         ../common/xbasic_types.o ../common/xdma_channel.o \
-         ../common/xdma_channel_sg.o ../common/xpacket_fifo_v1_00_b.o \
-         ../common/xversion.o \
+COBJS  = $(BOARD).o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
index 1a116ea..d805061 100644 (file)
@@ -41,8 +41,8 @@
 #define XILINX_TIMER_IRQ       0
 
 /* Uart pheriphery is RS232_Uart */
-#define XILINX_UART_BASEADDR   0x40600000
-#define XILINX_UART_BAUDRATE   115200
+#define XILINX_UARTLITE_BASEADDR       0x40600000
+#define XILINX_UARTLITE_BAUDRATE       115200
 
 /* IIC pheriphery is IIC_EEPROM */
 #define XILINX_IIC_0_BASEADDR  0x40800000
 #define XILINX_SYSACE_MEM_WIDTH        16
 
 /* Ethernet controller is Ethernet_MAC */
-#define XPAR_XEMAC_NUM_INSTANCES       1
-#define XPAR_OPB_ETHERNET_0_DEVICE_ID  0
-#define XPAR_OPB_ETHERNET_0_BASEADDR   0x40c00000
-#define XPAR_OPB_ETHERNET_0_HIGHADDR   0x40c0ffff
-#define XPAR_OPB_ETHERNET_0_DMA_PRESENT        1
-#define XPAR_OPB_ETHERNET_0_ERR_COUNT_EXIST    1
-#define XPAR_OPB_ETHERNET_0_MII_EXIST  1
+#define XILINX_EMACLITE_BASEADDR       0x40C00000
index 9ab5633..ee9b6d5 100644 (file)
 #
 
 include $(TOPDIR)/config.mk
-ifneq ($(OBJTREE),$(SRCTREE))
-$(shell mkdir -p $(obj)../common)
-$(shell mkdir -p $(obj)../xilinx_enet)
-endif
-
-INCS           := -I../common -I../xilinx_enet
-CFLAGS         += $(INCS)
-HOST_CFLAGS    += $(INCS)
 
 LIB    = $(obj)lib$(BOARD).a
 
-COBJS  = $(BOARD).o \
-         ../xilinx_enet/emac_adapter.o  ../xilinx_enet/xemac.o \
-         ../xilinx_enet/xemac_options.o ../xilinx_enet/xemac_polled.o \
-         ../xilinx_enet/xemac_intr.o ../xilinx_enet/xemac_g.o \
-         ../xilinx_enet/xemac_intr_dma.o ../common/xipif_v1_23_b.o \
-         ../common/xbasic_types.o ../common/xdma_channel.o \
-         ../common/xdma_channel_sg.o ../common/xpacket_fifo_v1_00_b.o \
-         ../common/xversion.o \
+COBJS  = $(BOARD).o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
index a96c693..9e5ebda 100644 (file)
@@ -37,8 +37,8 @@
 #define XILINX_TIMER_IRQ       1
 
 /* Uart pheriphery is RS232_Uart_1 */
-#define XILINX_UART_BASEADDR   0x40600000
-#define XILINX_UART_BAUDRATE   115200
+#define XILINX_UARTLITE_BASEADDR       0x40600000
+#define XILINX_UARTLITE_BAUDRATE       115200
 
 /* GPIO is LEDs_4Bit*/
 #define XILINX_GPIO_BASEADDR   0x40000000
 #define XILINX_SYSACE_MEM_WIDTH        16
 
 /* Ethernet controller is Ethernet_MAC */
-#define XPAR_XEMAC_NUM_INSTANCES       1
-#define XPAR_OPB_ETHERNET_0_DEVICE_ID  0
-#define XPAR_OPB_ETHERNET_0_BASEADDR   0x40c00000
-#define XPAR_OPB_ETHERNET_0_HIGHADDR   0x40c0ffff
-#define XPAR_OPB_ETHERNET_0_DMA_PRESENT        1
-#define XPAR_OPB_ETHERNET_0_ERR_COUNT_EXIST    1
-#define XPAR_OPB_ETHERNET_0_MII_EXIST  1
+#define XILINX_EMACLITE_BASEADDR       0x40C00000
index 6df5dfc..044511b 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 6631793..e0e20ca 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 195d91b..670c943 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index a88d1ef..9678799 100644 (file)
@@ -32,14 +32,19 @@ COBJS-y += ACEX1K.o
 COBJS-y += altera.o
 COBJS-y += bedbug.o
 COBJS-y += circbuf.o
+COBJS-$(CONFIG_CMD_AMBAPP) += cmd_ambapp.o
 COBJS-y += cmd_autoscript.o
 COBJS-$(CONFIG_CMD_BDI) += cmd_bdinfo.o
 COBJS-$(CONFIG_CMD_BEDBUG) += cmd_bedbug.o
 COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o
+COBJS-y += image.o
+COBJS-y += gunzip.o
 COBJS-y += cmd_boot.o
+COBJS-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o
 COBJS-y += cmd_bootm.o
 COBJS-$(CONFIG_CMD_CACHE) += cmd_cache.o
 COBJS-$(CONFIG_CMD_CONSOLE) += cmd_console.o
+COBJS-$(CONFIG_CMD_CPLBINFO) += cmd_cplbinfo.o
 COBJS-$(CONFIG_CMD_DATE) += cmd_date.o
 ifdef CONFIG_4xx
 COBJS-$(CONFIG_CMD_SETGETDCR) += cmd_dcr.o
@@ -84,17 +89,20 @@ COBJS-y += cmd_pcmcia.o
 COBJS-$(CONFIG_CMD_PORTIO) += cmd_portio.o
 COBJS-$(CONFIG_CMD_REGINFO) += cmd_reginfo.o
 COBJS-$(CONFIG_CMD_REISER) += cmd_reiser.o
-COBJS-y += cmd_sata.o
+COBJS-$(CONFIG_CMD_SATA) += cmd_sata.o
 COBJS-$(CONFIG_CMD_SCSI) += cmd_scsi.o
+COBJS-$(CONFIG_CMD_SETEXPR) += cmd_setexpr.o
 COBJS-$(CONFIG_CMD_SPI) += cmd_spi.o
 COBJS-$(CONFIG_CMD_STRINGS) += cmd_strings.o
 COBJS-$(CONFIG_CMD_TERMINAL) += cmd_terminal.o
 COBJS-$(CONFIG_CMD_UNIVERSE) += cmd_universe.o
 COBJS-$(CONFIG_CMD_USB) += cmd_usb.o
+COBJS-$(CONFIG_CMD_XIMG) += cmd_ximg.o
 COBJS-y += cmd_vfd.o
 COBJS-y += command.o
 COBJS-y += console.o
 COBJS-y += cyclon2.o
+COBJS-y += stratixII.o
 COBJS-y += devices.o
 COBJS-y += dlmalloc.o
 COBJS-y += docecc.o
@@ -134,6 +142,7 @@ COBJS-y += crc16.o
 COBJS-y += xyzModem.o
 COBJS-y += cmd_mac.o
 COBJS-$(CONFIG_CMD_MFSL) += cmd_mfsl.o
+COBJS-$(CONFIG_MP) += cmd_mp.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(AOBJS:.o=.S) $(COBJS:.o=.c)
index 0df7bae..a2b5967 100644 (file)
@@ -30,6 +30,7 @@
  */
 #include <common.h>
 #include <ACEX1K.h>
+#include <stratixII.h>
 
 /* Define FPGA_DEBUG to get debug printf's */
 /* #define FPGA_DEBUG */
@@ -43,7 +44,7 @@
 #if defined(CONFIG_FPGA) && defined(CONFIG_FPGA_ALTERA)
 
 /* Local Static Functions */
-static int altera_validate (Altera_desc * desc, char *fn);
+static int altera_validate (Altera_desc * desc, const char *fn);
 
 /* ------------------------------------------------------------------------- */
 int altera_load( Altera_desc *desc, void *buf, size_t bsize )
@@ -60,7 +61,7 @@ int altera_load( Altera_desc *desc, void *buf, size_t bsize )
                        PRINTF ("%s: Launching the ACEX1K Loader...\n",
                                        __FUNCTION__);
                        ret_val = ACEX1K_load (desc, buf, bsize);
-#elif defined CONFIG_FPGA_CYCLON2
+#elif defined(CONFIG_FPGA_CYCLON2)
                        PRINTF ("%s: Launching the CYCLON II Loader...\n",
                                        __FUNCTION__);
                        ret_val = CYC2_load (desc, buf, bsize);
@@ -70,6 +71,13 @@ int altera_load( Altera_desc *desc, void *buf, size_t bsize )
 #endif
                        break;
 
+#if defined(CONFIG_FPGA_STRATIX_II)
+               case Altera_StratixII:
+                       PRINTF ("%s: Launching the Stratix II Loader...\n",
+                               __FUNCTION__);
+                       ret_val = StratixII_load (desc, buf, bsize);
+                       break;
+#endif
                default:
                        printf ("%s: Unsupported family type, %d\n",
                                        __FUNCTION__, desc->family);
@@ -98,6 +106,13 @@ int altera_dump( Altera_desc *desc, void *buf, size_t bsize )
 #endif
                        break;
 
+#if defined(CONFIG_FPGA_STRATIX_II)
+               case Altera_StratixII:
+                       PRINTF ("%s: Launching the Stratix II Reader...\n",
+                               __FUNCTION__);
+                       ret_val = StratixII_dump (desc, buf, bsize);
+                       break;
+#endif
                default:
                        printf ("%s: Unsupported family type, %d\n",
                                        __FUNCTION__, desc->family);
@@ -117,10 +132,13 @@ int altera_info( Altera_desc *desc )
                case Altera_ACEX1K:
                        printf ("ACEX1K\n");
                        break;
-                       /* Add new family types here */
                case Altera_CYC2:
                        printf ("CYCLON II\n");
                        break;
+               case Altera_StratixII:
+                       printf ("Stratix II\n");
+                       break;
+                       /* Add new family types here */
                default:
                        printf ("Unknown family type, %d\n", desc->family);
                }
@@ -142,6 +160,13 @@ int altera_info( Altera_desc *desc )
                case altera_jtag_mode:          /* Not used */
                        printf ("JTAG Mode\n");
                        break;
+               case fast_passive_parallel:
+                       printf ("Fast Passive Parallel (FPP)\n");
+                       break;
+               case fast_passive_parallel_security:
+                       printf
+                           ("Fast Passive Parallel with Security (FPPS) \n");
+                       break;
                        /* Add new interface types here */
                default:
                        printf ("Unsupported interface type, %d\n", desc->iface);
@@ -166,6 +191,11 @@ int altera_info( Altera_desc *desc )
                                                __FUNCTION__);
 #endif
                                break;
+#if defined(CONFIG_FPGA_STRATIX_II)
+                       case Altera_StratixII:
+                               StratixII_info (desc);
+                               break;
+#endif
                                /* Add new family types here */
                        default:
                                /* we don't need a message here - we give one up above */
@@ -199,6 +229,11 @@ int altera_reloc( Altera_desc *desc, ulong reloc_offset)
                                        __FUNCTION__);
 #endif
                        break;
+#if defined(CONFIG_FPGA_STRATIX_II)
+               case Altera_StratixII:
+                       ret_val = StratixII_reloc (desc, reloc_offset);
+                       break;
+#endif
                case Altera_CYC2:
 #if defined(CONFIG_FPGA_CYCLON2)
                        ret_val = CYC2_reloc (desc, reloc_offset);
@@ -219,7 +254,7 @@ int altera_reloc( Altera_desc *desc, ulong reloc_offset)
 
 /* ------------------------------------------------------------------------- */
 
-static int altera_validate (Altera_desc * desc, char *fn)
+static int altera_validate (Altera_desc * desc, const char *fn)
 {
        int ret_val = FALSE;
 
diff --git a/common/cmd_ambapp.c b/common/cmd_ambapp.c
new file mode 100644 (file)
index 0000000..43427bb
--- /dev/null
@@ -0,0 +1,278 @@
+/*
+ * (C) Copyright 2007
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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
+ */
+
+/*
+ * AMBA Plug&Play information list command
+ *
+ */
+#include <common.h>
+#include <command.h>
+#include <ambapp.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/* We put these variables into .data section so that they are zero
+ * when entering the AMBA Plug & Play routines (in cpu/cpu/ambapp.c)
+ * the first time. BSS is not garantueed to be zero since BSS
+ * hasn't been cleared the first times entering the CPU AMBA functions.
+ *
+ * The AMBA PnP routines call these functions if ambapp_???_print is set.
+ *
+ */
+int ambapp_apb_print __attribute__ ((section(".data"))) = 0;
+int ambapp_ahb_print __attribute__ ((section(".data"))) = 0;
+
+typedef struct {
+       int device_id;
+       char *name;
+} ambapp_device_name;
+
+static ambapp_device_name gaisler_devices[] = {
+       {GAISLER_LEON3, "GAISLER_LEON3"},
+       {GAISLER_LEON3DSU, "GAISLER_LEON3DSU"},
+       {GAISLER_ETHAHB, "GAISLER_ETHAHB"},
+       {GAISLER_ETHMAC, "GAISLER_ETHMAC"},
+       {GAISLER_APBMST, "GAISLER_APBMST"},
+       {GAISLER_AHBUART, "GAISLER_AHBUART"},
+       {GAISLER_SRCTRL, "GAISLER_SRCTRL"},
+       {GAISLER_SDCTRL, "GAISLER_SDCTRL"},
+       {GAISLER_APBUART, "GAISLER_APBUART"},
+       {GAISLER_IRQMP, "GAISLER_IRQMP"},
+       {GAISLER_AHBRAM, "GAISLER_AHBRAM"},
+       {GAISLER_GPTIMER, "GAISLER_GPTIMER"},
+       {GAISLER_PCITRG, "GAISLER_PCITRG"},
+       {GAISLER_PCISBRG, "GAISLER_PCISBRG"},
+       {GAISLER_PCIFBRG, "GAISLER_PCIFBRG"},
+       {GAISLER_PCITRACE, "GAISLER_PCITRACE"},
+       {GAISLER_AHBTRACE, "GAISLER_AHBTRACE"},
+       {GAISLER_ETHDSU, "GAISLER_ETHDSU"},
+       {GAISLER_PIOPORT, "GAISLER_PIOPORT"},
+       {GAISLER_AHBJTAG, "GAISLER_AHBJTAG"},
+       {GAISLER_ATACTRL, "GAISLER_ATACTRL"},
+       {GAISLER_VGA, "GAISLER_VGA"},
+       {GAISLER_KBD, "GAISLER_KBD"},
+       {GAISLER_L2TIME, "GAISLER_L2TIME"},
+       {GAISLER_L2C, "GAISLER_L2C"},
+       {GAISLER_PLUGPLAY, "GAISLER_PLUGPLAY"},
+       {GAISLER_SPW, "GAISLER_SPW"},
+       {GAISLER_SPW2, "GAISLER_SPW2"},
+       {GAISLER_EHCI, "GAISLER_EHCI"},
+       {GAISLER_UHCI, "GAISLER_UHCI"},
+       {GAISLER_AHBSTAT, "GAISLER_AHBSTAT"},
+       {GAISLER_DDR2SPA, "GAISLER_DDR2SPA"},
+       {GAISLER_DDRSPA, "GAISLER_DDRSPA"},
+       {0, NULL}
+};
+
+static ambapp_device_name esa_devices[] = {
+       {ESA_LEON2, "ESA_LEON2"},
+       {ESA_MCTRL, "ESA_MCTRL"},
+       {0, NULL}
+};
+
+static ambapp_device_name opencores_devices[] = {
+       {OPENCORES_PCIBR, "OPENCORES_PCIBR"},
+       {OPENCORES_ETHMAC, "OPENCORES_ETHMAC"},
+       {0, NULL}
+};
+
+typedef struct {
+       unsigned int vendor_id;
+       char *name;
+       ambapp_device_name *devices;
+} ambapp_vendor_devnames;
+
+static ambapp_vendor_devnames vendors[] = {
+       {VENDOR_GAISLER, "VENDOR_GAISLER", gaisler_devices},
+       {VENDOR_ESA, "VENDOR_ESA", esa_devices},
+       {VENDOR_OPENCORES, "VENDOR_OPENCORES", opencores_devices},
+       {0, NULL, 0}
+};
+
+static char *ambapp_get_devname(ambapp_device_name * devs, int id)
+{
+       if (!devs)
+               return NULL;
+
+       while (devs->device_id > 0) {
+               if (devs->device_id == id)
+                       return devs->name;
+               devs++;
+       }
+       return NULL;
+}
+
+char *ambapp_device_id2str(int vendor, int id)
+{
+       ambapp_vendor_devnames *ven = &vendors[0];
+
+       while (ven->vendor_id > 0) {
+               if (ven->vendor_id == vendor) {
+                       return ambapp_get_devname(ven->devices, id);
+               }
+               ven++;
+       }
+       return NULL;
+}
+
+char *ambapp_vendor_id2str(int vendor)
+{
+       ambapp_vendor_devnames *ven = &vendors[0];
+
+       while (ven->vendor_id > 0) {
+               if (ven->vendor_id == vendor) {
+                       return ven->name;
+               }
+               ven++;
+       }
+       return NULL;
+}
+
+static char *unknown = "unknown";
+
+/* Print one APB device */
+void ambapp_print_apb(apbctrl_pp_dev * apb, ambapp_ahbdev * apbmst, int index)
+{
+       char *dev_str, *ven_str;
+       int irq, ver, vendor, deviceid;
+       unsigned int address, apbmst_base, mask;
+
+       vendor = amba_vendor(apb->conf);
+       deviceid = amba_device(apb->conf);
+       irq = amba_irq(apb->conf);
+       ver = amba_ver(apb->conf);
+       apbmst_base = apbmst->address[0] & LEON3_IO_AREA;
+       address = (apbmst_base | (((apb->bar & 0xfff00000) >> 12))) &
+           (((apb->bar & 0x0000fff0) << 4) | 0xfff00000);
+
+       mask = amba_membar_mask(apb->bar) << 8;
+       mask = ((~mask) & 0x000fffff) + 1;
+
+       ven_str = ambapp_vendor_id2str(vendor);
+       if (!ven_str) {
+               ven_str = unknown;
+               dev_str = unknown;
+       } else {
+               dev_str = ambapp_device_id2str(vendor, deviceid);
+               if (!dev_str)
+                       dev_str = unknown;
+       }
+
+       printf("0x%02x:0x%02x:0x%02x: %s  %s\n"
+              "   apb: 0x%08x - 0x%08x\n"
+              "   irq: %-2d (ver: %-2d)\n",
+              index, vendor, deviceid, ven_str, dev_str, address,
+              address + mask, irq, ver);
+}
+
+void ambapp_print_ahb(ahbctrl_pp_dev * ahb, int index)
+{
+       char *dev_str, *ven_str;
+       int irq, ver, vendor, deviceid;
+       unsigned int addr, mask;
+       int j;
+
+       vendor = amba_vendor(ahb->conf);
+       deviceid = amba_device(ahb->conf);
+       irq = amba_irq(ahb->conf);
+       ver = amba_ver(ahb->conf);
+
+       ven_str = ambapp_vendor_id2str(vendor);
+       if (!ven_str) {
+               ven_str = unknown;
+               dev_str = unknown;
+       } else {
+               dev_str = ambapp_device_id2str(vendor, deviceid);
+               if (!dev_str)
+                       dev_str = unknown;
+       }
+
+       printf("0x%02x:0x%02x:0x%02x: %s  %s\n",
+              index, vendor, deviceid, ven_str, dev_str);
+
+       for (j = 0; j < 4; j++) {
+               addr = amba_membar_start(ahb->bars[j]);
+               if (amba_membar_type(ahb->bars[j]) == 0)
+                       continue;
+               if (amba_membar_type(ahb->bars[j]) == AMBA_TYPE_AHBIO)
+                       addr = AMBA_TYPE_AHBIO_ADDR(addr);
+               mask = amba_membar_mask(ahb->bars[j]) << 20;
+               printf("   mem: 0x%08x - 0x%08x\n", addr, addr + ((~mask) + 1));
+       }
+
+       printf("   irq: %-2d (ver: %d)\n", irq, ver);
+}
+
+int do_ambapp_print(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+{
+
+       /* Print AHB Masters */
+       puts("--------- AHB Masters ---------\n");
+       ambapp_apb_print = 0;
+       ambapp_ahb_print = 1;
+       ambapp_ahbmst_count(99, 99);    /* Get vendor&device 99 = nonexistent... */
+
+       /* Print AHB Slaves */
+       puts("--------- AHB Slaves  ---------\n");
+       ambapp_ahbslv_count(99, 99);    /* Get vendor&device 99 = nonexistent... */
+
+       /* Print APB Slaves */
+       puts("--------- APB Slaves  ---------\n");
+       ambapp_apb_print = 1;
+       ambapp_ahb_print = 0;
+       ambapp_apb_count(99, 99);       /* Get vendor&device 99 = nonexistent... */
+
+       /* Reset, no futher printing */
+       ambapp_apb_print = 0;
+       ambapp_ahb_print = 0;
+       puts("\n");
+       return 0;
+}
+
+int ambapp_init_reloc(void)
+{
+       ambapp_vendor_devnames *vend = vendors;
+       ambapp_device_name *dev;
+
+       while (vend->vendor_id && vend->name) {
+               vend->name = (char *)((unsigned int)vend->name + gd->reloc_off);
+               vend->devices =
+                   (ambapp_device_name *) ((unsigned int)vend->devices +
+                                           gd->reloc_off);;
+               dev = vend->devices;
+               vend++;
+               if (!dev)
+                       continue;
+               while (dev->device_id && dev->name) {
+                       dev->name =
+                           (char *)((unsigned int)dev->name + gd->reloc_off);;
+                       dev++;
+               }
+       }
+       return 0;
+}
+
+U_BOOT_CMD(ambapp, 1, 1, do_ambapp_print,
+          "ambapp  - list AMBA Plug&Play information\n",
+          "ambapp\n"
+          "    - lists AMBA (AHB & APB) Plug&Play devices present on the system\n");
index a6038a6..932f638 100644 (file)
 
 #if defined(CONFIG_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT)
 
-extern image_header_t header;          /* from cmd_bootm.c */
 int
-autoscript (ulong addr)
+autoscript (ulong addr, const char *fit_uname)
 {
-       ulong crc, data, len;
-       image_header_t *hdr = &header;
-       ulong *len_ptr;
-       char *cmd;
-       int rcode = 0;
-       int verify;
+       ulong           len;
+       image_header_t  *hdr;
+       ulong           *data;
+       char            *cmd;
+       int             rcode = 0;
+       int             verify;
+#if defined(CONFIG_FIT)
+       const void*     fit_hdr;
+       int             noffset;
+       const void      *fit_data;
+       size_t          fit_len;
+#endif
 
-       cmd = getenv ("verify");
-       verify = (cmd && (*cmd == 'n')) ? 0 : 1;
+       verify = getenv_yesno ("verify");
 
+       switch (genimg_get_format ((void *)addr)) {
+       case IMAGE_FORMAT_LEGACY:
+               hdr = (image_header_t *)addr;
 
-       memmove (hdr, (char *)addr, sizeof(image_header_t));
+               if (!image_check_magic (hdr)) {
+                       puts ("Bad magic number\n");
+                       return 1;
+               }
 
-       if (ntohl(hdr->ih_magic) != IH_MAGIC) {
-               puts ("Bad magic number\n");
-               return 1;
-       }
+               if (!image_check_hcrc (hdr)) {
+                       puts ("Bad header crc\n");
+                       return 1;
+               }
 
-       crc = ntohl(hdr->ih_hcrc);
-       hdr->ih_hcrc = 0;
-       len = sizeof (image_header_t);
-       data = (ulong)hdr;
-       if (crc32(0, (uchar *)data, len) != crc) {
-               puts ("Bad header crc\n");
-               return 1;
-       }
+               if (verify) {
+                       if (!image_check_dcrc (hdr)) {
+                               puts ("Bad data crc\n");
+                               return 1;
+                       }
+               }
 
-       data = addr + sizeof(image_header_t);
-       len = ntohl(hdr->ih_size);
+               if (!image_check_type (hdr, IH_TYPE_SCRIPT)) {
+                       puts ("Bad image type\n");
+                       return 1;
+               }
+
+               /* get length of script */
+               data = (ulong *)image_get_data (hdr);
 
-       if (verify) {
-               if (crc32(0, (uchar *)data, len) != ntohl(hdr->ih_dcrc)) {
-                       puts ("Bad data crc\n");
+               if ((len = uimage_to_cpu (*data)) == 0) {
+                       puts ("Empty Script\n");
                        return 1;
                }
-       }
 
-       if (hdr->ih_type != IH_TYPE_SCRIPT) {
-               puts ("Bad image type\n");
-               return 1;
-       }
+               /*
+                * scripts are just multi-image files with one component, seek
+                * past the zero-terminated sequence of image lengths to get
+                * to the actual image data
+                */
+               while (*data++);
+               break;
+#if defined(CONFIG_FIT)
+       case IMAGE_FORMAT_FIT:
+               if (fit_uname == NULL) {
+                       puts ("No FIT subimage unit name\n");
+                       return 1;
+               }
 
-       /* get length of script */
-       len_ptr = (ulong *)data;
+               fit_hdr = (const void *)addr;
+               if (!fit_check_format (fit_hdr)) {
+                       puts ("Bad FIT image format\n");
+                       return 1;
+               }
+
+               /* get script component image node offset */
+               noffset = fit_image_get_node (fit_hdr, fit_uname);
+               if (noffset < 0) {
+                       printf ("Can't find '%s' FIT subimage\n", fit_uname);
+                       return 1;
+               }
+
+               if (!fit_image_check_type (fit_hdr, noffset, IH_TYPE_SCRIPT)) {
+                       puts ("Not a image image\n");
+                       return 1;
+               }
+
+               /* verify integrity */
+               if (verify) {
+                       if (!fit_image_check_hashes (fit_hdr, noffset)) {
+                               puts ("Bad Data Hash\n");
+                               return 1;
+                       }
+               }
 
-       if ((len = ntohl(*len_ptr)) == 0) {
-               puts ("Empty Script\n");
+               /* get script subimage data address and length */
+               if (fit_image_get_data (fit_hdr, noffset, &fit_data, &fit_len)) {
+                       puts ("Could not find script subimage data\n");
+                       return 1;
+               }
+
+               data = (ulong *)fit_data;
+               len = (ulong)fit_len;
+               break;
+#endif
+       default:
+               puts ("Wrong image format for autoscript\n");
                return 1;
        }
 
@@ -109,10 +162,8 @@ autoscript (ulong addr)
                return 1;
        }
 
-       while (*len_ptr++);
-
        /* make sure cmd is null terminated */
-       memmove (cmd, (char *)len_ptr, len);
+       memmove (cmd, (char *)data, len);
        *(cmd + len) = 0;
 
 #ifdef CFG_HUSH_PARSER /*?? */
@@ -158,25 +209,35 @@ do_autoscript (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        ulong addr;
        int rcode;
+       const char *fit_uname = NULL;
 
+       /* Find script image */
        if (argc < 2) {
                addr = CFG_LOAD_ADDR;
+               debug ("*  autoscr: default load address = 0x%08lx\n", addr);
+#if defined(CONFIG_FIT)
+       } else if (fit_parse_subimage (argv[1], load_addr, &addr, &fit_uname)) {
+               debug ("*  autoscr: subimage '%s' from FIT image at 0x%08lx\n",
+                               fit_uname, addr);
+#endif
        } else {
-               addr = simple_strtoul (argv[1],0,16);
+               addr = simple_strtoul(argv[1], NULL, 16);
+               debug ("*  autoscr: cmdline image address = 0x%08lx\n", addr);
        }
 
-       printf ("## Executing script at %08lx\n",addr);
-       rcode = autoscript (addr);
+       printf ("## Executing script at %08lx\n", addr);
+       rcode = autoscript (addr, fit_uname);
        return rcode;
 }
 
-#if defined(CONFIG_CMD_AUTOSCRIPT)
 U_BOOT_CMD(
        autoscr, 2, 0,  do_autoscript,
        "autoscr - run script from memory\n",
        "[addr] - run script starting at addr"
        " - A valid autoscr header must be present\n"
-);
+#if defined(CONFIG_FIT)
+       "For FIT format uImage addr must include subimage\n"
+       "unit name in the form of addr:<subimg_uname>\n"
 #endif
-
+);
 #endif
index bbb0192..731c1d2 100644 (file)
@@ -208,6 +208,45 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        return 0;
 }
 
+#elif defined(CONFIG_SPARC)    /* SPARC */
+int do_bdinfo(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+{
+       bd_t *bd = gd->bd;
+#if defined(CONFIG_CMD_NET)
+       int i;
+#endif
+
+#ifdef DEBUG
+       print_num("bd address             ", (ulong) bd);
+#endif
+       print_num("memstart               ", bd->bi_memstart);
+       print_num("memsize                ", bd->bi_memsize);
+       print_num("flashstart             ", bd->bi_flashstart);
+       print_num("CFG_MONITOR_BASE       ", CFG_MONITOR_BASE);
+       print_num("CFG_ENV_ADDR           ", CFG_ENV_ADDR);
+       printf("CFG_RELOC_MONITOR_BASE = 0x%lx (%d)\n", CFG_RELOC_MONITOR_BASE,
+              CFG_MONITOR_LEN);
+       printf("CFG_MALLOC_BASE        = 0x%lx (%d)\n", CFG_MALLOC_BASE,
+              CFG_MALLOC_LEN);
+       printf("CFG_INIT_SP_OFFSET     = 0x%lx (%d)\n", CFG_INIT_SP_OFFSET,
+              CFG_STACK_SIZE);
+       printf("CFG_PROM_OFFSET        = 0x%lx (%d)\n", CFG_PROM_OFFSET,
+              CFG_PROM_SIZE);
+       printf("CFG_GBL_DATA_OFFSET    = 0x%lx (%d)\n", CFG_GBL_DATA_OFFSET,
+              CFG_GBL_DATA_SIZE);
+
+#if defined(CONFIG_CMD_NET)
+       puts("ethaddr                =");
+       for (i = 0; i < 6; ++i) {
+               printf("%c%02X", i ? ':' : ' ', bd->bi_enetaddr[i]);
+       }
+       puts("\nIP addr                = ");
+       print_IPaddr(bd->bi_ip_addr);
+#endif
+       printf("\nbaudrate               = %6ld bps\n", bd->bi_baudrate);
+       return 0;
+}
+
 #elif defined(CONFIG_M68K) /* M68K */
 static void print_str(const char *, const char *);
 
index e68f16f..d83f5af 100644 (file)
 #include <command.h>
 #include <net.h>
 
-#if defined(CONFIG_I386)
-DECLARE_GLOBAL_DATA_PTR;
-#endif
+/* Allow ports to override the default behavior */
+__attribute__((weak))
+unsigned long do_go_exec (ulong (*entry)(int, char *[]), int argc, char *argv[])
+{
+       return entry (argc, argv);
+}
 
 int do_go (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
@@ -50,21 +53,7 @@ int do_go (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
         * pass address parameter as argv[0] (aka command name),
         * and all remaining args
         */
-#if defined(CONFIG_I386)
-       /*
-        * x86 does not use a dedicated register to pass the pointer
-        * to the global_data
-        */
-       argv[0] = (char *)gd;
-#endif
-#if !defined(CONFIG_NIOS)
-       rc = ((ulong (*)(int, char *[]))addr) (--argc, &argv[1]);
-#else
-       /*
-        * Nios function pointers are address >> 1
-        */
-       rc = ((ulong (*)(int, char *[]))(addr>>1)) (--argc, &argv[1]);
-#endif
+       rc = do_go_exec ((void *)addr, argc - 1, argv + 1);
        if (rc != 0) rcode = 1;
 
        printf ("## Application terminated, rc = 0x%lX\n", rc);
diff --git a/common/cmd_bootldr.c b/common/cmd_bootldr.c
new file mode 100644 (file)
index 0000000..e6474aa
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * U-boot - bootldr.c
+ *
+ * Copyright (c) 2005-2008 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>
+
+/*
+ * the bootldr command loads an address, checks to see if there
+ *   is a Boot stream that the on-chip BOOTROM can understand,
+ *   and loads it via the BOOTROM Callback. It is possible
+ *   to also add booting from SPI, or TWI, but this function does
+ *   not currently support that.
+ */
+
+int do_bootldr(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+       void *addr;
+       uint32_t *data;
+
+       /* Get the address */
+       if (argc < 2)
+               addr = (void *)load_addr;
+       else
+               addr = (void *)simple_strtoul(argv[1], NULL, 16);
+
+       /* Check if it is a LDR file */
+       data = addr;
+#if defined(__ADSPBF54x__) || defined(__ADSPBF52x__)
+       if ((*data & 0xFF000000) == 0xAD000000 && data[2] == 0x00000000) {
+#else
+       if (*data == 0xFF800060 || *data == 0xFF800040 || *data == 0xFF800020) {
+#endif
+               /* We want to boot from FLASH or SDRAM */
+               printf("## Booting ldr image at 0x%p ...\n", addr);
+
+               icache_disable();
+               dcache_disable();
+
+               __asm__(
+                       "jump (%1);"
+                       :
+                       : "q7" (addr), "a" (_BOOTROM_MEMBOOT));
+       } else
+               printf("## No ldr image at address 0x%p\n", addr);
+
+       return 0;
+}
+
+U_BOOT_CMD(bootldr, 2, 0, do_bootldr,
+       "bootldr - boot ldr image from memory\n",
+       "[addr]\n"
+       "    - boot ldr image stored in memory\n");
index 9deb781..44f6b9f 100644 (file)
@@ -21,6 +21,7 @@
  * MA 02111-1307 USA
  */
 
+
 /*
  * Boot support
  */
 #include <zlib.h>
 #include <bzlib.h>
 #include <environment.h>
+#include <lmb.h>
 #include <asm/byteorder.h>
 
-#if defined(CONFIG_OF_LIBFDT)
-#include <fdt.h>
-#include <libfdt.h>
-#include <fdt_support.h>
-#endif
-#if defined(CONFIG_OF_FLAT_TREE)
-#include <ft_build.h>
-#endif
-
-DECLARE_GLOBAL_DATA_PTR;
-
-/*cmd_boot.c*/
-extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
-
-#if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE)
-#include <rtc.h>
-#endif
-
 #ifdef CFG_HUSH_PARSER
 #include <hush.h>
 #endif
 
-#ifdef CFG_INIT_RAM_LOCK
-#include <asm/cache.h>
-#endif
-
-#ifdef CONFIG_LOGBUFFER
-#include <logbuff.h>
-#endif
+DECLARE_GLOBAL_DATA_PTR;
 
-#ifdef CONFIG_HAS_DATAFLASH
-#include <dataflash.h>
+extern int gunzip (void *dst, int dstlen, unsigned char *src, unsigned long *lenp);
+#ifndef CFG_BOOTM_LEN
+#define CFG_BOOTM_LEN  0x800000        /* use 8MByte as default max gunzip size */
 #endif
 
-/*
- * Some systems (for example LWMON) have very short watchdog periods;
- * we must make sure to split long operations like memmove() or
- * crc32() into reasonable chunks.
- */
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
-# define CHUNKSZ (64 * 1024)
+#ifdef CONFIG_BZIP2
+extern void bz_internal_error(int);
 #endif
 
-int  gunzip (void *, int, unsigned char *, unsigned long *);
-
-static void *zalloc(void *, unsigned, unsigned);
-static void zfree(void *, void *, unsigned);
-
 #if defined(CONFIG_CMD_IMI)
 static int image_info (unsigned long addr);
 #endif
@@ -92,12 +61,19 @@ extern flash_info_t flash_info[]; /* info for FLASH chips */
 static int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 #endif
 
-static void print_type (image_header_t *hdr);
+#ifdef CONFIG_SILENT_CONSOLE
+static void fixup_silent_linux (void);
+#endif
 
-#ifdef __I386__
-image_header_t *fake_header(image_header_t *hdr, void *ptr, int size);
+static image_header_t *image_get_kernel (ulong img_addr, int verify);
+#if defined(CONFIG_FIT)
+static int fit_check_kernel (const void *fit, int os_noffset, int verify);
 #endif
 
+static void *boot_get_kernel (cmd_tbl_t *cmdtp, int flag,int argc, char *argv[],
+               bootm_headers_t *images, ulong *os_data, ulong *os_len);
+extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+
 /*
  *  Continue booting an OS image; caller already has:
  *  - copied image header to global variable `header'
@@ -106,203 +82,134 @@ image_header_t *fake_header(image_header_t *hdr, void *ptr, int size);
  *  - loaded (first part of) image to header load address,
  *  - disabled interrupts.
  */
-typedef void boot_os_Fcn (cmd_tbl_t *cmdtp, int flag,
-                         int   argc, char *argv[],
-                         ulong addr,           /* of image to boot */
-                         ulong *len_ptr,       /* multi-file image length table */
-                         int   verify);        /* getenv("verify")[0] != 'n' */
-
-#ifdef DEBUG
-extern int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
-#endif
-
-#ifdef CONFIG_PPC
-static boot_os_Fcn do_bootm_linux;
-#else
-extern boot_os_Fcn do_bootm_linux;
+typedef void boot_os_fn (cmd_tbl_t *cmdtp, int flag,
+                       int argc, char *argv[],
+                       bootm_headers_t *images); /* pointers to os/initrd/fdt */
+
+extern boot_os_fn do_bootm_linux;
+static boot_os_fn do_bootm_netbsd;
+#if defined(CONFIG_LYNXKDI)
+static boot_os_fn do_bootm_lynxkdi;
+extern void lynxkdi_boot (image_header_t *);
 #endif
-#ifdef CONFIG_SILENT_CONSOLE
-static void fixup_silent_linux (void);
-#endif
-static boot_os_Fcn do_bootm_netbsd;
-static boot_os_Fcn do_bootm_rtems;
+static boot_os_fn do_bootm_rtems;
 #if defined(CONFIG_CMD_ELF)
-static boot_os_Fcn do_bootm_vxworks;
-static boot_os_Fcn do_bootm_qnxelf;
-int do_bootvx ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[] );
-int do_bootelf (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[] );
+static boot_os_fn do_bootm_vxworks;
+static boot_os_fn do_bootm_qnxelf;
+int do_bootvx (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+int do_bootelf (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 #endif
 #if defined(CONFIG_ARTOS) && defined(CONFIG_PPC)
-static boot_os_Fcn do_bootm_artos;
-#endif
-#ifdef CONFIG_LYNXKDI
-static boot_os_Fcn do_bootm_lynxkdi;
-extern void lynxkdi_boot( image_header_t * );
+static boot_os_fn do_bootm_artos;
 #endif
 
-#ifndef CFG_BOOTM_LEN
-#define CFG_BOOTM_LEN  0x800000        /* use 8MByte as default max gunzip size */
-#endif
+ulong load_addr = CFG_LOAD_ADDR;       /* Default Load Address */
+static bootm_headers_t images;         /* pointers to os/initrd/fdt images */
 
-image_header_t header;
+void __board_lmb_reserve(struct lmb *lmb)
+{
+       /* please define platform specific board_lmb_reserve() */
+}
+void board_lmb_reserve(struct lmb *lmb) __attribute__((weak, alias("__board_lmb_reserve")));
 
-ulong load_addr = CFG_LOAD_ADDR;               /* Default Load Address */
 
+/*******************************************************************/
+/* bootm - boot application image from image in memory */
+/*******************************************************************/
 int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
-       ulong   iflag;
-       ulong   addr;
-       ulong   data, len, checksum;
-       ulong  *len_ptr;
-       uint    unc_len = CFG_BOOTM_LEN;
-       int     i, verify;
-       char    *name, *s;
-       int     (*appl)(int, char *[]);
-       image_header_t *hdr = &header;
+       ulong           iflag;
+       const char      *type_name;
+       uint            unc_len = CFG_BOOTM_LEN;
+       uint8_t         comp, type, os;
 
-       s = getenv ("verify");
-       verify = (s && (*s == 'n')) ? 0 : 1;
+       void            *os_hdr;
+       ulong           os_data, os_len;
+       ulong           image_start, image_end;
+       ulong           load_start, load_end;
+       ulong           mem_start, mem_size;
 
-       if (argc < 2) {
-               addr = load_addr;
-       } else {
-               addr = simple_strtoul(argv[1], NULL, 16);
-       }
+       struct lmb lmb;
 
-       show_boot_progress (1);
-       printf ("## Booting image at %08lx ...\n", addr);
+       memset ((void *)&images, 0, sizeof (images));
+       images.verify = getenv_yesno ("verify");
+       images.autostart = getenv_yesno ("autostart");
+       images.lmb = &lmb;
 
-       /* Copy header so we can blank CRC field for re-calculation */
-#ifdef CONFIG_HAS_DATAFLASH
-       if (addr_dataflash(addr)){
-               read_dataflash(addr, sizeof(image_header_t), (char *)&header);
-       } else
-#endif
-       memmove (&header, (char *)addr, sizeof(image_header_t));
-
-       if (ntohl(hdr->ih_magic) != IH_MAGIC) {
-#ifdef __I386__        /* correct image format not implemented yet - fake it */
-               if (fake_header(hdr, (void*)addr, -1) != NULL) {
-                       /* to compensate for the addition below */
-                       addr -= sizeof(image_header_t);
-                       /* turnof verify,
-                        * fake_header() does not fake the data crc
-                        */
-                       verify = 0;
-               } else
-#endif /* __I386__ */
-           {
-               puts ("Bad Magic Number\n");
-               show_boot_progress (-1);
-               return 1;
-           }
-       }
-       show_boot_progress (2);
+       lmb_init(&lmb);
 
-       data = (ulong)&header;
-       len  = sizeof(image_header_t);
+       mem_start = getenv_bootm_low();
+       mem_size = getenv_bootm_size();
 
-       checksum = ntohl(hdr->ih_hcrc);
-       hdr->ih_hcrc = 0;
+       lmb_add(&lmb, mem_start, mem_size);
 
-       if (crc32 (0, (uchar *)data, len) != checksum) {
-               puts ("Bad Header Checksum\n");
-               show_boot_progress (-2);
-               return 1;
-       }
-       show_boot_progress (3);
+       board_lmb_reserve(&lmb);
 
-#ifdef CONFIG_HAS_DATAFLASH
-       if (addr_dataflash(addr)){
-               len  = ntohl(hdr->ih_size) + sizeof(image_header_t);
-               read_dataflash(addr, len, (char *)CFG_LOAD_ADDR);
-               addr = CFG_LOAD_ADDR;
+       /* get kernel image header, start address and length */
+       os_hdr = boot_get_kernel (cmdtp, flag, argc, argv,
+                       &images, &os_data, &os_len);
+       if (os_len == 0) {
+               puts ("ERROR: can't get kernel image!\n");
+               return 1;
        }
-#endif
 
+       /* get image parameters */
+       switch (genimg_get_format (os_hdr)) {
+       case IMAGE_FORMAT_LEGACY:
+               type = image_get_type (os_hdr);
+               comp = image_get_comp (os_hdr);
+               os = image_get_os (os_hdr);
 
-       /* for multi-file images we need the data part, too */
-       print_image_hdr ((image_header_t *)addr);
+               image_end = image_get_image_end (os_hdr);
+               load_start = image_get_load (os_hdr);
+               break;
+#if defined(CONFIG_FIT)
+       case IMAGE_FORMAT_FIT:
+               if (fit_image_get_type (images.fit_hdr_os,
+                                       images.fit_noffset_os, &type)) {
+                       puts ("Can't get image type!\n");
+                       show_boot_progress (-109);
+                       return 1;
+               }
 
-       data = addr + sizeof(image_header_t);
-       len  = ntohl(hdr->ih_size);
+               if (fit_image_get_comp (images.fit_hdr_os,
+                                       images.fit_noffset_os, &comp)) {
+                       puts ("Can't get image compression!\n");
+                       show_boot_progress (-110);
+                       return 1;
+               }
 
-       if (verify) {
-               puts ("   Verifying Checksum ... ");
-               if (crc32 (0, (uchar *)data, len) != ntohl(hdr->ih_dcrc)) {
-                       printf ("Bad Data CRC\n");
-                       show_boot_progress (-3);
+               if (fit_image_get_os (images.fit_hdr_os,
+                                       images.fit_noffset_os, &os)) {
+                       puts ("Can't get image OS!\n");
+                       show_boot_progress (-111);
                        return 1;
                }
-               puts ("OK\n");
-       }
-       show_boot_progress (4);
 
-       len_ptr = (ulong *)data;
-
-#if defined(__ARM__)
-       if (hdr->ih_arch != IH_CPU_ARM)
-#elif defined(__avr32__)
-       if (hdr->ih_arch != IH_CPU_AVR32)
-#elif defined(__bfin__)
-       if (hdr->ih_arch != IH_CPU_BLACKFIN)
-#elif defined(__I386__)
-       if (hdr->ih_arch != IH_CPU_I386)
-#elif defined(__M68K__)
-       if (hdr->ih_arch != IH_CPU_M68K)
-#elif defined(__microblaze__)
-       if (hdr->ih_arch != IH_CPU_MICROBLAZE)
-#elif defined(__mips__)
-       if (hdr->ih_arch != IH_CPU_MIPS)
-#elif defined(__nios__)
-       if (hdr->ih_arch != IH_CPU_NIOS)
-#elif defined(__nios2__)
-       if (hdr->ih_arch != IH_CPU_NIOS2)
-#elif defined(__PPC__)
-       if (hdr->ih_arch != IH_CPU_PPC)
-#elif defined(__sh__)
-       if (hdr->ih_arch != IH_CPU_SH)
-#else
-# error Unknown CPU type
-#endif
-       {
-               printf ("Unsupported Architecture 0x%x\n", hdr->ih_arch);
-               show_boot_progress (-4);
-               return 1;
-       }
-       show_boot_progress (5);
-
-       switch (hdr->ih_type) {
-       case IH_TYPE_STANDALONE:
-               name = "Standalone Application";
-               /* A second argument overwrites the load address */
-               if (argc > 2) {
-                       hdr->ih_load = htonl(simple_strtoul(argv[2], NULL, 16));
+               image_end = fit_get_end (images.fit_hdr_os);
+
+               if (fit_image_get_load (images.fit_hdr_os, images.fit_noffset_os,
+                                       &load_start)) {
+                       puts ("Can't get image load address!\n");
+                       show_boot_progress (-112);
+                       return 1;
                }
                break;
-       case IH_TYPE_KERNEL:
-               name = "Kernel Image";
-               break;
-       case IH_TYPE_MULTI:
-               name = "Multi-File Image";
-               len  = ntohl(len_ptr[0]);
-               /* OS kernel is always the first image */
-               data += 8; /* kernel_len + terminator */
-               for (i=1; len_ptr[i]; ++i)
-                       data += 4;
-               break;
-       default: printf ("Wrong Image Type for %s command\n", cmdtp->name);
-               show_boot_progress (-5);
+#endif
+       default:
+               puts ("ERROR: unknown image format type!\n");
                return 1;
        }
-       show_boot_progress (6);
+
+       image_start = (ulong)os_hdr;
+       load_end = 0;
+       type_name = genimg_get_type_name (type);
 
        /*
         * We have reached the point of no return: we are going to
         * overwrite all exception vector code, so we cannot easily
         * recover from any failures any more...
         */
-
        iflag = disable_interrupts();
 
 #ifdef CONFIG_AMIGAONEG3SE
@@ -316,138 +223,120 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        dcache_disable();
 #endif
 
-       switch (hdr->ih_comp) {
+       switch (comp) {
        case IH_COMP_NONE:
-               if(ntohl(hdr->ih_load) == addr) {
-                       printf ("   XIP %s ... ", name);
+               if (load_start == (ulong)os_hdr) {
+                       printf ("   XIP %s ... ", type_name);
                } else {
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
-                       size_t l = len;
-                       void *to = (void *)ntohl(hdr->ih_load);
-                       void *from = (void *)data;
-
-                       printf ("   Loading %s ... ", name);
-
-                       while (l > 0) {
-                               size_t tail = (l > CHUNKSZ) ? CHUNKSZ : l;
-                               WATCHDOG_RESET();
-                               memmove (to, from, tail);
-                               to += tail;
-                               from += tail;
-                               l -= tail;
-                       }
-#else  /* !(CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG) */
-                       memmove ((void *) ntohl(hdr->ih_load), (uchar *)data, len);
-#endif /* CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG */
+                       printf ("   Loading %s ... ", type_name);
+
+                       memmove_wd ((void *)load_start,
+                                  (void *)os_data, os_len, CHUNKSZ);
+
+                       load_end = load_start + os_len;
+                       puts("OK\n");
                }
                break;
        case IH_COMP_GZIP:
-               printf ("   Uncompressing %s ... ", name);
-               if (gunzip ((void *)ntohl(hdr->ih_load), unc_len,
-                           (uchar *)data, &len) != 0) {
-                       puts ("GUNZIP ERROR - must RESET board to recover\n");
+               printf ("   Uncompressing %s ... ", type_name);
+               if (gunzip ((void *)load_start, unc_len,
+                                       (uchar *)os_data, &os_len) != 0) {
+                       puts ("GUNZIP: uncompress or overwrite error "
+                               "- must RESET board to recover\n");
                        show_boot_progress (-6);
                        do_reset (cmdtp, flag, argc, argv);
                }
+
+               load_end = load_start + os_len;
                break;
 #ifdef CONFIG_BZIP2
        case IH_COMP_BZIP2:
-               printf ("   Uncompressing %s ... ", name);
+               printf ("   Uncompressing %s ... ", type_name);
                /*
                 * If we've got less than 4 MB of malloc() space,
                 * use slower decompression algorithm which requires
                 * at most 2300 KB of memory.
                 */
-               i = BZ2_bzBuffToBuffDecompress ((char*)ntohl(hdr->ih_load),
-                                               &unc_len, (char *)data, len,
-                                               CFG_MALLOC_LEN < (4096 * 1024), 0);
+               int i = BZ2_bzBuffToBuffDecompress ((char*)load_start,
+                                       &unc_len, (char *)os_data, os_len,
+                                       CFG_MALLOC_LEN < (4096 * 1024), 0);
                if (i != BZ_OK) {
-                       printf ("BUNZIP2 ERROR %d - must RESET board to recover\n", i);
+                       printf ("BUNZIP2: uncompress or overwrite error %d "
+                               "- must RESET board to recover\n", i);
                        show_boot_progress (-6);
                        do_reset (cmdtp, flag, argc, argv);
                }
+
+               load_end = load_start + unc_len;
                break;
 #endif /* CONFIG_BZIP2 */
        default:
                if (iflag)
                        enable_interrupts();
-               printf ("Unimplemented compression type %d\n", hdr->ih_comp);
+               printf ("Unimplemented compression type %d\n", comp);
                show_boot_progress (-7);
                return 1;
        }
        puts ("OK\n");
+       debug ("   kernel loaded at 0x%08lx, end = 0x%08lx\n", load_start, load_end);
        show_boot_progress (7);
 
-       switch (hdr->ih_type) {
-       case IH_TYPE_STANDALONE:
-               if (iflag)
-                       enable_interrupts();
+       if ((load_start < image_end) && (load_end > image_start)) {
+               debug ("image_start = 0x%lX, image_end = 0x%lx\n", image_start, image_end);
+               debug ("load_start = 0x%lx, load_end = 0x%lx\n", load_start, load_end);
 
-               /* load (and uncompress), but don't start if "autostart"
-                * is set to "no"
-                */
-               if (((s = getenv("autostart")) != NULL) && (strcmp(s,"no") == 0)) {
-                       char buf[32];
-                       sprintf(buf, "%lX", len);
-                       setenv("filesize", buf);
-                       return 0;
+               if (images.legacy_hdr_valid) {
+                       if (image_get_type (&images.legacy_hdr_os_copy) == IH_TYPE_MULTI)
+                               puts ("WARNING: legacy format multi component "
+                                       "image overwritten\n");
+               } else {
+                       puts ("ERROR: new format image overwritten - "
+                               "must RESET the board to recover\n");
+                       show_boot_progress (-113);
+                       do_reset (cmdtp, flag, argc, argv);
                }
-               appl = (int (*)(int, char *[]))ntohl(hdr->ih_ep);
-               (*appl)(argc-1, &argv[1]);
-               return 0;
-       case IH_TYPE_KERNEL:
-       case IH_TYPE_MULTI:
-               /* handled below */
-               break;
-       default:
-               if (iflag)
-                       enable_interrupts();
-               printf ("Can't boot image type %d\n", hdr->ih_type);
-               show_boot_progress (-8);
-               return 1;
        }
+
        show_boot_progress (8);
 
-       switch (hdr->ih_os) {
+       lmb_reserve(&lmb, load_start, (load_end - load_start));
+
+       switch (os) {
        default:                        /* handled by (original) Linux case */
        case IH_OS_LINUX:
 #ifdef CONFIG_SILENT_CONSOLE
            fixup_silent_linux();
 #endif
-           do_bootm_linux  (cmdtp, flag, argc, argv,
-                            addr, len_ptr, verify);
+           do_bootm_linux (cmdtp, flag, argc, argv, &images);
            break;
+
        case IH_OS_NETBSD:
-           do_bootm_netbsd (cmdtp, flag, argc, argv,
-                            addr, len_ptr, verify);
+           do_bootm_netbsd (cmdtp, flag, argc, argv, &images);
            break;
 
 #ifdef CONFIG_LYNXKDI
        case IH_OS_LYNXOS:
-           do_bootm_lynxkdi (cmdtp, flag, argc, argv,
-                            addr, len_ptr, verify);
+           do_bootm_lynxkdi (cmdtp, flag, argc, argv, &images);
            break;
 #endif
 
        case IH_OS_RTEMS:
-           do_bootm_rtems (cmdtp, flag, argc, argv,
-                            addr, len_ptr, verify);
+           do_bootm_rtems (cmdtp, flag, argc, argv, &images);
            break;
 
 #if defined(CONFIG_CMD_ELF)
        case IH_OS_VXWORKS:
-           do_bootm_vxworks (cmdtp, flag, argc, argv,
-                             addr, len_ptr, verify);
+           do_bootm_vxworks (cmdtp, flag, argc, argv, &images);
            break;
+
        case IH_OS_QNX:
-           do_bootm_qnxelf (cmdtp, flag, argc, argv,
-                             addr, len_ptr, verify);
+           do_bootm_qnxelf (cmdtp, flag, argc, argv, &images);
            break;
 #endif
+
 #ifdef CONFIG_ARTOS
        case IH_OS_ARTOS:
-           do_bootm_artos  (cmdtp, flag, argc, argv,
-                            addr, len_ptr, verify);
+           do_bootm_artos (cmdtp, flag, argc, argv, &images);
            break;
 #endif
        }
@@ -455,94 +344,94 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        show_boot_progress (-9);
 #ifdef DEBUG
        puts ("\n## Control returned to monitor - resetting...\n");
-       do_reset (cmdtp, flag, argc, argv);
+       if (images.autostart)
+               do_reset (cmdtp, flag, argc, argv);
 #endif
+       if (!images.autostart && iflag)
+               enable_interrupts();
+
        return 1;
 }
 
-U_BOOT_CMD(
-       bootm,  CFG_MAXARGS,    1,      do_bootm,
-       "bootm   - boot application image from memory\n",
-       "[addr [arg ...]]\n    - boot application image stored in memory\n"
-       "\tpassing arguments 'arg ...'; when booting a Linux kernel,\n"
-       "\t'arg' can be the address of an initrd image\n"
-#if defined(CONFIG_OF_FLAT_TREE) || defined(CONFIG_OF_LIBFDT)
-       "\tWhen booting a Linux kernel which requires a flat device-tree\n"
-       "\ta third argument is required which is the address of the\n"
-       "\tdevice-tree blob. To boot that kernel without an initrd image,\n"
-       "\tuse a '-' for the second argument. If you do not pass a third\n"
-       "\ta bd_info struct will be passed instead\n"
-#endif
-);
-
-#ifdef CONFIG_SILENT_CONSOLE
-static void
-fixup_silent_linux ()
+/**
+ * image_get_kernel - verify legacy format kernel image
+ * @img_addr: in RAM address of the legacy format image to be verified
+ * @verify: data CRC verification flag
+ *
+ * image_get_kernel() verifies legacy image integrity and returns pointer to
+ * legacy image header if image verification was completed successfully.
+ *
+ * returns:
+ *     pointer to a legacy image header if valid image was found
+ *     otherwise return NULL
+ */
+static image_header_t *image_get_kernel (ulong img_addr, int verify)
 {
-       char buf[256], *start, *end;
-       char *cmdline = getenv ("bootargs");
+       image_header_t *hdr = (image_header_t *)img_addr;
 
-       /* Only fix cmdline when requested */
-       if (!(gd->flags & GD_FLG_SILENT))
-               return;
+       if (!image_check_magic(hdr)) {
+               puts ("Bad Magic Number\n");
+               show_boot_progress (-1);
+               return NULL;
+       }
+       show_boot_progress (2);
 
-       debug ("before silent fix-up: %s\n", cmdline);
-       if (cmdline) {
-               if ((start = strstr (cmdline, "console=")) != NULL) {
-                       end = strchr (start, ' ');
-                       strncpy (buf, cmdline, (start - cmdline + 8));
-                       if (end)
-                               strcpy (buf + (start - cmdline + 8), end);
-                       else
-                               buf[start - cmdline + 8] = '\0';
-               } else {
-                       strcpy (buf, cmdline);
-                       strcat (buf, " console=");
+       if (!image_check_hcrc (hdr)) {
+               puts ("Bad Header Checksum\n");
+               show_boot_progress (-2);
+               return NULL;
+       }
+
+       show_boot_progress (3);
+       image_print_contents (hdr);
+
+       if (verify) {
+               puts ("   Verifying Checksum ... ");
+               if (!image_check_dcrc (hdr)) {
+                       printf ("Bad Data CRC\n");
+                       show_boot_progress (-3);
+                       return NULL;
                }
-       } else {
-               strcpy (buf, "console=");
+               puts ("OK\n");
        }
+       show_boot_progress (4);
 
-       setenv ("bootargs", buf);
-       debug ("after silent fix-up: %s\n", buf);
+       if (!image_check_target_arch (hdr)) {
+               printf ("Unsupported Architecture 0x%x\n", image_get_arch (hdr));
+               show_boot_progress (-4);
+               return NULL;
+       }
+       return hdr;
 }
-#endif /* CONFIG_SILENT_CONSOLE */
 
-#ifdef CONFIG_PPC
-static void  __attribute__((noinline))
-do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
-               int     argc, char *argv[],
-               ulong   addr,
-               ulong   *len_ptr,
-               int     verify)
+/**
+ * fit_check_kernel - verify FIT format kernel subimage
+ * @fit_hdr: pointer to the FIT image header
+ * os_noffset: kernel subimage node offset within FIT image
+ * @verify: data CRC verification flag
+ *
+ * fit_check_kernel() verifies integrity of the kernel subimage and from
+ * specified FIT image.
+ *
+ * returns:
+ *     1, on success
+ *     0, on failure
+ */
+#if defined (CONFIG_FIT)
+static int fit_check_kernel (const void *fit, int os_noffset, int verify)
 {
-       ulong   sp;
-       ulong   len, checksum;
-       ulong   initrd_start, initrd_end;
-       ulong   cmd_start, cmd_end;
-       ulong   initrd_high;
-       ulong   data;
-       int     initrd_copy_to_ram = 1;
-       char    *cmdline;
-       char    *s;
-       bd_t    *kbd;
-       void    (*kernel)(bd_t *, ulong, ulong, ulong, ulong);
-       image_header_t *hdr = &header;
-#if defined(CONFIG_OF_FLAT_TREE) || defined(CONFIG_OF_LIBFDT)
-       char    *of_flat_tree = NULL;
-       ulong   of_data = 0;
-#endif
+       fit_image_print (fit, os_noffset, "   ");
 
-       if ((s = getenv ("initrd_high")) != NULL) {
-               /* a value of "no" or a similar string will act like 0,
-                * turning the "load high" feature off. This is intentional.
-                */
-               initrd_high = simple_strtoul(s, NULL, 16);
-               if (initrd_high == ~0)
-                       initrd_copy_to_ram = 0;
-       } else {        /* not set, no restrictions to load high */
-               initrd_high = ~0;
+       if (verify) {
+               puts ("   Verifying Hash Integrity ... ");
+               if (!fit_image_check_hashes (fit, os_noffset)) {
+                       puts ("Bad Data Hash\n");
+                       show_boot_progress (-104);
+                       return 0;
+               }
+               puts ("OK\n");
        }
+       show_boot_progress (105);
 
 #ifdef CONFIG_LOGBUFFER
 #ifndef CONFIG_ALT_LB_ADDR
@@ -555,539 +444,453 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
        debug ("## Logbuffer at 0x%08lX ", CONFIG_ALT_LB_ADDR);
 #endif
 #endif
+       if (!fit_image_check_target_arch (fit, os_noffset)) {
+               puts ("Unsupported Architecture\n");
+               show_boot_progress (-105);
+               return 0;
+       }
 
-       /*
-        * Booting a (Linux) kernel image
-        *
-        * Allocate space for command line and board info - the
-        * address should be as high as possible within the reach of
-        * the kernel (see CFG_BOOTMAPSZ settings), but in unused
-        * memory, which means far enough below the current stack
-        * pointer.
-        */
-
-       asm( "mr %0,1": "=r"(sp) : );
-
-       debug ("## Current stack ends at 0x%08lX ", sp);
-
-       sp -= 2048;             /* just to be sure */
-       if (sp > CFG_BOOTMAPSZ)
-               sp = CFG_BOOTMAPSZ;
-       sp &= ~0xF;
-
-       debug ("=> set upper limit to 0x%08lX\n", sp);
-
-       cmdline = (char *)((sp - CFG_BARGSIZE) & ~0xF);
-       kbd = (bd_t *)(((ulong)cmdline - sizeof(bd_t)) & ~0xF);
-
-       if ((s = getenv("bootargs")) == NULL)
-               s = "";
-
-       strcpy (cmdline, s);
-
-       cmd_start    = (ulong)&cmdline[0];
-       cmd_end      = cmd_start + strlen(cmdline);
-
-       *kbd = *(gd->bd);
+       show_boot_progress (106);
+       if (!fit_image_check_type (fit, os_noffset, IH_TYPE_KERNEL)) {
+               puts ("Not a kernel image\n");
+               show_boot_progress (-106);
+               return 0;
+       }
 
-#ifdef DEBUG
-       printf ("## cmdline at 0x%08lX ... 0x%08lX\n", cmd_start, cmd_end);
+       show_boot_progress (107);
+       return 1;
+}
+#endif /* CONFIG_FIT */
 
-       do_bdinfo (NULL, 0, 0, NULL);
+/**
+ * boot_get_kernel - find kernel image
+ * @os_data: pointer to a ulong variable, will hold os data start address
+ * @os_len: pointer to a ulong variable, will hold os data length
+ *
+ * boot_get_kernel() tries to find a kernel image, verifies its integrity
+ * and locates kernel data.
+ *
+ * returns:
+ *     pointer to image header if valid image was found, plus kernel start
+ *     address and length, otherwise NULL
+ */
+static void *boot_get_kernel (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
+               bootm_headers_t *images, ulong *os_data, ulong *os_len)
+{
+       image_header_t  *hdr;
+       ulong           img_addr;
+#if defined(CONFIG_FIT)
+       void            *fit_hdr;
+       const char      *fit_uname_config = NULL;
+       const char      *fit_uname_kernel = NULL;
+       const void      *data;
+       size_t          len;
+       int             cfg_noffset;
+       int             os_noffset;
 #endif
 
-       if ((s = getenv ("clocks_in_mhz")) != NULL) {
-               /* convert all clock information to MHz */
-               kbd->bi_intfreq /= 1000000L;
-               kbd->bi_busfreq /= 1000000L;
-#if defined(CONFIG_MPC8220)
-       kbd->bi_inpfreq /= 1000000L;
-       kbd->bi_pcifreq /= 1000000L;
-       kbd->bi_pevfreq /= 1000000L;
-       kbd->bi_flbfreq /= 1000000L;
-       kbd->bi_vcofreq /= 1000000L;
-#endif
-#if defined(CONFIG_CPM2)
-               kbd->bi_cpmfreq /= 1000000L;
-               kbd->bi_brgfreq /= 1000000L;
-               kbd->bi_sccfreq /= 1000000L;
-               kbd->bi_vco     /= 1000000L;
+       /* find out kernel image address */
+       if (argc < 2) {
+               img_addr = load_addr;
+               debug ("*  kernel: default image load address = 0x%08lx\n",
+                               load_addr);
+#if defined(CONFIG_FIT)
+       } else if (fit_parse_conf (argv[1], load_addr, &img_addr,
+                                                       &fit_uname_config)) {
+               debug ("*  kernel: config '%s' from image at 0x%08lx\n",
+                               fit_uname_config, img_addr);
+       } else if (fit_parse_subimage (argv[1], load_addr, &img_addr,
+                                                       &fit_uname_kernel)) {
+               debug ("*  kernel: subimage '%s' from image at 0x%08lx\n",
+                               fit_uname_kernel, img_addr);
 #endif
-#if defined(CONFIG_MPC5xxx)
-               kbd->bi_ipbfreq /= 1000000L;
-               kbd->bi_pcifreq /= 1000000L;
-#endif /* CONFIG_MPC5xxx */
+       } else {
+               img_addr = simple_strtoul(argv[1], NULL, 16);
+               debug ("*  kernel: cmdline image address = 0x%08lx\n", img_addr);
        }
 
-       kernel = (void (*)(bd_t *, ulong, ulong, ulong, ulong)) ntohl(hdr->ih_ep);
-
-       /*
-        * Check if there is an initrd image
-        */
+       show_boot_progress (1);
 
-#if defined(CONFIG_OF_FLAT_TREE) || defined(CONFIG_OF_LIBFDT)
-       /* Look for a '-' which indicates to ignore the ramdisk argument */
-       if (argc >= 3 && strcmp(argv[2], "-") ==  0) {
-                       debug ("Skipping initrd\n");
-                       len = data = 0;
+       /* copy from dataflash if needed */
+       img_addr = genimg_get_image (img_addr);
+
+       /* check image type, for FIT images get FIT kernel node */
+       *os_data = *os_len = 0;
+       switch (genimg_get_format ((void *)img_addr)) {
+       case IMAGE_FORMAT_LEGACY:
+               printf ("## Booting kernel from Legacy Image at %08lx ...\n",
+                               img_addr);
+               hdr = image_get_kernel (img_addr, images->verify);
+               if (!hdr)
+                       return NULL;
+               show_boot_progress (5);
+
+               /* get os_data and os_len */
+               switch (image_get_type (hdr)) {
+               case IH_TYPE_KERNEL:
+                       *os_data = image_get_data (hdr);
+                       *os_len = image_get_data_size (hdr);
+                       break;
+               case IH_TYPE_MULTI:
+                       image_multi_getimg (hdr, 0, os_data, os_len);
+                       break;
+               default:
+                       printf ("Wrong Image Type for %s command\n", cmdtp->name);
+                       show_boot_progress (-5);
+                       return NULL;
                }
-       else
-#endif
-       if (argc >= 3) {
-               debug ("Not skipping initrd\n");
-               show_boot_progress (9);
 
-               addr = simple_strtoul(argv[2], NULL, 16);
-
-               printf ("## Loading RAMDisk Image at %08lx ...\n", addr);
+               /*
+                * copy image header to allow for image overwrites during kernel
+                * decompression.
+                */
+               memmove (&images->legacy_hdr_os_copy, hdr, sizeof(image_header_t));
 
-               /* Copy header so we can blank CRC field for re-calculation */
-               memmove (&header, (char *)addr, sizeof(image_header_t));
+               /* save pointer to image header */
+               images->legacy_hdr_os = hdr;
 
-               if (ntohl(hdr->ih_magic)  != IH_MAGIC) {
-                       puts ("Bad Magic Number\n");
-                       show_boot_progress (-10);
-                       do_reset (cmdtp, flag, argc, argv);
+               images->legacy_hdr_valid = 1;
+               show_boot_progress (6);
+               break;
+#if defined(CONFIG_FIT)
+       case IMAGE_FORMAT_FIT:
+               fit_hdr = (void *)img_addr;
+               printf ("## Booting kernel from FIT Image at %08lx ...\n",
+                               img_addr);
+
+               if (!fit_check_format (fit_hdr)) {
+                       puts ("Bad FIT kernel image format!\n");
+                       show_boot_progress (-100);
+                       return NULL;
                }
+               show_boot_progress (100);
 
-               data = (ulong)&header;
-               len  = sizeof(image_header_t);
-
-               checksum = ntohl(hdr->ih_hcrc);
-               hdr->ih_hcrc = 0;
+               if (!fit_uname_kernel) {
+                       /*
+                        * no kernel image node unit name, try to get config
+                        * node first. If config unit node name is NULL
+                        * fit_conf_get_node() will try to find default config node
+                        */
+                       show_boot_progress (101);
+                       cfg_noffset = fit_conf_get_node (fit_hdr, fit_uname_config);
+                       if (cfg_noffset < 0) {
+                               show_boot_progress (-101);
+                               return NULL;
+                       }
+                       /* save configuration uname provided in the first
+                        * bootm argument
+                        */
+                       images->fit_uname_cfg = fdt_get_name (fit_hdr, cfg_noffset, NULL);
+                       printf ("   Using '%s' configuration\n", images->fit_uname_cfg);
+                       show_boot_progress (103);
 
-               if (crc32 (0, (uchar *)data, len) != checksum) {
-                       puts ("Bad Header Checksum\n");
-                       show_boot_progress (-11);
-                       do_reset (cmdtp, flag, argc, argv);
+                       os_noffset = fit_conf_get_kernel_node (fit_hdr, cfg_noffset);
+                       fit_uname_kernel = fit_get_name (fit_hdr, os_noffset, NULL);
+               } else {
+                       /* get kernel component image node offset */
+                       show_boot_progress (102);
+                       os_noffset = fit_image_get_node (fit_hdr, fit_uname_kernel);
                }
-
-               show_boot_progress (10);
-
-               print_image_hdr (hdr);
-
-               data = addr + sizeof(image_header_t);
-               len  = ntohl(hdr->ih_size);
-
-               if (verify) {
-                       ulong csum = 0;
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
-                       ulong cdata = data, edata = cdata + len;
-#endif /* CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG */
-
-                       puts ("   Verifying Checksum ... ");
-
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
-
-                       while (cdata < edata) {
-                               ulong chunk = edata - cdata;
-
-                               if (chunk > CHUNKSZ)
-                                       chunk = CHUNKSZ;
-                               csum = crc32 (csum, (uchar *)cdata, chunk);
-                               cdata += chunk;
-
-                               WATCHDOG_RESET();
-                       }
-#else  /* !(CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG) */
-                       csum = crc32 (0, (uchar *)data, len);
-#endif /* CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG */
-
-                       if (csum != ntohl(hdr->ih_dcrc)) {
-                               puts ("Bad Data CRC\n");
-                               show_boot_progress (-12);
-                               do_reset (cmdtp, flag, argc, argv);
-                       }
-                       puts ("OK\n");
+               if (os_noffset < 0) {
+                       show_boot_progress (-103);
+                       return NULL;
                }
 
-               show_boot_progress (11);
+               printf ("   Trying '%s' kernel subimage\n", fit_uname_kernel);
 
-               if ((hdr->ih_os   != IH_OS_LINUX)       ||
-                   (hdr->ih_arch != IH_CPU_PPC)        ||
-                   (hdr->ih_type != IH_TYPE_RAMDISK)   ) {
-                       puts ("No Linux PPC Ramdisk Image\n");
-                       show_boot_progress (-13);
-                       do_reset (cmdtp, flag, argc, argv);
-               }
+               show_boot_progress (104);
+               if (!fit_check_kernel (fit_hdr, os_noffset, images->verify))
+                       return NULL;
 
-               /*
-                * Now check if we have a multifile image
-                */
-       } else if ((hdr->ih_type==IH_TYPE_MULTI) && (len_ptr[1])) {
-               u_long tail    = ntohl(len_ptr[0]) % 4;
-               int i;
-
-               show_boot_progress (13);
-
-               /* skip kernel length and terminator */
-               data = (ulong)(&len_ptr[2]);
-               /* skip any additional image length fields */
-               for (i=1; len_ptr[i]; ++i)
-                       data += 4;
-               /* add kernel length, and align */
-               data += ntohl(len_ptr[0]);
-               if (tail) {
-                       data += 4 - tail;
+               /* get kernel image data address and length */
+               if (fit_image_get_data (fit_hdr, os_noffset, &data, &len)) {
+                       puts ("Could not find kernel subimage data!\n");
+                       show_boot_progress (-107);
+                       return NULL;
                }
+               show_boot_progress (108);
 
-               len   = ntohl(len_ptr[1]);
+               *os_len = len;
+               *os_data = (ulong)data;
+               images->fit_hdr_os = fit_hdr;
+               images->fit_uname_os = fit_uname_kernel;
+               images->fit_noffset_os = os_noffset;
+               break;
+#endif
+       default:
+               printf ("Wrong Image Format for %s command\n", cmdtp->name);
+               show_boot_progress (-108);
+               return NULL;
+       }
 
-       } else {
-               /*
-                * no initrd image
-                */
-               show_boot_progress (14);
+       debug ("   kernel data at 0x%08lx, len = 0x%08lx (%d)\n",
+                       *os_data, *os_len, *os_len);
 
-               len = data = 0;
-       }
+       return (void *)img_addr;
+}
 
-#if defined(CONFIG_OF_FLAT_TREE) || defined(CONFIG_OF_LIBFDT)
-       if(argc > 3) {
-               of_flat_tree = (char *) simple_strtoul(argv[3], NULL, 16);
-               hdr = (image_header_t *)of_flat_tree;
-#if defined(CONFIG_OF_FLAT_TREE)
-               if (*((ulong *)(of_flat_tree + sizeof(image_header_t))) != OF_DT_HEADER) {
-#else
-               if (fdt_check_header(of_flat_tree + sizeof(image_header_t)) != 0) {
+U_BOOT_CMD(
+       bootm,  CFG_MAXARGS,    1,      do_bootm,
+       "bootm   - boot application image from memory\n",
+       "[addr [arg ...]]\n    - boot application image stored in memory\n"
+       "\tpassing arguments 'arg ...'; when booting a Linux kernel,\n"
+       "\t'arg' can be the address of an initrd image\n"
+#if defined(CONFIG_OF_LIBFDT)
+       "\tWhen booting a Linux kernel which requires a flat device-tree\n"
+       "\ta third argument is required which is the address of the\n"
+       "\tdevice-tree blob. To boot that kernel without an initrd image,\n"
+       "\tuse a '-' for the second argument. If you do not pass a third\n"
+       "\ta bd_info struct will be passed instead\n"
 #endif
-#ifndef CFG_NO_FLASH
-                       if (addr2info((ulong)of_flat_tree) != NULL)
-                               of_data = (ulong)of_flat_tree;
+#if defined(CONFIG_FIT)
+       "\t\nFor the new multi component uImage format (FIT) addresses\n"
+       "\tmust be extened to include component or configuration unit name:\n"
+       "\taddr:<subimg_uname> - direct component image specification\n"
+       "\taddr#<conf_uname>   - configuration specification\n"
+       "\tUse iminfo command to get the list of existing component\n"
+       "\timages and configurations.\n"
 #endif
-               } else if (ntohl(hdr->ih_magic) == IH_MAGIC) {
-                       printf("## Flat Device Tree at %08lX\n", hdr);
-                       print_image_hdr(hdr);
-
-                       if ((ntohl(hdr->ih_load) <  ((unsigned long)hdr + ntohl(hdr->ih_size) + sizeof(hdr))) &&
-                          ((ntohl(hdr->ih_load) + ntohl(hdr->ih_size)) > (unsigned long)hdr)) {
-                               puts ("ERROR: fdt overwritten - "
-                                       "must RESET the board to recover.\n");
-                               do_reset (cmdtp, flag, argc, argv);
-                       }
-
-                       puts ("   Verifying Checksum ... ");
-                       memmove (&header, (char *)hdr, sizeof(image_header_t));
-                       checksum = ntohl(header.ih_hcrc);
-                       header.ih_hcrc = 0;
+);
 
-                       if(checksum != crc32(0, (uchar *)&header, sizeof(image_header_t))) {
-                               puts ("ERROR: fdt header checksum invalid - "
-                                       "must RESET the board to recover.\n");
-                               do_reset (cmdtp, flag, argc, argv);
-                       }
+/*******************************************************************/
+/* bootd - boot default image */
+/*******************************************************************/
+#if defined(CONFIG_CMD_BOOTD)
+int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+       int rcode = 0;
 
-                       checksum = ntohl(hdr->ih_dcrc);
-                       addr = (ulong)((uchar *)(hdr) + sizeof(image_header_t));
-
-                       if(checksum != crc32(0, (uchar *)addr, ntohl(hdr->ih_size))) {
-                               puts ("ERROR: fdt checksum invalid - "
-                                       "must RESET the board to recover.\n");
-                               do_reset (cmdtp, flag, argc, argv);
-                       }
-                       puts ("OK\n");
-
-                       if (ntohl(hdr->ih_type) != IH_TYPE_FLATDT) {
-                               puts ("ERROR: uImage is not a fdt - "
-                                       "must RESET the board to recover.\n");
-                               do_reset (cmdtp, flag, argc, argv);
-                       }
-                       if (ntohl(hdr->ih_comp) != IH_COMP_NONE) {
-                               puts ("ERROR: uImage is compressed - "
-                                       "must RESET the board to recover.\n");
-                               do_reset (cmdtp, flag, argc, argv);
-                       }
-#if defined(CONFIG_OF_FLAT_TREE)
-                       if (*((ulong *)(of_flat_tree + sizeof(image_header_t))) != OF_DT_HEADER) {
+#ifndef CFG_HUSH_PARSER
+       if (run_command (getenv ("bootcmd"), flag) < 0)
+               rcode = 1;
 #else
-                       if (fdt_check_header(of_flat_tree + sizeof(image_header_t)) != 0) {
+       if (parse_string_outer (getenv ("bootcmd"),
+                       FLAG_PARSE_SEMICOLON | FLAG_EXIT_FROM_LOOP) != 0)
+               rcode = 1;
 #endif
-                               puts ("ERROR: uImage data is not a fdt - "
-                                       "must RESET the board to recover.\n");
-                               do_reset (cmdtp, flag, argc, argv);
-                       }
+       return rcode;
+}
 
-                       memmove((void *)ntohl(hdr->ih_load),
-                               (void *)(of_flat_tree + sizeof(image_header_t)),
-                               ntohl(hdr->ih_size));
-                       of_flat_tree = (char *)ntohl(hdr->ih_load);
-               } else {
-                       puts ("Did not find a flat Flat Device Tree.\n"
-                               "Must RESET the board to recover.\n");
-                       do_reset (cmdtp, flag, argc, argv);
-               }
-               printf ("   Booting using the fdt at 0x%x\n",
-                               of_flat_tree);
-       } else if ((hdr->ih_type==IH_TYPE_MULTI) && (len_ptr[1]) && (len_ptr[2])) {
-               u_long tail    = ntohl(len_ptr[0]) % 4;
-               int i;
-
-               /* skip kernel length, initrd length, and terminator */
-               of_flat_tree = (char *)(&len_ptr[3]);
-               /* skip any additional image length fields */
-               for (i=2; len_ptr[i]; ++i)
-                       of_flat_tree += 4;
-               /* add kernel length, and align */
-               of_flat_tree += ntohl(len_ptr[0]);
-               if (tail) {
-                       of_flat_tree += 4 - tail;
-               }
+U_BOOT_CMD(
+       boot,   1,      1,      do_bootd,
+       "boot    - boot default, i.e., run 'bootcmd'\n",
+       NULL
+);
 
-               /* add initrd length, and align */
-               tail = ntohl(len_ptr[1]) % 4;
-               of_flat_tree += ntohl(len_ptr[1]);
-               if (tail) {
-                       of_flat_tree += 4 - tail;
-               }
+/* keep old command name "bootd" for backward compatibility */
+U_BOOT_CMD(
+       bootd, 1,       1,      do_bootd,
+       "bootd   - boot default, i.e., run 'bootcmd'\n",
+       NULL
+);
 
-#ifndef CFG_NO_FLASH
-               /* move the blob if it is in flash (set of_data to !null) */
-               if (addr2info ((ulong)of_flat_tree) != NULL)
-                       of_data = (ulong)of_flat_tree;
 #endif
 
 
-#if defined(CONFIG_OF_FLAT_TREE)
-               if (*((ulong *)(of_flat_tree)) != OF_DT_HEADER) {
-#else
-               if (fdt_check_header (of_flat_tree) != 0) {
-#endif
-                       puts ("ERROR: image is not a fdt - "
-                               "must RESET the board to recover.\n");
-                       do_reset (cmdtp, flag, argc, argv);
-               }
+/*******************************************************************/
+/* iminfo - print header info for a requested image */
+/*******************************************************************/
+#if defined(CONFIG_CMD_IMI)
+int do_iminfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+       int     arg;
+       ulong   addr;
+       int     rcode = 0;
 
-#if defined(CONFIG_OF_FLAT_TREE)
-               if (((struct boot_param_header *)of_flat_tree)->totalsize !=
-                       ntohl (len_ptr[2])) {
-#else
-               if (be32_to_cpu (fdt_totalsize (of_flat_tree)) !=
-                       ntohl(len_ptr[2])) {
-#endif
-                       puts ("ERROR: fdt size != image size - "
-                               "must RESET the board to recover.\n");
-                       do_reset (cmdtp, flag, argc, argv);
-               }
+       if (argc < 2) {
+               return image_info (load_addr);
        }
-#endif
-       if (!data) {
-               debug ("No initrd\n");
+
+       for (arg = 1; arg < argc; ++arg) {
+               addr = simple_strtoul (argv[arg], NULL, 16);
+               if (image_info (addr) != 0)
+                       rcode = 1;
        }
+       return rcode;
+}
 
-       if (data) {
-           if (!initrd_copy_to_ram) {  /* zero-copy ramdisk support */
-               initrd_start = data;
-               initrd_end = initrd_start + len;
-           } else {
-               initrd_start  = (ulong)kbd - len;
-               initrd_start &= ~(4096 - 1);    /* align on page */
+static int image_info (ulong addr)
+{
+       void *hdr = (void *)addr;
 
-               if (initrd_high) {
-                       ulong nsp;
+       printf ("\n## Checking Image at %08lx ...\n", addr);
 
-                       /*
-                        * the inital ramdisk does not need to be within
-                        * CFG_BOOTMAPSZ as it is not accessed until after
-                        * the mm system is initialised.
-                        *
-                        * do the stack bottom calculation again and see if
-                        * the initrd will fit just below the monitor stack
-                        * bottom without overwriting the area allocated
-                        * above for command line args and board info.
-                        */
-                       asm( "mr %0,1": "=r"(nsp) : );
-                       nsp -= 2048;            /* just to be sure */
-                       nsp &= ~0xF;
-                       if (nsp > initrd_high)  /* limit as specified */
-                               nsp = initrd_high;
-                       nsp -= len;
-                       nsp &= ~(4096 - 1);     /* align on page */
-                       if (nsp >= sp)
-                               initrd_start = nsp;
+       switch (genimg_get_format (hdr)) {
+       case IMAGE_FORMAT_LEGACY:
+               puts ("   Legacy image found\n");
+               if (!image_check_magic (hdr)) {
+                       puts ("   Bad Magic Number\n");
+                       return 1;
                }
 
-               show_boot_progress (12);
-
-               debug ("## initrd at 0x%08lX ... 0x%08lX (len=%ld=0x%lX)\n",
-                       data, data + len - 1, len, len);
-
-               initrd_end    = initrd_start + len;
-               printf ("   Loading Ramdisk to %08lx, end %08lx ... ",
-                       initrd_start, initrd_end);
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
-               {
-                       size_t l = len;
-                       void *to = (void *)initrd_start;
-                       void *from = (void *)data;
-
-                       while (l > 0) {
-                               size_t tail = (l > CHUNKSZ) ? CHUNKSZ : l;
-                               WATCHDOG_RESET();
-                               memmove (to, from, tail);
-                               to += tail;
-                               from += tail;
-                               l -= tail;
-                       }
+               if (!image_check_hcrc (hdr)) {
+                       puts ("   Bad Header Checksum\n");
+                       return 1;
                }
-#else  /* !(CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG) */
-               memmove ((void *)initrd_start, (void *)data, len);
-#endif /* CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG */
-               puts ("OK\n");
-           }
-       } else {
-               initrd_start = 0;
-               initrd_end = 0;
-       }
 
-#if defined(CONFIG_OF_LIBFDT)
+               image_print_contents (hdr);
 
-#ifdef CFG_BOOTMAPSZ
-       /*
-        * The blob must be within CFG_BOOTMAPSZ,
-        * so we flag it to be copied if it is not.
-        */
-       if (of_flat_tree >= (char *)CFG_BOOTMAPSZ)
-               of_data = (ulong)of_flat_tree;
-#endif
-
-       /* move of_flat_tree if needed */
-       if (of_data) {
-               int err;
-               ulong of_start, of_len;
-
-               of_len = be32_to_cpu(fdt_totalsize(of_data));
-
-               /* position on a 4K boundary before the kbd */
-               of_start  = (ulong)kbd - of_len;
-               of_start &= ~(4096 - 1);        /* align on page */
-               debug ("## device tree at 0x%08lX ... 0x%08lX (len=%ld=0x%lX)\n",
-                       of_data, of_data + of_len - 1, of_len, of_len);
-
-               of_flat_tree = (char *)of_start;
-               printf ("   Loading Device Tree to %08lx, end %08lx ... ",
-                       of_start, of_start + of_len - 1);
-               err = fdt_open_into((void *)of_data, (void *)of_start, of_len);
-               if (err != 0) {
-                       puts ("ERROR: fdt move failed - "
-                               "must RESET the board to recover.\n");
-                       do_reset (cmdtp, flag, argc, argv);
+               puts ("   Verifying Checksum ... ");
+               if (!image_check_dcrc (hdr)) {
+                       puts ("   Bad Data CRC\n");
+                       return 1;
                }
                puts ("OK\n");
-       }
-       /*
-        * Add the chosen node if it doesn't exist, add the env and bd_t
-        * if the user wants it (the logic is in the subroutines).
-        */
-       if (of_flat_tree) {
-               if (fdt_chosen(of_flat_tree, initrd_start, initrd_end, 0) < 0) {
-                       puts ("ERROR: /chosen node create failed - "
-                               "must RESET the board to recover.\n");
-                       do_reset (cmdtp, flag, argc, argv);
-               }
-#ifdef CONFIG_OF_HAS_UBOOT_ENV
-               if (fdt_env(of_flat_tree) < 0) {
-                       puts ("ERROR: /u-boot-env node create failed - "
-                               "must RESET the board to recover.\n");
-                       do_reset (cmdtp, flag, argc, argv);
-               }
-#endif
-#ifdef CONFIG_OF_HAS_BD_T
-               if (fdt_bd_t(of_flat_tree) < 0) {
-                       puts ("ERROR: /bd_t node create failed - "
-                               "must RESET the board to recover.\n");
-                       do_reset (cmdtp, flag, argc, argv);
+               return 0;
+#if defined(CONFIG_FIT)
+       case IMAGE_FORMAT_FIT:
+               puts ("   FIT image found\n");
+
+               if (!fit_check_format (hdr)) {
+                       puts ("Bad FIT image format!\n");
+                       return 1;
                }
+
+               fit_print_contents (hdr);
+               return 0;
 #endif
-#ifdef CONFIG_OF_BOARD_SETUP
-               /* Call the board-specific fixup routine */
-               ft_board_setup(of_flat_tree, gd->bd);
-#endif
+       default:
+               puts ("Unknown image format!\n");
+               break;
        }
-#endif /* CONFIG_OF_LIBFDT */
-#if defined(CONFIG_OF_FLAT_TREE)
-#ifdef CFG_BOOTMAPSZ
-       /*
-        * The blob must be within CFG_BOOTMAPSZ,
-        * so we flag it to be copied if it is not.
-        */
-       if (of_flat_tree >= (char *)CFG_BOOTMAPSZ)
-               of_data = (ulong)of_flat_tree;
-#endif
 
-       /* move of_flat_tree if needed */
-       if (of_data) {
-               ulong of_start, of_len;
-               of_len = ((struct boot_param_header *)of_data)->totalsize;
-
-               /* provide extra 8k pad */
-               of_start  = (ulong)kbd - of_len - 8192;
-               of_start &= ~(4096 - 1);        /* align on page */
-               debug ("## device tree at 0x%08lX ... 0x%08lX (len=%ld=0x%lX)\n",
-                       of_data, of_data + of_len - 1, of_len, of_len);
-
-               of_flat_tree = (char *)of_start;
-               printf ("   Loading Device Tree to %08lx, end %08lx ... ",
-                       of_start, of_start + of_len - 1);
-               memmove ((void *)of_start, (void *)of_data, of_len);
-               puts ("OK\n");
-       }
-       /*
-        * Create the /chosen node and modify the blob with board specific
-        * values as needed.
-        */
-       ft_setup(of_flat_tree, kbd, initrd_start, initrd_end);
-       /* ft_dump_blob(of_flat_tree); */
+       return 1;
+}
+
+U_BOOT_CMD(
+       iminfo, CFG_MAXARGS,    1,      do_iminfo,
+       "iminfo  - print header information for application image\n",
+       "addr [addr ...]\n"
+       "    - print header information for application image starting at\n"
+       "      address 'addr' in memory; this includes verification of the\n"
+       "      image contents (magic number, header and payload checksums)\n"
+);
 #endif
-       debug ("## Transferring control to Linux (at address %08lx) ...\n",
-               (ulong)kernel);
 
-       show_boot_progress (15);
 
-#if defined(CFG_INIT_RAM_LOCK) && !defined(CONFIG_E500)
-       unlock_ram_in_cache();
+/*******************************************************************/
+/* imls - list all images found in flash */
+/*******************************************************************/
+#if defined(CONFIG_CMD_IMLS)
+int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+       flash_info_t *info;
+       int i, j;
+       void *hdr;
+
+       for (i = 0, info = &flash_info[0];
+               i < CFG_MAX_FLASH_BANKS; ++i, ++info) {
+
+               if (info->flash_id == FLASH_UNKNOWN)
+                       goto next_bank;
+               for (j = 0; j < info->sector_count; ++j) {
+
+                       hdr = (void *)info->start[j];
+                       if (!hdr)
+                               goto next_sector;
+
+                       switch (genimg_get_format (hdr)) {
+                       case IMAGE_FORMAT_LEGACY:
+                               if (!image_check_hcrc (hdr))
+                                       goto next_sector;
+
+                               printf ("Legacy Image at %08lX:\n", (ulong)hdr);
+                               image_print_contents (hdr);
+
+                               puts ("   Verifying Checksum ... ");
+                               if (!image_check_dcrc (hdr)) {
+                                       puts ("Bad Data CRC\n");
+                               } else {
+                                       puts ("OK\n");
+                               }
+                               break;
+#if defined(CONFIG_FIT)
+                       case IMAGE_FORMAT_FIT:
+                               if (!fit_check_format (hdr))
+                                       goto next_sector;
+
+                               printf ("FIT Image at %08lX:\n", (ulong)hdr);
+                               fit_print_contents (hdr);
+                               break;
 #endif
+                       default:
+                               goto next_sector;
+                       }
 
-#if defined(CONFIG_OF_FLAT_TREE) || defined(CONFIG_OF_LIBFDT)
-       if (of_flat_tree) {     /* device tree; boot new style */
-               /*
-                * Linux Kernel Parameters (passing device tree):
-                *   r3: pointer to the fdt, followed by the board info data
-                *   r4: physical pointer to the kernel itself
-                *   r5: NULL
-                *   r6: NULL
-                *   r7: NULL
-                */
-               (*kernel) ((bd_t *)of_flat_tree, (ulong)kernel, 0, 0, 0);
-               /* does not return */
+next_sector:           ;
+               }
+next_bank:     ;
        }
-#endif
-       /*
-        * Linux Kernel Parameters (passing board info data):
-        *   r3: ptr to board info data
-        *   r4: initrd_start or 0 if no initrd
-        *   r5: initrd_end - unused if r4 is 0
-        *   r6: Start of command line string
-        *   r7: End   of command line string
-        */
-       (*kernel) (kbd, initrd_start, initrd_end, cmd_start, cmd_end);
-       /* does not return */
+
+       return (0);
 }
-#endif /* CONFIG_PPC */
-
-static void
-do_bootm_netbsd (cmd_tbl_t *cmdtp, int flag,
-               int     argc, char *argv[],
-               ulong   addr,
-               ulong   *len_ptr,
-               int     verify)
+
+U_BOOT_CMD(
+       imls,   1,              1,      do_imls,
+       "imls    - list all images found in flash\n",
+       "\n"
+       "    - Prints information about all images found at sector\n"
+       "      boundaries in flash.\n"
+);
+#endif
+
+/*******************************************************************/
+/* helper routines */
+/*******************************************************************/
+#ifdef CONFIG_SILENT_CONSOLE
+static void fixup_silent_linux ()
 {
-       image_header_t *hdr = &header;
+       char buf[256], *start, *end;
+       char *cmdline = getenv ("bootargs");
+
+       /* Only fix cmdline when requested */
+       if (!(gd->flags & GD_FLG_SILENT))
+               return;
+
+       debug ("before silent fix-up: %s\n", cmdline);
+       if (cmdline) {
+               if ((start = strstr (cmdline, "console=")) != NULL) {
+                       end = strchr (start, ' ');
+                       strncpy (buf, cmdline, (start - cmdline + 8));
+                       if (end)
+                               strcpy (buf + (start - cmdline + 8), end);
+                       else
+                               buf[start - cmdline + 8] = '\0';
+               } else {
+                       strcpy (buf, cmdline);
+                       strcat (buf, " console=");
+               }
+       } else {
+               strcpy (buf, "console=");
+       }
+
+       setenv ("bootargs", buf);
+       debug ("after silent fix-up: %s\n", buf);
+}
+#endif /* CONFIG_SILENT_CONSOLE */
 
-       void    (*loader)(bd_t *, image_header_t *, char *, char *);
-       image_header_t *img_addr;
-       char     *consdev;
-       char     *cmdline;
 
+/*******************************************************************/
+/* OS booting routines */
+/*******************************************************************/
+
+static void do_bootm_netbsd (cmd_tbl_t *cmdtp, int flag,
+                           int argc, char *argv[],
+                           bootm_headers_t *images)
+{
+       void (*loader)(bd_t *, image_header_t *, char *, char *);
+       image_header_t *os_hdr, *hdr;
+       ulong kernel_data, kernel_len;
+       char *consdev;
+       char *cmdline;
+
+#if defined(CONFIG_FIT)
+       if (!images->legacy_hdr_valid) {
+               fit_unsupported_reset ("NetBSD");
+               do_reset (cmdtp, flag, argc, argv);
+       }
+#endif
+       hdr = images->legacy_hdr_os;
 
        /*
         * Booting a (NetBSD) kernel image
@@ -1100,11 +903,12 @@ do_bootm_netbsd (cmd_tbl_t *cmdtp, int flag,
         * line, the name of the console device, and (optionally) the
         * address of the original image header.
         */
-
-       img_addr = 0;
-       if ((hdr->ih_type==IH_TYPE_MULTI) && (len_ptr[1]))
-               img_addr = (image_header_t *) addr;
-
+       os_hdr = NULL;
+       if (image_check_type (&images->legacy_hdr_os_copy, IH_TYPE_MULTI)) {
+               image_multi_getimg (hdr, 1, &kernel_data, &kernel_len);
+               if (kernel_len)
+                       os_hdr = hdr;
+       }
 
        consdev = "";
 #if   defined (CONFIG_8xx_CONS_SMC1)
@@ -1121,21 +925,21 @@ do_bootm_netbsd (cmd_tbl_t *cmdtp, int flag,
                ulong len;
                int   i;
 
-               for (i=2, len=0 ; i<argc ; i+=1)
+               for (i = 2, len = 0; i < argc; i += 1)
                        len += strlen (argv[i]) + 1;
                cmdline = malloc (len);
 
-               for (i=2, len=0 ; i<argc ; i+=1) {
+               for (i = 2, len = 0; i < argc; i += 1) {
                        if (i > 2)
                                cmdline[len++] = ' ';
                        strcpy (&cmdline[len], argv[i]);
                        len += strlen (argv[i]);
                }
-       } else if ((cmdline = getenv("bootargs")) == NULL) {
+       } else if ((cmdline = getenv ("bootargs")) == NULL) {
                cmdline = "";
        }
 
-       loader = (void (*)(bd_t *, image_header_t *, char *, char *)) ntohl(hdr->ih_ep);
+       loader = (void (*)(bd_t *, image_header_t *, char *, char *))image_get_ep (hdr);
 
        printf ("## Transferring control to NetBSD stage-2 loader (at address %08lx) ...\n",
                (ulong)loader);
@@ -1149,20 +953,101 @@ do_bootm_netbsd (cmd_tbl_t *cmdtp, int flag,
         *   r5: console device
         *   r6: boot args string
         */
-       (*loader) (gd->bd, img_addr, consdev, cmdline);
+       (*loader) (gd->bd, os_hdr, consdev, cmdline);
 }
 
-#if defined(CONFIG_ARTOS) && defined(CONFIG_PPC)
+#ifdef CONFIG_LYNXKDI
+static void do_bootm_lynxkdi (cmd_tbl_t *cmdtp, int flag,
+                            int argc, char *argv[],
+                            bootm_headers_t *images)
+{
+       image_header_t *hdr = &images->legacy_hdr_os_copy;
+
+#if defined(CONFIG_FIT)
+       if (!images->legacy_hdr_valid) {
+               fit_unsupported_reset ("Lynx");
+               do_reset (cmdtp, flag, argc, argv);
+       }
+#endif
+
+       lynxkdi_boot ((image_header_t *)hdr);
+}
+#endif /* CONFIG_LYNXKDI */
+
+static void do_bootm_rtems (cmd_tbl_t *cmdtp, int flag,
+                          int argc, char *argv[],
+                          bootm_headers_t *images)
+{
+       image_header_t *hdr = &images->legacy_hdr_os_copy;
+       void (*entry_point)(bd_t *);
+
+#if defined(CONFIG_FIT)
+       if (!images->legacy_hdr_valid) {
+               fit_unsupported_reset ("RTEMS");
+               do_reset (cmdtp, flag, argc, argv);
+       }
+#endif
+
+       entry_point = (void (*)(bd_t *))image_get_ep (hdr);
+
+       printf ("## Transferring control to RTEMS (at address %08lx) ...\n",
+               (ulong)entry_point);
+
+       show_boot_progress (15);
+
+       /*
+        * RTEMS Parameters:
+        *   r3: ptr to board info data
+        */
+       (*entry_point)(gd->bd);
+}
+
+#if defined(CONFIG_CMD_ELF)
+static void do_bootm_vxworks (cmd_tbl_t *cmdtp, int flag,
+                            int argc, char *argv[],
+                            bootm_headers_t *images)
+{
+       char str[80];
+       image_header_t *hdr = &images->legacy_hdr_os_copy;
+
+#if defined(CONFIG_FIT)
+       if (!images->legacy_hdr_valid) {
+               fit_unsupported_reset ("VxWorks");
+               do_reset (cmdtp, flag, argc, argv);
+       }
+#endif
+
+       sprintf(str, "%x", image_get_ep (hdr)); /* write entry-point into string */
+       setenv("loadaddr", str);
+       do_bootvx(cmdtp, 0, 0, NULL);
+}
+
+static void do_bootm_qnxelf(cmd_tbl_t *cmdtp, int flag,
+                           int argc, char *argv[],
+                           bootm_headers_t *images)
+{
+       char *local_args[2];
+       char str[16];
+       image_header_t *hdr = &images->legacy_hdr_os_copy;
+
+#if defined(CONFIG_FIT)
+       if (!images->legacy_hdr_valid) {
+               fit_unsupported_reset ("QNX");
+               do_reset (cmdtp, flag, argc, argv);
+       }
+#endif
 
-/* Function that returns a character from the environment */
-extern uchar (*env_get_char)(int);
+       sprintf(str, "%x", image_get_ep (hdr)); /* write entry-point into string */
+       local_args[0] = argv[0];
+       local_args[1] = str;    /* and provide it via the arguments */
+       do_bootelf(cmdtp, 0, 2, local_args);
+}
+#endif
 
-static void
-do_bootm_artos (cmd_tbl_t *cmdtp, int flag,
-               int     argc, char *argv[],
-               ulong   addr,
-               ulong   *len_ptr,
-               int     verify)
+#if defined(CONFIG_ARTOS) && defined(CONFIG_PPC)
+static void do_bootm_artos (cmd_tbl_t *cmdtp, int flag,
+                          int argc, char *argv[],
+                          bootm_headers_t *images)
 {
        ulong top;
        char *s, *cmdline;
@@ -1170,7 +1055,14 @@ do_bootm_artos (cmd_tbl_t *cmdtp, int flag,
        int i, j, nxt, len, envno, envsz;
        bd_t *kbd;
        void (*entry)(bd_t *bd, char *cmdline, char **fwenv, ulong top);
-       image_header_t *hdr = &header;
+       image_header_t *hdr = &images->legacy_hdr_os_copy;
+
+#if defined(CONFIG_FIT)
+       if (!images->legacy_hdr_valid) {
+               fit_unsupported_reset ("ARTOS");
+               do_reset (cmdtp, flag, argc, argv);
+       }
+#endif
 
        /*
         * Booting an ARTOS kernel image + application
@@ -1191,27 +1083,27 @@ do_bootm_artos (cmd_tbl_t *cmdtp, int flag,
        debug ("=> set upper limit to 0x%08lX\n", top);
 
        /* first check the artos specific boot args, then the linux args*/
-       if ((s = getenv("abootargs")) == NULL && (s = getenv("bootargs")) == NULL)
+       if ((s = getenv( "abootargs")) == NULL && (s = getenv ("bootargs")) == NULL)
                s = "";
 
        /* get length of cmdline, and place it */
-       len = strlen(s);
+       len = strlen (s);
        top = (top - (len + 1)) & ~0xF;
        cmdline = (char *)top;
        debug ("## cmdline at 0x%08lX ", top);
-       strcpy(cmdline, s);
+       strcpy (cmdline, s);
 
        /* copy bdinfo */
-       top = (top - sizeof(bd_t)) & ~0xF;
+       top = (top - sizeof (bd_t)) & ~0xF;
        debug ("## bd at 0x%08lX ", top);
        kbd = (bd_t *)top;
-       memcpy(kbd, gd->bd, sizeof(bd_t));
+       memcpy (kbd, gd->bd, sizeof (bd_t));
 
        /* first find number of env entries, and their size */
        envno = 0;
        envsz = 0;
-       for (i = 0; env_get_char(i) != '\0'; i = nxt + 1) {
-               for (nxt = i; env_get_char(nxt) != '\0'; ++nxt)
+       for (i = 0; env_get_char (i) != '\0'; i = nxt + 1) {
+               for (nxt = i; env_get_char (nxt) != '\0'; ++nxt)
                        ;
                envno++;
                envsz += (nxt - i) + 1; /* plus trailing zero */
@@ -1219,7 +1111,7 @@ do_bootm_artos (cmd_tbl_t *cmdtp, int flag,
        envno++;        /* plus the terminating zero */
        debug ("## %u envvars total size %u ", envno, envsz);
 
-       top = (top - sizeof(char **)*envno) & ~0xF;
+       top = (top - sizeof (char **) * envno) & ~0xF;
        fwenv = (char **)top;
        debug ("## fwenv at 0x%08lX ", top);
 
@@ -1228,428 +1120,17 @@ do_bootm_artos (cmd_tbl_t *cmdtp, int flag,
        ss = fwenv;
 
        /* now copy them */
-       for (i = 0; env_get_char(i) != '\0'; i = nxt + 1) {
-               for (nxt = i; env_get_char(nxt) != '\0'; ++nxt)
+       for (i = 0; env_get_char (i) != '\0'; i = nxt + 1) {
+               for (nxt = i; env_get_char (nxt) != '\0'; ++nxt)
                        ;
                *ss++ = s;
                for (j = i; j < nxt; ++j)
-                       *s++ = env_get_char(j);
+                       *s++ = env_get_char (j);
                *s++ = '\0';
        }
        *ss++ = NULL;   /* terminate */
 
-       entry = (void (*)(bd_t *, char *, char **, ulong))ntohl(hdr->ih_ep);
-       (*entry)(kbd, cmdline, fwenv, top);
+       entry = (void (*)(bd_t *, char *, char **, ulong))image_get_ep (hdr);
+       (*entry) (kbd, cmdline, fwenv, top);
 }
 #endif
-
-
-#if defined(CONFIG_CMD_BOOTD)
-int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
-{
-       int rcode = 0;
-#ifndef CFG_HUSH_PARSER
-       if (run_command (getenv ("bootcmd"), flag) < 0) rcode = 1;
-#else
-       if (parse_string_outer(getenv("bootcmd"),
-               FLAG_PARSE_SEMICOLON | FLAG_EXIT_FROM_LOOP) != 0 ) rcode = 1;
-#endif
-       return rcode;
-}
-
-U_BOOT_CMD(
-       boot,   1,      1,      do_bootd,
-       "boot    - boot default, i.e., run 'bootcmd'\n",
-       NULL
-);
-
-/* keep old command name "bootd" for backward compatibility */
-U_BOOT_CMD(
-       bootd, 1,       1,      do_bootd,
-       "bootd   - boot default, i.e., run 'bootcmd'\n",
-       NULL
-);
-
-#endif
-
-#if defined(CONFIG_CMD_IMI)
-int do_iminfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
-{
-       int     arg;
-       ulong   addr;
-       int     rcode=0;
-
-       if (argc < 2) {
-               return image_info (load_addr);
-       }
-
-       for (arg=1; arg <argc; ++arg) {
-               addr = simple_strtoul(argv[arg], NULL, 16);
-               if (image_info (addr) != 0) rcode = 1;
-       }
-       return rcode;
-}
-
-static int image_info (ulong addr)
-{
-       ulong   data, len, checksum;
-       image_header_t *hdr = &header;
-
-       printf ("\n## Checking Image at %08lx ...\n", addr);
-
-       /* Copy header so we can blank CRC field for re-calculation */
-       memmove (&header, (char *)addr, sizeof(image_header_t));
-
-       if (ntohl(hdr->ih_magic) != IH_MAGIC) {
-               puts ("   Bad Magic Number\n");
-               return 1;
-       }
-
-       data = (ulong)&header;
-       len  = sizeof(image_header_t);
-
-       checksum = ntohl(hdr->ih_hcrc);
-       hdr->ih_hcrc = 0;
-
-       if (crc32 (0, (uchar *)data, len) != checksum) {
-               puts ("   Bad Header Checksum\n");
-               return 1;
-       }
-
-       /* for multi-file images we need the data part, too */
-       print_image_hdr ((image_header_t *)addr);
-
-       data = addr + sizeof(image_header_t);
-       len  = ntohl(hdr->ih_size);
-
-       puts ("   Verifying Checksum ... ");
-       if (crc32 (0, (uchar *)data, len) != ntohl(hdr->ih_dcrc)) {
-               puts ("   Bad Data CRC\n");
-               return 1;
-       }
-       puts ("OK\n");
-       return 0;
-}
-
-U_BOOT_CMD(
-       iminfo, CFG_MAXARGS,    1,      do_iminfo,
-       "iminfo  - print header information for application image\n",
-       "addr [addr ...]\n"
-       "    - print header information for application image starting at\n"
-       "      address 'addr' in memory; this includes verification of the\n"
-       "      image contents (magic number, header and payload checksums)\n"
-);
-
-#endif
-
-#if defined(CONFIG_CMD_IMLS)
-/*-----------------------------------------------------------------------
- * List all images found in flash.
- */
-int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
-{
-       flash_info_t *info;
-       int i, j;
-       image_header_t *hdr;
-       ulong data, len, checksum;
-
-       for (i=0, info=&flash_info[0]; i<CFG_MAX_FLASH_BANKS; ++i, ++info) {
-               if (info->flash_id == FLASH_UNKNOWN)
-                       goto next_bank;
-               for (j=0; j<info->sector_count; ++j) {
-
-                       if (!(hdr=(image_header_t *)info->start[j]) ||
-                           (ntohl(hdr->ih_magic) != IH_MAGIC))
-                               goto next_sector;
-
-                       /* Copy header so we can blank CRC field for re-calculation */
-                       memmove (&header, (char *)hdr, sizeof(image_header_t));
-
-                       checksum = ntohl(header.ih_hcrc);
-                       header.ih_hcrc = 0;
-
-                       if (crc32 (0, (uchar *)&header, sizeof(image_header_t))
-                           != checksum)
-                               goto next_sector;
-
-                       printf ("Image at %08lX:\n", (ulong)hdr);
-                       print_image_hdr( hdr );
-
-                       data = (ulong)hdr + sizeof(image_header_t);
-                       len  = ntohl(hdr->ih_size);
-
-                       puts ("   Verifying Checksum ... ");
-                       if (crc32 (0, (uchar *)data, len) != ntohl(hdr->ih_dcrc)) {
-                               puts ("   Bad Data CRC\n");
-                       }
-                       puts ("OK\n");
-next_sector:           ;
-               }
-next_bank:     ;
-       }
-
-       return (0);
-}
-
-U_BOOT_CMD(
-       imls,   1,              1,      do_imls,
-       "imls    - list all images found in flash\n",
-       "\n"
-       "    - Prints information about all images found at sector\n"
-       "      boundaries in flash.\n"
-);
-#endif
-
-void
-print_image_hdr (image_header_t *hdr)
-{
-#if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE)
-       time_t timestamp = (time_t)ntohl(hdr->ih_time);
-       struct rtc_time tm;
-#endif
-
-       printf ("   Image Name:   %.*s\n", IH_NMLEN, hdr->ih_name);
-#if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE)
-       to_tm (timestamp, &tm);
-       printf ("   Created:      %4d-%02d-%02d  %2d:%02d:%02d UTC\n",
-               tm.tm_year, tm.tm_mon, tm.tm_mday,
-               tm.tm_hour, tm.tm_min, tm.tm_sec);
-#endif
-       puts ("   Image Type:   "); print_type(hdr);
-       printf ("\n   Data Size:    %d Bytes = ", ntohl(hdr->ih_size));
-       print_size (ntohl(hdr->ih_size), "\n");
-       printf ("   Load Address: %08x\n"
-               "   Entry Point:  %08x\n",
-                ntohl(hdr->ih_load), ntohl(hdr->ih_ep));
-
-       if (hdr->ih_type == IH_TYPE_MULTI) {
-               int i;
-               ulong len;
-               ulong *len_ptr = (ulong *)((ulong)hdr + sizeof(image_header_t));
-
-               puts ("   Contents:\n");
-               for (i=0; (len = ntohl(*len_ptr)); ++i, ++len_ptr) {
-                       printf ("   Image %d: %8ld Bytes = ", i, len);
-                       print_size (len, "\n");
-               }
-       }
-}
-
-
-static void
-print_type (image_header_t *hdr)
-{
-       char *os, *arch, *type, *comp;
-
-       switch (hdr->ih_os) {
-       case IH_OS_INVALID:     os = "Invalid OS";              break;
-       case IH_OS_NETBSD:      os = "NetBSD";                  break;
-       case IH_OS_LINUX:       os = "Linux";                   break;
-       case IH_OS_VXWORKS:     os = "VxWorks";                 break;
-       case IH_OS_QNX:         os = "QNX";                     break;
-       case IH_OS_U_BOOT:      os = "U-Boot";                  break;
-       case IH_OS_RTEMS:       os = "RTEMS";                   break;
-#ifdef CONFIG_ARTOS
-       case IH_OS_ARTOS:       os = "ARTOS";                   break;
-#endif
-#ifdef CONFIG_LYNXKDI
-       case IH_OS_LYNXOS:      os = "LynxOS";                  break;
-#endif
-       default:                os = "Unknown OS";              break;
-       }
-
-       switch (hdr->ih_arch) {
-       case IH_CPU_INVALID:    arch = "Invalid CPU";           break;
-       case IH_CPU_ALPHA:      arch = "Alpha";                 break;
-       case IH_CPU_ARM:        arch = "ARM";                   break;
-       case IH_CPU_AVR32:      arch = "AVR32";                 break;
-       case IH_CPU_BLACKFIN:   arch = "Blackfin";              break;
-       case IH_CPU_I386:       arch = "Intel x86";             break;
-       case IH_CPU_IA64:       arch = "IA64";                  break;
-       case IH_CPU_M68K:       arch = "M68K";                  break;
-       case IH_CPU_MICROBLAZE: arch = "Microblaze";            break;
-       case IH_CPU_MIPS64:     arch = "MIPS 64 Bit";           break;
-       case IH_CPU_MIPS:       arch = "MIPS";                  break;
-       case IH_CPU_NIOS2:      arch = "Nios-II";               break;
-       case IH_CPU_NIOS:       arch = "Nios";                  break;
-       case IH_CPU_PPC:        arch = "PowerPC";               break;
-       case IH_CPU_S390:       arch = "IBM S390";              break;
-       case IH_CPU_SH:         arch = "SuperH";                break;
-       case IH_CPU_SPARC64:    arch = "SPARC 64 Bit";          break;
-       case IH_CPU_SPARC:      arch = "SPARC";                 break;
-       default:                arch = "Unknown Architecture";  break;
-       }
-
-       switch (hdr->ih_type) {
-       case IH_TYPE_INVALID:   type = "Invalid Image";         break;
-       case IH_TYPE_STANDALONE:type = "Standalone Program";    break;
-       case IH_TYPE_KERNEL:    type = "Kernel Image";          break;
-       case IH_TYPE_RAMDISK:   type = "RAMDisk Image";         break;
-       case IH_TYPE_MULTI:     type = "Multi-File Image";      break;
-       case IH_TYPE_FIRMWARE:  type = "Firmware";              break;
-       case IH_TYPE_SCRIPT:    type = "Script";                break;
-       case IH_TYPE_FLATDT:    type = "Flat Device Tree";      break;
-       default:                type = "Unknown Image";         break;
-       }
-
-       switch (hdr->ih_comp) {
-       case IH_COMP_NONE:      comp = "uncompressed";          break;
-       case IH_COMP_GZIP:      comp = "gzip compressed";       break;
-       case IH_COMP_BZIP2:     comp = "bzip2 compressed";      break;
-       default:                comp = "unknown compression";   break;
-       }
-
-       printf ("%s %s %s (%s)", arch, os, type, comp);
-}
-
-#define        ZALLOC_ALIGNMENT        16
-
-static void *zalloc(void *x, unsigned items, unsigned size)
-{
-       void *p;
-
-       size *= items;
-       size = (size + ZALLOC_ALIGNMENT - 1) & ~(ZALLOC_ALIGNMENT - 1);
-
-       p = malloc (size);
-
-       return (p);
-}
-
-static void zfree(void *x, void *addr, unsigned nb)
-{
-       free (addr);
-}
-
-#define HEAD_CRC       2
-#define EXTRA_FIELD    4
-#define ORIG_NAME      8
-#define COMMENT                0x10
-#define RESERVED       0xe0
-
-#define DEFLATED       8
-
-int gunzip(void *dst, int dstlen, unsigned char *src, unsigned long *lenp)
-{
-       z_stream s;
-       int r, i, flags;
-
-       /* skip header */
-       i = 10;
-       flags = src[3];
-       if (src[2] != DEFLATED || (flags & RESERVED) != 0) {
-               puts ("Error: Bad gzipped data\n");
-               return (-1);
-       }
-       if ((flags & EXTRA_FIELD) != 0)
-               i = 12 + src[10] + (src[11] << 8);
-       if ((flags & ORIG_NAME) != 0)
-               while (src[i++] != 0)
-                       ;
-       if ((flags & COMMENT) != 0)
-               while (src[i++] != 0)
-                       ;
-       if ((flags & HEAD_CRC) != 0)
-               i += 2;
-       if (i >= *lenp) {
-               puts ("Error: gunzip out of data in header\n");
-               return (-1);
-       }
-
-       s.zalloc = zalloc;
-       s.zfree = zfree;
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
-       s.outcb = (cb_func)WATCHDOG_RESET;
-#else
-       s.outcb = Z_NULL;
-#endif /* CONFIG_HW_WATCHDOG */
-
-       r = inflateInit2(&s, -MAX_WBITS);
-       if (r != Z_OK) {
-               printf ("Error: inflateInit2() returned %d\n", r);
-               return (-1);
-       }
-       s.next_in = src + i;
-       s.avail_in = *lenp - i;
-       s.next_out = dst;
-       s.avail_out = dstlen;
-       r = inflate(&s, Z_FINISH);
-       if (r != Z_OK && r != Z_STREAM_END) {
-               printf ("Error: inflate() returned %d\n", r);
-               return (-1);
-       }
-       *lenp = s.next_out - (unsigned char *) dst;
-       inflateEnd(&s);
-
-       return (0);
-}
-
-#ifdef CONFIG_BZIP2
-void bz_internal_error(int errcode)
-{
-       printf ("BZIP2 internal error %d\n", errcode);
-}
-#endif /* CONFIG_BZIP2 */
-
-static void
-do_bootm_rtems (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
-               ulong addr, ulong *len_ptr, int verify)
-{
-       image_header_t *hdr = &header;
-       void    (*entry_point)(bd_t *);
-
-       entry_point = (void (*)(bd_t *)) ntohl(hdr->ih_ep);
-
-       printf ("## Transferring control to RTEMS (at address %08lx) ...\n",
-               (ulong)entry_point);
-
-       show_boot_progress (15);
-
-       /*
-        * RTEMS Parameters:
-        *   r3: ptr to board info data
-        */
-
-       (*entry_point ) ( gd->bd );
-}
-
-#if defined(CONFIG_CMD_ELF)
-static void
-do_bootm_vxworks (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
-                 ulong addr, ulong *len_ptr, int verify)
-{
-       image_header_t *hdr = &header;
-       char str[80];
-
-       sprintf(str, "%x", ntohl(hdr->ih_ep)); /* write entry-point into string */
-       setenv("loadaddr", str);
-       do_bootvx(cmdtp, 0, 0, NULL);
-}
-
-static void
-do_bootm_qnxelf (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
-                ulong addr, ulong *len_ptr, int verify)
-{
-       image_header_t *hdr = &header;
-       char *local_args[2];
-       char str[16];
-
-       sprintf(str, "%x", ntohl(hdr->ih_ep)); /* write entry-point into string */
-       local_args[0] = argv[0];
-       local_args[1] = str;    /* and provide it via the arguments */
-       do_bootelf(cmdtp, 0, 2, local_args);
-}
-#endif
-
-#ifdef CONFIG_LYNXKDI
-static void
-do_bootm_lynxkdi (cmd_tbl_t *cmdtp, int flag,
-                int    argc, char *argv[],
-                ulong  addr,
-                ulong  *len_ptr,
-                int    verify)
-{
-       lynxkdi_boot( &header );
-}
-
-#endif /* CONFIG_LYNXKDI */
diff --git a/common/cmd_cplbinfo.c b/common/cmd_cplbinfo.c
new file mode 100644 (file)
index 0000000..b2bbec1
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * cmd_cplbinfo.c - dump the instruction/data cplb tables
+ *
+ * Copyright (c) 2007-2008 Analog Devices Inc.
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#include <common.h>
+#include <command.h>
+#include <asm/blackfin.h>
+#include <asm/cplb.h>
+#include <asm/mach-common/bits/mpu.h>
+
+/*
+ * Translate the PAGE_SIZE bits into a human string
+ */
+static const char *cplb_page_size(uint32_t data)
+{
+       static const char page_size_string_table[][4] = { "1K", "4K", "1M", "4M" };
+       return page_size_string_table[(data & PAGE_SIZE_MASK) >> PAGE_SIZE_SHIFT];
+}
+
+/*
+ * show a hardware cplb table
+ */
+static void show_cplb_table(uint32_t *addr, uint32_t *data)
+{
+       size_t i;
+       printf("      Address     Data   Size  Valid  Locked\n");
+       for (i = 1; i <= 16; ++i) {
+               printf(" %2i 0x%p  0x%05X   %s     %c      %c\n",
+                       i, *addr, *data,
+                       cplb_page_size(*data),
+                       (*data & CPLB_VALID ? 'Y' : 'N'),
+                       (*data & CPLB_LOCK ? 'Y' : 'N'));
+               ++addr;
+               ++data;
+       }
+}
+
+/*
+ * display current instruction and data cplb tables
+ */
+int do_cplbinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+       printf("%s CPLB table [%08x]:\n", "Instruction", *(uint32_t *)DMEM_CONTROL);
+       show_cplb_table((uint32_t *)ICPLB_ADDR0, (uint32_t *)ICPLB_DATA0);
+
+       printf("%s CPLB table [%08x]:\n", "Data", *(uint32_t *)IMEM_CONTROL);
+       show_cplb_table((uint32_t *)DCPLB_ADDR0, (uint32_t *)DCPLB_DATA0);
+
+       return 0;
+}
+
+U_BOOT_CMD(cplbinfo, 1, 0, do_cplbinfo,
+       "cplbinfo- display current CPLB tables\n",
+       "\n"
+       "    - display current CPLB tables\n");
index 3d717c0..83aba37 100644 (file)
@@ -205,6 +205,9 @@ int do_docboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        ulong offset = 0;
        image_header_t *hdr;
        int rcode = 0;
+#if defined(CONFIG_FIT)
+       const void *fit_hdr;
+#endif
 
        show_boot_progress (34);
        switch (argc) {
@@ -261,21 +264,36 @@ int do_docboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        }
        show_boot_progress (38);
 
-       hdr = (image_header_t *)addr;
+       switch (genimg_get_format ((void *)addr)) {
+       case IMAGE_FORMAT_LEGACY:
+               hdr = (image_header_t *)addr;
 
-       if (hdr->ih_magic == IH_MAGIC) {
+               image_print_contents (hdr);
 
-               print_image_hdr (hdr);
+               cnt = image_get_image_size (hdr);
+               break;
+#if defined(CONFIG_FIT)
+       case IMAGE_FORMAT_FIT:
+               fit_hdr = (const void *)addr;
+               if (!fit_check_format (fit_hdr)) {
+                       show_boot_progress (-130);
+                       puts ("** Bad FIT image format\n");
+                       return 1;
+               }
+               show_boot_progress (131);
+               puts ("Fit image detected...\n");
 
-               cnt = (ntohl(hdr->ih_size) + sizeof(image_header_t));
-               cnt -= SECTORSIZE;
-       } else {
-               puts ("\n** Bad Magic Number **\n");
+               cnt = fit_get_size (fit_hdr);
+               break;
+#endif
+       default:
                show_boot_progress (-39);
+               puts ("** Unknown image type\n");
                return 1;
        }
        show_boot_progress (39);
 
+       cnt -= SECTORSIZE;
        if (doc_rw (doc_dev_desc + dev, 1, offset + SECTORSIZE, cnt,
                    NULL, (u_char *)(addr+SECTORSIZE))) {
                printf ("** Read error on %d\n", dev);
@@ -284,6 +302,12 @@ int do_docboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        }
        show_boot_progress (40);
 
+#if defined(CONFIG_FIT)
+       /* This cannot be done earlier, we need complete FIT image in RAM first */
+       if (genimg_get_format ((void *)addr) == IMAGE_FORMAT_FIT)
+               fit_print_contents ((const void *)addr);
+#endif
+
        /* Loading ok, update default load address */
 
        load_addr = addr;
index 2eb7453..62e5e76 100644 (file)
@@ -30,6 +30,32 @@ DECLARE_GLOBAL_DATA_PTR;
 int valid_elf_image (unsigned long addr);
 unsigned long load_elf_image (unsigned long addr);
 
+/* Allow ports to override the default behavior */
+__attribute__((weak))
+unsigned long do_bootelf_exec (ulong (*entry)(int, char *[]), int argc, char *argv[])
+{
+       unsigned long ret;
+
+       /*
+        * QNX images require the data cache is disabled.
+        * Data cache is already flushed, so just turn it off.
+        */
+       int dcache = dcache_status ();
+       if (dcache)
+               dcache_disable ();
+
+       /*
+        * pass address parameter as argv[0] (aka command name),
+        * and all remaining args
+        */
+       ret = entry (argc, argv);
+
+       if (dcache)
+               dcache_enable ();
+
+       return ret;
+}
+
 /* ======================================================================
  * Interpreter command to boot an arbitrary ELF image from memory.
  * ====================================================================== */
@@ -54,17 +80,10 @@ int do_bootelf (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        printf ("## Starting application at 0x%08lx ...\n", addr);
 
        /*
-        * QNX images require the data cache is disabled.
-        * Data cache is already flushed, so just turn it off.
-        */
-       if (dcache_status ())
-               dcache_disable ();
-
-       /*
         * pass address parameter as argv[0] (aka command name),
         * and all remaining args
         */
-       rc = ((ulong (*)(int, char *[])) addr) (--argc, &argv[1]);
+       rc = do_bootelf_exec ((void *)addr, argc - 1, argv + 1);
        if (rc != 0)
                rcode = 1;
 
index 7349412..bf28370 100644 (file)
@@ -788,6 +788,9 @@ int do_fdcboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        int i,nrofblk;
        char *ep;
        int rcode = 0;
+#if defined(CONFIG_FIT)
+       const void *fit_hdr;
+#endif
 
        switch (argc) {
        case 1:
@@ -835,14 +838,31 @@ int do_fdcboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                        printf("result%d: 0x%02X\n",i,pCMD->result[i]);
                return 1;
        }
-       hdr = (image_header_t *)addr;
-       if (ntohl(hdr->ih_magic)  != IH_MAGIC) {
-               printf ("Bad Magic Number\n");
+
+       switch (genimg_get_format ((void *)addr)) {
+       case IMAGE_FORMAT_LEGACY:
+               hdr = (image_header_t *)addr;
+               image_print_contents (hdr);
+
+               imsize = image_get_image_size (hdr);
+               break;
+#if defined(CONFIG_FIT)
+       case IMAGE_FORMAT_FIT:
+               fit_hdr = (const void *)addr;
+               if (!fit_check_format (fit_hdr)) {
+                       puts ("** Bad FIT image format\n");
+                       return 1;
+               }
+               puts ("Fit image detected...\n");
+
+               imsize = fit_get_size (fit_hdr);
+               break;
+#endif
+       default:
+               puts ("** Unknown image type\n");
                return 1;
        }
-       print_image_hdr(hdr);
 
-       imsize= ntohl(hdr->ih_size)+sizeof(image_header_t);
        nrofblk=imsize/512;
        if((imsize%512)>0)
                nrofblk++;
@@ -858,23 +878,28 @@ int do_fdcboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        printf("OK %ld Bytes loaded.\n",imsize);
 
        flush_cache (addr, imsize);
-       /* Loading ok, update default load address */
 
+#if defined(CONFIG_FIT)
+       /* This cannot be done earlier, we need complete FIT image in RAM first */
+       if (genimg_get_format ((void *)addr) == IMAGE_FORMAT_FIT)
+               fit_print_contents ((const void *)addr);
+#endif
+
+       /* Loading ok, update default load address */
        load_addr = addr;
-       if(hdr->ih_type  == IH_TYPE_KERNEL) {
-               /* Check if we should attempt an auto-start */
-               if (((ep = getenv("autostart")) != NULL) && (strcmp(ep,"yes") == 0)) {
-                       char *local_args[2];
-                       extern int do_bootm (cmd_tbl_t *, int, int, char *[]);
 
-                       local_args[0] = argv[0];
-                       local_args[1] = NULL;
+       /* Check if we should attempt an auto-start */
+       if (((ep = getenv("autostart")) != NULL) && (strcmp(ep,"yes") == 0)) {
+               char *local_args[2];
+               extern int do_bootm (cmd_tbl_t *, int, int, char *[]);
 
-                       printf ("Automatic boot of image at addr 0x%08lX ...\n", addr);
+               local_args[0] = argv[0];
+               local_args[1] = NULL;
 
-                       do_bootm (cmdtp, 0, 1, local_args);
-                       rcode ++;
-               }
+               printf ("Automatic boot of image at addr 0x%08lX ...\n", addr);
+
+               do_bootm (cmdtp, 0, 1, local_args);
+               rcode ++;
        }
        return rcode;
 }
index 9cd22ee..7436a95 100644 (file)
@@ -42,8 +42,7 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 static int fdt_valid(void);
-static int fdt_parse_prop(char *pathp, char *prop, char *newval,
-       char *data, int *len);
+static int fdt_parse_prop(char **newval, int count, char *data, int *len);
 static int fdt_print(const char *pathp, char *prop, int depth);
 
 /*
@@ -202,7 +201,7 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
                if (argc == 4) {
                        len = 0;
                } else {
-                       ret = fdt_parse_prop(pathp, prop, argv[4], data, &len);
+                       ret = fdt_parse_prop(&argv[4], argc - 4, data, &len);
                        if (ret != 0)
                                return ret;
                }
@@ -260,7 +259,7 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
        /********************************************************************
         * Remove a property/node
         ********************************************************************/
-       } else if (argv[1][0] == 'r') {
+       } else if ((argv[1][0] == 'r') && (argv[1][1] == 'm')) {
                int  nodeoffset;        /* node offset from libfdt */
                int  err;
 
@@ -296,6 +295,111 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
                                return err;
                        }
                }
+
+       /********************************************************************
+        * Display header info
+        ********************************************************************/
+       } else if (argv[1][0] == 'h') {
+               u32 version = fdt_version(fdt);
+               printf("magic:\t\t\t0x%x\n", fdt_magic(fdt));
+               printf("totalsize:\t\t0x%x (%d)\n", fdt_totalsize(fdt), fdt_totalsize(fdt));
+               printf("off_dt_struct:\t\t0x%x\n", fdt_off_dt_struct(fdt));
+               printf("off_dt_strings:\t\t0x%x\n", fdt_off_dt_strings(fdt));
+               printf("off_mem_rsvmap:\t\t0x%x\n", fdt_off_mem_rsvmap(fdt));
+               printf("version:\t\t%d\n", version);
+               printf("last_comp_version:\t%d\n", fdt_last_comp_version(fdt));
+               if (version >= 2)
+                       printf("boot_cpuid_phys:\t0x%x\n",
+                               fdt_boot_cpuid_phys(fdt));
+               if (version >= 3)
+                       printf("size_dt_strings:\t0x%x\n",
+                               fdt_size_dt_strings(fdt));
+               if (version >= 17)
+                       printf("size_dt_struct:\t\t0x%x\n",
+                               fdt_size_dt_struct(fdt));
+               printf("number mem_rsv:\t\t0x%x\n", fdt_num_mem_rsv(fdt));
+               printf("\n");
+
+       /********************************************************************
+        * Set boot cpu id
+        ********************************************************************/
+       } else if ((argv[1][0] == 'b') && (argv[1][1] == 'o') &&
+                  (argv[1][2] == 'o')) {
+               unsigned long tmp = simple_strtoul(argv[2], NULL, 16);
+               fdt_set_boot_cpuid_phys(fdt, tmp);
+
+       /********************************************************************
+        * memory command
+        ********************************************************************/
+       } else if ((argv[1][0] == 'm') && (argv[1][1] == 'e')) {
+               uint64_t addr, size;
+               int err;
+#ifdef CFG_64BIT_STRTOUL
+                       addr = simple_strtoull(argv[2], NULL, 16);
+                       size = simple_strtoull(argv[3], NULL, 16);
+#else
+                       addr = simple_strtoul(argv[2], NULL, 16);
+                       size = simple_strtoul(argv[3], NULL, 16);
+#endif
+               err = fdt_fixup_memory(fdt, addr, size);
+               if (err < 0)
+                       return err;
+
+       /********************************************************************
+        * mem reserve commands
+        ********************************************************************/
+       } else if ((argv[1][0] == 'r') && (argv[1][1] == 's')) {
+               if (argv[2][0] == 'p') {
+                       uint64_t addr, size;
+                       int total = fdt_num_mem_rsv(fdt);
+                       int j, err;
+                       printf("index\t\t   start\t\t    size\n");
+                       printf("-------------------------------"
+                               "-----------------\n");
+                       for (j = 0; j < total; j++) {
+                               err = fdt_get_mem_rsv(fdt, j, &addr, &size);
+                               if (err < 0) {
+                                       printf("libfdt fdt_get_mem_rsv():  %s\n",
+                                                       fdt_strerror(err));
+                                       return err;
+                               }
+                               printf("    %x\t%08x%08x\t%08x%08x\n", j,
+                                       (u32)(addr >> 32),
+                                       (u32)(addr & 0xffffffff),
+                                       (u32)(size >> 32),
+                                       (u32)(size & 0xffffffff));
+                       }
+               } else if (argv[2][0] == 'a') {
+                       uint64_t addr, size;
+                       int err;
+#ifdef CFG_64BIT_STRTOUL
+                       addr = simple_strtoull(argv[3], NULL, 16);
+                       size = simple_strtoull(argv[4], NULL, 16);
+#else
+                       addr = simple_strtoul(argv[3], NULL, 16);
+                       size = simple_strtoul(argv[4], NULL, 16);
+#endif
+                       err = fdt_add_mem_rsv(fdt, addr, size);
+
+                       if (err < 0) {
+                               printf("libfdt fdt_add_mem_rsv():  %s\n",
+                                       fdt_strerror(err));
+                               return err;
+                       }
+               } else if (argv[2][0] == 'd') {
+                       unsigned long idx = simple_strtoul(argv[3], NULL, 16);
+                       int err = fdt_del_mem_rsv(fdt, idx);
+
+                       if (err < 0) {
+                               printf("libfdt fdt_del_mem_rsv():  %s\n",
+                                       fdt_strerror(err));
+                               return err;
+                       }
+               } else {
+                       /* Unrecognized command */
+                       printf ("Usage:\n%s\n", cmdtp->usage);
+                       return 1;
+               }
        }
 #ifdef CONFIG_OF_BOARD_SETUP
        /* Call the board-specific fixup routine */
@@ -305,17 +409,6 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
        /* Create a chosen node */
        else if (argv[1][0] == 'c')
                fdt_chosen(fdt, 0, 0, 1);
-
-#ifdef CONFIG_OF_HAS_UBOOT_ENV
-       /* Create a u-boot-env node */
-       else if (argv[1][0] == 'e')
-               fdt_env(fdt);
-#endif
-#ifdef CONFIG_OF_HAS_BD_T
-       /* Create a bd_t node */
-       else if (argv[1][0] == 'b')
-               fdt_bd_t(fdt);
-#endif
        else {
                /* Unrecognized command */
                printf ("Usage:\n%s\n", cmdtp->usage);
@@ -370,69 +463,77 @@ static int fdt_valid(void)
 
 /*
  * Parse the user's input, partially heuristic.  Valid formats:
- * <00>                - hex byte
- * <0011>      - hex half word (16 bits)
- * <00112233>  - hex word (32 bits)
- *             - hex double words (64 bits) are not supported, must use
- *                     a byte stream instead.
+ * <0x00112233 4 05>   - an array of cells.  Numbers follow standard
+ *                     C conventions.
  * [00 11 22 .. nn] - byte stream
  * "string"    - If the the value doesn't start with "<" or "[", it is
  *                     treated as a string.  Note that the quotes are
  *                     stripped by the parser before we get the string.
+ * newval: An array of strings containing the new property as specified
+ *     on the command line
+ * count: The number of strings in the array
+ * data: A bytestream to be placed in the property
+ * len: The length of the resulting bytestream
  */
-static int fdt_parse_prop(char *pathp, char *prop, char *newval,
-       char *data, int *len)
+static int fdt_parse_prop(char **newval, int count, char *data, int *len)
 {
        char *cp;               /* temporary char pointer */
+       char *newp;             /* temporary newval char pointer */
        unsigned long tmp;      /* holds converted values */
+       int stridx = 0;
 
-       if (*newval == '<') {
-               /*
-                * Bigger values than bytes.
-                */
-               *len = 0;
-               newval++;
-               while ((*newval != '>') && (*newval != '\0')) {
-                       cp = newval;
-                       tmp = simple_strtoul(cp, &newval, 16);
-                       if ((newval - cp) <= 2) {
-                               *data = tmp & 0xFF;
-                               data  += 1;
-                               *len += 1;
-                       } else if ((newval - cp) <= 4) {
-                               *(uint16_t *)data = __cpu_to_be16(tmp);
-                               data  += 2;
-                               *len += 2;
-                       } else if ((newval - cp) <= 8) {
-                               *(uint32_t *)data = __cpu_to_be32(tmp);
-                               data  += 4;
-                               *len += 4;
-                       } else {
+       *len = 0;
+       newp = newval[0];
+
+       /* An array of cells */
+       if (*newp == '<') {
+               newp++;
+               while ((*newp != '>') && (stridx < count)) {
+                       /*
+                        * Keep searching until we find that last ">"
+                        * That way users don't have to escape the spaces
+                        */
+                       if (*newp == '\0') {
+                               newp = newval[++stridx];
+                               continue;
+                       }
+
+                       cp = newp;
+                       tmp = simple_strtoul(cp, &newp, 0);
+                       *(uint32_t *)data = __cpu_to_be32(tmp);
+                       data  += 4;
+                       *len += 4;
+
+                       /* If the ptr didn't advance, something went wrong */
+                       if ((newp - cp) <= 0) {
                                printf("Sorry, I could not convert \"%s\"\n",
                                        cp);
                                return 1;
                        }
-                       while (*newval == ' ')
-                               newval++;
+
+                       while (*newp == ' ')
+                               newp++;
                }
-               if (*newval != '>') {
-                       printf("Unexpected character '%c'\n", *newval);
+
+               if (*newp != '>') {
+                       printf("Unexpected character '%c'\n", *newp);
                        return 1;
                }
-       } else if (*newval == '[') {
+       } else if (*newp == '[') {
                /*
                 * Byte stream.  Convert the values.
                 */
-               *len = 0;
-               newval++;
-               while ((*newval != ']') && (*newval != '\0')) {
-                       tmp = simple_strtoul(newval, &newval, 16);
+               newp++;
+               while ((*newp != ']') && (stridx < count)) {
+                       tmp = simple_strtoul(newp, &newp, 16);
                        *data++ = tmp & 0xFF;
                        *len    = *len + 1;
-                       while (*newval == ' ')
-                               newval++;
+                       while (*newp == ' ')
+                               newp++;
+                       if (*newp != '\0')
+                               newp = newval[++stridx];
                }
-               if (*newval != ']') {
+               if (*newp != ']') {
                        printf("Unexpected character '%c'\n", *newval);
                        return 1;
                }
@@ -441,8 +542,11 @@ static int fdt_parse_prop(char *pathp, char *prop, char *newval,
                 * Assume it is a string.  Copy it into our data area for
                 * convenience (including the terminating '\0').
                 */
-               *len = strlen(newval) + 1;
-               strcpy(data, newval);
+               while (stridx < count) {
+                       *len = strlen(newp) + 1;
+                       strcpy(data, newp);
+                       newp = newval[++stridx];
+               }
        }
        return 0;
 }
@@ -499,7 +603,6 @@ static int is_printable_string(const void *data, int len)
 static void print_data(const void *data, int len)
 {
        int j;
-       const u8 *s;
 
        /* no data, don't print */
        if (len == 0)
@@ -522,32 +625,20 @@ static void print_data(const void *data, int len)
                return;
        }
 
-       switch (len) {
-       case 1:  /* byte */
-               printf("<0x%02x>", (*(u8 *) data) & 0xff);
-               break;
-       case 2:  /* half-word */
-               printf("<0x%04x>", be16_to_cpu(*(u16 *) data) & 0xffff);
-               break;
-       case 4:  /* word */
-               printf("<0x%08x>", be32_to_cpu(*(u32 *) data) & 0xffffffffU);
-               break;
-       case 8:  /* double-word */
-#if __WORDSIZE == 64
-               printf("<0x%016llx>", be64_to_cpu(*(uint64_t *) data));
-#else
-               printf("<0x%08x ", be32_to_cpu(*(u32 *) data) & 0xffffffffU);
-               data += 4;
-               printf("0x%08x>", be32_to_cpu(*(u32 *) data) & 0xffffffffU);
-#endif
-               break;
-       default:                /* anything else... hexdump */
+       if ((len %4) == 0) {
+               const u32 *p;
+
+               printf("<");
+               for (j = 0, p = data; j < len/4; j ++)
+                       printf("0x%x%s", p[j], j < (len/4 - 1) ? " " : "");
+               printf(">");
+       } else { /* anything else... hexdump */
+               const u8 *s;
+
                printf("[");
                for (j = 0, s = data; j < len; j++)
                        printf("%02x%s", s[j], j < len - 1 ? " " : "");
                printf("]");
-
-               break;
        }
 }
 
@@ -677,7 +768,7 @@ static int fdt_print(const char *pathp, char *prop, int depth)
 /********************************************************************/
 
 U_BOOT_CMD(
-       fdt,    5,      0,      do_fdt,
+       fdt,    255,    0,      do_fdt,
        "fdt     - flattened device tree utility commands\n",
            "addr   <addr> [<length>]        - Set the fdt location to <addr>\n"
 #ifdef CONFIG_OF_BOARD_SETUP
@@ -689,13 +780,13 @@ U_BOOT_CMD(
        "fdt set    <path> <prop> [<val>]    - Set <property> [to <val>]\n"
        "fdt mknode <path> <node>            - Create a new node after <path>\n"
        "fdt rm     <path> [<prop>]          - Delete the node or <property>\n"
+       "fdt header                          - Display header info\n"
+       "fdt bootcpu <id>                    - Set boot cpuid\n"
+       "fdt memory <addr> <size>            - Add/Update memory node\n"
+       "fdt rsvmem print                    - Show current mem reserves\n"
+       "fdt rsvmem add <addr> <size>        - Add a mem reserve\n"
+       "fdt rsvmem delete <index>           - Delete a mem reserves\n"
        "fdt chosen - Add/update the /chosen branch in the tree\n"
-#ifdef CONFIG_OF_HAS_UBOOT_ENV
-       "fdt env    - Add/replace the /u-boot-env branch in the tree\n"
-#endif
-#ifdef CONFIG_OF_HAS_BD_T
-       "fdt bd_t   - Add/replace the /bd_t branch in the tree\n"
-#endif
        "NOTE: If the path or property you are setting/printing has a '#' character\n"
        "     or spaces, you MUST escape it with a \\ character or quote it with \".\n"
 );
index f56443e..db5dec9 100644 (file)
@@ -41,6 +41,7 @@ int find_dev_and_part(const char *id, struct mtd_device **dev,
                u8 *part_num, struct part_info **part);
 #endif
 
+#ifndef CFG_NO_FLASH
 extern flash_info_t flash_info[];      /* info for FLASH chips */
 
 /*
@@ -275,15 +276,19 @@ flash_fill_sect_ranges (ulong addr_first, ulong addr_last,
 
        return rcode;
 }
+#endif /* CFG_NO_FLASH */
 
 int do_flinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
+#ifndef CFG_NO_FLASH
        ulong bank;
+#endif
 
 #ifdef CONFIG_HAS_DATAFLASH
        dataflash_print_info();
 #endif
 
+#ifndef CFG_NO_FLASH
        if (argc == 1) {        /* print info for all FLASH banks */
                for (bank=0; bank <CFG_MAX_FLASH_BANKS; ++bank) {
                        printf ("\nBank # %ld: ", bank+1);
@@ -301,11 +306,13 @@ int do_flinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        }
        printf ("\nBank # %ld: ", bank);
        flash_print_info (&flash_info[bank-1]);
+#endif /* CFG_NO_FLASH */
        return 0;
 }
 
 int do_flerase (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
+#ifndef CFG_NO_FLASH
        flash_info_t *info;
        ulong bank, addr_first, addr_last;
        int n, sect_first, sect_last;
@@ -397,8 +404,12 @@ int do_flerase (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
        rcode = flash_sect_erase(addr_first, addr_last);
        return rcode;
+#else
+       return 0;
+#endif /* CFG_NO_FLASH */
 }
 
+#ifndef CFG_NO_FLASH
 int flash_sect_erase (ulong addr_first, ulong addr_last)
 {
        flash_info_t *info;
@@ -439,12 +450,17 @@ int flash_sect_erase (ulong addr_first, ulong addr_last)
        }
        return rcode;
 }
+#endif /* CFG_NO_FLASH */
 
 int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
+#ifndef CFG_NO_FLASH
        flash_info_t *info;
-       ulong bank, addr_first, addr_last;
-       int i, p, n, sect_first, sect_last;
+       ulong bank;
+       int i, n, sect_first, sect_last;
+#endif /* CFG_NO_FLASH */
+       ulong addr_first, addr_last;
+       int p;
 #if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
        struct mtd_device *dev;
        struct part_info *part;
@@ -487,6 +503,7 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        }
 #endif
 
+#ifndef CFG_NO_FLASH
        if (strcmp(argv[2], "all") == 0) {
                for (bank=1; bank<=CFG_MAX_FLASH_BANKS; ++bank) {
                        info = &flash_info[bank-1];
@@ -611,10 +628,11 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                return 1;
        }
        rcode = flash_sect_protect (p, addr_first, addr_last);
+#endif /* CFG_NO_FLASH */
        return rcode;
 }
 
-
+#ifndef CFG_NO_FLASH
 int flash_sect_protect (int p, ulong addr_first, ulong addr_last)
 {
        flash_info_t *info;
@@ -667,6 +685,7 @@ int flash_sect_protect (int p, ulong addr_first, ulong addr_last)
        }
        return rcode;
 }
+#endif /* CFG_NO_FLASH */
 
 
 /**************************************************/
index f55447a..9141dcc 100644 (file)
@@ -164,6 +164,10 @@ int do_fpga (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
        char *devstr = getenv ("fpga");
        char *datastr = getenv ("fpgadata");
        int rc = FPGA_FAIL;
+#if defined (CONFIG_FIT)
+       const char *fit_uname = NULL;
+       ulong fit_addr;
+#endif
 
        if (devstr)
                dev = (int) simple_strtoul (devstr, NULL, 16);
@@ -173,9 +177,22 @@ int do_fpga (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
        switch (argc) {
        case 5:         /* fpga <op> <dev> <data> <datasize> */
                data_size = simple_strtoul (argv[4], NULL, 16);
+
        case 4:         /* fpga <op> <dev> <data> */
-               fpga_data = (void *) simple_strtoul (argv[3], NULL, 16);
+#if defined(CONFIG_FIT)
+               if (fit_parse_subimage (argv[3], (ulong)fpga_data,
+                                       &fit_addr, &fit_uname)) {
+                       fpga_data = (void *)fit_addr;
+                       debug ("*  fpga: subimage '%s' from FIT image at 0x%08lx\n",
+                                       fit_uname, fit_addr);
+               } else
+#endif
+               {
+                       fpga_data = (void *) simple_strtoul (argv[3], NULL, 16);
+                       debug ("*  fpga: cmdline image address = 0x%08lx\n", (ulong)fpga_data);
+               }
                PRINTF ("%s: fpga_data = 0x%x\n", __FUNCTION__, (uint) fpga_data);
+
        case 3:         /* fpga <op> <dev | data addr> */
                dev = (int) simple_strtoul (argv[2], NULL, 16);
                PRINTF ("%s: device = %d\n", __FUNCTION__, dev);
@@ -183,14 +200,29 @@ int do_fpga (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
                if ((argc == 3) && (dev > fpga_count ())) {     /* must be buffer ptr */
                        PRINTF ("%s: Assuming buffer pointer in arg 3\n",
                                __FUNCTION__);
-                       fpga_data = (void *) dev;
+
+#if defined(CONFIG_FIT)
+                       if (fit_parse_subimage (argv[2], (ulong)fpga_data,
+                                               &fit_addr, &fit_uname)) {
+                               fpga_data = (void *)fit_addr;
+                               debug ("*  fpga: subimage '%s' from FIT image at 0x%08lx\n",
+                                               fit_uname, fit_addr);
+                       } else
+#endif
+                       {
+                               fpga_data = (void *) dev;
+                               debug ("*  fpga: cmdline image address = 0x%08lx\n", (ulong)fpga_data);
+                       }
+
                        PRINTF ("%s: fpga_data = 0x%x\n",
                                __FUNCTION__, (uint) fpga_data);
                        dev = FPGA_INVALID_DEVICE;      /* reset device num */
                }
+
        case 2:         /* fpga <op> */
                op = (int) fpga_get_op (argv[1]);
                break;
+
        default:
                PRINTF ("%s: Too many or too few args (%d)\n",
                        __FUNCTION__, argc);
@@ -216,19 +248,61 @@ int do_fpga (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
                break;
 
        case FPGA_LOADMK:
-               {
-                       image_header_t header;
-                       image_header_t *hdr = &header;
-                       ulong   data;
-
-                       memmove (&header, (char *)fpga_data, sizeof(image_header_t));
-                       if (ntohl(hdr->ih_magic) != IH_MAGIC) {
-                               puts ("Bad Magic Number\n");
-                               return 1;
+               switch (genimg_get_format (fpga_data)) {
+               case IMAGE_FORMAT_LEGACY:
+                       {
+                               image_header_t *hdr = (image_header_t *)fpga_data;
+                               ulong   data;
+
+                               data = (ulong)image_get_data (hdr);
+                               data_size = image_get_data_size (hdr);
+                               rc = fpga_load (dev, (void *)data, data_size);
+                       }
+                       break;
+#if defined(CONFIG_FIT)
+               case IMAGE_FORMAT_FIT:
+                       {
+                               const void *fit_hdr = (const void *)fpga_data;
+                               int noffset;
+                               void *fit_data;
+
+                               if (fit_uname == NULL) {
+                                       puts ("No FIT subimage unit name\n");
+                                       return 1;
+                               }
+
+                               if (!fit_check_format (fit_hdr)) {
+                                       puts ("Bad FIT image format\n");
+                                       return 1;
+                               }
+
+                               /* get fpga component image node offset */
+                               noffset = fit_image_get_node (fit_hdr, fit_uname);
+                               if (noffset < 0) {
+                                       printf ("Can't find '%s' FIT subimage\n", fit_uname);
+                                       return 1;
+                               }
+
+                               /* verify integrity */
+                               if (!fit_image_check_hashes (fit_hdr, noffset)) {
+                                       puts ("Bad Data Hash\n");
+                                       return 1;
+                               }
+
+                               /* get fpga subimage data address and length */
+                               if (fit_image_get_data (fit_hdr, noffset, &fit_data, &data_size)) {
+                                       puts ("Could not find fpga subimage data\n");
+                                       return 1;
+                               }
+
+                               rc = fpga_load (dev, fit_data, data_size);
                        }
-                       data = ((ulong)fpga_data + sizeof(image_header_t));
-                       data_size  = ntohl(hdr->ih_size);
-                       rc = fpga_load (dev, (void *)data, data_size);
+                       break;
+#endif
+               default:
+                       puts ("** Unknown image type\n");
+                       rc = FPGA_FAIL;
+                       break;
                }
                break;
 
@@ -283,4 +357,9 @@ U_BOOT_CMD (fpga, 6, 1, do_fpga,
            "\tload\tLoad device from memory buffer\n"
            "\tloadb\tLoad device from bitstream buffer (Xilinx devices only)\n"
            "\tloadmk\tLoad device generated with mkimage\n"
-           "\tdump\tLoad device to memory buffer\n");
+           "\tdump\tLoad device to memory buffer\n"
+#if defined(CONFIG_FIT)
+           "\tFor loadmk operating on FIT format uImage address must include\n"
+           "\tsubimage unit name in the form of addr:<subimg_uname>\n"
+#endif
+);
index c38be4f..f9cd422 100644 (file)
@@ -366,10 +366,13 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        char *boot_device = NULL;
        char *ep;
        int dev, part = 0;
-       ulong addr, cnt, checksum;
+       ulong addr, cnt;
        disk_partition_t info;
        image_header_t *hdr;
        int rcode = 0;
+#if defined(CONFIG_FIT)
+       const void *fit_hdr;
+#endif
 
        show_boot_progress (41);
        switch (argc) {
@@ -446,29 +449,43 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        }
        show_boot_progress (48);
 
-       hdr = (image_header_t *)addr;
+       switch (genimg_get_format ((void *)addr)) {
+       case IMAGE_FORMAT_LEGACY:
+               hdr = (image_header_t *)addr;
 
-       if (ntohl(hdr->ih_magic) != IH_MAGIC) {
-               printf("\n** Bad Magic Number **\n");
-               show_boot_progress (-49);
-               return 1;
-       }
-       show_boot_progress (49);
+               show_boot_progress (49);
 
-       checksum = ntohl(hdr->ih_hcrc);
-       hdr->ih_hcrc = 0;
+               if (!image_check_hcrc (hdr)) {
+                       puts ("\n** Bad Header Checksum **\n");
+                       show_boot_progress (-50);
+                       return 1;
+               }
+               show_boot_progress (50);
+
+               image_print_contents (hdr);
+
+               cnt = image_get_image_size (hdr);
+               break;
+#if defined(CONFIG_FIT)
+       case IMAGE_FORMAT_FIT:
+               fit_hdr = (const void *)addr;
+               if (!fit_check_format (fit_hdr)) {
+                       show_boot_progress (-140);
+                       puts ("** Bad FIT image format\n");
+                       return 1;
+               }
+               show_boot_progress (141);
+               puts ("Fit image detected...\n");
 
-       if (crc32 (0, (uchar *)hdr, sizeof(image_header_t)) != checksum) {
-               puts ("\n** Bad Header Checksum **\n");
-               show_boot_progress (-50);
+               cnt = fit_get_size (fit_hdr);
+               break;
+#endif
+       default:
+               show_boot_progress (-49);
+               puts ("** Unknown image type\n");
                return 1;
        }
-       show_boot_progress (50);
-       hdr->ih_hcrc = htonl(checksum); /* restore checksum for later use */
-
-       print_image_hdr (hdr);
 
-       cnt = (ntohl(hdr->ih_size) + sizeof(image_header_t));
        cnt += info.blksz - 1;
        cnt /= info.blksz;
        cnt -= 1;
@@ -481,6 +498,11 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        }
        show_boot_progress (51);
 
+#if defined(CONFIG_FIT)
+       /* This cannot be done earlier, we need complete FIT image in RAM first */
+       if (genimg_get_format ((void *)addr) == IMAGE_FORMAT_FIT)
+               fit_print_contents ((const void *)addr);
+#endif
 
        /* Loading ok, update default load address */
 
@@ -1507,6 +1529,9 @@ static void ide_reset (void)
 
        ide_set_reset (1); /* assert reset */
 
+       /* the reset signal shall be asserted for et least 25 us */
+       udelay(25);
+
        WATCHDOG_RESET();
 
 #ifdef CFG_PB_12V_ENABLE
index 204c3eb..1b75a7b 100644 (file)
@@ -521,8 +521,15 @@ int do_load_serial_bin (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                char *s;
 
                if (((s = getenv("autoscript")) != NULL) && (strcmp(s,"yes") == 0)) {
-                       printf("Running autoscript at addr 0x%08lX ...\n", load_addr);
-                       rcode = autoscript (load_addr);
+                       printf ("Running autoscript at addr 0x%08lX", load_addr);
+
+                       s = getenv ("autoscript_uname");
+                       if (s)
+                               printf (":%s ...\n", s);
+                       else
+                               puts (" ...\n");
+
+                       rcode = autoscript (load_addr, s);
                }
        }
 #endif
index 34b36ff..b9f9ba0 100644 (file)
@@ -76,7 +76,7 @@ void logbuff_init_ptrs (void)
        lbuf = (char *)CONFIG_ALT_LB_ADDR;
 #else
        log = (logbuff_t *)(gd->bd->bi_memsize-LOGBUFF_LEN) - 1;
-       lbuf = log->buf;
+       lbuf = (char *)log->buf;
 #endif
 
        /* Set up log version */
index 4740664..51aa71f 100644 (file)
@@ -493,7 +493,11 @@ int do_mem_cp ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        }
 
        /* Check if we are copying from DataFlash to RAM */
-       if (addr_dataflash(addr) && !addr_dataflash(dest) && (addr2info(dest)==NULL) ){
+       if (addr_dataflash(addr) && !addr_dataflash(dest)
+#ifndef CFG_NO_FLASH
+                                && (addr2info(dest) == NULL)
+#endif
+          ){
                int rc;
                rc = read_dataflash(addr, count * size, (char *) dest);
                if (rc != 1) {
index 31ac43d..bcbd7aa 100644 (file)
@@ -306,7 +306,7 @@ int do_mii (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
                return 1;
        }
 
-#if defined(CONFIG_8xx) || defined(CONFIG_MCF532x)
+#if defined(CONFIG_MII_INIT)
        mii_init ();
 #endif
 
diff --git a/common/cmd_mp.c b/common/cmd_mp.c
new file mode 100644 (file)
index 0000000..26a57c5
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2008 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 <command.h>
+
+int
+cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+       unsigned long cpuid;
+
+       if (argc < 3) {
+               printf ("Usage:\n%s\n", cmdtp->usage);
+               return 1;
+       }
+
+       cpuid = simple_strtoul(argv[1], NULL, 10);
+       if (cpuid >= CONFIG_NR_CPUS) {
+               printf ("Core num: %d is out of range[0..%d]\n",
+                               cpuid, CONFIG_NR_CPUS - 1);
+               return 1;
+       }
+
+
+       if (argc == 3) {
+               if (strncmp(argv[2], "reset", 5) == 0) {
+                       cpu_reset(cpuid);
+               } else if (strncmp(argv[2], "status", 6) == 0) {
+                       cpu_status(cpuid);
+               } else {
+                       printf ("Usage:\n%s\n", cmdtp->usage);
+                       return 1;
+               }
+               return 0;
+       }
+
+       /* 4 or greater, make sure its release */
+       if (strncmp(argv[2], "release", 7) != 0) {
+               printf ("Usage:\n%s\n", cmdtp->usage);
+               return 1;
+       }
+
+       if (cpu_release(cpuid, argc - 3, argv + 3)) {
+               printf ("Usage:\n%s\n", cmdtp->usage);
+               return 1;
+       }
+
+       return 0;
+}
+
+#ifdef CONFIG_PPC
+#define CPU_ARCH_HELP \
+       "                         [args] : <pir> <r3> <r6>\n" \
+       "                                   pir - processor id (if writeable)\n" \
+       "                                    r3 - value for gpr 3\n" \
+       "                                    r6 - value for gpr 6\n" \
+       "\n" \
+       "     Use '-' for any arg if you want the default value.\n" \
+       "     Default for r3 is <num> and r6 is 0\n" \
+       "\n" \
+       "     When cpu <num> is released r4 and r5 = 0.\n" \
+       "     r7 will contain the size of the initial mapped area\n"
+#endif
+
+U_BOOT_CMD(
+       cpu, CFG_MAXARGS, 1, cpu_cmd,
+       "cpu     - Multiprocessor CPU boot manipulation and release\n",
+           "<num> reset                 - Reset cpu <num>\n"
+       "cpu <num> status                - Status of cpu <num>\n"
+       "cpu <num> release <addr> [args] - Release cpu <num> at <addr> with [args]\n"
+#ifdef CPU_ARCH_HELP
+       CPU_ARCH_HELP
+#endif
+       );
index 8d6c959..7b1f830 100644 (file)
@@ -484,6 +484,9 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand,
        ulong cnt;
        image_header_t *hdr;
        int jffs2 = 0;
+#if defined(CONFIG_FIT)
+       const void *fit_hdr;
+#endif
 
        s = strchr(cmd, '.');
        if (s != NULL &&
@@ -512,18 +515,35 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand,
        }
        show_boot_progress (56);
 
-       hdr = (image_header_t *) addr;
+       switch (genimg_get_format ((void *)addr)) {
+       case IMAGE_FORMAT_LEGACY:
+               hdr = (image_header_t *)addr;
+
+               show_boot_progress (57);
+               image_print_contents (hdr);
 
-       if (ntohl(hdr->ih_magic) != IH_MAGIC) {
-               printf("\n** Bad Magic Number 0x%x **\n", hdr->ih_magic);
+               cnt = image_get_image_size (hdr);
+               break;
+#if defined(CONFIG_FIT)
+       case IMAGE_FORMAT_FIT:
+               fit_hdr = (const void *)addr;
+               if (!fit_check_format (fit_hdr)) {
+                       show_boot_progress (-150);
+                       puts ("** Bad FIT image format\n");
+                       return 1;
+               }
+               show_boot_progress (151);
+               puts ("Fit image detected...\n");
+
+               cnt = fit_get_size (fit_hdr);
+               break;
+#endif
+       default:
                show_boot_progress (-57);
+               puts ("** Unknown image type\n");
                return 1;
        }
-       show_boot_progress (57);
-
-       print_image_hdr(hdr);
 
-       cnt = (ntohl(hdr->ih_size) + sizeof (image_header_t));
        if (jffs2) {
                nand_read_options_t opts;
                memset(&opts, 0, sizeof(opts));
@@ -543,6 +563,12 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand,
        }
        show_boot_progress (58);
 
+#if defined(CONFIG_FIT)
+       /* This cannot be done earlier, we need complete FIT image in RAM first */
+       if (genimg_get_format ((void *)addr) == IMAGE_FORMAT_FIT)
+               fit_print_contents ((const void *)addr);
+#endif
+
        /* Loading ok, update default load address */
 
        load_addr = addr;
@@ -925,6 +951,10 @@ int do_nandboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        ulong offset = 0;
        image_header_t *hdr;
        int rcode = 0;
+#if defined(CONFIG_FIT)
+       const void *fit_hdr;
+#endif
+
        show_boot_progress (52);
        switch (argc) {
        case 1:
@@ -980,17 +1010,31 @@ int do_nandboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        }
        show_boot_progress (56);
 
-       hdr = (image_header_t *)addr;
-
-       if (ntohl(hdr->ih_magic) == IH_MAGIC) {
+       switch (genimg_get_format ((void *)addr)) {
+       case IMAGE_FORMAT_LEGACY:
+               hdr = (image_header_t *)addr;
+               image_print_contents (hdr);
 
-               print_image_hdr (hdr);
-
-               cnt = (ntohl(hdr->ih_size) + sizeof(image_header_t));
+               cnt = image_get_image_size (hdr);
                cnt -= SECTORSIZE;
-       } else {
-               printf ("\n** Bad Magic Number 0x%x **\n", ntohl(hdr->ih_magic));
+               break;
+#if defined(CONFIG_FIT)
+       case IMAGE_FORMAT_FIT:
+               fit_hdr = (const void *)addr;
+               if (!fit_check_format (fit_hdr)) {
+                       show_boot_progress (-150);
+                       puts ("** Bad FIT image format\n");
+                       return 1;
+               }
+               show_boot_progress (151);
+               puts ("Fit image detected...\n");
+
+               cnt = fit_get_size (fit_hdr);
+               break;
+#endif
+       default:
                show_boot_progress (-57);
+               puts ("** Unknown image type\n");
                return 1;
        }
        show_boot_progress (57);
@@ -1004,6 +1048,12 @@ int do_nandboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        }
        show_boot_progress (58);
 
+#if defined(CONFIG_FIT)
+       /* This cannot be done earlier, we need complete FIT image in RAM first */
+       if (genimg_get_format ((void *)addr) == IMAGE_FORMAT_FIT)
+               fit_print_contents ((const void *)addr);
+#endif
+
        /* Loading ok, update default load address */
 
        load_addr = addr;
index dbf6b86..79e910c 100644 (file)
@@ -220,9 +220,16 @@ netboot_common (proto_t proto, cmd_tbl_t *cmdtp, int argc, char *argv[])
 
 #ifdef CONFIG_AUTOSCRIPT
        if (((s = getenv("autoscript")) != NULL) && (strcmp(s,"yes") == 0)) {
-               printf("Running autoscript at addr 0x%08lX ...\n", load_addr);
+               printf ("Running autoscript at addr 0x%08lX", load_addr);
+
+               s = getenv ("autoscript_uname");
+               if (s)
+                       printf (":%s ...\n", s);
+               else
+                       puts (" ...\n");
+
                show_boot_progress (83);
-               rcode = autoscript (load_addr);
+               rcode = autoscript (load_addr, s);
        }
 #endif
        if (rcode < 0)
index cab727f..dc05f68 100644 (file)
@@ -68,9 +68,6 @@ DECLARE_GLOBAL_DATA_PTR;
 /************************************************************************
 ************************************************************************/
 
-/* Function that returns a character from the environment */
-extern uchar (*env_get_char)(int);
-
 /* Function that returns a pointer to a value from the environment */
 /* (Only memory version supported / needed). */
 extern uchar *env_get_addr(int);
index dcda099..aff11d1 100644 (file)
@@ -44,14 +44,28 @@ int do_onenand(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
        default:
                /* At least 4 args */
                if (strncmp(argv[1], "erase", 5) == 0) {
-                       struct erase_info instr;
+                       struct erase_info instr = {
+                               .callback       = NULL,
+                       };
                        ulong start, end;
                        ulong block;
-
-                       start = simple_strtoul(argv[2], NULL, 10);
-                       end = simple_strtoul(argv[3], NULL, 10);
-                       start -= (unsigned long)onenand_chip.base;
-                       end -= (unsigned long)onenand_chip.base;
+                       char *endtail;
+
+                       if (strncmp(argv[2], "block", 5) == 0) {
+                               start = simple_strtoul(argv[3], NULL, 10);
+                               endtail = strchr(argv[3], '-');
+                               end = simple_strtoul(endtail + 1, NULL, 10);
+                       } else {
+                               start = simple_strtoul(argv[2], NULL, 10);
+                               end = simple_strtoul(argv[3], NULL, 10);
+                               start -= (unsigned long)onenand_chip.base;
+                               end -= (unsigned long)onenand_chip.base;
+
+                               start >>= onenand_chip.erase_shift;
+                               end >>= onenand_chip.erase_shift;
+                               /* Don't include the end block */
+                               end--;
+                       }
 
                        if (!end || end < 0)
                                end = start;
index bd4c11f..79c2495 100644 (file)
@@ -1,8 +1,11 @@
 /*
+ * Copyright (C) 2000-2005, DENX Software Engineering
+ *             Wolfgang Denk <wd@denx.de>
  * Copyright (C) Procsys. All rights reserved.
- * Author: Mushtaq Khan <mushtaq_k@procsys.com>
+ *             Mushtaq Khan <mushtaq_k@procsys.com>
  *                     <mushtaqk_921@yahoo.co.in>
- *
+ * Copyright (C) 2008 Freescale Semiconductor, Inc.
+ *             Dave Liu <daveliu@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
  *
  * 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
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  * MA 02111-1307 USA
- *
- * with the reference to libata in kernel 2.4.32
- *
  */
 
-/*
- * File contains SATA read-write and other utility functions.
- */
 #include <common.h>
-#include <asm/io.h>
-#include <pci.h>
 #include <command.h>
-#include <config.h>
-#include <ide.h>
-#include <ata.h>
-
-#ifdef CFG_SATA_SUPPORTED
-/*For debug prints set macro DEBUG_SATA to 1 */
-#define DEBUG_SATA 0
-/*Macro for SATA library specific declarations */
-#define SATA_DECL
+#include <part.h>
 #include <sata.h>
-#undef SATA_DECL
-
-static u8 __inline__
-sata_inb (unsigned long ioaddr)
-{
-       return inb (ioaddr);
-}
-
-static void __inline__
-sata_outb (unsigned char val, unsigned long ioaddr)
-{
-       outb (val, ioaddr);
-}
-
-static void
-output_data (struct sata_ioports *ioaddr, ulong * sect_buf, int words)
-{
-       outsw (ioaddr->data_addr, sect_buf, words << 1);
-}
-
-static int
-input_data (struct sata_ioports *ioaddr, ulong * sect_buf, int words)
-{
-       insw (ioaddr->data_addr, sect_buf, words << 1);
-       return 0;
-}
-
-static void
-sata_cpy (unsigned char *dst, unsigned char *src, unsigned int len)
-{
-       unsigned char *end, *last;
-
-       last = dst;
-       end = src + len - 1;
-
-       /* reserve space for '\0' */
-       if (len < 2)
-               goto OUT;
-
-       /* skip leading white space */
-       while ((*src) && (src < end) && (*src == ' '))
-               ++src;
-
-       /* copy string, omitting trailing white space */
-       while ((*src) && (src < end)) {
-               *dst++ = *src;
-               if (*src++ != ' ')
-                       last = dst;
-       }
-      OUT:
-       *last = '\0';
-}
-
-int
-sata_bus_softreset (int num)
-{
-       u8 dev = 0, status = 0, i;
-
-       port[num].dev_mask = 0;
-
-       for (i = 0; i < CFG_SATA_DEVS_PER_BUS; i++) {
-               if (!(sata_devchk (&port[num].ioaddr, i))) {
-                       PRINTF ("dev_chk failed for dev#%d\n", i);
-               } else {
-                       port[num].dev_mask |= (1 << i);
-                       PRINTF ("dev_chk passed for dev#%d\n", i);
-               }
-       }
-
-       if (!(port[num].dev_mask)) {
-               printf ("no devices on port%d\n", num);
-               return 1;
-       }
-
-       dev_select (&port[num].ioaddr, dev);
-
-       port[num].ctl_reg = 0x08;       /*Default value of control reg */
-       sata_outb (port[num].ctl_reg, port[num].ioaddr.ctl_addr);
-       udelay (10);
-       sata_outb (port[num].ctl_reg | ATA_SRST, port[num].ioaddr.ctl_addr);
-       udelay (10);
-       sata_outb (port[num].ctl_reg, port[num].ioaddr.ctl_addr);
-
-       /* spec mandates ">= 2ms" before checking status.
-        * We wait 150ms, because that was the magic delay used for
-        * ATAPI devices in Hale Landis's ATADRVR, for the period of time
-        * between when the ATA command register is written, and then
-        * status is checked.  Because waiting for "a while" before
-        * checking status is fine, post SRST, we perform this magic
-        * delay here as well.
-        */
-       msleep (150);
-       status = sata_busy_wait (&port[num].ioaddr, ATA_BUSY, 300);
-       while ((status & ATA_BUSY)) {
-               msleep (100);
-               status = sata_busy_wait (&port[num].ioaddr, ATA_BUSY, 3);
-       }
-
-       if (status & ATA_BUSY)
-               printf ("ata%u is slow to respond,plz be patient\n", port);
-
-       while ((status & ATA_BUSY)) {
-               msleep (100);
-               status = sata_chk_status (&port[num].ioaddr);
-       }
-
-       if (status & ATA_BUSY) {
-               printf ("ata%u failed to respond : ", port);
-               printf ("bus reset failed\n");
-               return 1;
-       }
-       return 0;
-}
-
-void
-sata_identify (int num, int dev)
-{
-       u8 cmd = 0, status = 0, devno = num * CFG_SATA_DEVS_PER_BUS + dev;
-       u16 iobuf[ATA_SECT_SIZE];
-       u64 n_sectors = 0;
-       u8 mask = 0;
-
-       memset (iobuf, 0, sizeof (iobuf));
-       hd_driveid_t *iop = (hd_driveid_t *) iobuf;
-
-       if (dev == 0)
-               mask = 0x01;
-       else
-               mask = 0x02;
-
-       if (!(port[num].dev_mask & mask)) {
-               printf ("dev%d is not present on port#%d\n", dev, num);
-               return;
-       }
-
-       printf ("port=%d dev=%d\n", num, dev);
-
-       dev_select (&port[num].ioaddr, dev);
-
-       status = 0;
-       cmd = ATA_CMD_IDENT;    /*Device Identify Command */
-       sata_outb (cmd, port[num].ioaddr.command_addr);
-       sata_inb (port[num].ioaddr.altstatus_addr);
-       udelay (10);
-
-       status = sata_busy_wait (&port[num].ioaddr, ATA_BUSY, 1000);
-       if (status & ATA_ERR) {
-               printf ("\ndevice not responding\n");
-               port[num].dev_mask &= ~mask;
-               return;
-       }
-
-       input_data (&port[num].ioaddr, (ulong *) iobuf, ATA_SECTORWORDS);
-
-       PRINTF ("\nata%u: dev %u cfg 49:%04x 82:%04x 83:%04x 84:%04x85:%04x"
-               "86:%04x" "87:%04x 88:%04x\n", num, dev, iobuf[49],
-               iobuf[82], iobuf[83], iobuf[84], iobuf[85], iobuf[86],
-               iobuf[87], iobuf[88]);
-
-       /* we require LBA and DMA support (bits 8 & 9 of word 49) */
-       if (!ata_id_has_dma (iobuf) || !ata_id_has_lba (iobuf)) {
-               PRINTF ("ata%u: no dma/lba\n", num);
-       }
-       ata_dump_id (iobuf);
-
-       if (ata_id_has_lba48 (iobuf)) {
-               n_sectors = ata_id_u64 (iobuf, 100);
-       } else {
-               n_sectors = ata_id_u32 (iobuf, 60);
-       }
-       PRINTF ("no. of sectors %u\n", ata_id_u64 (iobuf, 100));
-       PRINTF ("no. of sectors %u\n", ata_id_u32 (iobuf, 60));
-
-       if (n_sectors == 0) {
-               port[num].dev_mask &= ~mask;
-               return;
-       }
-
-       sata_cpy (sata_dev_desc[devno].revision, iop->fw_rev,
-                 sizeof (sata_dev_desc[devno].revision));
-       sata_cpy (sata_dev_desc[devno].vendor, iop->model,
-                 sizeof (sata_dev_desc[devno].vendor));
-       sata_cpy (sata_dev_desc[devno].product, iop->serial_no,
-                 sizeof (sata_dev_desc[devno].product));
-       strswab (sata_dev_desc[devno].revision);
-       strswab (sata_dev_desc[devno].vendor);
-
-       if ((iop->config & 0x0080) == 0x0080) {
-               sata_dev_desc[devno].removable = 1;
-       } else {
-               sata_dev_desc[devno].removable = 0;
-       }
 
-       sata_dev_desc[devno].lba = iop->lba_capacity;
-       PRINTF ("lba=0x%x", sata_dev_desc[devno].lba);
+int curr_device = -1;
+block_dev_desc_t sata_dev_desc[CFG_SATA_MAX_DEVICE];
 
-#ifdef CONFIG_LBA48
-       if (iop->command_set_2 & 0x0400) {
-               sata_dev_desc[devno].lba48 = 1;
-               lba = (unsigned long long) iop->lba48_capacity[0] |
-                   ((unsigned long long) iop->lba48_capacity[1] << 16) |
-                   ((unsigned long long) iop->lba48_capacity[2] << 32) |
-                   ((unsigned long long) iop->lba48_capacity[3] << 48);
-       } else {
-               sata_dev_desc[devno].lba48 = 0;
-       }
-#endif
-
-       /* assuming HD */
-       sata_dev_desc[devno].type = DEV_TYPE_HARDDISK;
-       sata_dev_desc[devno].blksz = ATA_BLOCKSIZE;
-       sata_dev_desc[devno].lun = 0;   /* just to fill something in... */
-}
-
-void
-set_Feature_cmd (int num, int dev)
-{
-       u8 mask = 0x00, status = 0;
-
-       if (dev == 0)
-               mask = 0x01;
-       else
-               mask = 0x02;
-
-       if (!(port[num].dev_mask & mask)) {
-               PRINTF ("dev%d is not present on port#%d\n", dev, num);
-               return;
-       }
-
-       dev_select (&port[num].ioaddr, dev);
-
-       sata_outb (SETFEATURES_XFER, port[num].ioaddr.feature_addr);
-       sata_outb (XFER_PIO_4, port[num].ioaddr.nsect_addr);
-       sata_outb (0, port[num].ioaddr.lbal_addr);
-       sata_outb (0, port[num].ioaddr.lbam_addr);
-       sata_outb (0, port[num].ioaddr.lbah_addr);
-
-       sata_outb (ATA_DEVICE_OBS, port[num].ioaddr.device_addr);
-       sata_outb (ATA_CMD_SETF, port[num].ioaddr.command_addr);
-
-       udelay (50);
-       msleep (150);
-
-       status = sata_busy_wait (&port[num].ioaddr, ATA_BUSY, 5000);
-       if ((status & (ATA_STAT_BUSY | ATA_STAT_ERR))) {
-               printf ("Error  : status 0x%02x\n", status);
-               port[num].dev_mask &= ~mask;
-       }
-}
-
-void
-sata_port (struct sata_ioports *ioport)
-{
-       ioport->data_addr = ioport->cmd_addr + ATA_REG_DATA;
-       ioport->error_addr = ioport->cmd_addr + ATA_REG_ERR;
-       ioport->feature_addr = ioport->cmd_addr + ATA_REG_FEATURE;
-       ioport->nsect_addr = ioport->cmd_addr + ATA_REG_NSECT;
-       ioport->lbal_addr = ioport->cmd_addr + ATA_REG_LBAL;
-       ioport->lbam_addr = ioport->cmd_addr + ATA_REG_LBAM;
-       ioport->lbah_addr = ioport->cmd_addr + ATA_REG_LBAH;
-       ioport->device_addr = ioport->cmd_addr + ATA_REG_DEVICE;
-       ioport->status_addr = ioport->cmd_addr + ATA_REG_STATUS;
-       ioport->command_addr = ioport->cmd_addr + ATA_REG_CMD;
-}
-
-int
-sata_devchk (struct sata_ioports *ioaddr, int dev)
-{
-       u8 nsect, lbal;
-
-       dev_select (ioaddr, dev);
-
-       sata_outb (0x55, ioaddr->nsect_addr);
-       sata_outb (0xaa, ioaddr->lbal_addr);
-
-       sata_outb (0xaa, ioaddr->nsect_addr);
-       sata_outb (0x55, ioaddr->lbal_addr);
-
-       sata_outb (0x55, ioaddr->nsect_addr);
-       sata_outb (0xaa, ioaddr->lbal_addr);
-
-       nsect = sata_inb (ioaddr->nsect_addr);
-       lbal = sata_inb (ioaddr->lbal_addr);
-
-       if ((nsect == 0x55) && (lbal == 0xaa))
-               return 1;       /* we found a device */
-       else
-               return 0;       /* nothing found */
-}
-
-void
-dev_select (struct sata_ioports *ioaddr, int dev)
-{
-       u8 tmp = 0;
-
-       if (dev == 0)
-               tmp = ATA_DEVICE_OBS;
-       else
-               tmp = ATA_DEVICE_OBS | ATA_DEV1;
-
-       sata_outb (tmp, ioaddr->device_addr);
-       sata_inb (ioaddr->altstatus_addr);
-       udelay (5);
-}
-
-u8
-sata_busy_wait (struct sata_ioports *ioaddr, int bits, unsigned int max)
-{
-       u8 status;
-
-       do {
-               udelay (1000);
-               status = sata_chk_status (ioaddr);
-               max--;
-       } while ((status & bits) && (max > 0));
-
-       return status;
-}
-
-u8
-sata_chk_status (struct sata_ioports * ioaddr)
-{
-       return sata_inb (ioaddr->status_addr);
-}
-
-void
-msleep (int count)
+int sata_initialize(void)
 {
+       int rc;
        int i;
 
-       for (i = 0; i < count; i++)
-               udelay (1000);
-}
-
-ulong
-sata_read (int device, ulong blknr,lbaint_t blkcnt, void * buff)
-{
-       ulong n = 0, *buffer = (ulong *)buff;
-       u8 dev = 0, num = 0, mask = 0, status = 0;
-
-#ifdef CONFIG_LBA48
-       unsigned char lba48 = 0;
-
-       if (blknr & 0x0000fffff0000000) {
-               if (!sata_dev_desc[devno].lba48) {
-                       printf ("Drive doesn't support 48-bit addressing\n");
-                       return 0;
-               }
-               /* more than 28 bits used, use 48bit mode */
-               lba48 = 1;
-       }
-#endif
-       /*Port Number */
-       num = device / CFG_SATA_DEVS_PER_BUS;
-       /*dev on the port */
-       if (device >= CFG_SATA_DEVS_PER_BUS)
-               dev = device - CFG_SATA_DEVS_PER_BUS;
-       else
-               dev = device;
-
-       if (dev == 0)
-               mask = 0x01;
-       else
-               mask = 0x02;
-
-       if (!(port[num].dev_mask & mask)) {
-               printf ("dev%d is not present on port#%d\n", dev, num);
-               return 0;
-       }
+       for (i = 0; i < CFG_SATA_MAX_DEVICE; i++) {
+               memset(&sata_dev_desc[i], 0, sizeof(struct block_dev_desc));
+               sata_dev_desc[i].if_type = IF_TYPE_SATA;
+               sata_dev_desc[i].dev = i;
+               sata_dev_desc[i].part_type = PART_TYPE_UNKNOWN;
+               sata_dev_desc[i].type = DEV_TYPE_HARDDISK;
+               sata_dev_desc[i].lba = 0;
+               sata_dev_desc[i].blksz = 512;
+               sata_dev_desc[i].block_read = sata_read;
+               sata_dev_desc[i].block_write = sata_write;
 
-       /* Select device */
-       dev_select (&port[num].ioaddr, dev);
-
-       status = sata_busy_wait (&port[num].ioaddr, ATA_BUSY, 500);
-       if (status & ATA_BUSY) {
-               printf ("ata%u failed to respond\n", port[num].port_no);
-               return n;
+               rc = init_sata(i);
+               rc = scan_sata(i);
+               if ((sata_dev_desc[i].lba > 0) && (sata_dev_desc[i].blksz > 0))
+                       init_part(&sata_dev_desc[i]);
        }
-       while (blkcnt-- > 0) {
-               status = sata_busy_wait (&port[num].ioaddr, ATA_BUSY, 500);
-               if (status & ATA_BUSY) {
-                       printf ("ata%u failed to respond\n", 0);
-                       return n;
-               }
-#ifdef CONFIG_LBA48
-               if (lba48) {
-                       /* write high bits */
-                       sata_outb (0, port[num].ioaddr.nsect_addr);
-                       sata_outb ((blknr >> 24) & 0xFF,
-                                  port[num].ioaddr.lbal_addr);
-                       sata_outb ((blknr >> 32) & 0xFF,
-                                  port[num].ioaddr.lbam_addr);
-                       sata_outb ((blknr >> 40) & 0xFF,
-                                  port[num].ioaddr.lbah_addr);
-               }
-#endif
-               sata_outb (1, port[num].ioaddr.nsect_addr);
-               sata_outb (((blknr) >> 0) & 0xFF,
-                          port[num].ioaddr.lbal_addr);
-               sata_outb ((blknr >> 8) & 0xFF, port[num].ioaddr.lbam_addr);
-               sata_outb ((blknr >> 16) & 0xFF, port[num].ioaddr.lbah_addr);
-
-#ifdef CONFIG_LBA48
-               if (lba48) {
-                       sata_outb (ATA_LBA, port[num].ioaddr.device_addr);
-                       sata_outb (ATA_CMD_READ_EXT,
-                                  port[num].ioaddr.command_addr);
-               } else
-#endif
-               {
-                       sata_outb (ATA_LBA | ((blknr >> 24) & 0xF),
-                                  port[num].ioaddr.device_addr);
-                       sata_outb (ATA_CMD_READ,
-                                  port[num].ioaddr.command_addr);
-               }
-
-               msleep (50);
-               /*may take up to 4 sec */
-               status = sata_busy_wait (&port[num].ioaddr, ATA_BUSY, 4000);
-
-               if ((status & (ATA_STAT_DRQ | ATA_STAT_BUSY | ATA_STAT_ERR))
-                   != ATA_STAT_DRQ) {
-                       u8 err = 0;
-
-                       printf ("Error no DRQ dev %d blk %ld: sts 0x%02x\n",
-                               device, (ulong) blknr, status);
-                       err = sata_inb (port[num].ioaddr.error_addr);
-                       printf ("Error reg = 0x%x\n", err);
-                       return (n);
-               }
-               input_data (&port[num].ioaddr, buffer, ATA_SECTORWORDS);
-               sata_inb (port[num].ioaddr.altstatus_addr);
-               udelay (50);
-
-               ++n;
-               ++blknr;
-               buffer += ATA_SECTORWORDS;
-       }
-       return n;
+       curr_device = 0;
+       return rc;
 }
 
-ulong
-sata_write (int device, ulong blknr,lbaint_t blkcnt, void * buff)
+block_dev_desc_t *sata_get_dev(int dev)
 {
-       ulong n = 0, *buffer = (ulong *)buff;
-       unsigned char status = 0, num = 0, dev = 0, mask = 0;
-
-#ifdef CONFIG_LBA48
-       unsigned char lba48 = 0;
-
-       if (blknr & 0x0000fffff0000000) {
-               if (!sata_dev_desc[devno].lba48) {
-                       printf ("Drive doesn't support 48-bit addressing\n");
-                       return 0;
-               }
-               /* more than 28 bits used, use 48bit mode */
-               lba48 = 1;
-       }
-#endif
-       /*Port Number */
-       num = device / CFG_SATA_DEVS_PER_BUS;
-       /*dev on the Port */
-       if (device >= CFG_SATA_DEVS_PER_BUS)
-               dev = device - CFG_SATA_DEVS_PER_BUS;
-       else
-               dev = device;
-
-       if (dev == 0)
-               mask = 0x01;
-       else
-               mask = 0x02;
-
-       /* Select device */
-       dev_select (&port[num].ioaddr, dev);
-
-       status = sata_busy_wait (&port[num].ioaddr, ATA_BUSY, 500);
-       if (status & ATA_BUSY) {
-               printf ("ata%u failed to respond\n", port[num].port_no);
-               return n;
-       }
-
-       while (blkcnt-- > 0) {
-               status = sata_busy_wait (&port[num].ioaddr, ATA_BUSY, 500);
-               if (status & ATA_BUSY) {
-                       printf ("ata%u failed to respond\n",
-                               port[num].port_no);
-                       return n;
-               }
-#ifdef CONFIG_LBA48
-               if (lba48) {
-                       /* write high bits */
-                       sata_outb (0, port[num].ioaddr.nsect_addr);
-                       sata_outb ((blknr >> 24) & 0xFF,
-                                  port[num].ioaddr.lbal_addr);
-                       sata_outb ((blknr >> 32) & 0xFF,
-                                  port[num].ioaddr.lbam_addr);
-                       sata_outb ((blknr >> 40) & 0xFF,
-                                  port[num].ioaddr.lbah_addr);
-               }
-#endif
-               sata_outb (1, port[num].ioaddr.nsect_addr);
-               sata_outb ((blknr >> 0) & 0xFF, port[num].ioaddr.lbal_addr);
-               sata_outb ((blknr >> 8) & 0xFF, port[num].ioaddr.lbam_addr);
-               sata_outb ((blknr >> 16) & 0xFF, port[num].ioaddr.lbah_addr);
-#ifdef CONFIG_LBA48
-               if (lba48) {
-                       sata_outb (ATA_LBA, port[num].ioaddr.device_addr);
-                       sata_outb (ATA_CMD_WRITE_EXT,
-                                  port[num].ioaddr.command_addr);
-               } else
-#endif
-               {
-                       sata_outb (ATA_LBA | ((blknr >> 24) & 0xF),
-                                  port[num].ioaddr.device_addr);
-                       sata_outb (ATA_CMD_WRITE,
-                                  port[num].ioaddr.command_addr);
-               }
-
-               msleep (50);
-               /*may take up to 4 sec */
-               status = sata_busy_wait (&port[num].ioaddr, ATA_BUSY, 4000);
-               if ((status & (ATA_STAT_DRQ | ATA_STAT_BUSY | ATA_STAT_ERR))
-                   != ATA_STAT_DRQ) {
-                       printf ("Error no DRQ dev %d blk %ld: sts 0x%02x\n",
-                               device, (ulong) blknr, status);
-                       return (n);
-               }
-
-               output_data (&port[num].ioaddr, buffer, ATA_SECTORWORDS);
-               sata_inb (port[num].ioaddr.altstatus_addr);
-               udelay (50);
-
-               ++n;
-               ++blknr;
-               buffer += ATA_SECTORWORDS;
-       }
-       return n;
+       return (dev < CFG_SATA_MAX_DEVICE) ? &sata_dev_desc[dev] : NULL;
 }
 
-block_dev_desc_t *sata_get_dev (int dev);
-
-block_dev_desc_t *
-sata_get_dev (int dev)
-{
-       return ((block_dev_desc_t *) & sata_dev_desc[dev]);
-}
-
-int
-do_sata (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_sata(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
+       int rc = 0;
 
        switch (argc) {
        case 0:
        case 1:
-               printf ("Usage:\n%s\n", cmdtp->usage);
+               printf("Usage:\n%s\n", cmdtp->usage);
                return 1;
        case 2:
-               if (strncmp (argv[1], "init", 4) == 0) {
-                       int rcode = 0;
-
-                       rcode = init_sata ();
-                       if (rcode)
-                               printf ("Sata initialization Failed\n");
-                       return rcode;
-               } else if (strncmp (argv[1], "inf", 3) == 0) {
+               if (strncmp(argv[1],"inf", 3) == 0) {
                        int i;
-
-                       putc ('\n');
-                       for (i = 0; i < CFG_SATA_MAXDEVICES; ++i) {
-                               /*List only known devices */
-                               if (sata_dev_desc[i].type ==
-                                   DEV_TYPE_UNKNOWN)
+                       putc('\n');
+                       for (i = 0; i < CFG_SATA_MAX_DEVICE; ++i) {
+                               if (sata_dev_desc[i].type == DEV_TYPE_UNKNOWN)
                                        continue;
-                               printf ("sata dev %d: ", i);
-                               dev_print (&sata_dev_desc[i]);
+                               printf ("SATA device %d: ", i);
+                               dev_print(&sata_dev_desc[i]);
                        }
                        return 0;
+               } else if (strncmp(argv[1],"dev", 3) == 0) {
+                       if ((curr_device < 0) || (curr_device >= CFG_SATA_MAX_DEVICE)) {
+                               puts("\nno SATA devices available\n");
+                               return 1;
+                       }
+                       printf("\nSATA device %d: ", curr_device);
+                       dev_print(&sata_dev_desc[curr_device]);
+                       return 0;
+               } else if (strncmp(argv[1],"part",4) == 0) {
+                       int dev, ok;
+
+                       for (ok = 0, dev = 0; dev < CFG_SATA_MAX_DEVICE; ++dev) {
+                               if (sata_dev_desc[dev].part_type != PART_TYPE_UNKNOWN) {
+                                       ++ok;
+                                       if (dev)
+                                               putc ('\n');
+                                       print_part(&sata_dev_desc[dev]);
+                               }
+                       }
+                       if (!ok) {
+                               puts("\nno SATA devices available\n");
+                               rc ++;
+                       }
+                       return rc;
                }
-               printf ("Usage:\n%s\n", cmdtp->usage);
+               printf("Usage:\n%s\n", cmdtp->usage);
                return 1;
        case 3:
-               if (strcmp (argv[1], "dev") == 0) {
-                       int dev = (int) simple_strtoul (argv[2], NULL, 10);
+               if (strncmp(argv[1], "dev", 3) == 0) {
+                       int dev = (int)simple_strtoul(argv[2], NULL, 10);
 
-                       if (dev >= CFG_SATA_MAXDEVICES) {
-                               printf ("\nSata dev %d not available\n",
-                                       dev);
+                       printf("\nSATA device %d: ", dev);
+                       if (dev >= CFG_SATA_MAX_DEVICE) {
+                               puts ("unknown device\n");
                                return 1;
                        }
-                       printf ("\nSATA dev %d: ", dev);
-                       dev_print (&sata_dev_desc[dev]);
+                       dev_print(&sata_dev_desc[dev]);
+
                        if (sata_dev_desc[dev].type == DEV_TYPE_UNKNOWN)
                                return 1;
-                       curr_dev = dev;
+
+                       curr_device = dev;
+
+                       puts("... is now current device\n");
+
                        return 0;
-               } else if (strcmp (argv[1], "part") == 0) {
-                       int dev = (int) simple_strtoul (argv[2], NULL, 10);
+               } else if (strncmp(argv[1], "part", 4) == 0) {
+                       int dev = (int)simple_strtoul(argv[2], NULL, 10);
 
-                       if (dev >= CFG_SATA_MAXDEVICES) {
-                               printf ("\nSata dev %d not available\n",
-                                       dev);
-                               return 1;
-                       }
-                       PRINTF ("\nSATA dev %d: ", dev);
-                       if (sata_dev_desc[dev].part_type !=
-                           PART_TYPE_UNKNOWN) {
-                               print_part (&sata_dev_desc[dev]);
+                       if (sata_dev_desc[dev].part_type != PART_TYPE_UNKNOWN) {
+                               print_part(&sata_dev_desc[dev]);
                        } else {
-                               printf ("\nSata dev %d partition type "
-                                       "unknown\n", dev);
-                               return 1;
+                               printf("\nSATA device %d not available\n", dev);
+                               rc = 1;
                        }
-                       return 0;
+                       return rc;
                }
                printf ("Usage:\n%s\n", cmdtp->usage);
                return 1;
-       default:
-               if (argc < 5) {
-                       printf ("Usage:\n%s\n", cmdtp->usage);
-                       return 1;
-               }
-               if (strcmp (argv[1], "read") == 0) {
-                       ulong addr = simple_strtoul (argv[2], NULL, 16);
-                       ulong cnt = simple_strtoul (argv[4], NULL, 16);
+
+       default: /* at least 4 args */
+               if (strcmp(argv[1], "read") == 0) {
+                       ulong addr = simple_strtoul(argv[2], NULL, 16);
+                       ulong cnt = simple_strtoul(argv[4], NULL, 16);
                        ulong n;
-                       lbaint_t blk = simple_strtoul (argv[3], NULL, 16);
+                       lbaint_t blk = simple_strtoul(argv[3], NULL, 16);
+
+                       printf("\nSATA read: device %d block # %ld, count %ld ... ",
+                               curr_device, blk, cnt);
+
+                       n = sata_read(curr_device, blk, cnt, (u32 *)addr);
 
-                       memset ((int *) addr, 0, cnt * 512);
-                       printf ("\nSATA read: dev %d blk # %ld,"
-                               "count %ld ... ", curr_dev, blk, cnt);
-                       n = sata_read (curr_dev, blk, cnt, (ulong *) addr);
                        /* flush cache after read */
-                       flush_cache (addr, cnt * 512);
-                       printf ("%ld blocks read: %s\n", n,
-                               (n == cnt) ? "OK" : "ERR");
-                       if (n == cnt)
-                               return 1;
-                       else
-                               return 0;
-               } else if (strcmp (argv[1], "write") == 0) {
-                       ulong addr = simple_strtoul (argv[2], NULL, 16);
-                       ulong cnt = simple_strtoul (argv[4], NULL, 16);
+                       flush_cache(addr, cnt * sata_dev_desc[curr_device].blksz);
+
+                       printf("%ld blocks read: %s\n",
+                               n, (n==cnt) ? "OK" : "ERROR");
+                       return (n == cnt) ? 0 : 1;
+               } else if (strcmp(argv[1], "write") == 0) {
+                       ulong addr = simple_strtoul(argv[2], NULL, 16);
+                       ulong cnt = simple_strtoul(argv[4], NULL, 16);
                        ulong n;
-                       lbaint_t blk = simple_strtoul (argv[3], NULL, 16);
 
-                       printf ("\nSata write: dev %d blk # %ld,"
-                               "count %ld ... ", curr_dev, blk, cnt);
-                       n = sata_write (curr_dev, blk, cnt, (ulong *) addr);
-                       printf ("%ld blocks written: %s\n", n,
-                               (n == cnt) ? "OK" : "ERR");
-                       if (n == cnt)
-                               return 1;
-                       else
-                               return 0;
+                       lbaint_t blk = simple_strtoul(argv[3], NULL, 16);
+
+                       printf("\nSATA write: device %d block # %ld, count %ld ... ",
+                               curr_device, blk, cnt);
+
+                       n = sata_write(curr_device, blk, cnt, (u32 *)addr);
+
+                       printf("%ld blocks written: %s\n",
+                               n, (n == cnt) ? "OK" : "ERROR");
+                       return (n == cnt) ? 0 : 1;
                } else {
-                       printf ("Usage:\n%s\n", cmdtp->usage);
-                       return 1;
+                       printf("Usage:\n%s\n", cmdtp->usage);
+                       rc = 1;
                }
-       }                       /*End OF SWITCH */
-}
 
-U_BOOT_CMD (sata, 5, 1, do_sata,
-           "sata init\n"
-           "sata info\n"
-           "sata part device\n"
-           "sata dev device\n"
-           "sata read  addr blk# cnt\n"
-           "sata write  addr blk# cnt\n", "cmd for init,rw and dev-info\n");
+               return rc;
+       }
+}
 
-#endif
+U_BOOT_CMD(
+       sata, 5, 1, do_sata,
+       "sata   - SATA sub system\n",
+       "sata info - show available SATA devices\n"
+       "sata device [dev] - show or set current device\n"
+       "sata part [dev] - print partition table\n"
+       "sata read addr blk# cnt\n"
+       "sata write addr blk# cnt\n");
index 1cdec15..f49531e 100644 (file)
@@ -207,10 +207,13 @@ int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        char *boot_device = NULL;
        char *ep;
        int dev, part = 0;
-       ulong addr, cnt, checksum;
+       ulong addr, cnt;
        disk_partition_t info;
        image_header_t *hdr;
        int rcode = 0;
+#if defined(CONFIG_FIT)
+       const void *fit_hdr;
+#endif
 
        switch (argc) {
        case 1:
@@ -273,24 +276,35 @@ int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                return 1;
        }
 
-       hdr = (image_header_t *)addr;
+       switch (genimg_get_format ((void *)addr)) {
+       case IMAGE_FORMAT_LEGACY:
+               hdr = (image_header_t *)addr;
 
-       if (ntohl(hdr->ih_magic) == IH_MAGIC) {
-               printf("\n** Bad Magic Number **\n");
-               return 1;
-       }
+               if (!image_check_hcrc (hdr)) {
+                       puts ("\n** Bad Header Checksum **\n");
+                       return 1;
+               }
 
-       checksum = ntohl(hdr->ih_hcrc);
-       hdr->ih_hcrc = 0;
+               image_print_contents (hdr);
+               cnt = image_get_image_size (hdr);
+               break;
+#if defined(CONFIG_FIT)
+       case IMAGE_FORMAT_FIT:
+               fit_hdr = (const void *)addr;
+               if (!fit_check_format (fit_hdr)) {
+                       puts ("** Bad FIT image format\n");
+                       return 1;
+               }
+               puts ("Fit image detected...\n");
 
-       if (crc32 (0, (uchar *)hdr, sizeof(image_header_t)) != checksum) {
-               puts ("\n** Bad Header Checksum **\n");
+               cnt = fit_get_size (fit_hdr);
+               break;
+#endif
+       default:
+               puts ("** Unknown image type\n");
                return 1;
        }
-       hdr->ih_hcrc = htonl(checksum); /* restore checksum for later use */
 
-       print_image_hdr (hdr);
-       cnt = (ntohl(hdr->ih_size) + sizeof(image_header_t));
        cnt += info.blksz - 1;
        cnt /= info.blksz;
        cnt -= 1;
@@ -300,6 +314,13 @@ int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                printf ("** Read error on %d:%d\n", dev, part);
                return 1;
        }
+
+#if defined(CONFIG_FIT)
+       /* This cannot be done earlier, we need complete FIT image in RAM first */
+       if (genimg_get_format ((void *)addr) == IMAGE_FORMAT_FIT)
+               fit_print_contents ((const void *)addr);
+#endif
+
        /* Loading ok, update default load address */
        load_addr = addr;
 
diff --git a/common/cmd_setexpr.c b/common/cmd_setexpr.c
new file mode 100644 (file)
index 0000000..2e49b6d
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2008 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
+ */
+
+/*
+ * This file provides a shell like 'expr' function to return.
+ */
+
+#include <common.h>
+#include <config.h>
+#include <command.h>
+
+int do_setexpr(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+       ulong a, b;
+       char buf[16];
+
+       /* Validate arguments */
+       if ((argc != 5) || (strlen(argv[3]) != 1)) {
+               printf("Usage:\n%s\n", cmdtp->usage);
+               return 1;
+       }
+
+       a = simple_strtoul(argv[2], NULL, 16);
+       b = simple_strtoul(argv[4], NULL, 16);
+
+       switch (argv[3][0]) {
+       case '|': sprintf(buf, "%lx", (a | b)); break;
+       case '&': sprintf(buf, "%lx", (a & b)); break;
+       case '+': sprintf(buf, "%lx", (a + b)); break;
+       case '^': sprintf(buf, "%lx", (a ^ b)); break;
+       case '-': sprintf(buf, "%lx", (a - b)); break;
+       case '*': sprintf(buf, "%lx", (a * b)); break;
+       case '/': sprintf(buf, "%lx", (a / b)); break;
+       case '%': sprintf(buf, "%lx", (a % b)); break;
+       default:
+               printf("invalid op\n");
+               return 1;
+       }
+
+       setenv(argv[1], buf);
+
+       return 0;
+}
+
+U_BOOT_CMD(
+       setexpr, 5, 0, do_setexpr,
+       "setexpr - set environment variable as the result of eval expression\n",
+       "name value1 <op> value2\n"
+       "    - set environment variable 'name' to the result of the evaluated\n"
+       "      express specified by <op>.  <op> can be &, |, ^, +, -, *, /, %\n"
+);
index c6b17c2..23413b5 100644 (file)
@@ -311,11 +311,13 @@ int do_usbboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        char *boot_device = NULL;
        char *ep;
        int dev, part=1, rcode;
-       ulong addr, cnt, checksum;
+       ulong addr, cnt;
        disk_partition_t info;
        image_header_t *hdr;
        block_dev_desc_t *stor_dev;
-
+#if defined(CONFIG_FIT)
+       const void *fit_hdr;
+#endif
 
        switch (argc) {
        case 1:
@@ -386,25 +388,36 @@ int do_usbboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                return 1;
        }
 
-       hdr = (image_header_t *)addr;
+       switch (genimg_get_format ((void *)addr)) {
+       case IMAGE_FORMAT_LEGACY:
+               hdr = (image_header_t *)addr;
 
-       if (ntohl(hdr->ih_magic) != IH_MAGIC) {
-               printf("\n** Bad Magic Number **\n");
-               return 1;
-       }
+               if (!image_check_hcrc (hdr)) {
+                       puts ("\n** Bad Header Checksum **\n");
+                       return 1;
+               }
+
+               image_print_contents (hdr);
 
-       checksum = ntohl(hdr->ih_hcrc);
-       hdr->ih_hcrc = 0;
+               cnt = image_get_image_size (hdr);
+               break;
+#if defined(CONFIG_FIT)
+       case IMAGE_FORMAT_FIT:
+               fit_hdr = (const void *)addr;
+               if (!fit_check_format (fit_hdr)) {
+                       puts ("** Bad FIT image format\n");
+                       return 1;
+               }
+               puts ("Fit image detected...\n");
 
-       if (crc32 (0, (uchar *)hdr, sizeof(image_header_t)) != checksum) {
-               puts ("\n** Bad Header Checksum **\n");
+               cnt = fit_get_size (fit_hdr);
+               break;
+#endif
+       default:
+               puts ("** Unknown image type\n");
                return 1;
        }
-       hdr->ih_hcrc = htonl(checksum); /* restore checksum for later use */
 
-       print_image_hdr (hdr);
-
-       cnt = (ntohl(hdr->ih_size) + sizeof(image_header_t));
        cnt += info.blksz - 1;
        cnt /= info.blksz;
        cnt -= 1;
@@ -414,6 +427,13 @@ int do_usbboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                printf ("\n** Read error on %d:%d\n", dev, part);
                return 1;
        }
+
+#if defined(CONFIG_FIT)
+       /* This cannot be done earlier, we need complete FIT image in RAM first */
+       if (genimg_get_format ((void *)addr) == IMAGE_FORMAT_FIT)
+               fit_print_contents ((const void *)addr);
+#endif
+
        /* Loading ok, update default load address */
        load_addr = addr;
 
@@ -529,8 +549,7 @@ int do_usb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        }
 
        if (strncmp(argv[1], "stor", 4) == 0) {
-               usb_stor_info();
-               return 0;
+               return usb_stor_info();
        }
 
        if (strncmp(argv[1],"part",4) == 0) {
index 52e0614..2753389 100644 (file)
@@ -24,7 +24,6 @@
  * MA 02111-1307 USA
  */
 
-#if defined(CONFIG_CMD_XIMG)
 
 /*
  * Multi Image extract
 int
 do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 {
-       ulong addr = load_addr, dest = 0;
-       ulong data, len, checksum;
-       ulong *len_ptr;
-       int i, verify, part = 0;
-       char pbuf[10], *s;
-       image_header_t header;
+       ulong           addr = load_addr;
+       ulong           dest = 0;
+       ulong           data, len, count;
+       int             verify;
+       int             part = 0;
+       char            pbuf[10];
+       image_header_t  *hdr;
+#if defined(CONFIG_FIT)
+       const char      *uname = NULL;
+       const void*     fit_hdr;
+       int             noffset;
+       const void      *fit_data;
+       size_t          fit_len;
+#endif
 
-       s = getenv("verify");
-       verify = (s && (*s == 'n')) ? 0 : 1;
+       verify = getenv_yesno ("verify");
 
        if (argc > 1) {
                addr = simple_strtoul(argv[1], NULL, 16);
        }
        if (argc > 2) {
                part = simple_strtoul(argv[2], NULL, 16);
+#if defined(CONFIG_FIT)
+               uname = argv[2];
+#endif
        }
        if (argc > 3) {
                dest = simple_strtoul(argv[3], NULL, 16);
        }
 
-       printf("## Copying from image at %08lx ...\n", addr);
-
-       /* Copy header so we can blank CRC field for re-calculation */
-       memmove(&header, (char *) addr, sizeof (image_header_t));
-
-       if (ntohl(header.ih_magic) != IH_MAGIC) {
-               printf("Bad Magic Number\n");
-               return 1;
-       }
+       switch (genimg_get_format ((void *)addr)) {
+       case IMAGE_FORMAT_LEGACY:
 
-       data = (ulong) & header;
-       len = sizeof (image_header_t);
+               printf("## Copying part %d from legacy image "
+                       "at %08lx ...\n", part, addr);
 
-       checksum = ntohl(header.ih_hcrc);
-       header.ih_hcrc = 0;
+               hdr = (image_header_t *)addr;
+               if (!image_check_magic (hdr)) {
+                       printf("Bad Magic Number\n");
+                       return 1;
+               }
 
-       if (crc32(0, (char *) data, len) != checksum) {
-               printf("Bad Header Checksum\n");
-               return 1;
-       }
+               if (!image_check_hcrc (hdr)) {
+                       printf("Bad Header Checksum\n");
+                       return 1;
+               }
 #ifdef DEBUG
-       print_image_hdr((image_header_t *) addr);
+               image_print_contents (hdr);
 #endif
 
-       data = addr + sizeof (image_header_t);
-       len = ntohl(header.ih_size);
+               if (!image_check_type (hdr, IH_TYPE_MULTI)) {
+                       printf("Wrong Image Type for %s command\n",
+                                       cmdtp->name);
+                       return 1;
+               }
 
-       if (header.ih_type != IH_TYPE_MULTI) {
-               printf("Wrong Image Type for %s command\n", cmdtp->name);
-               return 1;
-       }
+               if (image_get_comp (hdr) != IH_COMP_NONE) {
+                       printf("Wrong Compression Type for %s command\n",
+                                       cmdtp->name);
+                       return 1;
+               }
 
-       if (header.ih_comp != IH_COMP_NONE) {
-               printf("Wrong Compression Type for %s command\n", cmdtp->name);
-               return 1;
-       }
+               if (verify) {
+                       printf("   Verifying Checksum ... ");
+                       if (!image_check_dcrc (hdr)) {
+                               printf("Bad Data CRC\n");
+                               return 1;
+                       }
+                       printf("OK\n");
+               }
 
-       if (verify) {
-               printf("   Verifying Checksum ... ");
-               if (crc32(0, (char *) data, len) != ntohl(header.ih_dcrc)) {
-                       printf("Bad Data CRC\n");
+               count = image_multi_count (hdr);
+               if (part >= count) {
+                       printf("Bad Image Part\n");
+                       return 1;
+               }
+
+               image_multi_getimg (hdr, part, &data, &len);
+               break;
+#if defined(CONFIG_FIT)
+       case IMAGE_FORMAT_FIT:
+               if (uname == NULL) {
+                       puts ("No FIT subimage unit name\n");
+                       return 1;
+               }
+
+               printf("## Copying '%s' subimage from FIT image "
+                       "at %08lx ...\n", uname, addr);
+
+               fit_hdr = (const void *)addr;
+               if (!fit_check_format (fit_hdr)) {
+                       puts ("Bad FIT image format\n");
+                       return 1;
+               }
+
+               /* get subimage node offset */
+               noffset = fit_image_get_node (fit_hdr, uname);
+               if (noffset < 0) {
+                       printf ("Can't find '%s' FIT subimage\n", uname);
                        return 1;
                }
-               printf("OK\n");
-       }
 
-       len_ptr = (ulong *) data;
-
-       data += 4;              /* terminator */
-       for (i = 0; len_ptr[i]; ++i) {
-               data += 4;
-               if (argc > 2 && part > i) {
-                       u_long tail;
-                       len = ntohl(len_ptr[i]);
-                       tail = len % 4;
-                       data += len;
-                       if (tail) {
-                               data += 4 - tail;
+               if (fit_image_check_comp (fit_hdr, noffset, IH_COMP_NONE)) {
+                       printf("Wrong Compression Type for %s command\n",
+                                       cmdtp->name);
+                       return 1;
+               }
+
+               /* verify integrity */
+               if (verify) {
+                       if (!fit_image_check_hashes (fit_hdr, noffset)) {
+                               puts ("Bad Data Hash\n");
+                               return 1;
                        }
                }
-       }
-       if (argc > 2 && part >= i) {
-               printf("Bad Image Part\n");
+
+               /* get subimage data address and length */
+               if (fit_image_get_data (fit_hdr, noffset, &fit_data, &fit_len)) {
+                       puts ("Could not find script subimage data\n");
+                       return 1;
+               }
+
+               data = (ulong)fit_data;
+               len = (ulong)fit_len;
+               break;
+#endif
+       default:
+               puts ("Invalid image type for imxtract\n");
                return 1;
        }
-       len = ntohl(len_ptr[part]);
 
        if (argc > 3) {
                memcpy((char *) dest, (char *) data, len);
@@ -139,6 +182,9 @@ do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 U_BOOT_CMD(imxtract, 4, 1, do_imgextract,
           "imxtract- extract a part of a multi-image\n",
           "addr part [dest]\n"
-          "    - extract <part> from image at <addr> and copy to <dest>\n");
-
+          "    - extract <part> from legacy image at <addr> and copy to <dest>\n"
+#if defined(CONFIG_FIT)
+          "addr uname [dest]\n"
+          "    - extract <uname> subimage from FIT image at <addr> and copy to <dest>\n"
 #endif
+);
index a494812..f366fdb 100644 (file)
@@ -50,7 +50,6 @@ extern void env_relocate_spec (void);
 extern uchar env_get_char_spec(int);
 
 static uchar env_get_char_init (int index);
-uchar (*env_get_char)(int) = env_get_char_init;
 
 /************************************************************************
  * Default settings to be used when no valid environment is found
@@ -182,6 +181,19 @@ uchar env_get_char_memory (int index)
 }
 #endif
 
+uchar env_get_char (int index)
+{
+       uchar c;
+
+       /* if relocated to RAM */
+       if (gd->flags & GD_FLG_RELOC)
+               c = env_get_char_memory(index);
+       else
+               c = env_get_char_init(index);
+
+       return (c);
+}
+
 uchar *env_get_addr (int index)
 {
        if (gd->env_valid) {
@@ -215,11 +227,6 @@ void env_relocate (void)
        DEBUGF ("%s[%d] malloced ENV at %p\n", __FUNCTION__,__LINE__,env_ptr);
 #endif
 
-       /*
-        * After relocation to RAM, we can always use the "memory" functions
-        */
-       env_get_char = env_get_char_memory;
-
        if (gd->env_valid == 0) {
 #if defined(CONFIG_GTH)        || defined(CFG_ENV_IS_NOWHERE)  /* Environment not changable */
                puts ("Using default environment\n\n");
index 2adc129..fae87ca 100644 (file)
@@ -38,7 +38,6 @@ env_t *env_ptr = NULL;
 
 char * env_name_spec = "EEPROM";
 
-extern uchar (*env_get_char)(int);
 extern uchar env_get_char_memory (int index);
 
 
index 7c18896..bfc8d02 100644 (file)
@@ -63,7 +63,6 @@ char * env_name_spec = "NVRAM";
 extern uchar default_environment[];
 extern int default_environment_size;
 
-extern uchar (*env_get_char)(int);
 extern uchar env_get_char_memory (int index);
 
 #ifdef CONFIG_AMIGAONEG3SE
index 5888f75..ac8a8c1 100644 (file)
@@ -52,22 +52,21 @@ static unsigned char onenand_env[MAX_ONENAND_PAGESIZE];
 env_t *env_ptr = (env_t *) onenand_env;
 #endif /* ENV_IS_EMBEDDED */
 
+DECLARE_GLOBAL_DATA_PTR;
+
 uchar env_get_char_spec(int index)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        return (*((uchar *) (gd->env_addr + index)));
 }
 
 void env_relocate_spec(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
        unsigned long env_addr;
        int use_default = 0;
        size_t retlen;
 
        env_addr = CFG_ENV_ADDR;
-       env_addr -= (unsigned long)onenand_chip.base;
+       env_addr -= (unsigned long) onenand_chip.base;
 
        /* Check OneNAND exist */
        if (onenand_mtd.oobblock)
@@ -95,7 +94,9 @@ void env_relocate_spec(void)
 int saveenv(void)
 {
        unsigned long env_addr = CFG_ENV_ADDR;
-       struct erase_info instr;
+       struct erase_info instr = {
+               .callback       = NULL,
+       };
        size_t retlen;
 
        instr.len = CFG_ENV_SIZE;
@@ -108,7 +109,7 @@ int saveenv(void)
 
        /* update crc */
        env_ptr->crc =
-           crc32(0, env_ptr->data, onenand_mtd.oobblock - ENV_HEADER_SIZE);
+           crc32(0, env_ptr->data, ONENAND_ENV_SIZE(onenand_mtd));
 
        env_addr -= (unsigned long)onenand_chip.base;
        if (onenand_write(&onenand_mtd, env_addr, onenand_mtd.oobblock, &retlen,
@@ -122,8 +123,6 @@ int saveenv(void)
 
 int env_init(void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
-
        /* use default */
        gd->env_addr = (ulong) & default_environment[0];
        gd->env_valid = 1;
index 69eb667..7507744 100644 (file)
@@ -40,7 +40,6 @@ DECLARE_GLOBAL_DATA_PTR;
  */
 struct fdt_header *fdt;
 
-/********************************************************************/
 
 /**
  * fdt_find_and_setprop: Find a node and set it's property
@@ -218,198 +217,6 @@ int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force)
        return err;
 }
 
-/********************************************************************/
-
-#ifdef CONFIG_OF_HAS_UBOOT_ENV
-
-/* Function that returns a character from the environment */
-extern uchar(*env_get_char) (int);
-
-
-int fdt_env(void *fdt)
-{
-       int   nodeoffset;
-       int   err;
-       int   k, nxt;
-       int i;
-       static char tmpenv[256];
-
-       err = fdt_check_header(fdt);
-       if (err < 0) {
-               printf("fdt_env: %s\n", fdt_strerror(err));
-               return err;
-       }
-
-       /*
-        * See if we already have a "u-boot-env" node, delete it if so.
-        * Then create a new empty node.
-        */
-       nodeoffset = fdt_path_offset (fdt, "/u-boot-env");
-       if (nodeoffset >= 0) {
-               err = fdt_del_node(fdt, nodeoffset);
-               if (err < 0) {
-                       printf("fdt_env: %s\n", fdt_strerror(err));
-                       return err;
-               }
-       }
-       /*
-        * Create a new node "/u-boot-env" (offset 0 is root level)
-        */
-       nodeoffset = fdt_add_subnode(fdt, 0, "u-boot-env");
-       if (nodeoffset < 0) {
-               printf("WARNING: could not create /u-boot-env %s.\n",
-                       fdt_strerror(nodeoffset));
-               return nodeoffset;
-       }
-
-       for (i = 0; env_get_char(i) != '\0'; i = nxt + 1) {
-               char *s, *lval, *rval;
-
-               /*
-                * Find the end of the name=definition
-                */
-               for (nxt = i; env_get_char(nxt) != '\0'; ++nxt)
-                       ;
-               s = tmpenv;
-               for (k = i; k < nxt && s < &tmpenv[sizeof(tmpenv) - 1]; ++k)
-                       *s++ = env_get_char(k);
-               *s++ = '\0';
-               lval = tmpenv;
-               /*
-                * Find the first '=': it separates the name from the value
-                */
-               s = strchr(tmpenv, '=');
-               if (s != NULL) {
-                       *s++ = '\0';
-                       rval = s;
-               } else
-                       continue;
-               err = fdt_setprop(fdt, nodeoffset, lval, rval, strlen(rval)+1);
-               if (err < 0) {
-                       printf("WARNING: could not set %s %s.\n",
-                               lval, fdt_strerror(err));
-                       return err;
-               }
-       }
-       return 0;
-}
-#endif /* ifdef CONFIG_OF_HAS_UBOOT_ENV */
-
-/********************************************************************/
-
-#ifdef CONFIG_OF_HAS_BD_T
-
-#define BDM(x) {       .name = #x, .offset = offsetof(bd_t, bi_ ##x ) }
-
-static const struct {
-       const char *name;
-       int offset;
-} bd_map[] = {
-       BDM(memstart),
-       BDM(memsize),
-       BDM(flashstart),
-       BDM(flashsize),
-       BDM(flashoffset),
-       BDM(sramstart),
-       BDM(sramsize),
-#if defined(CONFIG_5xx) || defined(CONFIG_8xx) || defined(CONFIG_8260) \
-       || defined(CONFIG_E500)
-       BDM(immr_base),
-#endif
-#if defined(CONFIG_MPC5xxx)
-       BDM(mbar_base),
-#endif
-#if defined(CONFIG_MPC83XX)
-       BDM(immrbar),
-#endif
-#if defined(CONFIG_MPC8220)
-       BDM(mbar_base),
-       BDM(inpfreq),
-       BDM(pcifreq),
-       BDM(pevfreq),
-       BDM(flbfreq),
-       BDM(vcofreq),
-#endif
-       BDM(bootflags),
-       BDM(ip_addr),
-       BDM(intfreq),
-       BDM(busfreq),
-#ifdef CONFIG_CPM2
-       BDM(cpmfreq),
-       BDM(brgfreq),
-       BDM(sccfreq),
-       BDM(vco),
-#endif
-#if defined(CONFIG_MPC5xxx)
-       BDM(ipbfreq),
-       BDM(pcifreq),
-#endif
-       BDM(baudrate),
-};
-
-
-int fdt_bd_t(void *fdt)
-{
-       bd_t *bd = gd->bd;
-       int   nodeoffset;
-       int   err;
-       u32   tmp;              /* used to set 32 bit integer properties */
-       int i;
-
-       err = fdt_check_header(fdt);
-       if (err < 0) {
-               printf("fdt_bd_t: %s\n", fdt_strerror(err));
-               return err;
-       }
-
-       /*
-        * See if we already have a "bd_t" node, delete it if so.
-        * Then create a new empty node.
-        */
-       nodeoffset = fdt_path_offset (fdt, "/bd_t");
-       if (nodeoffset >= 0) {
-               err = fdt_del_node(fdt, nodeoffset);
-               if (err < 0) {
-                       printf("fdt_bd_t: %s\n", fdt_strerror(err));
-                       return err;
-               }
-       }
-       /*
-        * Create a new node "/bd_t" (offset 0 is root level)
-        */
-       nodeoffset = fdt_add_subnode(fdt, 0, "bd_t");
-       if (nodeoffset < 0) {
-               printf("WARNING: could not create /bd_t %s.\n",
-                       fdt_strerror(nodeoffset));
-               printf("fdt_bd_t: %s\n", fdt_strerror(nodeoffset));
-               return nodeoffset;
-       }
-       /*
-        * Use the string/pointer structure to create the entries...
-        */
-       for (i = 0; i < sizeof(bd_map)/sizeof(bd_map[0]); i++) {
-               tmp = cpu_to_be32(getenv("bootargs"));
-               err = fdt_setprop(fdt, nodeoffset,
-                       bd_map[i].name, &tmp, sizeof(tmp));
-               if (err < 0)
-                       printf("WARNING: could not set %s %s.\n",
-                               bd_map[i].name, fdt_strerror(err));
-       }
-       /*
-        * Add a couple of oddball entries...
-        */
-       err = fdt_setprop(fdt, nodeoffset, "enetaddr", &bd->bi_enetaddr, 6);
-       if (err < 0)
-               printf("WARNING: could not set enetaddr %s.\n",
-                       fdt_strerror(err));
-       err = fdt_setprop(fdt, nodeoffset, "ethspeed", &bd->bi_ethspeed, 4);
-       if (err < 0)
-               printf("WARNING: could not set ethspeed %s.\n",
-                       fdt_strerror(err));
-       return 0;
-}
-#endif /* ifdef CONFIG_OF_HAS_BD_T */
-
 void do_fixup_by_path(void *fdt, const char *path, const char *prop,
                      const void *val, int len, int create)
 {
@@ -615,3 +422,28 @@ void fdt_fixup_ethernet(void *fdt, bd_t *bd)
        }
 }
 #endif
+
+#ifdef CONFIG_HAS_FSL_DR_USB
+void fdt_fixup_dr_usb(void *blob, bd_t *bd)
+{
+       char *mode;
+       const char *compat = "fsl-usb2-dr";
+       const char *prop = "dr_mode";
+       int node_offset;
+       int err;
+
+       mode = getenv("usb_dr_mode");
+       if (!mode)
+               return;
+
+       node_offset = fdt_node_offset_by_compatible(blob, 0, compat);
+       if (node_offset < 0)
+               printf("WARNING: could not find compatible node %s: %s.\n",
+                       compat, fdt_strerror(node_offset));
+
+       err = fdt_setprop(blob, node_offset, prop, mode, strlen(mode) + 1);
+       if (err < 0)
+               printf("WARNING: could not set %s for %s: %s.\n",
+                      prop, compat, fdt_strerror(err));
+}
+#endif /* CONFIG_HAS_FSL_DR_USB */
index d8b6ae3..d16a92d 100644 (file)
@@ -199,10 +199,6 @@ void fpga_init( ulong reloc_off )
        memset( desc_table, 0, sizeof(desc_table));
 
        PRINTF( "%s: CONFIG_FPGA = 0x%x\n", __FUNCTION__, CONFIG_FPGA );
-#if 0
-       PRINTF( "%s: CFG_FPGA_XILINX = 0x%x\n", __FUNCTION__, CFG_FPGA_XILINX );
-       PRINTF( "%s: CFG_FPGA_ALTERA = 0x%x\n", __FUNCTION__, CFG_FPGA_ALTERA );
-#endif
 }
 
 /* fpga_count
index 5a0575e..0b6c2b7 100644 (file)
@@ -396,58 +396,6 @@ void *ft_get_prop(void *bphp, const char *propname, int *szp)
 
 /********************************************************************/
 
-/* Function that returns a character from the environment */
-extern uchar(*env_get_char) (int);
-
-#define BDM(x) {       .name = #x, .offset = offsetof(bd_t, bi_ ##x ) }
-
-#ifdef CONFIG_OF_HAS_BD_T
-static const struct {
-       const char *name;
-       int offset;
-} bd_map[] = {
-       BDM(memstart),
-       BDM(memsize),
-       BDM(flashstart),
-       BDM(flashsize),
-       BDM(flashoffset),
-       BDM(sramstart),
-       BDM(sramsize),
-#if defined(CONFIG_5xx) || defined(CONFIG_8xx) || defined(CONFIG_8260) \
-       || defined(CONFIG_E500)
-       BDM(immr_base),
-#endif
-#if defined(CONFIG_MPC5xxx)
-       BDM(mbar_base),
-#endif
-#if defined(CONFIG_MPC83XX)
-       BDM(immrbar),
-#endif
-#if defined(CONFIG_MPC8220)
-       BDM(mbar_base),
-       BDM(inpfreq),
-       BDM(pcifreq),
-       BDM(pevfreq),
-       BDM(flbfreq),
-       BDM(vcofreq),
-#endif
-       BDM(bootflags),
-       BDM(ip_addr),
-       BDM(intfreq),
-       BDM(busfreq),
-#ifdef CONFIG_CPM2
-       BDM(cpmfreq),
-       BDM(brgfreq),
-       BDM(sccfreq),
-       BDM(vco),
-#endif
-#if defined(CONFIG_MPC5xxx)
-       BDM(ipbfreq),
-       BDM(pcifreq),
-#endif
-       BDM(baudrate),
-};
-#endif
 
 void ft_setup(void *blob, bd_t * bd, ulong initrd_start, ulong initrd_end)
 {
@@ -455,16 +403,6 @@ void ft_setup(void *blob, bd_t * bd, ulong initrd_start, ulong initrd_end)
        int len;
        struct ft_cxt cxt;
        ulong clock;
-#if defined(CONFIG_OF_HAS_UBOOT_ENV)
-       int k, nxt;
-#endif
-#if defined(CONFIG_OF_HAS_BD_T)
-       u8 *end;
-#endif
-#if defined(CONFIG_OF_HAS_UBOOT_ENV) || defined(CONFIG_OF_HAS_BD_T)
-       int i;
-       static char tmpenv[256];
-#endif
 
        /* disable OF tree; booting old kernel */
        if (getenv("disable_of") != NULL) {
@@ -485,30 +423,6 @@ void ft_setup(void *blob, bd_t * bd, ulong initrd_start, ulong initrd_end)
        /* back into root */
        ft_backtrack_node(&cxt);
 
-#ifdef CONFIG_OF_HAS_UBOOT_ENV
-       ft_begin_node(&cxt, "u-boot-env");
-
-       for (i = 0; env_get_char(i) != '\0'; i = nxt + 1) {
-               char *s, *lval, *rval;
-
-               for (nxt = i; env_get_char(nxt) != '\0'; ++nxt) ;
-               s = tmpenv;
-               for (k = i; k < nxt && s < &tmpenv[sizeof(tmpenv) - 1]; ++k)
-                       *s++ = env_get_char(k);
-               *s++ = '\0';
-               lval = tmpenv;
-               s = strchr(tmpenv, '=');
-               if (s != NULL) {
-                       *s++ = '\0';
-                       rval = s;
-               } else
-                       continue;
-               ft_prop_str(&cxt, lval, rval);
-       }
-
-       ft_end_node(&cxt);
-#endif
-
        ft_begin_node(&cxt, "chosen");
        ft_prop_str(&cxt, "name", "chosen");
 
@@ -529,36 +443,7 @@ void ft_setup(void *blob, bd_t * bd, ulong initrd_start, ulong initrd_end)
        ft_end_tree(&cxt);
        ft_finalize_tree(&cxt);
 
-#ifdef CONFIG_OF_HAS_BD_T
-       /* paste the bd_t at the end of the flat tree */
-       end = (char *)blob +
-           be32_to_cpu(((struct boot_param_header *)blob)->totalsize);
-       memcpy(end, bd, sizeof(*bd));
-#endif
-
 #ifdef CONFIG_PPC
-
-#ifdef CONFIG_OF_HAS_BD_T
-       for (i = 0; i < sizeof(bd_map)/sizeof(bd_map[0]); i++) {
-               uint32_t v;
-
-               sprintf(tmpenv, "/bd_t/%s", bd_map[i].name);
-               v = *(uint32_t *)((char *)bd + bd_map[i].offset);
-
-               p = ft_get_prop(blob, tmpenv, &len);
-               if (p != NULL)
-                       *p = cpu_to_be32(v);
-       }
-
-       p = ft_get_prop(blob, "/bd_t/enetaddr", &len);
-       if (p != NULL)
-               memcpy(p, bd->bi_enetaddr, 6);
-
-       p = ft_get_prop(blob, "/bd_t/ethspeed", &len);
-       if (p != NULL)
-               *p = cpu_to_be32((uint32_t) bd->bi_ethspeed);
-#endif
-
        clock = bd->bi_intfreq;
        p = ft_get_prop(blob, "/cpus/" OF_CPU "/clock-frequency", &len);
        if (p != NULL)
diff --git a/common/gunzip.c b/common/gunzip.c
new file mode 100644 (file)
index 0000000..74f0bf9
--- /dev/null
@@ -0,0 +1,113 @@
+/*
+ * (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 <common.h>
+#include <watchdog.h>
+#include <command.h>
+#include <image.h>
+#include <malloc.h>
+#include <zlib.h>
+
+#define        ZALLOC_ALIGNMENT        16
+#define HEAD_CRC               2
+#define EXTRA_FIELD            4
+#define ORIG_NAME              8
+#define COMMENT                        0x10
+#define RESERVED               0xe0
+#define DEFLATED               8
+
+int gunzip(void *, int, unsigned char *, unsigned long *);
+void *zalloc(void *, unsigned, unsigned);
+void zfree(void *, void *, unsigned);
+
+void *zalloc(void *x, unsigned items, unsigned size)
+{
+       void *p;
+
+       size *= items;
+       size = (size + ZALLOC_ALIGNMENT - 1) & ~(ZALLOC_ALIGNMENT - 1);
+
+       p = malloc (size);
+
+       return (p);
+}
+
+void zfree(void *x, void *addr, unsigned nb)
+{
+       free (addr);
+}
+
+int gunzip(void *dst, int dstlen, unsigned char *src, unsigned long *lenp)
+{
+       z_stream s;
+       int r, i, flags;
+
+       /* skip header */
+       i = 10;
+       flags = src[3];
+       if (src[2] != DEFLATED || (flags & RESERVED) != 0) {
+               puts ("Error: Bad gzipped data\n");
+               return (-1);
+       }
+       if ((flags & EXTRA_FIELD) != 0)
+               i = 12 + src[10] + (src[11] << 8);
+       if ((flags & ORIG_NAME) != 0)
+               while (src[i++] != 0)
+                       ;
+       if ((flags & COMMENT) != 0)
+               while (src[i++] != 0)
+                       ;
+       if ((flags & HEAD_CRC) != 0)
+               i += 2;
+       if (i >= *lenp) {
+               puts ("Error: gunzip out of data in header\n");
+               return (-1);
+       }
+
+       s.zalloc = zalloc;
+       s.zfree = zfree;
+#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+       s.outcb = (cb_func)WATCHDOG_RESET;
+#else
+       s.outcb = Z_NULL;
+#endif /* CONFIG_HW_WATCHDOG */
+
+       r = inflateInit2(&s, -MAX_WBITS);
+       if (r != Z_OK) {
+               printf ("Error: inflateInit2() returned %d\n", r);
+               return (-1);
+       }
+       s.next_in = src + i;
+       s.avail_in = *lenp - i;
+       s.next_out = dst;
+       s.avail_out = dstlen;
+       r = inflate(&s, Z_FINISH);
+       if (r != Z_OK && r != Z_STREAM_END) {
+               printf ("Error: inflate() returned %d\n", r);
+               return (-1);
+       }
+       *lenp = s.next_out - (unsigned char *) dst;
+       inflateEnd(&s);
+
+       return (0);
+}
diff --git a/common/image.c b/common/image.c
new file mode 100644 (file)
index 0000000..83e3593
--- /dev/null
@@ -0,0 +1,2531 @@
+/*
+ * (C) Copyright 2008 Semihalf
+ *
+ * (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
+ */
+
+
+#ifndef USE_HOSTCC
+#include <common.h>
+#include <watchdog.h>
+
+#ifdef CONFIG_SHOW_BOOT_PROGRESS
+#include <status_led.h>
+#endif
+
+#ifdef CONFIG_HAS_DATAFLASH
+#include <dataflash.h>
+#endif
+
+#ifdef CONFIG_LOGBUFFER
+#include <logbuff.h>
+#endif
+
+#if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE)
+#include <rtc.h>
+#endif
+
+#include <image.h>
+
+#if defined(CONFIG_FIT) || defined (CONFIG_OF_LIBFDT)
+#include <fdt.h>
+#include <libfdt.h>
+#include <fdt_support.h>
+#endif
+
+#if defined(CONFIG_FIT)
+#include <u-boot/md5.h>
+#include <sha1.h>
+
+static int fit_check_ramdisk (const void *fit, int os_noffset,
+               uint8_t arch, int verify);
+#endif
+
+#ifdef CONFIG_CMD_BDI
+extern int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+#endif
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static image_header_t* image_get_ramdisk (ulong rd_addr, uint8_t arch,
+                                               int verify);
+#else
+#include "mkimage.h"
+#include <u-boot/md5.h>
+#include <time.h>
+#include <image.h>
+#endif /* !USE_HOSTCC*/
+
+typedef struct table_entry {
+       int     id;             /* as defined in image.h        */
+       char    *sname;         /* short (input) name           */
+       char    *lname;         /* long (output) name           */
+} table_entry_t;
+
+static table_entry_t uimage_arch[] = {
+       {       IH_ARCH_INVALID,        NULL,           "Invalid ARCH", },
+       {       IH_ARCH_ALPHA,          "alpha",        "Alpha",        },
+       {       IH_ARCH_ARM,            "arm",          "ARM",          },
+       {       IH_ARCH_I386,           "x86",          "Intel x86",    },
+       {       IH_ARCH_IA64,           "ia64",         "IA64",         },
+       {       IH_ARCH_M68K,           "m68k",         "M68K",         },
+       {       IH_ARCH_MICROBLAZE,     "microblaze",   "MicroBlaze",   },
+       {       IH_ARCH_MIPS,           "mips",         "MIPS",         },
+       {       IH_ARCH_MIPS64,         "mips64",       "MIPS 64 Bit",  },
+       {       IH_ARCH_NIOS,           "nios",         "NIOS",         },
+       {       IH_ARCH_NIOS2,          "nios2",        "NIOS II",      },
+       {       IH_ARCH_PPC,            "ppc",          "PowerPC",      },
+       {       IH_ARCH_S390,           "s390",         "IBM S390",     },
+       {       IH_ARCH_SH,             "sh",           "SuperH",       },
+       {       IH_ARCH_SPARC,          "sparc",        "SPARC",        },
+       {       IH_ARCH_SPARC64,        "sparc64",      "SPARC 64 Bit", },
+       {       IH_ARCH_BLACKFIN,       "blackfin",     "Blackfin",     },
+       {       IH_ARCH_AVR32,          "avr32",        "AVR32",        },
+       {       -1,                     "",             "",             },
+};
+
+static table_entry_t uimage_os[] = {
+       {       IH_OS_INVALID,  NULL,           "Invalid OS",           },
+#if defined(CONFIG_ARTOS) || defined(USE_HOSTCC)
+       {       IH_OS_ARTOS,    "artos",        "ARTOS",                },
+#endif
+       {       IH_OS_LINUX,    "linux",        "Linux",                },
+#if defined(CONFIG_LYNXKDI) || defined(USE_HOSTCC)
+       {       IH_OS_LYNXOS,   "lynxos",       "LynxOS",               },
+#endif
+       {       IH_OS_NETBSD,   "netbsd",       "NetBSD",               },
+       {       IH_OS_RTEMS,    "rtems",        "RTEMS",                },
+       {       IH_OS_U_BOOT,   "u-boot",       "U-Boot",               },
+#if defined(CONFIG_CMD_ELF) || defined(USE_HOSTCC)
+       {       IH_OS_QNX,      "qnx",          "QNX",                  },
+       {       IH_OS_VXWORKS,  "vxworks",      "VxWorks",              },
+#endif
+#ifdef USE_HOSTCC
+       {       IH_OS_4_4BSD,   "4_4bsd",       "4_4BSD",               },
+       {       IH_OS_DELL,     "dell",         "Dell",                 },
+       {       IH_OS_ESIX,     "esix",         "Esix",                 },
+       {       IH_OS_FREEBSD,  "freebsd",      "FreeBSD",              },
+       {       IH_OS_IRIX,     "irix",         "Irix",                 },
+       {       IH_OS_NCR,      "ncr",          "NCR",                  },
+       {       IH_OS_OPENBSD,  "openbsd",      "OpenBSD",              },
+       {       IH_OS_PSOS,     "psos",         "pSOS",                 },
+       {       IH_OS_SCO,      "sco",          "SCO",                  },
+       {       IH_OS_SOLARIS,  "solaris",      "Solaris",              },
+       {       IH_OS_SVR4,     "svr4",         "SVR4",                 },
+#endif
+       {       -1,             "",             "",                     },
+};
+
+static table_entry_t uimage_type[] = {
+       {       IH_TYPE_INVALID,    NULL,         "Invalid Image",      },
+       {       IH_TYPE_FILESYSTEM, "filesystem", "Filesystem Image",   },
+       {       IH_TYPE_FIRMWARE,   "firmware",   "Firmware",           },
+       {       IH_TYPE_KERNEL,     "kernel",     "Kernel Image",       },
+       {       IH_TYPE_MULTI,      "multi",      "Multi-File Image",   },
+       {       IH_TYPE_RAMDISK,    "ramdisk",    "RAMDisk Image",      },
+       {       IH_TYPE_SCRIPT,     "script",     "Script",             },
+       {       IH_TYPE_STANDALONE, "standalone", "Standalone Program", },
+       {       IH_TYPE_FLATDT,     "flat_dt",    "Flat Device Tree",   },
+       {       -1,                 "",           "",                   },
+};
+
+static table_entry_t uimage_comp[] = {
+       {       IH_COMP_NONE,   "none",         "uncompressed",         },
+       {       IH_COMP_BZIP2,  "bzip2",        "bzip2 compressed",     },
+       {       IH_COMP_GZIP,   "gzip",         "gzip compressed",      },
+       {       -1,             "",             "",                     },
+};
+
+uint32_t crc32 (uint32_t, const unsigned char *, uint);
+static void genimg_print_size (uint32_t size);
+#if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE) || defined(USE_HOSTCC)
+static void genimg_print_time (time_t timestamp);
+#endif
+
+/*****************************************************************************/
+/* Legacy format routines */
+/*****************************************************************************/
+int image_check_hcrc (image_header_t *hdr)
+{
+       ulong hcrc;
+       ulong len = image_get_header_size ();
+       image_header_t header;
+
+       /* Copy header so we can blank CRC field for re-calculation */
+       memmove (&header, (char *)hdr, image_get_header_size ());
+       image_set_hcrc (&header, 0);
+
+       hcrc = crc32 (0, (unsigned char *)&header, len);
+
+       return (hcrc == image_get_hcrc (hdr));
+}
+
+int image_check_dcrc (image_header_t *hdr)
+{
+       ulong data = image_get_data (hdr);
+       ulong len = image_get_data_size (hdr);
+       ulong dcrc = crc32 (0, (unsigned char *)data, len);
+
+       return (dcrc == image_get_dcrc (hdr));
+}
+
+#ifndef USE_HOSTCC
+int image_check_dcrc_wd (image_header_t *hdr, ulong chunksz)
+{
+       ulong dcrc = 0;
+       ulong len = image_get_data_size (hdr);
+       ulong data = image_get_data (hdr);
+
+#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+       ulong cdata = data;
+       ulong edata = cdata + len;
+
+       while (cdata < edata) {
+               ulong chunk = edata - cdata;
+
+               if (chunk > chunksz)
+                       chunk = chunksz;
+               dcrc = crc32 (dcrc, (unsigned char *)cdata, chunk);
+               cdata += chunk;
+
+               WATCHDOG_RESET ();
+       }
+#else
+       dcrc = crc32 (0, (unsigned char *)data, len);
+#endif
+
+       return (dcrc == image_get_dcrc (hdr));
+}
+#endif /* !USE_HOSTCC */
+
+/**
+ * image_multi_count - get component (sub-image) count
+ * @hdr: pointer to the header of the multi component image
+ *
+ * image_multi_count() returns number of components in a multi
+ * component image.
+ *
+ * Note: no checking of the image type is done, caller must pass
+ * a valid multi component image.
+ *
+ * returns:
+ *     number of components
+ */
+ulong image_multi_count (image_header_t *hdr)
+{
+       ulong i, count = 0;
+       uint32_t *size;
+
+       /* get start of the image payload, which in case of multi
+        * component images that points to a table of component sizes */
+       size = (uint32_t *)image_get_data (hdr);
+
+       /* count non empty slots */
+       for (i = 0; size[i]; ++i)
+               count++;
+
+       return count;
+}
+
+/**
+ * image_multi_getimg - get component data address and size
+ * @hdr: pointer to the header of the multi component image
+ * @idx: index of the requested component
+ * @data: pointer to a ulong variable, will hold component data address
+ * @len: pointer to a ulong variable, will hold component size
+ *
+ * image_multi_getimg() returns size and data address for the requested
+ * component in a multi component image.
+ *
+ * Note: no checking of the image type is done, caller must pass
+ * a valid multi component image.
+ *
+ * returns:
+ *     data address and size of the component, if idx is valid
+ *     0 in data and len, if idx is out of range
+ */
+void image_multi_getimg (image_header_t *hdr, ulong idx,
+                       ulong *data, ulong *len)
+{
+       int i;
+       uint32_t *size;
+       ulong offset, tail, count, img_data;
+
+       /* get number of component */
+       count = image_multi_count (hdr);
+
+       /* get start of the image payload, which in case of multi
+        * component images that points to a table of component sizes */
+       size = (uint32_t *)image_get_data (hdr);
+
+       /* get address of the proper component data start, which means
+        * skipping sizes table (add 1 for last, null entry) */
+       img_data = image_get_data (hdr) + (count + 1) * sizeof (uint32_t);
+
+       if (idx < count) {
+               *len = uimage_to_cpu (size[idx]);
+               offset = 0;
+               tail = 0;
+
+               /* go over all indices preceding requested component idx */
+               for (i = 0; i < idx; i++) {
+                       /* add up i-th component size */
+                       offset += uimage_to_cpu (size[i]);
+
+                       /* add up alignment for i-th component */
+                       tail += (4 - uimage_to_cpu (size[i]) % 4);
+               }
+
+               /* calculate idx-th component data address */
+               *data = img_data + offset + tail;
+       } else {
+               *len = 0;
+               *data = 0;
+       }
+}
+
+static void image_print_type (image_header_t *hdr)
+{
+       const char *os, *arch, *type, *comp;
+
+       os = genimg_get_os_name (image_get_os (hdr));
+       arch = genimg_get_arch_name (image_get_arch (hdr));
+       type = genimg_get_type_name (image_get_type (hdr));
+       comp = genimg_get_comp_name (image_get_comp (hdr));
+
+       printf ("%s %s %s (%s)\n", arch, os, type, comp);
+}
+
+/**
+ * image_print_contents - prints out the contents of the legacy format image
+ * @hdr: pointer to the legacy format image header
+ * @p: pointer to prefix string
+ *
+ * image_print_contents() formats a multi line legacy image contents description.
+ * The routine prints out all header fields followed by the size/offset data
+ * for MULTI/SCRIPT images.
+ *
+ * returns:
+ *     no returned results
+ */
+void image_print_contents (image_header_t *hdr)
+{
+       const char *p;
+
+#ifdef USE_HOSTCC
+       p = "";
+#else
+       p = "   ";
+#endif
+
+       printf ("%sImage Name:   %.*s\n", p, IH_NMLEN, image_get_name (hdr));
+#if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE) || defined(USE_HOSTCC)
+       printf ("%sCreated:      ", p);
+       genimg_print_time ((time_t)image_get_time (hdr));
+#endif
+       printf ("%sImage Type:   ", p);
+       image_print_type (hdr);
+       printf ("%sData Size:    ", p);
+       genimg_print_size (image_get_data_size (hdr));
+       printf ("%sLoad Address: %08x\n", p, image_get_load (hdr));
+       printf ("%sEntry Point:  %08x\n", p, image_get_ep (hdr));
+
+       if (image_check_type (hdr, IH_TYPE_MULTI) ||
+                       image_check_type (hdr, IH_TYPE_SCRIPT)) {
+               int i;
+               ulong data, len;
+               ulong count = image_multi_count (hdr);
+
+               printf ("%sContents:\n", p);
+               for (i = 0; i < count; i++) {
+                       image_multi_getimg (hdr, i, &data, &len);
+
+                       printf ("%s   Image %d: ", p, i);
+                       genimg_print_size (len);
+
+                       if (image_check_type (hdr, IH_TYPE_SCRIPT) && i > 0) {
+                               /*
+                                * the user may need to know offsets
+                                * if planning to do something with
+                                * multiple files
+                                */
+                               printf ("%s    Offset = 0x%08lx\n", p, data);
+                       }
+               }
+       }
+}
+
+
+#ifndef USE_HOSTCC
+/**
+ * image_get_ramdisk - get and verify ramdisk image
+ * @rd_addr: ramdisk image start address
+ * @arch: expected ramdisk architecture
+ * @verify: checksum verification flag
+ *
+ * image_get_ramdisk() returns a pointer to the verified ramdisk image
+ * header. Routine receives image start address and expected architecture
+ * flag. Verification done covers data and header integrity and os/type/arch
+ * fields checking.
+ *
+ * If dataflash support is enabled routine checks for dataflash addresses
+ * and handles required dataflash reads.
+ *
+ * returns:
+ *     pointer to a ramdisk image header, if image was found and valid
+ *     otherwise, return NULL
+ */
+static image_header_t* image_get_ramdisk (ulong rd_addr, uint8_t arch,
+                                               int verify)
+{
+       image_header_t *rd_hdr = (image_header_t *)rd_addr;
+
+       if (!image_check_magic (rd_hdr)) {
+               puts ("Bad Magic Number\n");
+               show_boot_progress (-10);
+               return NULL;
+       }
+
+       if (!image_check_hcrc (rd_hdr)) {
+               puts ("Bad Header Checksum\n");
+               show_boot_progress (-11);
+               return NULL;
+       }
+
+       show_boot_progress (10);
+       image_print_contents (rd_hdr);
+
+       if (verify) {
+               puts("   Verifying Checksum ... ");
+               if (!image_check_dcrc_wd (rd_hdr, CHUNKSZ)) {
+                       puts ("Bad Data CRC\n");
+                       show_boot_progress (-12);
+                       return NULL;
+               }
+               puts("OK\n");
+       }
+
+       show_boot_progress (11);
+
+       if (!image_check_os (rd_hdr, IH_OS_LINUX) ||
+           !image_check_arch (rd_hdr, arch) ||
+           !image_check_type (rd_hdr, IH_TYPE_RAMDISK)) {
+               printf ("No Linux %s Ramdisk Image\n",
+                               genimg_get_arch_name(arch));
+               show_boot_progress (-13);
+               return NULL;
+       }
+
+       return rd_hdr;
+}
+#endif /* !USE_HOSTCC */
+
+/*****************************************************************************/
+/* Shared dual-format routines */
+/*****************************************************************************/
+#ifndef USE_HOSTCC
+int getenv_yesno (char *var)
+{
+       char *s = getenv (var);
+       return (s && (*s == 'n')) ? 0 : 1;
+}
+
+ulong getenv_bootm_low(void)
+{
+       char *s = getenv ("bootm_low");
+       if (s) {
+               ulong tmp = simple_strtoul (s, NULL, 16);
+               return tmp;
+       }
+
+#if defined(CFG_SDRAM_BASE)
+       return CFG_SDRAM_BASE;
+#elif defined(CONFIG_ARM)
+       return gd->bd->bi_dram[0].start;
+#else
+       return 0;
+#endif
+}
+
+ulong getenv_bootm_size(void)
+{
+       char *s = getenv ("bootm_size");
+       if (s) {
+               ulong tmp = simple_strtoul (s, NULL, 16);
+               return tmp;
+       }
+
+#if defined(CONFIG_ARM)
+       return gd->bd->bi_dram[0].size;
+#else
+       return gd->bd->bi_memsize;
+#endif
+}
+
+void memmove_wd (void *to, void *from, size_t len, ulong chunksz)
+{
+#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+       while (len > 0) {
+               size_t tail = (len > chunksz) ? chunksz : len;
+               WATCHDOG_RESET ();
+               memmove (to, from, tail);
+               to += tail;
+               from += tail;
+               len -= tail;
+       }
+#else  /* !(CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG) */
+       memmove (to, from, len);
+#endif /* CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG */
+}
+#endif /* !USE_HOSTCC */
+
+static void genimg_print_size (uint32_t size)
+{
+#ifndef USE_HOSTCC
+       printf ("%d Bytes = ", size);
+       print_size (size, "\n");
+#else
+       printf ("%d Bytes = %.2f kB = %.2f MB\n",
+                       size, (double)size / 1.024e3,
+                       (double)size / 1.048576e6);
+#endif
+}
+
+#if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE) || defined(USE_HOSTCC)
+static void genimg_print_time (time_t timestamp)
+{
+#ifndef USE_HOSTCC
+       struct rtc_time tm;
+
+       to_tm (timestamp, &tm);
+       printf ("%4d-%02d-%02d  %2d:%02d:%02d UTC\n",
+                       tm.tm_year, tm.tm_mon, tm.tm_mday,
+                       tm.tm_hour, tm.tm_min, tm.tm_sec);
+#else
+       printf ("%s", ctime(&timestamp));
+#endif
+}
+#endif /* CONFIG_TIMESTAMP || CONFIG_CMD_DATE || USE_HOSTCC */
+
+/**
+ * get_table_entry_name - translate entry id to long name
+ * @table: pointer to a translation table for entries of a specific type
+ * @msg: message to be returned when translation fails
+ * @id: entry id to be translated
+ *
+ * get_table_entry_name() will go over translation table trying to find
+ * entry that matches given id. If matching entry is found, its long
+ * name is returned to the caller.
+ *
+ * returns:
+ *     long entry name if translation succeeds
+ *     msg otherwise
+ */
+static char *get_table_entry_name (table_entry_t *table, char *msg, int id)
+{
+       for (; table->id >= 0; ++table) {
+               if (table->id == id)
+                       return (table->lname);
+       }
+       return (msg);
+}
+
+const char *genimg_get_os_name (uint8_t os)
+{
+       return (get_table_entry_name (uimage_os, "Unknown OS", os));
+}
+
+const char *genimg_get_arch_name (uint8_t arch)
+{
+       return (get_table_entry_name (uimage_arch, "Unknown Architecture", arch));
+}
+
+const char *genimg_get_type_name (uint8_t type)
+{
+       return (get_table_entry_name (uimage_type, "Unknown Image", type));
+}
+
+const char *genimg_get_comp_name (uint8_t comp)
+{
+       return (get_table_entry_name (uimage_comp, "Unknown Compression", comp));
+}
+
+/**
+ * get_table_entry_id - translate short entry name to id
+ * @table: pointer to a translation table for entries of a specific type
+ * @table_name: to be used in case of error
+ * @name: entry short name to be translated
+ *
+ * get_table_entry_id() will go over translation table trying to find
+ * entry that matches given short name. If matching entry is found,
+ * its id returned to the caller.
+ *
+ * returns:
+ *     entry id if translation succeeds
+ *     -1 otherwise
+ */
+static int get_table_entry_id (table_entry_t *table,
+               const char *table_name, const char *name)
+{
+       table_entry_t *t;
+#ifdef USE_HOSTCC
+       int first = 1;
+
+       for (t = table; t->id >= 0; ++t) {
+               if (t->sname && strcasecmp(t->sname, name) == 0)
+                       return (t->id);
+       }
+
+       fprintf (stderr, "\nInvalid %s Type - valid names are", table_name);
+       for (t = table; t->id >= 0; ++t) {
+               if (t->sname == NULL)
+                       continue;
+               fprintf (stderr, "%c %s", (first) ? ':' : ',', t->sname);
+               first = 0;
+       }
+       fprintf (stderr, "\n");
+#else
+       for (t = table; t->id >= 0; ++t) {
+               if (t->sname && strcmp(t->sname, name) == 0)
+                       return (t->id);
+       }
+       debug ("Invalid %s Type: %s\n", table_name, name);
+#endif /* USE_HOSTCC */
+       return (-1);
+}
+
+int genimg_get_os_id (const char *name)
+{
+       return (get_table_entry_id (uimage_os, "OS", name));
+}
+
+int genimg_get_arch_id (const char *name)
+{
+       return (get_table_entry_id (uimage_arch, "CPU", name));
+}
+
+int genimg_get_type_id (const char *name)
+{
+       return (get_table_entry_id (uimage_type, "Image", name));
+}
+
+int genimg_get_comp_id (const char *name)
+{
+       return (get_table_entry_id (uimage_comp, "Compression", name));
+}
+
+#ifndef USE_HOSTCC
+/**
+ * genimg_get_format - get image format type
+ * @img_addr: image start address
+ *
+ * genimg_get_format() checks whether provided address points to a valid
+ * legacy or FIT image.
+ *
+ * New uImage format and FDT blob are based on a libfdt. FDT blob
+ * may be passed directly or embedded in a FIT image. In both situations
+ * genimg_get_format() must be able to dectect libfdt header.
+ *
+ * returns:
+ *     image format type or IMAGE_FORMAT_INVALID if no image is present
+ */
+int genimg_get_format (void *img_addr)
+{
+       ulong           format = IMAGE_FORMAT_INVALID;
+       image_header_t  *hdr;
+#if defined(CONFIG_FIT) || defined(CONFIG_OF_LIBFDT)
+       char            *fit_hdr;
+#endif
+
+       hdr = (image_header_t *)img_addr;
+       if (image_check_magic(hdr))
+               format = IMAGE_FORMAT_LEGACY;
+#if defined(CONFIG_FIT) || defined(CONFIG_OF_LIBFDT)
+       else {
+               fit_hdr = (char *)img_addr;
+               if (fdt_check_header (fit_hdr) == 0)
+                       format = IMAGE_FORMAT_FIT;
+       }
+#endif
+
+       return format;
+}
+
+/**
+ * genimg_get_image - get image from special storage (if necessary)
+ * @img_addr: image start address
+ *
+ * genimg_get_image() checks if provided image start adddress is located
+ * in a dataflash storage. If so, image is moved to a system RAM memory.
+ *
+ * returns:
+ *     image start address after possible relocation from special storage
+ */
+ulong genimg_get_image (ulong img_addr)
+{
+       ulong ram_addr = img_addr;
+
+#ifdef CONFIG_HAS_DATAFLASH
+       ulong h_size, d_size;
+
+       if (addr_dataflash (img_addr)){
+               /* ger RAM address */
+               ram_addr = CFG_LOAD_ADDR;
+
+               /* get header size */
+               h_size = image_get_header_size ();
+#if defined(CONFIG_FIT)
+               if (sizeof(struct fdt_header) > h_size)
+                       h_size = sizeof(struct fdt_header);
+#endif
+
+               /* read in header */
+               debug ("   Reading image header from dataflash address "
+                       "%08lx to RAM address %08lx\n", img_addr, ram_addr);
+
+               read_dataflash (img_addr, h_size, (char *)ram_addr);
+
+               /* get data size */
+               switch (genimg_get_format ((void *)ram_addr)) {
+               case IMAGE_FORMAT_LEGACY:
+                       d_size = image_get_data_size ((image_header_t *)ram_addr);
+                       debug ("   Legacy format image found at 0x%08lx, size 0x%08lx\n",
+                                       ram_addr, d_size);
+                       break;
+#if defined(CONFIG_FIT)
+               case IMAGE_FORMAT_FIT:
+                       d_size = fit_get_size ((const void *)ram_addr) - h_size;
+                       debug ("   FIT/FDT format image found at 0x%08lx, size 0x%08lx\n",
+                                       ram_addr, d_size);
+                       break;
+#endif
+               default:
+                       printf ("   No valid image found at 0x%08lx\n", img_addr);
+                       return ram_addr;
+               }
+
+               /* read in image data */
+               debug ("   Reading image remaining data from dataflash address "
+                       "%08lx to RAM address %08lx\n", img_addr + h_size,
+                       ram_addr + h_size);
+
+               read_dataflash (img_addr + h_size, d_size,
+                               (char *)(ram_addr + h_size));
+
+       }
+#endif /* CONFIG_HAS_DATAFLASH */
+
+       return ram_addr;
+}
+
+/**
+ * fit_has_config - check if there is a valid FIT configuration
+ * @images: pointer to the bootm command headers structure
+ *
+ * fit_has_config() checks if there is a FIT configuration in use
+ * (if FTI support is present).
+ *
+ * returns:
+ *     0, no FIT support or no configuration found
+ *     1, configuration found
+ */
+int genimg_has_config (bootm_headers_t *images)
+{
+#if defined(CONFIG_FIT)
+       if (images->fit_uname_cfg)
+               return 1;
+#endif
+       return 0;
+}
+
+/**
+ * boot_get_ramdisk - main ramdisk handling routine
+ * @argc: command argument count
+ * @argv: command argument list
+ * @images: pointer to the bootm images structure
+ * @arch: expected ramdisk architecture
+ * @rd_start: pointer to a ulong variable, will hold ramdisk start address
+ * @rd_end: pointer to a ulong variable, will hold ramdisk end
+ *
+ * boot_get_ramdisk() is responsible for finding a valid ramdisk image.
+ * Curently supported are the following ramdisk sources:
+ *      - multicomponent kernel/ramdisk image,
+ *      - commandline provided address of decicated ramdisk image.
+ *
+ * returns:
+ *     0, if ramdisk image was found and valid, or skiped
+ *     rd_start and rd_end are set to ramdisk start/end addresses if
+ *     ramdisk image is found and valid
+ *
+ *     1, if ramdisk image is found but corrupted
+ *     rd_start and rd_end are set to 0 if no ramdisk exists
+ */
+int boot_get_ramdisk (int argc, char *argv[], bootm_headers_t *images,
+               uint8_t arch, ulong *rd_start, ulong *rd_end)
+{
+       ulong rd_addr, rd_load;
+       ulong rd_data, rd_len;
+       image_header_t *rd_hdr;
+#if defined(CONFIG_FIT)
+       void            *fit_hdr;
+       const char      *fit_uname_config = NULL;
+       const char      *fit_uname_ramdisk = NULL;
+       ulong           default_addr;
+       int             rd_noffset;
+       int             cfg_noffset;
+       const void      *data;
+       size_t          size;
+#endif
+
+       *rd_start = 0;
+       *rd_end = 0;
+
+       /*
+        * Look for a '-' which indicates to ignore the
+        * ramdisk argument
+        */
+       if ((argc >= 3) && (strcmp(argv[2], "-") ==  0)) {
+               debug ("## Skipping init Ramdisk\n");
+               rd_len = rd_data = 0;
+       } else if (argc >= 3 || genimg_has_config (images)) {
+#if defined(CONFIG_FIT)
+               if (argc >= 3) {
+                       /*
+                        * If the init ramdisk comes from the FIT image and
+                        * the FIT image address is omitted in the command
+                        * line argument, try to use os FIT image address or
+                        * default load address.
+                        */
+                       if (images->fit_uname_os)
+                               default_addr = (ulong)images->fit_hdr_os;
+                       else
+                               default_addr = load_addr;
+
+                       if (fit_parse_conf (argv[2], default_addr,
+                                               &rd_addr, &fit_uname_config)) {
+                               debug ("*  ramdisk: config '%s' from image at 0x%08lx\n",
+                                               fit_uname_config, rd_addr);
+                       } else if (fit_parse_subimage (argv[2], default_addr,
+                                               &rd_addr, &fit_uname_ramdisk)) {
+                               debug ("*  ramdisk: subimage '%s' from image at 0x%08lx\n",
+                                               fit_uname_ramdisk, rd_addr);
+                       } else
+#endif
+                       {
+                               rd_addr = simple_strtoul(argv[2], NULL, 16);
+                               debug ("*  ramdisk: cmdline image address = 0x%08lx\n",
+                                               rd_addr);
+                       }
+#if defined(CONFIG_FIT)
+               } else {
+                       /* use FIT configuration provided in first bootm
+                        * command argument
+                        */
+                       rd_addr = (ulong)images->fit_hdr_os;
+                       fit_uname_config = images->fit_uname_cfg;
+                       debug ("*  ramdisk: using config '%s' from image at 0x%08lx\n",
+                                       fit_uname_config, rd_addr);
+
+                       /*
+                        * Check whether configuration has ramdisk defined,
+                        * if not, don't try to use it, quit silently.
+                        */
+                       fit_hdr = (void *)rd_addr;
+                       cfg_noffset = fit_conf_get_node (fit_hdr, fit_uname_config);
+                       if (cfg_noffset < 0) {
+                               debug ("*  ramdisk: no such config\n");
+                               return 0;
+                       }
+
+                       rd_noffset = fit_conf_get_ramdisk_node (fit_hdr, cfg_noffset);
+                       if (rd_noffset < 0) {
+                               debug ("*  ramdisk: no ramdisk in config\n");
+                               return 0;
+                       }
+               }
+#endif
+
+               /* copy from dataflash if needed */
+               rd_addr = genimg_get_image (rd_addr);
+
+               /*
+                * Check if there is an initrd image at the
+                * address provided in the second bootm argument
+                * check image type, for FIT images get FIT node.
+                */
+               switch (genimg_get_format ((void *)rd_addr)) {
+               case IMAGE_FORMAT_LEGACY:
+                       printf ("## Loading init Ramdisk from Legacy "
+                                       "Image at %08lx ...\n", rd_addr);
+
+                       show_boot_progress (9);
+                       rd_hdr = image_get_ramdisk (rd_addr, arch,
+                                                       images->verify);
+
+                       if (rd_hdr == NULL)
+                               return 1;
+
+                       rd_data = image_get_data (rd_hdr);
+                       rd_len = image_get_data_size (rd_hdr);
+                       rd_load = image_get_load (rd_hdr);
+                       break;
+#if defined(CONFIG_FIT)
+               case IMAGE_FORMAT_FIT:
+                       fit_hdr = (void *)rd_addr;
+                       printf ("## Loading init Ramdisk from FIT "
+                                       "Image at %08lx ...\n", rd_addr);
+
+                       show_boot_progress (120);
+                       if (!fit_check_format (fit_hdr)) {
+                               puts ("Bad FIT ramdisk image format!\n");
+                               show_boot_progress (-120);
+                               return 0;
+                       }
+                       show_boot_progress (121);
+
+                       if (!fit_uname_ramdisk) {
+                               /*
+                                * no ramdisk image node unit name, try to get config
+                                * node first. If config unit node name is NULL
+                                * fit_conf_get_node() will try to find default config node
+                                */
+                               show_boot_progress (122);
+                               cfg_noffset = fit_conf_get_node (fit_hdr, fit_uname_config);
+                               if (cfg_noffset < 0) {
+                                       puts ("Could not find configuration node\n");
+                                       show_boot_progress (-122);
+                                       return 0;
+                               }
+                               fit_uname_config = fdt_get_name (fit_hdr, cfg_noffset, NULL);
+                               printf ("   Using '%s' configuration\n", fit_uname_config);
+
+                               rd_noffset = fit_conf_get_ramdisk_node (fit_hdr, cfg_noffset);
+                               fit_uname_ramdisk = fit_get_name (fit_hdr, rd_noffset, NULL);
+                       } else {
+                               /* get ramdisk component image node offset */
+                               show_boot_progress (123);
+                               rd_noffset = fit_image_get_node (fit_hdr, fit_uname_ramdisk);
+                       }
+                       if (rd_noffset < 0) {
+                               puts ("Could not find subimage node\n");
+                               show_boot_progress (-124);
+                               return 0;
+                       }
+
+                       printf ("   Trying '%s' ramdisk subimage\n", fit_uname_ramdisk);
+
+                       show_boot_progress (125);
+                       if (!fit_check_ramdisk (fit_hdr, rd_noffset, arch, images->verify))
+                               return 0;
+
+                       /* get ramdisk image data address and length */
+                       if (fit_image_get_data (fit_hdr, rd_noffset, &data, &size)) {
+                               puts ("Could not find ramdisk subimage data!\n");
+                               show_boot_progress (-127);
+                               return 0;
+                       }
+                       show_boot_progress (128);
+
+                       rd_data = (ulong)data;
+                       rd_len = size;
+
+                       if (fit_image_get_load (fit_hdr, rd_noffset, &rd_load)) {
+                               puts ("Can't get ramdisk subimage load address!\n");
+                               show_boot_progress (-129);
+                               return 0;
+                       }
+                       show_boot_progress (129);
+
+                       images->fit_hdr_rd = fit_hdr;
+                       images->fit_uname_rd = fit_uname_ramdisk;
+                       images->fit_noffset_rd = rd_noffset;
+                       break;
+#endif
+               default:
+                       puts ("Wrong Ramdisk Image Format\n");
+                       rd_data = rd_len = rd_load = 0;
+               }
+
+#if defined(CONFIG_B2) || defined(CONFIG_EVB4510) || defined(CONFIG_ARMADILLO)
+               /*
+                * We need to copy the ramdisk to SRAM to let Linux boot
+                */
+               if (rd_data) {
+                       memmove ((void *)rd_load, (uchar *)rd_data, rd_len);
+                       rd_data = rd_load;
+               }
+#endif /* CONFIG_B2 || CONFIG_EVB4510 || CONFIG_ARMADILLO */
+
+       } else if (images->legacy_hdr_valid &&
+                       image_check_type (&images->legacy_hdr_os_copy, IH_TYPE_MULTI)) {
+               /*
+                * Now check if we have a legacy mult-component image,
+                * get second entry data start address and len.
+                */
+               show_boot_progress (13);
+               printf ("## Loading init Ramdisk from multi component "
+                               "Legacy Image at %08lx ...\n",
+                               (ulong)images->legacy_hdr_os);
+
+               image_multi_getimg (images->legacy_hdr_os, 1, &rd_data, &rd_len);
+       } else {
+               /*
+                * no initrd image
+                */
+               show_boot_progress (14);
+               rd_len = rd_data = 0;
+       }
+
+       if (!rd_data) {
+               debug ("## No init Ramdisk\n");
+       } else {
+               *rd_start = rd_data;
+               *rd_end = rd_data + rd_len;
+       }
+       debug ("   ramdisk start = 0x%08lx, ramdisk end = 0x%08lx\n",
+                       *rd_start, *rd_end);
+
+       return 0;
+}
+
+#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_SPARC)
+/**
+ * boot_ramdisk_high - relocate init ramdisk
+ * @lmb: pointer to lmb handle, will be used for memory mgmt
+ * @rd_data: ramdisk data start address
+ * @rd_len: ramdisk data length
+ * @initrd_start: pointer to a ulong variable, will hold final init ramdisk
+ *      start address (after possible relocation)
+ * @initrd_end: pointer to a ulong variable, will hold final init ramdisk
+ *      end address (after possible relocation)
+ *
+ * boot_ramdisk_high() takes a relocation hint from "initrd_high" environement
+ * variable and if requested ramdisk data is moved to a specified location.
+ *
+ * Initrd_start and initrd_end are set to final (after relocation) ramdisk
+ * start/end addresses if ramdisk image start and len were provided,
+ * otherwise set initrd_start and initrd_end set to zeros.
+ *
+ * returns:
+ *      0 - success
+ *     -1 - failure
+ */
+int boot_ramdisk_high (struct lmb *lmb, ulong rd_data, ulong rd_len,
+                 ulong *initrd_start, ulong *initrd_end)
+{
+       char    *s;
+       ulong   initrd_high;
+       int     initrd_copy_to_ram = 1;
+
+       if ((s = getenv ("initrd_high")) != NULL) {
+               /* a value of "no" or a similar string will act like 0,
+                * turning the "load high" feature off. This is intentional.
+                */
+               initrd_high = simple_strtoul (s, NULL, 16);
+               if (initrd_high == ~0)
+                       initrd_copy_to_ram = 0;
+       } else {
+               /* not set, no restrictions to load high */
+               initrd_high = ~0;
+       }
+
+       debug ("## initrd_high = 0x%08lx, copy_to_ram = %d\n",
+                       initrd_high, initrd_copy_to_ram);
+
+       if (rd_data) {
+               if (!initrd_copy_to_ram) {      /* zero-copy ramdisk support */
+                       debug ("   in-place initrd\n");
+                       *initrd_start = rd_data;
+                       *initrd_end = rd_data + rd_len;
+                       lmb_reserve(lmb, rd_data, rd_len);
+               } else {
+                       if (initrd_high)
+                               *initrd_start = lmb_alloc_base (lmb, rd_len, 0x1000, initrd_high);
+                       else
+                               *initrd_start = lmb_alloc (lmb, rd_len, 0x1000);
+
+                       if (*initrd_start == 0) {
+                               puts ("ramdisk - allocation error\n");
+                               goto error;
+                       }
+                       show_boot_progress (12);
+
+                       *initrd_end = *initrd_start + rd_len;
+                       printf ("   Loading Ramdisk to %08lx, end %08lx ... ",
+                                       *initrd_start, *initrd_end);
+
+                       memmove_wd ((void *)*initrd_start,
+                                       (void *)rd_data, rd_len, CHUNKSZ);
+
+                       puts ("OK\n");
+               }
+       } else {
+               *initrd_start = 0;
+               *initrd_end = 0;
+       }
+       debug ("   ramdisk load start = 0x%08lx, ramdisk load end = 0x%08lx\n",
+                       *initrd_start, *initrd_end);
+
+       return 0;
+
+error:
+       return -1;
+}
+
+/**
+ * boot_get_cmdline - allocate and initialize kernel cmdline
+ * @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
+ * variable is present its contents is copied to allocated kernel
+ * command line.
+ *
+ * returns:
+ *      0 - success
+ *     -1 - failure
+ */
+int boot_get_cmdline (struct lmb *lmb, ulong *cmd_start, ulong *cmd_end,
+                       ulong bootmap_base)
+{
+       char *cmdline;
+       char *s;
+
+       cmdline = (char *)lmb_alloc_base(lmb, CFG_BARGSIZE, 0xf,
+                                        CFG_BOOTMAPSZ + bootmap_base);
+
+       if (cmdline == NULL)
+               return -1;
+
+       if ((s = getenv("bootargs")) == NULL)
+               s = "";
+
+       strcpy(cmdline, s);
+
+       *cmd_start = (ulong) & cmdline[0];
+       *cmd_end = *cmd_start + strlen(cmdline);
+
+       debug ("## cmdline at 0x%08lx ... 0x%08lx\n", *cmd_start, *cmd_end);
+
+       return 0;
+}
+
+/**
+ * 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.
+ *
+ * returns:
+ *      0 - success
+ *     -1 - failure
+ */
+int boot_get_kbd (struct lmb *lmb, bd_t **kbd, ulong bootmap_base)
+{
+       *kbd = (bd_t *)lmb_alloc_base(lmb, sizeof(bd_t), 0xf,
+                                     CFG_BOOTMAPSZ + bootmap_base);
+       if (*kbd == NULL)
+               return -1;
+
+       **kbd = *(gd->bd);
+
+       debug ("## kernel board info at 0x%08lx\n", (ulong)*kbd);
+
+#if defined(DEBUG) && defined(CONFIG_CMD_BDI)
+       do_bdinfo(NULL, 0, 0, NULL);
+#endif
+
+       return 0;
+}
+#endif /* CONFIG_PPC || CONFIG_M68K */
+#endif /* !USE_HOSTCC */
+
+#if defined(CONFIG_FIT)
+/*****************************************************************************/
+/* New uImage format routines */
+/*****************************************************************************/
+#ifndef USE_HOSTCC
+static int fit_parse_spec (const char *spec, char sepc, ulong addr_curr,
+               ulong *addr, const char **name)
+{
+       const char *sep;
+
+       *addr = addr_curr;
+       *name = NULL;
+
+       sep = strchr (spec, sepc);
+       if (sep) {
+               if (sep - spec > 0)
+                       *addr = simple_strtoul (spec, NULL, 16);
+
+               *name = sep + 1;
+               return 1;
+       }
+
+       return 0;
+}
+
+/**
+ * fit_parse_conf - parse FIT configuration spec
+ * @spec: input string, containing configuration spec
+ * @add_curr: current image address (to be used as a possible default)
+ * @addr: pointer to a ulong variable, will hold FIT image address of a given
+ * configuration
+ * @conf_name double pointer to a char, will hold pointer to a configuration
+ * unit name
+ *
+ * fit_parse_conf() expects configuration spec in the for of [<addr>]#<conf>,
+ * where <addr> is a FIT image address that contains configuration
+ * with a <conf> unit name.
+ *
+ * Address part is optional, and if omitted default add_curr will
+ * be used instead.
+ *
+ * returns:
+ *     1 if spec is a valid configuration string,
+ *     addr and conf_name are set accordingly
+ *     0 otherwise
+ */
+inline int fit_parse_conf (const char *spec, ulong addr_curr,
+               ulong *addr, const char **conf_name)
+{
+       return fit_parse_spec (spec, '#', addr_curr, addr, conf_name);
+}
+
+/**
+ * fit_parse_subimage - parse FIT subimage spec
+ * @spec: input string, containing subimage spec
+ * @add_curr: current image address (to be used as a possible default)
+ * @addr: pointer to a ulong variable, will hold FIT image address of a given
+ * subimage
+ * @image_name: double pointer to a char, will hold pointer to a subimage name
+ *
+ * fit_parse_subimage() expects subimage spec in the for of
+ * [<addr>]:<subimage>, where <addr> is a FIT image address that contains
+ * subimage with a <subimg> unit name.
+ *
+ * Address part is optional, and if omitted default add_curr will
+ * be used instead.
+ *
+ * returns:
+ *     1 if spec is a valid subimage string,
+ *     addr and image_name are set accordingly
+ *     0 otherwise
+ */
+inline int fit_parse_subimage (const char *spec, ulong addr_curr,
+               ulong *addr, const char **image_name)
+{
+       return fit_parse_spec (spec, ':', addr_curr, addr, image_name);
+}
+#endif /* !USE_HOSTCC */
+
+static void fit_get_debug (const void *fit, int noffset,
+               char *prop_name, int err)
+{
+       debug ("Can't get '%s' property from FIT 0x%08lx, "
+               "node: offset %d, name %s (%s)\n",
+               prop_name, (ulong)fit, noffset,
+               fit_get_name (fit, noffset, NULL),
+               fdt_strerror (err));
+}
+
+/**
+ * fit_print_contents - prints out the contents of the FIT format image
+ * @fit: pointer to the FIT format image header
+ * @p: pointer to prefix string
+ *
+ * fit_print_contents() formats a multi line FIT image contents description.
+ * The routine prints out FIT image properties (root node level) follwed by
+ * the details of each component image.
+ *
+ * returns:
+ *     no returned results
+ */
+void fit_print_contents (const void *fit)
+{
+       char *desc;
+       char *uname;
+       int images_noffset;
+       int confs_noffset;
+       int noffset;
+       int ndepth;
+       int count = 0;
+       int ret;
+       const char *p;
+#if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE) || defined(USE_HOSTCC)
+       time_t timestamp;
+#endif
+
+#ifdef USE_HOSTCC
+       p = "";
+#else
+       p = "   ";
+#endif
+
+       /* Root node properties */
+       ret = fit_get_desc (fit, 0, &desc);
+       printf ("%sFIT description: ", p);
+       if (ret)
+               printf ("unavailable\n");
+       else
+               printf ("%s\n", desc);
+
+#if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE) || defined(USE_HOSTCC)
+       ret = fit_get_timestamp (fit, 0, &timestamp);
+       printf ("%sCreated:         ", p);
+       if (ret)
+               printf ("unavailable\n");
+       else
+               genimg_print_time (timestamp);
+#endif
+
+       /* Find images parent node offset */
+       images_noffset = fdt_path_offset (fit, FIT_IMAGES_PATH);
+       if (images_noffset < 0) {
+               printf ("Can't find images parent node '%s' (%s)\n",
+                       FIT_IMAGES_PATH, fdt_strerror (images_noffset));
+               return;
+       }
+
+       /* Process its subnodes, print out component images details */
+       for (ndepth = 0, count = 0, noffset = fdt_next_node (fit, images_noffset, &ndepth);
+            (noffset >= 0) && (ndepth > 0);
+            noffset = fdt_next_node (fit, noffset, &ndepth)) {
+               if (ndepth == 1) {
+                       /*
+                        * Direct child node of the images parent node,
+                        * i.e. component image node.
+                        */
+                       printf ("%s Image %u (%s)\n", p, count++,
+                                       fit_get_name(fit, noffset, NULL));
+
+                       fit_image_print (fit, noffset, p);
+               }
+       }
+
+       /* Find configurations parent node offset */
+       confs_noffset = fdt_path_offset (fit, FIT_CONFS_PATH);
+       if (confs_noffset < 0) {
+               debug ("Can't get configurations parent node '%s' (%s)\n",
+                       FIT_CONFS_PATH, fdt_strerror (confs_noffset));
+               return;
+       }
+
+       /* get default configuration unit name from default property */
+       uname = (char *)fdt_getprop (fit, noffset, FIT_DEFAULT_PROP, NULL);
+       if (uname)
+               printf ("%s Default Configuration: '%s'\n", p, uname);
+
+       /* Process its subnodes, print out configurations details */
+       for (ndepth = 0, count = 0, noffset = fdt_next_node (fit, confs_noffset, &ndepth);
+            (noffset >= 0) && (ndepth > 0);
+            noffset = fdt_next_node (fit, noffset, &ndepth)) {
+               if (ndepth == 1) {
+                       /*
+                        * Direct child node of the configurations parent node,
+                        * i.e. configuration node.
+                        */
+                       printf ("%s Configuration %u (%s)\n", p, count++,
+                                       fit_get_name(fit, noffset, NULL));
+
+                       fit_conf_print (fit, noffset, p);
+               }
+       }
+}
+
+/**
+ * fit_image_print - prints out the FIT component image details
+ * @fit: pointer to the FIT format image header
+ * @image_noffset: offset of the component image node
+ * @p: pointer to prefix string
+ *
+ * fit_image_print() lists all mandatory properies for the processed component
+ * image. If present, hash nodes are printed out as well.
+ *
+ * returns:
+ *     no returned results
+ */
+void fit_image_print (const void *fit, int image_noffset, const char *p)
+{
+       char *desc;
+       uint8_t type, arch, os, comp;
+       size_t size;
+       ulong load, entry;
+       const void *data;
+       int noffset;
+       int ndepth;
+       int ret;
+
+       /* Mandatory properties */
+       ret = fit_get_desc (fit, image_noffset, &desc);
+       printf ("%s  Description:  ", p);
+       if (ret)
+               printf ("unavailable\n");
+       else
+               printf ("%s\n", desc);
+
+       fit_image_get_type (fit, image_noffset, &type);
+       printf ("%s  Type:         %s\n", p, genimg_get_type_name (type));
+
+       fit_image_get_comp (fit, image_noffset, &comp);
+       printf ("%s  Compression:  %s\n", p, genimg_get_comp_name (comp));
+
+       ret = fit_image_get_data (fit, image_noffset, &data, &size);
+
+#ifndef USE_HOSTCC
+       printf ("%s  Data Start:   ", p);
+       if (ret)
+               printf ("unavailable\n");
+       else
+               printf ("0x%08lx\n", (ulong)data);
+#endif
+
+       printf ("%s  Data Size:    ", p);
+       if (ret)
+               printf ("unavailable\n");
+       else
+               genimg_print_size (size);
+
+       /* Remaining, type dependent properties */
+       if ((type == IH_TYPE_KERNEL) || (type == IH_TYPE_STANDALONE) ||
+           (type == IH_TYPE_RAMDISK) || (type == IH_TYPE_FIRMWARE) ||
+           (type == IH_TYPE_FLATDT)) {
+               fit_image_get_arch (fit, image_noffset, &arch);
+               printf ("%s  Architecture: %s\n", p, genimg_get_arch_name (arch));
+       }
+
+       if (type == IH_TYPE_KERNEL) {
+               fit_image_get_os (fit, image_noffset, &os);
+               printf ("%s  OS:           %s\n", p, genimg_get_os_name (os));
+       }
+
+       if ((type == IH_TYPE_KERNEL) || (type == IH_TYPE_STANDALONE)) {
+               ret = fit_image_get_load (fit, image_noffset, &load);
+               printf ("%s  Load Address: ", p);
+               if (ret)
+                       printf ("unavailable\n");
+               else
+                       printf ("0x%08lx\n", load);
+
+               fit_image_get_entry (fit, image_noffset, &entry);
+               printf ("%s  Entry Point:  ", p);
+               if (ret)
+                       printf ("unavailable\n");
+               else
+                       printf ("0x%08lx\n", entry);
+       }
+
+       /* Process all hash subnodes of the component image node */
+       for (ndepth = 0, noffset = fdt_next_node (fit, image_noffset, &ndepth);
+            (noffset >= 0) && (ndepth > 0);
+            noffset = fdt_next_node (fit, noffset, &ndepth)) {
+               if (ndepth == 1) {
+                       /* Direct child node of the component image node */
+                       fit_image_print_hash (fit, noffset, p);
+               }
+       }
+}
+
+/**
+ * fit_image_print_hash - prints out the hash node details
+ * @fit: pointer to the FIT format image header
+ * @noffset: offset of the hash node
+ * @p: pointer to prefix string
+ *
+ * fit_image_print_hash() lists properies for the processed hash node
+ *
+ * returns:
+ *     no returned results
+ */
+void fit_image_print_hash (const void *fit, int noffset, const char *p)
+{
+       char *algo;
+       uint8_t *value;
+       int value_len;
+       int i, ret;
+
+       /*
+        * Check subnode name, must be equal to "hash".
+        * Multiple hash nodes require unique unit node
+        * names, e.g. hash@1, hash@2, etc.
+        */
+       if (strncmp (fit_get_name(fit, noffset, NULL),
+                       FIT_HASH_NODENAME,
+                       strlen(FIT_HASH_NODENAME)) != 0)
+               return;
+
+       debug ("%s  Hash node:    '%s'\n", p,
+                       fit_get_name (fit, noffset, NULL));
+
+       printf ("%s  Hash algo:    ", p);
+       if (fit_image_hash_get_algo (fit, noffset, &algo)) {
+               printf ("invalid/unsupported\n");
+               return;
+       }
+       printf ("%s\n", algo);
+
+       ret = fit_image_hash_get_value (fit, noffset, &value,
+                                       &value_len);
+       printf ("%s  Hash value:   ", p);
+       if (ret) {
+               printf ("unavailable\n");
+       } else {
+               for (i = 0; i < value_len; i++)
+                       printf ("%02x", value[i]);
+               printf ("\n");
+       }
+
+       debug  ("%s  Hash len:     %d\n", p, value_len);
+}
+
+/**
+ * fit_get_desc - get node description property
+ * @fit: pointer to the FIT format image header
+ * @noffset: node offset
+ * @desc: double pointer to the char, will hold pointer to the descrption
+ *
+ * fit_get_desc() reads description property from a given node, if
+ * description is found pointer to it is returened in third call argument.
+ *
+ * returns:
+ *     0, on success
+ *     -1, on failure
+ */
+int fit_get_desc (const void *fit, int noffset, char **desc)
+{
+       int len;
+
+       *desc = (char *)fdt_getprop (fit, noffset, FIT_DESC_PROP, &len);
+       if (*desc == NULL) {
+               fit_get_debug (fit, noffset, FIT_DESC_PROP, len);
+               return -1;
+       }
+
+       return 0;
+}
+
+/**
+ * fit_get_timestamp - get node timestamp property
+ * @fit: pointer to the FIT format image header
+ * @noffset: node offset
+ * @timestamp: pointer to the time_t, will hold read timestamp
+ *
+ * fit_get_timestamp() reads timestamp poperty from given node, if timestamp
+ * is found and has a correct size its value is retured in third call
+ * argument.
+ *
+ * returns:
+ *     0, on success
+ *     -1, on property read failure
+ *     -2, on wrong timestamp size
+ */
+int fit_get_timestamp (const void *fit, int noffset, time_t *timestamp)
+{
+       int len;
+       const void *data;
+
+       data = fdt_getprop (fit, noffset, FIT_TIMESTAMP_PROP, &len);
+       if (data == NULL) {
+               fit_get_debug (fit, noffset, FIT_TIMESTAMP_PROP, len);
+               return -1;
+       }
+       if (len != sizeof (uint32_t)) {
+               debug ("FIT timestamp with incorrect size of (%u)\n", len);
+               return -2;
+       }
+
+       *timestamp = uimage_to_cpu (*((uint32_t *)data));
+       return 0;
+}
+
+/**
+ * fit_image_get_node - get node offset for component image of a given unit name
+ * @fit: pointer to the FIT format image header
+ * @image_uname: component image node unit name
+ *
+ * fit_image_get_node() finds a component image (withing the '/images'
+ * node) of a provided unit name. If image is found its node offset is
+ * returned to the caller.
+ *
+ * returns:
+ *     image node offset when found (>=0)
+ *     negative number on failure (FDT_ERR_* code)
+ */
+int fit_image_get_node (const void *fit, const char *image_uname)
+{
+       int noffset, images_noffset;
+
+       images_noffset = fdt_path_offset (fit, FIT_IMAGES_PATH);
+       if (images_noffset < 0) {
+               debug ("Can't find images parent node '%s' (%s)\n",
+                       FIT_IMAGES_PATH, fdt_strerror (images_noffset));
+               return images_noffset;
+       }
+
+       noffset = fdt_subnode_offset (fit, images_noffset, image_uname);
+       if (noffset < 0) {
+               debug ("Can't get node offset for image unit name: '%s' (%s)\n",
+                       image_uname, fdt_strerror (noffset));
+       }
+
+       return noffset;
+}
+
+/**
+ * fit_image_get_os - get os id for a given component image node
+ * @fit: pointer to the FIT format image header
+ * @noffset: component image node offset
+ * @os: pointer to the uint8_t, will hold os numeric id
+ *
+ * fit_image_get_os() finds os property in a given component image node.
+ * If the property is found, its (string) value is translated to the numeric
+ * id which is returned to the caller.
+ *
+ * returns:
+ *     0, on success
+ *     -1, on failure
+ */
+int fit_image_get_os (const void *fit, int noffset, uint8_t *os)
+{
+       int len;
+       const void *data;
+
+       /* Get OS name from property data */
+       data = fdt_getprop (fit, noffset, FIT_OS_PROP, &len);
+       if (data == NULL) {
+               fit_get_debug (fit, noffset, FIT_OS_PROP, len);
+               *os = -1;
+               return -1;
+       }
+
+       /* Translate OS name to id */
+       *os = genimg_get_os_id (data);
+       return 0;
+}
+
+/**
+ * fit_image_get_arch - get arch id for a given component image node
+ * @fit: pointer to the FIT format image header
+ * @noffset: component image node offset
+ * @arch: pointer to the uint8_t, will hold arch numeric id
+ *
+ * fit_image_get_arch() finds arch property in a given component image node.
+ * If the property is found, its (string) value is translated to the numeric
+ * id which is returned to the caller.
+ *
+ * returns:
+ *     0, on success
+ *     -1, on failure
+ */
+int fit_image_get_arch (const void *fit, int noffset, uint8_t *arch)
+{
+       int len;
+       const void *data;
+
+       /* Get architecture name from property data */
+       data = fdt_getprop (fit, noffset, FIT_ARCH_PROP, &len);
+       if (data == NULL) {
+               fit_get_debug (fit, noffset, FIT_ARCH_PROP, len);
+               *arch = -1;
+               return -1;
+       }
+
+       /* Translate architecture name to id */
+       *arch = genimg_get_arch_id (data);
+       return 0;
+}
+
+/**
+ * fit_image_get_type - get type id for a given component image node
+ * @fit: pointer to the FIT format image header
+ * @noffset: component image node offset
+ * @type: pointer to the uint8_t, will hold type numeric id
+ *
+ * fit_image_get_type() finds type property in a given component image node.
+ * If the property is found, its (string) value is translated to the numeric
+ * id which is returned to the caller.
+ *
+ * returns:
+ *     0, on success
+ *     -1, on failure
+ */
+int fit_image_get_type (const void *fit, int noffset, uint8_t *type)
+{
+       int len;
+       const void *data;
+
+       /* Get image type name from property data */
+       data = fdt_getprop (fit, noffset, FIT_TYPE_PROP, &len);
+       if (data == NULL) {
+               fit_get_debug (fit, noffset, FIT_TYPE_PROP, len);
+               *type = -1;
+               return -1;
+       }
+
+       /* Translate image type name to id */
+       *type = genimg_get_type_id (data);
+       return 0;
+}
+
+/**
+ * fit_image_get_comp - get comp id for a given component image node
+ * @fit: pointer to the FIT format image header
+ * @noffset: component image node offset
+ * @comp: pointer to the uint8_t, will hold comp numeric id
+ *
+ * fit_image_get_comp() finds comp property in a given component image node.
+ * If the property is found, its (string) value is translated to the numeric
+ * id which is returned to the caller.
+ *
+ * returns:
+ *     0, on success
+ *     -1, on failure
+ */
+int fit_image_get_comp (const void *fit, int noffset, uint8_t *comp)
+{
+       int len;
+       const void *data;
+
+       /* Get compression name from property data */
+       data = fdt_getprop (fit, noffset, FIT_COMP_PROP, &len);
+       if (data == NULL) {
+               fit_get_debug (fit, noffset, FIT_COMP_PROP, len);
+               *comp = -1;
+               return -1;
+       }
+
+       /* Translate compression name to id */
+       *comp = genimg_get_comp_id (data);
+       return 0;
+}
+
+/**
+ * fit_image_get_load - get load address property for a given component image node
+ * @fit: pointer to the FIT format image header
+ * @noffset: component image node offset
+ * @load: pointer to the uint32_t, will hold load address
+ *
+ * fit_image_get_load() finds load address property in a given component image node.
+ * If the property is found, its value is returned to the caller.
+ *
+ * returns:
+ *     0, on success
+ *     -1, on failure
+ */
+int fit_image_get_load (const void *fit, int noffset, ulong *load)
+{
+       int len;
+       const uint32_t *data;
+
+       data = fdt_getprop (fit, noffset, FIT_LOAD_PROP, &len);
+       if (data == NULL) {
+               fit_get_debug (fit, noffset, FIT_LOAD_PROP, len);
+               return -1;
+       }
+
+       *load = uimage_to_cpu (*data);
+       return 0;
+}
+
+/**
+ * fit_image_get_entry - get entry point address property for a given component image node
+ * @fit: pointer to the FIT format image header
+ * @noffset: component image node offset
+ * @entry: pointer to the uint32_t, will hold entry point address
+ *
+ * fit_image_get_entry() finds entry point address property in a given component image node.
+ * If the property is found, its value is returned to the caller.
+ *
+ * returns:
+ *     0, on success
+ *     -1, on failure
+ */
+int fit_image_get_entry (const void *fit, int noffset, ulong *entry)
+{
+       int len;
+       const uint32_t *data;
+
+       data = fdt_getprop (fit, noffset, FIT_ENTRY_PROP, &len);
+       if (data == NULL) {
+               fit_get_debug (fit, noffset, FIT_ENTRY_PROP, len);
+               return -1;
+       }
+
+       *entry = uimage_to_cpu (*data);
+       return 0;
+}
+
+/**
+ * fit_image_get_data - get data property and its size for a given component image node
+ * @fit: pointer to the FIT format image header
+ * @noffset: component image node offset
+ * @data: double pointer to void, will hold data property's data address
+ * @size: pointer to size_t, will hold data property's data size
+ *
+ * fit_image_get_data() finds data property in a given component image node.
+ * If the property is found its data start address and size are returned to
+ * the caller.
+ *
+ * returns:
+ *     0, on success
+ *     -1, on failure
+ */
+int fit_image_get_data (const void *fit, int noffset,
+               const void **data, size_t *size)
+{
+       int len;
+
+       *data = fdt_getprop (fit, noffset, FIT_DATA_PROP, &len);
+       if (*data == NULL) {
+               fit_get_debug (fit, noffset, FIT_DATA_PROP, len);
+               *size = 0;
+               return -1;
+       }
+
+       *size = len;
+       return 0;
+}
+
+/**
+ * fit_image_hash_get_algo - get hash algorithm name
+ * @fit: pointer to the FIT format image header
+ * @noffset: hash node offset
+ * @algo: double pointer to char, will hold pointer to the algorithm name
+ *
+ * fit_image_hash_get_algo() finds hash algorithm property in a given hash node.
+ * If the property is found its data start address is returned to the caller.
+ *
+ * returns:
+ *     0, on success
+ *     -1, on failure
+ */
+int fit_image_hash_get_algo (const void *fit, int noffset, char **algo)
+{
+       int len;
+
+       *algo = (char *)fdt_getprop (fit, noffset, FIT_ALGO_PROP, &len);
+       if (*algo == NULL) {
+               fit_get_debug (fit, noffset, FIT_ALGO_PROP, len);
+               return -1;
+       }
+
+       return 0;
+}
+
+/**
+ * fit_image_hash_get_value - get hash value and length
+ * @fit: pointer to the FIT format image header
+ * @noffset: hash node offset
+ * @value: double pointer to uint8_t, will hold address of a hash value data
+ * @value_len: pointer to an int, will hold hash data length
+ *
+ * fit_image_hash_get_value() finds hash value property in a given hash node.
+ * If the property is found its data start address and size are returned to
+ * the caller.
+ *
+ * returns:
+ *     0, on success
+ *     -1, on failure
+ */
+int fit_image_hash_get_value (const void *fit, int noffset, uint8_t **value,
+                               int *value_len)
+{
+       int len;
+
+       *value = (uint8_t *)fdt_getprop (fit, noffset, FIT_VALUE_PROP, &len);
+       if (*value == NULL) {
+               fit_get_debug (fit, noffset, FIT_VALUE_PROP, len);
+               *value_len = 0;
+               return -1;
+       }
+
+       *value_len = len;
+       return 0;
+}
+
+/**
+ * fit_set_timestamp - set node timestamp property
+ * @fit: pointer to the FIT format image header
+ * @noffset: node offset
+ * @timestamp: timestamp value to be set
+ *
+ * fit_set_timestamp() attempts to set timestamp property in the requested
+ * node and returns operation status to the caller.
+ *
+ * returns:
+ *     0, on success
+ *     -1, on property read failure
+ */
+int fit_set_timestamp (void *fit, int noffset, time_t timestamp)
+{
+       uint32_t t;
+       int ret;
+
+       t = cpu_to_uimage (timestamp);
+       ret = fdt_setprop (fit, noffset, FIT_TIMESTAMP_PROP, &t,
+                               sizeof (uint32_t));
+       if (ret) {
+               printf ("Can't set '%s' property for '%s' node (%s)\n",
+                       FIT_TIMESTAMP_PROP, fit_get_name (fit, noffset, NULL),
+                       fdt_strerror (ret));
+               return -1;
+       }
+
+       return 0;
+}
+
+/**
+ * calculate_hash - calculate and return hash for provided input data
+ * @data: pointer to the input data
+ * @data_len: data length
+ * @algo: requested hash algorithm
+ * @value: pointer to the char, will hold hash value data (caller must
+ * allocate enough free space)
+ * value_len: length of the calculated hash
+ *
+ * calculate_hash() computes input data hash according to the requested algorithm.
+ * Resulting hash value is placed in caller provided 'value' buffer, length
+ * of the calculated hash is returned via value_len pointer argument.
+ *
+ * returns:
+ *     0, on success
+ *    -1, when algo is unsupported
+ */
+static int calculate_hash (const void *data, int data_len, const char *algo,
+                       uint8_t *value, int *value_len)
+{
+       if (strcmp (algo, "crc32") == 0 ) {
+               *((uint32_t *)value) = crc32 (0, data, data_len);
+               *((uint32_t *)value) = cpu_to_uimage (*((uint32_t *)value));
+               *value_len = 4;
+       } else if (strcmp (algo, "sha1") == 0 ) {
+               sha1_csum ((unsigned char *) data, data_len,
+                               (unsigned char *) value);
+               *value_len = 20;
+       } else if (strcmp (algo, "md5") == 0 ) {
+               md5 ((unsigned char *)data, data_len, value);
+               *value_len = 16;
+       } else {
+               debug ("Unsupported hash alogrithm\n");
+               return -1;
+       }
+       return 0;
+}
+
+#ifdef USE_HOSTCC
+/**
+ * fit_set_hashes - process FIT component image nodes and calculate hashes
+ * @fit: pointer to the FIT format image header
+ *
+ * fit_set_hashes() adds hash values for all component images in the FIT blob.
+ * Hashes are calculated for all component images which have hash subnodes
+ * with algorithm property set to one of the supported hash algorithms.
+ *
+ * returns
+ *     0, on success
+ *     libfdt error code, on failure
+ */
+int fit_set_hashes (void *fit)
+{
+       int images_noffset;
+       int noffset;
+       int ndepth;
+       int ret;
+
+       /* Find images parent node offset */
+       images_noffset = fdt_path_offset (fit, FIT_IMAGES_PATH);
+       if (images_noffset < 0) {
+               printf ("Can't find images parent node '%s' (%s)\n",
+                       FIT_IMAGES_PATH, fdt_strerror (images_noffset));
+               return images_noffset;
+       }
+
+       /* Process its subnodes, print out component images details */
+       for (ndepth = 0, noffset = fdt_next_node (fit, images_noffset, &ndepth);
+            (noffset >= 0) && (ndepth > 0);
+            noffset = fdt_next_node (fit, noffset, &ndepth)) {
+               if (ndepth == 1) {
+                       /*
+                        * Direct child node of the images parent node,
+                        * i.e. component image node.
+                        */
+                       ret = fit_image_set_hashes (fit, noffset);
+                       if (ret)
+                               return ret;
+               }
+       }
+
+       return 0;
+}
+
+/**
+ * fit_image_set_hashes - calculate/set hashes for given component image node
+ * @fit: pointer to the FIT format image header
+ * @image_noffset: requested component image node
+ *
+ * fit_image_set_hashes() adds hash values for an component image node. All
+ * existing hash subnodes are checked, if algorithm property is set to one of
+ * the supported hash algorithms, hash value is computed and corresponding
+ * hash node property is set, for example:
+ *
+ * Input component image node structure:
+ *
+ * o image@1 (at image_noffset)
+ *   | - data = [binary data]
+ *   o hash@1
+ *     |- algo = "sha1"
+ *
+ * Output component image node structure:
+ *
+ * o image@1 (at image_noffset)
+ *   | - data = [binary data]
+ *   o hash@1
+ *     |- algo = "sha1"
+ *     |- value = sha1(data)
+ *
+ * returns:
+ *     0 on sucess
+ *    <0 on failure
+ */
+int fit_image_set_hashes (void *fit, int image_noffset)
+{
+       const void *data;
+       size_t size;
+       char *algo;
+       uint8_t value[FIT_MAX_HASH_LEN];
+       int value_len;
+       int noffset;
+       int ndepth;
+
+       /* Get image data and data length */
+       if (fit_image_get_data (fit, image_noffset, &data, &size)) {
+               printf ("Can't get image data/size\n");
+               return -1;
+       }
+
+       /* Process all hash subnodes of the component image node */
+       for (ndepth = 0, noffset = fdt_next_node (fit, image_noffset, &ndepth);
+            (noffset >= 0) && (ndepth > 0);
+            noffset = fdt_next_node (fit, noffset, &ndepth)) {
+               if (ndepth == 1) {
+                       /* Direct child node of the component image node */
+
+                       /*
+                        * Check subnode name, must be equal to "hash".
+                        * Multiple hash nodes require unique unit node
+                        * names, e.g. hash@1, hash@2, etc.
+                        */
+                       if (strncmp (fit_get_name(fit, noffset, NULL),
+                                               FIT_HASH_NODENAME,
+                                               strlen(FIT_HASH_NODENAME)) != 0) {
+                               /* Not a hash subnode, skip it */
+                               continue;
+                       }
+
+                       if (fit_image_hash_get_algo (fit, noffset, &algo)) {
+                               printf ("Can't get hash algo property for "
+                                       "'%s' hash node in '%s' image node\n",
+                                       fit_get_name (fit, noffset, NULL),
+                                       fit_get_name (fit, image_noffset, NULL));
+                               return -1;
+                       }
+
+                       if (calculate_hash (data, size, algo, value, &value_len)) {
+                               printf ("Unsupported hash algorithm (%s) for "
+                                       "'%s' hash node in '%s' image node\n",
+                                       algo, fit_get_name (fit, noffset, NULL),
+                                       fit_get_name (fit, image_noffset, NULL));
+                               return -1;
+                       }
+
+                       if (fit_image_hash_set_value (fit, noffset, value,
+                                                       value_len)) {
+                               printf ("Can't set hash value for "
+                                       "'%s' hash node in '%s' image node\n",
+                                       fit_get_name (fit, noffset, NULL),
+                                       fit_get_name (fit, image_noffset, NULL));
+                               return -1;
+                       }
+               }
+       }
+
+       return 0;
+}
+
+/**
+ * fit_image_hash_set_value - set hash value in requested has node
+ * @fit: pointer to the FIT format image header
+ * @noffset: hash node offset
+ * @value: hash value to be set
+ * @value_len: hash value length
+ *
+ * fit_image_hash_set_value() attempts to set hash value in a node at offset
+ * given and returns operation status to the caller.
+ *
+ * returns
+ *     0, on success
+ *     -1, on failure
+ */
+int fit_image_hash_set_value (void *fit, int noffset, uint8_t *value,
+                               int value_len)
+{
+       int ret;
+
+       ret = fdt_setprop (fit, noffset, FIT_VALUE_PROP, value, value_len);
+       if (ret) {
+               printf ("Can't set hash '%s' property for '%s' node (%s)\n",
+                       FIT_VALUE_PROP, fit_get_name (fit, noffset, NULL),
+                       fdt_strerror (ret));
+               return -1;
+       }
+
+       return 0;
+}
+#endif /* USE_HOSTCC */
+
+/**
+ * fit_image_check_hashes - verify data intergity
+ * @fit: pointer to the FIT format image header
+ * @image_noffset: component image node offset
+ *
+ * fit_image_check_hashes() goes over component image hash nodes,
+ * re-calculates each data hash and compares with the value stored in hash
+ * node.
+ *
+ * returns:
+ *     1, if all hashes are valid
+ *     0, otherwise (or on error)
+ */
+int fit_image_check_hashes (const void *fit, int image_noffset)
+{
+       const void      *data;
+       size_t          size;
+       char            *algo;
+       uint8_t         *fit_value;
+       int             fit_value_len;
+       uint8_t         value[FIT_MAX_HASH_LEN];
+       int             value_len;
+       int             noffset;
+       int             ndepth;
+       char            *err_msg = "";
+
+       /* Get image data and data length */
+       if (fit_image_get_data (fit, image_noffset, &data, &size)) {
+               printf ("Can't get image data/size\n");
+               return 0;
+       }
+
+       /* Process all hash subnodes of the component image node */
+       for (ndepth = 0, noffset = fdt_next_node (fit, image_noffset, &ndepth);
+            (noffset >= 0) && (ndepth > 0);
+            noffset = fdt_next_node (fit, noffset, &ndepth)) {
+               if (ndepth == 1) {
+                       /* Direct child node of the component image node */
+
+                       /*
+                        * Check subnode name, must be equal to "hash".
+                        * Multiple hash nodes require unique unit node
+                        * names, e.g. hash@1, hash@2, etc.
+                        */
+                       if (strncmp (fit_get_name(fit, noffset, NULL),
+                                       FIT_HASH_NODENAME,
+                                       strlen(FIT_HASH_NODENAME)) != 0)
+                               continue;
+
+                       if (fit_image_hash_get_algo (fit, noffset, &algo)) {
+                               err_msg = "Can't get hash algo property";
+                               goto error;
+                       }
+                       printf ("%s", algo);
+
+                       if (fit_image_hash_get_value (fit, noffset, &fit_value,
+                                                       &fit_value_len)) {
+                               err_msg = "Can't get hash value property";
+                               goto error;
+                       }
+
+                       if (calculate_hash (data, size, algo, value, &value_len)) {
+                               err_msg = "Unsupported hash algorithm";
+                               goto error;
+                       }
+
+                       if (value_len != fit_value_len) {
+                               err_msg = "Bad hash value len";
+                               goto error;
+                       } else if (memcmp (value, fit_value, value_len) != 0) {
+                               err_msg = "Bad hash value";
+                               goto error;
+                       }
+                       printf ("+ ");
+               }
+       }
+
+       return 1;
+
+error:
+       printf ("%s for '%s' hash node in '%s' image node\n",
+                       err_msg, fit_get_name (fit, noffset, NULL),
+                       fit_get_name (fit, image_noffset, NULL));
+       return 0;
+}
+
+/**
+ * fit_image_check_os - check whether image node is of a given os type
+ * @fit: pointer to the FIT format image header
+ * @noffset: component image node offset
+ * @os: requested image os
+ *
+ * fit_image_check_os() reads image os property and compares its numeric
+ * id with the requested os. Comparison result is returned to the caller.
+ *
+ * returns:
+ *     1 if image is of given os type
+ *     0 otherwise (or on error)
+ */
+int fit_image_check_os (const void *fit, int noffset, uint8_t os)
+{
+       uint8_t image_os;
+
+       if (fit_image_get_os (fit, noffset, &image_os))
+               return 0;
+       return (os == image_os);
+}
+
+/**
+ * fit_image_check_arch - check whether image node is of a given arch
+ * @fit: pointer to the FIT format image header
+ * @noffset: component image node offset
+ * @arch: requested imagearch
+ *
+ * fit_image_check_arch() reads image arch property and compares its numeric
+ * id with the requested arch. Comparison result is returned to the caller.
+ *
+ * returns:
+ *     1 if image is of given arch
+ *     0 otherwise (or on error)
+ */
+int fit_image_check_arch (const void *fit, int noffset, uint8_t arch)
+{
+       uint8_t image_arch;
+
+       if (fit_image_get_arch (fit, noffset, &image_arch))
+               return 0;
+       return (arch == image_arch);
+}
+
+/**
+ * fit_image_check_type - check whether image node is of a given type
+ * @fit: pointer to the FIT format image header
+ * @noffset: component image node offset
+ * @type: requested image type
+ *
+ * fit_image_check_type() reads image type property and compares its numeric
+ * id with the requested type. Comparison result is returned to the caller.
+ *
+ * returns:
+ *     1 if image is of given type
+ *     0 otherwise (or on error)
+ */
+int fit_image_check_type (const void *fit, int noffset, uint8_t type)
+{
+       uint8_t image_type;
+
+       if (fit_image_get_type (fit, noffset, &image_type))
+               return 0;
+       return (type == image_type);
+}
+
+/**
+ * fit_image_check_comp - check whether image node uses given compression
+ * @fit: pointer to the FIT format image header
+ * @noffset: component image node offset
+ * @comp: requested image compression type
+ *
+ * fit_image_check_comp() reads image compression property and compares its
+ * numeric id with the requested compression type. Comparison result is
+ * returned to the caller.
+ *
+ * returns:
+ *     1 if image uses requested compression
+ *     0 otherwise (or on error)
+ */
+int fit_image_check_comp (const void *fit, int noffset, uint8_t comp)
+{
+       uint8_t image_comp;
+
+       if (fit_image_get_comp (fit, noffset, &image_comp))
+               return 0;
+       return (comp == image_comp);
+}
+
+/**
+ * fit_check_format - sanity check FIT image format
+ * @fit: pointer to the FIT format image header
+ *
+ * fit_check_format() runs a basic sanity FIT image verification.
+ * Routine checks for mandatory properties, nodes, etc.
+ *
+ * returns:
+ *     1, on success
+ *     0, on failure
+ */
+int fit_check_format (const void *fit)
+{
+       /* mandatory / node 'description' property */
+       if (fdt_getprop (fit, 0, FIT_DESC_PROP, NULL) == NULL) {
+               debug ("Wrong FIT format: no description\n");
+               return 0;
+       }
+
+#if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE) || defined(USE_HOSTCC)
+       /* mandatory / node 'timestamp' property */
+       if (fdt_getprop (fit, 0, FIT_TIMESTAMP_PROP, NULL) == NULL) {
+               debug ("Wrong FIT format: no description\n");
+               return 0;
+       }
+#endif
+
+       /* mandatory subimages parent '/images' node */
+       if (fdt_path_offset (fit, FIT_IMAGES_PATH) < 0) {
+               debug ("Wrong FIT format: no images parent node\n");
+               return 0;
+       }
+
+       return 1;
+}
+
+/**
+ * fit_conf_get_node - get node offset for configuration of a given unit name
+ * @fit: pointer to the FIT format image header
+ * @conf_uname: configuration node unit name
+ *
+ * fit_conf_get_node() finds a configuration (withing the '/configurations'
+ * parant node) of a provided unit name. If configuration is found its node offset
+ * is returned to the caller.
+ *
+ * When NULL is provided in second argument fit_conf_get_node() will search
+ * for a default configuration node instead. Default configuration node unit name
+ * is retrived from FIT_DEFAULT_PROP property of the '/configurations' node.
+ *
+ * returns:
+ *     configuration node offset when found (>=0)
+ *     negative number on failure (FDT_ERR_* code)
+ */
+int fit_conf_get_node (const void *fit, const char *conf_uname)
+{
+       int noffset, confs_noffset;
+       int len;
+
+       confs_noffset = fdt_path_offset (fit, FIT_CONFS_PATH);
+       if (confs_noffset < 0) {
+               debug ("Can't find configurations parent node '%s' (%s)\n",
+                       FIT_CONFS_PATH, fdt_strerror (confs_noffset));
+               return confs_noffset;
+       }
+
+       if (conf_uname == NULL) {
+               /* get configuration unit name from the default property */
+               debug ("No configuration specified, trying default...\n");
+               conf_uname = (char *)fdt_getprop (fit, confs_noffset, FIT_DEFAULT_PROP, &len);
+               if (conf_uname == NULL) {
+                       fit_get_debug (fit, confs_noffset, FIT_DEFAULT_PROP, len);
+                       return len;
+               }
+               debug ("Found default configuration: '%s'\n", conf_uname);
+       }
+
+       noffset = fdt_subnode_offset (fit, confs_noffset, conf_uname);
+       if (noffset < 0) {
+               debug ("Can't get node offset for configuration unit name: '%s' (%s)\n",
+                       conf_uname, fdt_strerror (noffset));
+       }
+
+       return noffset;
+}
+
+static int __fit_conf_get_prop_node (const void *fit, int noffset,
+               const char *prop_name)
+{
+       char *uname;
+       int len;
+
+       /* get kernel image unit name from configuration kernel property */
+       uname = (char *)fdt_getprop (fit, noffset, prop_name, &len);
+       if (uname == NULL)
+               return len;
+
+       return fit_image_get_node (fit, uname);
+}
+
+/**
+ * fit_conf_get_kernel_node - get kernel image node offset that corresponds to
+ * a given configuration
+ * @fit: pointer to the FIT format image header
+ * @noffset: configuration node offset
+ *
+ * fit_conf_get_kernel_node() retrives kernel image node unit name from
+ * configuration FIT_KERNEL_PROP property and translates it to the node
+ * offset.
+ *
+ * returns:
+ *     image node offset when found (>=0)
+ *     negative number on failure (FDT_ERR_* code)
+ */
+int fit_conf_get_kernel_node (const void *fit, int noffset)
+{
+       return __fit_conf_get_prop_node (fit, noffset, FIT_KERNEL_PROP);
+}
+
+/**
+ * fit_conf_get_ramdisk_node - get ramdisk image node offset that corresponds to
+ * a given configuration
+ * @fit: pointer to the FIT format image header
+ * @noffset: configuration node offset
+ *
+ * fit_conf_get_ramdisk_node() retrives ramdisk image node unit name from
+ * configuration FIT_KERNEL_PROP property and translates it to the node
+ * offset.
+ *
+ * returns:
+ *     image node offset when found (>=0)
+ *     negative number on failure (FDT_ERR_* code)
+ */
+int fit_conf_get_ramdisk_node (const void *fit, int noffset)
+{
+       return __fit_conf_get_prop_node (fit, noffset, FIT_RAMDISK_PROP);
+}
+
+/**
+ * fit_conf_get_fdt_node - get fdt image node offset that corresponds to
+ * a given configuration
+ * @fit: pointer to the FIT format image header
+ * @noffset: configuration node offset
+ *
+ * fit_conf_get_fdt_node() retrives fdt image node unit name from
+ * configuration FIT_KERNEL_PROP property and translates it to the node
+ * offset.
+ *
+ * returns:
+ *     image node offset when found (>=0)
+ *     negative number on failure (FDT_ERR_* code)
+ */
+int fit_conf_get_fdt_node (const void *fit, int noffset)
+{
+       return __fit_conf_get_prop_node (fit, noffset, FIT_FDT_PROP);
+}
+
+/**
+ * fit_conf_print - prints out the FIT configuration details
+ * @fit: pointer to the FIT format image header
+ * @noffset: offset of the configuration node
+ * @p: pointer to prefix string
+ *
+ * fit_conf_print() lists all mandatory properies for the processed
+ * configuration node.
+ *
+ * returns:
+ *     no returned results
+ */
+void fit_conf_print (const void *fit, int noffset, const char *p)
+{
+       char *desc;
+       char *uname;
+       int ret;
+
+       /* Mandatory properties */
+       ret = fit_get_desc (fit, noffset, &desc);
+       printf ("%s  Description:  ", p);
+       if (ret)
+               printf ("unavailable\n");
+       else
+               printf ("%s\n", desc);
+
+       uname = (char *)fdt_getprop (fit, noffset, FIT_KERNEL_PROP, NULL);
+       printf ("%s  Kernel:       ", p);
+       if (uname == NULL)
+               printf ("unavailable\n");
+       else
+               printf ("%s\n", uname);
+
+       /* Optional properties */
+       uname = (char *)fdt_getprop (fit, noffset, FIT_RAMDISK_PROP, NULL);
+       if (uname)
+               printf ("%s  Init Ramdisk: %s\n", p, uname);
+
+       uname = (char *)fdt_getprop (fit, noffset, FIT_FDT_PROP, NULL);
+       if (uname)
+               printf ("%s  FDT:          %s\n", p, uname);
+}
+
+/**
+ * fit_check_ramdisk - verify FIT format ramdisk subimage
+ * @fit_hdr: pointer to the FIT ramdisk header
+ * @rd_noffset: ramdisk subimage node offset within FIT image
+ * @arch: requested ramdisk image architecture type
+ * @verify: data CRC verification flag
+ *
+ * fit_check_ramdisk() verifies integrity of the ramdisk subimage and from
+ * specified FIT image.
+ *
+ * returns:
+ *     1, on success
+ *     0, on failure
+ */
+#ifndef USE_HOSTCC
+static int fit_check_ramdisk (const void *fit, int rd_noffset, uint8_t arch, int verify)
+{
+       fit_image_print (fit, rd_noffset, "   ");
+
+       if (verify) {
+               puts ("   Verifying Hash Integrity ... ");
+               if (!fit_image_check_hashes (fit, rd_noffset)) {
+                       puts ("Bad Data Hash\n");
+                       show_boot_progress (-125);
+                       return 0;
+               }
+               puts ("OK\n");
+       }
+
+       show_boot_progress (126);
+       if (!fit_image_check_os (fit, rd_noffset, IH_OS_LINUX) ||
+           !fit_image_check_arch (fit, rd_noffset, arch) ||
+           !fit_image_check_type (fit, rd_noffset, IH_TYPE_RAMDISK)) {
+               printf ("No Linux %s Ramdisk Image\n",
+                               genimg_get_arch_name(arch));
+               show_boot_progress (-126);
+               return 0;
+       }
+
+       show_boot_progress (127);
+       return 1;
+}
+#endif /* USE_HOSTCC */
+#endif /* CONFIG_FIT */
index 76a271b..a5dc887 100644 (file)
 DECLARE_GLOBAL_DATA_PTR;
 
 #if defined(CONFIG_MPC8260) || defined(CONFIG_440EP) || defined(CONFIG_440GR)
-void lynxkdi_boot ( image_header_t *hdr )
+void lynxkdi_boot (image_header_t *hdr)
 {
-       void (*lynxkdi)(void) = (void(*)(void)) ntohl(hdr->ih_ep);
+       void (*lynxkdi)(void) = (void(*)(void))image_get_ep (hdr);
        lynxos_bootparms_t *parms = (lynxos_bootparms_t *)0x0020;
        bd_t *kbd;
-       u32 *psz = (u32 *)(ntohl(hdr->ih_load) + 0x0204);
+       u32 *psz = (u32 *)(image_get_load (hdr) + 0x0204);
 
-       memsetparms, 0, sizeof(*parms));
+       memset (parms, 0, sizeof(*parms));
        kbd = gd->bd;
        parms->clock_ref = kbd->bi_busfreq;
        parms->dramsz = kbd->bi_memsize;
-       memcpy(parms->ethaddr, kbd->bi_enetaddr, 6);
-       mtspr(SPRN_SPRG2, 0x0020);
+       memcpy (parms->ethaddr, kbd->bi_enetaddr, 6);
+       mtspr (SPRN_SPRG2, 0x0020);
 
        /* Do a simple check for Bluecat so we can pass the
         * kernel command line parameters.
         */
-       if( le32_to_cpu(*psz) == ntohl(hdr->ih_size) ){ /* FIXME: NOT SURE HERE ! */
-           char *args;
-           char *cmdline = (char *)(ntohl(hdr->ih_load) + 0x020c);
-           int len;
+       if (le32_to_cpu (*psz) == image_get_data_size (hdr)) {  /* FIXME: NOT SURE HERE ! */
+               char *args;
+               char *cmdline = (char *)(image_get_load (hdr) + 0x020c);
+               int len;
 
-           printf("Booting Bluecat KDI ...\n");
-           udelay(200*1000); /* Allow serial port to flush */
-           if ((args = getenv("bootargs")) == NULL)
-                   args = "";
-           /* Prepend the cmdline */
-           len = strlen(args);
-           if( len && (len + strlen(cmdline) + 2 < (0x0400 - 0x020c))) {
-               memmove( cmdline + strlen(args) + 1, cmdline, strlen(cmdline) );
-               strcpy( cmdline, args );
-               cmdline[len] = ' ';
-           }
+               printf ("Booting Bluecat KDI ...\n");
+               udelay (200*1000); /* Allow serial port to flush */
+               if ((args = getenv ("bootargs")) == NULL)
+                       args = "";
+               /* Prepend the cmdline */
+               len = strlen (args);
+               if (len && (len + strlen (cmdline) + 2 < (0x0400 - 0x020c))) {
+                       memmove (cmdline + strlen (args) + 1, cmdline, strlen (cmdline));
+                       strcpy (cmdline, args);
+                       cmdline[len] = ' ';
+               }
        }
        else {
-           printf("Booting LynxOS KDI ...\n");
+               printf ("Booting LynxOS KDI ...\n");
        }
 
-       lynxkdi();
+       lynxkdi ();
 }
 #else
 #error "Lynx KDI support not implemented for configured CPU"
diff --git a/common/stratixII.c b/common/stratixII.c
new file mode 100644 (file)
index 0000000..85c461c
--- /dev/null
@@ -0,0 +1,235 @@
+/*
+ * (C) Copyright 2007
+ * Eran Liberty, Extricom , eran.liberty@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
+ *
+ */
+
+#include <common.h>            /* core U-Boot definitions */
+#include <altera.h>
+
+#if defined(CONFIG_FPGA) && defined(CONFIG_FPGA_ALTERA) && defined(CONFIG_FPGA_STRATIX_II)
+
+int StratixII_ps_fpp_load (Altera_desc * desc, void *buf, size_t bsize,
+                          int isSerial, int isSecure);
+int StratixII_ps_fpp_dump (Altera_desc * desc, void *buf, size_t bsize);
+
+/****************************************************************/
+/* Stratix II Generic Implementation                            */
+int StratixII_load (Altera_desc * desc, void *buf, size_t bsize)
+{
+       int ret_val = FPGA_FAIL;
+
+       switch (desc->iface) {
+       case passive_serial:
+               ret_val = StratixII_ps_fpp_load (desc, buf, bsize, 1, 0);
+               break;
+       case fast_passive_parallel:
+               ret_val = StratixII_ps_fpp_load (desc, buf, bsize, 0, 0);
+               break;
+       case fast_passive_parallel_security:
+               ret_val = StratixII_ps_fpp_load (desc, buf, bsize, 0, 1);
+               break;
+
+               /* Add new interface types here */
+       default:
+               printf ("%s: Unsupported interface type, %d\n", __FUNCTION__,
+                       desc->iface);
+       }
+       return ret_val;
+}
+
+int StratixII_dump (Altera_desc * desc, void *buf, size_t bsize)
+{
+       int ret_val = FPGA_FAIL;
+
+       switch (desc->iface) {
+       case passive_serial:
+       case fast_passive_parallel:
+       case fast_passive_parallel_security:
+               ret_val = StratixII_ps_fpp_dump (desc, buf, bsize);
+               break;
+               /* Add new interface types here */
+       default:
+               printf ("%s: Unsupported interface type, %d\n", __FUNCTION__,
+                       desc->iface);
+       }
+       return ret_val;
+}
+
+int StratixII_info (Altera_desc * desc)
+{
+       return FPGA_SUCCESS;
+}
+
+int StratixII_reloc (Altera_desc * desc, ulong reloc_offset)
+{
+       int i;
+       uint32_t dest = (uint32_t) desc & 0xff000000;
+
+       /* we assume a relocated code and non relocated code has different upper 8 bits */
+       if (dest != ((uint32_t) desc->iface_fns & 0xff000000)) {
+               desc->iface_fns =
+                   (void *)((uint32_t) (desc->iface_fns) + reloc_offset);
+       }
+       for (i = 0; i < sizeof (altera_board_specific_func) / sizeof (void *);
+            i++) {
+               if (dest !=
+                   ((uint32_t) (((void **)(desc->iface_fns))[i]) & 0xff000000))
+               {
+                       ((void **)(desc->iface_fns))[i] =
+                           (void
+                            *)(((uint32_t) (((void **)(desc->iface_fns))[i])) +
+                               reloc_offset);
+               }
+       }
+       return FPGA_SUCCESS;
+}
+
+int StratixII_ps_fpp_dump (Altera_desc * desc, void *buf, size_t bsize)
+{
+       printf ("Stratix II Fast Passive Parallel dump is not implemented\n");
+       return FPGA_FAIL;
+}
+
+int StratixII_ps_fpp_load (Altera_desc * desc, void *buf, size_t bsize,
+                          int isSerial, int isSecure)
+{
+       altera_board_specific_func *fns;
+       int cookie;
+       int ret_val = FPGA_FAIL;
+       int bytecount;
+       char *buff = buf;
+       int i;
+
+       if (!desc) {
+               printf ("%s(%d) Altera_desc missing\n", __FUNCTION__, __LINE__);
+               return FPGA_FAIL;
+       }
+       if (!buff) {
+               printf ("%s(%d) buffer is missing\n", __FUNCTION__, __LINE__);
+               return FPGA_FAIL;
+       }
+       if (!bsize) {
+               printf ("%s(%d) size is zero\n", __FUNCTION__, __LINE__);
+               return FPGA_FAIL;
+       }
+       if (!desc->iface_fns) {
+               printf
+                   ("%s(%d) Altera_desc function interface table is missing\n",
+                    __FUNCTION__, __LINE__);
+               return FPGA_FAIL;
+       }
+       fns = (altera_board_specific_func *) (desc->iface_fns);
+       cookie = desc->cookie;
+
+       if (!
+           (fns->config && fns->status && fns->done && fns->data
+            && fns->abort)) {
+               printf
+                   ("%s(%d) Missing some function in the function interface table\n",
+                    __FUNCTION__, __LINE__);
+               return FPGA_FAIL;
+       }
+
+       /* 1. give board specific a chance to do anything before we start */
+       if (fns->pre) {
+               if ((ret_val = fns->pre (cookie)) < 0) {
+                       return ret_val;
+               }
+       }
+
+       /* from this point on we must fail gracfully by calling lower layer abort */
+
+       /* 2. Strat burn cycle by deasserting config for t_CFG and waiting t_CF2CK after reaserted */
+       fns->config (0, 1, cookie);
+       udelay (5);             /* nCONFIG low pulse width 2usec */
+       fns->config (1, 1, cookie);
+       udelay (100);           /* nCONFIG high to first rising edge on DCLK */
+
+       /* 3. Start the Data cycle with clk deasserted */
+       bytecount = 0;
+       fns->clk (0, 1, cookie);
+
+       printf ("loading to fpga    ");
+       while (bytecount < bsize) {
+               /* 3.1 check stratix has not signaled us an error */
+               if (fns->status (cookie) != 1) {
+                       printf
+                           ("\n%s(%d) Stratix failed (byte transfered till failure 0x%x)\n",
+                            __FUNCTION__, __LINE__, bytecount);
+                       fns->abort (cookie);
+                       return FPGA_FAIL;
+               }
+               if (isSerial) {
+                       int i;
+                       uint8_t data = buff[bytecount++];
+                       for (i = 0; i < 8; i++) {
+                               /* 3.2(ps) put data on the bus */
+                               fns->data ((data >> i) & 1, 1, cookie);
+
+                               /* 3.3(ps) clock once */
+                               fns->clk (1, 1, cookie);
+                               fns->clk (0, 1, cookie);
+                       }
+               } else {
+                       /* 3.2(fpp) put data on the bus */
+                       fns->data (buff[bytecount++], 1, cookie);
+
+                       /* 3.3(fpp) clock once */
+                       fns->clk (1, 1, cookie);
+                       fns->clk (0, 1, cookie);
+
+                       /* 3.4(fpp) for secure cycle push 3 more  clocks */
+                       for (i = 0; isSecure && i < 3; i++) {
+                               fns->clk (1, 1, cookie);
+                               fns->clk (0, 1, cookie);
+                       }
+               }
+
+               /* 3.5 while clk is deasserted it is safe to print some progress indication */
+               if ((bytecount % (bsize / 100)) == 0) {
+                       printf ("\b\b\b%02d\%", bytecount * 100 / bsize);
+               }
+       }
+
+       /* 4. Set one last clock and check conf done signal */
+       fns->clk (1, 1, cookie);
+       udelay (100);
+       if (!fns->done (cookie)) {
+               printf (" error!.\n");
+               fns->abort (cookie);
+               return FPGA_FAIL;
+       } else {
+               printf ("\b\b\b done.\n");
+       }
+
+       /* 5. call lower layer post configuration */
+       if (fns->post) {
+               if ((ret_val = fns->post (cookie)) < 0) {
+                       fns->abort (cookie);
+                       return ret_val;
+               }
+       }
+
+       return FPGA_SUCCESS;
+}
+
+#endif                         /* defined(CONFIG_FPGA) && defined(CONFIG_FPGA_ALTERA) && defined(CONFIG_FPGA_STRATIX_II) */
index 443d785..7c08f95 100644 (file)
@@ -188,17 +188,20 @@ void usb_show_progress(void)
  * show info on storage devices; 'usb start/init' must be invoked earlier
  * as we only retrieve structures populated during devices initialization
  */
-void usb_stor_info(void)
+int usb_stor_info(void)
 {
        int i;
 
-       if (usb_max_devs > 0)
+       if (usb_max_devs > 0) {
                for (i = 0; i < usb_max_devs; i++) {
                        printf ("  Device %d: ", i);
                        dev_print(&usb_dev_desc[i]);
                }
-       else
-               printf("No storage devices, perhaps not 'usb start'ed..?\n");
+               return 0;
+       }
+
+       printf("No storage devices, perhaps not 'usb start'ed..?\n");
+       return 1;
 }
 
 /*********************************************************************************
index d5ac7d3..7701b03 100644 (file)
@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
 LIB    = $(obj)lib$(CPU).a
 
 START  = start.o
-COBJS  = interrupts.o cpu.o
+COBJS  = cpu.o
 
 SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
index fa78eaa..c27f8cd 100644 (file)
@@ -33,9 +33,6 @@
 
 #include <common.h>
 #include <command.h>
-#if !defined(CONFIG_INTEGRATOR) && ! defined(CONFIG_ARCH_CINTEGRATOR)
-#include <asm/arch/omap2420.h>
-#endif
 
 #ifdef CONFIG_USE_IRQ
 DECLARE_GLOBAL_DATA_PTR;
@@ -47,10 +44,10 @@ static unsigned long read_p15_c1 (void)
        unsigned long value;
 
        __asm__ __volatile__(
-                                               "mrc    p15, 0, %0, c1, c0, 0   @ read control reg\n"
-                                               : "=r" (value)
-                                               :
-                                               : "memory");
+                               "mrc    p15, 0, %0, c1, c0, 0   @ read control reg\n"
+                               : "=r" (value)
+                               :
+                               : "memory");
        return value;
 }
 
diff --git a/cpu/arm1136/mx31/Makefile b/cpu/arm1136/mx31/Makefile
new file mode 100644 (file)
index 0000000..b648ffd
--- /dev/null
@@ -0,0 +1,45 @@
+#
+# (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$(SOC).a
+
+COBJS  = interrupts.o serial.o generic.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+
+all:   $(obj).depend $(LIB)
+
+$(LIB):        $(OBJS)
+       $(AR) $(ARFLAGS) $@ $(OBJS)
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/cpu/arm1136/mx31/generic.c b/cpu/arm1136/mx31/generic.c
new file mode 100644 (file)
index 0000000..16b2cf1
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+ * (C) Copyright 2007
+ * Sascha Hauer, Pengutronix
+ *
+ * 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/mx31-regs.h>
+
+static u32 mx31_decode_pll(u32 reg, u32 infreq)
+{
+       u32 mfi = (reg >> 10) & 0xf;
+       u32 mfn = reg & 0x3f;
+       u32 mfd = (reg >> 16) & 0x3f;
+       u32 pd =  (reg >> 26) & 0xf;
+
+       mfi = mfi <= 5 ? 5 : mfi;
+       mfd += 1;
+       pd += 1;
+
+       return ((2 * (infreq >> 10) * (mfi * mfd + mfn)) /
+               (mfd * pd)) << 10;
+}
+
+u32 mx31_get_mpl_dpdgck_clk(void)
+{
+       u32 infreq;
+
+       if ((__REG(CCM_CCMR) & CCMR_PRCS_MASK) == CCMR_FPM)
+               infreq = CONFIG_MX31_CLK32 * 1024;
+       else
+               infreq = CONFIG_MX31_HCLK_FREQ;
+
+       return mx31_decode_pll(__REG(CCM_MPCTL), infreq);
+}
+
+u32 mx31_get_mcu_main_clk(void)
+{
+       /* For now we assume mpl_dpdgck_clk == mcu_main_clk
+        * which should be correct for most boards
+        */
+       return mx31_get_mpl_dpdgck_clk();
+}
+
+u32 mx31_get_ipg_clk(void)
+{
+       u32 freq = mx31_get_mcu_main_clk();
+       u32 pdr0 = __REG(CCM_PDR0);
+
+       freq /= ((pdr0 >> 3) & 0x7) + 1;
+       freq /= ((pdr0 >> 6) & 0x3) + 1;
+
+       return freq;
+}
+
+void mx31_dump_clocks(void)
+{
+       u32 cpufreq = mx31_get_mcu_main_clk();
+       printf("mx31 cpu clock: %dMHz\n",cpufreq / 1000000);
+       printf("ipg clock     : %dHz\n", mx31_get_ipg_clk());
+}
+
+void mx31_gpio_mux(unsigned long mode)
+{
+       unsigned long reg, shift, tmp;
+
+       reg = IOMUXC_BASE + (mode & 0xfc);
+       shift = (~mode & 0x3) * 8;
+
+       tmp = __REG(reg);
+       tmp &= ~(0xff << shift);
+       tmp |= ((mode >> 8) & 0xff) << shift;
+       __REG(reg) = tmp;
+}
+
+#if defined(CONFIG_DISPLAY_CPUINFO)
+int print_cpuinfo (void)
+{
+       printf("CPU:   Freescale i.MX31 at %d MHz\n",
+               mx31_get_mcu_main_clk() / 1000000);
+       return 0;
+}
+#endif
diff --git a/cpu/arm1136/mx31/interrupts.c b/cpu/arm1136/mx31/interrupts.c
new file mode 100644 (file)
index 0000000..21b77a5
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * (C) Copyright 2007
+ * Sascha Hauer, Pengutronix
+ *
+ * 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/mx31-regs.h>
+
+#define TIMER_BASE 0x53f90000 /* General purpose timer 1 */
+
+/* General purpose timers registers */
+#define GPTCR   __REG(TIMER_BASE) /* Control register */
+#define GPTPR  __REG(TIMER_BASE + 0x4) /* Prescaler register */
+#define GPTSR   __REG(TIMER_BASE + 0x8) /* Status register */
+#define GPTCNT __REG(TIMER_BASE + 0x24) /* Counter register */
+
+/* General purpose timers bitfields */
+#define GPTCR_SWR       (1<<15) /* Software reset */
+#define GPTCR_FRR       (1<<9)  /* Freerun / restart */
+#define GPTCR_CLKSOURCE_32 (4<<6)  /* Clock source */
+#define GPTCR_TEN       (1)     /* Timer enable */
+
+/* nothing really to do with interrupts, just starts up a counter. */
+int interrupt_init (void)
+{
+       int i;
+
+       /* setup GP Timer 1 */
+       GPTCR = GPTCR_SWR;
+       for ( i=0; i<100; i++) GPTCR = 0; /* We have no udelay by now */
+       GPTPR = 0; /* 32Khz */
+       GPTCR |= GPTCR_CLKSOURCE_32 | GPTCR_TEN; /* Freerun Mode, PERCLK1 input */
+
+       return 0;
+}
+
+void reset_timer_masked (void)
+{
+       GPTCR = 0;
+       GPTCR = GPTCR_CLKSOURCE_32 | GPTCR_TEN; /* Freerun Mode, PERCLK1 input */
+}
+
+ulong get_timer_masked (void)
+{
+       ulong val = GPTCNT;
+       return val;
+}
+
+ulong get_timer (ulong base)
+{
+       return get_timer_masked () - base;
+}
+
+void set_timer (ulong t)
+{
+}
+
+/* delay x useconds AND perserve advance timstamp value */
+void udelay (unsigned long usec)
+{
+       ulong tmo, tmp;
+
+       if (usec >= 1000) {                     /* if "big" number, spread normalization to seconds */
+               tmo = usec / 1000;              /* start to normalize for usec to ticks per sec */
+               tmo *= CFG_HZ;                  /* find number of "ticks" to wait to achieve target */
+               tmo /= 1000;                    /* finish normalize. */
+       } else {                                        /* else small number, don't kill it prior to HZ multiply */
+               tmo = usec * CFG_HZ;
+               tmo /= (1000*1000);
+       }
+
+       tmp = get_timer (0);            /* get current timestamp */
+       if ( (tmo + tmp + 1) < tmp )/* if setting this forward will roll time stamp */
+               reset_timer_masked ();  /* reset "advancing" timestamp to 0, set lastinc value */
+       else
+               tmo     += tmp;                         /* else, set advancing stamp wake up time */
+       while (get_timer_masked () < tmo)/* loop till event */
+               /*NOP*/;
+}
+
+void reset_cpu (ulong addr)
+{
+       __REG16(WDOG_BASE) = 4;
+}
diff --git a/cpu/arm1136/mx31/serial.c b/cpu/arm1136/mx31/serial.c
new file mode 100644 (file)
index 0000000..a829ba7
--- /dev/null
@@ -0,0 +1,231 @@
+/*
+ * (c) 2007 Sascha Hauer <s.hauer@pengutronix.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.
+ *
+ * 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>
+
+#if defined CONFIG_MX31_UART
+
+#include <asm/arch/mx31.h>
+
+#define __REG(x)     (*((volatile u32 *)(x)))
+
+#ifdef CFG_MX31_UART1
+#define UART_PHYS 0x43f90000
+#elif defined(CFG_MX31_UART2)
+#define UART_PHYS 0x43f94000
+#elif defined(CFG_MX31_UART3)
+#define UART_PHYS 0x5000c000
+#elif defined(CFG_MX31_UART4)
+#define UART_PHYS 0x43fb0000
+#elif defined(CFG_MX31_UART5)
+#define UART_PHYS 0x43fb4000
+#else
+#error "define CFG_MX31_UARTx to use the mx31 UART driver"
+#endif
+
+/* Register definitions */
+#define URXD  0x0  /* Receiver Register */
+#define UTXD  0x40 /* Transmitter Register */
+#define UCR1  0x80 /* Control Register 1 */
+#define UCR2  0x84 /* Control Register 2 */
+#define UCR3  0x88 /* Control Register 3 */
+#define UCR4  0x8c /* Control Register 4 */
+#define UFCR  0x90 /* FIFO Control Register */
+#define USR1  0x94 /* Status Register 1 */
+#define USR2  0x98 /* Status Register 2 */
+#define UESC  0x9c /* Escape Character Register */
+#define UTIM  0xa0 /* Escape Timer Register */
+#define UBIR  0xa4 /* BRM Incremental Register */
+#define UBMR  0xa8 /* BRM Modulator Register */
+#define UBRC  0xac /* Baud Rate Count Register */
+#define UTS   0xb4 /* UART Test Register (mx31) */
+
+/* UART Control Register Bit Fields.*/
+#define  URXD_CHARRDY    (1<<15)
+#define  URXD_ERR        (1<<14)
+#define  URXD_OVRRUN     (1<<13)
+#define  URXD_FRMERR     (1<<12)
+#define  URXD_BRK        (1<<11)
+#define  URXD_PRERR      (1<<10)
+#define  UCR1_ADEN       (1<<15) /* Auto dectect interrupt */
+#define  UCR1_ADBR       (1<<14) /* Auto detect baud rate */
+#define  UCR1_TRDYEN     (1<<13) /* Transmitter ready interrupt enable */
+#define  UCR1_IDEN       (1<<12) /* Idle condition interrupt */
+#define  UCR1_RRDYEN     (1<<9)         /* Recv ready interrupt enable */
+#define  UCR1_RDMAEN     (1<<8)         /* Recv ready DMA enable */
+#define  UCR1_IREN       (1<<7)         /* Infrared interface enable */
+#define  UCR1_TXMPTYEN   (1<<6)         /* Transimitter empty interrupt enable */
+#define  UCR1_RTSDEN     (1<<5)         /* RTS delta interrupt enable */
+#define  UCR1_SNDBRK     (1<<4)         /* Send break */
+#define  UCR1_TDMAEN     (1<<3)         /* Transmitter ready DMA enable */
+#define  UCR1_UARTCLKEN  (1<<2)         /* UART clock enabled */
+#define  UCR1_DOZE       (1<<1)         /* Doze */
+#define  UCR1_UARTEN     (1<<0)         /* UART enabled */
+#define  UCR2_ESCI              (1<<15) /* Escape seq interrupt enable */
+#define  UCR2_IRTS      (1<<14) /* Ignore RTS pin */
+#define  UCR2_CTSC      (1<<13) /* CTS pin control */
+#define  UCR2_CTS        (1<<12) /* Clear to send */
+#define  UCR2_ESCEN      (1<<11) /* Escape enable */
+#define  UCR2_PREN       (1<<8)  /* Parity enable */
+#define  UCR2_PROE       (1<<7)  /* Parity odd/even */
+#define  UCR2_STPB       (1<<6)         /* Stop */
+#define  UCR2_WS         (1<<5)         /* Word size */
+#define  UCR2_RTSEN      (1<<4)         /* Request to send interrupt enable */
+#define  UCR2_TXEN       (1<<2)         /* Transmitter enabled */
+#define  UCR2_RXEN       (1<<1)         /* Receiver enabled */
+#define  UCR2_SRST      (1<<0)  /* SW reset */
+#define  UCR3_DTREN     (1<<13) /* DTR interrupt enable */
+#define  UCR3_PARERREN   (1<<12) /* Parity enable */
+#define  UCR3_FRAERREN   (1<<11) /* Frame error interrupt enable */
+#define  UCR3_DSR        (1<<10) /* Data set ready */
+#define  UCR3_DCD        (1<<9)  /* Data carrier detect */
+#define  UCR3_RI         (1<<8)  /* Ring indicator */
+#define  UCR3_TIMEOUTEN  (1<<7)  /* Timeout interrupt enable */
+#define  UCR3_RXDSEN    (1<<6)  /* Receive status interrupt enable */
+#define  UCR3_AIRINTEN   (1<<5)  /* Async IR wake interrupt enable */
+#define  UCR3_AWAKEN    (1<<4)  /* Async wake interrupt enable */
+#define  UCR3_REF25     (1<<3)  /* Ref freq 25 MHz */
+#define  UCR3_REF30     (1<<2)  /* Ref Freq 30 MHz */
+#define  UCR3_INVT      (1<<1)  /* Inverted Infrared transmission */
+#define  UCR3_BPEN      (1<<0)  /* Preset registers enable */
+#define  UCR4_CTSTL_32   (32<<10) /* CTS trigger level (32 chars) */
+#define  UCR4_INVR      (1<<9)  /* Inverted infrared reception */
+#define  UCR4_ENIRI     (1<<8)  /* Serial infrared interrupt enable */
+#define  UCR4_WKEN      (1<<7)  /* Wake interrupt enable */
+#define  UCR4_REF16     (1<<6)  /* Ref freq 16 MHz */
+#define  UCR4_IRSC      (1<<5)  /* IR special case */
+#define  UCR4_TCEN      (1<<3)  /* Transmit complete interrupt enable */
+#define  UCR4_BKEN      (1<<2)  /* Break condition interrupt enable */
+#define  UCR4_OREN      (1<<1)  /* Receiver overrun interrupt enable */
+#define  UCR4_DREN      (1<<0)  /* Recv data ready interrupt enable */
+#define  UFCR_RXTL_SHF   0       /* Receiver trigger level shift */
+#define  UFCR_RFDIV      (7<<7)  /* Reference freq divider mask */
+#define  UFCR_TXTL_SHF   10      /* Transmitter trigger level shift */
+#define  USR1_PARITYERR  (1<<15) /* Parity error interrupt flag */
+#define  USR1_RTSS      (1<<14) /* RTS pin status */
+#define  USR1_TRDY      (1<<13) /* Transmitter ready interrupt/dma flag */
+#define  USR1_RTSD      (1<<12) /* RTS delta */
+#define  USR1_ESCF      (1<<11) /* Escape seq interrupt flag */
+#define  USR1_FRAMERR    (1<<10) /* Frame error interrupt flag */
+#define  USR1_RRDY       (1<<9)         /* Receiver ready interrupt/dma flag */
+#define  USR1_TIMEOUT    (1<<7)         /* Receive timeout interrupt status */
+#define  USR1_RXDS      (1<<6)  /* Receiver idle interrupt flag */
+#define  USR1_AIRINT    (1<<5)  /* Async IR wake interrupt flag */
+#define  USR1_AWAKE     (1<<4)  /* Aysnc wake interrupt flag */
+#define  USR2_ADET      (1<<15) /* Auto baud rate detect complete */
+#define  USR2_TXFE      (1<<14) /* Transmit buffer FIFO empty */
+#define  USR2_DTRF      (1<<13) /* DTR edge interrupt flag */
+#define  USR2_IDLE      (1<<12) /* Idle condition */
+#define  USR2_IRINT     (1<<8)  /* Serial infrared interrupt flag */
+#define  USR2_WAKE      (1<<7)  /* Wake */
+#define  USR2_RTSF      (1<<4)  /* RTS edge interrupt flag */
+#define  USR2_TXDC      (1<<3)  /* Transmitter complete */
+#define  USR2_BRCD      (1<<2)  /* Break condition */
+#define  USR2_ORE        (1<<1)         /* Overrun error */
+#define  USR2_RDR        (1<<0)         /* Recv data ready */
+#define  UTS_FRCPERR    (1<<13) /* Force parity error */
+#define  UTS_LOOP        (1<<12) /* Loop tx and rx */
+#define  UTS_TXEMPTY    (1<<6)  /* TxFIFO empty */
+#define  UTS_RXEMPTY    (1<<5)  /* RxFIFO empty */
+#define  UTS_TXFULL     (1<<4)  /* TxFIFO full */
+#define  UTS_RXFULL     (1<<3)  /* RxFIFO full */
+#define  UTS_SOFTRST    (1<<0)  /* Software reset */
+
+DECLARE_GLOBAL_DATA_PTR;
+
+void serial_setbrg (void)
+{
+       u32 clk = mx31_get_ipg_clk();
+
+       if (!gd->baudrate)
+               gd->baudrate = CONFIG_BAUDRATE;
+
+       __REG(UART_PHYS + UFCR) = 4 << 7; /* divide input clock by 2 */
+       __REG(UART_PHYS + UBIR) = 0xf;
+       __REG(UART_PHYS + UBMR) = clk / (2 * gd->baudrate);
+
+}
+
+int serial_getc (void)
+{
+       while (__REG(UART_PHYS + UTS) & UTS_RXEMPTY);
+       return __REG(UART_PHYS + URXD);
+}
+
+void serial_putc (const char c)
+{
+       __REG(UART_PHYS + UTXD) = c;
+
+       /* wait for transmitter to be ready */
+       while(!(__REG(UART_PHYS + UTS) & UTS_TXEMPTY));
+
+       /* If \n, also do \r */
+       if (c == '\n')
+               serial_putc ('\r');
+}
+
+/*
+ * Test whether a character is in the RX buffer
+ */
+int serial_tstc (void)
+{
+       /* If receive fifo is empty, return false */
+       if (__REG(UART_PHYS + UTS) & UTS_RXEMPTY)
+               return 0;
+       return 1;
+}
+
+void
+serial_puts (const char *s)
+{
+       while (*s) {
+               serial_putc (*s++);
+       }
+}
+
+/*
+ * Initialise the serial port with the given baudrate. The settings
+ * are always 8 data bits, no parity, 1 stop bit, no start bits.
+ *
+ */
+int serial_init (void)
+{
+       __REG(UART_PHYS + UCR1) = 0x0;
+       __REG(UART_PHYS + UCR2) = 0x0;
+
+       while (!(__REG(UART_PHYS + UCR2) & UCR2_SRST));
+
+       __REG(UART_PHYS + UCR3) = 0x0704;
+       __REG(UART_PHYS + UCR4) = 0x8000;
+       __REG(UART_PHYS + UESC) = 0x002b;
+       __REG(UART_PHYS + UTIM) = 0x0;
+
+       __REG(UART_PHYS + UTS) = 0x0;
+
+       serial_setbrg();
+
+       __REG(UART_PHYS + UCR2) = UCR2_WS | UCR2_IRTS | UCR2_RXEN | UCR2_TXEN | UCR2_SRST;
+
+       __REG(UART_PHYS + UCR1) = UCR1_UARTEN;
+
+       return 0;
+}
+
+
+#endif /* CONFIG_MX31 */
diff --git a/cpu/arm1136/omap24xx/Makefile b/cpu/arm1136/omap24xx/Makefile
new file mode 100644 (file)
index 0000000..f9afed7
--- /dev/null
@@ -0,0 +1,46 @@
+#
+# (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$(SOC).a
+
+COBJS  = interrupts.o
+SOBJS  = start.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+
+all:   $(obj).depend $(LIB)
+
+$(LIB):        $(OBJS)
+       $(AR) $(ARFLAGS) $@ $(OBJS)
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
similarity index 92%
rename from cpu/arm1136/interrupts.c
rename to cpu/arm1136/omap24xx/interrupts.c
index 491c902..b9a8b93 100644 (file)
 
 #include <common.h>
 #include <asm/arch/bits.h>
-
-#if !defined(CONFIG_INTEGRATOR) && ! defined(CONFIG_ARCH_CINTEGRATOR)
-# include <asm/arch/omap2420.h>
-#endif
+#include <asm/arch/omap2420.h>
 
 #define TIMER_LOAD_VAL 0
 
 /* macro to read the 32 bit timer */
-#define READ_TIMER (*(volatile ulong *)(CFG_TIMERBASE+TCRR))
-
-#if defined(CONFIG_INTEGRATOR) && defined(CONFIG_ARCH_CINTEGRATOR)
-/* Use the IntegratorCP function from board/integratorcp.c */
-#else
+#define READ_TIMER (*((volatile ulong *)(CFG_TIMERBASE+TCRR)))
 
 static ulong timestamp;
 static ulong lastinc;
@@ -164,4 +157,3 @@ ulong get_tbclk (void)
        tbclk = CFG_HZ;
        return tbclk;
 }
-#endif /* !Integrator/CP */
diff --git a/cpu/arm1136/omap24xx/start.S b/cpu/arm1136/omap24xx/start.S
new file mode 100644 (file)
index 0000000..d6cefbd
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ *  armboot - Startup Code for OMP2420/ARM1136 CPU-core
+ *
+ *  Copyright (c) 2004 Texas Instruments <r-woodruff2@ti.com>
+ *
+ *  Copyright (c) 2001 Marius Gröger <mag@sysgo.de>
+ *  Copyright (c) 2002 Alex Züpke <azu@sysgo.de>
+ *  Copyright (c) 2002 Gary Jennejohn <gj@denx.de>
+ *  Copyright (c) 2003 Richard Woodruff <r-woodruff2@ti.com>
+ *  Copyright (c) 2003 Kshitij <kshitij@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 <asm/arch/omap2420.h>
+
+.globl reset_cpu
+reset_cpu:
+       ldr     r1, rstctl      /* get addr for global reset reg */
+       mov     r3, #0x2        /* full reset pll+mpu */
+       str     r3, [r1]        /* force reset */
+       mov     r0, r0
+_loop_forever:
+       b       _loop_forever
+rstctl:
+       .word   PM_RSTCTRL_WKUP
index 8b765f1..56009d0 100644 (file)
@@ -30,9 +30,6 @@
 
 #include <config.h>
 #include <version.h>
-#if !defined(CONFIG_INTEGRATOR) && ! defined(CONFIG_ARCH_CINTEGRATOR)
-#include <asm/arch/omap2420.h>
-#endif
 .globl _start
 _start: b      reset
 #ifdef CONFIG_ONENAND_IPL
@@ -438,22 +435,4 @@ fiq:
 arm1136_cache_flush:
                mcr     p15, 0, r1, c7, c5, 0   @ invalidate I cache
                mov     pc, lr                  @ back to caller
-
-#if defined(CONFIG_INTEGRATOR) && defined(CONFIG_ARCH_CINTEGRATOR)
-/* Use the IntegratorCP function from board/integratorcp/platform.S */
-#else
-
-       .align  5
-.globl reset_cpu
-reset_cpu:
-       ldr     r1, rstctl      /* get addr for global reset reg */
-       mov     r3, #0x2        /* full reset pll+mpu */
-       str     r3, [r1]        /* force reset */
-       mov     r0, r0
-_loop_forever:
-       b       _loop_forever
-rstctl:
-       .word   PM_RSTCTRL_WKUP
-
-#endif
 #endif /* CONFIG_ONENAND_IPL */
index 1902bd0..98363eb 100644 (file)
@@ -46,7 +46,7 @@
 #define MC_ASR         0xFFFFFF04
 #define MC_AASR                0xFFFFFF08
 #define EBI_CFGR       0xFFFFFF64
-#define SMC2_CSR       0xFFFFFF70
+#define SMC_CSR0       0xFFFFFF70
 
 /* clocks */
 #define PLLAR          0xFFFFFC28
@@ -146,8 +146,8 @@ SMRDATA:
        .word MC_AASR_VAL
        .word EBI_CFGR
        .word EBI_CFGR_VAL
-       .word SMC2_CSR
-       .word SMC2_CSR_VAL
+       .word SMC_CSR0
+       .word SMC_CSR0_VAL
        .word PLLAR
        .word PLLAR_VAL
        .word PLLBR
index ae86002..acc00ad 100644 (file)
@@ -178,7 +178,7 @@ copyex:
        bl      cpu_init_crit
 #endif
 
-#ifdef CONFIG_AT91RM9200
+#ifndef        CONFIG_AT91RM9200
 
 #ifndef CONFIG_SKIP_RELOCATE_UBOOT
 relocate:                              /* relocate U-Boot to RAM           */
diff --git a/cpu/arm926ejs/at91cap9/spi.c b/cpu/arm926ejs/at91cap9/spi.c
deleted file mode 100644 (file)
index 0953820..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Driver for ATMEL DataFlash support
- * Author : Hamid Ikdoumi (Atmel)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- */
-
-#include <config.h>
-#include <common.h>
-#include <asm/hardware.h>
-
-#ifdef CONFIG_HAS_DATAFLASH
-#include <dataflash.h>
-
-/* Max Value = 10MHz to be compliant to the Continuous Array Read function */
-#define AT91C_SPI_CLK  10000000
-
-/* AC Characteristics: DLYBS = tCSS = 250ns min and DLYBCT = tCSH = 250ns */
-#define DATAFLASH_TCSS (0xFA << 16)
-#define DATAFLASH_TCHS (0x8 << 24)
-
-#define AT91C_TIMEOUT_WRDY             200000
-#define AT91C_SPI_PCS0_DATAFLASH_CARD  0xE     /* Chip Select 0: NPCS0%1110 */
-#define AT91C_SPI_PCS3_DATAFLASH_CARD  0x7     /* Chip Select 3: NPCS3%0111 */
-
-void AT91F_SpiInit(void)
-{
-       /* Reset the SPI */
-       AT91C_BASE_SPI0->SPI_CR = AT91C_SPI_SWRST;
-
-       /* Configure SPI in Master Mode with No CS selected !!! */
-       AT91C_BASE_SPI0->SPI_MR =
-               AT91C_SPI_MSTR | AT91C_SPI_MODFDIS | AT91C_SPI_PCS;
-
-       /* Configure CS0 */
-       AT91C_BASE_SPI0->SPI_CSR[0] =
-               AT91C_SPI_CPOL |
-               (AT91C_SPI_DLYBS & DATAFLASH_TCSS) |
-               (AT91C_SPI_DLYBCT & DATAFLASH_TCHS) |
-               ((AT91C_MASTER_CLOCK / (2*AT91C_SPI_CLK)) << 8);
-}
-
-void AT91F_SpiEnable(int cs)
-{
-       switch (cs) {
-       case 0: /* Configure SPI CS0 for Serial DataFlash AT45DBxx */
-               AT91C_BASE_SPI0->SPI_MR &= 0xFFF0FFFF;
-               AT91C_BASE_SPI0->SPI_MR |=
-                       ((AT91C_SPI_PCS0_DATAFLASH_CARD<<16) & AT91C_SPI_PCS);
-               break;
-       case 3:
-               AT91C_BASE_SPI0->SPI_MR &= 0xFFF0FFFF;
-               AT91C_BASE_SPI0->SPI_MR |=
-                       ((AT91C_SPI_PCS3_DATAFLASH_CARD<<16) & AT91C_SPI_PCS);
-               break;
-       }
-
-       /* SPI_Enable */
-       AT91C_BASE_SPI0->SPI_CR = AT91C_SPI_SPIEN;
-}
-
-unsigned int AT91F_SpiWrite(AT91PS_DataflashDesc pDesc)
-{
-       unsigned int timeout;
-
-       pDesc->state = BUSY;
-
-       AT91C_BASE_SPI0->SPI_PTCR = AT91C_PDC_TXTDIS + AT91C_PDC_RXTDIS;
-
-       /* Initialize the Transmit and Receive Pointer */
-       AT91C_BASE_SPI0->SPI_RPR = (unsigned int)pDesc->rx_cmd_pt;
-       AT91C_BASE_SPI0->SPI_TPR = (unsigned int)pDesc->tx_cmd_pt;
-
-       /* Intialize the Transmit and Receive Counters */
-       AT91C_BASE_SPI0->SPI_RCR = pDesc->rx_cmd_size;
-       AT91C_BASE_SPI0->SPI_TCR = pDesc->tx_cmd_size;
-
-       if (pDesc->tx_data_size != 0) {
-               /* Initialize the Next Transmit and Next Receive Pointer */
-               AT91C_BASE_SPI0->SPI_RNPR = (unsigned int)pDesc->rx_data_pt;
-               AT91C_BASE_SPI0->SPI_TNPR = (unsigned int)pDesc->tx_data_pt;
-
-               /* Intialize the Next Transmit and Next Receive Counters */
-               AT91C_BASE_SPI0->SPI_RNCR = pDesc->rx_data_size;
-               AT91C_BASE_SPI0->SPI_TNCR = pDesc->tx_data_size;
-       }
-
-       /* arm simple, non interrupt dependent timer */
-       reset_timer_masked();
-       timeout = 0;
-
-       AT91C_BASE_SPI0->SPI_PTCR = AT91C_PDC_TXTEN + AT91C_PDC_RXTEN;
-       while (!(AT91C_BASE_SPI0->SPI_SR & AT91C_SPI_RXBUFF) &&
-               ((timeout = get_timer_masked()) < CFG_SPI_WRITE_TOUT));
-       AT91C_BASE_SPI0->SPI_PTCR = AT91C_PDC_TXTDIS + AT91C_PDC_RXTDIS;
-       pDesc->state = IDLE;
-
-       if (timeout >= CFG_SPI_WRITE_TOUT) {
-               printf("Error Timeout\n\r");
-               return DATAFLASH_ERROR;
-       }
-
-       return DATAFLASH_OK;
-}
-#endif
similarity index 87%
rename from cpu/arm926ejs/at91cap9/Makefile
rename to cpu/arm926ejs/at91sam9/Makefile
index bf15e1e..203abc2 100644 (file)
@@ -25,11 +25,14 @@ include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(SOC).a
 
-COBJS  = ether.o timer.o spi.o usb.o
+COBJS-y        += ether.o
+COBJS-y        += timer.o
+COBJS-$(CONFIG_HAS_DATAFLASH) +=spi.o
+COBJS-y        += usb.o
 SOBJS  = lowlevel_init.o
 
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+SRCS    := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS    := $(addprefix $(obj),$(SOBJS) $(COBJS-y))
 
 all:   $(obj).depend $(LIB)
 
similarity index 89%
rename from cpu/arm926ejs/at91cap9/ether.c
rename to cpu/arm926ejs/at91sam9/ether.c
index b7958d5..e4f5601 100644 (file)
  */
 
 #include <common.h>
-#include <asm/arch/AT91CAP9.h>
+#include <asm/arch/hardware.h>
 
 extern int macb_eth_initialize(int id, void *regs, unsigned int phy_addr);
 
 #if defined(CONFIG_MACB) && defined(CONFIG_CMD_NET)
-void at91cap9_eth_initialize(bd_t *bi)
+void at91sam9_eth_initialize(bd_t *bi)
 {
-       macb_eth_initialize(0, (void *)AT91C_BASE_MACB, 0x00);
+       macb_eth_initialize(0, (void *)AT91_BASE_EMAC, 0x00);
 }
 #endif
similarity index 97%
rename from cpu/arm926ejs/at91cap9/lowlevel_init.S
rename to cpu/arm926ejs/at91sam9/lowlevel_init.S
index 24d950c..40a3f6a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * AT91CAP9 setup stuff
+ * AT91CAP9/SAM9 setup stuff
  *
  * (C) Copyright 2007-2008
  * Stelian Pop <stelian.pop <at> leadtechdesign.com>
diff --git a/cpu/arm926ejs/at91sam9/spi.c b/cpu/arm926ejs/at91sam9/spi.c
new file mode 100644 (file)
index 0000000..c9fe6d8
--- /dev/null
@@ -0,0 +1,157 @@
+/*
+ * Driver for ATMEL DataFlash support
+ * Author : Hamid Ikdoumi (Atmel)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ */
+
+#include <common.h>
+#include <asm/arch/hardware.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/io.h>
+#include <asm/arch/at91_pio.h>
+#include <asm/arch/at91_spi.h>
+
+#include <dataflash.h>
+
+#define AT91_SPI_PCS0_DATAFLASH_CARD   0xE     /* Chip Select 0: NPCS0%1110 */
+#define AT91_SPI_PCS1_DATAFLASH_CARD   0xD     /* Chip Select 0: NPCS0%1101 */
+#define AT91_SPI_PCS3_DATAFLASH_CARD   0x7     /* Chip Select 3: NPCS3%0111 */
+
+void AT91F_SpiInit(void)
+{
+       /* Reset the SPI */
+       writel(AT91_SPI_SWRST, AT91_BASE_SPI + AT91_SPI_CR);
+
+       /* Configure SPI in Master Mode with No CS selected !!! */
+       writel(AT91_SPI_MSTR | AT91_SPI_MODFDIS | AT91_SPI_PCS,
+              AT91_BASE_SPI + AT91_SPI_MR);
+
+       /* Configure CS0 */
+       writel(AT91_SPI_NCPHA |
+              (AT91_SPI_DLYBS & DATAFLASH_TCSS) |
+              (AT91_SPI_DLYBCT & DATAFLASH_TCHS) |
+              ((AT91_MASTER_CLOCK / AT91_SPI_CLK) << 8),
+              AT91_BASE_SPI + AT91_SPI_CSR(0));
+
+#ifdef CFG_DATAFLASH_LOGIC_ADDR_CS1
+       /* Configure CS1 */
+       writel(AT91_SPI_NCPHA |
+              (AT91_SPI_DLYBS & DATAFLASH_TCSS) |
+              (AT91_SPI_DLYBCT & DATAFLASH_TCHS) |
+              ((AT91_MASTER_CLOCK / AT91_SPI_CLK) << 8),
+              AT91_BASE_SPI + AT91_SPI_CSR(1));
+#endif
+
+#ifdef CFG_DATAFLASH_LOGIC_ADDR_CS3
+       /* Configure CS3 */
+       writel(AT91_SPI_NCPHA |
+              (AT91_SPI_DLYBS & DATAFLASH_TCSS) |
+              (AT91_SPI_DLYBCT & DATAFLASH_TCHS) |
+              ((AT91_MASTER_CLOCK / AT91_SPI_CLK) << 8),
+              AT91_BASE_SPI + AT91_SPI_CSR(3));
+#endif
+
+       /* SPI_Enable */
+       writel(AT91_SPI_SPIEN, AT91_BASE_SPI + AT91_SPI_CR);
+
+       while (!(readl(AT91_BASE_SPI + AT91_SPI_SR) & AT91_SPI_SPIENS));
+
+       /*
+        * Add tempo to get SPI in a safe state.
+        * Should not be needed for new silicon (Rev B)
+        */
+       udelay(500000);
+       readl(AT91_BASE_SPI + AT91_SPI_SR);
+       readl(AT91_BASE_SPI + AT91_SPI_RDR);
+
+}
+
+void AT91F_SpiEnable(int cs)
+{
+       unsigned long mode;
+
+       switch (cs) {
+       case 0: /* Configure SPI CS0 for Serial DataFlash AT45DBxx */
+               mode = readl(AT91_BASE_SPI + AT91_SPI_MR);
+               mode &= 0xFFF0FFFF;
+               writel(mode | ((AT91_SPI_PCS0_DATAFLASH_CARD<<16) & AT91_SPI_PCS),
+                      AT91_BASE_SPI + AT91_SPI_MR);
+               break;
+       case 1: /* Configure SPI CS1 for Serial DataFlash AT45DBxx */
+               mode = readl(AT91_BASE_SPI + AT91_SPI_MR);
+               mode &= 0xFFF0FFFF;
+               writel(mode | ((AT91_SPI_PCS1_DATAFLASH_CARD<<16) & AT91_SPI_PCS),
+                      AT91_BASE_SPI + AT91_SPI_MR);
+               break;
+       case 3:
+               mode = readl(AT91_BASE_SPI + AT91_SPI_MR);
+               mode &= 0xFFF0FFFF;
+               writel(mode | ((AT91_SPI_PCS3_DATAFLASH_CARD<<16) & AT91_SPI_PCS),
+                      AT91_BASE_SPI + AT91_SPI_MR);
+               break;
+       }
+
+       /* SPI_Enable */
+       writel(AT91_SPI_SPIEN, AT91_BASE_SPI + AT91_SPI_CR);
+}
+
+unsigned int AT91F_SpiWrite1(AT91PS_DataflashDesc pDesc);
+
+unsigned int AT91F_SpiWrite(AT91PS_DataflashDesc pDesc)
+{
+       unsigned int timeout;
+
+       pDesc->state = BUSY;
+
+       writel(AT91_SPI_TXTDIS + AT91_SPI_RXTDIS, AT91_BASE_SPI + AT91_SPI_PTCR);
+
+       /* Initialize the Transmit and Receive Pointer */
+       writel((unsigned int)pDesc->rx_cmd_pt, AT91_BASE_SPI + AT91_SPI_RPR);
+       writel((unsigned int)pDesc->tx_cmd_pt, AT91_BASE_SPI + AT91_SPI_TPR);
+
+       /* Intialize the Transmit and Receive Counters */
+       writel(pDesc->rx_cmd_size, AT91_BASE_SPI + AT91_SPI_RCR);
+       writel(pDesc->tx_cmd_size, AT91_BASE_SPI + AT91_SPI_TCR);
+
+       if (pDesc->tx_data_size != 0) {
+               /* Initialize the Next Transmit and Next Receive Pointer */
+               writel((unsigned int)pDesc->rx_data_pt, AT91_BASE_SPI + AT91_SPI_RNPR);
+               writel((unsigned int)pDesc->tx_data_pt, AT91_BASE_SPI + AT91_SPI_TNPR);
+
+               /* Intialize the Next Transmit and Next Receive Counters */
+               writel(pDesc->rx_data_size, AT91_BASE_SPI + AT91_SPI_RNCR);
+               writel(pDesc->tx_data_size, AT91_BASE_SPI + AT91_SPI_TNCR);
+       }
+
+       /* arm simple, non interrupt dependent timer */
+       reset_timer_masked();
+       timeout = 0;
+
+       writel(AT91_SPI_TXTEN + AT91_SPI_RXTEN, AT91_BASE_SPI + AT91_SPI_PTCR);
+       while (!(readl(AT91_BASE_SPI + AT91_SPI_SR) & AT91_SPI_RXBUFF) &&
+               ((timeout = get_timer_masked()) < CFG_SPI_WRITE_TOUT));
+       writel(AT91_SPI_TXTDIS + AT91_SPI_RXTDIS, AT91_BASE_SPI + AT91_SPI_PTCR);
+       pDesc->state = IDLE;
+
+       if (timeout >= CFG_SPI_WRITE_TOUT) {
+               printf("Error Timeout\n\r");
+               return DATAFLASH_ERROR;
+       }
+
+       return DATAFLASH_OK;
+}
similarity index 84%
rename from cpu/arm926ejs/at91cap9/timer.c
rename to cpu/arm926ejs/at91sam9/timer.c
index 4110e15..4e79466 100644 (file)
 
 #include <common.h>
 #include <asm/arch/hardware.h>
+#include <asm/arch/at91_pit.h>
+#include <asm/arch/at91_pmc.h>
+#include <asm/arch/at91_rstc.h>
+#include <asm/arch/io.h>
 
 /*
- * We're using the AT91CAP9 PITC in 32 bit mode, by
+ * We're using the AT91CAP9/SAM9 PITC in 32 bit mode, by
  * setting the 20 bit counter period to its maximum (0xfffff).
  */
 #define TIMER_LOAD_VAL 0xfffff
-#define READ_RESET_TIMER (AT91C_BASE_PITC->PITC_PIVR)
-#define READ_TIMER (AT91C_BASE_PITC->PITC_PIIR)
+#define READ_RESET_TIMER at91_sys_read(AT91_PIT_PIVR)
+#define READ_TIMER at91_sys_read(AT91_PIT_PIIR)
 #define TIMER_FREQ (AT91C_MASTER_CLOCK << 4)
 #define TICKS_TO_USEC(ticks) ((ticks) / 6)
 
 ulong get_timer_masked(void);
 ulong resettime;
 
-AT91PS_PITC p_pitc;
-
 /* nothing really to do with interrupts, just starts up a counter. */
-int interrupt_init(void)
+int timer_init(void)
 {
        /*
         * Enable PITC Clock
         * The clock is already enabled for system controller in boot
         */
-       AT91C_BASE_PMC->PMC_PCER = 1 << AT91C_ID_SYS;
+       at91_sys_write(AT91_PMC_PCER, 1 << AT91_ID_SYS);
 
        /* Enable PITC */
-       AT91C_BASE_PITC->PITC_PIMR = AT91C_PITC_PITEN;
-
-       /* Load PITC_PIMR with the right timer value */
-       AT91C_BASE_PITC->PITC_PIMR |= TIMER_LOAD_VAL;
+       at91_sys_write(AT91_PIT_MR, TIMER_LOAD_VAL | AT91_PIT_PITEN);
 
        reset_timer_masked();
 
@@ -67,6 +66,7 @@ int interrupt_init(void)
 static inline ulong get_timer_raw(void)
 {
        ulong now = READ_TIMER;
+
        if (now >= resettime)
                return now - resettime;
        else
@@ -129,20 +129,20 @@ unsigned long long get_ticks(void)
 ulong get_tbclk(void)
 {
        ulong tbclk;
+
        tbclk = CFG_HZ;
        return tbclk;
 }
 
 /*
- * Reset the cpu by setting up the watchdog timer and let him time out
- * on the AT91CAP9ADK board
+ * Reset the cpu by setting up the watchdog timer and let him time out.
  */
 void reset_cpu(ulong ignored)
 {
        /* this is the way Linux does it */
-       AT91C_BASE_RSTC->RSTC_RCR = (0xA5 << 24) |
-                                   AT91C_RSTC_PROCRST |
-                                   AT91C_RSTC_PERRST;
+       at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY |
+                                    AT91_RSTC_PROCRST |
+                                    AT91_RSTC_PERRST);
 
        while (1);
        /* Never reached */
similarity index 83%
rename from cpu/arm926ejs/at91cap9/usb.c
rename to cpu/arm926ejs/at91sam9/usb.c
index 69da5f3..d678897 100644 (file)
 #include <common.h>
 
 #if defined(CONFIG_USB_OHCI_NEW) && defined(CFG_USB_OHCI_CPU_INIT)
-#ifdef CONFIG_AT91CAP9
 
 #include <asm/arch/hardware.h>
+#include <asm/arch/io.h>
+#include <asm/arch/at91_pmc.h>
 
 int usb_cpu_init(void)
 {
        /* Enable USB host clock. */
-       AT91C_BASE_PMC->PMC_SCER = AT91C_PMC_UHP;
-       AT91C_BASE_PMC->PMC_PCER = 1 << AT91C_ID_UHP;
+       at91_sys_write(AT91_PMC_PCER, 1 << AT91_ID_UHP);
+       at91_sys_write(AT91_PMC_SCER, AT91_PMC_UHP);
 
        return 0;
 }
@@ -40,8 +41,8 @@ int usb_cpu_init(void)
 int usb_cpu_stop(void)
 {
        /* Disable USB host clock. */
-       AT91C_BASE_PMC->PMC_PCDR = 1 << AT91C_ID_UHP;
-       AT91C_BASE_PMC->PMC_SCDR = AT91C_PMC_UHP;
+       at91_sys_write(AT91_PMC_PCDR, 1 << AT91_ID_UHP);
+       at91_sys_write(AT91_PMC_SCDR, AT91_PMC_UHP);
        return 0;
 }
 
@@ -50,5 +51,4 @@ int usb_cpu_init_fail(void)
        return usb_cpu_stop();
 }
 
-#endif /* CONFIG_AT91CAP9 */
 #endif /* defined(CONFIG_USB_OHCI) && defined(CFG_USB_OHCI_CPU_INIT) */
index 8bb8b45..6c670f0 100644 (file)
@@ -42,9 +42,9 @@
 
 typedef volatile struct {
        u_int32_t       pid12;
-       u_int32_t       emumgt_clksped;
-       u_int32_t       gpint_en;
-       u_int32_t       gpdir_dat;
+       u_int32_t       emumgt;
+       u_int32_t       na1;
+       u_int32_t       na2;
        u_int32_t       tim12;
        u_int32_t       tim34;
        u_int32_t       prd12;
@@ -52,21 +52,12 @@ typedef volatile struct {
        u_int32_t       tcr;
        u_int32_t       tgcr;
        u_int32_t       wdtcr;
-       u_int32_t       tlgc;
-       u_int32_t       tlmr;
 } davinci_timer;
 
 davinci_timer          *timer = (davinci_timer *)CFG_TIMERBASE;
 
 #define TIMER_LOAD_VAL (CFG_HZ_CLOCK / CFG_HZ)
-#define READ_TIMER     timer->tim34
-
-/*
- * Timer runs with CFG_HZ_CLOCK, currently 27MHz. To avoid wrap
- * around of timestamp already after min ~159s, divide it, e.g. by 16.
- * timestamp will then wrap around all min ~42min
- */
-#define DIV(x)         ((x) >> 4)
+#define TIM_CLK_DIV    16
 
 static ulong timestamp;
 static ulong lastinc;
@@ -76,63 +67,51 @@ int timer_init(void)
        /* We are using timer34 in unchained 32-bit mode, full speed */
        timer->tcr = 0x0;
        timer->tgcr = 0x0;
-       timer->tgcr = 0x06;
+       timer->tgcr = 0x06 | ((TIM_CLK_DIV - 1) << 8);
        timer->tim34 = 0x0;
        timer->prd34 = TIMER_LOAD_VAL;
        lastinc = 0;
-       timer->tcr = 0x80 << 16;
        timestamp = 0;
+       timer->tcr = 2 << 22;
 
        return(0);
 }
 
 void reset_timer(void)
 {
-       reset_timer_masked();
-}
-
-ulong get_timer(ulong base)
-{
-       return(get_timer_masked() - base);
-}
-
-void set_timer(ulong t)
-{
-       timestamp = t;
-}
-
-void udelay(unsigned long usec)
-{
-       udelay_masked(usec);
-}
-
-void reset_timer_masked(void)
-{
-       lastinc = DIV(READ_TIMER);
+       timer->tcr = 0x0;
+       timer->tim34 = 0;
+       lastinc = 0;
        timestamp = 0;
+       timer->tcr = 2 << 22;
 }
 
-ulong get_timer_raw(void)
+static ulong get_timer_raw(void)
 {
-       ulong now = DIV(READ_TIMER);
+       ulong now = timer->tim34;
 
        if (now >= lastinc) {
                /* normal mode */
                timestamp += now - lastinc;
        } else {
                /* overflow ... */
-               timestamp += now + DIV(TIMER_LOAD_VAL) - lastinc;
+               timestamp += now + TIMER_LOAD_VAL - lastinc;
        }
        lastinc = now;
        return timestamp;
 }
 
-ulong get_timer_masked(void)
+ulong get_timer(ulong base)
+{
+       return((get_timer_raw() / (TIMER_LOAD_VAL / TIM_CLK_DIV)) - base);
+}
+
+void set_timer(ulong t)
 {
-       return(get_timer_raw() / DIV(TIMER_LOAD_VAL));
+       timestamp = t;
 }
 
-void udelay_masked(unsigned long usec)
+void udelay(unsigned long usec)
 {
        ulong tmo;
        ulong endtime;
@@ -140,7 +119,7 @@ void udelay_masked(unsigned long usec)
 
        tmo = CFG_HZ_CLOCK / 1000;
        tmo *= usec;
-       tmo /= 1000;
+       tmo /= (1000 * TIM_CLK_DIV);
 
        endtime = get_timer_raw() + tmo;
 
@@ -165,8 +144,5 @@ unsigned long long get_ticks(void)
  */
 ulong get_tbclk(void)
 {
-       ulong tbclk;
-
-       tbclk = CFG_HZ;
-       return(tbclk);
+       return CFG_HZ;
 }
index 0971fea..1819f6b 100644 (file)
@@ -38,7 +38,7 @@
 #include <common.h>
 #include <arm926ejs.h>
 
-#if defined(CONFIG_INTEGRATOR) || defined(CONFIG_AT91CAP9ADK)
+#ifdef CONFIG_INTEGRATOR
 
        /* Timer functionality supplied by Integrator board (AP or CP) */
 
diff --git a/cpu/bf533/Makefile b/cpu/bf533/Makefile
deleted file mode 100644 (file)
index ad48f1c..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-# U-boot - Makefile
-#
-# Copyright (c) 2005-2007 Analog Devices 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., 51 Franklin St, Fifth Floor, Boston,
-# MA 02110-1301 USA
-#
-
-include $(TOPDIR)/config.mk
-
-LIB    = $(obj)lib$(CPU).a
-
-SOBJS  = start.o start1.o interrupt.o cache.o flush.o init_sdram.o
-COBJS  = cpu.o traps.o ints.o serial.o interrupts.o video.o
-
-EXTRA = init_sdram_bootrom_initblock.o
-
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
-START  := $(addprefix $(obj),$(START))
-
-all:   $(obj).depend $(START) $(LIB) $(obj).depend $(EXTRA)
-
-$(LIB):        $(OBJS)
-       $(AR) $(ARFLAGS) $@ $(OBJS)
-
-#########################################################################
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
diff --git a/cpu/bf533/bf533_serial.h b/cpu/bf533/bf533_serial.h
deleted file mode 100644 (file)
index 9970b72..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * U-boot - bf533_serial.h Serial Driver defines
- *
- * Copyright (c) 2005-2007 Analog Devices Inc.
- *
- * This file is based on
- * bf533_serial.h: Definitions for the BlackFin BF533 DSP serial driver.
- * Copyright (C) 2003  Bas Vermeulen <bas@buyways.nl>
- *                     BuyWays B.V. (www.buyways.nl)
- *
- * Based heavily on:
- * blkfinserial.h: Definitions for the BlackFin DSP serial driver.
- *
- * Copyright (C) 2001  Tony Z. Kou     tonyko@arcturusnetworks.com
- * Copyright (C) 2001   Arcturus Networks Inc. <www.arcturusnetworks.com>
- *
- * Based on code from 68328serial.c which was:
- * Copyright (C) 1995       David S. Miller    <davem@caip.rutgers.edu>
- * Copyright (C) 1998       Kenneth Albanowski <kjahds@kjahds.com>
- * Copyright (C) 1998, 1999 D. Jeff Dionne     <jeff@uclinux.org>
- * Copyright (C) 1999       Vladimir Gurevich  <vgurevic@cisco.com>
- *
- * (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
- */
-
-#ifndef _Bf533_SERIAL_H
-#define _Bf533_SERIAL_H
-
-#include <linux/config.h>
-#include <asm/blackfin.h>
-
-#define SYNC_ALL       __asm__ __volatile__ ("ssync;\n")
-#define ACCESS_LATCH   *pUART_LCR |= DLAB;
-#define ACCESS_PORT_IER        *pUART_LCR &= (~DLAB);
-
-void serial_setbrg(void);
-static void local_put_char(char ch);
-void calc_baud(void);
-void serial_setbrg(void);
-int serial_init(void);
-void serial_putc(const char c);
-int serial_tstc(void);
-int serial_getc(void);
-void serial_puts(const char *s);
-static void local_put_char(char ch);
-
-int baud_table[5] = { 9600, 19200, 38400, 57600, 115200 };
-
-struct {
-       unsigned char dl_high;
-       unsigned char dl_low;
-} hw_baud_table[5];
-
-#ifdef CONFIG_STAMP
-extern unsigned long pll_div_fact;
-#endif
-
-#endif
diff --git a/cpu/bf533/cache.S b/cpu/bf533/cache.S
deleted file mode 100644 (file)
index d9015c6..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-#define ASSEMBLY
-#include <asm/linkage.h>
-#include <config.h>
-#include <asm/blackfin.h>
-#include <asm/mach-common/bits/mpu.h>
-
-.text
-.align 2
-ENTRY(_blackfin_icache_flush_range)
-       R2 = -32;
-       R2 = R0 & R2;
-       P0 = R2;
-       P1 = R1;
-       CSYNC;
-       1:
-       IFLUSH[P0++];
-       CC = P0 < P1(iu);
-       IF CC JUMP 1b(bp);
-       IFLUSH[P0];
-       SSYNC;
-       RTS;
-
-ENTRY(_blackfin_dcache_flush_range)
-       R2 = -32;
-       R2 = R0 & R2;
-       P0 = R2;
-       P1 = R1;
-       CSYNC;
-1:
-       FLUSH[P0++];
-       CC = P0 < P1(iu);
-       IF CC JUMP 1b(bp);
-       FLUSH[P0];
-       SSYNC;
-       RTS;
-
-ENTRY(_icache_invalidate)
-ENTRY(_invalidate_entire_icache)
-       [--SP] = (R7:5);
-
-       P0.L = (IMEM_CONTROL & 0xFFFF);
-       P0.H = (IMEM_CONTROL >> 16);
-       R7 =[P0];
-
-       /*
-        * Clear the IMC bit , All valid bits in the instruction
-        * cache are set to the invalid state
-        */
-       BITCLR(R7, IMC_P);
-       CLI R6;
-       /* SSYNC required before invalidating cache. */
-       SSYNC;
-       .align 8;
-       [P0] = R7;
-       SSYNC;
-       STI R6;
-
-       /* Configures the instruction cache agian */
-       R6 = (IMC | ENICPLB);
-       R7 = R7 | R6;
-
-       CLI R6;
-       SSYNC;
-       .align 8;
-       [P0] = R7;
-       SSYNC;
-       STI R6;
-
-       (R7:5) =[SP++];
-       RTS;
-
-/*
- * Invalidate the Entire Data cache by
- * clearing DMC[1:0] bits
- */
-ENTRY(_invalidate_entire_dcache)
-ENTRY(_dcache_invalidate)
-       [--SP] = (R7:6);
-
-       P0.L = (DMEM_CONTROL & 0xFFFF);
-       P0.H = (DMEM_CONTROL >> 16);
-       R7 =[P0];
-
-       /*
-        * Clear the DMC[1:0] bits, All valid bits in the data
-        * cache are set to the invalid state
-        */
-       BITCLR(R7, DMC0_P);
-       BITCLR(R7, DMC1_P);
-       CLI R6;
-       SSYNC;
-       .align 8;
-       [P0] = R7;
-       SSYNC;
-       STI R6;
-       /* Configures the data cache again */
-
-       R6 = (ACACHE_BCACHE | ENDCPLB | PORT_PREF0);
-       R7 = R7 | R6;
-
-       CLI R6;
-       SSYNC;
-       .align 8;
-       [P0] = R7;
-       SSYNC;
-       STI R6;
-
-       (R7:6) =[SP++];
-       RTS;
-
-ENTRY(_blackfin_dcache_invalidate_range)
-       R2 = -32;
-       R2 = R0 & R2;
-       P0 = R2;
-       P1 = R1;
-       CSYNC;
-1:
-       FLUSHINV[P0++];
-       CC = P0 < P1(iu);
-       IF CC JUMP 1b(bp);
-
-       /*
-        * If the data crosses a cache line, then we'll be pointing to
-        * the last cache line, but won't have flushed/invalidated it yet, so do
-        * one more.
-        */
-       FLUSHINV[P0];
-       SSYNC;
-       RTS;
diff --git a/cpu/bf533/cpu.c b/cpu/bf533/cpu.c
deleted file mode 100644 (file)
index edb771e..0000000
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * U-boot - cpu.c CPU specific functions
- *
- * Copyright (c) 2005-2007 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 <asm/blackfin.h>
-#include <command.h>
-#include <asm/entry.h>
-#include <asm/cplb.h>
-#include <asm/io.h>
-
-#define CACHE_ON 1
-#define CACHE_OFF 0
-
-extern unsigned int icplb_table[page_descriptor_table_size][2];
-extern unsigned int dcplb_table[page_descriptor_table_size][2];
-
-int do_reset(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
-{
-       __asm__ __volatile__("cli r3;" "P0 = %0;" "JUMP (P0);"::"r"(L1_INST_SRAM)
-           );
-
-       return 0;
-}
-
-/* These functions are just used to satisfy the linker */
-int cpu_init(void)
-{
-       return 0;
-}
-
-int cleanup_before_linux(void)
-{
-       return 0;
-}
-
-void icache_enable(void)
-{
-       unsigned int *I0, *I1;
-       int i, j = 0;
-
-       /* Before enable icache, disable it first */
-       icache_disable();
-       I0 = (unsigned int *)ICPLB_ADDR0;
-       I1 = (unsigned int *)ICPLB_DATA0;
-
-       /* make sure the locked ones go in first */
-       for (i = 0; i < page_descriptor_table_size; i++) {
-               if (CPLB_LOCK & icplb_table[i][1]) {
-                       debug("adding %02i %02i 0x%08x 0x%08x\n", i, j,
-                                icplb_table[i][0], icplb_table[i][1]);
-                       *I0++ = icplb_table[i][0];
-                       *I1++ = icplb_table[i][1];
-                       j++;
-               }
-       }
-
-       for (i = 0; i < page_descriptor_table_size; i++) {
-               if (!(CPLB_LOCK & icplb_table[i][1])) {
-                       debug("adding %02i %02i 0x%08x 0x%08x\n", i, j,
-                                icplb_table[i][0], icplb_table[i][1]);
-                       *I0++ = icplb_table[i][0];
-                       *I1++ = icplb_table[i][1];
-                       j++;
-                       if (j == 16) {
-                               break;
-                       }
-               }
-       }
-
-       /* Fill the rest with invalid entry */
-       if (j <= 15) {
-               for (; j < 16; j++) {
-                       debug("filling %i with 0", j);
-                       *I1++ = 0x0;
-               }
-
-       }
-
-       SSYNC();
-       asm(" .align 8; ");
-       *(unsigned int *)IMEM_CONTROL = IMC | ENICPLB;
-       SSYNC();
-}
-
-void icache_disable(void)
-{
-       SSYNC();
-       asm(" .align 8; ");
-       *(unsigned int *)IMEM_CONTROL &= ~(IMC | ENICPLB);
-       SSYNC();
-}
-
-int icache_status(void)
-{
-       unsigned int value;
-       value = *(unsigned int *)IMEM_CONTROL;
-
-       if (value & (IMC | ENICPLB))
-               return CACHE_ON;
-       else
-               return CACHE_OFF;
-}
-
-void dcache_enable(void)
-{
-       unsigned int *I0, *I1;
-       unsigned int temp;
-       int i, j = 0;
-
-       /* Before enable dcache, disable it first */
-       dcache_disable();
-       I0 = (unsigned int *)DCPLB_ADDR0;
-       I1 = (unsigned int *)DCPLB_DATA0;
-
-       /* make sure the locked ones go in first */
-       for (i = 0; i < page_descriptor_table_size; i++) {
-               if (CPLB_LOCK & dcplb_table[i][1]) {
-                       debug("adding %02i %02i 0x%08x 0x%08x\n", i, j,
-                                dcplb_table[i][0], dcplb_table[i][1]);
-                       *I0++ = dcplb_table[i][0];
-                       *I1++ = dcplb_table[i][1];
-                       j++;
-               } else {
-                       debug("skip   %02i %02i 0x%08x 0x%08x\n", i, j,
-                                dcplb_table[i][0], dcplb_table[i][1]);
-               }
-       }
-
-       for (i = 0; i < page_descriptor_table_size; i++) {
-               if (!(CPLB_LOCK & dcplb_table[i][1])) {
-                       debug("adding %02i %02i 0x%08x 0x%08x\n", i, j,
-                                dcplb_table[i][0], dcplb_table[i][1]);
-                       *I0++ = dcplb_table[i][0];
-                       *I1++ = dcplb_table[i][1];
-                       j++;
-                       if (j == 16) {
-                               break;
-                       }
-               }
-       }
-
-       /* Fill the rest with invalid entry */
-       if (j <= 15) {
-               for (; j < 16; j++) {
-                       debug("filling %i with 0", j);
-                       *I1++ = 0x0;
-               }
-       }
-
-       temp = *(unsigned int *)DMEM_CONTROL;
-       SSYNC();
-       asm(" .align 8; ");
-       *(unsigned int *)DMEM_CONTROL =
-           ACACHE_BCACHE | ENDCPLB | PORT_PREF0 | temp;
-       SSYNC();
-}
-
-void dcache_disable(void)
-{
-       unsigned int *I0, *I1;
-       int i;
-
-       SSYNC();
-       asm(" .align 8; ");
-       *(unsigned int *)DMEM_CONTROL &=
-           ~(ACACHE_BCACHE | ENDCPLB | PORT_PREF0);
-       SSYNC();
-
-       /* after disable dcache,
-        * clear it so we don't confuse the next application
-        */
-       I0 = (unsigned int *)DCPLB_ADDR0;
-       I1 = (unsigned int *)DCPLB_DATA0;
-
-       for (i = 0; i < 16; i++) {
-               *I0++ = 0x0;
-               *I1++ = 0x0;
-       }
-}
-
-int dcache_status(void)
-{
-       unsigned int value;
-       value = *(unsigned int *)DMEM_CONTROL;
-       if (value & (ENDCPLB))
-               return CACHE_ON;
-       else
-               return CACHE_OFF;
-}
diff --git a/cpu/bf533/cpu.h b/cpu/bf533/cpu.h
deleted file mode 100644 (file)
index b6b73b1..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- *  U-boot - cpu.h
- *
- *  Copyright (c) 2005-2007 Analog Devices 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., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
- */
-
-#ifndef _CPU_H_
-#define _CPU_H_
-
-#include <command.h>
-
-#define INTERNAL_IRQS (32)
-#define NUM_IRQ_NODES 16
-#define DEF_INTERRUPT_FLAGS 1
-#define MAX_TIM_LOAD   0xFFFFFFFF
-
-void blackfin_irq_panic(int reason, struct pt_regs *reg);
-extern void dump(struct pt_regs *regs);
-void display_excp(void);
-asmlinkage void evt_nmi(void);
-asmlinkage void evt_exception(void);
-asmlinkage void trap(void);
-asmlinkage void evt_ivhw(void);
-asmlinkage void evt_rst(void);
-asmlinkage void evt_timer(void);
-asmlinkage void evt_evt7(void);
-asmlinkage void evt_evt8(void);
-asmlinkage void evt_evt9(void);
-asmlinkage void evt_evt10(void);
-asmlinkage void evt_evt11(void);
-asmlinkage void evt_evt12(void);
-asmlinkage void evt_evt13(void);
-asmlinkage void evt_soft_int1(void);
-asmlinkage void evt_system_call(void);
-void blackfin_irq_panic(int reason, struct pt_regs *regs);
-void blackfin_free_irq(unsigned int irq, void *dev_id);
-void call_isr(int irq, struct pt_regs *fp);
-void blackfin_do_irq(int vec, struct pt_regs *fp);
-void blackfin_init_IRQ(void);
-void blackfin_enable_irq(unsigned int irq);
-void blackfin_disable_irq(unsigned int irq);
-extern int do_reset(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]);
-int blackfin_request_irq(unsigned int irq,
-                        void (*handler) (int, void *, struct pt_regs *),
-                        unsigned long flags, const char *devname,
-                        void *dev_id);
-void timer_init(void);
-#endif
diff --git a/cpu/bf533/flush.S b/cpu/bf533/flush.S
deleted file mode 100644 (file)
index 62e3d65..0000000
+++ /dev/null
@@ -1,405 +0,0 @@
-/* Copyright (C) 2003-2007 Analog Devices Inc.
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.
- */
-
-#define ASSEMBLY
-
-#include <asm/linkage.h>
-#include <asm/cplb.h>
-#include <config.h>
-#include <asm/blackfin.h>
-
-.text
-
-/* This is an external function being called by the user
- * application through __flush_cache_all. Currently this function
- * serves the purpose of flushing all the pending writes in
- * in the instruction cache.
- */
-
-ENTRY(_flush_instruction_cache)
-       [--SP] = ( R7:6, P5:4 );
-       LINK 12;
-       SP += -12;
-       P5.H = (ICPLB_ADDR0 >> 16);
-       P5.L = (ICPLB_ADDR0 & 0xFFFF);
-       P4.H = (ICPLB_DATA0 >> 16);
-       P4.L = (ICPLB_DATA0 & 0xFFFF);
-       R7 = CPLB_VALID | CPLB_L1_CHBL;
-       R6 = 16;
-inext: R0 = [P5++];
-       R1 = [P4++];
-       [--SP] =  RETS;
-       CALL _icplb_flush;      /* R0 = page, R1 = data*/
-       RETS = [SP++];
-iskip: R6 += -1;
-       CC = R6;
-       IF CC JUMP inext;
-       SSYNC;
-       SP += 12;
-       UNLINK;
-       ( R7:6, P5:4 ) = [SP++];
-       RTS;
-
-/* This is an internal function to flush all pending
- * writes in the cache associated with a particular ICPLB.
- *
- * R0 -  page's start address
- * R1 -  CPLB's data field.
- */
-
-.align 2
-ENTRY(_icplb_flush)
-       [--SP] = ( R7:0, P5:0 );
-       [--SP] = LC0;
-       [--SP] = LT0;
-       [--SP] = LB0;
-       [--SP] = LC1;
-       [--SP] = LT1;
-       [--SP] = LB1;
-
-       /* If it's a 1K or 4K page, then it's quickest to
-        * just systematically flush all the addresses in
-        * the page, regardless of whether they're in the
-        * cache, or dirty. If it's a 1M or 4M page, there
-        * are too many addresses, and we have to search the
-        * cache for lines corresponding to the page.
-        */
-
-       CC = BITTST(R1, 17);    /* 1MB or 4MB */
-       IF !CC JUMP iflush_whole_page;
-
-       /* We're only interested in the page's size, so extract
-        * this from the CPLB (bits 17:16), and scale to give an
-        * offset into the page_size and page_prefix tables.
-        */
-
-       R1 <<= 14;
-       R1 >>= 30;
-       R1 <<= 2;
-
-       /* We can also determine the sub-bank used, because this is
-        * taken from bits 13:12 of the address.
-        */
-
-       R3 = ((12<<8)|2);               /* Extraction pattern */
-       nop;                            /* Anamoly 05000209 */
-       R4 = EXTRACT(R0, R3.L) (Z);     /* Extract bits */
-
-       /* Save in extraction pattern for later deposit. */
-       R3.H = R4.L << 0;
-
-       /* So:
-        * R0 = Page start
-        * R1 = Page length (actually, offset into size/prefix tables)
-        * R3 = sub-bank deposit values
-        *
-        * The cache has 2 Ways, and 64 sets, so we iterate through
-        * the sets, accessing the tag for each Way, for our Bank and
-        * sub-bank, looking for dirty, valid tags that match our
-        * address prefix.
-        */
-
-       P5.L = (ITEST_COMMAND & 0xFFFF);
-       P5.H = (ITEST_COMMAND >> 16);
-       P4.L = (ITEST_DATA0 & 0xFFFF);
-       P4.H = (ITEST_DATA0 >> 16);
-
-       P0.L = page_prefix_table;
-       P0.H = page_prefix_table;
-       P1 = R1;
-       R5 = 0;                 /* Set counter*/
-       P0 = P1 + P0;
-       R4 = [P0];              /* This is the address prefix*/
-
-       /* We're reading (bit 1==0) the tag (bit 2==0), and we
-        * don't care about which double-word, since we're only
-        * fetching tags, so we only have to set Set, Bank,
-        * Sub-bank and Way.
-        */
-
-       P2 = 4;
-       LSETUP (ifs1, ife1) LC1 = P2;
-ifs1:  P0 = 32;                /* iterate over all sets*/
-       LSETUP (ifs0, ife0) LC0 = P0;
-ifs0:  R6 = R5 << 5;           /* Combine set*/
-       R6.H = R3.H << 0 ;      /* and sub-bank*/
-       [P5] = R6;              /* Issue Command*/
-       SSYNC;                  /* CSYNC will not work here :(*/
-       R7 = [P4];              /* and read Tag.*/
-       CC = BITTST(R7, 0);     /* Check if valid*/
-       IF !CC JUMP ifskip;     /* and skip if not.*/
-
-       /* Compare against the page address. First, plant bits 13:12
-        * into the tag, since those aren't part of the returned data.
-        */
-
-       R7 = DEPOSIT(R7, R3);   /* set 13:12*/
-       R1 = R7 & R4;           /* Mask off lower bits*/
-       CC = R1 == R0;          /* Compare against page start.*/
-       IF !CC JUMP ifskip;     /* Skip it if it doesn't match.*/
-
-       /* Tag address matches against page, so this is an entry
-        * we must flush.
-        */
-
-       R7 >>= 10;              /* Mask off the non-address bits*/
-       R7 <<= 10;
-       P3 = R7;
-       IFLUSH [P3];            /* And flush the entry*/
-ifskip:
-ife0:  R5 += 1;                /* Advance to next Set*/
-ife1:  NOP;
-
-ifinished:
-       SSYNC;                  /* Ensure the data gets out to mem.*/
-
-       /*Finished. Restore context.*/
-       LB1 = [SP++];
-       LT1 = [SP++];
-       LC1 = [SP++];
-       LB0 = [SP++];
-       LT0 = [SP++];
-       LC0 = [SP++];
-       ( R7:0, P5:0 ) = [SP++];
-       RTS;
-
-iflush_whole_page:
-       /* It's a 1K or 4K page, so quicker to just flush the
-        * entire page.
-        */
-
-       P1 = 32;                /* For 1K pages*/
-       P2 = P1 << 2;           /* For 4K pages*/
-       P0 = R0;                /* Start of page*/
-       CC = BITTST(R1, 16);    /* Whether 1K or 4K*/
-       IF CC P1 = P2;
-       P1 += -1;               /* Unroll one iteration*/
-       SSYNC;
-       IFLUSH [P0++];          /* because CSYNC can't end loops.*/
-       LSETUP (isall, ieall) LC0 = P1;
-isall:
-       IFLUSH [P0++];
-ieall:
-       NOP;
-       SSYNC;
-       JUMP ifinished;
-
-/* This is an external function being called by the user
- * application through __flush_cache_all. Currently this function
- * serves the purpose of flushing all the pending writes in
- * in the data cache.
- */
-
-ENTRY(_flush_data_cache)
-       [--SP] = ( R7:6, P5:4 );
-       LINK 12;
-       SP += -12;
-       P5.H = (DCPLB_ADDR0 >> 16);
-       P5.L = (DCPLB_ADDR0 & 0xFFFF);
-       P4.H = (DCPLB_DATA0 >> 16);
-       P4.L = (DCPLB_DATA0 & 0xFFFF);
-       R7 = CPLB_VALID | CPLB_L1_CHBL | CPLB_DIRTY (Z);
-       R6 = 16;
-next:  R0 = [P5++];
-       R1 = [P4++];
-       CC = BITTST(R1, 14);    /* Is it write-through?*/
-       IF CC JUMP skip;        /* If so, ignore it.*/
-       R2 = R1 & R7;           /* Is it a dirty, cached page?*/
-       CC = R2;
-       IF !CC JUMP skip;       /* If not, ignore it.*/
-       [--SP] = RETS;
-       CALL _dcplb_flush;      /* R0 = page, R1 = data*/
-       RETS = [SP++];
-skip:  R6 += -1;
-       CC = R6;
-       IF CC JUMP next;
-       SSYNC;
-       SP += 12;
-       UNLINK;
-       ( R7:6, P5:4 ) = [SP++];
-       RTS;
-
-/* This is an internal function to flush all pending
- * writes in the cache associated with a particular DCPLB.
- *
- * R0 -  page's start address
- * R1 -  CPLB's data field.
- */
-
-.align 2
-ENTRY(_dcplb_flush)
-       [--SP] = ( R7:0, P5:0 );
-       [--SP] = LC0;
-       [--SP] = LT0;
-       [--SP] = LB0;
-       [--SP] = LC1;
-       [--SP] = LT1;
-       [--SP] = LB1;
-
-       /* If it's a 1K or 4K page, then it's quickest to
-        * just systematically flush all the addresses in
-        * the page, regardless of whether they're in the
-        * cache, or dirty. If it's a 1M or 4M page, there
-        * are too many addresses, and we have to search the
-        * cache for lines corresponding to the page.
-        */
-
-       CC = BITTST(R1, 17);    /* 1MB or 4MB */
-       IF !CC JUMP dflush_whole_page;
-
-       /* We're only interested in the page's size, so extract
-        * this from the CPLB (bits 17:16), and scale to give an
-        * offset into the page_size and page_prefix tables.
-        */
-
-       R1 <<= 14;
-       R1 >>= 30;
-       R1 <<= 2;
-
-       /* The page could be mapped into Bank A or Bank B, depending
-        * on (a) whether both banks are configured as cache, and
-        * (b) on whether address bit A[x] is set. x is determined
-        * by DCBS in DMEM_CONTROL
-        */
-
-       R2 = 0;                 /* Default to Bank A (Bank B would be 1)*/
-
-       P0.L = (DMEM_CONTROL & 0xFFFF);
-       P0.H = (DMEM_CONTROL >> 16);
-
-       R3 = [P0];              /* If Bank B is not enabled as cache*/
-       CC = BITTST(R3, 2);     /* then Bank A is our only option.*/
-       IF CC JUMP bank_chosen;
-
-       R4 = 1<<14;             /* If DCBS==0, use A[14].*/
-       R5 = R4 << 7;           /* If DCBS==1, use A[23];*/
-       CC = BITTST(R3, 4);
-       IF CC R4 = R5;          /* R4 now has either bit 14 or bit 23 set.*/
-       R5 = R0 & R4;           /* Use it to test the Page address*/
-       CC = R5;                /* and if that bit is set, we use Bank B,*/
-       R2 = CC;                /* else we use Bank A.*/
-       R2 <<= 23;              /* The Bank selection's at posn 23.*/
-
-bank_chosen:
-
-       /* We can also determine the sub-bank used, because this is
-        * taken from bits 13:12 of the address.
-        */
-
-       R3 = ((12<<8)|2);               /* Extraction pattern */
-       nop;                            /*Anamoly 05000209*/
-       R4 = EXTRACT(R0, R3.L) (Z);     /* Extract bits*/
-       /* Save in extraction pattern for later deposit.*/
-       R3.H = R4.L << 0;
-
-       /* So:
-        * R0 = Page start
-        * R1 = Page length (actually, offset into size/prefix tables)
-        * R2 = Bank select mask
-        * R3 = sub-bank deposit values
-        *
-        * The cache has 2 Ways, and 64 sets, so we iterate through
-        * the sets, accessing the tag for each Way, for our Bank and
-        * sub-bank, looking for dirty, valid tags that match our
-        * address prefix.
-        */
-
-       P5.L = (DTEST_COMMAND & 0xFFFF);
-       P5.H = (DTEST_COMMAND >> 16);
-       P4.L = (DTEST_DATA0 & 0xFFFF);
-       P4.H = (DTEST_DATA0 >> 16);
-
-       P0.L = page_prefix_table;
-       P0.H = page_prefix_table;
-       P1 = R1;
-       R5 = 0;                 /* Set counter*/
-       P0 = P1 + P0;
-       R4 = [P0];              /* This is the address prefix*/
-
-
-       /* We're reading (bit 1==0) the tag (bit 2==0), and we
-        * don't care about which double-word, since we're only
-        * fetching tags, so we only have to set Set, Bank,
-        * Sub-bank and Way.
-        */
-
-       P2 = 2;
-       LSETUP (fs1, fe1) LC1 = P2;
-fs1:   P0 = 64;                /* iterate over all sets*/
-       LSETUP (fs0, fe0) LC0 = P0;
-fs0:   R6 = R5 << 5;           /* Combine set*/
-       R6.H = R3.H << 0 ;      /* and sub-bank*/
-       R6 = R6 | R2;           /* and Bank. Leave Way==0 at first.*/
-       BITSET(R6,14);
-       [P5] = R6;              /* Issue Command*/
-       SSYNC;
-       R7 = [P4];              /* and read Tag.*/
-       CC = BITTST(R7, 0);     /* Check if valid*/
-       IF !CC JUMP fskip;      /* and skip if not.*/
-       CC = BITTST(R7, 1);     /* Check if dirty*/
-       IF !CC JUMP fskip;      /* and skip if not.*/
-
-       /* Compare against the page address. First, plant bits 13:12
-        * into the tag, since those aren't part of the returned data.
-        */
-
-       R7 = DEPOSIT(R7, R3);   /* set 13:12*/
-       R1 = R7 & R4;           /* Mask off lower bits*/
-       CC = R1 == R0;          /* Compare against page start.*/
-       IF !CC JUMP fskip;      /* Skip it if it doesn't match.*/
-
-       /* Tag address matches against page, so this is an entry
-        * we must flush.
-        */
-
-       R7 >>= 10;              /* Mask off the non-address bits*/
-       R7 <<= 10;
-       P3 = R7;
-       SSYNC;
-       FLUSHINV [P3];          /* And flush the entry*/
-fskip:
-fe0:   R5 += 1;                /* Advance to next Set*/
-fe1:   BITSET(R2, 26);         /* Go to next Way.*/
-
-dfinished:
-       SSYNC;                  /* Ensure the data gets out to mem.*/
-
-       /*Finished. Restore context.*/
-       LB1 = [SP++];
-       LT1 = [SP++];
-       LC1 = [SP++];
-       LB0 = [SP++];
-       LT0 = [SP++];
-       LC0 = [SP++];
-       ( R7:0, P5:0 ) = [SP++];
-       RTS;
-
-dflush_whole_page:
-
-       /* It's a 1K or 4K page, so quicker to just flush the
-        * entire page.
-        */
-
-       P1 = 32;                /* For 1K pages*/
-       P2 = P1 << 2;           /* For 4K pages*/
-       P0 = R0;                /* Start of page*/
-       CC = BITTST(R1, 16);    /* Whether 1K or 4K*/
-       IF CC P1 = P2;
-       P1 += -1;               /* Unroll one iteration*/
-       SSYNC;
-       FLUSHINV [P0++];        /* because CSYNC can't end loops.*/
-       LSETUP (eall, eall) LC0 = P1;
-eall:  FLUSHINV [P0++];
-       SSYNC;
-       JUMP dfinished;
-
-.align 4;
-page_prefix_table:
-.byte4         0xFFFFFC00;     /* 1K */
-.byte4 0xFFFFF000;     /* 4K */
-.byte4 0xFFF00000;     /* 1M */
-.byte4 0xFFC00000;     /* 4M */
-.page_prefix_table.end:
diff --git a/cpu/bf533/init_sdram.S b/cpu/bf533/init_sdram.S
deleted file mode 100644 (file)
index 67a99e4..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-#define ASSEMBLY
-
-#include <linux/config.h>
-#include <config.h>
-#include <asm/blackfin.h>
-#include <asm/mem_init.h>
-#include <asm/mach-common/bits/bootrom.h>
-#include <asm/mach-common/bits/ebiu.h>
-#include <asm/mach-common/bits/pll.h>
-#include <asm/mach-common/bits/uart.h>
-.global init_sdram;
-
-#if (CONFIG_CCLK_DIV == 1)
-#define CONFIG_CCLK_ACT_DIV   CCLK_DIV1
-#endif
-#if (CONFIG_CCLK_DIV == 2)
-#define CONFIG_CCLK_ACT_DIV   CCLK_DIV2
-#endif
-#if (CONFIG_CCLK_DIV == 4)
-#define CONFIG_CCLK_ACT_DIV   CCLK_DIV4
-#endif
-#if (CONFIG_CCLK_DIV == 8)
-#define CONFIG_CCLK_ACT_DIV   CCLK_DIV8
-#endif
-#ifndef CONFIG_CCLK_ACT_DIV
-#define CONFIG_CCLK_ACT_DIV   CONFIG_CCLK_DIV_not_defined_properly
-#endif
-
-init_sdram:
-       [--SP] = ASTAT;
-       [--SP] = RETS;
-       [--SP] = (R7:0);
-       [--SP] = (P5:0);
-
-#if (BFIN_BOOT_MODE == BF533_SPI_BOOT)
-       p0.h = hi(SPI_BAUD);
-       p0.l = lo(SPI_BAUD);
-       r0.l = CONFIG_SPI_BAUD;
-       w[p0] = r0.l;
-       SSYNC;
-#endif
-
-       /*
-        * PLL_LOCKCNT - how many SCLK Cycles to delay while PLL becomes stable
-        */
-       p0.h = hi(PLL_LOCKCNT);
-       p0.l = lo(PLL_LOCKCNT);
-       r0 = 0x300(Z);
-       w[p0] = r0.l;
-       ssync;
-
-       /*
-        * Put SDRAM in self-refresh, incase anything is running
-        */
-       P2.H = hi(EBIU_SDGCTL);
-       P2.L = lo(EBIU_SDGCTL);
-       R0 = [P2];
-       BITSET (R0, 24);
-       [P2] = R0;
-       SSYNC;
-
-       /*
-        *  Set PLL_CTL with the value that we calculate in R0
-        *   - [14:09] = MSEL[5:0] : CLKIN / VCO multiplication factors
-        *   - [8]     = BYPASS    : BYPASS the PLL, run CLKIN into CCLK/SCLK
-        *   - [7]     = output delay (add 200ps of delay to mem signals)
-        *   - [6]     = input delay (add 200ps of input delay to mem signals)
-        *   - [5]     = PDWN      : 1=All Clocks off
-        *   - [3]     = STOPCK    : 1=Core Clock off
-        *   - [1]     = PLL_OFF   : 1=Disable Power to PLL
-        *   - [0]     = DF        : 1=Pass CLKIN/2 to PLL / 0=Pass CLKIN to PLL
-        *   all other bits set to zero
-        */
-
-       r0 = CONFIG_VCO_MULT & 63;      /* Load the VCO multiplier         */
-       r0 = r0 << 9;                   /* Shift it over,                  */
-       r1 = CONFIG_CLKIN_HALF;         /* Do we need to divide CLKIN by 2?*/
-       r0 = r1 | r0;
-       r1 = CONFIG_PLL_BYPASS;         /* Bypass the PLL?                 */
-       r1 = r1 << 8;                   /* Shift it over                   */
-       r0 = r1 | r0;                   /* add them all together           */
-
-       p0.h = hi(PLL_CTL);
-       p0.l = lo(PLL_CTL);             /* Load the address                */
-       cli r2;                         /* Disable interrupts              */
-       ssync;
-       w[p0] = r0.l;                   /* Set the value                   */
-       idle;                           /* Wait for the PLL to stablize    */
-       sti r2;                         /* Enable interrupts               */
-
-check_again:
-       p0.h = hi(PLL_STAT);
-       p0.l = lo(PLL_STAT);
-       R0 = W[P0](Z);
-       CC = BITTST(R0,5);
-       if ! CC jump check_again;
-
-       /* Configure SCLK & CCLK Dividers */
-       r0 = (CONFIG_CCLK_ACT_DIV | CONFIG_SCLK_DIV);
-       p0.h = hi(PLL_DIV);
-       p0.l = lo(PLL_DIV);
-       w[p0] = r0.l;
-       ssync;
-
-       /*
-        * We now are running at speed, time to set the Async mem bank wait states
-        * This will speed up execution, since we are normally running from FLASH.
-        */
-
-       p2.h = (EBIU_AMBCTL1 >> 16);
-       p2.l = (EBIU_AMBCTL1 & 0xFFFF);
-       r0.h = (AMBCTL1VAL >> 16);
-       r0.l = (AMBCTL1VAL & 0xFFFF);
-       [p2] = r0;
-       ssync;
-
-       p2.h = (EBIU_AMBCTL0 >> 16);
-       p2.l = (EBIU_AMBCTL0 & 0xFFFF);
-       r0.h = (AMBCTL0VAL >> 16);
-       r0.l = (AMBCTL0VAL & 0xFFFF);
-       [p2] = r0;
-       ssync;
-
-       p2.h = (EBIU_AMGCTL >> 16);
-       p2.l = (EBIU_AMGCTL & 0xffff);
-       r0 = AMGCTLVAL;
-       w[p2] = r0;
-       ssync;
-
-       /*
-        * Now, Initialize the SDRAM,
-        * start with the SDRAM Refresh Rate Control Register
-        */
-       p0.l = lo(EBIU_SDRRC);
-       p0.h = hi(EBIU_SDRRC);
-       r0 = mem_SDRRC;
-       w[p0] = r0.l;
-       ssync;
-
-       /*
-        * SDRAM Memory Bank Control Register - bank specific parameters
-        */
-       p0.l = (EBIU_SDBCTL & 0xFFFF);
-       p0.h = (EBIU_SDBCTL >> 16);
-       r0 = mem_SDBCTL;
-       w[p0] = r0.l;
-       ssync;
-
-       /*
-        * SDRAM Global Control Register - global programmable parameters
-        * Disable self-refresh
-        */
-       P2.H = hi(EBIU_SDGCTL);
-       P2.L = lo(EBIU_SDGCTL);
-       R0 = [P2];
-       BITCLR (R0, 24);
-
-       /*
-        * Check if SDRAM is already powered up, if it is, enable self-refresh
-        */
-       p0.h = hi(EBIU_SDSTAT);
-       p0.l = lo(EBIU_SDSTAT);
-       r2.l = w[p0];
-       cc = bittst(r2,3);
-       if !cc jump skip;
-       NOP;
-       BITSET (R0, 23);
-skip:
-       [P2] = R0;
-       SSYNC;
-
-       /* Write in the new value in the register */
-       R0.L = lo(mem_SDGCTL);
-       R0.H = hi(mem_SDGCTL);
-       [P2] = R0;
-       SSYNC;
-       nop;
-
-       (P5:0) = [SP++];
-       (R7:0) = [SP++];
-       RETS   = [SP++];
-       ASTAT  = [SP++];
-       RTS;
diff --git a/cpu/bf533/init_sdram_bootrom_initblock.S b/cpu/bf533/init_sdram_bootrom_initblock.S
deleted file mode 100644 (file)
index 8694ca2..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-#define ASSEMBLY
-
-#include <linux/config.h>
-#include <config.h>
-#include <asm/blackfin.h>
-#include <asm/mem_init.h>
-#include <asm/mach-common/bits/bootrom.h>
-#include <asm/mach-common/bits/ebiu.h>
-#include <asm/mach-common/bits/pll.h>
-#include <asm/mach-common/bits/uart.h>
-.global init_sdram;
-
-#if (CONFIG_CCLK_DIV == 1)
-#define CONFIG_CCLK_ACT_DIV   CCLK_DIV1
-#endif
-#if (CONFIG_CCLK_DIV == 2)
-#define CONFIG_CCLK_ACT_DIV   CCLK_DIV2
-#endif
-#if (CONFIG_CCLK_DIV == 4)
-#define CONFIG_CCLK_ACT_DIV   CCLK_DIV4
-#endif
-#if (CONFIG_CCLK_DIV == 8)
-#define CONFIG_CCLK_ACT_DIV   CCLK_DIV8
-#endif
-#ifndef CONFIG_CCLK_ACT_DIV
-#define CONFIG_CCLK_ACT_DIV   CONFIG_CCLK_DIV_not_defined_properly
-#endif
-
-init_sdram:
-       [--SP] = ASTAT;
-       [--SP] = RETS;
-       [--SP] = (R7:0);
-       [--SP] = (P5:0);
-
-#if (BFIN_BOOT_MODE == BF533_SPI_BOOT)
-       p0.h = hi(SPI_BAUD);
-       p0.l = lo(SPI_BAUD);
-       r0.l = CONFIG_SPI_BAUD_INITBLOCK;
-       w[p0] = r0.l;
-       SSYNC;
-#endif
-
-       /*
-        * PLL_LOCKCNT - how many SCLK Cycles to delay while PLL becomes stable
-        */
-       p0.h = hi(PLL_LOCKCNT);
-       p0.l = lo(PLL_LOCKCNT);
-       r0 = 0x300(Z);
-       w[p0] = r0.l;
-       ssync;
-
-       /*
-        * Put SDRAM in self-refresh, incase anything is running
-        */
-       P2.H = hi(EBIU_SDGCTL);
-       P2.L = lo(EBIU_SDGCTL);
-       R0 = [P2];
-       BITSET (R0, 24);
-       [P2] = R0;
-       SSYNC;
-
-       /*
-        *  Set PLL_CTL with the value that we calculate in R0
-        *   - [14:09] = MSEL[5:0] : CLKIN / VCO multiplication factors
-        *   - [8]     = BYPASS    : BYPASS the PLL, run CLKIN into CCLK/SCLK
-        *   - [7]     = output delay (add 200ps of delay to mem signals)
-        *   - [6]     = input delay (add 200ps of input delay to mem signals)
-        *   - [5]     = PDWN      : 1=All Clocks off
-        *   - [3]     = STOPCK    : 1=Core Clock off
-        *   - [1]     = PLL_OFF   : 1=Disable Power to PLL
-        *   - [0]     = DF        : 1=Pass CLKIN/2 to PLL / 0=Pass CLKIN to PLL
-        *   all other bits set to zero
-        */
-
-       r0 = CONFIG_VCO_MULT & 63;      /* Load the VCO multiplier         */
-       r0 = r0 << 9;                   /* Shift it over,                  */
-       r1 = CONFIG_CLKIN_HALF;         /* Do we need to divide CLKIN by 2?*/
-       r0 = r1 | r0;
-       r1 = CONFIG_PLL_BYPASS;         /* Bypass the PLL?                 */
-       r1 = r1 << 8;                   /* Shift it over                   */
-       r0 = r1 | r0;                   /* add them all together           */
-
-       p0.h = hi(PLL_CTL);
-       p0.l = lo(PLL_CTL);             /* Load the address                */
-       cli r2;                         /* Disable interrupts              */
-       ssync;
-       w[p0] = r0.l;                   /* Set the value                   */
-       idle;                           /* Wait for the PLL to stablize    */
-       sti r2;                         /* Enable interrupts               */
-
-check_again:
-       p0.h = hi(PLL_STAT);
-       p0.l = lo(PLL_STAT);
-       R0 = W[P0](Z);
-       CC = BITTST(R0,5);
-       if ! CC jump check_again;
-
-       /* Configure SCLK & CCLK Dividers */
-       r0 = (CONFIG_CCLK_ACT_DIV | CONFIG_SCLK_DIV);
-       p0.h = hi(PLL_DIV);
-       p0.l = lo(PLL_DIV);
-       w[p0] = r0.l;
-       ssync;
-
-       /*
-        * We now are running at speed, time to set the Async mem bank wait states
-        * This will speed up execution, since we are normally running from FLASH.
-        */
-
-       p2.h = (EBIU_AMBCTL1 >> 16);
-       p2.l = (EBIU_AMBCTL1 & 0xFFFF);
-       r0.h = (AMBCTL1VAL >> 16);
-       r0.l = (AMBCTL1VAL & 0xFFFF);
-       [p2] = r0;
-       ssync;
-
-       p2.h = (EBIU_AMBCTL0 >> 16);
-       p2.l = (EBIU_AMBCTL0 & 0xFFFF);
-       r0.h = (AMBCTL0VAL >> 16);
-       r0.l = (AMBCTL0VAL & 0xFFFF);
-       [p2] = r0;
-       ssync;
-
-       p2.h = (EBIU_AMGCTL >> 16);
-       p2.l = (EBIU_AMGCTL & 0xffff);
-       r0 = AMGCTLVAL;
-       w[p2] = r0;
-       ssync;
-
-       /*
-        * Now, Initialize the SDRAM,
-        * start with the SDRAM Refresh Rate Control Register
-        */
-       p0.l = lo(EBIU_SDRRC);
-       p0.h = hi(EBIU_SDRRC);
-       r0 = mem_SDRRC;
-       w[p0] = r0.l;
-       ssync;
-
-       /*
-        * SDRAM Memory Bank Control Register - bank specific parameters
-        */
-       p0.l = (EBIU_SDBCTL & 0xFFFF);
-       p0.h = (EBIU_SDBCTL >> 16);
-       r0 = mem_SDBCTL;
-       w[p0] = r0.l;
-       ssync;
-
-       /*
-        * SDRAM Global Control Register - global programmable parameters
-        * Disable self-refresh
-        */
-       P2.H = hi(EBIU_SDGCTL);
-       P2.L = lo(EBIU_SDGCTL);
-       R0 = [P2];
-       BITCLR (R0, 24);
-
-       /*
-        * Check if SDRAM is already powered up, if it is, enable self-refresh
-        */
-       p0.h = hi(EBIU_SDSTAT);
-       p0.l = lo(EBIU_SDSTAT);
-       r2.l = w[p0];
-       cc = bittst(r2,3);
-       if !cc jump skip;
-       NOP;
-       BITSET (R0, 23);
-skip:
-       [P2] = R0;
-       SSYNC;
-
-       /* Write in the new value in the register */
-       R0.L = lo(mem_SDGCTL);
-       R0.H = hi(mem_SDGCTL);
-       [P2] = R0;
-       SSYNC;
-       nop;
-
-       (P5:0) = [SP++];
-       (R7:0) = [SP++];
-       RETS   = [SP++];
-       ASTAT  = [SP++];
-       RTS;
diff --git a/cpu/bf533/interrupt.S b/cpu/bf533/interrupt.S
deleted file mode 100644 (file)
index 7556ec9..0000000
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- * U-boot - interrupt.S Processing of interrupts and exception handling
- *
- * Copyright (c) 2005-2007 Analog Devices Inc.
- *
- * (C) Copyright 2000-2004
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * This file is based on interrupt.S
- *
- * Copyright (C) 2003  Metrowerks, Inc. <mwaddel@metrowerks.com>
- * Copyright (C) 2002  Arcturus Networks Ltd. Ted Ma <mated@sympatico.ca>
- * Copyright (C) 1998  D. Jeff Dionne <jeff@ryeham.ee.ryerson.ca>,
- *                     Kenneth Albanowski <kjahds@kjahds.com>,
- *                     The Silver Hammer Group, Ltd.
- *
- * (c) 1995, Dionne & Associates
- * (c) 1995, DKG Display Tech.
- *
- * This file is also based on exception.asm
- * (C) Copyright 2001-2005 - Analog Devices, 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., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
- */
-
-#define ASSEMBLY
-#include <config.h>
-#include <asm/blackfin.h>
-#include <asm/entry.h>
-
-.global _blackfin_irq_panic;
-
-.text
-.align 2
-
-#ifndef CONFIG_KGDB
-.global _evt_emulation
-_evt_emulation:
-       SAVE_CONTEXT
-       r0 = 0;
-       r1 = seqstat;
-       sp += -12;
-       call _blackfin_irq_panic;
-       sp += 12;
-       rte;
-#endif
-
-.global _evt_nmi
-_evt_nmi:
-       SAVE_CONTEXT
-       r0 = 2;
-       r1 = RETN;
-       sp += -12;
-       call _blackfin_irq_panic;
-       sp += 12;
-
-_evt_nmi_exit:
-       rtn;
-
-.global _trap
-_trap:
-       SAVE_ALL_SYS
-       r0 = sp;        /* stack frame pt_regs pointer argument ==> r0 */
-       sp += -12;
-       call _trap_c
-       sp += 12;
-       RESTORE_ALL_SYS
-       rtx;
-
-.global _evt_rst
-_evt_rst:
-       SAVE_CONTEXT
-       r0 = 1;
-       r1 = RETN;
-       sp += -12;
-       call _do_reset;
-       sp += 12;
-
-_evt_rst_exit:
-       rtn;
-
-irq_panic:
-       r0 = 3;
-       r1 =  sp;
-       sp += -12;
-       call _blackfin_irq_panic;
-       sp += 12;
-
-.global _evt_ivhw
-_evt_ivhw:
-       SAVE_CONTEXT
-       RAISE 14;
-
-_evt_ivhw_exit:
-        rti;
-
-.global _evt_timer
-_evt_timer:
-       SAVE_CONTEXT
-       r0 = 6;
-       sp += -12;
-       /* Polling method used now. */
-       /* call timer_int; */
-       sp += 12;
-       RESTORE_CONTEXT
-       rti;
-       nop;
-
-.global _evt_evt7
-_evt_evt7:
-       SAVE_CONTEXT
-       r0 = 7;
-       sp += -12;
-       call _process_int;
-       sp += 12;
-
-evt_evt7_exit:
-       RESTORE_CONTEXT
-       rti;
-
-.global _evt_evt8
-_evt_evt8:
-       SAVE_CONTEXT
-       r0 = 8;
-       sp += -12;
-       call _process_int;
-       sp += 12;
-
-evt_evt8_exit:
-       RESTORE_CONTEXT
-       rti;
-
-.global _evt_evt9
-_evt_evt9:
-       SAVE_CONTEXT
-       r0 = 9;
-       sp += -12;
-       call _process_int;
-       sp += 12;
-
-evt_evt9_exit:
-       RESTORE_CONTEXT
-       rti;
-
-.global _evt_evt10
-_evt_evt10:
-       SAVE_CONTEXT
-       r0 = 10;
-       sp += -12;
-       call _process_int;
-       sp += 12;
-
-evt_evt10_exit:
-       RESTORE_CONTEXT
-       rti;
-
-.global _evt_evt11
-_evt_evt11:
-       SAVE_CONTEXT
-       r0 = 11;
-       sp += -12;
-       call _process_int;
-       sp += 12;
-
-evt_evt11_exit:
-       RESTORE_CONTEXT
-       rti;
-
-.global _evt_evt12
-_evt_evt12:
-       SAVE_CONTEXT
-       r0 = 12;
-       sp += -12;
-       call _process_int;
-       sp += 12;
-evt_evt12_exit:
-        RESTORE_CONTEXT
-        rti;
-
-.global _evt_evt13
-_evt_evt13:
-       SAVE_CONTEXT
-       r0 = 13;
-       sp += -12;
-       call _process_int;
-       sp += 12;
-
-evt_evt13_exit:
-        RESTORE_CONTEXT
-        rti;
-
-.global _evt_system_call
-_evt_system_call:
-       [--sp] = r0;
-       [--SP] = RETI;
-       r0 = [sp++];
-       r0 += 2;
-       [--sp] = r0;
-       RETI = [SP++];
-       r0 = [SP++];
-       SAVE_CONTEXT
-       sp += -12;
-       call _exception_handle;
-       sp += 12;
-       RESTORE_CONTEXT
-       RTI;
-
-evt_system_call_exit:
-       rti;
-
-.global _evt_soft_int1
-_evt_soft_int1:
-       [--sp] = r0;
-       [--SP] = RETI;
-       r0 = [sp++];
-       r0 += 2;
-       [--sp] = r0;
-       RETI = [SP++];
-       r0 = [SP++];
-       SAVE_CONTEXT
-       sp += -12;
-       call _exception_handle;
-       sp += 12;
-       RESTORE_CONTEXT
-       RTI;
-
-evt_soft_int1_exit:
-       rti;
diff --git a/cpu/bf533/interrupts.c b/cpu/bf533/interrupts.c
deleted file mode 100644 (file)
index 3d1c3bc..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * U-boot - interrupts.c Interrupt related routines
- *
- * Copyright (c) 2005-2007 Analog Devices Inc.
- *
- * This file is based on interrupts.c
- * Copyright 1996 Roman Zippel
- * Copyright 1999 D. Jeff Dionne <jeff@uclinux.org>
- * Copyright 2000-2001 Lineo, Inc. D. Jefff Dionne <jeff@lineo.ca>
- * Copyright 2002 Arcturus Networks Inc. MaTed <mated@sympatico.ca>
- * Copyright 2003 Metrowerks/Motorola
- * Copyright 2003 Bas Vermeulen <bas@buyways.nl>,
- *                     BuyWays B.V. (www.buyways.nl)
- *
- * (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 "cpu.h"
-
-static ulong timestamp;
-static ulong last_time;
-static int int_flag;
-
-int irq_flags;                 /* needed by asm-blackfin/system.h */
-
-/* Functions just to satisfy the linker */
-
-/*
- * This function is derived from PowerPC code (read timebase as long long).
- * On BF533 it just returns the timer value.
- */
-unsigned long long get_ticks(void)
-{
-       return get_timer(0);
-}
-
-/*
- * This function is derived from PowerPC code (timebase clock frequency).
- * On BF533 it returns the number of timer ticks per second.
- */
-ulong get_tbclk(void)
-{
-       ulong tbclk;
-
-       tbclk = CFG_HZ;
-       return tbclk;
-}
-
-void enable_interrupts(void)
-{
-}
-
-int disable_interrupts(void)
-{
-       return 1;
-}
-
-int interrupt_init(void)
-{
-       return (0);
-}
-
-void udelay(unsigned long usec)
-{
-       unsigned long delay, start, stop;
-       unsigned long cclk;
-       cclk = (CONFIG_CCLK_HZ);
-
-       while (usec > 1) {
-               /*
-                * how many clock ticks to delay?
-                *  - request(in useconds) * clock_ticks(Hz) / useconds/second
-                */
-               if (usec < 1000) {
-                       delay = (usec * (cclk / 244)) >> 12;
-                       usec = 0;
-               } else {
-                       delay = (1000 * (cclk / 244)) >> 12;
-                       usec -= 1000;
-               }
-
-               asm volatile (" %0 = CYCLES;":"=r" (start));
-               do {
-                       asm volatile (" %0 = CYCLES; ":"=r" (stop));
-               } while (stop - start < delay);
-       }
-
-       return;
-}
-
-void timer_init(void)
-{
-       *pTCNTL = 0x1;
-       *pTSCALE = 0x0;
-       *pTCOUNT = MAX_TIM_LOAD;
-       *pTPERIOD = MAX_TIM_LOAD;
-       *pTCNTL = 0x7;
-       asm("CSYNC;");
-
-       timestamp = 0;
-       last_time = 0;
-}
-
-/* Any network command or flash
- * command is started get_timer shall
- * be called before TCOUNT gets reset,
- * to implement the accurate timeouts.
- *
- * How ever milliconds doesn't return
- * the number that has been elapsed from
- * the last reset.
- *
- *  As get_timer is used in the u-boot
- *  only for timeouts this should be
- *  sufficient
- */
-ulong get_timer(ulong base)
-{
-       ulong milisec;
-
-       /* Number of clocks elapsed */
-       ulong clocks = (MAX_TIM_LOAD - (*pTCOUNT));
-
-       /**
-        * Find if the TCOUNT is reset
-        * timestamp gives the number of times
-        * TCOUNT got reset
-        */
-       if (clocks < last_time)
-               timestamp++;
-       last_time = clocks;
-
-       /* Get the number of milliseconds */
-       milisec = clocks / (CONFIG_CCLK_HZ / 1000);
-
-       /**
-        * Find the number of millisonds
-        * that got elapsed before this TCOUNT cycle
-        */
-       milisec += timestamp * (MAX_TIM_LOAD / (CONFIG_CCLK_HZ / 1000));
-
-       return (milisec - base);
-}
diff --git a/cpu/bf533/ints.c b/cpu/bf533/ints.c
deleted file mode 100644 (file)
index 05d9a1b..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * U-boot - ints.c Interrupt related routines
- *
- * Copyright (c) 2005-2007 Analog Devices Inc.
- *
- * This file is based on ints.c
- *
- * Apr18 2003, Changed by HuTao to support interrupt cascading for Blackfin
- *             drivers
- *
- * Copyright 1996 Roman Zippel
- * Copyright 1999 D. Jeff Dionne <jeff@uclinux.org>
- * Copyright 2000-2001 Lineo, Inc. D. Jefff Dionne <jeff@lineo.ca>
- * Copyright 2002 Arcturus Networks Inc. MaTed <mated@sympatico.ca>
- * Copyright 2003 Metrowerks/Motorola
- *
- * (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 <linux/stddef.h>
-#include <asm/system.h>
-#include <asm/traps.h>
-#include <asm/io.h>
-#include <asm/errno.h>
-#include <asm/blackfin.h>
-#include "cpu.h"
-
-void blackfin_irq_panic(int reason, struct pt_regs *regs)
-{
-       printf("\n\nException: IRQ 0x%x entered\n", reason);
-       printf("code=[0x%x], ", (unsigned int)(regs->seqstat & 0x3f));
-       printf("stack frame=0x%x, ", (unsigned int)regs);
-       printf("bad PC=0x%04x\n", (unsigned int)regs->pc);
-       dump(regs);
-       printf("Unhandled IRQ or exceptions!\n");
-       printf("Please reset the board \n");
-}
-
-void blackfin_init_IRQ(void)
-{
-       *(unsigned volatile long *)(SIC_IMASK) = 0;
-#ifndef CONFIG_KGDB
-       *(unsigned volatile long *)(EVT1) = 0x0;
-#endif
-       *(unsigned volatile long *)(EVT2) =
-           (unsigned volatile long)evt_nmi;
-       *(unsigned volatile long *)(EVT3) =
-           (unsigned volatile long)trap;
-       *(unsigned volatile long *)(EVT5) =
-           (unsigned volatile long)evt_ivhw;
-       *(unsigned volatile long *)(EVT0) =
-           (unsigned volatile long)evt_rst;
-       *(unsigned volatile long *)(EVT6) =
-           (unsigned volatile long)evt_timer;
-       *(unsigned volatile long *)(EVT7) =
-           (unsigned volatile long)evt_evt7;
-       *(unsigned volatile long *)(EVT8) =
-           (unsigned volatile long)evt_evt8;
-       *(unsigned volatile long *)(EVT9) =
-           (unsigned volatile long)evt_evt9;
-       *(unsigned volatile long *)(EVT10) =
-           (unsigned volatile long)evt_evt10;
-       *(unsigned volatile long *)(EVT11) =
-           (unsigned volatile long)evt_evt11;
-       *(unsigned volatile long *)(EVT12) =
-           (unsigned volatile long)evt_evt12;
-       *(unsigned volatile long *)(EVT13) =
-           (unsigned volatile long)evt_evt13;
-       *(unsigned volatile long *)(EVT14) =
-           (unsigned volatile long)evt_system_call;
-       *(unsigned volatile long *)(EVT15) =
-           (unsigned volatile long)evt_soft_int1;
-       *(volatile unsigned long *)ILAT = 0;
-       asm("csync;");
-       *(volatile unsigned long *)IMASK = 0xffbf;
-       asm("csync;");
-}
-
-void exception_handle(void)
-{
-#if defined (CONFIG_PANIC_HANG)
-       display_excp();
-#else
-       udelay(100000);         /* allow messages to go out */
-       do_reset(NULL, 0, 0, NULL);
-#endif
-}
-
-void display_excp(void)
-{
-       printf("Exception!\n");
-}
diff --git a/cpu/bf533/serial.c b/cpu/bf533/serial.c
deleted file mode 100644 (file)
index 05fcfcc..0000000
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * U-boot - serial.c Serial driver for BF533
- *
- * Copyright (c) 2005-2007 Analog Devices Inc.
- *
- * This file is based on
- * bf533_serial.c: Serial driver for BlackFin BF533 DSP internal UART.
- * Copyright (c) 2003  Bas Vermeulen <bas@buyways.nl>,
- *                     BuyWays B.V. (www.buyways.nl)
- *
- * Based heavily on blkfinserial.c
- * blkfinserial.c: Serial driver for BlackFin DSP internal USRTs.
- * Copyright(c) 2003   Metrowerks      <mwaddel@metrowerks.com>
- * Copyright(c)        2001    Tony Z. Kou     <tonyko@arcturusnetworks.com>
- * Copyright(c)        2001-2002 Arcturus Networks Inc. <www.arcturusnetworks.com>
- *
- * Based on code from 68328 version serial driver imlpementation which was:
- * Copyright (C) 1995       David S. Miller    <davem@caip.rutgers.edu>
- * Copyright (C) 1998       Kenneth Albanowski <kjahds@kjahds.com>
- * Copyright (C) 1998, 1999 D. Jeff Dionne     <jeff@uclinux.org>
- * Copyright (C) 1999       Vladimir Gurevich  <vgurevic@cisco.com>
- *
- * (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 <asm/system.h>
-#include <asm/bitops.h>
-#include <asm/delay.h>
-#include <asm/io.h>
-#include "bf533_serial.h"
-#include <asm/mach-common/bits/uart.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-unsigned long pll_div_fact;
-
-void calc_baud(void)
-{
-       unsigned char i;
-       int temp;
-       u_long sclk = get_sclk();
-
-       for (i = 0; i < sizeof(baud_table) / sizeof(int); i++) {
-               temp = sclk / (baud_table[i] * 8);
-               if ((temp & 0x1) == 1) {
-                       temp++;
-               }
-               temp = temp / 2;
-               hw_baud_table[i].dl_high = (temp >> 8) & 0xFF;
-               hw_baud_table[i].dl_low = (temp) & 0xFF;
-       }
-}
-
-void serial_setbrg(void)
-{
-       int i;
-
-       calc_baud();
-
-       for (i = 0; i < sizeof(baud_table) / sizeof(int); i++) {
-               if (gd->baudrate == baud_table[i])
-                       break;
-       }
-
-       /* Enable UART */
-       *pUART_GCTL |= UCEN;
-       SSYNC();
-
-       /* Set DLAB in LCR to Access DLL and DLH */
-       ACCESS_LATCH;
-       SSYNC();
-
-       *pUART_DLL = hw_baud_table[i].dl_low;
-       SSYNC();
-       *pUART_DLH = hw_baud_table[i].dl_high;
-       SSYNC();
-
-       /* Clear DLAB in LCR to Access THR RBR IER */
-       ACCESS_PORT_IER;
-       SSYNC();
-
-       /* Enable  ERBFI and ELSI interrupts
-        * to poll SIC_ISR register*/
-       *pUART_IER = ELSI | ERBFI | ETBEI;
-       SSYNC();
-
-       /* Set LCR to Word Lengh 8-bit word select */
-       *pUART_LCR = WLS_8;
-       SSYNC();
-
-       return;
-}
-
-int serial_init(void)
-{
-       serial_setbrg();
-       return (0);
-}
-
-void serial_putc(const char c)
-{
-       if ((*pUART_LSR) & TEMT) {
-               if (c == '\n')
-                       serial_putc('\r');
-
-               local_put_char(c);
-       }
-
-       while (!((*pUART_LSR) & TEMT))
-               SYNC_ALL;
-
-       return;
-}
-
-int serial_tstc(void)
-{
-       if (*pUART_LSR & DR)
-               return 1;
-       else
-               return 0;
-}
-
-int serial_getc(void)
-{
-       unsigned short uart_lsr_val, uart_rbr_val;
-       unsigned long isr_val;
-       int ret;
-
-       /* Poll for RX Interrupt */
-       while (!serial_tstc())
-               continue;
-       asm("csync;");
-
-       uart_lsr_val = *pUART_LSR;      /* Clear status bit */
-       uart_rbr_val = *pUART_RBR;      /* getc() */
-
-       if (uart_lsr_val & (OE|PE|FE|BI)) {
-               ret = -1;
-       } else {
-               ret = uart_rbr_val & 0xff;
-       }
-
-       return ret;
-}
-
-void serial_puts(const char *s)
-{
-       while (*s) {
-               serial_putc(*s++);
-       }
-}
-
-static void local_put_char(char ch)
-{
-       int flags = 0;
-       unsigned long isr_val;
-
-       /* Poll for TX Interruput */
-       while (!(*pUART_LSR & THRE))
-               continue;
-       asm("csync;");
-
-       *pUART_THR = ch;        /* putc() */
-
-       return;
-}
diff --git a/cpu/bf533/start.S b/cpu/bf533/start.S
deleted file mode 100644 (file)
index c32fef6..0000000
+++ /dev/null
@@ -1,313 +0,0 @@
-/*
- * U-boot - start.S Startup file of u-boot for BF533/BF561
- *
- * Copyright (c) 2005-2007 Analog Devices Inc.
- *
- * This file is based on head.S
- * Copyright (c) 2003  Metrowerks/Motorola
- * Copyright (C) 1998  D. Jeff Dionne <jeff@ryeham.ee.ryerson.ca>,
- *                     Kenneth Albanowski <kjahds@kjahds.com>,
- *                     The Silver Hammer Group, Ltd.
- * (c) 1995, Dionne & Associates
- * (c) 1995, DKG Display Tech.
- *
- * 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
- */
-
-/*
- * Note: A change in this file subsequently requires a change in
- *       board/$(board_name)/config.mk for a valid u-boot.bin
- */
-
-#define ASSEMBLY
-
-#include <linux/config.h>
-#include <config.h>
-#include <asm/blackfin.h>
-
-#include <asm/mach-common/bits/core.h>
-#include <asm/mach-common/bits/dma.h>
-#include <asm/mach-common/bits/pll.h>
-
-.global _stext;
-.global __bss_start;
-.global start;
-.global _start;
-.global edata;
-.global _exit;
-.global init_sdram;
-
-#if (CONFIG_CCLK_DIV == 1)
-#define CONFIG_CCLK_ACT_DIV   CCLK_DIV1
-#endif
-#if (CONFIG_CCLK_DIV == 2)
-#define CONFIG_CCLK_ACT_DIV   CCLK_DIV2
-#endif
-#if (CONFIG_CCLK_DIV == 4)
-#define CONFIG_CCLK_ACT_DIV   CCLK_DIV4
-#endif
-#if (CONFIG_CCLK_DIV == 8)
-#define CONFIG_CCLK_ACT_DIV   CCLK_DIV8
-#endif
-#ifndef CONFIG_CCLK_ACT_DIV
-#define CONFIG_CCLK_ACT_DIV   CONFIG_CCLK_DIV_not_defined_properly
-#endif
-
-.text
-_start:
-start:
-_stext:
-
-       R0 = 0x32;
-       SYSCFG = R0;
-       SSYNC;
-
-       /* As per HW reference manual DAG registers,
-        * DATA and Address resgister shall be zero'd
-        * in initialization, after a reset state
-        */
-       r1 = 0; /* Data registers zero'd */
-       r2 = 0;
-       r3 = 0;
-       r4 = 0;
-       r5 = 0;
-       r6 = 0;
-       r7 = 0;
-
-       p0 = 0; /* Address registers zero'd */
-       p1 = 0;
-       p2 = 0;
-       p3 = 0;
-       p4 = 0;
-       p5 = 0;
-
-       i0 = 0; /* DAG Registers zero'd */
-       i1 = 0;
-       i2 = 0;
-       i3 = 0;
-       m0 = 0;
-       m1 = 0;
-       m3 = 0;
-       m3 = 0;
-       l0 = 0;
-       l1 = 0;
-       l2 = 0;
-       l3 = 0;
-       b0 = 0;
-       b1 = 0;
-       b2 = 0;
-       b3 = 0;
-
-       /* Set loop counters to zero, to make sure that
-        * hw loops are disabled.
-        */
-       r0  = 0;
-       lc0 = r0;
-       lc1 = r0;
-
-       SSYNC;
-
-       /* Check soft reset status */
-       p0.h = SWRST >> 16;
-       p0.l = SWRST & 0xFFFF;
-       r0.l = w[p0];
-
-       cc = bittst(r0, 15);
-       if !cc jump no_soft_reset;
-
-       /* Clear Soft reset */
-       r0 = 0x0000;
-       w[p0] = r0;
-       ssync;
-
-no_soft_reset:
-       nop;
-
-       /* Clear EVT registers */
-       p0.h = (EVT0 >> 16);
-       p0.l = (EVT0 & 0xFFFF);
-       p0 += 8;
-       p1 = 14;
-       r1 = 0;
-       LSETUP(4,4) lc0 = p1;
-       [ p0 ++ ] = r1;
-
-       p0.h = hi(SIC_IWR);
-       p0.l = lo(SIC_IWR);
-       r0.l = 0x1;
-       w[p0] = r0.l;
-       SSYNC;
-
-       sp.l = (0xffb01000 & 0xFFFF);
-       sp.h = (0xffb01000 >> 16);
-
-       call init_sdram;
-
-       /* relocate into to RAM */
-       call get_pc;
-offset:
-       r2.l = offset;
-       r2.h = offset;
-       r3.l = start;
-       r3.h = start;
-       r1 = r2 - r3;
-
-       r0 = r0 - r1;
-       p1 = r0;
-
-       p2.l = (CFG_MONITOR_BASE & 0xffff);
-       p2.h = (CFG_MONITOR_BASE >> 16);
-
-       p3 = 0x04;
-       p4.l = ((CFG_MONITOR_BASE + CFG_MONITOR_LEN) & 0xffff);
-       p4.h = ((CFG_MONITOR_BASE + CFG_MONITOR_LEN) >> 16);
-loop1:
-       r1 = [p1 ++ p3];
-       [p2 ++ p3] = r1;
-       cc=p2==p4;
-       if !cc jump loop1;
-       /*
-        * configure STACK
-        */
-       r0.h = (CONFIG_STACKBASE >> 16);
-       r0.l = (CONFIG_STACKBASE & 0xFFFF);
-       sp = r0;
-       fp = sp;
-
-       /*
-        * This next section keeps the processor in supervisor mode
-        * during kernel boot.  Switches to user mode at end of boot.
-        * See page 3-9 of Hardware Reference manual for documentation.
-        */
-
-       /* To keep ourselves in the supervisor mode */
-       p0.l = (EVT15 & 0xFFFF);
-       p0.h = (EVT15 >> 16);
-
-       p1.l = _real_start;
-       p1.h = _real_start;
-       [p0] = p1;
-
-       p0.l = (IMASK & 0xFFFF);
-       p0.h = (IMASK >> 16);
-       r0.l = LO(EVT_IVG15);
-       r0.h = HI(EVT_IVG15);
-       [p0] = r0;
-       raise 15;
-       p0.l = WAIT_HERE;
-       p0.h = WAIT_HERE;
-       reti = p0;
-       rti;
-
-WAIT_HERE:
-       jump WAIT_HERE;
-
-.global _real_start;
-_real_start:
-       [ -- sp ] = reti;
-
-       /* DMA reset code to Hi of L1 SRAM */
-copy:
-       /* P1 Points to the beginning of SYSTEM MMR Space */
-       P1.H = hi(SYSMMR_BASE);
-       P1.L = lo(SYSMMR_BASE);
-
-       R0.H = reset_start;     /* Source Address (high) */
-       R0.L = reset_start;     /* Source Address (low) */
-       R1.H = reset_end;
-       R1.L = reset_end;
-       R2 = R1 - R0;           /* Count */
-       R1.H = hi(L1_INST_SRAM);        /* Destination Address (high) */
-       R1.L = lo(L1_INST_SRAM);        /* Destination Address (low) */
-       R3.L = DMAEN;           /* Source DMAConfig Value (8-bit words) */
-       /* Destination DMAConfig Value (8-bit words) */
-       R4.L = (DI_EN | WNR | DMAEN);
-
-DMA:
-       R6 = 0x1 (Z);
-       W[P1+OFFSET_(MDMA_S0_X_MODIFY)] = R6;   /* Source Modify = 1 */
-       W[P1+OFFSET_(MDMA_D0_X_MODIFY)] = R6;   /* Destination Modify = 1 */
-
-       [P1+OFFSET_(MDMA_S0_START_ADDR)] = R0;  /* Set Source Base Address */
-       W[P1+OFFSET_(MDMA_S0_X_COUNT)] = R2;    /* Set Source Count */
-       /* Set Source  DMAConfig = DMA Enable,
-       Memory Read,  8-Bit Transfers, 1-D DMA, Flow - Stop */
-       W[P1+OFFSET_(MDMA_S0_CONFIG)] = R3;
-
-       /* Set Destination Base Address */
-       [P1+OFFSET_(MDMA_D0_START_ADDR)] = R1;
-       W[P1+OFFSET_(MDMA_D0_X_COUNT)] = R2;    /* Set Destination Count */
-       /* Set Destination DMAConfig = DMA Enable,
-       Memory Write, 8-Bit Transfers, 1-D DMA, Flow - Stop, IOC */
-       W[P1+OFFSET_(MDMA_D0_CONFIG)] = R4;
-
-WAIT_DMA_DONE:
-       p0.h = hi(MDMA_D0_IRQ_STATUS);
-       p0.l = lo(MDMA_D0_IRQ_STATUS);
-       R0 = W[P0](Z);
-       CC = BITTST(R0, 0);
-       if ! CC jump WAIT_DMA_DONE
-
-       R0 = 0x1;
-
-       /* Write 1 to clear DMA interrupt */
-       W[P1+OFFSET_(MDMA_D0_IRQ_STATUS)] = R0;
-
-       /* Initialize BSS Section with 0 s */
-       p1.l = __bss_start;
-       p1.h = __bss_start;
-       p2.l = _end;
-       p2.h = _end;
-       r1 = p1;
-       r2 = p2;
-       r3 = r2 - r1;
-       r3 = r3 >> 2;
-       p3 = r3;
-       lsetup (_clear_bss, _clear_bss_end ) lc1 = p3;
-       CC = p2<=p1;
-       if CC jump _clear_bss_skip;
-       r0 = 0;
-_clear_bss:
-_clear_bss_end:
-       [p1++] = r0;
-_clear_bss_skip:
-
-       p0.l = _start1;
-       p0.h = _start1;
-       jump (p0);
-
-reset_start:
-       p0.h = WDOG_CNT >> 16;
-       p0.l = WDOG_CNT & 0xffff;
-       r0 = 0x0010;
-       w[p0] = r0;
-       p0.h = WDOG_CTL >> 16;
-       p0.l = WDOG_CTL & 0xffff;
-       r0 = 0x0000;
-       w[p0] = r0;
-reset_wait:
-       jump reset_wait;
-
-reset_end: nop;
-
-_exit:
-       jump.s  _exit;
-get_pc:
-       r0 = rets;
-       rts;
diff --git a/cpu/bf533/traps.c b/cpu/bf533/traps.c
deleted file mode 100644 (file)
index 7e156d5..0000000
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * U-boot - traps.c Routines related to interrupts and exceptions
- *
- * Copyright (c) 2005-2007 Analog Devices Inc.
- *
- * This file is based on
- * No original Copyright holder listed,
- * Probabily original (C) Roman Zippel (assigned DJD, 1999)
- *
- * Copyright 2003 Metrowerks - for Blackfin
- * Copyright 2000-2001 Lineo, Inc. D. Jeff Dionne <jeff@lineo.ca>
- * Copyright 1999-2000 D. Jeff Dionne, <jeff@uclinux.org>
- *
- * (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 <linux/types.h>
-#include <asm/errno.h>
-#include <asm/system.h>
-#include <asm/traps.h>
-#include "cpu.h"
-#include <asm/cplb.h>
-#include <asm/io.h>
-#include <asm/mach-common/bits/core.h>
-#include <asm/mach-common/bits/mpu.h>
-
-void init_IRQ(void)
-{
-       blackfin_init_IRQ();
-       return;
-}
-
-void process_int(unsigned long vec, struct pt_regs *fp)
-{
-       printf("interrupt\n");
-       return;
-}
-
-extern unsigned int icplb_table[page_descriptor_table_size][2];
-extern unsigned int dcplb_table[page_descriptor_table_size][2];
-
-unsigned long last_cplb_fault_retx;
-
-static unsigned int cplb_sizes[4] =
-    { 1024, 4 * 1024, 1024 * 1024, 4 * 1024 * 1024 };
-
-void trap_c(struct pt_regs *regs)
-{
-       unsigned int addr;
-       unsigned long trapnr = (regs->seqstat) & EXCAUSE;
-       unsigned int i, j, size, *I0, *I1;
-       unsigned short data = 0;
-
-       switch (trapnr) {
-       /* 0x26 - Data CPLB Miss */
-       case VEC_CPLB_M:
-
-#if ANOMALY_05000261
-               /*
-                * Work around an anomaly: if we see a new DCPLB fault,
-                * return without doing anything. Then,
-                * if we get the same fault again, handle it.
-                */
-               addr = last_cplb_fault_retx;
-               last_cplb_fault_retx = regs->retx;
-               printf("this time, curr = 0x%08x last = 0x%08x\n",
-                      addr, last_cplb_fault_retx);
-               if (addr != last_cplb_fault_retx)
-                       goto trap_c_return;
-#endif
-               data = 1;
-
-       case VEC_CPLB_I_M:
-
-               if (data) {
-                       addr = *(unsigned int *)pDCPLB_FAULT_ADDR;
-               } else {
-                       addr = *(unsigned int *)pICPLB_FAULT_ADDR;
-               }
-               for (i = 0; i < page_descriptor_table_size; i++) {
-                       if (data) {
-                               size = cplb_sizes[dcplb_table[i][1] >> 16];
-                               j = dcplb_table[i][0];
-                       } else {
-                               size = cplb_sizes[icplb_table[i][1] >> 16];
-                               j = icplb_table[i][0];
-                       }
-                       if ((j <= addr) && ((j + size) > addr)) {
-                               debug("found %i 0x%08x\n", i, j);
-                               break;
-                       }
-               }
-               if (i == page_descriptor_table_size) {
-                       printf("something is really wrong\n");
-                       do_reset(NULL, 0, 0, NULL);
-               }
-
-               /* Turn the cache off */
-               if (data) {
-                       SSYNC();
-                       asm(" .align 8; ");
-                       *(unsigned int *)DMEM_CONTROL &=
-                           ~(ACACHE_BCACHE | ENDCPLB | PORT_PREF0);
-                       SSYNC();
-               } else {
-                       SSYNC();
-                       asm(" .align 8; ");
-                       *(unsigned int *)IMEM_CONTROL &= ~(IMC | ENICPLB);
-                       SSYNC();
-               }
-
-               if (data) {
-                       I0 = (unsigned int *)DCPLB_ADDR0;
-                       I1 = (unsigned int *)DCPLB_DATA0;
-               } else {
-                       I0 = (unsigned int *)ICPLB_ADDR0;
-                       I1 = (unsigned int *)ICPLB_DATA0;
-               }
-
-               j = 0;
-               while (*I1 & CPLB_LOCK) {
-                       debug("skipping %i %08p - %08x\n", j, I1, *I1);
-                       *I0++;
-                       *I1++;
-                       j++;
-               }
-
-               debug("remove %i 0x%08x  0x%08x\n", j, *I0, *I1);
-
-               for (; j < 15; j++) {
-                       debug("replace %i 0x%08x  0x%08x\n", j, I0, I0 + 1);
-                       *I0++ = *(I0 + 1);
-                       *I1++ = *(I1 + 1);
-               }
-
-               if (data) {
-                       *I0 = dcplb_table[i][0];
-                       *I1 = dcplb_table[i][1];
-                       I0 = (unsigned int *)DCPLB_ADDR0;
-                       I1 = (unsigned int *)DCPLB_DATA0;
-               } else {
-                       *I0 = icplb_table[i][0];
-                       *I1 = icplb_table[i][1];
-                       I0 = (unsigned int *)ICPLB_ADDR0;
-                       I1 = (unsigned int *)ICPLB_DATA0;
-               }
-
-               for (j = 0; j < 16; j++) {
-                       debug("%i 0x%08x  0x%08x\n", j, *I0++, *I1++);
-               }
-
-               /* Turn the cache back on */
-               if (data) {
-                       j = *(unsigned int *)DMEM_CONTROL;
-                       SSYNC();
-                       asm(" .align 8; ");
-                       *(unsigned int *)DMEM_CONTROL =
-                           ACACHE_BCACHE | ENDCPLB | PORT_PREF0 | j;
-                       SSYNC();
-               } else {
-                       SSYNC();
-                       asm(" .align 8; ");
-                       *(unsigned int *)IMEM_CONTROL = IMC | ENICPLB;
-                       SSYNC();
-               }
-
-               break;
-       default:
-               /* All traps come here */
-               printf("code=[0x%x], ", (unsigned int)(regs->seqstat & 0x3f));
-               printf("stack frame=0x%x, ", (unsigned int)regs);
-               printf("bad PC=0x%04x\n", (unsigned int)regs->pc);
-               dump(regs);
-               printf("\n\n");
-
-               printf("Unhandled IRQ or exceptions!\n");
-               printf("Please reset the board \n");
-               do_reset(NULL, 0, 0, NULL);
-       }
-
-       return;
-
-}
-
-void dump(struct pt_regs *fp)
-{
-       debug("RETE:  %08lx  RETN: %08lx  RETX: %08lx  RETS: %08lx\n",
-                fp->rete, fp->retn, fp->retx, fp->rets);
-       debug("IPEND: %04lx  SYSCFG: %04lx\n", fp->ipend, fp->syscfg);
-       debug("SEQSTAT: %08lx    SP: %08lx\n", (long)fp->seqstat, (long)fp);
-       debug("R0: %08lx    R1: %08lx    R2: %08lx    R3: %08lx\n",
-                fp->r0, fp->r1, fp->r2, fp->r3);
-       debug("R4: %08lx    R5: %08lx    R6: %08lx    R7: %08lx\n",
-                fp->r4, fp->r5, fp->r6, fp->r7);
-       debug("P0: %08lx    P1: %08lx    P2: %08lx    P3: %08lx\n",
-                fp->p0, fp->p1, fp->p2, fp->p3);
-       debug("P4: %08lx    P5: %08lx    FP: %08lx\n",
-                fp->p4, fp->p5, fp->fp);
-       debug("A0.w: %08lx    A0.x: %08lx    A1.w: %08lx    A1.x: %08lx\n",
-                fp->a0w, fp->a0x, fp->a1w, fp->a1x);
-
-       debug("LB0: %08lx  LT0: %08lx  LC0: %08lx\n",
-                fp->lb0, fp->lt0, fp->lc0);
-       debug("LB1: %08lx  LT1: %08lx  LC1: %08lx\n",
-                fp->lb1, fp->lt1, fp->lc1);
-       debug("B0: %08lx  L0: %08lx  M0: %08lx  I0: %08lx\n",
-                fp->b0, fp->l0, fp->m0, fp->i0);
-       debug("B1: %08lx  L1: %08lx  M1: %08lx  I1: %08lx\n",
-                fp->b1, fp->l1, fp->m1, fp->i1);
-       debug("B2: %08lx  L2: %08lx  M2: %08lx  I2: %08lx\n",
-                fp->b2, fp->l2, fp->m2, fp->i2);
-       debug("B3: %08lx  L3: %08lx  M3: %08lx  I3: %08lx\n",
-                fp->b3, fp->l3, fp->m3, fp->i3);
-
-       debug("DCPLB_FAULT_ADDR=%p\n", *pDCPLB_FAULT_ADDR);
-       debug("ICPLB_FAULT_ADDR=%p\n", *pICPLB_FAULT_ADDR);
-
-}
diff --git a/cpu/bf533/video.c b/cpu/bf533/video.c
deleted file mode 100644 (file)
index 3ff0151..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * (C) Copyright 2000
- * Paolo Scaffardi, AIRVENT SAM s.p.a - RIMINI(ITALY), arsenio@tin.it
- * (C) Copyright 2002
- * Wolfgang Denk, wd@denx.de
- * (C) Copyright 2006
- * Aubrey Li, aubrey.li@analog.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 <stdarg.h>
-#include <common.h>
-#include <config.h>
-#include <asm/blackfin.h>
-#include <i2c.h>
-#include <linux/types.h>
-#include <devices.h>
-
-#ifdef CONFIG_VIDEO
-#define NTSC_FRAME_ADDR 0x06000000
-#include "video.h"
-
-/* NTSC OUTPUT SIZE  720 * 240 */
-#define VERTICAL       2
-#define HORIZONTAL     4
-
-int is_vblank_line(const int line)
-{
-       /*
-        *  This array contains a single bit for each line in
-        *  an NTSC frame.
-        */
-       if ((line <= 18) || (line >= 264 && line <= 281) || (line == 528))
-               return true;
-
-       return false;
-}
-
-int NTSC_framebuffer_init(char *base_address)
-{
-       const int NTSC_frames = 1;
-       const int NTSC_lines = 525;
-       char *dest = base_address;
-       int frame_num, line_num;
-
-       for (frame_num = 0; frame_num < NTSC_frames; ++frame_num) {
-               for (line_num = 1; line_num <= NTSC_lines; ++line_num) {
-                       unsigned int code;
-                       int offset = 0;
-                       int i;
-
-                       if (is_vblank_line(line_num))
-                               offset++;
-
-                       if (line_num > 266 || line_num < 3)
-                               offset += 2;
-
-                       /* Output EAV code */
-                       code = SystemCodeMap[offset].EAV;
-                       write_dest_byte((char)(code >> 24) & 0xff);
-                       write_dest_byte((char)(code >> 16) & 0xff);
-                       write_dest_byte((char)(code >> 8) & 0xff);
-                       write_dest_byte((char)(code) & 0xff);
-
-                       /* Output horizontal blanking */
-                       for (i = 0; i < 67 * 2; ++i) {
-                               write_dest_byte(0x80);
-                               write_dest_byte(0x10);
-                       }
-
-                       /* Output SAV */
-                       code = SystemCodeMap[offset].SAV;
-                       write_dest_byte((char)(code >> 24) & 0xff);
-                       write_dest_byte((char)(code >> 16) & 0xff);
-                       write_dest_byte((char)(code >> 8) & 0xff);
-                       write_dest_byte((char)(code) & 0xff);
-
-                       /* Output empty horizontal data */
-                       for (i = 0; i < 360 * 2; ++i) {
-                               write_dest_byte(0x80);
-                               write_dest_byte(0x10);
-                       }
-               }
-       }
-
-       return dest - base_address;
-}
-
-void fill_frame(char *Frame, int Value)
-{
-       int *OddPtr32;
-       int OddLine;
-       int *EvenPtr32;
-       int EvenLine;
-       int i;
-       int *data;
-       int m, n;
-
-       /* fill odd and even frames */
-       for (OddLine = 22, EvenLine = 285; OddLine < 263; OddLine++, EvenLine++) {
-               OddPtr32 = (int *)((Frame + (OddLine * 1716)) + 276);
-               EvenPtr32 = (int *)((Frame + (EvenLine * 1716)) + 276);
-               for (i = 0; i < 360; i++, OddPtr32++, EvenPtr32++) {
-                       *OddPtr32 = Value;
-                       *EvenPtr32 = Value;
-               }
-       }
-
-       for (m = 0; m < VERTICAL; m++) {
-               data = (int *)u_boot_logo.data;
-               for (OddLine = (22 + m), EvenLine = (285 + m);
-                    OddLine < (u_boot_logo.height * VERTICAL) + (22 + m);
-                    OddLine += VERTICAL, EvenLine += VERTICAL) {
-                       OddPtr32 = (int *)((Frame + ((OddLine) * 1716)) + 276);
-                       EvenPtr32 =
-                           (int *)((Frame + ((EvenLine) * 1716)) + 276);
-                       for (i = 0; i < u_boot_logo.width / 2; i++) {
-                               /* enlarge one pixel to m x n */
-                               for (n = 0; n < HORIZONTAL; n++) {
-                                       *OddPtr32++ = *data;
-                                       *EvenPtr32++ = *data;
-                               }
-                               data++;
-                       }
-               }
-       }
-}
-
-void video_putc(const char c)
-{
-}
-
-void video_puts(const char *s)
-{
-}
-
-static int video_init(void)
-{
-       char *NTSCFrame;
-       NTSCFrame = (char *)NTSC_FRAME_ADDR;
-       NTSC_framebuffer_init(NTSCFrame);
-       fill_frame(NTSCFrame, BLUE);
-
-       *pPPI_CONTROL = 0x0082;
-       *pPPI_FRAME = 0x020D;
-
-       *pDMA0_START_ADDR = NTSCFrame;
-       *pDMA0_X_COUNT = 0x035A;
-       *pDMA0_X_MODIFY = 0x0002;
-       *pDMA0_Y_COUNT = 0x020D;
-       *pDMA0_Y_MODIFY = 0x0002;
-       *pDMA0_CONFIG = 0x1015;
-       *pPPI_CONTROL = 0x0083;
-       return 0;
-}
-
-int drv_video_init(void)
-{
-       int error, devices = 1;
-
-       device_t videodev;
-
-       video_init();           /* Video initialization */
-
-       memset(&videodev, 0, sizeof(videodev));
-
-       strcpy(videodev.name, "video");
-       videodev.ext = DEV_EXT_VIDEO;   /* Video extensions */
-       videodev.flags = DEV_FLAGS_OUTPUT;      /* Output only */
-       videodev.putc = video_putc;     /* 'putc' function */
-       videodev.puts = video_puts;     /* 'puts' function */
-
-       error = device_register(&videodev);
-
-       return (error == 0) ? devices : error;
-}
-#endif
diff --git a/cpu/bf533/video.h b/cpu/bf533/video.h
deleted file mode 100644 (file)
index d237f6a..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#include <video_logo.h>
-#define write_dest_byte(val) {*dest++=val;}
-#define BLACK   (0x01800180)   /* black pixel pattern  */
-#define BLUE    (0x296E29F0)   /* blue pixel pattern   */
-#define RED     (0x51F0515A)   /* red pixel pattern    */
-#define MAGENTA (0x6ADE6ACA)   /* magenta pixel pattern */
-#define GREEN   (0x91229136)   /* green pixel pattern  */
-#define CYAN    (0xAA10AAA6)   /* cyan pixel pattern   */
-#define YELLOW  (0xD292D210)   /* yellow pixel pattern */
-#define WHITE   (0xFE80FE80)   /* white pixel pattern  */
-
-#define true   1
-#define false  0
-
-typedef struct {
-       unsigned int SAV;
-       unsigned int EAV;
-} SystemCodeType;
-
-const SystemCodeType SystemCodeMap[4] = {
-       {0xFF000080, 0xFF00009D},
-       {0xFF0000AB, 0xFF0000B6},
-       {0xFF0000C7, 0xFF0000DA},
-       {0xFF0000EC, 0xFF0000F1}
-};
diff --git a/cpu/bf537/cache.S b/cpu/bf537/cache.S
deleted file mode 100644 (file)
index d9015c6..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-#define ASSEMBLY
-#include <asm/linkage.h>
-#include <config.h>
-#include <asm/blackfin.h>
-#include <asm/mach-common/bits/mpu.h>
-
-.text
-.align 2
-ENTRY(_blackfin_icache_flush_range)
-       R2 = -32;
-       R2 = R0 & R2;
-       P0 = R2;
-       P1 = R1;
-       CSYNC;
-       1:
-       IFLUSH[P0++];
-       CC = P0 < P1(iu);
-       IF CC JUMP 1b(bp);
-       IFLUSH[P0];
-       SSYNC;
-       RTS;
-
-ENTRY(_blackfin_dcache_flush_range)
-       R2 = -32;
-       R2 = R0 & R2;
-       P0 = R2;
-       P1 = R1;
-       CSYNC;
-1:
-       FLUSH[P0++];
-       CC = P0 < P1(iu);
-       IF CC JUMP 1b(bp);
-       FLUSH[P0];
-       SSYNC;
-       RTS;
-
-ENTRY(_icache_invalidate)
-ENTRY(_invalidate_entire_icache)
-       [--SP] = (R7:5);
-
-       P0.L = (IMEM_CONTROL & 0xFFFF);
-       P0.H = (IMEM_CONTROL >> 16);
-       R7 =[P0];
-
-       /*
-        * Clear the IMC bit , All valid bits in the instruction
-        * cache are set to the invalid state
-        */
-       BITCLR(R7, IMC_P);
-       CLI R6;
-       /* SSYNC required before invalidating cache. */
-       SSYNC;
-       .align 8;
-       [P0] = R7;
-       SSYNC;
-       STI R6;
-
-       /* Configures the instruction cache agian */
-       R6 = (IMC | ENICPLB);
-       R7 = R7 | R6;
-
-       CLI R6;
-       SSYNC;
-       .align 8;
-       [P0] = R7;
-       SSYNC;
-       STI R6;
-
-       (R7:5) =[SP++];
-       RTS;
-
-/*
- * Invalidate the Entire Data cache by
- * clearing DMC[1:0] bits
- */
-ENTRY(_invalidate_entire_dcache)
-ENTRY(_dcache_invalidate)
-       [--SP] = (R7:6);
-
-       P0.L = (DMEM_CONTROL & 0xFFFF);
-       P0.H = (DMEM_CONTROL >> 16);
-       R7 =[P0];
-
-       /*
-        * Clear the DMC[1:0] bits, All valid bits in the data
-        * cache are set to the invalid state
-        */
-       BITCLR(R7, DMC0_P);
-       BITCLR(R7, DMC1_P);
-       CLI R6;
-       SSYNC;
-       .align 8;
-       [P0] = R7;
-       SSYNC;
-       STI R6;
-       /* Configures the data cache again */
-
-       R6 = (ACACHE_BCACHE | ENDCPLB | PORT_PREF0);
-       R7 = R7 | R6;
-
-       CLI R6;
-       SSYNC;
-       .align 8;
-       [P0] = R7;
-       SSYNC;
-       STI R6;
-
-       (R7:6) =[SP++];
-       RTS;
-
-ENTRY(_blackfin_dcache_invalidate_range)
-       R2 = -32;
-       R2 = R0 & R2;
-       P0 = R2;
-       P1 = R1;
-       CSYNC;
-1:
-       FLUSHINV[P0++];
-       CC = P0 < P1(iu);
-       IF CC JUMP 1b(bp);
-
-       /*
-        * If the data crosses a cache line, then we'll be pointing to
-        * the last cache line, but won't have flushed/invalidated it yet, so do
-        * one more.
-        */
-       FLUSHINV[P0];
-       SSYNC;
-       RTS;
diff --git a/cpu/bf537/cpu.c b/cpu/bf537/cpu.c
deleted file mode 100644 (file)
index 7233908..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * U-boot - cpu.c CPU specific functions
- *
- * Copyright (c) 2005-2007 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 <asm/blackfin.h>
-#include <command.h>
-#include <asm/entry.h>
-#include <asm/cplb.h>
-#include <asm/io.h>
-
-#define CACHE_ON 1
-#define CACHE_OFF 0
-
-extern unsigned int icplb_table[page_descriptor_table_size][2];
-extern unsigned int dcplb_table[page_descriptor_table_size][2];
-
-int do_reset(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
-{
-       __asm__ __volatile__("cli r3;" "P0 = %0;" "JUMP (P0);"::"r"(L1_INST_SRAM)
-           );
-
-       return 0;
-}
-
-/* These functions are just used to satisfy the linker */
-int cpu_init(void)
-{
-       return 0;
-}
-
-int cleanup_before_linux(void)
-{
-       return 0;
-}
-
-void icache_enable(void)
-{
-       unsigned int *I0, *I1;
-       int i, j = 0;
-
-       if ((*pCHIPID >> 28) < 2)
-               return;
-
-       /* Before enable icache, disable it first */
-       icache_disable();
-       I0 = (unsigned int *)ICPLB_ADDR0;
-       I1 = (unsigned int *)ICPLB_DATA0;
-
-       /* make sure the locked ones go in first */
-       for (i = 0; i < page_descriptor_table_size; i++) {
-               if (CPLB_LOCK & icplb_table[i][1]) {
-                       debug("adding %02i %02i 0x%08x 0x%08x\n", i, j,
-                                icplb_table[i][0], icplb_table[i][1]);
-                       *I0++ = icplb_table[i][0];
-                       *I1++ = icplb_table[i][1];
-                       j++;
-               }
-       }
-
-       for (i = 0; i < page_descriptor_table_size; i++) {
-               if (!(CPLB_LOCK & icplb_table[i][1])) {
-                       debug("adding %02i %02i 0x%08x 0x%08x\n", i, j,
-                                icplb_table[i][0], icplb_table[i][1]);
-                       *I0++ = icplb_table[i][0];
-                       *I1++ = icplb_table[i][1];
-                       j++;
-                       if (j == 16) {
-                               break;
-                       }
-               }
-       }
-
-       /* Fill the rest with invalid entry */
-       if (j <= 15) {
-               for (; j < 16; j++) {
-                       debug("filling %i with 0", j);
-                       *I1++ = 0x0;
-               }
-
-       }
-
-       SSYNC();
-       asm(" .align 8; ");
-       *(unsigned int *)IMEM_CONTROL = IMC | ENICPLB;
-       SSYNC();
-}
-
-void icache_disable(void)
-{
-       if ((*pCHIPID >> 28) < 2)
-               return;
-       SSYNC();
-       asm(" .align 8; ");
-       *(unsigned int *)IMEM_CONTROL &= ~(IMC | ENICPLB);
-       SSYNC();
-}
-
-int icache_status(void)
-{
-       unsigned int value;
-       value = *(unsigned int *)IMEM_CONTROL;
-
-       if (value & (IMC | ENICPLB))
-               return CACHE_ON;
-       else
-               return CACHE_OFF;
-}
-
-void dcache_enable(void)
-{
-       unsigned int *I0, *I1;
-       unsigned int temp;
-       int i, j = 0;
-
-       /* Before enable dcache, disable it first */
-       dcache_disable();
-       I0 = (unsigned int *)DCPLB_ADDR0;
-       I1 = (unsigned int *)DCPLB_DATA0;
-
-       /* make sure the locked ones go in first */
-       for (i = 0; i < page_descriptor_table_size; i++) {
-               if (CPLB_LOCK & dcplb_table[i][1]) {
-                       debug("adding %02i %02i 0x%08x 0x%08x\n", i, j,
-                                dcplb_table[i][0], dcplb_table[i][1]);
-                       *I0++ = dcplb_table[i][0];
-                       *I1++ = dcplb_table[i][1];
-                       j++;
-               } else {
-                       debug("skip   %02i %02i 0x%08x 0x%08x\n", i, j,
-                                dcplb_table[i][0], dcplb_table[i][1]);
-               }
-       }
-
-       for (i = 0; i < page_descriptor_table_size; i++) {
-               if (!(CPLB_LOCK & dcplb_table[i][1])) {
-                       debug("adding %02i %02i 0x%08x 0x%08x\n", i, j,
-                                dcplb_table[i][0], dcplb_table[i][1]);
-                       *I0++ = dcplb_table[i][0];
-                       *I1++ = dcplb_table[i][1];
-                       j++;
-                       if (j == 16) {
-                               break;
-                       }
-               }
-       }
-
-       /* Fill the rest with invalid entry */
-       if (j <= 15) {
-               for (; j < 16; j++) {
-                       debug("filling %i with 0", j);
-                       *I1++ = 0x0;
-               }
-       }
-
-       temp = *(unsigned int *)DMEM_CONTROL;
-       SSYNC();
-       asm(" .align 8; ");
-       *(unsigned int *)DMEM_CONTROL =
-           ACACHE_BCACHE | ENDCPLB | PORT_PREF0 | temp;
-       SSYNC();
-}
-
-void dcache_disable(void)
-{
-       unsigned int *I0, *I1;
-       int i;
-
-       SSYNC();
-       asm(" .align 8; ");
-       *(unsigned int *)DMEM_CONTROL &=
-           ~(ACACHE_BCACHE | ENDCPLB | PORT_PREF0);
-       SSYNC();
-
-       /* after disable dcache,
-        * clear it so we don't confuse the next application
-        */
-       I0 = (unsigned int *)DCPLB_ADDR0;
-       I1 = (unsigned int *)DCPLB_DATA0;
-
-       for (i = 0; i < 16; i++) {
-               *I0++ = 0x0;
-               *I1++ = 0x0;
-       }
-}
-
-int dcache_status(void)
-{
-       unsigned int value;
-       value = *(unsigned int *)DMEM_CONTROL;
-
-       if (value & (ENDCPLB))
-               return CACHE_ON;
-       else
-               return CACHE_OFF;
-}
diff --git a/cpu/bf537/cpu.h b/cpu/bf537/cpu.h
deleted file mode 100644 (file)
index b6b73b1..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- *  U-boot - cpu.h
- *
- *  Copyright (c) 2005-2007 Analog Devices 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., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
- */
-
-#ifndef _CPU_H_
-#define _CPU_H_
-
-#include <command.h>
-
-#define INTERNAL_IRQS (32)
-#define NUM_IRQ_NODES 16
-#define DEF_INTERRUPT_FLAGS 1
-#define MAX_TIM_LOAD   0xFFFFFFFF
-
-void blackfin_irq_panic(int reason, struct pt_regs *reg);
-extern void dump(struct pt_regs *regs);
-void display_excp(void);
-asmlinkage void evt_nmi(void);
-asmlinkage void evt_exception(void);
-asmlinkage void trap(void);
-asmlinkage void evt_ivhw(void);
-asmlinkage void evt_rst(void);
-asmlinkage void evt_timer(void);
-asmlinkage void evt_evt7(void);
-asmlinkage void evt_evt8(void);
-asmlinkage void evt_evt9(void);
-asmlinkage void evt_evt10(void);
-asmlinkage void evt_evt11(void);
-asmlinkage void evt_evt12(void);
-asmlinkage void evt_evt13(void);
-asmlinkage void evt_soft_int1(void);
-asmlinkage void evt_system_call(void);
-void blackfin_irq_panic(int reason, struct pt_regs *regs);
-void blackfin_free_irq(unsigned int irq, void *dev_id);
-void call_isr(int irq, struct pt_regs *fp);
-void blackfin_do_irq(int vec, struct pt_regs *fp);
-void blackfin_init_IRQ(void);
-void blackfin_enable_irq(unsigned int irq);
-void blackfin_disable_irq(unsigned int irq);
-extern int do_reset(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]);
-int blackfin_request_irq(unsigned int irq,
-                        void (*handler) (int, void *, struct pt_regs *),
-                        unsigned long flags, const char *devname,
-                        void *dev_id);
-void timer_init(void);
-#endif
diff --git a/cpu/bf537/flush.S b/cpu/bf537/flush.S
deleted file mode 100644 (file)
index fbd26cc..0000000
+++ /dev/null
@@ -1,403 +0,0 @@
-/* Copyright (C) 2003-2007 Analog Devices Inc.
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.
- */
-
-#define ASSEMBLY
-
-#include <asm/linkage.h>
-#include <asm/cplb.h>
-#include <config.h>
-#include <asm/blackfin.h>
-
-.text
-
-/* This is an external function being called by the user
- * application through __flush_cache_all. Currently this function
- * serves the purpose of flushing all the pending writes in
- * in the instruction cache.
- */
-
-ENTRY(_flush_instruction_cache)
-       [--SP] = ( R7:6, P5:4 );
-       LINK 12;
-       SP += -12;
-       P5.H = (ICPLB_ADDR0 >> 16);
-       P5.L = (ICPLB_ADDR0 & 0xFFFF);
-       P4.H = (ICPLB_DATA0 >> 16);
-       P4.L = (ICPLB_DATA0 & 0xFFFF);
-       R7 = CPLB_VALID | CPLB_L1_CHBL;
-       R6 = 16;
-inext: R0 = [P5++];
-       R1 = [P4++];
-       [--SP] =  RETS;
-       CALL _icplb_flush;      /* R0 = page, R1 = data*/
-       RETS = [SP++];
-iskip: R6 += -1;
-       CC = R6;
-       IF CC JUMP inext;
-       SSYNC;
-       SP += 12;
-       UNLINK;
-       ( R7:6, P5:4 ) = [SP++];
-       RTS;
-
-/* This is an internal function to flush all pending
- * writes in the cache associated with a particular ICPLB.
- *
- * R0 -  page's start address
- * R1 -  CPLB's data field.
- */
-
-.align 2
-ENTRY(_icplb_flush)
-       [--SP] = ( R7:0, P5:0 );
-       [--SP] = LC0;
-       [--SP] = LT0;
-       [--SP] = LB0;
-       [--SP] = LC1;
-       [--SP] = LT1;
-       [--SP] = LB1;
-
-       /* If it's a 1K or 4K page, then it's quickest to
-        * just systematically flush all the addresses in
-        * the page, regardless of whether they're in the
-        * cache, or dirty. If it's a 1M or 4M page, there
-        * are too many addresses, and we have to search the
-        * cache for lines corresponding to the page.
-        */
-
-       CC = BITTST(R1, 17);    /* 1MB or 4MB */
-       IF !CC JUMP iflush_whole_page;
-
-       /* We're only interested in the page's size, so extract
-        * this from the CPLB (bits 17:16), and scale to give an
-        * offset into the page_size and page_prefix tables.
-        */
-
-       R1 <<= 14;
-       R1 >>= 30;
-       R1 <<= 2;
-
-       /* We can also determine the sub-bank used, because this is
-        * taken from bits 13:12 of the address.
-        */
-
-       R3 = ((12<<8)|2);               /* Extraction pattern */
-       nop;                            /* Anamoly 05000209 */
-       R4 = EXTRACT(R0, R3.L) (Z);     /* Extract bits */
-
-       /* Save in extraction pattern for later deposit. */
-       R3.H = R4.L << 0;
-
-       /* So:
-        * R0 = Page start
-        * R1 = Page length (actually, offset into size/prefix tables)
-        * R3 = sub-bank deposit values
-        *
-        * The cache has 2 Ways, and 64 sets, so we iterate through
-        * the sets, accessing the tag for each Way, for our Bank and
-        * sub-bank, looking for dirty, valid tags that match our
-        * address prefix.
-        */
-
-       P5.L = (ITEST_COMMAND & 0xFFFF);
-       P5.H = (ITEST_COMMAND >> 16);
-       P4.L = (ITEST_DATA0 & 0xFFFF);
-       P4.H = (ITEST_DATA0 >> 16);
-
-       P0.L = page_prefix_table;
-       P0.H = page_prefix_table;
-       P1 = R1;
-       R5 = 0;                 /* Set counter*/
-       P0 = P1 + P0;
-       R4 = [P0];              /* This is the address prefix*/
-
-       /* We're reading (bit 1==0) the tag (bit 2==0), and we
-        * don't care about which double-word, since we're only
-        * fetching tags, so we only have to set Set, Bank,
-        * Sub-bank and Way.
-        */
-
-       P2 = 4;
-       LSETUP (ifs1, ife1) LC1 = P2;
-ifs1:  P0 = 32;                /* iterate over all sets*/
-       LSETUP (ifs0, ife0) LC0 = P0;
-ifs0:  R6 = R5 << 5;           /* Combine set*/
-       R6.H = R3.H << 0 ;      /* and sub-bank*/
-       [P5] = R6;              /* Issue Command*/
-       SSYNC;                  /* CSYNC will not work here :(*/
-       R7 = [P4];              /* and read Tag.*/
-       CC = BITTST(R7, 0);     /* Check if valid*/
-       IF !CC JUMP ifskip;     /* and skip if not.*/
-
-       /* Compare against the page address. First, plant bits 13:12
-        * into the tag, since those aren't part of the returned data.
-        */
-
-       R7 = DEPOSIT(R7, R3);   /* set 13:12*/
-       R1 = R7 & R4;           /* Mask off lower bits*/
-       CC = R1 == R0;          /* Compare against page start.*/
-       IF !CC JUMP ifskip;     /* Skip it if it doesn't match.*/
-
-       /* Tag address matches against page, so this is an entry
-        * we must flush.
-        */
-
-       R7 >>= 10;              /* Mask off the non-address bits*/
-       R7 <<= 10;
-       P3 = R7;
-       IFLUSH [P3];            /* And flush the entry*/
-ifskip:
-ife0:  R5 += 1;                /* Advance to next Set*/
-ife1:  NOP;
-
-ifinished:
-       SSYNC;                  /* Ensure the data gets out to mem.*/
-
-       /*Finished. Restore context.*/
-       LB1 = [SP++];
-       LT1 = [SP++];
-       LC1 = [SP++];
-       LB0 = [SP++];
-       LT0 = [SP++];
-       LC0 = [SP++];
-       ( R7:0, P5:0 ) = [SP++];
-       RTS;
-
-iflush_whole_page:
-       /* It's a 1K or 4K page, so quicker to just flush the
-        * entire page.
-        */
-
-       P1 = 32;                /* For 1K pages*/
-       P2 = P1 << 2;           /* For 4K pages*/
-       P0 = R0;                /* Start of page*/
-       CC = BITTST(R1, 16);    /* Whether 1K or 4K*/
-       IF CC P1 = P2;
-       P1 += -1;               /* Unroll one iteration*/
-       SSYNC;
-       IFLUSH [P0++];          /* because CSYNC can't end loops.*/
-       LSETUP (isall, ieall) LC0 = P1;
-isall:IFLUSH [P0++];
-ieall: NOP;
-       SSYNC;
-       JUMP ifinished;
-
-/* This is an external function being called by the user
- * application through __flush_cache_all. Currently this function
- * serves the purpose of flushing all the pending writes in
- * in the data cache.
- */
-
-ENTRY(_flush_data_cache)
-       [--SP] = ( R7:6, P5:4 );
-       LINK 12;
-       SP += -12;
-       P5.H = (DCPLB_ADDR0 >> 16);
-       P5.L = (DCPLB_ADDR0 & 0xFFFF);
-       P4.H = (DCPLB_DATA0 >> 16);
-       P4.L = (DCPLB_DATA0 & 0xFFFF);
-       R7 = CPLB_VALID | CPLB_L1_CHBL | CPLB_DIRTY (Z);
-       R6 = 16;
-next:  R0 = [P5++];
-       R1 = [P4++];
-       CC = BITTST(R1, 14);    /* Is it write-through?*/
-       IF CC JUMP skip;        /* If so, ignore it.*/
-       R2 = R1 & R7;           /* Is it a dirty, cached page?*/
-       CC = R2;
-       IF !CC JUMP skip;       /* If not, ignore it.*/
-       [--SP] = RETS;
-       CALL _dcplb_flush;      /* R0 = page, R1 = data*/
-       RETS = [SP++];
-skip:  R6 += -1;
-       CC = R6;
-       IF CC JUMP next;
-       SSYNC;
-       SP += 12;
-       UNLINK;
-       ( R7:6, P5:4 ) = [SP++];
-       RTS;
-
-/* This is an internal function to flush all pending
- * writes in the cache associated with a particular DCPLB.
- *
- * R0 -  page's start address
- * R1 -  CPLB's data field.
- */
-
-.align 2
-ENTRY(_dcplb_flush)
-       [--SP] = ( R7:0, P5:0 );
-       [--SP] = LC0;
-       [--SP] = LT0;
-       [--SP] = LB0;
-       [--SP] = LC1;
-       [--SP] = LT1;
-       [--SP] = LB1;
-
-       /* If it's a 1K or 4K page, then it's quickest to
-        * just systematically flush all the addresses in
-        * the page, regardless of whether they're in the
-        * cache, or dirty. If it's a 1M or 4M page, there
-        * are too many addresses, and we have to search the
-        * cache for lines corresponding to the page.
-        */
-
-       CC = BITTST(R1, 17);    /* 1MB or 4MB */
-       IF !CC JUMP dflush_whole_page;
-
-       /* We're only interested in the page's size, so extract
-        * this from the CPLB (bits 17:16), and scale to give an
-        * offset into the page_size and page_prefix tables.
-        */
-
-       R1 <<= 14;
-       R1 >>= 30;
-       R1 <<= 2;
-
-       /* The page could be mapped into Bank A or Bank B, depending
-        * on (a) whether both banks are configured as cache, and
-        * (b) on whether address bit A[x] is set. x is determined
-        * by DCBS in DMEM_CONTROL
-        */
-
-       R2 = 0;                 /* Default to Bank A (Bank B would be 1)*/
-
-       P0.L = (DMEM_CONTROL & 0xFFFF);
-       P0.H = (DMEM_CONTROL >> 16);
-
-       R3 = [P0];              /* If Bank B is not enabled as cache*/
-       CC = BITTST(R3, 2);     /* then Bank A is our only option.*/
-       IF CC JUMP bank_chosen;
-
-       R4 = 1<<14;             /* If DCBS==0, use A[14].*/
-       R5 = R4 << 7;           /* If DCBS==1, use A[23];*/
-       CC = BITTST(R3, 4);
-       IF CC R4 = R5;          /* R4 now has either bit 14 or bit 23 set.*/
-       R5 = R0 & R4;           /* Use it to test the Page address*/
-       CC = R5;                /* and if that bit is set, we use Bank B,*/
-       R2 = CC;                /* else we use Bank A.*/
-       R2 <<= 23;              /* The Bank selection's at posn 23.*/
-
-bank_chosen:
-
-       /* We can also determine the sub-bank used, because this is
-        * taken from bits 13:12 of the address.
-        */
-
-       R3 = ((12<<8)|2);               /* Extraction pattern */
-       nop;                            /*Anamoly 05000209*/
-       R4 = EXTRACT(R0, R3.L) (Z);     /* Extract bits*/
-       /* Save in extraction pattern for later deposit.*/
-       R3.H = R4.L << 0;
-
-       /* So:
-        * R0 = Page start
-        * R1 = Page length (actually, offset into size/prefix tables)
-        * R2 = Bank select mask
-        * R3 = sub-bank deposit values
-        *
-        * The cache has 2 Ways, and 64 sets, so we iterate through
-        * the sets, accessing the tag for each Way, for our Bank and
-        * sub-bank, looking for dirty, valid tags that match our
-        * address prefix.
-        */
-
-       P5.L = (DTEST_COMMAND & 0xFFFF);
-       P5.H = (DTEST_COMMAND >> 16);
-       P4.L = (DTEST_DATA0 & 0xFFFF);
-       P4.H = (DTEST_DATA0 >> 16);
-
-       P0.L = page_prefix_table;
-       P0.H = page_prefix_table;
-       P1 = R1;
-       R5 = 0;                 /* Set counter*/
-       P0 = P1 + P0;
-       R4 = [P0];              /* This is the address prefix*/
-
-
-       /* We're reading (bit 1==0) the tag (bit 2==0), and we
-        * don't care about which double-word, since we're only
-        * fetching tags, so we only have to set Set, Bank,
-        * Sub-bank and Way.
-        */
-
-       P2 = 2;
-       LSETUP (fs1, fe1) LC1 = P2;
-fs1:   P0 = 64;                /* iterate over all sets*/
-       LSETUP (fs0, fe0) LC0 = P0;
-fs0:   R6 = R5 << 5;           /* Combine set*/
-       R6.H = R3.H << 0 ;      /* and sub-bank*/
-       R6 = R6 | R2;           /* and Bank. Leave Way==0 at first.*/
-       BITSET(R6,14);
-       [P5] = R6;              /* Issue Command*/
-       SSYNC;
-       R7 = [P4];              /* and read Tag.*/
-       CC = BITTST(R7, 0);     /* Check if valid*/
-       IF !CC JUMP fskip;      /* and skip if not.*/
-       CC = BITTST(R7, 1);     /* Check if dirty*/
-       IF !CC JUMP fskip;      /* and skip if not.*/
-
-       /* Compare against the page address. First, plant bits 13:12
-        * into the tag, since those aren't part of the returned data.
-        */
-
-       R7 = DEPOSIT(R7, R3);   /* set 13:12*/
-       R1 = R7 & R4;           /* Mask off lower bits*/
-       CC = R1 == R0;          /* Compare against page start.*/
-       IF !CC JUMP fskip;      /* Skip it if it doesn't match.*/
-
-       /* Tag address matches against page, so this is an entry
-        * we must flush.
-        */
-
-       R7 >>= 10;              /* Mask off the non-address bits*/
-       R7 <<= 10;
-       P3 = R7;
-       SSYNC;
-       FLUSHINV [P3];          /* And flush the entry*/
-fskip:
-fe0:   R5 += 1;                /* Advance to next Set*/
-fe1:   BITSET(R2, 26);         /* Go to next Way.*/
-
-dfinished:
-       SSYNC;                  /* Ensure the data gets out to mem.*/
-
-       /*Finished. Restore context.*/
-       LB1 = [SP++];
-       LT1 = [SP++];
-       LC1 = [SP++];
-       LB0 = [SP++];
-       LT0 = [SP++];
-       LC0 = [SP++];
-       ( R7:0, P5:0 ) = [SP++];
-       RTS;
-
-dflush_whole_page:
-
-       /* It's a 1K or 4K page, so quicker to just flush the
-        * entire page.
-        */
-
-       P1 = 32;                /* For 1K pages*/
-       P2 = P1 << 2;           /* For 4K pages*/
-       P0 = R0;                /* Start of page*/
-       CC = BITTST(R1, 16);    /* Whether 1K or 4K*/
-       IF CC P1 = P2;
-       P1 += -1;               /* Unroll one iteration*/
-       SSYNC;
-       FLUSHINV [P0++];        /* because CSYNC can't end loops.*/
-       LSETUP (eall, eall) LC0 = P1;
-eall:  FLUSHINV [P0++];
-       SSYNC;
-       JUMP dfinished;
-
-.align 4;
-page_prefix_table:
-.byte4         0xFFFFFC00;     /* 1K */
-.byte4 0xFFFFF000;     /* 4K */
-.byte4 0xFFF00000;     /* 1M */
-.byte4 0xFFC00000;     /* 4M */
-.page_prefix_table.end:
diff --git a/cpu/bf537/init_sdram.S b/cpu/bf537/init_sdram.S
deleted file mode 100644 (file)
index e997500..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-#define ASSEMBLY
-
-#include <linux/config.h>
-#include <config.h>
-#include <asm/blackfin.h>
-#include <asm/mem_init.h>
-#include <asm/mach-common/bits/bootrom.h>
-#include <asm/mach-common/bits/ebiu.h>
-#include <asm/mach-common/bits/pll.h>
-#include <asm/mach-common/bits/uart.h>
-.global init_sdram;
-
-#if (BFIN_BOOT_MODE != BF537_UART_BOOT)
-#if (CONFIG_CCLK_DIV == 1)
-#define CONFIG_CCLK_ACT_DIV   CCLK_DIV1
-#endif
-#if (CONFIG_CCLK_DIV == 2)
-#define CONFIG_CCLK_ACT_DIV   CCLK_DIV2
-#endif
-#if (CONFIG_CCLK_DIV == 4)
-#define CONFIG_CCLK_ACT_DIV   CCLK_DIV4
-#endif
-#if (CONFIG_CCLK_DIV == 8)
-#define CONFIG_CCLK_ACT_DIV   CCLK_DIV8
-#endif
-#ifndef CONFIG_CCLK_ACT_DIV
-#define CONFIG_CCLK_ACT_DIV   CONFIG_CCLK_DIV_not_defined_properly
-#endif
-#endif
-
-init_sdram:
-       [--SP] = ASTAT;
-       [--SP] = RETS;
-       [--SP] = (R7:0);
-       [--SP] = (P5:0);
-
-#if (BFIN_BOOT_MODE == BF537_SPI_MASTER_BOOT)
-       p0.h = hi(SIC_IWR);
-       p0.l = lo(SIC_IWR);
-       r0.l = 0x1;
-       w[p0] = r0.l;
-       SSYNC;
-
-       p0.h = hi(SPI_BAUD);
-       p0.l = lo(SPI_BAUD);
-       r0.l = CONFIG_SPI_BAUD;
-       w[p0] = r0.l;
-       SSYNC;
-#endif
-
-#if (BFIN_BOOT_MODE != BF537_UART_BOOT)
-
-#ifdef CONFIG_BF537
-       /* Enable PHY CLK buffer output */
-       p0.h = hi(VR_CTL);
-       p0.l = lo(VR_CTL);
-       r0.l = w[p0];
-       bitset(r0, 14);
-       w[p0] = r0.l;
-       ssync;
-#endif
-       /*
-        * PLL_LOCKCNT - how many SCLK Cycles to delay while PLL becomes stable
-        */
-       p0.h = hi(PLL_LOCKCNT);
-       p0.l = lo(PLL_LOCKCNT);
-       r0 = 0x300(Z);
-       w[p0] = r0.l;
-       ssync;
-
-       /*
-        * Put SDRAM in self-refresh, incase anything is running
-        */
-       P2.H = hi(EBIU_SDGCTL);
-       P2.L = lo(EBIU_SDGCTL);
-       R0 = [P2];
-       BITSET (R0, 24);
-       [P2] = R0;
-       SSYNC;
-
-       /*
-        *  Set PLL_CTL with the value that we calculate in R0
-        *   - [14:09] = MSEL[5:0] : CLKIN / VCO multiplication factors
-        *   - [8]     = BYPASS    : BYPASS the PLL, run CLKIN into CCLK/SCLK
-        *   - [7]     = output delay (add 200ps of delay to mem signals)
-        *   - [6]     = input delay (add 200ps of input delay to mem signals)
-        *   - [5]     = PDWN      : 1=All Clocks off
-        *   - [3]     = STOPCK    : 1=Core Clock off
-        *   - [1]     = PLL_OFF   : 1=Disable Power to PLL
-        *   - [0]     = DF     : 1=Pass CLKIN/2 to PLL / 0=Pass CLKIN to PLL
-        *   all other bits set to zero
-        */
-
-       r0 = CONFIG_VCO_MULT & 63;      /* Load the VCO multiplier */
-       r0 = r0 << 9;                   /* Shift it over */
-       r1 = CONFIG_CLKIN_HALF;         /* Do we need to divide CLKIN by 2?*/
-       r0 = r1 | r0;
-       r1 = CONFIG_PLL_BYPASS;         /* Bypass the PLL? */
-       r1 = r1 << 8;                   /* Shift it over */
-       r0 = r1 | r0;                   /* add them all together */
-
-       p0.h = hi(PLL_CTL);
-       p0.l = lo(PLL_CTL);             /* Load the address */
-       cli r2;                         /* Disable interrupts */
-       ssync;
-       w[p0] = r0.l;                   /* Set the value */
-       idle;                           /* Wait for the PLL to stablize */
-       sti r2;                         /* Enable interrupts */
-
-check_again:
-       p0.h = hi(PLL_STAT);
-       p0.l = lo(PLL_STAT);
-       R0 = W[P0](Z);
-       CC = BITTST(R0,5);
-       if ! CC jump check_again;
-
-       /* Configure SCLK & CCLK Dividers */
-       r0 = (CONFIG_CCLK_ACT_DIV | CONFIG_SCLK_DIV);
-       p0.h = hi(PLL_DIV);
-       p0.l = lo(PLL_DIV);
-       w[p0] = r0.l;
-       ssync;
-#endif
-
-       /*
-        * Now, Initialize the SDRAM,
-        * start with the SDRAM Refresh Rate Control Register
-        */
-       p0.l = lo(EBIU_SDRRC);
-       p0.h = hi(EBIU_SDRRC);
-       r0 = mem_SDRRC;
-       w[p0] = r0.l;
-       ssync;
-
-       /*
-        * SDRAM Memory Bank Control Register - bank specific parameters
-        */
-       p0.l = (EBIU_SDBCTL & 0xFFFF);
-       p0.h = (EBIU_SDBCTL >> 16);
-       r0 = mem_SDBCTL;
-       w[p0] = r0.l;
-       ssync;
-
-       /*
-        * SDRAM Global Control Register - global programmable parameters
-        * Disable self-refresh
-        */
-       P2.H = hi(EBIU_SDGCTL);
-       P2.L = lo(EBIU_SDGCTL);
-       R0 = [P2];
-       BITCLR (R0, 24);
-
-       /*
-        * Check if SDRAM is already powered up, if it is, enable self-refresh
-        */
-       p0.h = hi(EBIU_SDSTAT);
-       p0.l = lo(EBIU_SDSTAT);
-       r2.l = w[p0];
-       cc = bittst(r2,3);
-       if !cc jump skip;
-       NOP;
-       BITSET (R0, 23);
-skip:
-       [P2] = R0;
-       SSYNC;
-
-       /* Write in the new value in the register */
-       R0.L = lo(mem_SDGCTL);
-       R0.H = hi(mem_SDGCTL);
-       [P2] = R0;
-       SSYNC;
-       nop;
-
-       (P5:0) = [SP++];
-       (R7:0) = [SP++];
-       RETS   = [SP++];
-       ASTAT  = [SP++];
-       RTS;
diff --git a/cpu/bf537/init_sdram_bootrom_initblock.S b/cpu/bf537/init_sdram_bootrom_initblock.S
deleted file mode 100644 (file)
index 197b836..0000000
+++ /dev/null
@@ -1,203 +0,0 @@
-#define ASSEMBLY
-
-#include <linux/config.h>
-#include <config.h>
-#include <asm/blackfin.h>
-#include <asm/mem_init.h>
-#include <asm/mach-common/bits/bootrom.h>
-#include <asm/mach-common/bits/ebiu.h>
-#include <asm/mach-common/bits/pll.h>
-#include <asm/mach-common/bits/uart.h>
-.global init_sdram;
-
-#if (BFIN_BOOT_MODE != BF537_UART_BOOT)
-#if (CONFIG_CCLK_DIV == 1)
-#define CONFIG_CCLK_ACT_DIV   CCLK_DIV1
-#endif
-#if (CONFIG_CCLK_DIV == 2)
-#define CONFIG_CCLK_ACT_DIV   CCLK_DIV2
-#endif
-#if (CONFIG_CCLK_DIV == 4)
-#define CONFIG_CCLK_ACT_DIV   CCLK_DIV4
-#endif
-#if (CONFIG_CCLK_DIV == 8)
-#define CONFIG_CCLK_ACT_DIV   CCLK_DIV8
-#endif
-#ifndef CONFIG_CCLK_ACT_DIV
-#define CONFIG_CCLK_ACT_DIV   CONFIG_CCLK_DIV_not_defined_properly
-#endif
-#endif
-
-init_sdram:
-       [--SP] = ASTAT;
-       [--SP] = RETS;
-       [--SP] = (R7:0);
-       [--SP] = (P5:0);
-
-#if (BFIN_BOOT_MODE == BF537_SPI_MASTER_BOOT)
-       p0.h = hi(SIC_IWR);
-       p0.l = lo(SIC_IWR);
-       r0.l = 0x1;
-       w[p0] = r0.l;
-       SSYNC;
-
-       p0.h = hi(SPI_BAUD);
-       p0.l = lo(SPI_BAUD);
-       r0.l = CONFIG_SPI_BAUD_INITBLOCK;
-       w[p0] = r0.l;
-       SSYNC;
-#endif
-
-#if (BFIN_BOOT_MODE != BF537_UART_BOOT)
-
-#ifdef CONFIG_BF537
-       /* Enable PHY CLK buffer output */
-       p0.h = hi(VR_CTL);
-       p0.l = lo(VR_CTL);
-       r0.l = w[p0];
-       bitset(r0, 14);
-       w[p0] = r0.l;
-       ssync;
-#endif
-       /*
-        * PLL_LOCKCNT - how many SCLK Cycles to delay while PLL becomes stable
-        */
-       p0.h = hi(PLL_LOCKCNT);
-       p0.l = lo(PLL_LOCKCNT);
-       r0 = 0x300(Z);
-       w[p0] = r0.l;
-       ssync;
-
-       /*
-        * Put SDRAM in self-refresh, incase anything is running
-        */
-       P2.H = hi(EBIU_SDGCTL);
-       P2.L = lo(EBIU_SDGCTL);
-       R0 = [P2];
-       BITSET (R0, 24);
-       [P2] = R0;
-       SSYNC;
-
-       /*
-        *  Set PLL_CTL with the value that we calculate in R0
-        *   - [14:09] = MSEL[5:0] : CLKIN / VCO multiplication factors
-        *   - [8]     = BYPASS    : BYPASS the PLL, run CLKIN into CCLK/SCLK
-        *   - [7]     = output delay (add 200ps of delay to mem signals)
-        *   - [6]     = input delay (add 200ps of input delay to mem signals)
-        *   - [5]     = PDWN      : 1=All Clocks off
-        *   - [3]     = STOPCK    : 1=Core Clock off
-        *   - [1]     = PLL_OFF   : 1=Disable Power to PLL
-        *   - [0]     = DF     : 1=Pass CLKIN/2 to PLL / 0=Pass CLKIN to PLL
-        *   all other bits set to zero
-        */
-
-       r0 = CONFIG_VCO_MULT & 63;      /* Load the VCO multiplier */
-       r0 = r0 << 9;                   /* Shift it over */
-       r1 = CONFIG_CLKIN_HALF;         /* Do we need to divide CLKIN by 2?*/
-       r0 = r1 | r0;
-       r1 = CONFIG_PLL_BYPASS;         /* Bypass the PLL? */
-       r1 = r1 << 8;                   /* Shift it over */
-       r0 = r1 | r0;                   /* add them all together */
-
-       p0.h = hi(PLL_CTL);
-       p0.l = lo(PLL_CTL);             /* Load the address */
-       cli r2;                         /* Disable interrupts */
-       ssync;
-       w[p0] = r0.l;                   /* Set the value */
-       idle;                           /* Wait for the PLL to stablize */
-       sti r2;                         /* Enable interrupts */
-
-check_again:
-       p0.h = hi(PLL_STAT);
-       p0.l = lo(PLL_STAT);
-       R0 = W[P0](Z);
-       CC = BITTST(R0,5);
-       if ! CC jump check_again;
-
-       /* Configure SCLK & CCLK Dividers */
-       r0 = (CONFIG_CCLK_ACT_DIV | CONFIG_SCLK_DIV);
-       p0.h = hi(PLL_DIV);
-       p0.l = lo(PLL_DIV);
-       w[p0] = r0.l;
-       ssync;
-#endif
-
-       /*
-        * We now are running at speed, time to set the Async mem bank wait states
-        * This will speed up execution, since we are normally running from FLASH.
-        */
-
-       p2.h = (EBIU_AMBCTL1 >> 16);
-       p2.l = (EBIU_AMBCTL1 & 0xFFFF);
-       r0.h = (AMBCTL1VAL >> 16);
-       r0.l = (AMBCTL1VAL & 0xFFFF);
-       [p2] = r0;
-       ssync;
-
-       p2.h = (EBIU_AMBCTL0 >> 16);
-       p2.l = (EBIU_AMBCTL0 & 0xFFFF);
-       r0.h = (AMBCTL0VAL >> 16);
-       r0.l = (AMBCTL0VAL & 0xFFFF);
-       [p2] = r0;
-       ssync;
-
-       p2.h = (EBIU_AMGCTL >> 16);
-       p2.l = (EBIU_AMGCTL & 0xffff);
-       r0 = AMGCTLVAL;
-       w[p2] = r0;
-       ssync;
-
-       /*
-        * Now, Initialize the SDRAM,
-        * start with the SDRAM Refresh Rate Control Register
-        */
-       p0.l = lo(EBIU_SDRRC);
-       p0.h = hi(EBIU_SDRRC);
-       r0 = mem_SDRRC;
-       w[p0] = r0.l;
-       ssync;
-
-       /*
-        * SDRAM Memory Bank Control Register - bank specific parameters
-        */
-       p0.l = (EBIU_SDBCTL & 0xFFFF);
-       p0.h = (EBIU_SDBCTL >> 16);
-       r0 = mem_SDBCTL;
-       w[p0] = r0.l;
-       ssync;
-
-       /*
-        * SDRAM Global Control Register - global programmable parameters
-        * Disable self-refresh
-        */
-       P2.H = hi(EBIU_SDGCTL);
-       P2.L = lo(EBIU_SDGCTL);
-       R0 = [P2];
-       BITCLR (R0, 24);
-
-       /*
-        * Check if SDRAM is already powered up, if it is, enable self-refresh
-        */
-       p0.h = hi(EBIU_SDSTAT);
-       p0.l = lo(EBIU_SDSTAT);
-       r2.l = w[p0];
-       cc = bittst(r2,3);
-       if !cc jump skip;
-       NOP;
-       BITSET (R0, 23);
-skip:
-       [P2] = R0;
-       SSYNC;
-
-       /* Write in the new value in the register */
-       R0.L = lo(mem_SDGCTL);
-       R0.H = hi(mem_SDGCTL);
-       [P2] = R0;
-       SSYNC;
-       nop;
-
-       (P5:0) = [SP++];
-       (R7:0) = [SP++];
-       RETS   = [SP++];
-       ASTAT  = [SP++];
-       RTS;
diff --git a/cpu/bf537/interrupt.S b/cpu/bf537/interrupt.S
deleted file mode 100644 (file)
index fe850bf..0000000
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- * U-boot - interrupt.S Processing of interrupts and exception handling
- *
- * Copyright (c) 2005-2007 Analog Devices Inc.
- *
- * (C) Copyright 2000-2004
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * This file is based on interrupt.S
- *
- * Copyright (C) 2003  Metrowerks, Inc. <mwaddel@metrowerks.com>
- * Copyright (C) 2002  Arcturus Networks Ltd. Ted Ma <mated@sympatico.ca>
- * Copyright (C) 1998  D. Jeff Dionne <jeff@ryeham.ee.ryerson.ca>,
- *                     Kenneth Albanowski <kjahds@kjahds.com>,
- *                     The Silver Hammer Group, Ltd.
- *
- * (c) 1995, Dionne & Associates
- * (c) 1995, DKG Display Tech.
- *
- * This file is also based on exception.asm
- * (C) Copyright 2001-2005 - Analog Devices, 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., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
- */
-
-#define ASSEMBLY
-#include <config.h>
-#include <asm/blackfin.h>
-#include <asm/entry.h>
-
-.global _blackfin_irq_panic;
-
-.text
-.align 2
-
-#ifndef CONFIG_KGDB
-.global _evt_emulation
-_evt_emulation:
-       SAVE_CONTEXT
-       r0 = 0;
-       r1 = seqstat;
-       sp += -12;
-       call _blackfin_irq_panic;
-       sp += 12;
-       rte;
-#endif
-
-.global _evt_nmi
-_evt_nmi:
-       SAVE_CONTEXT
-       r0 = 2;
-       r1 = RETN;
-       sp += -12;
-       call _blackfin_irq_panic;
-       sp += 12;
-
-_evt_nmi_exit:
-       rtn;
-
-.global _trap
-_trap:
-       SAVE_ALL_SYS
-       r0 = sp;        /* stack frame pt_regs pointer argument ==> r0 */
-       sp += -12;
-       call _trap_c
-       sp += 12;
-       RESTORE_ALL_SYS
-       rtx;
-
-.global _evt_rst
-_evt_rst:
-       SAVE_CONTEXT
-       r0 = 1;
-       r1 = RETN;
-       sp += -12;
-       call _do_reset;
-       sp += 12;
-
-_evt_rst_exit:
-       rtn;
-
-irq_panic:
-       r0 = 3;
-       r1 =  sp;
-       sp += -12;
-       call _blackfin_irq_panic;
-       sp += 12;
-
-.global _evt_ivhw
-_evt_ivhw:
-       SAVE_CONTEXT
-       RAISE 14;
-
-_evt_ivhw_exit:
-        rti;
-
-.global _evt_timer
-_evt_timer:
-       SAVE_CONTEXT
-       r0 = 6;
-       sp += -12;
-       /* Polling method used now. */
-       /* call timer_int; */
-       sp += 12;
-       RESTORE_CONTEXT
-       rti;
-       nop;
-
-.global _evt_evt7
-_evt_evt7:
-       SAVE_CONTEXT
-       r0 = 7;
-       sp += -12;
-       call _process_int;
-       sp += 12;
-
-evt_evt7_exit:
-       RESTORE_CONTEXT
-       rti;
-
-.global _evt_evt8
-_evt_evt8:
-       SAVE_CONTEXT
-       r0 = 8;
-       sp += -12;
-       call _process_int;
-       sp += 12;
-
-evt_evt8_exit:
-       RESTORE_CONTEXT
-       rti;
-
-.global _evt_evt9
-_evt_evt9:
-       SAVE_CONTEXT
-       r0 = 9;
-       sp += -12;
-       call _process_int;
-       sp += 12;
-
-evt_evt9_exit:
-       RESTORE_CONTEXT
-       rti;
-
-.global _evt_evt10
-_evt_evt10:
-       SAVE_CONTEXT
-       r0 = 10;
-       sp += -12;
-       call _process_int;
-       sp += 12;
-
-evt_evt10_exit:
-       RESTORE_CONTEXT
-       rti;
-
-.global _evt_evt11
-_evt_evt11:
-       SAVE_CONTEXT
-       r0 = 11;
-       sp += -12;
-       call _process_int;
-       sp += 12;
-
-evt_evt11_exit:
-       RESTORE_CONTEXT
-       rti;
-
-.global _evt_evt12
-_evt_evt12:
-       SAVE_CONTEXT
-       r0 = 12;
-       sp += -12;
-       call _process_int;
-       sp += 12;
-evt_evt12_exit:
-        RESTORE_CONTEXT
-        rti;
-
-.global _evt_evt13
-_evt_evt13:
-       SAVE_CONTEXT
-       r0 = 13;
-       sp += -12;
-       call _process_int;
-       sp += 12;
-
-evt_evt13_exit:
-        RESTORE_CONTEXT
-        rti;
-
-.global _evt_system_call
-_evt_system_call:
-       [--sp] = r0;
-       [--SP] = RETI;
-       r0 = [sp++];
-       r0 += 2;
-       [--sp] = r0;
-       RETI = [SP++];
-       r0 = [SP++];
-       SAVE_CONTEXT
-       sp += -12;
-       call _exception_handle;
-       sp += 12;
-       RESTORE_CONTEXT
-       RTI;
-
-evt_system_call_exit:
-       rti;
-
-.global _evt_soft_int1
-_evt_soft_int1:
-       [--sp] = r0;
-       [--SP] = RETI;
-       r0 = [sp++];
-       r0 += 2;
-       [--sp] = r0;
-       RETI = [SP++];
-       r0 = [SP++];
-       SAVE_CONTEXT
-       sp += -12;
-       call _exception_handle;
-       sp += 12;
-       RESTORE_CONTEXT
-       RTI;
-
-evt_soft_int1_exit:
-       rti;
diff --git a/cpu/bf537/interrupts.c b/cpu/bf537/interrupts.c
deleted file mode 100644 (file)
index 853fa49..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * U-boot - interrupts.c Interrupt related routines
- *
- * Copyright (c) 2005-2007 Analog Devices Inc.
- *
- * This file is based on interrupts.c
- * Copyright 1996 Roman Zippel
- * Copyright 1999 D. Jeff Dionne <jeff@uclinux.org>
- * Copyright 2000-2001 Lineo, Inc. D. Jefff Dionne <jeff@lineo.ca>
- * Copyright 2002 Arcturus Networks Inc. MaTed <mated@sympatico.ca>
- * Copyright 2003 Metrowerks/Motorola
- * Copyright 2003 Bas Vermeulen <bas@buyways.nl>,
- *                     BuyWays B.V. (www.buyways.nl)
- *
- * (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 "cpu.h"
-
-static ulong timestamp;
-static ulong last_time;
-static int int_flag;
-
-int irq_flags;                 /* needed by asm-blackfin/system.h */
-
-/* Functions just to satisfy the linker */
-
-/*
- * This function is derived from PowerPC code (read timebase as long long).
- * On BF533 it just returns the timer value.
- */
-unsigned long long get_ticks(void)
-{
-       return get_timer(0);
-}
-
-/*
- * This function is derived from PowerPC code (timebase clock frequency).
- * On BF533 it returns the number of timer ticks per second.
- */
-ulong get_tbclk (void)
-{
-       ulong tbclk;
-
-       tbclk = CFG_HZ;
-       return tbclk;
-}
-
-void enable_interrupts(void)
-{
-}
-
-int disable_interrupts(void)
-{
-       return 1;
-}
-
-int interrupt_init(void)
-{
-       return (0);
-}
-
-void udelay(unsigned long usec)
-{
-       unsigned long delay, start, stop;
-       unsigned long cclk;
-       cclk = (CONFIG_CCLK_HZ);
-
-       while (usec > 1) {
-               /*
-                * how many clock ticks to delay?
-                *  - request(in useconds) * clock_ticks(Hz) / useconds/second
-                */
-               if (usec < 1000) {
-                       delay = (usec * (cclk / 244)) >> 12;
-                       usec = 0;
-               } else {
-                       delay = (1000 * (cclk / 244)) >> 12;
-                       usec -= 1000;
-               }
-
-               asm volatile (" %0 = CYCLES;":"=r" (start));
-               do {
-                       asm volatile (" %0 = CYCLES; ":"=r" (stop));
-               } while (stop - start < delay);
-       }
-
-       return;
-}
-
-void timer_init(void)
-{
-       *pTCNTL = 0x1;
-       *pTSCALE = 0x0;
-       *pTCOUNT = MAX_TIM_LOAD;
-       *pTPERIOD = MAX_TIM_LOAD;
-       *pTCNTL = 0x7;
-       asm("CSYNC;");
-
-       timestamp = 0;
-       last_time = 0;
-}
-
-/* Any network command or flash
- * command is started get_timer shall
- * be called before TCOUNT gets reset,
- * to implement the accurate timeouts.
- *
- * How ever milliconds doesn't return
- * the number that has been elapsed from
- * the last reset.
- *
- *  As get_timer is used in the u-boot
- *  only for timeouts this should be
- *  sufficient
- */
-ulong get_timer(ulong base)
-{
-       ulong milisec;
-
-       /* Number of clocks elapsed */
-       ulong clocks = (MAX_TIM_LOAD - (*pTCOUNT));
-
-       /**
-        * Find if the TCOUNT is reset
-        * timestamp gives the number of times
-        * TCOUNT got reset
-        */
-       if (clocks < last_time)
-               timestamp++;
-       last_time = clocks;
-
-       /* Get the number of milliseconds */
-       milisec = clocks / (CONFIG_CCLK_HZ / 1000);
-
-       /**
-        * Find the number of millisonds
-        * that got elapsed before this TCOUNT cycle
-        */
-       milisec += timestamp * (MAX_TIM_LOAD / (CONFIG_CCLK_HZ / 1000));
-
-       return (milisec - base);
-}
-
-void reset_timer (void)
-{
-       timestamp = 0;
-}
diff --git a/cpu/bf537/ints.c b/cpu/bf537/ints.c
deleted file mode 100644 (file)
index 05d9a1b..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * U-boot - ints.c Interrupt related routines
- *
- * Copyright (c) 2005-2007 Analog Devices Inc.
- *
- * This file is based on ints.c
- *
- * Apr18 2003, Changed by HuTao to support interrupt cascading for Blackfin
- *             drivers
- *
- * Copyright 1996 Roman Zippel
- * Copyright 1999 D. Jeff Dionne <jeff@uclinux.org>
- * Copyright 2000-2001 Lineo, Inc. D. Jefff Dionne <jeff@lineo.ca>
- * Copyright 2002 Arcturus Networks Inc. MaTed <mated@sympatico.ca>
- * Copyright 2003 Metrowerks/Motorola
- *
- * (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 <linux/stddef.h>
-#include <asm/system.h>
-#include <asm/traps.h>
-#include <asm/io.h>
-#include <asm/errno.h>
-#include <asm/blackfin.h>
-#include "cpu.h"
-
-void blackfin_irq_panic(int reason, struct pt_regs *regs)
-{
-       printf("\n\nException: IRQ 0x%x entered\n", reason);
-       printf("code=[0x%x], ", (unsigned int)(regs->seqstat & 0x3f));
-       printf("stack frame=0x%x, ", (unsigned int)regs);
-       printf("bad PC=0x%04x\n", (unsigned int)regs->pc);
-       dump(regs);
-       printf("Unhandled IRQ or exceptions!\n");
-       printf("Please reset the board \n");
-}
-
-void blackfin_init_IRQ(void)
-{
-       *(unsigned volatile long *)(SIC_IMASK) = 0;
-#ifndef CONFIG_KGDB
-       *(unsigned volatile long *)(EVT1) = 0x0;
-#endif
-       *(unsigned volatile long *)(EVT2) =
-           (unsigned volatile long)evt_nmi;
-       *(unsigned volatile long *)(EVT3) =
-           (unsigned volatile long)trap;
-       *(unsigned volatile long *)(EVT5) =
-           (unsigned volatile long)evt_ivhw;
-       *(unsigned volatile long *)(EVT0) =
-           (unsigned volatile long)evt_rst;
-       *(unsigned volatile long *)(EVT6) =
-           (unsigned volatile long)evt_timer;
-       *(unsigned volatile long *)(EVT7) =
-           (unsigned volatile long)evt_evt7;
-       *(unsigned volatile long *)(EVT8) =
-           (unsigned volatile long)evt_evt8;
-       *(unsigned volatile long *)(EVT9) =
-           (unsigned volatile long)evt_evt9;
-       *(unsigned volatile long *)(EVT10) =
-           (unsigned volatile long)evt_evt10;
-       *(unsigned volatile long *)(EVT11) =
-           (unsigned volatile long)evt_evt11;
-       *(unsigned volatile long *)(EVT12) =
-           (unsigned volatile long)evt_evt12;
-       *(unsigned volatile long *)(EVT13) =
-           (unsigned volatile long)evt_evt13;
-       *(unsigned volatile long *)(EVT14) =
-           (unsigned volatile long)evt_system_call;
-       *(unsigned volatile long *)(EVT15) =
-           (unsigned volatile long)evt_soft_int1;
-       *(volatile unsigned long *)ILAT = 0;
-       asm("csync;");
-       *(volatile unsigned long *)IMASK = 0xffbf;
-       asm("csync;");
-}
-
-void exception_handle(void)
-{
-#if defined (CONFIG_PANIC_HANG)
-       display_excp();
-#else
-       udelay(100000);         /* allow messages to go out */
-       do_reset(NULL, 0, 0, NULL);
-#endif
-}
-
-void display_excp(void)
-{
-       printf("Exception!\n");
-}
diff --git a/cpu/bf537/serial.c b/cpu/bf537/serial.c
deleted file mode 100644 (file)
index 3c6a370..0000000
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * U-boot - serial.c Serial driver for BF537
- *
- * Copyright (c) 2005-2007 Analog Devices Inc.
- *
- * This file is based on
- * bf537_serial.c: Serial driver for BlackFin BF537 internal UART.
- * Copyright (c) 2003  Bas Vermeulen <bas@buyways.nl>,
- *                     BuyWays B.V. (www.buyways.nl)
- *
- * Based heavily on blkfinserial.c
- * blkfinserial.c: Serial driver for BlackFin DSP internal USRTs.
- * Copyright(c) 2003   Metrowerks      <mwaddel@metrowerks.com>
- * Copyright(c)        2001    Tony Z. Kou     <tonyko@arcturusnetworks.com>
- * Copyright(c)        2001-2002 Arcturus Networks Inc. <www.arcturusnetworks.com>
- *
- * Based on code from 68328 version serial driver imlpementation which was:
- * Copyright (C) 1995       David S. Miller    <davem@caip.rutgers.edu>
- * Copyright (C) 1998       Kenneth Albanowski <kjahds@kjahds.com>
- * Copyright (C) 1998, 1999 D. Jeff Dionne     <jeff@uclinux.org>
- * Copyright (C) 1999       Vladimir Gurevich  <vgurevic@cisco.com>
- *
- * (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 <asm/system.h>
-#include <asm/bitops.h>
-#include <asm/delay.h>
-#include <asm/io.h>
-#include "serial.h"
-#include <asm/mach-common/bits/uart.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-unsigned long pll_div_fact;
-
-void calc_baud(void)
-{
-       unsigned char i;
-       int temp;
-       u_long sclk = get_sclk();
-
-       for (i = 0; i < sizeof(baud_table) / sizeof(int); i++) {
-               temp = sclk / (baud_table[i] * 8);
-               if ((temp & 0x1) == 1) {
-                       temp++;
-               }
-               temp = temp / 2;
-               hw_baud_table[i].dl_high = (temp >> 8) & 0xFF;
-               hw_baud_table[i].dl_low = (temp) & 0xFF;
-       }
-}
-
-void serial_setbrg(void)
-{
-       int i;
-
-       calc_baud();
-
-       for (i = 0; i < sizeof(baud_table) / sizeof(int); i++) {
-               if (gd->baudrate == baud_table[i])
-                       break;
-       }
-
-       /* Enable UART */
-       *pUART0_GCTL |= UCEN;
-       SSYNC();
-
-       /* Set DLAB in LCR to Access DLL and DLH */
-       ACCESS_LATCH;
-       SSYNC();
-
-       *pUART0_DLL = hw_baud_table[i].dl_low;
-       SSYNC();
-       *pUART0_DLH = hw_baud_table[i].dl_high;
-       SSYNC();
-
-       /* Clear DLAB in LCR to Access THR RBR IER */
-       ACCESS_PORT_IER;
-       SSYNC();
-
-       /* Enable  ERBFI and ELSI interrupts
-        * to poll SIC_ISR register*/
-       *pUART0_IER = ELSI | ERBFI | ETBEI;
-       SSYNC();
-
-       /* Set LCR to Word Lengh 8-bit word select */
-       *pUART0_LCR = WLS_8;
-       SSYNC();
-
-       return;
-}
-
-int serial_init(void)
-{
-       serial_setbrg();
-       return (0);
-}
-
-void serial_putc(const char c)
-{
-       if ((*pUART0_LSR) & TEMT) {
-               if (c == '\n')
-                       serial_putc('\r');
-
-               local_put_char(c);
-       }
-
-       while (!((*pUART0_LSR) & TEMT))
-               SYNC_ALL;
-
-       return;
-}
-
-int serial_tstc(void)
-{
-       if (*pUART0_LSR & DR)
-               return 1;
-       else
-               return 0;
-}
-
-int serial_getc(void)
-{
-       unsigned short uart_lsr_val, uart_rbr_val;
-       unsigned long isr_val;
-       int ret;
-
-       /* Poll for RX Interrupt */
-       while (!serial_tstc())
-               continue;
-       asm("csync;");
-
-       uart_lsr_val = *pUART0_LSR;     /* Clear status bit */
-       uart_rbr_val = *pUART0_RBR;     /* getc() */
-
-       if (uart_lsr_val & (OE|PE|FE|BI)) {
-               ret = -1;
-       } else {
-               ret = uart_rbr_val & 0xff;
-       }
-
-       return ret;
-}
-
-void serial_puts(const char *s)
-{
-       while (*s) {
-               serial_putc(*s++);
-       }
-}
-
-static void local_put_char(char ch)
-{
-       int flags = 0;
-       unsigned long isr_val;
-
-       /* Poll for TX Interruput */
-       while (!(*pUART0_LSR & THRE))
-               continue;
-       asm("csync;");
-
-       *pUART0_THR = ch;       /* putc() */
-
-       return;
-}
diff --git a/cpu/bf537/serial.h b/cpu/bf537/serial.h
deleted file mode 100644 (file)
index e4e0b9a..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * U-boot - bf537_serial.h Serial Driver defines
- *
- * Copyright (c) 2005-2007 Analog Devices Inc.
- *
- * This file is based on
- * bf533_serial.h: Definitions for the BlackFin BF533 DSP serial driver.
- * Copyright (C) 2003  Bas Vermeulen <bas@buyways.nl>
- *                     BuyWays B.V. (www.buyways.nl)
- *
- * Based heavily on:
- * blkfinserial.h: Definitions for the BlackFin DSP serial driver.
- *
- * Copyright (C) 2001  Tony Z. Kou     tonyko@arcturusnetworks.com
- * Copyright (C) 2001   Arcturus Networks Inc. <www.arcturusnetworks.com>
- *
- * Based on code from 68328serial.c which was:
- * Copyright (C) 1995       David S. Miller    <davem@caip.rutgers.edu>
- * Copyright (C) 1998       Kenneth Albanowski <kjahds@kjahds.com>
- * Copyright (C) 1998, 1999 D. Jeff Dionne     <jeff@uclinux.org>
- * Copyright (C) 1999       Vladimir Gurevich  <vgurevic@cisco.com>
- *
- * (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
- */
-
-#ifndef _Bf537_SERIAL_H
-#define _Bf537_SERIAL_H
-
-#include <linux/config.h>
-#include <asm/blackfin.h>
-
-#define SYNC_ALL       __asm__ __volatile__ ("ssync;\n")
-#define ACCESS_LATCH   *pUART0_LCR |= DLAB;
-#define ACCESS_PORT_IER        *pUART0_LCR &= (~DLAB);
-
-void serial_setbrg(void);
-static void local_put_char(char ch);
-void calc_baud(void);
-void serial_setbrg(void);
-int serial_init(void);
-void serial_putc(const char c);
-int serial_tstc(void);
-int serial_getc(void);
-void serial_puts(const char *s);
-static void local_put_char(char ch);
-
-int baud_table[5] = { 9600, 19200, 38400, 57600, 115200 };
-
-struct {
-       unsigned char dl_high;
-       unsigned char dl_low;
-} hw_baud_table[5];
-
-#ifdef CONFIG_STAMP
-extern unsigned long pll_div_fact;
-#endif
-
-#endif
diff --git a/cpu/bf537/start.S b/cpu/bf537/start.S
deleted file mode 100644 (file)
index a48f3c6..0000000
+++ /dev/null
@@ -1,576 +0,0 @@
-/*
- * U-boot - start.S Startup file of u-boot for BF537
- *
- * Copyright (c) 2005-2007 Analog Devices Inc.
- *
- * This file is based on head.S
- * Copyright (c) 2003  Metrowerks/Motorola
- * Copyright (C) 1998  D. Jeff Dionne <jeff@ryeham.ee.ryerson.ca>,
- *                     Kenneth Albanowski <kjahds@kjahds.com>,
- *                     The Silver Hammer Group, Ltd.
- * (c) 1995, Dionne & Associates
- * (c) 1995, DKG Display Tech.
- *
- * 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
- */
-
-/*
- * Note: A change in this file subsequently requires a change in
- *       board/$(board_name)/config.mk for a valid u-boot.bin
- */
-
-#define ASSEMBLY
-
-#include <linux/config.h>
-#include <config.h>
-#include <asm/blackfin.h>
-
-#include <asm/mach-common/bits/core.h>
-#include <asm/mach-common/bits/dma.h>
-#include <asm/mach-common/bits/pll.h>
-
-.global _stext;
-.global __bss_start;
-.global start;
-.global _start;
-.global edata;
-.global _exit;
-.global init_sdram;
-.global _icache_enable;
-.global _dcache_enable;
-#if defined(CONFIG_BF537)&&defined(CONFIG_POST)
-.global _memory_post_test;
-.global _post_flag;
-#endif
-
-#if (BFIN_BOOT_MODE == BF537_UART_BOOT)
-#if (CONFIG_CCLK_DIV == 1)
-#define CONFIG_CCLK_ACT_DIV   CCLK_DIV1
-#endif
-#if (CONFIG_CCLK_DIV == 2)
-#define CONFIG_CCLK_ACT_DIV   CCLK_DIV2
-#endif
-#if (CONFIG_CCLK_DIV == 4)
-#define CONFIG_CCLK_ACT_DIV   CCLK_DIV4
-#endif
-#if (CONFIG_CCLK_DIV == 8)
-#define CONFIG_CCLK_ACT_DIV   CCLK_DIV8
-#endif
-#ifndef CONFIG_CCLK_ACT_DIV
-#define CONFIG_CCLK_ACT_DIV   CONFIG_CCLK_DIV_not_defined_properly
-#endif
-#endif
-
-.text
-_start:
-start:
-_stext:
-
-       R0 = 0x32;
-       SYSCFG = R0;
-       SSYNC;
-
-       /* As per HW reference manual DAG registers,
-        * DATA and Address resgister shall be zero'd
-        * in initialization, after a reset state
-        */
-       r1 = 0; /* Data registers zero'd */
-       r2 = 0;
-       r3 = 0;
-       r4 = 0;
-       r5 = 0;
-       r6 = 0;
-       r7 = 0;
-
-       p0 = 0; /* Address registers zero'd */
-       p1 = 0;
-       p2 = 0;
-       p3 = 0;
-       p4 = 0;
-       p5 = 0;
-
-       i0 = 0; /* DAG Registers zero'd */
-       i1 = 0;
-       i2 = 0;
-       i3 = 0;
-       m0 = 0;
-       m1 = 0;
-       m3 = 0;
-       m3 = 0;
-       l0 = 0;
-       l1 = 0;
-       l2 = 0;
-       l3 = 0;
-       b0 = 0;
-       b1 = 0;
-       b2 = 0;
-       b3 = 0;
-
-       /* Set loop counters to zero, to make sure that
-        * hw loops are disabled.
-        */
-       r0  = 0;
-       lc0 = r0;
-       lc1 = r0;
-
-       SSYNC;
-
-       /* Check soft reset status */
-       p0.h = SWRST >> 16;
-       p0.l = SWRST & 0xFFFF;
-       r0.l = w[p0];
-
-       cc = bittst(r0, 15);
-       if !cc jump no_soft_reset;
-
-       /* Clear Soft reset */
-       r0 = 0x0000;
-       w[p0] = r0;
-       ssync;
-
-no_soft_reset:
-       nop;
-
-       /* Clear EVT registers */
-       p0.h = (EVT0 >> 16);
-       p0.l = (EVT0 & 0xFFFF);
-       p0 += 8;
-       p1 = 14;
-       r1 = 0;
-       LSETUP(4,4) lc0 = p1;
-       [ p0 ++ ] = r1;
-
-#if (BFIN_BOOT_MODE != BF537_SPI_MASTER_BOOT)
-       p0.h = hi(SIC_IWR);
-       p0.l = lo(SIC_IWR);
-       r0.l = 0x1;
-       w[p0] = r0.l;
-       SSYNC;
-#endif
-
-#if (BFIN_BOOT_MODE == BF537_UART_BOOT)
-
-       p0.h = hi(SIC_IWR);
-       p0.l = lo(SIC_IWR);
-       r0.l = 0x1;
-       w[p0] = r0.l;
-       SSYNC;
-
-       /*
-       * PLL_LOCKCNT - how many SCLK Cycles to delay while PLL becomes stable
-       */
-       p0.h = hi(PLL_LOCKCNT);
-       p0.l = lo(PLL_LOCKCNT);
-       r0 = 0x300(Z);
-       w[p0] = r0.l;
-       ssync;
-
-       /*
-       * Put SDRAM in self-refresh, incase anything is running
-       */
-       P2.H = hi(EBIU_SDGCTL);
-       P2.L = lo(EBIU_SDGCTL);
-       R0 = [P2];
-       BITSET (R0, 24);
-       [P2] = R0;
-       SSYNC;
-
-       /*
-       *  Set PLL_CTL with the value that we calculate in R0
-       *   - [14:09] = MSEL[5:0] : CLKIN / VCO multiplication factors
-       *   - [8]     = BYPASS    : BYPASS the PLL, run CLKIN into CCLK/SCLK
-       *   - [7]     = output delay (add 200ps of delay to mem signals)
-       *   - [6]     = input delay (add 200ps of input delay to mem signals)
-       *   - [5]     = PDWN      : 1=All Clocks off
-       *   - [3]     = STOPCK    : 1=Core Clock off
-       *   - [1]     = PLL_OFF   : 1=Disable Power to PLL
-       *   - [0]     = DF        : 1=Pass CLKIN/2 to PLL / 0=Pass CLKIN to PLL
-       *   all other bits set to zero
-       */
-
-       r0 = CONFIG_VCO_MULT & 63;      /* Load the VCO multiplier         */
-       r0 = r0 << 9;                   /* Shift it over,                  */
-       r1 = CONFIG_CLKIN_HALF;        /* Do we need to divide CLKIN by 2?*/
-       r0 = r1 | r0;
-       r1 = CONFIG_PLL_BYPASS;         /* Bypass the PLL?                 */
-       r1 = r1 << 8;                   /* Shift it over                   */
-       r0 = r1 | r0;                   /* add them all together           */
-
-       p0.h = hi(PLL_CTL);
-       p0.l = lo(PLL_CTL);             /* Load the address                */
-       cli r2;                         /* Disable interrupts              */
-               ssync;
-       w[p0] = r0.l;                   /* Set the value                   */
-       idle;                           /* Wait for the PLL to stablize    */
-       sti r2;                         /* Enable interrupts               */
-
-check_again:
-       p0.h = hi(PLL_STAT);
-       p0.l = lo(PLL_STAT);
-       R0 = W[P0](Z);
-       CC = BITTST(R0,5);
-       if ! CC jump check_again;
-
-       /* Configure SCLK & CCLK Dividers */
-       r0 = (CONFIG_CCLK_ACT_DIV | CONFIG_SCLK_DIV);
-       p0.h = hi(PLL_DIV);
-       p0.l = lo(PLL_DIV);
-       w[p0] = r0.l;
-       ssync;
-#endif
-
-       /*
-        * We now are running at speed, time to set the Async mem bank wait states
-        * This will speed up execution, since we are normally running from FLASH.
-        * we need to read MAC address from FLASH
-        */
-       p2.h = (EBIU_AMBCTL1 >> 16);
-       p2.l = (EBIU_AMBCTL1 & 0xFFFF);
-       r0.h = (AMBCTL1VAL >> 16);
-       r0.l = (AMBCTL1VAL & 0xFFFF);
-       [p2] = r0;
-       ssync;
-
-       p2.h = (EBIU_AMBCTL0 >> 16);
-       p2.l = (EBIU_AMBCTL0 & 0xFFFF);
-       r0.h = (AMBCTL0VAL >> 16);
-       r0.l = (AMBCTL0VAL & 0xFFFF);
-       [p2] = r0;
-       ssync;
-
-       p2.h = (EBIU_AMGCTL >> 16);
-       p2.l = (EBIU_AMGCTL & 0xffff);
-       r0 = AMGCTLVAL;
-       w[p2] = r0;
-       ssync;
-
-#if ((BFIN_BOOT_MODE != BF537_SPI_MASTER_BOOT) && (BFIN_BOOT_MODE != BF537_UART_BOOT))
-       sp.l = (0xffb01000 & 0xFFFF);
-       sp.h = (0xffb01000 >> 16);
-
-       call init_sdram;
-#endif
-
-
-#if defined(CONFIG_BF537)&&defined(CONFIG_POST)
-       /* DMA POST code to Hi of L1 SRAM */
-postcopy:
-       /* P1 Points to the beginning of SYSTEM MMR Space */
-       P1.H = hi(SYSMMR_BASE);
-       P1.L = lo(SYSMMR_BASE);
-
-       R0.H = _text_l1;
-       R0.L = _text_l1;
-       R1.H = _etext_l1;
-       R1.L = _etext_l1;
-       R2 = R1 - R0;           /* Count */
-       R0.H = _etext;
-       R0.L = _etext;
-       R1.H = (CFG_MONITOR_BASE >> 16);
-       R1.L = (CFG_MONITOR_BASE & 0xFFFF);
-       R0 = R0 - R1;
-       R1.H = (CFG_FLASH_BASE >> 16);
-       R1.L = (CFG_FLASH_BASE & 0xFFFF);
-       R0 = R0 + R1;           /* Source Address */
-       R1.H = hi(L1_INST_SRAM);    /* Destination Address (high) */
-       R1.L = lo(L1_INST_SRAM);    /* Destination Address (low) */
-       R3.L = DMAEN;           /* Source DMAConfig Value (8-bit words) */
-       /* Destination DMAConfig Value (8-bit words) */
-       R4.L = (DI_EN | WNR | DMAEN);
-
-       R6 = 0x1 (Z);
-       W[P1+OFFSET_(MDMA_S0_X_MODIFY)] = R6;   /* Source Modify = 1 */
-       W[P1+OFFSET_(MDMA_D0_X_MODIFY)] = R6;   /* Destination Modify = 1 */
-
-       [P1+OFFSET_(MDMA_S0_START_ADDR)] = R0;  /* Set Source Base Address */
-       W[P1+OFFSET_(MDMA_S0_X_COUNT)] = R2;    /* Set Source Count */
-       /* Set Source  DMAConfig = DMA Enable,
-       Memory Read,  8-Bit Transfers, 1-D DMA, Flow - Stop */
-       W[P1+OFFSET_(MDMA_S0_CONFIG)] = R3;
-
-       [P1+OFFSET_(MDMA_D0_START_ADDR)] = R1;  /* Set Destination Base Address */
-       W[P1+OFFSET_(MDMA_D0_X_COUNT)] = R2;    /* Set Destination Count */
-       /* Set Destination DMAConfig = DMA Enable,
-       Memory Write, 8-Bit Transfers, 1-D DMA, Flow - Stop, IOC */
-       W[P1+OFFSET_(MDMA_D0_CONFIG)] = R4;
-
-POST_DMA_DONE:
-       p0.h = hi(MDMA_D0_IRQ_STATUS);
-       p0.l = lo(MDMA_D0_IRQ_STATUS);
-       R0 = W[P0](Z);
-       CC = BITTST(R0, 0);
-       if ! CC jump POST_DMA_DONE
-
-       R0 = 0x1;
-       W[P1+OFFSET_(MDMA_D0_IRQ_STATUS)] = R0; /* Write 1 to clear DMA interrupt */
-
-       /* DMA POST data to Hi of L1 SRAM */
-       R0.H = _rodata_l1;
-       R0.L = _rodata_l1;
-       R1.H = _erodata_l1;
-       R1.L = _erodata_l1;
-       R2 = R1 - R0;           /* Count */
-       R0.H = _erodata;
-       R0.L = _erodata;
-       R1.H = (CFG_MONITOR_BASE >> 16);
-       R1.L = (CFG_MONITOR_BASE & 0xFFFF);
-       R0 = R0 - R1;
-       R1.H = (CFG_FLASH_BASE >> 16);
-       R1.L = (CFG_FLASH_BASE & 0xFFFF);
-       R0 = R0 + R1;           /* Source Address */
-       R1.H = hi(DATA_BANKB_SRAM);    /* Destination Address (high) */
-       R1.L = lo(DATA_BANKB_SRAM);    /* Destination Address (low) */
-       R3.L = DMAEN;           /* Source DMAConfig Value (8-bit words) */
-       R4.L = (DI_EN | WNR | DMAEN);   /* Destination DMAConfig Value (8-bit words) */
-
-       R6 = 0x1 (Z);
-       W[P1+OFFSET_(MDMA_S0_X_MODIFY)] = R6;   /* Source Modify = 1 */
-       W[P1+OFFSET_(MDMA_D0_X_MODIFY)] = R6;   /* Destination Modify = 1 */
-
-       [P1+OFFSET_(MDMA_S0_START_ADDR)] = R0;  /* Set Source Base Address */
-       W[P1+OFFSET_(MDMA_S0_X_COUNT)] = R2;    /* Set Source Count */
-       /* Set Source  DMAConfig = DMA Enable,
-       Memory Read,  8-Bit Transfers, 1-D DMA, Flow - Stop */
-       W[P1+OFFSET_(MDMA_S0_CONFIG)] = R3;
-
-       [P1+OFFSET_(MDMA_D0_START_ADDR)] = R1;  /* Set Destination Base Address */
-       W[P1+OFFSET_(MDMA_D0_X_COUNT)] = R2;    /* Set Destination Count */
-       /* Set Destination DMAConfig = DMA Enable,
-       Memory Write, 8-Bit Transfers, 1-D DMA, Flow - Stop, IOC */
-       W[P1+OFFSET_(MDMA_D0_CONFIG)] = R4;
-
-POST_DATA_DMA_DONE:
-       p0.h = hi(MDMA_D0_IRQ_STATUS);
-       p0.l = lo(MDMA_D0_IRQ_STATUS);
-       R0 = W[P0](Z);
-       CC = BITTST(R0, 0);
-       if ! CC jump POST_DATA_DMA_DONE
-
-       R0 = 0x1;
-       W[P1+OFFSET_(MDMA_D0_IRQ_STATUS)] = R0; /* Write 1 to clear DMA interrupt */
-
-       p0.l = _memory_post_test;
-       p0.h = _memory_post_test;
-       r0 = 0x0;
-       call (p0);
-       r7 = r0;                                /* save return value */
-
-       call init_sdram;
-#endif
-
-       /* relocate into to RAM */
-       call get_pc;
-offset:
-       r2.l = offset;
-       r2.h = offset;
-       r3.l = start;
-       r3.h = start;
-       r1 = r2 - r3;
-
-       r0 = r0 - r1;
-       p1 = r0;
-
-       p2.l = (CFG_MONITOR_BASE & 0xffff);
-       p2.h = (CFG_MONITOR_BASE >> 16);
-
-       p3 = 0x04;
-       p4.l = ((CFG_MONITOR_BASE + CFG_MONITOR_LEN) & 0xffff);
-       p4.h = ((CFG_MONITOR_BASE + CFG_MONITOR_LEN) >> 16);
-loop1:
-       r1 = [p1 ++ p3];
-       [p2 ++ p3] = r1;
-       cc=p2==p4;
-       if !cc jump loop1;
-       /*
-        * configure STACK
-        */
-       r0.h = (CONFIG_STACKBASE >> 16);
-       r0.l = (CONFIG_STACKBASE & 0xFFFF);
-       sp = r0;
-       fp = sp;
-
-       /*
-        * This next section keeps the processor in supervisor mode
-        * during kernel boot.  Switches to user mode at end of boot.
-        * See page 3-9 of Hardware Reference manual for documentation.
-        */
-
-       /* To keep ourselves in the supervisor mode */
-       p0.l = (EVT15 & 0xFFFF);
-       p0.h = (EVT15 >> 16);
-
-       p1.l = _real_start;
-       p1.h = _real_start;
-       [p0] = p1;
-
-       p0.l = (IMASK & 0xFFFF);
-       p0.h = (IMASK >> 16);
-       r0.l = LO(EVT_IVG15);
-       r0.h = HI(EVT_IVG15);
-       [p0] = r0;
-       raise 15;
-       p0.l = WAIT_HERE;
-       p0.h = WAIT_HERE;
-       reti = p0;
-       rti;
-
-WAIT_HERE:
-       jump WAIT_HERE;
-
-.global _real_start;
-_real_start:
-       [ -- sp ] = reti;
-
-#ifdef CONFIG_BF537
-/* Initialise General-Purpose I/O Modules on BF537
- * Rev 0.0 Anomaly 05000212 - PORTx_FER,
- * PORT_MUX Registers Do Not accept "writes" correctly
- */
-       p0.h = hi(PORTF_FER);
-       p0.l = lo(PORTF_FER);
-       R0.L = W[P0]; /* Read */
-       nop;
-       nop;
-       nop;
-       ssync;
-       R0 = 0x000F(Z);
-       W[P0] = R0.L; /* Write */
-       nop;
-       nop;
-       nop;
-       ssync;
-       W[P0] = R0.L; /* Enable peripheral function of PORTF for UART0 and UART1 */
-       nop;
-       nop;
-       nop;
-       ssync;
-
-       p0.h = hi(PORTH_FER);
-       p0.l = lo(PORTH_FER);
-       R0.L = W[P0]; /* Read */
-       nop;
-       nop;
-       nop;
-       ssync;
-       R0 = 0xFFFF(Z);
-       W[P0] = R0.L; /* Write */
-       nop;
-       nop;
-       nop;
-       ssync;
-       W[P0] = R0.L; /* Enable peripheral function of PORTH for MAC */
-       nop;
-       nop;
-       nop;
-       ssync;
-
-#endif
-
-       /* DMA reset code to Hi of L1 SRAM */
-copy:
-       P1.H = hi(SYSMMR_BASE); /* P1 Points to the beginning of SYSTEM MMR Space */
-       P1.L = lo(SYSMMR_BASE);
-
-       R0.H = reset_start;     /* Source Address (high) */
-       R0.L = reset_start;     /* Source Address (low) */
-       R1.H = reset_end;
-       R1.L = reset_end;
-       R2 = R1 - R0;           /* Count */
-       R1.H = hi(L1_INST_SRAM);        /* Destination Address (high) */
-       R1.L = lo(L1_INST_SRAM);        /* Destination Address (low) */
-       R3.L = DMAEN;           /* Source DMAConfig Value (8-bit words) */
-       R4.L = (DI_EN | WNR | DMAEN);   /* Destination DMAConfig Value (8-bit words) */
-
-DMA:
-       R6 = 0x1 (Z);
-       W[P1+OFFSET_(MDMA_S0_X_MODIFY)] = R6;   /* Source Modify = 1 */
-       W[P1+OFFSET_(MDMA_D0_X_MODIFY)] = R6;   /* Destination Modify = 1 */
-
-       [P1+OFFSET_(MDMA_S0_START_ADDR)] = R0;  /* Set Source Base Address */
-       W[P1+OFFSET_(MDMA_S0_X_COUNT)] = R2;    /* Set Source Count */
-       /* Set Source  DMAConfig = DMA Enable,
-       Memory Read,  8-Bit Transfers, 1-D DMA, Flow - Stop */
-       W[P1+OFFSET_(MDMA_S0_CONFIG)] = R3;
-
-       [P1+OFFSET_(MDMA_D0_START_ADDR)] = R1;  /* Set Destination Base Address */
-       W[P1+OFFSET_(MDMA_D0_X_COUNT)] = R2;    /* Set Destination Count */
-       /* Set Destination DMAConfig = DMA Enable,
-       Memory Write, 8-Bit Transfers, 1-D DMA, Flow - Stop, IOC */
-       W[P1+OFFSET_(MDMA_D0_CONFIG)] = R4;
-
-WAIT_DMA_DONE:
-       p0.h = hi(MDMA_D0_IRQ_STATUS);
-       p0.l = lo(MDMA_D0_IRQ_STATUS);
-       R0 = W[P0](Z);
-       CC = BITTST(R0, 0);
-       if ! CC jump WAIT_DMA_DONE
-
-       R0 = 0x1;
-       W[P1+OFFSET_(MDMA_D0_IRQ_STATUS)] = R0; /* Write 1 to clear DMA interrupt */
-
-       /* Initialize BSS Section with 0 s */
-       p1.l = __bss_start;
-       p1.h = __bss_start;
-       p2.l = _end;
-       p2.h = _end;
-       r1 = p1;
-       r2 = p2;
-       r3 = r2 - r1;
-       r3 = r3 >> 2;
-       p3 = r3;
-       lsetup (_clear_bss, _clear_bss_end ) lc1 = p3;
-       CC = p2<=p1;
-       if CC jump _clear_bss_skip;
-       r0 = 0;
-_clear_bss:
-_clear_bss_end:
-       [p1++] = r0;
-_clear_bss_skip:
-
-#if defined(CONFIG_BF537)&&defined(CONFIG_POST)
-       p0.l = _post_flag;
-       p0.h = _post_flag;
-       r0   = r7;
-       [p0] = r0;
-#endif
-
-       p0.l = _start1;
-       p0.h = _start1;
-       jump (p0);
-
-reset_start:
-       p0.h = WDOG_CNT >> 16;
-       p0.l = WDOG_CNT & 0xffff;
-       r0 = 0x0010;
-       w[p0] = r0;
-       p0.h = WDOG_CTL >> 16;
-       p0.l = WDOG_CTL & 0xffff;
-       r0 = 0x0000;
-       w[p0] = r0;
-reset_wait:
-       jump reset_wait;
-
-reset_end:
-       nop;
-
-_exit:
-       jump.s  _exit;
-get_pc:
-       r0 = rets;
-       rts;
diff --git a/cpu/bf537/traps.c b/cpu/bf537/traps.c
deleted file mode 100644 (file)
index 51de322..0000000
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- * U-boot - traps.c Routines related to interrupts and exceptions
- *
- * Copyright (c) 2005-2007 Analog Devices Inc.
- *
- * This file is based on
- * No original Copyright holder listed,
- * Probabily original (C) Roman Zippel (assigned DJD, 1999)
- *
- * Copyright 2003 Metrowerks - for Blackfin
- * Copyright 2000-2001 Lineo, Inc. D. Jeff Dionne <jeff@lineo.ca>
- * Copyright 1999-2000 D. Jeff Dionne, <jeff@uclinux.org>
- *
- * (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 <linux/types.h>
-#include <asm/errno.h>
-#include <asm/system.h>
-#include <asm/traps.h>
-#include "cpu.h"
-#include <asm/cplb.h>
-#include <asm/io.h>
-#include <asm/mach-common/bits/core.h>
-#include <asm/mach-common/bits/mpu.h>
-
-void init_IRQ(void)
-{
-       blackfin_init_IRQ();
-       return;
-}
-
-void process_int(unsigned long vec, struct pt_regs *fp)
-{
-       printf("interrupt\n");
-       return;
-}
-
-extern unsigned int icplb_table[page_descriptor_table_size][2];
-extern unsigned int dcplb_table[page_descriptor_table_size][2];
-
-unsigned long last_cplb_fault_retx;
-
-static unsigned int cplb_sizes[4] =
-    { 1024, 4 * 1024, 1024 * 1024, 4 * 1024 * 1024 };
-
-void trap_c(struct pt_regs *regs)
-{
-       unsigned int addr;
-       unsigned long trapnr = (regs->seqstat) & EXCAUSE;
-       unsigned int i, j, size, *I0, *I1;
-       unsigned short data = 0;
-
-       switch (trapnr) {
-               /* 0x26 - Data CPLB Miss */
-       case VEC_CPLB_M:
-
-#if ANOMALY_05000261
-               /*
-                * Work around an anomaly: if we see a new DCPLB fault,
-                * return without doing anything. Then,
-                * if we get the same fault again, handle it.
-                */
-               addr = last_cplb_fault_retx;
-               last_cplb_fault_retx = regs->retx;
-               printf("this time, curr = 0x%08x last = 0x%08x\n",
-                      addr, last_cplb_fault_retx);
-               if (addr != last_cplb_fault_retx)
-                       goto trap_c_return;
-#endif
-               data = 1;
-
-       case VEC_CPLB_I_M:
-
-               if (data) {
-                       addr = *pDCPLB_FAULT_ADDR;
-               } else {
-                       addr = *pICPLB_FAULT_ADDR;
-               }
-               for (i = 0; i < page_descriptor_table_size; i++) {
-                       if (data) {
-                               size = cplb_sizes[dcplb_table[i][1] >> 16];
-                               j = dcplb_table[i][0];
-                       } else {
-                               size = cplb_sizes[icplb_table[i][1] >> 16];
-                               j = icplb_table[i][0];
-                       }
-                       if ((j <= addr) && ((j + size) > addr)) {
-                               debug("found %i 0x%08x\n", i, j);
-                               break;
-                       }
-               }
-               if (i == page_descriptor_table_size) {
-                       printf("something is really wrong\n");
-                       do_reset(NULL, 0, 0, NULL);
-               }
-
-               /* Turn the cache off */
-               if (data) {
-                       SSYNC();
-                       asm(" .align 8; ");
-                       *(unsigned int *)DMEM_CONTROL &=
-                           ~(ACACHE_BCACHE | ENDCPLB | PORT_PREF0);
-                       SSYNC();
-               } else {
-                       SSYNC();
-                       asm(" .align 8; ");
-                       *(unsigned int *)IMEM_CONTROL &= ~(IMC | ENICPLB);
-                       SSYNC();
-               }
-
-               if (data) {
-                       I0 = (unsigned int *)DCPLB_ADDR0;
-                       I1 = (unsigned int *)DCPLB_DATA0;
-               } else {
-                       I0 = (unsigned int *)ICPLB_ADDR0;
-                       I1 = (unsigned int *)ICPLB_DATA0;
-               }
-
-               j = 0;
-               while (*I1 & CPLB_LOCK) {
-                       debug("skipping %i %08p - %08x\n", j, I1, *I1);
-                       *I0++;
-                       *I1++;
-                       j++;
-               }
-
-               debug("remove %i 0x%08x  0x%08x\n", j, *I0, *I1);
-
-               for (; j < 15; j++) {
-                       debug("replace %i 0x%08x  0x%08x\n", j, I0, I0 + 1);
-                       *I0++ = *(I0 + 1);
-                       *I1++ = *(I1 + 1);
-               }
-
-               if (data) {
-                       *I0 = dcplb_table[i][0];
-                       *I1 = dcplb_table[i][1];
-                       I0 = (unsigned int *)DCPLB_ADDR0;
-                       I1 = (unsigned int *)DCPLB_DATA0;
-               } else {
-                       *I0 = icplb_table[i][0];
-                       *I1 = icplb_table[i][1];
-                       I0 = (unsigned int *)ICPLB_ADDR0;
-                       I1 = (unsigned int *)ICPLB_DATA0;
-               }
-
-               for (j = 0; j < 16; j++) {
-                       debug("%i 0x%08x  0x%08x\n", j, *I0++, *I1++);
-               }
-
-               /* Turn the cache back on */
-               if (data) {
-                       j = *(unsigned int *)DMEM_CONTROL;
-                       SSYNC();
-                       asm(" .align 8; ");
-                       *(unsigned int *)DMEM_CONTROL =
-                           ACACHE_BCACHE | ENDCPLB | PORT_PREF0 | j;
-                       SSYNC();
-               } else {
-                       SSYNC();
-                       asm(" .align 8; ");
-                       *(unsigned int *)IMEM_CONTROL = IMC | ENICPLB;
-                       SSYNC();
-               }
-
-               break;
-       default:
-               /* All traps come here */
-               printf("code=[0x%x], ", (unsigned int)(regs->seqstat & 0x3f));
-               printf("stack frame=0x%x, ", (unsigned int)regs);
-               printf("bad PC=0x%04x\n", (unsigned int)regs->pc);
-               dump(regs);
-               printf("\n\n");
-
-               printf("Unhandled IRQ or exceptions!\n");
-               printf("Please reset the board \n");
-               do_reset(NULL, 0, 0, NULL);
-       }
-
-trap_c_return:
-       return;
-
-}
-
-void dump(struct pt_regs *fp)
-{
-       debug("RETE:  %08lx  RETN: %08lx  RETX: %08lx  RETS: %08lx\n",
-                fp->rete, fp->retn, fp->retx, fp->rets);
-       debug("IPEND: %04lx  SYSCFG: %04lx\n", fp->ipend, fp->syscfg);
-       debug("SEQSTAT: %08lx    SP: %08lx\n", (long)fp->seqstat, (long)fp);
-       debug("R0: %08lx    R1: %08lx    R2: %08lx    R3: %08lx\n",
-                fp->r0, fp->r1, fp->r2, fp->r3);
-       debug("R4: %08lx    R5: %08lx    R6: %08lx    R7: %08lx\n",
-                fp->r4, fp->r5, fp->r6, fp->r7);
-       debug("P0: %08lx    P1: %08lx    P2: %08lx    P3: %08lx\n",
-                fp->p0, fp->p1, fp->p2, fp->p3);
-       debug("P4: %08lx    P5: %08lx    FP: %08lx\n",
-                fp->p4, fp->p5, fp->fp);
-       debug("A0.w: %08lx    A0.x: %08lx    A1.w: %08lx    A1.x: %08lx\n",
-                fp->a0w, fp->a0x, fp->a1w, fp->a1x);
-
-       debug("LB0: %08lx  LT0: %08lx  LC0: %08lx\n",
-                fp->lb0, fp->lt0, fp->lc0);
-       debug("LB1: %08lx  LT1: %08lx  LC1: %08lx\n",
-                fp->lb1, fp->lt1, fp->lc1);
-       debug("B0: %08lx  L0: %08lx  M0: %08lx  I0: %08lx\n",
-                fp->b0, fp->l0, fp->m0, fp->i0);
-       debug("B1: %08lx  L1: %08lx  M1: %08lx  I1: %08lx\n",
-                fp->b1, fp->l1, fp->m1, fp->i1);
-       debug("B2: %08lx  L2: %08lx  M2: %08lx  I2: %08lx\n",
-                fp->b2, fp->l2, fp->m2, fp->i2);
-       debug("B3: %08lx  L3: %08lx  M3: %08lx  I3: %08lx\n",
-                fp->b3, fp->l3, fp->m3, fp->i3);
-
-       debug("DCPLB_FAULT_ADDR=%p\n", *pDCPLB_FAULT_ADDR);
-       debug("ICPLB_FAULT_ADDR=%p\n", *pICPLB_FAULT_ADDR);
-
-}
diff --git a/cpu/bf537/video.c b/cpu/bf537/video.c
deleted file mode 100644 (file)
index 3ff0151..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * (C) Copyright 2000
- * Paolo Scaffardi, AIRVENT SAM s.p.a - RIMINI(ITALY), arsenio@tin.it
- * (C) Copyright 2002
- * Wolfgang Denk, wd@denx.de
- * (C) Copyright 2006
- * Aubrey Li, aubrey.li@analog.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 <stdarg.h>
-#include <common.h>
-#include <config.h>
-#include <asm/blackfin.h>
-#include <i2c.h>
-#include <linux/types.h>
-#include <devices.h>
-
-#ifdef CONFIG_VIDEO
-#define NTSC_FRAME_ADDR 0x06000000
-#include "video.h"
-
-/* NTSC OUTPUT SIZE  720 * 240 */
-#define VERTICAL       2
-#define HORIZONTAL     4
-
-int is_vblank_line(const int line)
-{
-       /*
-        *  This array contains a single bit for each line in
-        *  an NTSC frame.
-        */
-       if ((line <= 18) || (line >= 264 && line <= 281) || (line == 528))
-               return true;
-
-       return false;
-}
-
-int NTSC_framebuffer_init(char *base_address)
-{
-       const int NTSC_frames = 1;
-       const int NTSC_lines = 525;
-       char *dest = base_address;
-       int frame_num, line_num;
-
-       for (frame_num = 0; frame_num < NTSC_frames; ++frame_num) {
-               for (line_num = 1; line_num <= NTSC_lines; ++line_num) {
-                       unsigned int code;
-                       int offset = 0;
-                       int i;
-
-                       if (is_vblank_line(line_num))
-                               offset++;
-
-                       if (line_num > 266 || line_num < 3)
-                               offset += 2;
-
-                       /* Output EAV code */
-                       code = SystemCodeMap[offset].EAV;
-                       write_dest_byte((char)(code >> 24) & 0xff);
-                       write_dest_byte((char)(code >> 16) & 0xff);
-                       write_dest_byte((char)(code >> 8) & 0xff);
-                       write_dest_byte((char)(code) & 0xff);
-
-                       /* Output horizontal blanking */
-                       for (i = 0; i < 67 * 2; ++i) {
-                               write_dest_byte(0x80);
-                               write_dest_byte(0x10);
-                       }
-
-                       /* Output SAV */
-                       code = SystemCodeMap[offset].SAV;
-                       write_dest_byte((char)(code >> 24) & 0xff);
-                       write_dest_byte((char)(code >> 16) & 0xff);
-                       write_dest_byte((char)(code >> 8) & 0xff);
-                       write_dest_byte((char)(code) & 0xff);
-
-                       /* Output empty horizontal data */
-                       for (i = 0; i < 360 * 2; ++i) {
-                               write_dest_byte(0x80);
-                               write_dest_byte(0x10);
-                       }
-               }
-       }
-
-       return dest - base_address;
-}
-
-void fill_frame(char *Frame, int Value)
-{
-       int *OddPtr32;
-       int OddLine;
-       int *EvenPtr32;
-       int EvenLine;
-       int i;
-       int *data;
-       int m, n;
-
-       /* fill odd and even frames */
-       for (OddLine = 22, EvenLine = 285; OddLine < 263; OddLine++, EvenLine++) {
-               OddPtr32 = (int *)((Frame + (OddLine * 1716)) + 276);
-               EvenPtr32 = (int *)((Frame + (EvenLine * 1716)) + 276);
-               for (i = 0; i < 360; i++, OddPtr32++, EvenPtr32++) {
-                       *OddPtr32 = Value;
-                       *EvenPtr32 = Value;
-               }
-       }
-
-       for (m = 0; m < VERTICAL; m++) {
-               data = (int *)u_boot_logo.data;
-               for (OddLine = (22 + m), EvenLine = (285 + m);
-                    OddLine < (u_boot_logo.height * VERTICAL) + (22 + m);
-                    OddLine += VERTICAL, EvenLine += VERTICAL) {
-                       OddPtr32 = (int *)((Frame + ((OddLine) * 1716)) + 276);
-                       EvenPtr32 =
-                           (int *)((Frame + ((EvenLine) * 1716)) + 276);
-                       for (i = 0; i < u_boot_logo.width / 2; i++) {
-                               /* enlarge one pixel to m x n */
-                               for (n = 0; n < HORIZONTAL; n++) {
-                                       *OddPtr32++ = *data;
-                                       *EvenPtr32++ = *data;
-                               }
-                               data++;
-                       }
-               }
-       }
-}
-
-void video_putc(const char c)
-{
-}
-
-void video_puts(const char *s)
-{
-}
-
-static int video_init(void)
-{
-       char *NTSCFrame;
-       NTSCFrame = (char *)NTSC_FRAME_ADDR;
-       NTSC_framebuffer_init(NTSCFrame);
-       fill_frame(NTSCFrame, BLUE);
-
-       *pPPI_CONTROL = 0x0082;
-       *pPPI_FRAME = 0x020D;
-
-       *pDMA0_START_ADDR = NTSCFrame;
-       *pDMA0_X_COUNT = 0x035A;
-       *pDMA0_X_MODIFY = 0x0002;
-       *pDMA0_Y_COUNT = 0x020D;
-       *pDMA0_Y_MODIFY = 0x0002;
-       *pDMA0_CONFIG = 0x1015;
-       *pPPI_CONTROL = 0x0083;
-       return 0;
-}
-
-int drv_video_init(void)
-{
-       int error, devices = 1;
-
-       device_t videodev;
-
-       video_init();           /* Video initialization */
-
-       memset(&videodev, 0, sizeof(videodev));
-
-       strcpy(videodev.name, "video");
-       videodev.ext = DEV_EXT_VIDEO;   /* Video extensions */
-       videodev.flags = DEV_FLAGS_OUTPUT;      /* Output only */
-       videodev.putc = video_putc;     /* 'putc' function */
-       videodev.puts = video_puts;     /* 'puts' function */
-
-       error = device_register(&videodev);
-
-       return (error == 0) ? devices : error;
-}
-#endif
diff --git a/cpu/bf537/video.h b/cpu/bf537/video.h
deleted file mode 100644 (file)
index a43553f..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#include <video_logo.h>
-#define write_dest_byte(val) {*dest++=val;}
-#define BLACK   (0x01800180)   /* black pixel pattern  */
-#define BLUE    (0x296E29F0)   /* blue pixel pattern   */
-#define RED     (0x51F0515A)   /* red pixel pattern    */
-#define MAGENTA (0x6ADE6ACA)   /* magenta pixel pattern*/
-#define GREEN   (0x91229136)   /* green pixel pattern  */
-#define CYAN    (0xAA10AAA6)   /* cyan pixel pattern   */
-#define YELLOW  (0xD292D210)   /* yellow pixel pattern */
-#define WHITE   (0xFE80FE80)   /* white pixel pattern  */
-
-#define true   1
-#define false  0
-
-typedef struct {
-       unsigned int SAV;
-       unsigned int EAV;
-} SystemCodeType;
-
-const SystemCodeType SystemCodeMap[4] = {
-       {0xFF000080, 0xFF00009D},
-       {0xFF0000AB, 0xFF0000B6},
-       {0xFF0000C7, 0xFF0000DA},
-       {0xFF0000EC, 0xFF0000F1}
-};
diff --git a/cpu/bf561/cache.S b/cpu/bf561/cache.S
deleted file mode 100644 (file)
index d9015c6..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-#define ASSEMBLY
-#include <asm/linkage.h>
-#include <config.h>
-#include <asm/blackfin.h>
-#include <asm/mach-common/bits/mpu.h>
-
-.text
-.align 2
-ENTRY(_blackfin_icache_flush_range)
-       R2 = -32;
-       R2 = R0 & R2;
-       P0 = R2;
-       P1 = R1;
-       CSYNC;
-       1:
-       IFLUSH[P0++];
-       CC = P0 < P1(iu);
-       IF CC JUMP 1b(bp);
-       IFLUSH[P0];
-       SSYNC;
-       RTS;
-
-ENTRY(_blackfin_dcache_flush_range)
-       R2 = -32;
-       R2 = R0 & R2;
-       P0 = R2;
-       P1 = R1;
-       CSYNC;
-1:
-       FLUSH[P0++];
-       CC = P0 < P1(iu);
-       IF CC JUMP 1b(bp);
-       FLUSH[P0];
-       SSYNC;
-       RTS;
-
-ENTRY(_icache_invalidate)
-ENTRY(_invalidate_entire_icache)
-       [--SP] = (R7:5);
-
-       P0.L = (IMEM_CONTROL & 0xFFFF);
-       P0.H = (IMEM_CONTROL >> 16);
-       R7 =[P0];
-
-       /*
-        * Clear the IMC bit , All valid bits in the instruction
-        * cache are set to the invalid state
-        */
-       BITCLR(R7, IMC_P);
-       CLI R6;
-       /* SSYNC required before invalidating cache. */
-       SSYNC;
-       .align 8;
-       [P0] = R7;
-       SSYNC;
-       STI R6;
-
-       /* Configures the instruction cache agian */
-       R6 = (IMC | ENICPLB);
-       R7 = R7 | R6;
-
-       CLI R6;
-       SSYNC;
-       .align 8;
-       [P0] = R7;
-       SSYNC;
-       STI R6;
-
-       (R7:5) =[SP++];
-       RTS;
-
-/*
- * Invalidate the Entire Data cache by
- * clearing DMC[1:0] bits
- */
-ENTRY(_invalidate_entire_dcache)
-ENTRY(_dcache_invalidate)
-       [--SP] = (R7:6);
-
-       P0.L = (DMEM_CONTROL & 0xFFFF);
-       P0.H = (DMEM_CONTROL >> 16);
-       R7 =[P0];
-
-       /*
-        * Clear the DMC[1:0] bits, All valid bits in the data
-        * cache are set to the invalid state
-        */
-       BITCLR(R7, DMC0_P);
-       BITCLR(R7, DMC1_P);
-       CLI R6;
-       SSYNC;
-       .align 8;
-       [P0] = R7;
-       SSYNC;
-       STI R6;
-       /* Configures the data cache again */
-
-       R6 = (ACACHE_BCACHE | ENDCPLB | PORT_PREF0);
-       R7 = R7 | R6;
-
-       CLI R6;
-       SSYNC;
-       .align 8;
-       [P0] = R7;
-       SSYNC;
-       STI R6;
-
-       (R7:6) =[SP++];
-       RTS;
-
-ENTRY(_blackfin_dcache_invalidate_range)
-       R2 = -32;
-       R2 = R0 & R2;
-       P0 = R2;
-       P1 = R1;
-       CSYNC;
-1:
-       FLUSHINV[P0++];
-       CC = P0 < P1(iu);
-       IF CC JUMP 1b(bp);
-
-       /*
-        * If the data crosses a cache line, then we'll be pointing to
-        * the last cache line, but won't have flushed/invalidated it yet, so do
-        * one more.
-        */
-       FLUSHINV[P0];
-       SSYNC;
-       RTS;
diff --git a/cpu/bf561/config.mk b/cpu/bf561/config.mk
deleted file mode 100644 (file)
index 3628a02..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-# U-boot - config.mk
-#
-# Copyright (c) 2005-2007 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
-#
-
-PLATFORM_RELFLAGS += -mcpu=bf561
diff --git a/cpu/bf561/cpu.c b/cpu/bf561/cpu.c
deleted file mode 100644 (file)
index e0dd2f5..0000000
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * U-boot - cpu.c CPU specific functions
- *
- * Copyright (c) 2005-2007 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 <asm/blackfin.h>
-#include <command.h>
-#include <asm/entry.h>
-#include <asm/cplb.h>
-#include <asm/io.h>
-
-#define CACHE_ON 1
-#define CACHE_OFF 0
-
-extern unsigned int icplb_table[page_descriptor_table_size][2];
-extern unsigned int dcplb_table[page_descriptor_table_size][2];
-
-int do_reset(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
-{
-       __asm__ __volatile__("cli r3;" "P0 = %0;" "JUMP (P0);"::"r"(L1_INST_SRAM)
-           );
-
-       return 0;
-}
-
-/* These functions are just used to satisfy the linker */
-int cpu_init(void)
-{
-       return 0;
-}
-
-int cleanup_before_linux(void)
-{
-       return 0;
-}
-
-void icache_enable(void)
-{
-       unsigned int *I0, *I1;
-       int i, j = 0;
-
-       /* Before enable icache, disable it first */
-       icache_disable();
-       I0 = (unsigned int *)ICPLB_ADDR0;
-       I1 = (unsigned int *)ICPLB_DATA0;
-
-       /* make sure the locked ones go in first */
-       for (i = 0; i < page_descriptor_table_size; i++) {
-               if (CPLB_LOCK & icplb_table[i][1]) {
-                       debug("adding %02i %02i 0x%08x 0x%08x\n", i, j,
-                             icplb_table[i][0], icplb_table[i][1]);
-                       *I0++ = icplb_table[i][0];
-                       *I1++ = icplb_table[i][1];
-                       j++;
-               }
-       }
-
-       for (i = 0; i < page_descriptor_table_size; i++) {
-               if (!(CPLB_LOCK & icplb_table[i][1])) {
-                       debug("adding %02i %02i 0x%08x 0x%08x\n", i, j,
-                             icplb_table[i][0], icplb_table[i][1]);
-                       *I0++ = icplb_table[i][0];
-                       *I1++ = icplb_table[i][1];
-                       j++;
-                       if (j == 16) {
-                               break;
-                       }
-               }
-       }
-
-       /* Fill the rest with invalid entry */
-       if (j <= 15) {
-               for (; j < 16; j++) {
-                       debug("filling %i with 0", j);
-                       *I1++ = 0x0;
-               }
-
-       }
-
-       SSYNC();
-       asm(" .align 8; ");
-       *(unsigned int *)IMEM_CONTROL = IMC | ENICPLB;
-       SSYNC();
-}
-
-void icache_disable(void)
-{
-       SSYNC();
-       asm(" .align 8; ");
-       *(unsigned int *)IMEM_CONTROL &= ~(IMC | ENICPLB);
-       SSYNC();
-}
-
-int icache_status(void)
-{
-       unsigned int value;
-       value = *(unsigned int *)IMEM_CONTROL;
-
-       if (value & (IMC | ENICPLB))
-               return CACHE_ON;
-       else
-               return CACHE_OFF;
-}
-
-void dcache_enable(void)
-{
-       unsigned int *I0, *I1;
-       unsigned int temp;
-       int i, j = 0;
-
-       /* Before enable dcache, disable it first */
-       dcache_disable();
-       I0 = (unsigned int *)DCPLB_ADDR0;
-       I1 = (unsigned int *)DCPLB_DATA0;
-
-       /* make sure the locked ones go in first */
-       for (i = 0; i < page_descriptor_table_size; i++) {
-               if (CPLB_LOCK & dcplb_table[i][1]) {
-                       debug("adding %02i %02i 0x%08x 0x%08x\n", i, j,
-                             dcplb_table[i][0], dcplb_table[i][1]);
-                       *I0++ = dcplb_table[i][0];
-                       *I1++ = dcplb_table[i][1];
-                       j++;
-               } else {
-                       debug("skip   %02i %02i 0x%08x 0x%08x\n", i, j,
-                             dcplb_table[i][0], dcplb_table[i][1]);
-               }
-       }
-
-       for (i = 0; i < page_descriptor_table_size; i++) {
-               if (!(CPLB_LOCK & dcplb_table[i][1])) {
-                       debug("adding %02i %02i 0x%08x 0x%08x\n", i, j,
-                             dcplb_table[i][0], dcplb_table[i][1]);
-                       *I0++ = dcplb_table[i][0];
-                       *I1++ = dcplb_table[i][1];
-                       j++;
-                       if (j == 16) {
-                               break;
-                       }
-               }
-       }
-
-       /* Fill the rest with invalid entry */
-       if (j <= 15) {
-               for (; j < 16; j++) {
-                       debug("filling %i with 0", j);
-                       *I1++ = 0x0;
-               }
-       }
-
-       temp = *(unsigned int *)DMEM_CONTROL;
-       SSYNC();
-       asm(" .align 8; ");
-       *(unsigned int *)DMEM_CONTROL =
-           ACACHE_BCACHE | ENDCPLB | PORT_PREF0 | temp;
-       SSYNC();
-}
-
-void dcache_disable(void)
-{
-
-       unsigned int *I0, *I1;
-       int i;
-
-       SSYNC();
-       asm(" .align 8; ");
-       *(unsigned int *)DMEM_CONTROL &=
-           ~(ACACHE_BCACHE | ENDCPLB | PORT_PREF0);
-       SSYNC();
-
-       /* after disable dcache, clear it so we don't confuse the next application */
-       I0 = (unsigned int *)DCPLB_ADDR0;
-       I1 = (unsigned int *)DCPLB_DATA0;
-
-       for (i = 0; i < 16; i++) {
-               *I0++ = 0x0;
-               *I1++ = 0x0;
-       }
-}
-
-int dcache_status(void)
-{
-       unsigned int value;
-       value = *(unsigned int *)DMEM_CONTROL;
-       if (value & (ENDCPLB))
-               return CACHE_ON;
-       else
-               return CACHE_OFF;
-}
diff --git a/cpu/bf561/cpu.h b/cpu/bf561/cpu.h
deleted file mode 100644 (file)
index b6b73b1..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- *  U-boot - cpu.h
- *
- *  Copyright (c) 2005-2007 Analog Devices 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., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
- */
-
-#ifndef _CPU_H_
-#define _CPU_H_
-
-#include <command.h>
-
-#define INTERNAL_IRQS (32)
-#define NUM_IRQ_NODES 16
-#define DEF_INTERRUPT_FLAGS 1
-#define MAX_TIM_LOAD   0xFFFFFFFF
-
-void blackfin_irq_panic(int reason, struct pt_regs *reg);
-extern void dump(struct pt_regs *regs);
-void display_excp(void);
-asmlinkage void evt_nmi(void);
-asmlinkage void evt_exception(void);
-asmlinkage void trap(void);
-asmlinkage void evt_ivhw(void);
-asmlinkage void evt_rst(void);
-asmlinkage void evt_timer(void);
-asmlinkage void evt_evt7(void);
-asmlinkage void evt_evt8(void);
-asmlinkage void evt_evt9(void);
-asmlinkage void evt_evt10(void);
-asmlinkage void evt_evt11(void);
-asmlinkage void evt_evt12(void);
-asmlinkage void evt_evt13(void);
-asmlinkage void evt_soft_int1(void);
-asmlinkage void evt_system_call(void);
-void blackfin_irq_panic(int reason, struct pt_regs *regs);
-void blackfin_free_irq(unsigned int irq, void *dev_id);
-void call_isr(int irq, struct pt_regs *fp);
-void blackfin_do_irq(int vec, struct pt_regs *fp);
-void blackfin_init_IRQ(void);
-void blackfin_enable_irq(unsigned int irq);
-void blackfin_disable_irq(unsigned int irq);
-extern int do_reset(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]);
-int blackfin_request_irq(unsigned int irq,
-                        void (*handler) (int, void *, struct pt_regs *),
-                        unsigned long flags, const char *devname,
-                        void *dev_id);
-void timer_init(void);
-#endif
diff --git a/cpu/bf561/flush.S b/cpu/bf561/flush.S
deleted file mode 100644 (file)
index 0140a60..0000000
+++ /dev/null
@@ -1,402 +0,0 @@
-/* Copyright (C) 2003-2007 Analog Devices Inc.
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.
- */
-
-#define ASSEMBLY
-
-#include <asm/linkage.h>
-#include <asm/cplb.h>
-#include <config.h>
-#include <asm/blackfin.h>
-
-.text
-
-/* This is an external function being called by the user
- * application through __flush_cache_all. Currently this function
- * serves the purpose of flushing all the pending writes in
- * in the instruction cache.
- */
-
-ENTRY(_flush_instruction_cache)
-       [--SP] = ( R7:6, P5:4 );
-       LINK 12;
-       SP += -12;
-       P5.H = (ICPLB_ADDR0 >> 16);
-       P5.L = (ICPLB_ADDR0 & 0xFFFF);
-       P4.H = (ICPLB_DATA0 >> 16);
-       P4.L = (ICPLB_DATA0 & 0xFFFF);
-       R7 = CPLB_VALID | CPLB_L1_CHBL;
-       R6 = 16;
-inext: R0 = [P5++];
-       R1 = [P4++];
-       [--SP] =  RETS;
-       CALL _icplb_flush;      /* R0 = page, R1 = data*/
-       RETS = [SP++];
-iskip: R6 += -1;
-       CC = R6;
-       IF CC JUMP inext;
-       SSYNC;
-       SP += 12;
-       UNLINK;
-       ( R7:6, P5:4 ) = [SP++];
-       RTS;
-
-/* This is an internal function to flush all pending
- * writes in the cache associated with a particular ICPLB.
- *
- * R0 -  page's start address
- * R1 -  CPLB's data field.
- */
-
-.align 2
-ENTRY(_icplb_flush)
-       [--SP] = ( R7:0, P5:0 );
-       [--SP] = LC0;
-       [--SP] = LT0;
-       [--SP] = LB0;
-       [--SP] = LC1;
-       [--SP] = LT1;
-       [--SP] = LB1;
-
-       /* If it's a 1K or 4K page, then it's quickest to
-        * just systematically flush all the addresses in
-        * the page, regardless of whether they're in the
-        * cache, or dirty. If it's a 1M or 4M page, there
-        * are too many addresses, and we have to search the
-        * cache for lines corresponding to the page.
-        */
-
-       CC = BITTST(R1, 17);    /* 1MB or 4MB */
-       IF !CC JUMP iflush_whole_page;
-
-       /* We're only interested in the page's size, so extract
-        * this from the CPLB (bits 17:16), and scale to give an
-        * offset into the page_size and page_prefix tables.
-        */
-
-       R1 <<= 14;
-       R1 >>= 30;
-       R1 <<= 2;
-
-       /* We can also determine the sub-bank used, because this is
-        * taken from bits 13:12 of the address.
-        */
-
-       R3 = ((12<<8)|2);               /* Extraction pattern */
-       nop;                            /*Anamoly 05000209*/
-       R4 = EXTRACT(R0, R3.L) (Z);     /* Extract bits*/
-       R3.H = R4.L << 0 ;              /* Save in extraction pattern for later deposit.*/
-
-
-       /* So:
-        * R0 = Page start
-        * R1 = Page length (actually, offset into size/prefix tables)
-        * R3 = sub-bank deposit values
-        *
-        * The cache has 2 Ways, and 64 sets, so we iterate through
-        * the sets, accessing the tag for each Way, for our Bank and
-        * sub-bank, looking for dirty, valid tags that match our
-        * address prefix.
-        */
-
-       P5.L = (ITEST_COMMAND & 0xFFFF);
-       P5.H = (ITEST_COMMAND >> 16);
-       P4.L = (ITEST_DATA0 & 0xFFFF);
-       P4.H = (ITEST_DATA0 >> 16);
-
-       P0.L = page_prefix_table;
-       P0.H = page_prefix_table;
-       P1 = R1;
-       R5 = 0;                 /* Set counter*/
-       P0 = P1 + P0;
-       R4 = [P0];              /* This is the address prefix*/
-
-       /* We're reading (bit 1==0) the tag (bit 2==0), and we
-        * don't care about which double-word, since we're only
-        * fetching tags, so we only have to set Set, Bank,
-        * Sub-bank and Way.
-        */
-
-       P2 = 4;
-       LSETUP (ifs1, ife1) LC1 = P2;
-ifs1:  P0 = 32;                /* iterate over all sets*/
-       LSETUP (ifs0, ife0) LC0 = P0;
-ifs0:  R6 = R5 << 5;           /* Combine set*/
-       R6.H = R3.H << 0 ;      /* and sub-bank*/
-       [P5] = R6;              /* Issue Command*/
-       SSYNC;                  /* CSYNC will not work here :(*/
-       R7 = [P4];              /* and read Tag.*/
-       CC = BITTST(R7, 0);     /* Check if valid*/
-       IF !CC JUMP ifskip;     /* and skip if not.*/
-
-       /* Compare against the page address. First, plant bits 13:12
-        * into the tag, since those aren't part of the returned data.
-        */
-
-       R7 = DEPOSIT(R7, R3);   /* set 13:12*/
-       R1 = R7 & R4;           /* Mask off lower bits*/
-       CC = R1 == R0;          /* Compare against page start.*/
-       IF !CC JUMP ifskip;     /* Skip it if it doesn't match.*/
-
-       /* Tag address matches against page, so this is an entry
-        * we must flush.
-        */
-
-       R7 >>= 10;              /* Mask off the non-address bits*/
-       R7 <<= 10;
-       P3 = R7;
-       IFLUSH [P3];            /* And flush the entry*/
-ifskip:
-ife0:  R5 += 1;                /* Advance to next Set*/
-ife1:  NOP;
-
-ifinished:
-       SSYNC;                  /* Ensure the data gets out to mem.*/
-
-       /*Finished. Restore context.*/
-       LB1 = [SP++];
-       LT1 = [SP++];
-       LC1 = [SP++];
-       LB0 = [SP++];
-       LT0 = [SP++];
-       LC0 = [SP++];
-       ( R7:0, P5:0 ) = [SP++];
-       RTS;
-
-iflush_whole_page:
-       /* It's a 1K or 4K page, so quicker to just flush the
-        * entire page.
-        */
-
-       P1 = 32;                /* For 1K pages*/
-       P2 = P1 << 2;           /* For 4K pages*/
-       P0 = R0;                /* Start of page*/
-       CC = BITTST(R1, 16);    /* Whether 1K or 4K*/
-       IF CC P1 = P2;
-       P1 += -1;               /* Unroll one iteration*/
-       SSYNC;
-       IFLUSH [P0++];          /* because CSYNC can't end loops.*/
-       LSETUP (isall, ieall) LC0 = P1;
-isall:IFLUSH [P0++];
-ieall: NOP;
-       SSYNC;
-       JUMP ifinished;
-
-/* This is an external function being called by the user
- * application through __flush_cache_all. Currently this function
- * serves the purpose of flushing all the pending writes in
- * in the data cache.
- */
-
-ENTRY(_flush_data_cache)
-       [--SP] = ( R7:6, P5:4 );
-       LINK 12;
-       SP += -12;
-       P5.H = (DCPLB_ADDR0 >> 16);
-       P5.L = (DCPLB_ADDR0 & 0xFFFF);
-       P4.H = (DCPLB_DATA0 >> 16);
-       P4.L = (DCPLB_DATA0 & 0xFFFF);
-       R7 = CPLB_VALID | CPLB_L1_CHBL | CPLB_DIRTY (Z);
-       R6 = 16;
-next:  R0 = [P5++];
-       R1 = [P4++];
-       CC = BITTST(R1, 14);    /* Is it write-through?*/
-       IF CC JUMP skip;        /* If so, ignore it.*/
-       R2 = R1 & R7;           /* Is it a dirty, cached page?*/
-       CC = R2;
-       IF !CC JUMP skip;       /* If not, ignore it.*/
-       [--SP] = RETS;
-       CALL _dcplb_flush;      /* R0 = page, R1 = data*/
-       RETS = [SP++];
-skip:  R6 += -1;
-       CC = R6;
-       IF CC JUMP next;
-       SSYNC;
-       SP += 12;
-       UNLINK;
-       ( R7:6, P5:4 ) = [SP++];
-       RTS;
-
-/* This is an internal function to flush all pending
- * writes in the cache associated with a particular DCPLB.
- *
- * R0 -  page's start address
- * R1 -  CPLB's data field.
- */
-
-.align 2
-ENTRY(_dcplb_flush)
-       [--SP] = ( R7:0, P5:0 );
-       [--SP] = LC0;
-       [--SP] = LT0;
-       [--SP] = LB0;
-       [--SP] = LC1;
-       [--SP] = LT1;
-       [--SP] = LB1;
-
-       /* If it's a 1K or 4K page, then it's quickest to
-        * just systematically flush all the addresses in
-        * the page, regardless of whether they're in the
-        * cache, or dirty. If it's a 1M or 4M page, there
-        * are too many addresses, and we have to search the
-        * cache for lines corresponding to the page.
-        */
-
-       CC = BITTST(R1, 17);    /* 1MB or 4MB */
-       IF !CC JUMP dflush_whole_page;
-
-       /* We're only interested in the page's size, so extract
-        * this from the CPLB (bits 17:16), and scale to give an
-        * offset into the page_size and page_prefix tables.
-        */
-
-       R1 <<= 14;
-       R1 >>= 30;
-       R1 <<= 2;
-
-       /* The page could be mapped into Bank A or Bank B, depending
-        * on (a) whether both banks are configured as cache, and
-        * (b) on whether address bit A[x] is set. x is determined
-        * by DCBS in DMEM_CONTROL
-        */
-
-       R2 = 0;                 /* Default to Bank A (Bank B would be 1)*/
-
-       P0.L = (DMEM_CONTROL & 0xFFFF);
-       P0.H = (DMEM_CONTROL >> 16);
-
-       R3 = [P0];              /* If Bank B is not enabled as cache*/
-       CC = BITTST(R3, 2);     /* then Bank A is our only option.*/
-       IF CC JUMP bank_chosen;
-
-       R4 = 1<<14;             /* If DCBS==0, use A[14].*/
-       R5 = R4 << 7;           /* If DCBS==1, use A[23];*/
-       CC = BITTST(R3, 4);
-       IF CC R4 = R5;          /* R4 now has either bit 14 or bit 23 set.*/
-       R5 = R0 & R4;           /* Use it to test the Page address*/
-       CC = R5;                /* and if that bit is set, we use Bank B,*/
-       R2 = CC;                /* else we use Bank A.*/
-       R2 <<= 23;              /* The Bank selection's at posn 23.*/
-
-bank_chosen:
-
-       /* We can also determine the sub-bank used, because this is
-        * taken from bits 13:12 of the address.
-        */
-
-       R3 = ((12<<8)|2);               /* Extraction pattern */
-       nop;                            /*Anamoly 05000209*/
-       R4 = EXTRACT(R0, R3.L) (Z);     /* Extract bits*/
-       /* Save in extraction pattern for later deposit.*/
-       R3.H = R4.L << 0;
-
-       /* So:
-        * R0 = Page start
-        * R1 = Page length (actually, offset into size/prefix tables)
-        * R2 = Bank select mask
-        * R3 = sub-bank deposit values
-        *
-        * The cache has 2 Ways, and 64 sets, so we iterate through
-        * the sets, accessing the tag for each Way, for our Bank and
-        * sub-bank, looking for dirty, valid tags that match our
-        * address prefix.
-        */
-
-       P5.L = (DTEST_COMMAND & 0xFFFF);
-       P5.H = (DTEST_COMMAND >> 16);
-       P4.L = (DTEST_DATA0 & 0xFFFF);
-       P4.H = (DTEST_DATA0 >> 16);
-
-       P0.L = page_prefix_table;
-       P0.H = page_prefix_table;
-       P1 = R1;
-       R5 = 0;                 /* Set counter*/
-       P0 = P1 + P0;
-       R4 = [P0];              /* This is the address prefix*/
-
-
-       /* We're reading (bit 1==0) the tag (bit 2==0), and we
-        * don't care about which double-word, since we're only
-        * fetching tags, so we only have to set Set, Bank,
-        * Sub-bank and Way.
-        */
-
-       P2 = 2;
-       LSETUP (fs1, fe1) LC1 = P2;
-fs1:   P0 = 64;                /* iterate over all sets*/
-       LSETUP (fs0, fe0) LC0 = P0;
-fs0:   R6 = R5 << 5;           /* Combine set*/
-       R6.H = R3.H << 0 ;      /* and sub-bank*/
-       R6 = R6 | R2;           /* and Bank. Leave Way==0 at first.*/
-       BITSET(R6,14);
-       [P5] = R6;              /* Issue Command*/
-       SSYNC;
-       R7 = [P4];              /* and read Tag.*/
-       CC = BITTST(R7, 0);     /* Check if valid*/
-       IF !CC JUMP fskip;      /* and skip if not.*/
-       CC = BITTST(R7, 1);     /* Check if dirty*/
-       IF !CC JUMP fskip;      /* and skip if not.*/
-
-       /* Compare against the page address. First, plant bits 13:12
-        * into the tag, since those aren't part of the returned data.
-        */
-
-       R7 = DEPOSIT(R7, R3);   /* set 13:12*/
-       R1 = R7 & R4;           /* Mask off lower bits*/
-       CC = R1 == R0;          /* Compare against page start.*/
-       IF !CC JUMP fskip;      /* Skip it if it doesn't match.*/
-
-       /* Tag address matches against page, so this is an entry
-        * we must flush.
-        */
-
-       R7 >>= 10;              /* Mask off the non-address bits*/
-       R7 <<= 10;
-       P3 = R7;
-       SSYNC;
-       FLUSHINV [P3];          /* And flush the entry*/
-fskip:
-fe0:   R5 += 1;                /* Advance to next Set*/
-fe1:   BITSET(R2, 26);         /* Go to next Way.*/
-
-dfinished:
-       SSYNC;                  /* Ensure the data gets out to mem.*/
-
-       /*Finished. Restore context.*/
-       LB1 = [SP++];
-       LT1 = [SP++];
-       LC1 = [SP++];
-       LB0 = [SP++];
-       LT0 = [SP++];
-       LC0 = [SP++];
-       ( R7:0, P5:0 ) = [SP++];
-       RTS;
-
-dflush_whole_page:
-
-       /* It's a 1K or 4K page, so quicker to just flush the
-        * entire page.
-        */
-
-       P1 = 32;                /* For 1K pages*/
-       P2 = P1 << 2;           /* For 4K pages*/
-       P0 = R0;                /* Start of page*/
-       CC = BITTST(R1, 16);    /* Whether 1K or 4K*/
-       IF CC P1 = P2;
-       P1 += -1;               /* Unroll one iteration*/
-       SSYNC;
-       FLUSHINV [P0++];        /* because CSYNC can't end loops.*/
-       LSETUP (eall, eall) LC0 = P1;
-eall:  FLUSHINV [P0++];
-       SSYNC;
-       JUMP dfinished;
-
-.align 4;
-page_prefix_table:
-.byte4         0xFFFFFC00;     /* 1K */
-.byte4 0xFFFFF000;     /* 4K */
-.byte4 0xFFF00000;     /* 1M */
-.byte4 0xFFC00000;     /* 4M */
-.page_prefix_table.end:
diff --git a/cpu/bf561/init_sdram.S b/cpu/bf561/init_sdram.S
deleted file mode 100644 (file)
index f5ccf30..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-#define ASSEMBLY
-
-#include <linux/config.h>
-#include <config.h>
-#include <asm/blackfin.h>
-#include <asm/mem_init.h>
-#include <asm/mach-common/bits/bootrom.h>
-#include <asm/mach-common/bits/ebiu.h>
-#include <asm/mach-common/bits/pll.h>
-#include <asm/mach-common/bits/uart.h>
-.global init_sdram;
-
-#if (CONFIG_CCLK_DIV == 1)
-#define CONFIG_CCLK_ACT_DIV   CCLK_DIV1
-#endif
-#if (CONFIG_CCLK_DIV == 2)
-#define CONFIG_CCLK_ACT_DIV   CCLK_DIV2
-#endif
-#if (CONFIG_CCLK_DIV == 4)
-#define CONFIG_CCLK_ACT_DIV   CCLK_DIV4
-#endif
-#if (CONFIG_CCLK_DIV == 8)
-#define CONFIG_CCLK_ACT_DIV   CCLK_DIV8
-#endif
-#ifndef CONFIG_CCLK_ACT_DIV
-#define CONFIG_CCLK_ACT_DIV   CONFIG_CCLK_DIV_not_defined_properly
-#endif
-
-init_sdram:
-       [--SP] = ASTAT;
-       [--SP] = RETS;
-       [--SP] = (R7:0);
-       [--SP] = (P5:0);
-
-       /*
-        * PLL_LOCKCNT - how many SCLK Cycles to delay while PLL becomes stable
-        */
-       p0.h = hi(PLL_LOCKCNT);
-       p0.l = lo(PLL_LOCKCNT);
-       r0 = 0x300(Z);
-       w[p0] = r0.l;
-       ssync;
-
-       /*
-        * Put SDRAM in self-refresh, incase anything is running
-        */
-       P2.H = hi(EBIU_SDGCTL);
-       P2.L = lo(EBIU_SDGCTL);
-       R0 = [P2];
-       BITSET (R0, 24);
-       [P2] = R0;
-       SSYNC;
-
-       /*
-        *  Set PLL_CTL with the value that we calculate in R0
-        *   - [14:09] = MSEL[5:0] : CLKIN / VCO multiplication factors
-        *   - [8]     = BYPASS    : BYPASS the PLL, run CLKIN into CCLK/SCLK
-        *   - [7]     = output delay (add 200ps of delay to mem signals)
-        *   - [6]     = input delay (add 200ps of input delay to mem signals)
-        *   - [5]     = PDWN      : 1=All Clocks off
-        *   - [3]     = STOPCK    : 1=Core Clock off
-        *   - [1]     = PLL_OFF   : 1=Disable Power to PLL
-        *   - [0]     = DF        : 1=Pass CLKIN/2 to PLL / 0=Pass CLKIN to PLL
-        *   all other bits set to zero
-        */
-
-       r0 = CONFIG_VCO_MULT & 63;      /* Load the VCO multiplier */
-       r0 = r0 << 9;                   /* Shift it over, */
-       r1 = CONFIG_CLKIN_HALF;         /* Do we need to divide CLKIN by 2? */
-       r0 = r1 | r0;
-       r1 = CONFIG_PLL_BYPASS;         /* Bypass the PLL? */
-       r1 = r1 << 8;                   /* Shift it over */
-       r0 = r1 | r0;                   /* add them all together */
-
-       p0.h = hi(PLL_CTL);
-       p0.l = lo(PLL_CTL);             /* Load the address */
-       cli r2;                         /* Disable interrupts */
-       ssync;
-       w[p0] = r0.l;                   /* Set the value */
-       idle;                           /* Wait for the PLL to stablize */
-       sti r2;                         /* Enable interrupts */
-
-check_again:
-       p0.h = hi(PLL_STAT);
-       p0.l = lo(PLL_STAT);
-       R0 = W[P0](Z);
-       CC = BITTST(R0,5);
-       if ! CC jump check_again;
-
-       /* Configure SCLK & CCLK Dividers */
-       r0 = (CONFIG_CCLK_ACT_DIV | CONFIG_SCLK_DIV);
-       p0.h = hi(PLL_DIV);
-       p0.l = lo(PLL_DIV);
-       w[p0] = r0.l;
-       ssync;
-
-       /*
-        * We now are running at speed, time to set the Async mem bank wait states
-        * This will speed up execution, since we are normally running from FLASH.
-        */
-
-       p2.h = (EBIU_AMBCTL1 >> 16);
-       p2.l = (EBIU_AMBCTL1 & 0xFFFF);
-       r0.h = (AMBCTL1VAL >> 16);
-       r0.l = (AMBCTL1VAL & 0xFFFF);
-       [p2] = r0;
-       ssync;
-
-       p2.h = (EBIU_AMBCTL0 >> 16);
-       p2.l = (EBIU_AMBCTL0 & 0xFFFF);
-       r0.h = (AMBCTL0VAL >> 16);
-       r0.l = (AMBCTL0VAL & 0xFFFF);
-       [p2] = r0;
-       ssync;
-
-       p2.h = (EBIU_AMGCTL >> 16);
-       p2.l = (EBIU_AMGCTL & 0xffff);
-       r0 = AMGCTLVAL;
-       w[p2] = r0;
-       ssync;
-
-       /*
-        * Now, Initialize the SDRAM,
-        * start with the SDRAM Refresh Rate Control Register
-        */
-       p0.l = lo(EBIU_SDRRC);
-       p0.h = hi(EBIU_SDRRC);
-       r0 = mem_SDRRC;
-       w[p0] = r0.l;
-       ssync;
-
-       /*
-        * SDRAM Memory Bank Control Register - bank specific parameters
-        */
-       p0.l = (EBIU_SDBCTL & 0xFFFF);
-       p0.h = (EBIU_SDBCTL >> 16);
-       r0 = mem_SDBCTL;
-       w[p0] = r0.l;
-       ssync;
-
-       /*
-        * SDRAM Global Control Register - global programmable parameters
-        * Disable self-refresh
-        */
-       P2.H = hi(EBIU_SDGCTL);
-       P2.L = lo(EBIU_SDGCTL);
-       R0 = [P2];
-       BITCLR (R0, 24);
-
-       /*
-        * Check if SDRAM is already powered up, if it is, enable self-refresh
-        */
-       p0.h = hi(EBIU_SDSTAT);
-       p0.l = lo(EBIU_SDSTAT);
-       r2.l = w[p0];
-       cc = bittst(r2,3);
-       if !cc jump skip;
-       NOP;
-       BITSET (R0, 23);
-skip:
-       [P2] = R0;
-       SSYNC;
-
-       /* Write in the new value in the register */
-       R0.L = lo(mem_SDGCTL);
-       R0.H = hi(mem_SDGCTL);
-       [P2] = R0;
-       SSYNC;
-       nop;
-
-       (P5:0) = [SP++];
-       (R7:0) = [SP++];
-       RETS   = [SP++];
-       ASTAT  = [SP++];
-       RTS;
diff --git a/cpu/bf561/init_sdram_bootrom_initblock.S b/cpu/bf561/init_sdram_bootrom_initblock.S
deleted file mode 100644 (file)
index 9cc5e78..0000000
+++ /dev/null
@@ -1,189 +0,0 @@
-#define ASSEMBLY
-
-#include <linux/config.h>
-#include <config.h>
-#include <asm/blackfin.h>
-#include <asm/mem_init.h>
-#include <asm/mach-common/bits/bootrom.h>
-#include <asm/mach-common/bits/ebiu.h>
-#include <asm/mach-common/bits/pll.h>
-#include <asm/mach-common/bits/uart.h>
-.global init_sdram;
-
-#if (CONFIG_CCLK_DIV == 1)
-#define CONFIG_CCLK_ACT_DIV    CCLK_DIV1
-#endif
-#if (CONFIG_CCLK_DIV == 2)
-#define CONFIG_CCLK_ACT_DIV    CCLK_DIV2
-#endif
-#if (CONFIG_CCLK_DIV == 4)
-#define CONFIG_CCLK_ACT_DIV    CCLK_DIV4
-#endif
-#if (CONFIG_CCLK_DIV == 8)
-#define CONFIG_CCLK_ACT_DIV    CCLK_DIV8
-#endif
-#ifndef CONFIG_CCLK_ACT_DIV
-#define CONFIG_CCLK_ACT_DIV    CONFIG_CCLK_DIV_not_defined_properly
-#endif
-
-init_sdram:
-       [--SP] = ASTAT;
-       [--SP] = RETS;
-       [--SP] = (R7:0);
-       [--SP] = (P5:0);
-
-
-       p0.h = hi(SICA_IWR0);
-       p0.l = lo(SICA_IWR0);
-       r0.l = 0x1;
-       w[p0] = r0.l;
-       SSYNC;
-
-       p0.h = hi(SPI_BAUD);
-       p0.l = lo(SPI_BAUD);
-       r0.l = CONFIG_SPI_BAUD_INITBLOCK;
-       w[p0] = r0.l;
-       SSYNC;
-
-       /*
-        * PLL_LOCKCNT - how many SCLK Cycles to delay while PLL becomes stable
-        */
-       p0.h = hi(PLL_LOCKCNT);
-       p0.l = lo(PLL_LOCKCNT);
-       r0 = 0x300(Z);
-       w[p0] = r0.l;
-       ssync;
-
-       /*
-        * Put SDRAM in self-refresh, incase anything is running
-        */
-       P2.H = hi(EBIU_SDGCTL);
-       P2.L = lo(EBIU_SDGCTL);
-       R0 = [P2];
-       BITSET (R0, 24);
-       [P2] = R0;
-       SSYNC;
-
-       /*
-        *  Set PLL_CTL with the value that we calculate in R0
-        *   - [14:09] = MSEL[5:0] : CLKIN / VCO multiplication factors
-        *   - [8]     = BYPASS    : BYPASS the PLL, run CLKIN into CCLK/SCLK
-        *   - [7]     = output delay (add 200ps of delay to mem signals)
-        *   - [6]     = input delay (add 200ps of input delay to mem signals)
-        *   - [5]     = PDWN      : 1=All Clocks off
-        *   - [3]     = STOPCK    : 1=Core Clock off
-        *   - [1]     = PLL_OFF   : 1=Disable Power to PLL
-        *   - [0]     = DF        : 1=Pass CLKIN/2 to PLL / 0=Pass CLKIN to PLL
-        *   all other bits set to zero
-        */
-
-       r0 = CONFIG_VCO_MULT & 63;      /* Load the VCO multiplier */
-       r0 = r0 << 9;                   /* Shift it over, */
-       r1 = CONFIG_CLKIN_HALF;         /* Do we need to divide CLKIN by 2? */
-       r0 = r1 | r0;
-       r1 = CONFIG_PLL_BYPASS;         /* Bypass the PLL? */
-       r1 = r1 << 8;                   /* Shift it over */
-       r0 = r1 | r0;                   /* add them all together */
-
-       p0.h = hi(PLL_CTL);
-       p0.l = lo(PLL_CTL);             /* Load the address */
-       cli r2;                         /* Disable interrupts */
-       ssync;
-       w[p0] = r0.l;                   /* Set the value */
-       idle;                           /* Wait for the PLL to stablize */
-       sti r2;                         /* Enable interrupts */
-
-check_again:
-       p0.h = hi(PLL_STAT);
-       p0.l = lo(PLL_STAT);
-       R0 = W[P0](Z);
-       CC = BITTST(R0,5);
-       if ! CC jump check_again;
-
-       /* Configure SCLK & CCLK Dividers */
-       r0 = (CONFIG_CCLK_ACT_DIV | CONFIG_SCLK_DIV);
-       p0.h = hi(PLL_DIV);
-       p0.l = lo(PLL_DIV);
-       w[p0] = r0.l;
-       ssync;
-
-       /*
-        * We now are running at speed, time to set the Async mem bank wait states
-        * This will speed up execution, since we are normally running from FLASH.
-        */
-
-       p2.h = (EBIU_AMBCTL1 >> 16);
-       p2.l = (EBIU_AMBCTL1 & 0xFFFF);
-       r0.h = (AMBCTL1VAL >> 16);
-       r0.l = (AMBCTL1VAL & 0xFFFF);
-       [p2] = r0;
-       ssync;
-
-       p2.h = (EBIU_AMBCTL0 >> 16);
-       p2.l = (EBIU_AMBCTL0 & 0xFFFF);
-       r0.h = (AMBCTL0VAL >> 16);
-       r0.l = (AMBCTL0VAL & 0xFFFF);
-       [p2] = r0;
-       ssync;
-
-       p2.h = (EBIU_AMGCTL >> 16);
-       p2.l = (EBIU_AMGCTL & 0xffff);
-       r0 = AMGCTLVAL;
-       w[p2] = r0;
-       ssync;
-
-       /*
-        * Now, Initialize the SDRAM,
-        * start with the SDRAM Refresh Rate Control Register
-        */
-       p0.l = lo(EBIU_SDRRC);
-       p0.h = hi(EBIU_SDRRC);
-       r0 = mem_SDRRC;
-       w[p0] = r0.l;
-       ssync;
-
-       /*
-        * SDRAM Memory Bank Control Register - bank specific parameters
-        */
-       p0.l = (EBIU_SDBCTL & 0xFFFF);
-       p0.h = (EBIU_SDBCTL >> 16);
-       r0 = mem_SDBCTL;
-       w[p0] = r0.l;
-       ssync;
-
-       /*
-        * SDRAM Global Control Register - global programmable parameters
-        * Disable self-refresh
-        */
-       P2.H = hi(EBIU_SDGCTL);
-       P2.L = lo(EBIU_SDGCTL);
-       R0 = [P2];
-       BITCLR (R0, 24);
-
-       /*
-        * Check if SDRAM is already powered up, if it is, enable self-refresh
-        */
-       p0.h = hi(EBIU_SDSTAT);
-       p0.l = lo(EBIU_SDSTAT);
-       r2.l = w[p0];
-       cc = bittst(r2,3);
-       if !cc jump skip;
-       NOP;
-       BITSET (R0, 23);
-skip:
-       [P2] = R0;
-       SSYNC;
-
-       /* Write in the new value in the register */
-       R0.L = lo(mem_SDGCTL);
-       R0.H = hi(mem_SDGCTL);
-       [P2] = R0;
-       SSYNC;
-       nop;
-
-
-       (P5:0) = [SP++];
-       (R7:0) = [SP++];
-       RETS   = [SP++];
-       ASTAT  = [SP++];
-       RTS;
diff --git a/cpu/bf561/interrupt.S b/cpu/bf561/interrupt.S
deleted file mode 100644 (file)
index a10eaab..0000000
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- * U-boot - interrupt.S Processing of interrupts and exception handling
- *
- * Copyright (c) 2005-2007 Analog Devices Inc.
- *
- * (C) Copyright 2000-2004
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * This file is based on interrupt.S
- *
- * Copyright (C) 2003  Metrowerks, Inc. <mwaddel@metrowerks.com>
- * Copyright (C) 2002  Arcturus Networks Ltd. Ted Ma <mated@sympatico.ca>
- * Copyright (C) 1998  D. Jeff Dionne <jeff@ryeham.ee.ryerson.ca>,
- *                     Kenneth Albanowski <kjahds@kjahds.com>,
- *                     The Silver Hammer Group, Ltd.
- *
- * (c) 1995, Dionne & Associates
- * (c) 1995, DKG Display Tech.
- *
- * This file is also based on exception.asm
- * (C) Copyright 2001-2005 - Analog Devices, 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., 51 Franklin St, Fifth Floor, Boston,
- * MA 02110-1301 USA
- */
-
-#define ASSEMBLY
-#include <config.h>
-#include <asm/blackfin.h>
-#include <asm/entry.h>
-
-.global _blackfin_irq_panic;
-
-.text
-.align 2
-
-#ifndef CONFIG_KGDB
-.global _evt_emulation
-_evt_emulation:
-       SAVE_CONTEXT
-       r0 = 0;
-       r1 = seqstat;
-       sp += -12;
-       call _blackfin_irq_panic;
-       sp += 12;
-       rte;
-#endif
-
-.global _evt_nmi
-_evt_nmi:
-       SAVE_CONTEXT
-       r0 = 2;
-       r1 = RETN;
-       sp += -12;
-       call _blackfin_irq_panic;
-       sp += 12;
-
-_evt_nmi_exit:
-       rtn;
-
-.global _trap
-_trap:
-       SAVE_ALL_SYS
-       r0 = sp;        /* stack frame pt_regs pointer argument ==> r0 */
-       sp += -12;
-       call _trap_c
-       sp += 12;
-       RESTORE_ALL_SYS
-       rtx;
-
-.global _evt_rst
-_evt_rst:
-       SAVE_CONTEXT
-       r0 = 1;
-       r1 = RETN;
-       sp += -12;
-       call _do_reset;
-       sp += 12;
-
-_evt_rst_exit:
-       rtn;
-
-irq_panic:
-       r0 = 3;
-       r1 =  sp;
-       sp += -12;
-       call _blackfin_irq_panic;
-       sp += 12;
-
-.global _evt_ivhw
-_evt_ivhw:
-       SAVE_CONTEXT
-       RAISE 14;
-
-_evt_ivhw_exit:
-        rti;
-
-.global _evt_timer
-_evt_timer:
-       SAVE_CONTEXT
-       r0 = 6;
-       sp += -12;
-       /* Polling method used now. */
-       /* call timer_int; */
-       sp += 12;
-       RESTORE_CONTEXT
-       rti;
-       nop;
-
-.global _evt_evt7
-_evt_evt7:
-       SAVE_CONTEXT
-       r0 = 7;
-       sp += -12;
-       call _process_int;
-       sp += 12;
-
-evt_evt7_exit:
-       RESTORE_CONTEXT
-       rti;
-
-.global _evt_evt8
-_evt_evt8:
-       SAVE_CONTEXT
-       r0 = 8;
-       sp += -12;
-       call _process_int;
-       sp += 12;
-
-evt_evt8_exit:
-       RESTORE_CONTEXT
-       rti;
-
-.global _evt_evt9
-_evt_evt9:
-       SAVE_CONTEXT
-       r0 = 9;
-       sp += -12;
-       call _process_int;
-       sp += 12;
-
-evt_evt9_exit:
-       RESTORE_CONTEXT
-       rti;
-
-.global _evt_evt10
-_evt_evt10:
-       SAVE_CONTEXT
-       r0 = 10;
-       sp += -12;
-       call _process_int;
-       sp += 12;
-
-evt_evt10_exit:
-       RESTORE_CONTEXT
-       rti;
-
-.global _evt_evt11
-_evt_evt11:
-       SAVE_CONTEXT
-       r0 = 11;
-       sp += -12;
-       call _process_int;
-       sp += 12;
-
-evt_evt11_exit:
-       RESTORE_CONTEXT
-       rti;
-
-.global _evt_evt12
-_evt_evt12:
-       SAVE_CONTEXT
-       r0 = 12;
-       sp += -12;
-       call _process_int;
-       sp += 12;
-evt_evt12_exit:
-        RESTORE_CONTEXT
-        rti;
-
-.global _evt_evt13
-_evt_evt13:
-       SAVE_CONTEXT
-       r0 = 13;
-       sp += -12;
-       call _process_int;
-       sp += 12;
-
-evt_evt13_exit:
-        RESTORE_CONTEXT
-        rti;
-
-.global _evt_system_call
-_evt_system_call:
-       [--sp] = r0;
-       [--SP] = RETI;
-       r0 = [sp++];
-       r0 += 2;
-       [--sp] = r0;
-       RETI = [SP++];
-       r0 = [SP++];
-       SAVE_CONTEXT
-       sp += -12;
-       call _exception_handle;
-       sp += 12;
-       RESTORE_CONTEXT
-       RTI;
-
-evt_system_call_exit:
-       rti;
-
-.global _evt_soft_int1
-_evt_soft_int1:
-       [--sp] = r0;
-       [--SP] = RETI;
-       r0 = [sp++];
-       r0 += 2;
-       [--sp] = r0;
-       RETI = [SP++];
-       r0 = [SP++];
-       SAVE_CONTEXT
-       sp += -12;
-       call _exception_handle;
-       sp += 12;
-       RESTORE_CONTEXT
-       RTI;
-
-evt_soft_int1_exit:
-       rti;
diff --git a/cpu/bf561/ints.c b/cpu/bf561/ints.c
deleted file mode 100644 (file)
index d6aa393..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * U-boot - ints.c Interrupt related routines
- *
- * Copyright (c) 2005-2007 Analog Devices Inc.
- *
- * This file is based on ints.c
- *
- * Apr18 2003, Changed by HuTao to support interrupt cascading for Blackfin
- *     drivers
- *
- * Copyright 1996 Roman Zippel
- * Copyright 1999 D. Jeff Dionne <jeff@uclinux.org>
- * Copyright 2000-2001 Lineo, Inc. D. Jefff Dionne <jeff@lineo.ca>
- * Copyright 2002 Arcturus Networks Inc. MaTed <mated@sympatico.ca>
- * Copyright 2003 Metrowerks/Motorola
- *
- * (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 <linux/stddef.h>
-#include <asm/system.h>
-#include <asm/traps.h>
-#include <asm/io.h>
-#include <asm/errno.h>
-#include <asm/blackfin.h>
-#include "cpu.h"
-
-void blackfin_irq_panic(int reason, struct pt_regs *regs)
-{
-       printf("\n\nException: IRQ 0x%x entered\n", reason);
-       printf("code=[0x%x], ", (unsigned int)(regs->seqstat & 0x3f));
-       printf("stack frame=0x%x, ", (unsigned int)regs);
-       printf("bad PC=0x%04x\n", (unsigned int)regs->pc);
-       dump(regs);
-       printf("Unhandled IRQ or exceptions!\n");
-       printf("Please reset the board \n");
-}
-
-void blackfin_init_IRQ(void)
-{
-       *(unsigned volatile long *)(SICA_IMASK0) = 0;
-#ifndef CONFIG_KGDB
-       *(unsigned volatile long *)(EVT1) = 0x0;
-#endif
-       *(unsigned volatile long *)(EVT2) =
-           (unsigned volatile long)evt_nmi;
-       *(unsigned volatile long *)(EVT3) =
-           (unsigned volatile long)trap;
-       *(unsigned volatile long *)(EVT5) =
-           (unsigned volatile long)evt_ivhw;
-       *(unsigned volatile long *)(EVT0) =
-           (unsigned volatile long)evt_rst;
-       *(unsigned volatile long *)(EVT6) =
-           (unsigned volatile long)evt_timer;
-       *(unsigned volatile long *)(EVT7) =
-           (unsigned volatile long)evt_evt7;
-       *(unsigned volatile long *)(EVT8) =
-           (unsigned volatile long)evt_evt8;
-       *(unsigned volatile long *)(EVT9) =
-           (unsigned volatile long)evt_evt9;
-       *(unsigned volatile long *)(EVT10) =
-           (unsigned volatile long)evt_evt10;
-       *(unsigned volatile long *)(EVT11) =
-           (unsigned volatile long)evt_evt11;
-       *(unsigned volatile long *)(EVT12) =
-           (unsigned volatile long)evt_evt12;
-       *(unsigned volatile long *)(EVT13) =
-           (unsigned volatile long)evt_evt13;
-       *(unsigned volatile long *)(EVT14) =
-           (unsigned volatile long)evt_system_call;
-       *(unsigned volatile long *)(EVT15) =
-           (unsigned volatile long)evt_soft_int1;
-       *(volatile unsigned long *)ILAT = 0;
-       asm("csync;");
-       *(volatile unsigned long *)IMASK = 0xffbf;
-       asm("csync;");
-}
-
-void exception_handle(void)
-{
-#if defined (CONFIG_PANIC_HANG)
-       display_excp();
-#else
-       udelay(100000);         /* allow messages to go out */
-       do_reset(NULL, 0, 0, NULL);
-#endif
-}
-
-void display_excp(void)
-{
-       printf("Exception!\n");
-}
diff --git a/cpu/bf561/serial.c b/cpu/bf561/serial.c
deleted file mode 100644 (file)
index a398fd5..0000000
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * U-boot - serial.c Serial driver for BF561
- *
- * Copyright (c) 2005-2007 Analog Devices Inc.
- *
- * This file is based on
- * bf533_serial.c: Serial driver for BlackFin BF533 DSP internal UART.
- * Copyright (c) 2003  Bas Vermeulen <bas@buyways.nl>,
- *                     BuyWays B.V. (www.buyways.nl)
- *
- * Based heavily on blkfinserial.c
- * blkfinserial.c: Serial driver for BlackFin DSP internal USRTs.
- * Copyright(c) 2003   Metrowerks      <mwaddel@metrowerks.com>
- * Copyright(c)        2001    Tony Z. Kou     <tonyko@arcturusnetworks.com>
- * Copyright(c)        2001-2002 Arcturus Networks Inc. <www.arcturusnetworks.com>
- *
- * Based on code from 68328 version serial driver imlpementation which was:
- * Copyright (C) 1995       David S. Miller    <davem@caip.rutgers.edu>
- * Copyright (C) 1998       Kenneth Albanowski <kjahds@kjahds.com>
- * Copyright (C) 1998, 1999 D. Jeff Dionne     <jeff@uclinux.org>
- * Copyright (C) 1999       Vladimir Gurevich  <vgurevic@cisco.com>
- *
- * (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 <asm/system.h>
-#include <asm/bitops.h>
-#include <asm/delay.h>
-#include "serial.h"
-#include <asm/io.h>
-#include <asm/mach-common/bits/uart.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-unsigned long pll_div_fact;
-
-void calc_baud(void)
-{
-       unsigned char i;
-       int temp;
-       u_long sclk = get_sclk();
-
-       for (i = 0; i < sizeof(baud_table) / sizeof(int); i++) {
-               temp = sclk / (baud_table[i] * 8);
-               if ((temp & 0x1) == 1) {
-                       temp++;
-               }
-               temp = temp / 2;
-               hw_baud_table[i].dl_high = (temp >> 8) & 0xFF;
-               hw_baud_table[i].dl_low = (temp) & 0xFF;
-       }
-}
-
-void serial_setbrg(void)
-{
-       int i;
-
-       calc_baud();
-
-       for (i = 0; i < sizeof(baud_table) / sizeof(int); i++) {
-               if (gd->baudrate == baud_table[i])
-                       break;
-       }
-
-       /* Enable UART */
-       *pUART_GCTL |= UCEN;
-       SSYNC();
-
-       /* Set DLAB in LCR to Access DLL and DLH */
-       ACCESS_LATCH;
-       SSYNC();
-
-       *pUART_DLL = hw_baud_table[i].dl_low;
-       SSYNC();
-       *pUART_DLH = hw_baud_table[i].dl_high;
-       SSYNC();
-
-       /* Clear DLAB in LCR to Access THR RBR IER */
-       ACCESS_PORT_IER;
-       SSYNC();
-
-       /*
-        * Enable  ERBFI and ELSI interrupts
-        * to poll SIC_ISR register
-        */
-       *pUART_IER = ELSI | ERBFI | ETBEI;
-       SSYNC();
-
-       /* Set LCR to Word Lengh 8-bit word select */
-       *pUART_LCR = WLS_8;
-       SSYNC();
-
-       return;
-}
-
-int serial_init(void)
-{
-       serial_setbrg();
-       return (0);
-}
-
-void serial_putc(const char c)
-{
-       if ((*pUART_LSR) & TEMT) {
-               if (c == '\n')
-                       serial_putc('\r');
-
-               local_put_char(c);
-       }
-
-       while (!((*pUART_LSR) & TEMT))
-               SYNC_ALL;
-
-       return;
-}
-
-int serial_tstc(void)
-{
-       if (*pUART_LSR & DR)
-               return 1;
-       else
-               return 0;
-}
-
-int serial_getc(void)
-{
-       unsigned short uart_lsr_val, uart_rbr_val;
-       unsigned long isr_val;
-       int ret;
-
-       /* Poll for RX Interrupt */
-       while (!serial_tstc())
-               continue;
-       asm("csync;");
-
-       uart_lsr_val = *pUART_LSR;      /* Clear status bit */
-       uart_rbr_val = *pUART_RBR;      /* getc() */
-
-       if (uart_lsr_val & (OE|PE|FE|BI)) {
-               ret = -1;
-       } else {
-               ret = uart_rbr_val & 0xff;
-       }
-
-       return ret;
-}
-
-void serial_puts(const char *s)
-{
-       while (*s) {
-               serial_putc(*s++);
-       }
-}
-
-static void local_put_char(char ch)
-{
-       int flags = 0;
-       unsigned long isr_val;
-
-       /* Poll for TX Interruput */
-       while (!(*pUART_LSR & THRE))
-               continue;
-       asm("csync;");
-
-       *pUART_THR = ch;        /* putc() */
-
-       return;
-}
diff --git a/cpu/bf561/serial.h b/cpu/bf561/serial.h
deleted file mode 100644 (file)
index 647560c..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * U-boot - bf561_serial.h Serial Driver defines
- *
- * Copyright (c) 2005-2007 Analog Devices Inc.
- *
- * This file is based on
- * bf533_serial.h: Definitions for the BlackFin BF533 DSP serial driver.
- * Copyright (C) 2003  Bas Vermeulen <bas@buyways.nl>
- *                     BuyWays B.V. (www.buyways.nl)
- *
- * Based heavily on:
- * blkfinserial.h: Definitions for the BlackFin DSP serial driver.
- *
- * Copyright (C) 2001  Tony Z. Kou     tonyko@arcturusnetworks.com
- * Copyright (C) 2001   Arcturus Networks Inc. <www.arcturusnetworks.com>
- *
- * Based on code from 68328serial.c which was:
- * Copyright (C) 1995       David S. Miller    <davem@caip.rutgers.edu>
- * Copyright (C) 1998       Kenneth Albanowski <kjahds@kjahds.com>
- * Copyright (C) 1998, 1999 D. Jeff Dionne     <jeff@uclinux.org>
- * Copyright (C) 1999       Vladimir Gurevich  <vgurevic@cisco.com>
- *
- * (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
- */
-
-#ifndef _Bf561_SERIAL_H
-#define _Bf561_SERIAL_H
-
-#include <linux/config.h>
-#include <asm/blackfin.h>
-
-#define SYNC_ALL       __asm__ __volatile__ ("ssync;\n")
-#define ACCESS_LATCH   *pUART_LCR |= DLAB;
-#define ACCESS_PORT_IER        *pUART_LCR &= (~DLAB);
-
-void serial_setbrg(void);
-static void local_put_char(char ch);
-void calc_baud(void);
-void serial_setbrg(void);
-int serial_init(void);
-void serial_putc(const char c);
-int serial_tstc(void);
-int serial_getc(void);
-void serial_puts(const char *s);
-static void local_put_char(char ch);
-
-int baud_table[5] = { 9600, 19200, 38400, 57600, 115200 };
-
-struct {
-       unsigned char dl_high;
-       unsigned char dl_low;
-} hw_baud_table[5];
-
-#ifdef CONFIG_STAMP
-extern unsigned long pll_div_fact;
-#endif
-
-#endif
diff --git a/cpu/bf561/start.S b/cpu/bf561/start.S
deleted file mode 100644 (file)
index 6565de8..0000000
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * U-boot - start.S Startup file of u-boot for BF533/BF561
- *
- * Copyright (c) 2005-2007 Analog Devices Inc.
- *
- * This file is based on head.S
- * Copyright (c) 2003  Metrowerks/Motorola
- * Copyright (C) 1998  D. Jeff Dionne <jeff@ryeham.ee.ryerson.ca>,
- *                    Kenneth Albanowski <kjahds@kjahds.com>,
- *                    The Silver Hammer Group, Ltd.
- * (c) 1995, Dionne & Associates
- * (c) 1995, DKG Display Tech.
- *
- * 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
- */
-
-/*
- * Note: A change in this file subsequently requires a change in
- *       board/$(board_name)/config.mk for a valid u-boot.bin
- */
-
-#define ASSEMBLY
-
-#include <linux/config.h>
-#include <config.h>
-#include <asm/blackfin.h>
-
-#include <asm/mach-common/bits/core.h>
-#include <asm/mach-common/bits/dma.h>
-#include <asm/mach-common/bits/pll.h>
-
-.global _stext;
-.global __bss_start;
-.global start;
-.global _start;
-.global edata;
-.global _exit;
-.global init_sdram;
-
-.text
-_start:
-start:
-_stext:
-
-       R0 = 0x32;
-       SYSCFG = R0;
-       SSYNC;
-
-       /*
-        * As per HW reference manual DAG registers,
-        * DATA and Address resgister shall be zero'd
-        * in initialization, after a reset state
-        */
-       r1 = 0; /* Data registers zero'd */
-       r2 = 0;
-       r3 = 0;
-       r4 = 0;
-       r5 = 0;
-       r6 = 0;
-       r7 = 0;
-
-       p0 = 0; /* Address registers zero'd */
-       p1 = 0;
-       p2 = 0;
-       p3 = 0;
-       p4 = 0;
-       p5 = 0;
-
-       i0 = 0; /* DAG Registers zero'd */
-       i1 = 0;
-       i2 = 0;
-       i3 = 0;
-       m0 = 0;
-       m1 = 0;
-       m3 = 0;
-       m3 = 0;
-       l0 = 0;
-       l1 = 0;
-       l2 = 0;
-       l3 = 0;
-       b0 = 0;
-       b1 = 0;
-       b2 = 0;
-       b3 = 0;
-
-       /*
-        * Set loop counters to zero, to make sure that
-        * hw loops are disabled.
-        */
-       r0  = 0;
-       lc0 = r0;
-       lc1 = r0;
-
-       SSYNC;
-
-       /* Check soft reset status */
-       p0.h = SWRST >> 16;
-       p0.l = SWRST & 0xFFFF;
-       r0.l = w[p0];
-
-       cc = bittst(r0, 15);
-       if !cc jump no_soft_reset;
-
-       /* Clear Soft reset */
-       r0 = 0x0000;
-       w[p0] = r0;
-       ssync;
-
-no_soft_reset:
-       nop;
-
-       /* Clear EVT registers */
-       p0.h = (EVT0 >> 16);
-       p0.l = (EVT0 & 0xFFFF);
-       p0 += 8;
-       p1 = 14;
-       r1 = 0;
-       LSETUP(4,4) lc0 = p1;
-       [ p0 ++ ] = r1;
-
-       p0.h = hi(SICA_IWR0);
-       p0.l = lo(SICA_IWR0);
-       r0.l = 0x1;
-       w[p0] = r0.l;
-       SSYNC;
-
-       sp.l = (0xffb01000 & 0xFFFF);
-       sp.h = (0xffb01000 >> 16);
-
-       /*
-        * Check if the code is in SDRAM
-        * If the code is in SDRAM, skip SDRAM initializaiton
-        */
-       call get_pc;
-       r3.l = 0x0;
-       r3.h = 0x2000;
-       cc = r0 < r3 (iu);
-       if cc jump sdram_initialized;
-       call init_sdram;
-       /* relocate into to RAM */
-sdram_initialized:
-       call get_pc;
-offset:
-       r2.l = offset;
-       r2.h = offset;
-       r3.l = start;
-       r3.h = start;
-       r1 = r2 - r3;
-
-       r0 = r0 - r1;
-       p1 = r0;
-
-       p2.l = (CFG_MONITOR_BASE & 0xffff);
-       p2.h = (CFG_MONITOR_BASE >> 16);
-
-       p3 = 0x04;
-       p4.l = ((CFG_MONITOR_BASE + CFG_MONITOR_LEN) & 0xffff);
-       p4.h = ((CFG_MONITOR_BASE + CFG_MONITOR_LEN) >> 16);
-loop1:
-       r1 = [p1 ++ p3];
-       [p2 ++ p3] = r1;
-       cc=p2==p4;
-       if !cc jump loop1;
-       /*
-        * configure STACK
-        */
-       r0.h = (CONFIG_STACKBASE >> 16);
-       r0.l = (CONFIG_STACKBASE & 0xFFFF);
-       sp = r0;
-       fp = sp;
-
-       /*
-        * This next section keeps the processor in supervisor mode
-        * during kernel boot.  Switches to user mode at end of boot.
-        * See page 3-9 of Hardware Reference manual for documentation.
-        */
-
-       /* To keep ourselves in the supervisor mode */
-       p0.l = (EVT15 & 0xFFFF);
-       p0.h = (EVT15 >> 16);
-
-       p1.l = _real_start;
-       p1.h = _real_start;
-       [p0] = p1;
-
-       p0.l = (IMASK & 0xFFFF);
-       p0.h = (IMASK >> 16);
-       r0.l = LO(EVT_IVG15);
-       r0.h = HI(EVT_IVG15);
-       [p0] = r0;
-       raise 15;
-       p0.l = WAIT_HERE;
-       p0.h = WAIT_HERE;
-       reti = p0;
-       rti;
-
-WAIT_HERE:
-       jump WAIT_HERE;
-
-.global _real_start;
-_real_start:
-       [ -- sp ] = reti;
-
-       /* DMA reset code to Hi of L1 SRAM */
-copy:
-       P1.H = hi(SYSMMR_BASE); /* P1 Points to the beginning of SYSTEM MMR Space */
-       P1.L = lo(SYSMMR_BASE);
-
-       R0.H = reset_start;     /* Source Address (high) */
-       R0.L = reset_start;     /* Source Address (low) */
-       R1.H = reset_end;
-       R1.L = reset_end;
-       R2 = R1 - R0;           /* Count */
-       R1.H = hi(L1_INST_SRAM);        /* Destination Address (high) */
-       R1.L = lo(L1_INST_SRAM);        /* Destination Address (low) */
-       R3.L = DMAEN;           /* Source DMAConfig Value (8-bit words) */
-       R4.L = (DI_EN | WNR | DMAEN);   /* Destination DMAConfig Value (8-bit words) */
-
-DMA:
-       R6 = 0x1 (Z);
-       W[P1+OFFSET_(IMDMA_S0_X_MODIFY)] = R6;  /* Source Modify = 1 */
-       W[P1+OFFSET_(IMDMA_D0_X_MODIFY)] = R6;  /* Destination Modify = 1 */
-
-       [P1+OFFSET_(IMDMA_S0_START_ADDR)] = R0; /* Set Source Base Address */
-       W[P1+OFFSET_(IMDMA_S0_X_COUNT)] = R2;   /* Set Source Count */
-       /* Set Source  DMAConfig = DMA Enable,
-       Memory Read,  8-Bit Transfers, 1-D DMA, Flow - Stop */
-       W[P1+OFFSET_(IMDMA_S0_CONFIG)] = R3;
-
-       [P1+OFFSET_(IMDMA_D0_START_ADDR)] = R1; /* Set Destination Base Address */
-       W[P1+OFFSET_(IMDMA_D0_X_COUNT)] = R2;   /* Set Destination Count */
-       /* Set Destination DMAConfig = DMA Enable,
-       Memory Write, 8-Bit Transfers, 1-D DMA, Flow - Stop, IOC */
-       W[P1+OFFSET_(IMDMA_D0_CONFIG)] = R4;
-
-WAIT_DMA_DONE:
-       p0.h = hi(IMDMA_D0_IRQ_STATUS);
-       p0.l = lo(IMDMA_D0_IRQ_STATUS);
-       R0 = W[P0](Z);
-       CC = BITTST(R0, 0);
-       if ! CC jump WAIT_DMA_DONE
-
-       R0 = 0x1;
-       W[P1+OFFSET_(IMDMA_D0_IRQ_STATUS)] = R0;        /* Write 1 to clear DMA interrupt */
-
-       /* Initialize BSS Section with 0 s */
-       p1.l = __bss_start;
-       p1.h = __bss_start;
-       p2.l = _end;
-       p2.h = _end;
-       r1 = p1;
-       r2 = p2;
-       r3 = r2 - r1;
-       r3 = r3 >> 2;
-       p3 = r3;
-       lsetup (_clear_bss, _clear_bss_end ) lc1 = p3;
-       CC = p2<=p1;
-       if CC jump _clear_bss_skip;
-       r0 = 0;
-_clear_bss:
-_clear_bss_end:
-       [p1++] = r0;
-_clear_bss_skip:
-
-       p0.l = _start1;
-       p0.h = _start1;
-       jump (p0);
-
-reset_start:
-       p0.h = WDOG_CNT >> 16;
-       p0.l = WDOG_CNT & 0xffff;
-       r0 = 0x0010;
-       w[p0] = r0;
-       p0.h = WDOG_CTL >> 16;
-       p0.l = WDOG_CTL & 0xffff;
-       r0 = 0x0000;
-       w[p0] = r0;
-reset_wait:
-       jump reset_wait;
-
-reset_end: nop;
-
-_exit:
-       jump.s  _exit;
-get_pc:
-       r0 = rets;
-       rts;
diff --git a/cpu/bf561/traps.c b/cpu/bf561/traps.c
deleted file mode 100644 (file)
index e35620c..0000000
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * U-boot - traps.c Routines related to interrupts and exceptions
- *
- * Copyright (c) 2005-2007 Analog Devices Inc.
- *
- * This file is based on
- * No original Copyright holder listed,
- * Probabily original (C) Roman Zippel (assigned DJD, 1999)
- *
- * Copyright 2003 Metrowerks - for Blackfin
- * Copyright 2000-2001 Lineo, Inc. D. Jeff Dionne <jeff@lineo.ca>
- * Copyright 1999-2000 D. Jeff Dionne, <jeff@uclinux.org>
- *
- * (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 <linux/types.h>
-#include <asm/errno.h>
-#include <asm/system.h>
-#include <asm/traps.h>
-#include "cpu.h"
-#include <asm/cplb.h>
-#include <asm/io.h>
-#include <asm/mach-common/bits/core.h>
-#include <asm/mach-common/bits/mpu.h>
-
-void init_IRQ(void)
-{
-       blackfin_init_IRQ();
-       return;
-}
-
-void process_int(unsigned long vec, struct pt_regs *fp)
-{
-       printf("interrupt\n");
-       return;
-}
-
-extern unsigned int icplb_table[page_descriptor_table_size][2];
-extern unsigned int dcplb_table[page_descriptor_table_size][2];
-
-unsigned long last_cplb_fault_retx;
-
-static unsigned int cplb_sizes[4] =
-    { 1024, 4 * 1024, 1024 * 1024, 4 * 1024 * 1024 };
-
-void trap_c(struct pt_regs *regs)
-{
-       unsigned int addr;
-       unsigned long trapnr = (regs->seqstat) & EXCAUSE;
-       unsigned int i, j, size, *I0, *I1;
-       unsigned short data = 0;
-
-       switch (trapnr) {
-               /* 0x26 - Data CPLB Miss */
-       case VEC_CPLB_M:
-
-#if ANOMALY_05000261
-               /*
-                * Work around an anomaly: if we see a new DCPLB fault, return
-                * without doing anything.  Then, if we get the same fault again,
-                * handle it.
-                */
-               addr = last_cplb_fault_retx;
-               last_cplb_fault_retx = regs->retx;
-               printf("this time, curr = 0x%08x last = 0x%08x\n", addr,
-                      last_cplb_fault_retx);
-               if (addr != last_cplb_fault_retx)
-                       goto trap_c_return;
-#endif
-               data = 1;
-
-       case VEC_CPLB_I_M:
-
-               if (data)
-                       addr = *pDCPLB_FAULT_ADDR;
-               else
-                       addr = *pICPLB_FAULT_ADDR;
-
-               for (i = 0; i < page_descriptor_table_size; i++) {
-                       if (data) {
-                               size = cplb_sizes[dcplb_table[i][1] >> 16];
-                               j = dcplb_table[i][0];
-                       } else {
-                               size = cplb_sizes[icplb_table[i][1] >> 16];
-                               j = icplb_table[i][0];
-                       }
-                       if ((j <= addr) && ((j + size) > addr)) {
-                               debug("found %i 0x%08x\n", i, j);
-                               break;
-                       }
-               }
-               if (i == page_descriptor_table_size) {
-                       printf("something is really wrong\n");
-                       do_reset(NULL, 0, 0, NULL);
-               }
-
-               /* Turn the cache off */
-               if (data) {
-                       SSYNC();
-                       asm(" .align 8; ");
-                       *(unsigned int *)DMEM_CONTROL &=
-                           ~(ACACHE_BCACHE | ENDCPLB | PORT_PREF0);
-                       SSYNC();
-               } else {
-                       SSYNC();
-                       asm(" .align 8; ");
-                       *(unsigned int *)IMEM_CONTROL &= ~(IMC | ENICPLB);
-                       SSYNC();
-               }
-
-               if (data) {
-                       I0 = (unsigned int *)DCPLB_ADDR0;
-                       I1 = (unsigned int *)DCPLB_DATA0;
-               } else {
-                       I0 = (unsigned int *)ICPLB_ADDR0;
-                       I1 = (unsigned int *)ICPLB_DATA0;
-               }
-
-               j = 0;
-               while (*I1 & CPLB_LOCK) {
-                       debug("skipping %i %08p - %08x\n", j, I1, *I1);
-                       *I0++;
-                       *I1++;
-                       j++;
-               }
-
-               debug("remove %i 0x%08x  0x%08x\n", j, *I0, *I1);
-
-               for (; j < 15; j++) {
-                       debug("replace %i 0x%08x  0x%08x\n", j, I0, I0 + 1);
-                       *I0++ = *(I0 + 1);
-                       *I1++ = *(I1 + 1);
-               }
-
-               if (data) {
-                       *I0 = dcplb_table[i][0];
-                       *I1 = dcplb_table[i][1];
-                       I0 = (unsigned int *)DCPLB_ADDR0;
-                       I1 = (unsigned int *)DCPLB_DATA0;
-               } else {
-                       *I0 = icplb_table[i][0];
-                       *I1 = icplb_table[i][1];
-                       I0 = (unsigned int *)ICPLB_ADDR0;
-                       I1 = (unsigned int *)ICPLB_DATA0;
-               }
-
-               for (j = 0; j < 16; j++) {
-                       debug("%i 0x%08x  0x%08x\n", j, *I0++, *I1++);
-               }
-
-               /* Turn the cache back on */
-               if (data) {
-                       j = *(unsigned int *)DMEM_CONTROL;
-                       SSYNC();
-                       asm(" .align 8; ");
-                       *(unsigned int *)DMEM_CONTROL =
-                           ACACHE_BCACHE | ENDCPLB | PORT_PREF0 | j;
-                       SSYNC();
-               } else {
-                       SSYNC();
-                       asm(" .align 8; ");
-                       *(unsigned int *)IMEM_CONTROL = IMC | ENICPLB;
-                       SSYNC();
-               }
-
-               break;
-       default:
-               /* All traps come here */
-               printf("code=[0x%x], ", (unsigned int)(regs->seqstat & 0x3f));
-               printf("stack frame=0x%x, ", (unsigned int)regs);
-               printf("bad PC=0x%04x\n", (unsigned int)regs->pc);
-               dump(regs);
-               printf("\n\n");
-
-               printf("Unhandled IRQ or exceptions!\n");
-               printf("Please reset the board \n");
-               do_reset(NULL, 0, 0, NULL);
-       }
-
-trap_c_return:
-       return;
-
-}
-
-void dump(struct pt_regs *fp)
-{
-       debug("RETE:  %08lx  RETN: %08lx  RETX: %08lx  RETS: %08lx\n", fp->rete,
-             fp->retn, fp->retx, fp->rets);
-       debug("IPEND: %04lx  SYSCFG: %04lx\n", fp->ipend, fp->syscfg);
-       debug("SEQSTAT: %08lx    SP: %08lx\n", (long)fp->seqstat, (long)fp);
-       debug("R0: %08lx    R1: %08lx    R2: %08lx    R3: %08lx\n", fp->r0,
-             fp->r1, fp->r2, fp->r3);
-       debug("R4: %08lx    R5: %08lx    R6: %08lx    R7: %08lx\n", fp->r4,
-             fp->r5, fp->r6, fp->r7);
-       debug("P0: %08lx    P1: %08lx    P2: %08lx    P3: %08lx\n", fp->p0,
-             fp->p1, fp->p2, fp->p3);
-       debug("P4: %08lx    P5: %08lx    FP: %08lx\n", fp->p4, fp->p5, fp->fp);
-       debug("A0.w: %08lx    A0.x: %08lx    A1.w: %08lx    A1.x: %08lx\n",
-             fp->a0w, fp->a0x, fp->a1w, fp->a1x);
-
-       debug("LB0: %08lx  LT0: %08lx  LC0: %08lx\n", fp->lb0, fp->lt0,
-             fp->lc0);
-       debug("LB1: %08lx  LT1: %08lx  LC1: %08lx\n", fp->lb1, fp->lt1,
-             fp->lc1);
-       debug("B0: %08lx  L0: %08lx  M0: %08lx  I0: %08lx\n", fp->b0, fp->l0,
-             fp->m0, fp->i0);
-       debug("B1: %08lx  L1: %08lx  M1: %08lx  I1: %08lx\n", fp->b1, fp->l1,
-             fp->m1, fp->i1);
-       debug("B2: %08lx  L2: %08lx  M2: %08lx  I2: %08lx\n", fp->b2, fp->l2,
-             fp->m2, fp->i2);
-       debug("B3: %08lx  L3: %08lx  M3: %08lx  I3: %08lx\n", fp->b3, fp->l3,
-             fp->m3, fp->i3);
-
-       debug("DCPLB_FAULT_ADDR=%p\n", *pDCPLB_FAULT_ADDR);
-       debug("ICPLB_FAULT_ADDR=%p\n", *pICPLB_FAULT_ADDR);
-
-}
diff --git a/cpu/bf561/video.c b/cpu/bf561/video.c
deleted file mode 100644 (file)
index 3ff0151..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * (C) Copyright 2000
- * Paolo Scaffardi, AIRVENT SAM s.p.a - RIMINI(ITALY), arsenio@tin.it
- * (C) Copyright 2002
- * Wolfgang Denk, wd@denx.de
- * (C) Copyright 2006
- * Aubrey Li, aubrey.li@analog.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 <stdarg.h>
-#include <common.h>
-#include <config.h>
-#include <asm/blackfin.h>
-#include <i2c.h>
-#include <linux/types.h>
-#include <devices.h>
-
-#ifdef CONFIG_VIDEO
-#define NTSC_FRAME_ADDR 0x06000000
-#include "video.h"
-
-/* NTSC OUTPUT SIZE  720 * 240 */
-#define VERTICAL       2
-#define HORIZONTAL     4
-
-int is_vblank_line(const int line)
-{
-       /*
-        *  This array contains a single bit for each line in
-        *  an NTSC frame.
-        */
-       if ((line <= 18) || (line >= 264 && line <= 281) || (line == 528))
-               return true;
-
-       return false;
-}
-
-int NTSC_framebuffer_init(char *base_address)
-{
-       const int NTSC_frames = 1;
-       const int NTSC_lines = 525;
-       char *dest = base_address;
-       int frame_num, line_num;
-
-       for (frame_num = 0; frame_num < NTSC_frames; ++frame_num) {
-               for (line_num = 1; line_num <= NTSC_lines; ++line_num) {
-                       unsigned int code;
-                       int offset = 0;
-                       int i;
-
-                       if (is_vblank_line(line_num))
-                               offset++;
-
-                       if (line_num > 266 || line_num < 3)
-                               offset += 2;
-
-                       /* Output EAV code */
-                       code = SystemCodeMap[offset].EAV;
-                       write_dest_byte((char)(code >> 24) & 0xff);
-                       write_dest_byte((char)(code >> 16) & 0xff);
-                       write_dest_byte((char)(code >> 8) & 0xff);
-                       write_dest_byte((char)(code) & 0xff);
-
-                       /* Output horizontal blanking */
-                       for (i = 0; i < 67 * 2; ++i) {
-                               write_dest_byte(0x80);
-                               write_dest_byte(0x10);
-                       }
-
-                       /* Output SAV */
-                       code = SystemCodeMap[offset].SAV;
-                       write_dest_byte((char)(code >> 24) & 0xff);
-                       write_dest_byte((char)(code >> 16) & 0xff);
-                       write_dest_byte((char)(code >> 8) & 0xff);
-                       write_dest_byte((char)(code) & 0xff);
-
-                       /* Output empty horizontal data */
-                       for (i = 0; i < 360 * 2; ++i) {
-                               write_dest_byte(0x80);
-                               write_dest_byte(0x10);
-                       }
-               }
-       }
-
-       return dest - base_address;
-}
-
-void fill_frame(char *Frame, int Value)
-{
-       int *OddPtr32;
-       int OddLine;
-       int *EvenPtr32;
-       int EvenLine;
-       int i;
-       int *data;
-       int m, n;
-
-       /* fill odd and even frames */
-       for (OddLine = 22, EvenLine = 285; OddLine < 263; OddLine++, EvenLine++) {
-               OddPtr32 = (int *)((Frame + (OddLine * 1716)) + 276);
-               EvenPtr32 = (int *)((Frame + (EvenLine * 1716)) + 276);
-               for (i = 0; i < 360; i++, OddPtr32++, EvenPtr32++) {
-                       *OddPtr32 = Value;
-                       *EvenPtr32 = Value;
-               }
-       }
-
-       for (m = 0; m < VERTICAL; m++) {
-               data = (int *)u_boot_logo.data;
-               for (OddLine = (22 + m), EvenLine = (285 + m);
-                    OddLine < (u_boot_logo.height * VERTICAL) + (22 + m);
-                    OddLine += VERTICAL, EvenLine += VERTICAL) {
-                       OddPtr32 = (int *)((Frame + ((OddLine) * 1716)) + 276);
-                       EvenPtr32 =
-                           (int *)((Frame + ((EvenLine) * 1716)) + 276);
-                       for (i = 0; i < u_boot_logo.width / 2; i++) {
-                               /* enlarge one pixel to m x n */
-                               for (n = 0; n < HORIZONTAL; n++) {
-                                       *OddPtr32++ = *data;
-                                       *EvenPtr32++ = *data;
-                               }
-                               data++;
-                       }
-               }
-       }
-}
-
-void video_putc(const char c)
-{
-}
-
-void video_puts(const char *s)
-{
-}
-
-static int video_init(void)
-{
-       char *NTSCFrame;
-       NTSCFrame = (char *)NTSC_FRAME_ADDR;
-       NTSC_framebuffer_init(NTSCFrame);
-       fill_frame(NTSCFrame, BLUE);
-
-       *pPPI_CONTROL = 0x0082;
-       *pPPI_FRAME = 0x020D;
-
-       *pDMA0_START_ADDR = NTSCFrame;
-       *pDMA0_X_COUNT = 0x035A;
-       *pDMA0_X_MODIFY = 0x0002;
-       *pDMA0_Y_COUNT = 0x020D;
-       *pDMA0_Y_MODIFY = 0x0002;
-       *pDMA0_CONFIG = 0x1015;
-       *pPPI_CONTROL = 0x0083;
-       return 0;
-}
-
-int drv_video_init(void)
-{
-       int error, devices = 1;
-
-       device_t videodev;
-
-       video_init();           /* Video initialization */
-
-       memset(&videodev, 0, sizeof(videodev));
-
-       strcpy(videodev.name, "video");
-       videodev.ext = DEV_EXT_VIDEO;   /* Video extensions */
-       videodev.flags = DEV_FLAGS_OUTPUT;      /* Output only */
-       videodev.putc = video_putc;     /* 'putc' function */
-       videodev.puts = video_puts;     /* 'puts' function */
-
-       error = device_register(&videodev);
-
-       return (error == 0) ? devices : error;
-}
-#endif
diff --git a/cpu/bf561/video.h b/cpu/bf561/video.h
deleted file mode 100644 (file)
index d237f6a..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#include <video_logo.h>
-#define write_dest_byte(val) {*dest++=val;}
-#define BLACK   (0x01800180)   /* black pixel pattern  */
-#define BLUE    (0x296E29F0)   /* blue pixel pattern   */
-#define RED     (0x51F0515A)   /* red pixel pattern    */
-#define MAGENTA (0x6ADE6ACA)   /* magenta pixel pattern */
-#define GREEN   (0x91229136)   /* green pixel pattern  */
-#define CYAN    (0xAA10AAA6)   /* cyan pixel pattern   */
-#define YELLOW  (0xD292D210)   /* yellow pixel pattern */
-#define WHITE   (0xFE80FE80)   /* white pixel pattern  */
-
-#define true   1
-#define false  0
-
-typedef struct {
-       unsigned int SAV;
-       unsigned int EAV;
-} SystemCodeType;
-
-const SystemCodeType SystemCodeMap[4] = {
-       {0xFF000080, 0xFF00009D},
-       {0xFF0000AB, 0xFF0000B6},
-       {0xFF0000C7, 0xFF0000DA},
-       {0xFF0000EC, 0xFF0000F1}
-};
diff --git a/cpu/blackfin/.gitignore b/cpu/blackfin/.gitignore
new file mode 100644 (file)
index 0000000..0ec9d56
--- /dev/null
@@ -0,0 +1 @@
+bootrom-asm-offsets.[chs]
diff --git a/cpu/blackfin/Makefile b/cpu/blackfin/Makefile
new file mode 100644 (file)
index 0000000..f194a38
--- /dev/null
@@ -0,0 +1,65 @@
+#
+# U-boot - Makefile
+#
+# Copyright (c) 2005-2008 Analog Device Inc.
+#
+# (C) Copyright 2000-2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
+# Licensed under the GPL-2 or later.
+#
+
+include $(TOPDIR)/config.mk
+
+LIB    = $(obj)lib$(CPU).a
+
+EXTRA    :=
+CEXTRA   := initcode.o
+SEXTRA   := start.o
+SOBJS    := interrupt.o cache.o flush.o
+COBJS    := cpu.o traps.o interrupts.o reset.o serial.o i2c.o watchdog.o
+
+ifeq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_BYPASS)
+COBJS    += initcode.o
+endif
+
+SRCS     := $(SEXTRA:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS     := $(addprefix $(obj),$(COBJS) $(SOBJS))
+EXTRA    := $(addprefix $(obj),$(EXTRA))
+CEXTRA   := $(addprefix $(obj),$(CEXTRA))
+SEXTRA   := $(addprefix $(obj),$(SEXTRA))
+
+all:   $(obj).depend $(LIB) $(obj).depend $(EXTRA) $(CEXTRA) $(SEXTRA) check_initcode
+
+$(LIB):        $(OBJS)
+       $(AR) $(ARFLAGS) $@ $(OBJS)
+
+$(OBJS): $(obj)bootrom-asm-offsets.h
+$(obj)bootrom-asm-offsets.c: bootrom-asm-offsets.c.in bootrom-asm-offsets.awk
+       echo '#include <asm/mach-common/bits/bootrom.h>' | $(CPP) $(CPPFLAGS) - | gawk -f ./bootrom-asm-offsets.awk > $@.tmp
+       mv $@.tmp $@
+$(obj)bootrom-asm-offsets.s: $(obj)bootrom-asm-offsets.c
+       $(CC) $(CFLAGS) -S $^ -o $@.tmp
+       mv $@.tmp $@
+$(obj)bootrom-asm-offsets.h: $(obj)bootrom-asm-offsets.s
+       sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}" $^ > $@
+
+# make sure our initcode (which goes into LDR) does not
+# have relocs or external references
+READINIT = env LC_ALL=C $(CROSS_COMPILE)readelf -s $<
+check_initcode: $(obj)initcode.o
+ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_BYPASS)
+       @if $(READINIT) | grep '\<GLOBAL\>.*\<UND\>' ; then \
+               echo "$< contains external references!" 1>&2 ; \
+               exit 1 ; \
+       fi
+endif
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/cpu/blackfin/bootrom-asm-offsets.awk b/cpu/blackfin/bootrom-asm-offsets.awk
new file mode 100755 (executable)
index 0000000..1d61824
--- /dev/null
@@ -0,0 +1,41 @@
+#!/usr/bin/gawk -f
+BEGIN {
+       print "/* DO NOT EDIT: AUTOMATICALLY GENERATED"
+       print " * Input files: bootrom-asm-offsets.awk bootrom-asm-offsets.c.in"
+       print " * DO NOT EDIT: AUTOMATICALLY GENERATED"
+       print " */"
+       print ""
+       system("cat bootrom-asm-offsets.c.in")
+       print "{"
+}
+
+{
+       /* find a structure definition */
+       if ($0 ~ /typedef struct .* {/) {
+               delete members;
+               i = 0;
+
+               /* extract each member of the structure */
+               while (1) {
+                       getline
+                       if ($1 == "}")
+                               break;
+                       gsub(/[*;]/, "");
+                       members[i++] = $NF;
+               }
+
+               /* grab the structure's name */
+               struct = $NF;
+               sub(/;$/, "", struct);
+
+               /* output the DEFINE() macros */
+               while (i-- > 0)
+                       print "\tDEFINE(" struct ", " members[i] ");"
+               print ""
+       }
+}
+
+END {
+       print "\treturn 0;"
+       print "}"
+}
diff --git a/cpu/blackfin/bootrom-asm-offsets.c.in b/cpu/blackfin/bootrom-asm-offsets.c.in
new file mode 100644 (file)
index 0000000..3146e46
--- /dev/null
@@ -0,0 +1,12 @@
+/* A little trick taken from the kernel asm-offsets.h where we convert
+ * the C structures automatically into a bunch of defines for use in
+ * the assembly files.
+ */
+
+#include <linux/stddef.h>
+#include <asm/mach-common/bits/bootrom.h>
+
+#define _DEFINE(sym, val) asm volatile("\n->" #sym " %0 " #val : : "i" (val))
+#define DEFINE(s, m) _DEFINE(offset_##s##_##m, offsetof(s, m))
+
+int main(int argc, char *argv[])
diff --git a/cpu/blackfin/cache.S b/cpu/blackfin/cache.S
new file mode 100644 (file)
index 0000000..51bdb30
--- /dev/null
@@ -0,0 +1,61 @@
+/* cache.S - low level cache handling routines
+ * Copyright (C) 2003-2007 Analog Devices Inc.
+ * Licensed under the GPL-2 or later.
+ */
+
+#include <asm/linkage.h>
+#include <config.h>
+#include <asm/blackfin.h>
+
+.text
+.align 2
+ENTRY(_blackfin_icache_flush_range)
+       R2 = -32;
+       R2 = R0 & R2;
+       P0 = R2;
+       P1 = R1;
+       CSYNC;
+1:
+       IFLUSH[P0++];
+       CC = P0 < P1(iu);
+       IF CC JUMP 1b(bp);
+       IFLUSH[P0];
+       SSYNC;
+       RTS;
+ENDPROC(_blackfin_icache_flush_range)
+
+ENTRY(_blackfin_dcache_flush_range)
+       R2 = -32;
+       R2 = R0 & R2;
+       P0 = R2;
+       P1 = R1;
+       CSYNC;
+1:
+       FLUSH[P0++];
+       CC = P0 < P1(iu);
+       IF CC JUMP 1b(bp);
+       FLUSH[P0];
+       SSYNC;
+       RTS;
+ENDPROC(_blackfin_dcache_flush_range)
+
+ENTRY(_blackfin_dcache_invalidate_range)
+       R2 = -32;
+       R2 = R0 & R2;
+       P0 = R2;
+       P1 = R1;
+       CSYNC;
+1:
+       FLUSHINV[P0++];
+       CC = P0 < P1(iu);
+       IF CC JUMP 1b(bp);
+
+       /*
+        * If the data crosses a cache line, then we'll be pointing to
+        * the last cache line, but won't have flushed/invalidated it yet, so do
+        * one more.
+        */
+       FLUSHINV[P0];
+       SSYNC;
+       RTS;
+ENDPROC(_blackfin_dcache_invalidate_range)
diff --git a/cpu/blackfin/cpu.c b/cpu/blackfin/cpu.c
new file mode 100644 (file)
index 0000000..53de5ab
--- /dev/null
@@ -0,0 +1,141 @@
+/*
+ * U-boot - cpu.c CPU specific functions
+ *
+ * Copyright (c) 2005-2008 Analog Devices Inc.
+ *
+ * (C) Copyright 2000-2004
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#include <common.h>
+#include <command.h>
+#include <asm/blackfin.h>
+#include <asm/cplb.h>
+#include <asm/mach-common/bits/core.h>
+#include <asm/mach-common/bits/mpu.h>
+#include <asm/mach-common/bits/trace.h>
+
+#include "cpu.h"
+#include "serial.h"
+
+void icache_enable(void)
+{
+       bfin_write_IMEM_CONTROL(bfin_read_IMEM_CONTROL() | (IMC | ENICPLB));
+       SSYNC();
+}
+
+void icache_disable(void)
+{
+       bfin_write_IMEM_CONTROL(bfin_read_IMEM_CONTROL() & ~(IMC | ENICPLB));
+       SSYNC();
+}
+
+int icache_status(void)
+{
+       return bfin_read_IMEM_CONTROL() & ENICPLB;
+}
+
+void dcache_enable(void)
+{
+       bfin_write_DMEM_CONTROL(bfin_read_DMEM_CONTROL() | (ACACHE_BCACHE | ENDCPLB | PORT_PREF0));
+       SSYNC();
+}
+
+void dcache_disable(void)
+{
+       bfin_write_DMEM_CONTROL(bfin_read_DMEM_CONTROL() & ~(ACACHE_BCACHE | ENDCPLB | PORT_PREF0));
+       SSYNC();
+}
+
+int dcache_status(void)
+{
+       return bfin_read_DMEM_CONTROL() & ENDCPLB;
+}
+
+__attribute__ ((__noreturn__))
+void cpu_init_f(ulong bootflag, ulong loaded_from_ldr)
+{
+       /* Build a NOP slide over the LDR jump block.  Whee! */
+       serial_early_puts("NOP Slide\n");
+       char nops[0xC];
+       memset(nops, 0x00, sizeof(nops));
+       extern char _stext_l1;
+       memcpy(&_stext_l1 - sizeof(nops), nops, sizeof(nops));
+
+       if (!loaded_from_ldr) {
+               /* Relocate sections into L1 if the LDR didn't do it -- don't
+                * check length because the linker script does the size
+                * checking at build time.
+                */
+               serial_early_puts("L1 Relocate\n");
+               extern char _stext_l1, _etext_l1, _stext_l1_lma;
+               memcpy(&_stext_l1, &_stext_l1_lma, (&_etext_l1 - &_stext_l1));
+               extern char _sdata_l1, _edata_l1, _sdata_l1_lma;
+               memcpy(&_sdata_l1, &_sdata_l1_lma, (&_edata_l1 - &_sdata_l1));
+       }
+#if defined(__ADSPBF537__) || defined(__ADSPBF536__) || defined(__ADSPBF534__)
+       /* The BF537 bootrom will reset the EBIU_AMGCTL register on us
+        * after it has finished loading the LDR.  So configure it again.
+        */
+       else
+               bfin_write_EBIU_AMGCTL(CONFIG_EBIU_AMGCTL_VAL);
+#endif
+
+#ifdef CONFIG_DEBUG_DUMP
+       /* Turn on hardware trace buffer */
+       bfin_write_TBUFCTL(TBUFPWR | TBUFEN);
+#endif
+
+#ifndef CONFIG_PANIC_HANG
+       /* Reset upon a double exception rather than just hanging.
+        * Do not do bfin_read on SWRST as that will reset status bits.
+        */
+       bfin_write_SWRST(DOUBLE_FAULT);
+#endif
+
+       serial_early_puts("Board init flash\n");
+       board_init_f(bootflag);
+}
+
+int exception_init(void)
+{
+       bfin_write_EVT3(trap);
+       return 0;
+}
+
+int irq_init(void)
+{
+#ifdef SIC_IMASK0
+       bfin_write_SIC_IMASK0(0);
+       bfin_write_SIC_IMASK1(0);
+# ifdef SIC_IMASK2
+       bfin_write_SIC_IMASK2(0);
+# endif
+#elif defined(SICA_IMASK0)
+       bfin_write_SICA_IMASK0(0);
+       bfin_write_SICA_IMASK1(0);
+#else
+       bfin_write_SIC_IMASK(0);
+#endif
+       bfin_write_EVT2(evt_default);   /* NMI */
+       bfin_write_EVT5(evt_default);   /* hardware error */
+       bfin_write_EVT6(evt_default);   /* core timer */
+       bfin_write_EVT7(evt_default);
+       bfin_write_EVT8(evt_default);
+       bfin_write_EVT9(evt_default);
+       bfin_write_EVT10(evt_default);
+       bfin_write_EVT11(evt_default);
+       bfin_write_EVT12(evt_default);
+       bfin_write_EVT13(evt_default);
+       bfin_write_EVT14(evt_default);
+       bfin_write_EVT15(evt_default);
+       bfin_write_ILAT(0);
+       CSYNC();
+       /* enable all interrupts except for core timer */
+       irq_flags = 0xffffffbf;
+       local_irq_enable();
+       CSYNC();
+       return 0;
+}
similarity index 68%
rename from cpu/bf533/start1.S
rename to cpu/blackfin/cpu.h
index 6d4731b..0a13c28 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * U-boot - start1.S Code running out of RAM after relocation
+ *  U-boot - cpu.h
  *
- * Copyright (c) 2005-2007 Analog Devices Inc.
+ *  Copyright (c) 2005-2007 Analog Devices Inc.
  *
  * See file CREDITS for list of people who contributed to this
  * project.
  * MA 02110-1301 USA
  */
 
-#define ASSEMBLY
-#include <linux/config.h>
-#include <config.h>
-#include <asm/blackfin.h>
+#ifndef _CPU_H_
+#define _CPU_H_
 
-.global        start1;
-.global        _start1;
+#include <command.h>
 
-.text
-_start1:
-start1:
-       sp += -12;
-       call    _board_init_f;
-       sp += 12;
+void board_reset(void) __attribute__((__weak__));
+void bfin_reset_or_hang(void) __attribute__((__noreturn__));
+void bfin_panic(struct pt_regs *reg);
+void dump(struct pt_regs *regs);
+
+asmlinkage void trap(void);
+asmlinkage void evt_default(void);
+
+#endif
diff --git a/cpu/blackfin/flush.S b/cpu/blackfin/flush.S
new file mode 100644 (file)
index 0000000..8072b86
--- /dev/null
@@ -0,0 +1,230 @@
+/* flush.S - low level cache flushing routines
+ * Copyright (C) 2003-2007 Analog Devices Inc.
+ * Licensed under the GPL-2 or later.
+ */
+
+#include <config.h>
+#include <asm/blackfin.h>
+#include <asm/cplb.h>
+#include <asm/mach-common/bits/mpu.h>
+
+.text
+
+/* This is an external function being called by the user
+ * application through __flush_cache_all. Currently this function
+ * serves the purpose of flushing all the pending writes in
+ * in the data cache.
+ */
+
+ENTRY(_flush_data_cache)
+       [--SP] = ( R7:6, P5:4 );
+       LINK 12;
+       SP += -12;
+       P5.H = HI(DCPLB_ADDR0);
+       P5.L = LO(DCPLB_ADDR0);
+       P4.H = HI(DCPLB_DATA0);
+       P4.L = LO(DCPLB_DATA0);
+       R7 = CPLB_VALID | CPLB_L1_CHBL | CPLB_DIRTY (Z);
+       R6 = 16;
+.Lnext:        R0 = [P5++];
+       R1 = [P4++];
+       CC = BITTST(R1, 14);    /* Is it write-through?*/
+       IF CC JUMP .Lskip;      /* If so, ignore it.*/
+       R2 = R1 & R7;           /* Is it a dirty, cached page?*/
+       CC = R2;
+       IF !CC JUMP .Lskip;     /* If not, ignore it.*/
+       [--SP] = RETS;
+       CALL _dcplb_flush;      /* R0 = page, R1 = data*/
+       RETS = [SP++];
+.Lskip:        R6 += -1;
+       CC = R6;
+       IF CC JUMP .Lnext;
+       SSYNC;
+       SP += 12;
+       UNLINK;
+       ( R7:6, P5:4 ) = [SP++];
+       RTS;
+ENDPROC(_flush_data_cache)
+
+/* This is an internal function to flush all pending
+ * writes in the cache associated with a particular DCPLB.
+ *
+ * R0 -  page's start address
+ * R1 -  CPLB's data field.
+ */
+
+.align 2
+ENTRY(_dcplb_flush)
+       [--SP] = ( R7:0, P5:0 );
+       [--SP] = LC0;
+       [--SP] = LT0;
+       [--SP] = LB0;
+       [--SP] = LC1;
+       [--SP] = LT1;
+       [--SP] = LB1;
+
+       /* If it's a 1K or 4K page, then it's quickest to
+        * just systematically flush all the addresses in
+        * the page, regardless of whether they're in the
+        * cache, or dirty. If it's a 1M or 4M page, there
+        * are too many addresses, and we have to search the
+        * cache for lines corresponding to the page.
+        */
+
+       CC = BITTST(R1, 17);    /* 1MB or 4MB */
+       IF !CC JUMP .Ldflush_whole_page;
+
+       /* We're only interested in the page's size, so extract
+        * this from the CPLB (bits 17:16), and scale to give an
+        * offset into the page_size and page_prefix tables.
+        */
+
+       R1 <<= 14;
+       R1 >>= 30;
+       R1 <<= 2;
+
+       /* The page could be mapped into Bank A or Bank B, depending
+        * on (a) whether both banks are configured as cache, and
+        * (b) on whether address bit A[x] is set. x is determined
+        * by DCBS in DMEM_CONTROL
+        */
+
+       R2 = 0;                 /* Default to Bank A (Bank B would be 1)*/
+
+       P0.L = LO(DMEM_CONTROL);
+       P0.H = HI(DMEM_CONTROL);
+
+       R3 = [P0];              /* If Bank B is not enabled as cache*/
+       CC = BITTST(R3, 2);     /* then Bank A is our only option.*/
+       IF CC JUMP .Lbank_chosen;
+
+       R4 = 1<<14;             /* If DCBS==0, use A[14].*/
+       R5 = R4 << 7;           /* If DCBS==1, use A[23];*/
+       CC = BITTST(R3, 4);
+       IF CC R4 = R5;          /* R4 now has either bit 14 or bit 23 set.*/
+       R5 = R0 & R4;           /* Use it to test the Page address*/
+       CC = R5;                /* and if that bit is set, we use Bank B,*/
+       R2 = CC;                /* else we use Bank A.*/
+       R2 <<= 23;              /* The Bank selection's at posn 23.*/
+
+.Lbank_chosen:
+
+       /* We can also determine the sub-bank used, because this is
+        * taken from bits 13:12 of the address.
+        */
+
+       R3 = ((12<<8)|2);               /* Extraction pattern */
+       nop;                            /*Anamoly 05000209*/
+       R4 = EXTRACT(R0, R3.L) (Z);     /* Extract bits*/
+       /* Save in extraction pattern for later deposit.*/
+       R3.H = R4.L << 0;
+
+       /* So:
+        * R0 = Page start
+        * R1 = Page length (actually, offset into size/prefix tables)
+        * R2 = Bank select mask
+        * R3 = sub-bank deposit values
+        *
+        * The cache has 2 Ways, and 64 sets, so we iterate through
+        * the sets, accessing the tag for each Way, for our Bank and
+        * sub-bank, looking for dirty, valid tags that match our
+        * address prefix.
+        */
+
+       P5.L = LO(DTEST_COMMAND);
+       P5.H = HI(DTEST_COMMAND);
+       P4.L = LO(DTEST_DATA0);
+       P4.H = HI(DTEST_DATA0);
+
+       P0.L = page_prefix_table;
+       P0.H = page_prefix_table;
+       P1 = R1;
+       R5 = 0;                 /* Set counter*/
+       P0 = P1 + P0;
+       R4 = [P0];              /* This is the address prefix*/
+
+
+       /* We're reading (bit 1==0) the tag (bit 2==0), and we
+        * don't care about which double-word, since we're only
+        * fetching tags, so we only have to set Set, Bank,
+        * Sub-bank and Way.
+        */
+
+       P2 = 2;
+       LSETUP (.Lfs1, .Lfe1) LC1 = P2;
+.Lfs1: P0 = 64;                /* iterate over all sets*/
+       LSETUP (.Lfs0, .Lfe0) LC0 = P0;
+.Lfs0: R6 = R5 << 5;           /* Combine set*/
+       R6.H = R3.H << 0 ;      /* and sub-bank*/
+       R6 = R6 | R2;           /* and Bank. Leave Way==0 at first.*/
+       BITSET(R6,14);
+       [P5] = R6;              /* Issue Command*/
+       SSYNC;
+       R7 = [P4];              /* and read Tag.*/
+       CC = BITTST(R7, 0);     /* Check if valid*/
+       IF !CC JUMP .Lfskip;    /* and skip if not.*/
+       CC = BITTST(R7, 1);     /* Check if dirty*/
+       IF !CC JUMP .Lfskip;    /* and skip if not.*/
+
+       /* Compare against the page address. First, plant bits 13:12
+        * into the tag, since those aren't part of the returned data.
+        */
+
+       R7 = DEPOSIT(R7, R3);   /* set 13:12*/
+       R1 = R7 & R4;           /* Mask off lower bits*/
+       CC = R1 == R0;          /* Compare against page start.*/
+       IF !CC JUMP .Lfskip;    /* Skip it if it doesn't match.*/
+
+       /* Tag address matches against page, so this is an entry
+        * we must flush.
+        */
+
+       R7 >>= 10;              /* Mask off the non-address bits*/
+       R7 <<= 10;
+       P3 = R7;
+       SSYNC;
+       FLUSHINV [P3];          /* And flush the entry*/
+.Lfskip:
+.Lfe0: R5 += 1;                /* Advance to next Set*/
+.Lfe1: BITSET(R2, 26);         /* Go to next Way.*/
+
+.Ldfinished:
+       SSYNC;                  /* Ensure the data gets out to mem.*/
+
+       /*Finished. Restore context.*/
+       LB1 = [SP++];
+       LT1 = [SP++];
+       LC1 = [SP++];
+       LB0 = [SP++];
+       LT0 = [SP++];
+       LC0 = [SP++];
+       ( R7:0, P5:0 ) = [SP++];
+       RTS;
+
+.Ldflush_whole_page:
+
+       /* It's a 1K or 4K page, so quicker to just flush the
+        * entire page.
+        */
+
+       P1 = 32;                /* For 1K pages*/
+       P2 = P1 << 2;           /* For 4K pages*/
+       P0 = R0;                /* Start of page*/
+       CC = BITTST(R1, 16);    /* Whether 1K or 4K*/
+       IF CC P1 = P2;
+       P1 += -1;               /* Unroll one iteration*/
+       SSYNC;
+       FLUSHINV [P0++];        /* because CSYNC can't end loops.*/
+       LSETUP (.Leall, .Leall) LC0 = P1;
+.Leall:        FLUSHINV [P0++];
+       SSYNC;
+       JUMP .Ldfinished;
+ENDPROC(_dcplb_flush)
+
+.align 4;
+page_prefix_table:
+.byte4         0xFFFFFC00;     /* 1K */
+.byte4 0xFFFFF000;     /* 4K */
+.byte4 0xFFF00000;     /* 1M */
+.byte4 0xFFC00000;     /* 4M */
+.page_prefix_table.end:
similarity index 75%
rename from cpu/bf537/i2c.c
rename to cpu/blackfin/i2c.c
index ab7dd38..47be258 100644 (file)
@@ -1,18 +1,10 @@
-/****************************************************************
- * $ID: i2c.c  24 Oct 2006 12:00:00 +0800 $                    *
- *                                                             *
- * Description:                                                        *
- *                                                             *
- * Maintainer:  sonicz  <sonic.zhang@analog.com>               *
- *                                                             *
- * CopyRight (c)  2006  Analog Device                          *
- * All rights reserved.                                                *
- *                                                             *
- * This file is free software;                                 *
- *     you are free to modify and/or redistribute it           *
- *     under the terms of the GNU General Public Licence (GPL).*
- *                                                             *
- ****************************************************************/
+/*
+ * i2c.c - driver for Blackfin on-chip TWI/I2C
+ *
+ * Copyright (c) 2006-2008 Analog Devices Inc.
+ *
+ * Licensed under the GPL-2 or later.
+ */
 
 #include <common.h>
 
 #include <asm/io.h>
 #include <asm/mach-common/bits/twi.h>
 
-DECLARE_GLOBAL_DATA_PTR;
+/* Two-Wire Interface          (0xFFC01400 - 0xFFC014FF) */
+#ifdef TWI0_CLKDIV
+#define bfin_read_TWI_CLKDIV()               bfin_read_TWI0_CLKDIV()
+#define bfin_write_TWI_CLKDIV(val)           bfin_write_TWI0_CLKDIV(val)
+#define bfin_read_TWI_CONTROL()              bfin_read_TWI0_CONTROL()
+#define bfin_write_TWI_CONTROL(val)          bfin_write_TWI0_CONTROL(val)
+#define bfin_read_TWI_SLAVE_CTL()            bfin_read_TWI0_SLAVE_CTL()
+#define bfin_write_TWI_SLAVE_CTL(val)        bfin_write_TWI0_SLAVE_CTL(val)
+#define bfin_read_TWI_SLAVE_STAT()           bfin_read_TWI0_SLAVE_STAT()
+#define bfin_write_TWI_SLAVE_STAT(val)       bfin_write_TWI0_SLAVE_STAT(val)
+#define bfin_read_TWI_SLAVE_ADDR()           bfin_read_TWI0_SLAVE_ADDR()
+#define bfin_write_TWI_SLAVE_ADDR(val)       bfin_write_TWI0_SLAVE_ADDR(val)
+#define bfin_read_TWI_MASTER_CTL()           bfin_read_TWI0_MASTER_CTL()
+#define bfin_write_TWI_MASTER_CTL(val)       bfin_write_TWI0_MASTER_CTL(val)
+#define bfin_read_TWI_MASTER_STAT()          bfin_read_TWI0_MASTER_STAT()
+#define bfin_write_TWI_MASTER_STAT(val)      bfin_write_TWI0_MASTER_STAT(val)
+#define bfin_read_TWI_MASTER_ADDR()          bfin_read_TWI0_MASTER_ADDR()
+#define bfin_write_TWI_MASTER_ADDR(val)      bfin_write_TWI0_MASTER_ADDR(val)
+#define bfin_read_TWI_INT_STAT()             bfin_read_TWI0_INT_STAT()
+#define bfin_write_TWI_INT_STAT(val)         bfin_write_TWI0_INT_STAT(val)
+#define bfin_read_TWI_INT_MASK()             bfin_read_TWI0_INT_MASK()
+#define bfin_write_TWI_INT_MASK(val)         bfin_write_TWI0_INT_MASK(val)
+#define bfin_read_TWI_FIFO_CTL()             bfin_read_TWI0_FIFO_CTL()
+#define bfin_write_TWI_FIFO_CTL(val)         bfin_write_TWI0_FIFO_CTL(val)
+#define bfin_read_TWI_FIFO_STAT()            bfin_read_TWI0_FIFO_STAT()
+#define bfin_write_TWI_FIFO_STAT(val)        bfin_write_TWI0_FIFO_STAT(val)
+#define bfin_read_TWI_XMT_DATA8()            bfin_read_TWI0_XMT_DATA8()
+#define bfin_write_TWI_XMT_DATA8(val)        bfin_write_TWI0_XMT_DATA8(val)
+#define bfin_read_TWI_XMT_DATA_16()          bfin_read_TWI0_XMT_DATA16()
+#define bfin_write_TWI_XMT_DATA16(val)       bfin_write_TWI0_XMT_DATA16(val)
+#define bfin_read_TWI_RCV_DATA8()            bfin_read_TWI0_RCV_DATA8()
+#define bfin_write_TWI_RCV_DATA8(val)        bfin_write_TWI0_RCV_DATA8(val)
+#define bfin_read_TWI_RCV_DATA16()           bfin_read_TWI0_RCV_DATA16()
+#define bfin_write_TWI_RCV_DATA16(val)       bfin_write_TWI0_RCV_DATA16(val)
+#endif
 
 #ifdef DEBUG_I2C
 #define PRINTD(fmt,args...)    do {    \
+       DECLARE_GLOBAL_DATA_PTR;        \
        if (gd->have_console)           \
                printf(fmt ,##args);    \
        } while (0)
@@ -50,14 +77,12 @@ struct i2c_msg {
 
 /**
  * i2c_reset: - reset the host controller
- *
  */
-
 static void i2c_reset(void)
 {
        /* Disable TWI */
        bfin_write_TWI_CONTROL(0);
-       sync();
+       SSYNC();
 
        /* Set TWI internal clock as 10MHz */
        bfin_write_TWI_CONTROL(((get_sclk() / 1024 / 1024 + 5) / 10) & 0x7F);
@@ -74,7 +99,7 @@ static void i2c_reset(void)
 
        /* Enable TWI */
        bfin_write_TWI_CONTROL(bfin_read_TWI_CONTROL() | TWI_ENA);
-       sync();
+       SSYNC();
 }
 
 int wait_for_completion(struct i2c_msg *msg, int timeout_count)
@@ -95,10 +120,10 @@ int wait_for_completion(struct i2c_msg *msg, int timeout_count)
                        } else if (msg->flags & I2C_M_STOP)
                                bfin_write_TWI_MASTER_CTL
                                    (bfin_read_TWI_MASTER_CTL() | STOP);
-                       sync();
+                       SSYNC();
                        /* Clear status */
                        bfin_write_TWI_INT_STAT(XMTSERV);
-                       sync();
+                       SSYNC();
                        i = 0;
                }
                if (RCVSERV & twi_int_stat) {
@@ -109,11 +134,11 @@ int wait_for_completion(struct i2c_msg *msg, int timeout_count)
                        } else if (msg->flags & I2C_M_STOP) {
                                bfin_write_TWI_MASTER_CTL
                                    (bfin_read_TWI_MASTER_CTL() | STOP);
-                               sync();
+                               SSYNC();
                        }
                        /* Clear interrupt source */
                        bfin_write_TWI_INT_STAT(RCVSERV);
-                       sync();
+                       SSYNC();
                        i = 0;
                }
                if (MERR & twi_int_stat) {
@@ -121,7 +146,7 @@ int wait_for_completion(struct i2c_msg *msg, int timeout_count)
                        bfin_write_TWI_INT_MASK(0);
                        bfin_write_TWI_MASTER_STAT(0x3e);
                        bfin_write_TWI_MASTER_CTL(0);
-                       sync();
+                       SSYNC();
                        /*
                         * if both err and complete int stats are set,
                         * return proper results.
@@ -130,7 +155,7 @@ int wait_for_completion(struct i2c_msg *msg, int timeout_count)
                                bfin_write_TWI_INT_STAT(MCOMP);
                                bfin_write_TWI_INT_MASK(0);
                                bfin_write_TWI_MASTER_CTL(0);
-                               sync();
+                               SSYNC();
                                /*
                                 * If it is a quick transfer,
                                 * only address bug no data, not an err.
@@ -150,10 +175,10 @@ int wait_for_completion(struct i2c_msg *msg, int timeout_count)
                }
                if (MCOMP & twi_int_stat) {
                        bfin_write_TWI_INT_STAT(MCOMP);
-                       sync();
+                       SSYNC();
                        bfin_write_TWI_INT_MASK(0);
                        bfin_write_TWI_MASTER_CTL(0);
-                       sync();
+                       SSYNC();
                        return 0;
                }
        }
@@ -187,7 +212,8 @@ int i2c_transfer(struct i2c_msg *msg)
                goto transfer_error;
        }
 
-       while (bfin_read_TWI_MASTER_STAT() & BUSBUSY) ;
+       while (bfin_read_TWI_MASTER_STAT() & BUSBUSY)
+               continue;
 
        /* Set Transmit device address */
        bfin_write_TWI_MASTER_ADDR(msg->addr);
@@ -197,9 +223,9 @@ int i2c_transfer(struct i2c_msg *msg)
         * Data in FIFO should be discarded before start a new operation.
         */
        bfin_write_TWI_FIFO_CTL(0x3);
-       sync();
+       SSYNC();
        bfin_write_TWI_FIFO_CTL(0);
-       sync();
+       SSYNC();
 
        if (!(msg->flags & I2C_M_RD)) {
                /* Transmit first data */
@@ -208,7 +234,7 @@ int i2c_transfer(struct i2c_msg *msg)
                               len);
                        bfin_write_TWI_XMT_DATA8(*(msg->buf++));
                        msg->len--;
-                       sync();
+                       SSYNC();
                }
        }
 
@@ -218,7 +244,7 @@ int i2c_transfer(struct i2c_msg *msg)
        /* Interrupt mask . Enable XMT, RCV interrupt */
        bfin_write_TWI_INT_MASK(MCOMP | MERR |
                        ((msg->flags & I2C_M_RD) ? RCVSERV : XMTSERV));
-       sync();
+       SSYNC();
 
        if (len > 0 && len <= 255)
                bfin_write_TWI_MASTER_CTL((len << 6));
@@ -233,12 +259,12 @@ int i2c_transfer(struct i2c_msg *msg)
                        ((msg->flags & I2C_M_RD)
                         ? MDIR : 0) | ((CONFIG_TWICLK_KHZ >
                                         100) ? FAST : 0));
-       sync();
+       SSYNC();
 
        ret = wait_for_completion(msg, timeout_count);
        PRINTD("3 in i2c_transfer: ret=%d\n", ret);
 
-transfer_error:
+ transfer_error:
        switch (ret) {
        case 1:
                PRINTD(("i2c_transfer: error: transfer fail\n"));
@@ -415,4 +441,4 @@ void i2c_reg_write(uchar chip, uchar reg, uchar val)
        i2c_write(chip, reg, 0, &val, 1);
 }
 
-#endif                         /* CONFIG_HARD_I2C */
+#endif /* CONFIG_HARD_I2C */
diff --git a/cpu/blackfin/initcode.c b/cpu/blackfin/initcode.c
new file mode 100644 (file)
index 0000000..ffc8420
--- /dev/null
@@ -0,0 +1,353 @@
+/*
+ * initcode.c - Initialize the processor.  This is usually entails things
+ * like external memory, voltage regulators, etc...  Note that this file
+ * cannot make any function calls as it may be executed all by itself by
+ * the Blackfin's bootrom in LDR format.
+ *
+ * Copyright (c) 2004-2008 Analog Devices Inc.
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#include <config.h>
+#include <asm/blackfin.h>
+#include <asm/mach-common/bits/bootrom.h>
+#include <asm/mach-common/bits/ebiu.h>
+#include <asm/mach-common/bits/pll.h>
+#include <asm/mach-common/bits/uart.h>
+
+#define BFIN_IN_INITCODE
+#include "serial.h"
+
+__attribute__((always_inline))
+static inline uint32_t serial_init(void)
+{
+#ifdef __ADSPBF54x__
+# ifdef BFIN_BOOT_UART_USE_RTS
+#  define BFIN_UART_USE_RTS 1
+# else
+#  define BFIN_UART_USE_RTS 0
+# endif
+       if (BFIN_UART_USE_RTS && CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_UART) {
+               size_t i;
+
+               /* force RTS rather than relying on auto RTS */
+               bfin_write_UART1_MCR(bfin_read_UART1_MCR() | FCPOL);
+
+               /* Wait for the line to clear up.  We cannot rely on UART
+                * registers as none of them reflect the status of the RSR.
+                * Instead, we'll sleep for ~10 bit times at 9600 baud.
+                * We can precalc things here by assuming boot values for
+                * PLL rather than loading registers and calculating.
+                *      baud    = SCLK / (16 ^ (1 - EDBO) * Divisor)
+                *      EDB0    = 0
+                *      Divisor = (SCLK / baud) / 16
+                *      SCLK    = baud * 16 * Divisor
+                *      SCLK    = (0x14 * CONFIG_CLKIN_HZ) / 5
+                *      CCLK    = (16 * Divisor * 5) * (9600 / 10)
+                * In reality, this will probably be just about 1 second delay,
+                * so assuming 9600 baud is OK (both as a very low and too high
+                * speed as this will buffer things enough).
+                */
+#define _NUMBITS (10)                                   /* how many bits to delay */
+#define _LOWBAUD (9600)                                 /* low baud rate */
+#define _SCLK    ((0x14 * CONFIG_CLKIN_HZ) / 5)         /* SCLK based on PLL */
+#define _DIVISOR ((_SCLK / _LOWBAUD) / 16)              /* UART DLL/DLH */
+#define _NUMINS  (3)                                    /* how many instructions in loop */
+#define _CCLK    (((16 * _DIVISOR * 5) * (_LOWBAUD / _NUMBITS)) / _NUMINS)
+               i = _CCLK;
+               while (i--)
+                       asm volatile("" : : : "memory");
+       }
+#endif
+
+       uint32_t old_baud = serial_early_get_baud();
+
+       if (BFIN_DEBUG_EARLY_SERIAL) {
+               serial_early_init();
+
+               /* If the UART is off, that means we need to program
+                * the baud rate ourselves initially.
+                */
+               if (!old_baud) {
+                       old_baud = CONFIG_BAUDRATE;
+                       serial_early_set_baud(CONFIG_BAUDRATE);
+               }
+       }
+
+       return old_baud;
+}
+
+__attribute__((always_inline))
+static inline void serial_deinit(void)
+{
+#ifdef __ADSPBF54x__
+       if (BFIN_UART_USE_RTS && CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_UART) {
+               /* clear forced RTS rather than relying on auto RTS */
+               bfin_write_UART1_MCR(bfin_read_UART1_MCR() & ~FCPOL);
+       }
+#endif
+}
+
+/* We need to reset the baud rate when we have early debug turned on
+ * or when we are booting over the UART.
+ * XXX: we should fix this to calc the old baud and restore it rather
+ *      than hardcoding it via CONFIG_LDR_LOAD_BAUD ... but we have
+ *      to figure out how to avoid the division in the baud calc ...
+ */
+__attribute__((always_inline))
+static inline void serial_reset_baud(uint32_t baud)
+{
+       if (!BFIN_DEBUG_EARLY_SERIAL && CONFIG_BFIN_BOOT_MODE != BFIN_BOOT_UART)
+               return;
+
+#ifndef CONFIG_LDR_LOAD_BAUD
+# define CONFIG_LDR_LOAD_BAUD 115200
+#endif
+
+       if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS)
+               serial_early_set_baud(baud);
+       else if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_UART)
+               serial_early_set_baud(CONFIG_LDR_LOAD_BAUD);
+       else
+               serial_early_set_baud(CONFIG_BAUDRATE);
+}
+
+__attribute__((always_inline))
+static inline void serial_putc(char c)
+{
+       if (!BFIN_DEBUG_EARLY_SERIAL)
+               return;
+
+       if (c == '\n')
+               *pUART_THR = '\r';
+
+       *pUART_THR = c;
+
+       while (!(*pUART_LSR & TEMT))
+               continue;
+}
+
+
+/* Max SCLK can be 133MHz ... dividing that by 4 gives
+ * us a freq of 33MHz for SPI which should generally be
+ * slow enough for the slow reads the bootrom uses.
+ */
+#ifndef CONFIG_SPI_BAUD_INITBLOCK
+# define CONFIG_SPI_BAUD_INITBLOCK 4
+#endif
+
+/* PLL_DIV defines */
+#ifndef CONFIG_PLL_DIV_VAL
+# if (CONFIG_CCLK_DIV == 1)
+#  define CONFIG_CCLK_ACT_DIV CCLK_DIV1
+# elif (CONFIG_CCLK_DIV == 2)
+#  define CONFIG_CCLK_ACT_DIV CCLK_DIV2
+# elif (CONFIG_CCLK_DIV == 4)
+#  define CONFIG_CCLK_ACT_DIV CCLK_DIV4
+# elif (CONFIG_CCLK_DIV == 8)
+#  define CONFIG_CCLK_ACT_DIV CCLK_DIV8
+# else
+#  define CONFIG_CCLK_ACT_DIV CONFIG_CCLK_DIV_not_defined_properly
+# endif
+# define CONFIG_PLL_DIV_VAL (CONFIG_CCLK_ACT_DIV | CONFIG_SCLK_DIV)
+#endif
+
+#ifndef CONFIG_PLL_LOCKCNT_VAL
+# define CONFIG_PLL_LOCKCNT_VAL 0x0300
+#endif
+
+#ifndef CONFIG_PLL_CTL_VAL
+# define CONFIG_PLL_CTL_VAL (SPORT_HYST | (CONFIG_VCO_MULT << 9))
+#endif
+
+#ifndef CONFIG_EBIU_RSTCTL_VAL
+# define CONFIG_EBIU_RSTCTL_VAL 0 /* only MDDRENABLE is useful */
+#endif
+
+#ifndef CONFIG_EBIU_MBSCTL_VAL
+# define CONFIG_EBIU_MBSCTL_VAL 0
+#endif
+
+/* Make sure our voltage value is sane so we don't blow up! */
+#ifndef CONFIG_VR_CTL_VAL
+# define BFIN_CCLK ((CONFIG_CLKIN_HZ * CONFIG_VCO_MULT) / CONFIG_CCLK_DIV)
+# if defined(__ADSPBF533__) || defined(__ADSPBF532__) || defined(__ADSPBF531__)
+#  define CCLK_VLEV_120        400000000
+#  define CCLK_VLEV_125        533000000
+# elif defined(__ADSPBF537__) || defined(__ADSPBF536__) || defined(__ADSPBF534__)
+#  define CCLK_VLEV_120        401000000
+#  define CCLK_VLEV_125        401000000
+# elif defined(__ADSPBF561__)
+#  define CCLK_VLEV_120        300000000
+#  define CCLK_VLEV_125        501000000
+# endif
+# if BFIN_CCLK < CCLK_VLEV_120
+#  define CONFIG_VR_CTL_VLEV VLEV_120
+# elif BFIN_CCLK < CCLK_VLEV_125
+#  define CONFIG_VR_CTL_VLEV VLEV_125
+# else
+#  define CONFIG_VR_CTL_VLEV VLEV_130
+# endif
+# if defined(__ADSPBF52x__)    /* TBD; use default */
+#  undef CONFIG_VR_CTL_VLEV
+#  define CONFIG_VR_CTL_VLEV VLEV_110
+# elif defined(__ADSPBF54x__)  /* TBD; use default */
+#  undef CONFIG_VR_CTL_VLEV
+#  define CONFIG_VR_CTL_VLEV VLEV_120
+# endif
+
+# ifdef CONFIG_BFIN_MAC
+#  define CONFIG_VR_CTL_CLKBUF CLKBUFOE
+# else
+#  define CONFIG_VR_CTL_CLKBUF 0
+# endif
+
+# if defined(__ADSPBF52x__)
+#  define CONFIG_VR_CTL_FREQ FREQ_1000
+# else
+#  define CONFIG_VR_CTL_FREQ (GAIN_20 | FREQ_1000)
+# endif
+
+# define CONFIG_VR_CTL_VAL (CONFIG_VR_CTL_CLKBUF | CONFIG_VR_CTL_VLEV | CONFIG_VR_CTL_FREQ)
+#endif
+
+__attribute__((saveall))
+void initcode(ADI_BOOT_DATA *bootstruct)
+{
+       uint32_t old_baud = serial_init();
+
+#ifdef CONFIG_HW_WATCHDOG
+# ifndef CONFIG_HW_WATCHDOG_TIMEOUT_INITCODE
+#  define CONFIG_HW_WATCHDOG_TIMEOUT_INITCODE 20000
+# endif
+       /* Program the watchdog with an initial timeout of ~20 seconds.
+        * Hopefully that should be long enough to load the u-boot LDR
+        * (from wherever) and then the common u-boot code can take over.
+        * In bypass mode, the start.S would have already set a much lower
+        * timeout, so don't clobber that.
+        */
+       if (CONFIG_BFIN_BOOT_MODE != BFIN_BOOT_BYPASS) {
+               bfin_write_WDOG_CNT(MSEC_TO_SCLK(CONFIG_HW_WATCHDOG_TIMEOUT_INITCODE));
+               bfin_write_WDOG_CTL(0);
+       }
+#endif
+
+       serial_putc('S');
+
+       /* Blackfin bootroms use the SPI slow read opcode instead of the SPI
+        * fast read, so we need to slow down the SPI clock a lot more during
+        * boot.  Once we switch over to u-boot's SPI flash driver, we'll
+        * increase the speed appropriately.
+        */
+       if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_SPI_MASTER)
+#ifdef SPI0_BAUD
+               bfin_write_SPI0_BAUD(CONFIG_SPI_BAUD_INITBLOCK);
+#else
+               bfin_write_SPI_BAUD(CONFIG_SPI_BAUD_INITBLOCK);
+#endif
+
+       serial_putc('B');
+
+       /* Disable all peripheral wakeups except for the PLL event. */
+#ifdef SIC_IWR0
+       bfin_write_SIC_IWR0(1);
+       bfin_write_SIC_IWR1(0);
+# ifdef SIC_IWR2
+       bfin_write_SIC_IWR2(0);
+# endif
+#elif defined(SICA_IWR0)
+       bfin_write_SICA_IWR0(1);
+       bfin_write_SICA_IWR1(0);
+#else
+       bfin_write_SIC_IWR(1);
+#endif
+
+       serial_putc('L');
+
+       bfin_write_PLL_LOCKCNT(CONFIG_PLL_LOCKCNT_VAL);
+
+       serial_putc('A');
+
+       /* Only reprogram when needed to avoid triggering unnecessary
+        * PLL relock sequences.
+        */
+       if (bfin_read_VR_CTL() != CONFIG_VR_CTL_VAL) {
+               serial_putc('!');
+               bfin_write_VR_CTL(CONFIG_VR_CTL_VAL);
+               asm("idle;");
+       }
+
+       serial_putc('C');
+
+       bfin_write_PLL_DIV(CONFIG_PLL_DIV_VAL);
+
+       serial_putc('K');
+
+       /* Only reprogram when needed to avoid triggering unnecessary
+        * PLL relock sequences.
+        */
+       if (bfin_read_PLL_CTL() != CONFIG_PLL_CTL_VAL) {
+               serial_putc('!');
+               bfin_write_PLL_CTL(CONFIG_PLL_CTL_VAL);
+               asm("idle;");
+       }
+
+       /* Since we've changed the SCLK above, we may need to update
+        * the UART divisors (UART baud rates are based on SCLK).
+        */
+       serial_reset_baud(old_baud);
+
+       serial_putc('F');
+
+       /* Program the async banks controller. */
+       bfin_write_EBIU_AMBCTL0(CONFIG_EBIU_AMBCTL0_VAL);
+       bfin_write_EBIU_AMBCTL1(CONFIG_EBIU_AMBCTL1_VAL);
+       bfin_write_EBIU_AMGCTL(CONFIG_EBIU_AMGCTL_VAL);
+
+#ifdef EBIU_MODE
+       /* Not all parts have these additional MMRs. */
+       bfin_write_EBIU_MBSCTL(CONFIG_EBIU_MBSCTL_VAL);
+       bfin_write_EBIU_MODE(CONFIG_EBIU_MODE_VAL);
+       bfin_write_EBIU_FCTL(CONFIG_EBIU_FCTL_VAL);
+#endif
+
+       serial_putc('I');
+
+       /* Program the external memory controller. */
+#ifdef EBIU_RSTCTL
+       bfin_write_EBIU_RSTCTL(bfin_read_EBIU_RSTCTL() | 0x1 /*DDRSRESET*/ | CONFIG_EBIU_RSTCTL_VAL);
+       bfin_write_EBIU_DDRCTL0(CONFIG_EBIU_DDRCTL0_VAL);
+       bfin_write_EBIU_DDRCTL1(CONFIG_EBIU_DDRCTL1_VAL);
+       bfin_write_EBIU_DDRCTL2(CONFIG_EBIU_DDRCTL2_VAL);
+# ifdef CONFIG_EBIU_DDRCTL3_VAL
+       /* default is disable, so don't need to force this */
+       bfin_write_EBIU_DDRCTL3(CONFIG_EBIU_DDRCTL3_VAL);
+# endif
+#else
+       bfin_write_EBIU_SDRRC(CONFIG_EBIU_SDRRC_VAL);
+       bfin_write_EBIU_SDBCTL(CONFIG_EBIU_SDBCTL_VAL);
+       bfin_write_EBIU_SDGCTL(CONFIG_EBIU_SDGCTL_VAL);
+#endif
+
+       serial_putc('N');
+
+       /* Restore all peripheral wakeups. */
+#ifdef SIC_IWR0
+       bfin_write_SIC_IWR0(-1);
+       bfin_write_SIC_IWR1(-1);
+# ifdef SIC_IWR2
+       bfin_write_SIC_IWR2(-1);
+# endif
+#elif defined(SICA_IWR0)
+       bfin_write_SICA_IWR0(-1);
+       bfin_write_SICA_IWR1(-1);
+#else
+       bfin_write_SIC_IWR(-1);
+#endif
+
+       serial_putc('>');
+       serial_putc('\n');
+
+       serial_deinit();
+}
diff --git a/cpu/blackfin/interrupt.S b/cpu/blackfin/interrupt.S
new file mode 100644 (file)
index 0000000..dd2cc53
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * interrupt.S - trampoline default exceptions/interrupts to C handlers
+ *
+ * Copyright (c) 2005-2007 Analog Devices Inc.
+ * Licensed under the GPL-2 or later.
+ */
+
+#include <asm/blackfin.h>
+#include <asm/entry.h>
+
+.text
+
+/* default entry point for exceptions */
+ENTRY(_trap)
+       SAVE_ALL_SYS
+       r0 = sp;        /* stack frame pt_regs pointer argument ==> r0 */
+       sp += -12;
+       call _trap_c;
+       sp += 12;
+       RESTORE_ALL_SYS
+       rtx;
+ENDPROC(_trap)
+
+/* default entry point for interrupts */
+ENTRY(_evt_default)
+       SAVE_ALL_SYS
+       r0 = sp;        /* stack frame pt_regs pointer argument ==> r0 */
+       sp += -12;
+       call _bfin_panic;
+       sp += 12;
+       RESTORE_ALL_SYS
+       rti;
+ENDPROC(_evt_default)
similarity index 68%
rename from cpu/bf561/interrupts.c
rename to cpu/blackfin/interrupts.c
index 7880061..80c5505 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * U-boot - interrupts.c Interrupt related routines
  *
- * Copyright (c) 2005-2007 Analog Devices Inc.
+ * Copyright (c) 2005-2008 Analog Devices Inc.
  *
  * This file is based on interrupts.c
  * Copyright 1996 Roman Zippel
  *
  * (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
+ * Licensed under the GPL-2 or later.
  */
 
 #include <common.h>
@@ -49,7 +33,7 @@ int irq_flags;                        /* needed by asm-blackfin/system.h */
 
 /*
  * This function is derived from PowerPC code (read timebase as long long).
- * On BF561 it just returns the timer value.
+ * On Blackfin it just returns the timer value.
  */
 unsigned long long get_ticks(void)
 {
@@ -58,7 +42,7 @@ unsigned long long get_ticks(void)
 
 /*
  * This function is derived from PowerPC code (timebase clock frequency).
- * On BF561 it returns the number of timer ticks per second.
+ * On Blackfin it returns the number of timer ticks per second.
  */
 ulong get_tbclk(void)
 {
@@ -70,18 +54,15 @@ ulong get_tbclk(void)
 
 void enable_interrupts(void)
 {
+       local_irq_restore(int_flag);
 }
 
 int disable_interrupts(void)
 {
+       local_irq_save(int_flag);
        return 1;
 }
 
-int interrupt_init(void)
-{
-       return (0);
-}
-
 void udelay(unsigned long usec)
 {
        unsigned long delay, start, stop;
@@ -101,16 +82,17 @@ void udelay(unsigned long usec)
                        usec -= 1000;
                }
 
-               asm volatile (" %0 = CYCLES;":"=r" (start));
+               asm volatile (" %0 = CYCLES;" : "=r" (start));
                do {
-                       asm volatile (" %0 = CYCLES; ":"=r" (stop));
+                       asm volatile (" %0 = CYCLES; " : "=r" (stop));
                } while (stop - start < delay);
        }
 
        return;
 }
 
-void timer_init(void)
+#define MAX_TIM_LOAD   0xFFFFFFFF
+int timer_init(void)
 {
        *pTCNTL = 0x1;
        *pTSCALE = 0x0;
@@ -121,6 +103,8 @@ void timer_init(void)
 
        timestamp = 0;
        last_time = 0;
+
+       return 0;
 }
 
 /*
@@ -157,11 +141,15 @@ ulong get_timer(ulong base)
        milisec = clocks / (CONFIG_CCLK_HZ / 1000);
 
        /*
-        * Find the number of millisonds
-        * that got elapsed before this TCOUNT
-        * cycle
+        * Find the number of millisonds that
+        * got elapsed before this TCOUNT cycle
         */
        milisec += timestamp * (MAX_TIM_LOAD / (CONFIG_CCLK_HZ / 1000));
 
        return (milisec - base);
 }
+
+void reset_timer(void)
+{
+       timestamp = 0;
+}
diff --git a/cpu/blackfin/reset.c b/cpu/blackfin/reset.c
new file mode 100644 (file)
index 0000000..d1e34b3
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+ * reset.c - logic for resetting the cpu
+ *
+ * Copyright (c) 2005-2008 Analog Devices Inc.
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#include <common.h>
+#include <command.h>
+#include <asm/blackfin.h>
+#include "cpu.h"
+
+/* A system soft reset makes external memory unusable so force
+ * this function into L1.  We use the compiler ssync here rather
+ * than SSYNC() because it's safe (no interrupts and such) and
+ * we save some L1.  We do not need to force sanity in the SYSCR
+ * register as the BMODE selection bit is cleared by the soft
+ * reset while the Core B bit (on dual core parts) is cleared by
+ * the core reset.
+ */
+__attribute__ ((__l1_text__, __noreturn__))
+void bfin_reset(void)
+{
+       /* Wait for completion of "system" events such as cache line
+        * line fills so that we avoid infinite stalls later on as
+        * much as possible.  This code is in L1, so it won't trigger
+        * any such event after this point in time.
+        */
+       __builtin_bfin_ssync();
+
+       while (1) {
+               /* Initiate System software reset. */
+               bfin_write_SWRST(0x7);
+
+               /* Due to the way reset is handled in the hardware, we need
+                * to delay for 7 SCLKS.  The only reliable way to do this is
+                * to calculate the CCLK/SCLK ratio and multiply 7.  For now,
+                * we'll assume worse case which is a 1:15 ratio.
+                */
+               asm(
+                       "LSETUP (1f, 1f) LC0 = %0\n"
+                       "1: nop;"
+                       :
+                       : "a" (15 * 7)
+                       : "LC0", "LB0", "LT0"
+               );
+
+               /* Clear System software reset */
+               bfin_write_SWRST(0);
+
+               /* Wait for the SWRST write to complete.  Cannot rely on SSYNC
+                * though as the System state is all reset now.
+                */
+               asm(
+                       "LSETUP (1f, 1f) LC1 = %0\n"
+                       "1: nop;"
+                       :
+                       : "a" (15 * 1)
+                       : "LC1", "LB1", "LT1"
+               );
+
+               /* Issue core reset */
+               asm("raise 1");
+       }
+}
+
+/* We need to trampoline ourselves up into L1 since our linker
+ * does not have relaxtion support and will only generate a
+ * 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)
+{
+       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 *argv[])
+{
+       bfin_reset_trampoline();
+       return 0;
+}
diff --git a/cpu/blackfin/serial.c b/cpu/blackfin/serial.c
new file mode 100644 (file)
index 0000000..0dfee51
--- /dev/null
@@ -0,0 +1,124 @@
+/*
+ * U-boot - serial.c Blackfin Serial Driver
+ *
+ * Copyright (c) 2005-2008 Analog Devices Inc.
+ *
+ * Copyright (c) 2003  Bas Vermeulen <bas@buyways.nl>,
+ *                     BuyWays B.V. (www.buyways.nl)
+ *
+ * Based heavily on:
+ * blkfinserial.c: Serial driver for BlackFin DSP internal USRTs.
+ * Copyright(c) 2003   Metrowerks      <mwaddel@metrowerks.com>
+ * Copyright(c)        2001    Tony Z. Kou     <tonyko@arcturusnetworks.com>
+ * Copyright(c)        2001-2002 Arcturus Networks Inc. <www.arcturusnetworks.com>
+ *
+ * Based on code from 68328 version serial driver imlpementation which was:
+ * Copyright (C) 1995       David S. Miller    <davem@caip.rutgers.edu>
+ * Copyright (C) 1998       Kenneth Albanowski <kjahds@kjahds.com>
+ * Copyright (C) 1998, 1999 D. Jeff Dionne     <jeff@uclinux.org>
+ * Copyright (C) 1999       Vladimir Gurevich  <vgurevic@cisco.com>
+ *
+ * (C) Copyright 2000-2004
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#include <common.h>
+#include <watchdog.h>
+#include <asm/blackfin.h>
+#include <asm/mach-common/bits/uart.h>
+
+#if defined(UART_LSR) && (CONFIG_UART_CONSOLE != 0)
+# error CONFIG_UART_CONSOLE must be 0 on parts with only one UART
+#endif
+
+#include "serial.h"
+
+/* Symbol for our assembly to call. */
+void serial_set_baud(uint32_t baud)
+{
+       serial_early_set_baud(baud);
+}
+
+/* Symbol for common u-boot code to call.
+ * Setup the baudrate (brg: baudrate generator).
+ */
+void serial_setbrg(void)
+{
+       DECLARE_GLOBAL_DATA_PTR;
+       serial_set_baud(gd->baudrate);
+}
+
+/* Symbol for our assembly to call. */
+void serial_initialize(void)
+{
+       serial_early_init();
+}
+
+/* Symbol for common u-boot code to call. */
+int serial_init(void)
+{
+       serial_initialize();
+       serial_setbrg();
+       return 0;
+}
+
+void serial_putc(const char c)
+{
+       /* send a \r for compatibility */
+       if (c == '\n')
+               serial_putc('\r');
+
+       WATCHDOG_RESET();
+
+       /* wait for the hardware fifo to clear up */
+       while (!(*pUART_LSR & THRE))
+               continue;
+
+       /* queue the character for transmission */
+       *pUART_THR = c;
+       SSYNC();
+
+       WATCHDOG_RESET();
+
+       /* wait for the byte to be shifted over the line */
+       while (!(*pUART_LSR & TEMT))
+               continue;
+}
+
+int serial_tstc(void)
+{
+       WATCHDOG_RESET();
+       return (*pUART_LSR & DR) ? 1 : 0;
+}
+
+int serial_getc(void)
+{
+       uint16_t uart_lsr_val, uart_rbr_val;
+
+       /* wait for data ! */
+       while (!serial_tstc())
+               continue;
+
+       /* clear the status and grab the new byte */
+       uart_lsr_val = *pUART_LSR;
+       uart_rbr_val = *pUART_RBR;
+
+       if (uart_lsr_val & (OE|PE|FE|BI)) {
+               /* Some parts are read-to-clear while others are
+                * write-to-clear.  Just do the write for everyone
+                * since it cant hurt (other than code size).
+                */
+               *pUART_LSR = (OE|PE|FE|BI);
+               return -1;
+       }
+
+       return uart_rbr_val & 0xFF;
+}
+
+void serial_puts(const char *s)
+{
+       while (*s)
+               serial_putc(*s++);
+}
diff --git a/cpu/blackfin/serial.h b/cpu/blackfin/serial.h
new file mode 100644 (file)
index 0000000..1f0f4b4
--- /dev/null
@@ -0,0 +1,275 @@
+/*
+ * serial.h - common serial defines for early debug and serial driver.
+ *            any functions defined here must be always_inline since
+ *            initcode cannot have function calls.
+ *
+ * Copyright (c) 2004-2007 Analog Devices Inc.
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#ifndef __BFIN_CPU_SERIAL_H__
+#define __BFIN_CPU_SERIAL_H__
+
+#include <asm/blackfin.h>
+#include <asm/mach-common/bits/uart.h>
+
+#ifdef CONFIG_DEBUG_EARLY_SERIAL
+# define BFIN_DEBUG_EARLY_SERIAL 1
+#else
+# define BFIN_DEBUG_EARLY_SERIAL 0
+#endif
+
+#define LOB(x) ((x) & 0xFF)
+#define HIB(x) (((x) >> 8) & 0xFF)
+
+#ifndef UART_LSR
+# if (CONFIG_UART_CONSOLE == 3)
+#  define pUART_DLH  pUART3_DLH
+#  define pUART_DLL  pUART3_DLL
+#  define pUART_GCTL pUART3_GCTL
+#  define pUART_IER  pUART3_IER
+#  define pUART_IERC pUART3_IER_CLEAR
+#  define pUART_LCR  pUART3_LCR
+#  define pUART_LSR  pUART3_LSR
+#  define pUART_RBR  pUART3_RBR
+#  define pUART_THR  pUART3_THR
+#  define  UART_THR   UART3_THR
+#  define  UART_LSR   UART3_LSR
+# elif (CONFIG_UART_CONSOLE == 2)
+#  define pUART_DLH  pUART2_DLH
+#  define pUART_DLL  pUART2_DLL
+#  define pUART_GCTL pUART2_GCTL
+#  define pUART_IER  pUART2_IER
+#  define pUART_IERC pUART2_IER_CLEAR
+#  define pUART_LCR  pUART2_LCR
+#  define pUART_LSR  pUART2_LSR
+#  define pUART_RBR  pUART2_RBR
+#  define pUART_THR  pUART2_THR
+#  define  UART_THR   UART2_THR
+#  define  UART_LSR   UART2_LSR
+# elif (CONFIG_UART_CONSOLE == 1)
+#  define pUART_DLH  pUART1_DLH
+#  define pUART_DLL  pUART1_DLL
+#  define pUART_GCTL pUART1_GCTL
+#  define pUART_IER  pUART1_IER
+#  define pUART_IERC pUART1_IER_CLEAR
+#  define pUART_LCR  pUART1_LCR
+#  define pUART_LSR  pUART1_LSR
+#  define pUART_RBR  pUART1_RBR
+#  define pUART_THR  pUART1_THR
+#  define  UART_THR   UART1_THR
+#  define  UART_LSR   UART1_LSR
+# elif (CONFIG_UART_CONSOLE == 0)
+#  define pUART_DLH  pUART0_DLH
+#  define pUART_DLL  pUART0_DLL
+#  define pUART_GCTL pUART0_GCTL
+#  define pUART_IER  pUART0_IER
+#  define pUART_IERC pUART0_IER_CLEAR
+#  define pUART_LCR  pUART0_LCR
+#  define pUART_LSR  pUART0_LSR
+#  define pUART_RBR  pUART0_RBR
+#  define pUART_THR  pUART0_THR
+#  define  UART_THR   UART0_THR
+#  define  UART_LSR   UART0_LSR
+# endif
+#endif
+
+#ifndef __ASSEMBLY__
+
+/* We cannot use get_sclk() in initcode as it is defined elsewhere. */
+#ifdef BFIN_IN_INITCODE
+# define get_sclk() (CONFIG_CLKIN_HZ * CONFIG_VCO_MULT / CONFIG_SCLK_DIV)
+#endif
+
+#ifdef __ADSPBF54x__
+# define ACCESS_LATCH()
+# define ACCESS_PORT_IER()
+# define CLEAR_IER()       (*pUART_IERC = 0)
+#else
+# define ACCESS_LATCH()    (*pUART_LCR |= DLAB)
+# define ACCESS_PORT_IER() (*pUART_LCR &= ~DLAB)
+# define CLEAR_IER()       (*pUART_IER = 0)
+#endif
+
+__attribute__((always_inline))
+static inline void serial_do_portmux(void)
+{
+#ifdef __ADSPBF52x__
+# define DO_MUX(port, mux, tx, rx) \
+       bfin_write_PORT##port##_MUX((bfin_read_PORT##port##_MUX() & ~PORT_x_MUX_##mux##_MASK) | PORT_x_MUX_##mux##_FUNC_3); \
+       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, 2, 7, 8);   break;    /* Port G; mux 2; PG2 and PG8 */
+       case 1: DO_MUX(F, 5, 14, 15); break;    /* Port F; mux 5; PF14 and PF15 */
+       }
+       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;
+       }
+       SSYNC();
+#elif defined(__ADSPBF54x__)
+# define DO_MUX(port, tx, rx) \
+       bfin_write_PORT##port##_MUX((bfin_read_PORT##port##_MUX() & ~(PORT_x_MUX_##tx##_MASK | PORT_x_MUX_##rx##_MASK)) | PORT_x_MUX_##tx##_FUNC_1 | PORT_x_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(E, 7, 8); break; /* Port E; PE7 and PE8 */
+       case 1: DO_MUX(H, 0, 1); break; /* Port H; PH0 and PH1 */
+       case 2: DO_MUX(B, 4, 5); break; /* Port B; PB4 and PB5 */
+       case 3: DO_MUX(B, 6, 7); break; /* Port B; PB6 and PB7 */
+       }
+       SSYNC();
+#endif
+}
+
+__attribute__((always_inline))
+static inline void serial_early_init(void)
+{
+       /* handle portmux crap on different Blackfins */
+       serial_do_portmux();
+
+       /* Enable UART */
+       *pUART_GCTL = UCEN;
+
+       /* Set LCR to Word Lengh 8-bit word select */
+       *pUART_LCR = WLS_8;
+
+       SSYNC();
+}
+
+__attribute__((always_inline))
+static inline uint32_t serial_early_get_baud(void)
+{
+       /* If the UART isnt enabled, then we are booting an LDR
+        * from a non-UART source (so like flash) which means
+        * the baud rate here is meaningless.
+        */
+       if ((*pUART_GCTL & UCEN) != UCEN)
+               return 0;
+
+#if (0)        /* See comment for serial_reset_baud() in initcode.c */
+       /* Set DLAB in LCR to Access DLL and DLH */
+       ACCESS_LATCH();
+       SSYNC();
+
+       uint8_t dll = *pUART_DLL;
+       uint8_t dlh = *pUART_DLH;
+       uint16_t divisor = (dlh << 8) | dll;
+       uint32_t baud = get_sclk() / (divisor * 16);
+
+       /* Clear DLAB in LCR to Access THR RBR IER */
+       ACCESS_PORT_IER();
+       SSYNC();
+
+       return baud;
+#else
+       return CONFIG_BAUDRATE;
+#endif
+}
+
+__attribute__((always_inline))
+static inline void serial_early_set_baud(uint32_t baud)
+{
+       /* Translate from baud into divisor in terms of SCLK.
+        * The +1 is to make sure we over sample just a little
+        * rather than under sample the incoming signals.
+        */
+       uint16_t divisor = (get_sclk() / (baud * 16)) + 1;
+
+       /* Set DLAB in LCR to Access DLL and DLH */
+       ACCESS_LATCH();
+       SSYNC();
+
+       /* Program the divisor to get the baud rate we want */
+       *pUART_DLL = LOB(divisor);
+       *pUART_DLH = HIB(divisor);
+       SSYNC();
+
+       /* Clear DLAB in LCR to Access THR RBR IER */
+       ACCESS_PORT_IER();
+       SSYNC();
+}
+
+#ifndef BFIN_IN_INITCODE
+__attribute__((always_inline))
+static inline void serial_early_puts(const char *s)
+{
+       if (BFIN_DEBUG_EARLY_SERIAL) {
+               serial_puts("Early: ");
+               serial_puts(s);
+       }
+}
+#endif
+
+#else
+
+.macro serial_early_init
+#ifdef CONFIG_DEBUG_EARLY_SERIAL
+       call _serial_initialize;
+#endif
+.endm
+
+.macro serial_early_set_baud
+#ifdef CONFIG_DEBUG_EARLY_SERIAL
+       R0.L = LO(CONFIG_BAUDRATE);
+       R0.H = HI(CONFIG_BAUDRATE);
+       call _serial_set_baud;
+#endif
+.endm
+
+/* Recursively expand calls to _serial_putc for every byte
+ * passed to us.  Append a newline when we're all done.
+ */
+.macro _serial_early_putc byte:req morebytes:vararg
+#ifdef CONFIG_DEBUG_EARLY_SERIAL
+       R0 = \byte;
+       call _serial_putc;
+.ifnb \morebytes
+       _serial_early_putc \morebytes
+.else
+.if (\byte != '\n')
+       _serial_early_putc '\n'
+.endif
+.endif
+#endif
+.endm
+
+/* Wrapper around recurisve _serial_early_putc macro which
+ * simply prepends the string "Early: "
+ */
+.macro serial_early_putc byte:req morebytes:vararg
+#ifdef CONFIG_DEBUG_EARLY_SERIAL
+       _serial_early_putc 'E', 'a', 'r', 'l', 'y', ':', ' ', \byte, \morebytes
+#endif
+.endm
+
+/* Since we embed the string right into our .text section, we need
+ * to find its address.  We do this by getting our PC and adding 2
+ * bytes (which is the length of the jump instruction).  Then we
+ * pass this address to serial_puts().
+ */
+#ifdef CONFIG_DEBUG_EARLY_SERIAL
+# define serial_early_puts(str) \
+       call _get_pc; \
+       jump 1f; \
+       .ascii "Early:"; \
+       .ascii __FILE__; \
+       .ascii ": "; \
+       .ascii str; \
+       .asciz "\n"; \
+       .align 4; \
+1: \
+       R0 += 2; \
+       call _serial_puts;
+#else
+# define serial_early_puts(str)
+#endif
+
+#endif
+
+#endif
diff --git a/cpu/blackfin/start.S b/cpu/blackfin/start.S
new file mode 100644 (file)
index 0000000..30212e9
--- /dev/null
@@ -0,0 +1,219 @@
+/*
+ * U-boot - start.S Startup file for Blackfin u-boot
+ *
+ * Copyright (c) 2005-2007 Analog Devices Inc.
+ *
+ * This file is based on head.S
+ * Copyright (c) 2003  Metrowerks/Motorola
+ * Copyright (C) 1998  D. Jeff Dionne <jeff@ryeham.ee.ryerson.ca>,
+ *                     Kenneth Albanowski <kjahds@kjahds.com>,
+ *                     The Silver Hammer Group, Ltd.
+ * (c) 1995, Dionne & Associates
+ * (c) 1995, DKG Display Tech.
+ *
+ * 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 <config.h>
+#include <asm/blackfin.h>
+#include <asm/mach-common/bits/core.h>
+#include <asm/mach-common/bits/dma.h>
+#include <asm/mach-common/bits/pll.h>
+
+#include "serial.h"
+
+/* It may seem odd that we make calls to functions even though we haven't
+ * relocated ourselves yet out of {flash,ram,wherever}.  This is OK because
+ * the "call" instruction in the Blackfin architecture is actually PC
+ * relative.  So we can call functions all we want and not worry about them
+ * not being relocated yet.
+ */
+
+.text
+ENTRY(_start)
+
+       /* Set our initial stack to L1 scratch space */
+       sp.l = LO(L1_SRAM_SCRATCH + L1_SRAM_SCRATCH_SIZE);
+       sp.h = HI(L1_SRAM_SCRATCH + L1_SRAM_SCRATCH_SIZE);
+
+#ifdef CONFIG_HW_WATCHDOG
+# ifndef CONFIG_HW_WATCHDOG_TIMEOUT_START
+#  define CONFIG_HW_WATCHDOG_TIMEOUT_START 5000
+# endif
+       /* Program the watchdog with an initial timeout of ~5 seconds.
+        * 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;
+       /* fire up the watchdog - R0.L above needs to be 0x0000 */
+       W[P0 + (WDOG_CTL - WDOG_CNT)] = R0;
+#endif
+
+       /* Turn on the serial for debugging the init process */
+       serial_early_init
+       serial_early_set_baud
+
+       serial_early_puts("Init Registers");
+
+       /* Disable nested interrupts and enable CYCLES for udelay() */
+       R0 = CCEN | 0x30;
+       SYSCFG = R0;
+
+       /* Zero out registers required by Blackfin ABI.
+        * http://docs.blackfin.uclinux.org/doku.php?id=application_binary_interface
+        */
+       r1 = 0 (x);
+       /* Disable circular buffers */
+       l0 = r1;
+       l1 = r1;
+       l2 = r1;
+       l3 = r1;
+       /* Disable hardware loops in case we were started by 'go' */
+       lc0 = r1;
+       lc1 = r1;
+
+       /* Save RETX so we can pass it while booting Linux */
+       r7 = RETX;
+
+#if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS)
+       /* 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 and setup our async banks.
+        */
+       /* XXX: we should DMA this into L1, put external memory into
+        *      self refresh, and then jump there ...
+        */
+       call _get_pc;
+       r3 = 0x0;
+       r3.h = 0x2000;
+       cc = r0 < r3 (iu);
+       if cc jump .Lproc_initialized;
+
+       serial_early_puts("Program Clocks");
+
+       call _initcode;
+
+       /* Since we reprogrammed SCLK, we need to update the serial divisor */
+       serial_early_set_baud
+
+.Lproc_initialized:
+#endif
+
+       /* Inform upper layers if we had to do the relocation ourselves.
+        * This allows us to detect whether we were loaded by 'go 0x1000'
+        * or by the bootrom from an LDR.  "r6" is "loaded_from_ldr".
+        */
+       r6 = 1 (x);
+
+       /* Relocate from wherever are (FLASH/RAM/etc...) to the
+        * hardcoded monitor location in the end of RAM.
+        */
+       serial_early_puts("Relocate");
+       call _get_pc;
+.Loffset:
+       r2.l = .Loffset;
+       r2.h = .Loffset;
+       r3.l = _start;
+       r3.h = _start;
+       r1 = r2 - r3;
+
+       r0 = r0 - r1;
+
+       cc = r0 == r3;
+       if cc jump .Lnorelocate;
+
+       r6 = 0 (x);
+       p1 = r0;
+
+       p2.l = LO(CFG_MONITOR_BASE);
+       p2.h = HI(CFG_MONITOR_BASE);
+
+       p3 = 0x04;
+       p4.l = LO(CFG_MONITOR_BASE + CFG_MONITOR_LEN);
+       p4.h = HI(CFG_MONITOR_BASE + CFG_MONITOR_LEN);
+.Lloop1:
+       r1 = [p1 ++ p3];
+       [p2 ++ p3] = r1;
+       cc=p2==p4;
+       if !cc jump .Lloop1;
+
+       /* Initialize BSS section ... we know that memset() does not
+        * use the BSS, so it is safe to call here.  The bootrom LDR
+        * takes care of clearing things for us.
+        */
+       serial_early_puts("Zero BSS");
+       r0.l = __bss_start;
+       r0.h = __bss_start;
+       r1 = 0 (x);
+       r2.l = __bss_end;
+       r2.h = __bss_end;
+       r2 = r2 - r0;
+       call _memset;
+
+.Lnorelocate:
+
+       /* Setup the actual stack in external memory */
+       r0.h = HI(CONFIG_STACKBASE);
+       r0.l = LO(CONFIG_STACKBASE);
+       sp = r0;
+       fp = sp;
+
+       /* Now lower ourselves from the highest interrupt level to
+        * the lowest.  We do this by masking all interrupts but 15,
+        * setting the 15 handler to "board_init_f", raising the 15
+        * interrupt, and then returning from the highest interrupt
+        * level to the dummy "jump" until the interrupt controller
+        * services the pending 15 interrupt.
+        */
+       serial_early_puts("Lower to 15");
+       r0 = r7;
+       r1 = r6;
+       p0.l = LO(EVT15);
+       p0.h = HI(EVT15);
+       p1.l = _cpu_init_f;
+       p1.h = _cpu_init_f;
+       [p0] = p1;
+       p2.l = LO(IMASK);
+       p2.h = HI(IMASK);
+       p3.l = LO(EVT_IVG15);
+       p3.h = HI(EVT_IVG15);
+       [p2] = p3;
+       raise 15;
+       p4.l = .LWAIT_HERE;
+       p4.h = .LWAIT_HERE;
+       reti = p4;
+       rti;
+
+.LWAIT_HERE:
+       jump .LWAIT_HERE;
+ENDPROC(_start)
+
+LENTRY(_get_pc)
+       r0 = rets;
+#if ANOMALY_05000371
+       NOP;
+       NOP;
+       NOP;
+#endif
+       rts;
+ENDPROC(_get_pc)
diff --git a/cpu/blackfin/system_map.S b/cpu/blackfin/system_map.S
new file mode 100644 (file)
index 0000000..286d7f3
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * system_map.S - optional symbol lookup for debugging
+ *
+ * Copyright (c) 2007 Analog Devices Inc.
+ * Licensed under the GPL-2 or later.
+ */
+
+#include <config.h>
+
+#ifdef CONFIG_DEBUG_DUMP_SYMS
+.data
+.global _system_map
+.type _system_map,@object
+_system_map:
+#include SYM_FILE
+.asciz ""
+.size _system_map,.-_system_map
+#endif
diff --git a/cpu/blackfin/traps.c b/cpu/blackfin/traps.c
new file mode 100644 (file)
index 0000000..4474fe5
--- /dev/null
@@ -0,0 +1,353 @@
+/*
+ * U-boot - traps.c Routines related to interrupts and exceptions
+ *
+ * Copyright (c) 2005-2008 Analog Devices Inc.
+ *
+ * This file is based on
+ * No original Copyright holder listed,
+ * Probabily original (C) Roman Zippel (assigned DJD, 1999)
+ *
+ * Copyright 2003 Metrowerks - for Blackfin
+ * Copyright 2000-2001 Lineo, Inc. D. Jeff Dionne <jeff@lineo.ca>
+ * Copyright 1999-2000 D. Jeff Dionne, <jeff@uclinux.org>
+ *
+ * (C) Copyright 2000-2004
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#include <common.h>
+#include <linux/types.h>
+#include <asm/traps.h>
+#include <asm/cplb.h>
+#include <asm/io.h>
+#include <asm/mach-common/bits/core.h>
+#include <asm/mach-common/bits/mpu.h>
+#include <asm/mach-common/bits/trace.h>
+#include "cpu.h"
+
+#define trace_buffer_save(x) \
+       do { \
+               (x) = bfin_read_TBUFCTL(); \
+               bfin_write_TBUFCTL((x) & ~TBUFEN); \
+       } while (0)
+
+#define trace_buffer_restore(x) \
+       bfin_write_TBUFCTL((x))
+
+/* The purpose of this map is to provide a mapping of address<->cplb settings
+ * rather than an exact map of what is actually addressable on the part.  This
+ * map covers all current Blackfin parts.  If you try to access an address that
+ * is in this map but not actually on the part, you won't get an exception and
+ * reboot, you'll get an external hardware addressing error and reboot.  Since
+ * only the ends matter (you did something wrong and the board reset), the means
+ * are largely irrelevant.
+ */
+struct memory_map {
+       uint32_t start, end;
+       uint32_t data_flags, inst_flags;
+};
+const struct memory_map const bfin_memory_map[] = {
+       {       /* external memory */
+               .start = 0x00000000,
+               .end   = 0x20000000,
+               .data_flags = SDRAM_DGENERIC,
+               .inst_flags = SDRAM_IGENERIC,
+       },
+       {       /* async banks */
+               .start = 0x20000000,
+               .end   = 0x30000000,
+               .data_flags = SDRAM_EBIU,
+               .inst_flags = SDRAM_INON_CHBL,
+       },
+       {       /* everything on chip */
+               .start = 0xE0000000,
+               .end   = 0xFFFFFFFF,
+               .data_flags = L1_DMEMORY,
+               .inst_flags = L1_IMEMORY,
+       }
+};
+
+void trap_c(struct pt_regs *regs)
+{
+       uint32_t trapnr = (regs->seqstat & EXCAUSE);
+       bool data = false;
+
+       switch (trapnr) {
+       /* 0x26 - Data CPLB Miss */
+       case VEC_CPLB_M:
+
+               if (ANOMALY_05000261) {
+                       static uint32_t last_cplb_fault_retx;
+                       /*
+                        * Work around an anomaly: if we see a new DCPLB fault,
+                        * return without doing anything. Then,
+                        * if we get the same fault again, handle it.
+                        */
+                       if (last_cplb_fault_retx != regs->retx) {
+                               last_cplb_fault_retx = regs->retx;
+                               return;
+                       }
+               }
+
+               data = true;
+               /* fall through */
+
+       /* 0x27 - Instruction CPLB Miss */
+       case VEC_CPLB_I_M: {
+               volatile uint32_t *CPLB_ADDR_BASE, *CPLB_DATA_BASE, *CPLB_ADDR, *CPLB_DATA;
+               uint32_t new_cplb_addr = 0, new_cplb_data = 0;
+               static size_t last_evicted;
+               size_t i;
+
+               new_cplb_addr = (data ? bfin_read_DCPLB_FAULT_ADDR() : bfin_read_ICPLB_FAULT_ADDR()) & ~(4 * 1024 * 1024 - 1);
+
+               for (i = 0; i < ARRAY_SIZE(bfin_memory_map); ++i) {
+                       /* if the exception is inside this range, lets use it */
+                       if (new_cplb_addr >= bfin_memory_map[i].start &&
+                           new_cplb_addr < bfin_memory_map[i].end)
+                               break;
+               }
+               if (i == ARRAY_SIZE(bfin_memory_map)) {
+                       printf("%cCPLB exception outside of memory map at 0x%p\n",
+                               (data ? 'D' : 'I'), new_cplb_addr);
+                       bfin_panic(regs);
+               } else
+                       debug("CPLB addr %p matches map 0x%p - 0x%p\n", new_cplb_addr, bfin_memory_map[i].start, bfin_memory_map[i].end);
+               new_cplb_data = (data ? bfin_memory_map[i].data_flags : bfin_memory_map[i].inst_flags);
+
+               /* Turn the cache off */
+               SSYNC();
+               if (data) {
+                       asm(" .align 8; ");
+                       *pDMEM_CONTROL &= ~ENDCPLB;
+               } else {
+                       asm(" .align 8; ");
+                       *pIMEM_CONTROL &= ~ENICPLB;
+               }
+               SSYNC();
+
+               if (data) {
+                       CPLB_ADDR_BASE = (uint32_t *)DCPLB_ADDR0;
+                       CPLB_DATA_BASE = (uint32_t *)DCPLB_DATA0;
+               } else {
+                       CPLB_ADDR_BASE = (uint32_t *)ICPLB_ADDR0;
+                       CPLB_DATA_BASE = (uint32_t *)ICPLB_DATA0;
+               }
+
+               /* find the next unlocked entry and evict it */
+               i = last_evicted & 0xF;
+               debug("last evicted = %i\n", i);
+               CPLB_DATA = CPLB_DATA_BASE + i;
+               while (*CPLB_DATA & CPLB_LOCK) {
+                       debug("skipping %i %p - %08X\n", i, CPLB_DATA, *CPLB_DATA);
+                       i = (i + 1) & 0xF;      /* wrap around */
+                       CPLB_DATA = CPLB_DATA_BASE + i;
+               }
+               CPLB_ADDR = CPLB_ADDR_BASE + i;
+
+               debug("evicting entry %i: 0x%p 0x%08X\n", i, *CPLB_ADDR, *CPLB_DATA);
+               last_evicted = i + 1;
+               *CPLB_ADDR = new_cplb_addr;
+               *CPLB_DATA = new_cplb_data;
+
+               /* dump current table for debugging purposes */
+               CPLB_ADDR = CPLB_ADDR_BASE;
+               CPLB_DATA = CPLB_DATA_BASE;
+               for (i = 0; i < 16; ++i)
+                       debug("%2i 0x%p 0x%08X\n", i, *CPLB_ADDR++, *CPLB_DATA++);
+
+               /* Turn the cache back on */
+               SSYNC();
+               if (data) {
+                       asm(" .align 8; ");
+                       *pDMEM_CONTROL |= ENDCPLB;
+               } else {
+                       asm(" .align 8; ");
+                       *pIMEM_CONTROL |= ENICPLB;
+               }
+               SSYNC();
+
+               break;
+       }
+
+       default:
+               /* All traps come here */
+               bfin_panic(regs);
+       }
+}
+
+#ifdef CONFIG_DEBUG_DUMP
+# define ENABLE_DUMP 1
+#else
+# define ENABLE_DUMP 0
+#endif
+
+#ifdef CONFIG_DEBUG_DUMP_SYMS
+# define ENABLE_DUMP_SYMS 1
+#else
+# define ENABLE_DUMP_SYMS 0
+#endif
+
+static const char *symbol_lookup(unsigned long addr, unsigned long *caddr)
+{
+       if (!ENABLE_DUMP_SYMS)
+               return NULL;
+
+       extern const char system_map[] __attribute__((__weak__));
+       const char *sym, *csym;
+       char *esym;
+       unsigned long sym_addr;
+
+       sym = system_map;
+       csym = NULL;
+       *caddr = 0;
+
+       while (*sym) {
+               sym_addr = simple_strtoul(sym, &esym, 16);
+               sym = esym + 1;
+               if (sym_addr > addr)
+                       break;
+               *caddr = sym_addr;
+               csym = sym;
+               sym += strlen(sym) + 1;
+       }
+
+       return csym;
+}
+
+static void decode_address(char *buf, unsigned long address)
+{
+       unsigned long sym_addr;
+       const char *sym = symbol_lookup(address, &sym_addr);
+
+       if (sym) {
+               sprintf(buf, "<0x%p> { %s + 0x%x }", address, sym, address - sym_addr);
+               return;
+       }
+
+       if (!address)
+               sprintf(buf, "<0x%p> /* Maybe null pointer? */", address);
+       else if (address >= CFG_MONITOR_BASE &&
+                address < CFG_MONITOR_BASE + CFG_MONITOR_LEN)
+               sprintf(buf, "<0x%p> /* somewhere in u-boot */", address);
+       else
+               sprintf(buf, "<0x%p> /* unknown address */", address);
+}
+
+void dump(struct pt_regs *fp)
+{
+       char buf[150];
+       size_t i;
+
+       if (!ENABLE_DUMP)
+               return;
+
+       printf("SEQUENCER STATUS:\n");
+       printf(" SEQSTAT: %08lx  IPEND: %04lx  SYSCFG: %04lx\n",
+               fp->seqstat, fp->ipend, fp->syscfg);
+       printf("  HWERRCAUSE: 0x%lx\n", (fp->seqstat & HWERRCAUSE) >> HWERRCAUSE_P);
+       printf("  EXCAUSE   : 0x%lx\n", (fp->seqstat & EXCAUSE) >> EXCAUSE_P);
+       for (i = 6; i <= 15; ++i) {
+               if (fp->ipend & (1 << i)) {
+                       decode_address(buf, bfin_read32(EVT0 + 4*i));
+                       printf("  physical IVG%i asserted : %s\n", i, buf);
+               }
+       }
+       decode_address(buf, fp->rete);
+       printf(" RETE: %s\n", buf);
+       decode_address(buf, fp->retn);
+       printf(" RETN: %s\n", buf);
+       decode_address(buf, fp->retx);
+       printf(" RETX: %s\n", buf);
+       decode_address(buf, fp->rets);
+       printf(" RETS: %s\n", buf);
+       decode_address(buf, fp->pc);
+       printf(" PC  : %s\n", buf);
+
+       if (fp->seqstat & EXCAUSE) {
+               decode_address(buf, bfin_read_DCPLB_FAULT_ADDR());
+               printf("DCPLB_FAULT_ADDR: %s\n", buf);
+               decode_address(buf, bfin_read_ICPLB_FAULT_ADDR());
+               printf("ICPLB_FAULT_ADDR: %s\n", buf);
+       }
+
+       printf("\nPROCESSOR STATE:\n");
+       printf(" R0 : %08lx    R1 : %08lx    R2 : %08lx    R3 : %08lx\n",
+               fp->r0, fp->r1, fp->r2, fp->r3);
+       printf(" R4 : %08lx    R5 : %08lx    R6 : %08lx    R7 : %08lx\n",
+               fp->r4, fp->r5, fp->r6, fp->r7);
+       printf(" P0 : %08lx    P1 : %08lx    P2 : %08lx    P3 : %08lx\n",
+               fp->p0, fp->p1, fp->p2, fp->p3);
+       printf(" P4 : %08lx    P5 : %08lx    FP : %08lx    SP : %08lx\n",
+               fp->p4, fp->p5, fp->fp, fp);
+       printf(" LB0: %08lx    LT0: %08lx    LC0: %08lx\n",
+               fp->lb0, fp->lt0, fp->lc0);
+       printf(" LB1: %08lx    LT1: %08lx    LC1: %08lx\n",
+               fp->lb1, fp->lt1, fp->lc1);
+       printf(" B0 : %08lx    L0 : %08lx    M0 : %08lx    I0 : %08lx\n",
+               fp->b0, fp->l0, fp->m0, fp->i0);
+       printf(" B1 : %08lx    L1 : %08lx    M1 : %08lx    I1 : %08lx\n",
+               fp->b1, fp->l1, fp->m1, fp->i1);
+       printf(" B2 : %08lx    L2 : %08lx    M2 : %08lx    I2 : %08lx\n",
+               fp->b2, fp->l2, fp->m2, fp->i2);
+       printf(" B3 : %08lx    L3 : %08lx    M3 : %08lx    I3 : %08lx\n",
+               fp->b3, fp->l3, fp->m3, fp->i3);
+       printf("A0.w: %08lx   A0.x: %08lx   A1.w: %08lx   A1.x: %08lx\n",
+               fp->a0w, fp->a0x, fp->a1w, fp->a1x);
+
+       printf("USP : %08lx  ASTAT: %08lx\n",
+               fp->usp, fp->astat);
+
+       printf("\n");
+}
+
+void dump_bfin_trace_buffer(void)
+{
+       char buf[150];
+       unsigned long tflags;
+       size_t i = 0;
+
+       if (!ENABLE_DUMP)
+               return;
+
+       trace_buffer_save(tflags);
+
+       printf("Hardware Trace:\n");
+
+       if (bfin_read_TBUFSTAT() & TBUFCNT) {
+               for (; bfin_read_TBUFSTAT() & TBUFCNT; i++) {
+                       decode_address(buf, bfin_read_TBUF());
+                       printf("%4i Target : %s\n", i, buf);
+                       decode_address(buf, bfin_read_TBUF());
+                       printf("     Source : %s\n", buf);
+               }
+       }
+
+       trace_buffer_restore(tflags);
+}
+
+void bfin_panic(struct pt_regs *regs)
+{
+       if (ENABLE_DUMP) {
+               unsigned long tflags;
+               trace_buffer_save(tflags);
+       }
+
+       puts(
+               "\n"
+               "\n"
+               "\n"
+               "Ack! Something bad happened to the Blackfin!\n"
+               "\n"
+       );
+       dump(regs);
+       dump_bfin_trace_buffer();
+       printf(
+               "\n"
+               "Please reset the board\n"
+               "\n"
+       );
+       bfin_reset_or_hang();
+}
diff --git a/cpu/blackfin/watchdog.c b/cpu/blackfin/watchdog.c
new file mode 100644 (file)
index 0000000..b47c6b6
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * watchdog.c - driver for Blackfin on-chip watchdog
+ *
+ * Copyright (c) 2007-2008 Analog Devices Inc.
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#include <common.h>
+#include <watchdog.h>
+#include <asm/blackfin.h>
+
+#ifdef CONFIG_HW_WATCHDOG
+void hw_watchdog_reset(void)
+{
+       bfin_write_WDOG_STAT(0);
+}
+
+void hw_watchdog_init(void)
+{
+       bfin_write_WDOG_CNT(5 * get_sclk());    /* 5 second timeout */
+       hw_watchdog_reset();
+       bfin_write_WDOG_CTL(0x0);
+}
+#endif
similarity index 64%
rename from cpu/bf537/Makefile
rename to cpu/leon2/Makefile
index 06d1aae..7cc4420 100644 (file)
@@ -1,8 +1,5 @@
-# U-boot - Makefile
 #
-# Copyright (c) 2005-2007 Analog Devices Inc.
-#
-# (C) Copyright 2000-2004
+# (C) Copyright 2003-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 # 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
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
 #
 
 include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(CPU).a
 
-SOBJS  = start.o start1.o interrupt.o cache.o flush.o init_sdram.o
-COBJS  = cpu.o traps.o ints.o serial.o interrupts.o video.o i2c.o
-
-EXTRA = init_sdram_bootrom_initblock.o
+START  = start.o
+SOBJS  =
+COBJS  = cpu_init.o serial.o cpu.o interrupts.o prom.o
 
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
 START  := $(addprefix $(obj),$(START))
 
-all:   $(obj).depend $(START) $(LIB) $(obj).depend $(EXTRA)
+all:   $(obj).depend $(START) $(LIB)
 
 $(LIB):        $(OBJS)
        $(AR) $(ARFLAGS) $@ $(OBJS)
@@ -47,6 +43,12 @@ $(LIB):      $(OBJS)
 # defines $(obj).depend target
 include $(SRCTREE)/rules.mk
 
+$(START): $(START:.o=.S)
+       $(CC) -D__ASSEMBLY__ $(DBGFLAGS) $(OPTFLAGS) -D__KERNEL__ -DTEXT_BASE=$(TEXT_BASE) \
+       -I$(TOPDIR)/include -fno-builtin -ffreestanding -nostdinc -isystem $(gccincdir) -pipe \
+       $(PLATFORM_CPPFLAGS) -Wall -Wstrict-prototypes \
+       -I$(TOPDIR)/board -c -o $(START) $(START:.o=.S)
+
 sinclude $(obj).depend
 
 #########################################################################
similarity index 78%
rename from cpu/bf533/config.mk
rename to cpu/leon2/config.mk
index 2caa3cc..30b224a 100644 (file)
@@ -1,8 +1,5 @@
-# U-boot - config.mk
 #
-# Copyright (c) 2005-2007 Analog Devices Inc.
-#
-# (C) Copyright 2000-2004
+# (C) Copyright 2003
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 # 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
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
 #
 
-PLATFORM_RELFLAGS += -mcpu=bf533
+PLATFORM_RELFLAGS += -fPIC
+
+PLATFORM_CPPFLAGS += -DCONFIG_LEON
diff --git a/cpu/leon2/cpu.c b/cpu/leon2/cpu.c
new file mode 100644 (file)
index 0000000..1c1e24b
--- /dev/null
@@ -0,0 +1,58 @@
+/* CPU specific code for the LEON2 CPU
+ *
+ * (C) Copyright 2007
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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 <watchdog.h>
+#include <command.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+extern void _reset_reloc(void);
+
+int checkcpu(void)
+{
+       /* check LEON version here */
+       printf("CPU: LEON2\n");
+       return 0;
+}
+
+/* ------------------------------------------------------------------------- */
+
+void cpu_reset(void)
+{
+       /* Interrupts off */
+       disable_interrupts();
+
+       /* jump to restart in flash */
+       _reset_reloc();
+}
+
+int do_reset(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+{
+       cpu_reset();
+
+       return 1;
+}
+
+/* ------------------------------------------------------------------------- */
diff --git a/cpu/leon2/cpu_init.c b/cpu/leon2/cpu_init.c
new file mode 100644 (file)
index 0000000..a24f778
--- /dev/null
@@ -0,0 +1,142 @@
+/* Initializes CPU and basic hardware such as memory
+ * controllers, IRQ controller and system timer 0.
+ *
+ * (C) Copyright 2007
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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/asi.h>
+#include <asm/leon.h>
+
+#include <config.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/* reset CPU (jump to 0, without reset) */
+void start(void);
+
+struct {
+       gd_t gd_area;
+       bd_t bd;
+} global_data;
+
+/*
+ * Breath some life into the CPU...
+ *
+ * Set up the memory map,
+ * initialize a bunch of registers.
+ *
+ * Run from FLASH/PROM:
+ *  - until memory controller is set up, only registers avaiable
+ *  - no global variables available for writing
+ *  - constants avaiable
+ */
+
+void cpu_init_f(void)
+{
+       LEON2_regs *leon2 = (LEON2_regs *) LEON2_PREGS;
+
+       /* initialize the IRQMP */
+       leon2->Interrupt_Force = 0;
+       leon2->Interrupt_Pending = 0;
+       leon2->Interrupt_Clear = 0xfffe;        /* clear all old pending interrupts */
+       leon2->Interrupt_Mask = 0xfffe0000;     /* mask all IRQs */
+
+       /* cache */
+
+       /* I/O port setup */
+#ifdef LEON2_IO_PORT_DIR
+       leon2->PIO_Direction = LEON2_IO_PORT_DIR;
+#endif
+#ifdef LEON2_IO_PORT_DATA
+       leon2->PIO_Data = LEON2_IO_PORT_DATA;
+#endif
+#ifdef LEON2_IO_PORT_INT
+       leon2->PIO_Interrupt = LEON2_IO_PORT_INT;
+#else
+       leon2->PIO_Interrupt = 0;
+#endif
+}
+
+void cpu_init_f2(void)
+{
+
+}
+
+/*
+ * initialize higher level parts of CPU like time base and timers
+ */
+int cpu_init_r(void)
+{
+       LEON2_regs *leon2 = (LEON2_regs *) LEON2_PREGS;
+
+       /* initialize prescaler common to all timers to 1MHz */
+       leon2->Scaler_Counter = leon2->Scaler_Reload =
+           (((CONFIG_SYS_CLK_FREQ / 1000) + 500) / 1000) - 1;
+
+       return (0);
+}
+
+/* Uses Timer 0 to get accurate
+ * pauses. Max 2 raised to 32 ticks
+ *
+ */
+void cpu_wait_ticks(unsigned long ticks)
+{
+       unsigned long start = get_timer(0);
+       while (get_timer(start) < ticks) ;
+}
+
+/* initiate and setup timer0 interrupt to 1MHz
+ * Return irq number for timer int or a negative number for
+ * dealing with self
+ */
+int timer_interrupt_init_cpu(void)
+{
+       LEON2_regs *leon2 = (LEON2_regs *) LEON2_PREGS;
+
+       /* 1ms ticks */
+       leon2->Timer_Counter_1 = 0;
+       leon2->Timer_Reload_1 = 999;    /* (((1000000 / 100) - 1)) */
+       leon2->Timer_Control_1 =
+           (LEON2_TIMER_CTRL_EN | LEON2_TIMER_CTRL_RS | LEON2_TIMER_CTRL_LD);
+
+       return LEON2_TIMER1_IRQNO;
+}
+
+/*
+ * This function is intended for SHORT delays only.
+ */
+unsigned long cpu_usec2ticks(unsigned long usec)
+{
+       /* timer set to 1kHz ==> 1 clk tick = 1 msec */
+       if (usec < 1000)
+               return 1;
+       return (usec / 1000);
+}
+
+unsigned long cpu_ticks2usec(unsigned long ticks)
+{
+       /* 1tick = 1usec */
+       return ticks * 1000;
+}
diff --git a/cpu/leon2/interrupts.c b/cpu/leon2/interrupts.c
new file mode 100644 (file)
index 0000000..35b375c
--- /dev/null
@@ -0,0 +1,217 @@
+/*
+ * (C) Copyright 2007
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.com
+ *
+ * (C) Copyright 2006
+ * Detlev Zundel, DENX Software Engineering, dzu@denx.de
+ *
+ * (C) Copyright -2003
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * (C) Copyright 2001
+ * Josh Huber <huber@mclx.com>, Mission Critical Linux, 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 <asm/stack.h>
+#include <common.h>
+#include <asm/io.h>
+#include <asm/processor.h>
+#include <command.h>
+#include <asm/irq.h>
+
+#include <asm/leon.h>
+
+/* 15 normal irqs and a non maskable interrupt */
+#define NR_IRQS 15
+
+struct irq_action {
+       interrupt_handler_t *handler;
+       void *arg;
+       unsigned int count;
+};
+
+static struct irq_action irq_handlers[NR_IRQS] = { {0}, };
+static int spurious_irq_cnt = 0;
+static int spurious_irq = 0;
+
+static inline unsigned int leon2_get_irqmask(unsigned int irq)
+{
+       if ((irq < 0) || (irq >= NR_IRQS)) {
+               return 0;
+       } else {
+               return (1 << irq);
+       }
+}
+
+static void leon2_ic_disable(unsigned int irq)
+{
+       unsigned int mask, pil;
+       LEON2_regs *leon2 = (LEON2_regs *) LEON2_PREGS;
+
+       pil = intLock();
+
+       /* get mask of interrupt */
+       mask = leon2_get_irqmask(irq);
+
+       /* set int level */
+       leon2->Interrupt_Mask =
+           SPARC_NOCACHE_READ(&leon2->Interrupt_Mask) & (~mask);
+
+       intUnlock(pil);
+}
+
+static void leon2_ic_enable(unsigned int irq)
+{
+       unsigned int mask, pil;
+       LEON2_regs *leon2 = (LEON2_regs *) LEON2_PREGS;
+
+       pil = intLock();
+
+       /* get mask of interrupt */
+       mask = leon2_get_irqmask(irq);
+
+       /* set int level */
+       leon2->Interrupt_Mask =
+           SPARC_NOCACHE_READ(&leon2->Interrupt_Mask) | mask;
+
+       intUnlock(pil);
+}
+
+void handler_irq(int irq, struct pt_regs *regs)
+{
+       if (irq_handlers[irq].handler) {
+               if (((unsigned int)irq_handlers[irq].handler > CFG_RAM_END) ||
+                   ((unsigned int)irq_handlers[irq].handler < CFG_RAM_BASE)
+                   ) {
+                       printf("handler_irq: bad handler: %x, irq number %d\n",
+                              (unsigned int)irq_handlers[irq].handler, irq);
+                       return;
+               }
+               irq_handlers[irq].handler(irq_handlers[irq].arg);
+               irq_handlers[irq].count++;
+       } else {
+               spurious_irq_cnt++;
+               spurious_irq = irq;
+       }
+}
+
+void leon2_force_int(int irq)
+{
+       LEON2_regs *leon2 = (LEON2_regs *) LEON2_PREGS;
+
+       if ((irq >= NR_IRQS) || (irq < 0))
+               return;
+       printf("Forcing interrupt %d\n", irq);
+
+       leon2->Interrupt_Force =
+           SPARC_NOCACHE_READ(&leon2->Interrupt_Force) | (1 << irq);
+}
+
+/****************************************************************************/
+
+int interrupt_init_cpu(void)
+{
+       return (0);
+}
+
+/****************************************************************************/
+
+/* Handle Timer 0 IRQ */
+void timer_interrupt_cpu(void *arg)
+{
+       LEON2_regs *leon2 = (LEON2_regs *) LEON2_PREGS;
+
+       leon2->Timer_Control_1 =
+           (LEON2_TIMER_CTRL_EN | LEON2_TIMER_CTRL_RS | LEON2_TIMER_CTRL_LD);
+
+       /* nothing to do here */
+       return;
+}
+
+/****************************************************************************/
+
+/*
+ * Install and free a interrupt handler.
+ */
+
+void irq_install_handler(int irq, interrupt_handler_t * handler, void *arg)
+{
+       if (irq < 0 || irq >= NR_IRQS) {
+               printf("irq_install_handler: bad irq number %d\n", irq);
+               return;
+       }
+
+       if (irq_handlers[irq].handler != NULL)
+               printf("irq_install_handler: 0x%08lx replacing 0x%08lx\n",
+                      (ulong) handler, (ulong) irq_handlers[irq].handler);
+
+       if (((unsigned int)handler > CFG_RAM_END) ||
+           ((unsigned int)handler < CFG_RAM_BASE)
+           ) {
+               printf("irq_install_handler: bad handler: %x, irq number %d\n",
+                      (unsigned int)handler, irq);
+               return;
+       }
+       irq_handlers[irq].handler = handler;
+       irq_handlers[irq].arg = arg;
+
+       /* enable irq on LEON2 hardware */
+       leon2_ic_enable(irq);
+
+}
+
+void irq_free_handler(int irq)
+{
+       if (irq < 0 || irq >= NR_IRQS) {
+               printf("irq_free_handler: bad irq number %d\n", irq);
+               return;
+       }
+
+       /* disable irq on LEON2 hardware */
+       leon2_ic_disable(irq);
+
+       irq_handlers[irq].handler = NULL;
+       irq_handlers[irq].arg = NULL;
+}
+
+/****************************************************************************/
+
+#if defined(CONFIG_CMD_IRQ)
+void do_irqinfo(cmd_tbl_t * cmdtp, bd_t * bd, int flag, int argc, char *argv[])
+{
+       int irq;
+       unsigned int pil = get_pil();
+       printf("PIL level: %u\n\r", pil);
+       printf("Spurious IRQ: %u, last unknown IRQ: %d\n",
+              spurious_irq_cnt, spurious_irq);
+
+       puts("\nInterrupt-Information:\n" "Nr  Routine   Arg       Count\n");
+
+       for (irq = 0; irq < NR_IRQS; irq++) {
+               if (irq_handlers[irq].handler != NULL) {
+                       printf("%02d  %08lx  %08lx  %ld\n", irq,
+                              (unsigned int)irq_handlers[irq].handler,
+                              (unsigned int)irq_handlers[irq].arg,
+                              irq_handlers[irq].count);
+               }
+       }
+}
+#endif
diff --git a/cpu/leon2/prom.c b/cpu/leon2/prom.c
new file mode 100644 (file)
index 0000000..b031995
--- /dev/null
@@ -0,0 +1,1047 @@
+/* prom.c - emulates a sparc v0 PROM for the linux kernel.
+ *
+ * Copyright (C) 2003 Konrad Eisele <eiselekd@web.de>
+ * Copyright (C) 2004 Stefan Holst <mail@s-holst.de>
+ * Copyright (C) 2007 Daniel Hellstrom <daniel@gaisler.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/prom.h>
+#include <asm/machines.h>
+#include <asm/srmmu.h>
+#include <asm/processor.h>
+#include <asm/irq.h>
+#include <asm/leon.h>
+
+#include <config.h>
+/*
+#define PRINT_ROM_VEC
+*/
+extern struct linux_romvec *kernel_arg_promvec;
+
+#define PROM_PGT __attribute__ ((__section__ (".prom.pgt")))
+#define PROM_TEXT __attribute__ ((__section__ (".prom.text")))
+#define PROM_DATA __attribute__ ((__section__ (".prom.data")))
+
+/* for __va */
+extern int __prom_start;
+#define PAGE_OFFSET 0xf0000000
+#define phys_base CFG_SDRAM_BASE
+#define PROM_OFFS 8192
+#define PROM_SIZE_MASK (PROM_OFFS-1)
+#define __va(x) ( \
+       (void *)( ((unsigned long)(x))-PROM_OFFS+ \
+       (CFG_PROM_OFFSET-phys_base)+PAGE_OFFSET-TEXT_BASE ) \
+       )
+#define __phy(x) ((void *)(((unsigned long)(x))-PROM_OFFS+CFG_PROM_OFFSET-TEXT_BASE))
+
+struct property {
+       char *name;
+       char *value;
+       int length;
+};
+
+struct node {
+       int level;
+       struct property *properties;
+};
+
+static void leon_reboot(char *bcommand);
+static void leon_halt(void);
+static int leon_nbputchar(int c);
+static int leon_nbgetchar(void);
+
+static int no_nextnode(int node);
+static int no_child(int node);
+static int no_proplen(int node, char *name);
+static int no_getprop(int node, char *name, char *value);
+static int no_setprop(int node, char *name, char *value, int len);
+static char *no_nextprop(int node, char *name);
+
+static struct property PROM_TEXT *find_property(int node, char *name);
+static int PROM_TEXT leon_strcmp(const char *s1, const char *s2);
+static void *PROM_TEXT leon_memcpy(void *dest, const void *src, size_t n);
+static void PROM_TEXT leon_reboot_physical(char *bcommand);
+
+void __inline__ leon_flush_cache_all(void)
+{
+       __asm__ __volatile__(" flush ");
+      __asm__ __volatile__("sta %%g0, [%%g0] %0\n\t"::"i"(ASI_DFLUSH):"memory");
+}
+
+void __inline__ leon_flush_tlb_all(void)
+{
+       leon_flush_cache_all();
+       __asm__ __volatile__("sta %%g0, [%0] %1\n\t"::"r"(0x400),
+                            "i"(ASI_MMUFLUSH):"memory");
+}
+
+typedef struct {
+       unsigned int ctx_table[256];
+       unsigned int pgd_table[256];
+} sparc_srmmu_setup;
+
+sparc_srmmu_setup srmmu_tables PROM_PGT = {
+       {0},
+       {0x1e,
+        0x10001e,
+        0x20001e,
+        0x30001e,
+        0x40001e,
+        0x50001e,
+        0x60001e,
+        0x70001e,
+        0x80001e,
+        0x90001e,
+        0xa0001e,
+        0xb0001e,
+        0xc0001e,
+        0xd0001e,
+        0xe0001e,
+        0xf0001e,
+        0x100001e,
+        0x110001e,
+        0x120001e,
+        0x130001e,
+        0x140001e,
+        0x150001e,
+        0x160001e,
+        0x170001e,
+        0x180001e,
+        0x190001e,
+        0x1a0001e,
+        0x1b0001e,
+        0x1c0001e,
+        0x1d0001e,
+        0x1e0001e,
+        0x1f0001e,
+        0x200001e,
+        0x210001e,
+        0x220001e,
+        0x230001e,
+        0x240001e,
+        0x250001e,
+        0x260001e,
+        0x270001e,
+        0x280001e,
+        0x290001e,
+        0x2a0001e,
+        0x2b0001e,
+        0x2c0001e,
+        0x2d0001e,
+        0x2e0001e,
+        0x2f0001e,
+        0x300001e,
+        0x310001e,
+        0x320001e,
+        0x330001e,
+        0x340001e,
+        0x350001e,
+        0x360001e,
+        0x370001e,
+        0x380001e,
+        0x390001e,
+        0x3a0001e,
+        0x3b0001e,
+        0x3c0001e,
+        0x3d0001e,
+        0x3e0001e,
+        0x3f0001e,
+        0x400001e,
+        0x410001e,
+        0x420001e,
+        0x430001e,
+        0x440001e,
+        0x450001e,
+        0x460001e,
+        0x470001e,
+        0x480001e,
+        0x490001e,
+        0x4a0001e,
+        0x4b0001e,
+        0x4c0001e,
+        0x4d0001e,
+        0x4e0001e,
+        0x4f0001e,
+        0x500001e,
+        0x510001e,
+        0x520001e,
+        0x530001e,
+        0x540001e,
+        0x550001e,
+        0x560001e,
+        0x570001e,
+        0x580001e,
+        0x590001e,
+        0x5a0001e,
+        0x5b0001e,
+        0x5c0001e,
+        0x5d0001e,
+        0x5e0001e,
+        0x5f0001e,
+        0x600001e,
+        0x610001e,
+        0x620001e,
+        0x630001e,
+        0x640001e,
+        0x650001e,
+        0x660001e,
+        0x670001e,
+        0x680001e,
+        0x690001e,
+        0x6a0001e,
+        0x6b0001e,
+        0x6c0001e,
+        0x6d0001e,
+        0x6e0001e,
+        0x6f0001e,
+        0x700001e,
+        0x710001e,
+        0x720001e,
+        0x730001e,
+        0x740001e,
+        0x750001e,
+        0x760001e,
+        0x770001e,
+        0x780001e,
+        0x790001e,
+        0x7a0001e,
+        0x7b0001e,
+        0x7c0001e,
+        0x7d0001e,
+        0x7e0001e,
+        0x7f0001e,
+        0x800001e,
+        0x810001e,
+        0x820001e,
+        0x830001e,
+        0x840001e,
+        0x850001e,
+        0x860001e,
+        0x870001e,
+        0x880001e,
+        0x890001e,
+        0x8a0001e,
+        0x8b0001e,
+        0x8c0001e,
+        0x8d0001e,
+        0x8e0001e,
+        0x8f0001e,
+        0x900001e,
+        0x910001e,
+        0x920001e,
+        0x930001e,
+        0x940001e,
+        0x950001e,
+        0x960001e,
+        0x970001e,
+        0x980001e,
+        0x990001e,
+        0x9a0001e,
+        0x9b0001e,
+        0x9c0001e,
+        0x9d0001e,
+        0x9e0001e,
+        0x9f0001e,
+        0xa00001e,
+        0xa10001e,
+        0xa20001e,
+        0xa30001e,
+        0xa40001e,
+        0xa50001e,
+        0xa60001e,
+        0xa70001e,
+        0xa80001e,
+        0xa90001e,
+        0xaa0001e,
+        0xab0001e,
+        0xac0001e,
+        0xad0001e,
+        0xae0001e,
+        0xaf0001e,
+        0xb00001e,
+        0xb10001e,
+        0xb20001e,
+        0xb30001e,
+        0xb40001e,
+        0xb50001e,
+        0xb60001e,
+        0xb70001e,
+        0xb80001e,
+        0xb90001e,
+        0xba0001e,
+        0xbb0001e,
+        0xbc0001e,
+        0xbd0001e,
+        0xbe0001e,
+        0xbf0001e,
+        0xc00001e,
+        0xc10001e,
+        0xc20001e,
+        0xc30001e,
+        0xc40001e,
+        0xc50001e,
+        0xc60001e,
+        0xc70001e,
+        0xc80001e,
+        0xc90001e,
+        0xca0001e,
+        0xcb0001e,
+        0xcc0001e,
+        0xcd0001e,
+        0xce0001e,
+        0xcf0001e,
+        0xd00001e,
+        0xd10001e,
+        0xd20001e,
+        0xd30001e,
+        0xd40001e,
+        0xd50001e,
+        0xd60001e,
+        0xd70001e,
+        0xd80001e,
+        0xd90001e,
+        0xda0001e,
+        0xdb0001e,
+        0xdc0001e,
+        0xdd0001e,
+        0xde0001e,
+        0xdf0001e,
+        0xe00001e,
+        0xe10001e,
+        0xe20001e,
+        0xe30001e,
+        0xe40001e,
+        0xe50001e,
+        0xe60001e,
+        0xe70001e,
+        0xe80001e,
+        0xe90001e,
+        0xea0001e,
+        0xeb0001e,
+        0xec0001e,
+        0xed0001e,
+        0xee0001e,
+        0xef0001e,
+        0x400001e              /* default */
+        }
+};
+
+/* a self contained prom info structure */
+struct leon_reloc_func {
+       struct property *(*find_property) (int node, char *name);
+       int (*strcmp) (char *s1, char *s2);
+       void *(*memcpy) (void *dest, const void *src, size_t n);
+       void (*reboot_physical) (char *cmd);
+};
+
+struct leon_prom_info {
+       int freq_khz;
+       int leon_nctx;
+       int mids[32];
+       int baudrates[2];
+       struct leon_reloc_func reloc_funcs;
+       struct property root_properties[4];
+       struct property cpu_properties[7];
+#undef  CPUENTRY
+#define CPUENTRY(idx) struct property cpu_properties##idx[4]
+        CPUENTRY(1);
+        CPUENTRY(2);
+        CPUENTRY(3);
+        CPUENTRY(4);
+        CPUENTRY(5);
+        CPUENTRY(6);
+        CPUENTRY(7);
+        CPUENTRY(8);
+        CPUENTRY(9);
+        CPUENTRY(10);
+        CPUENTRY(11);
+        CPUENTRY(12);
+        CPUENTRY(13);
+        CPUENTRY(14);
+        CPUENTRY(15);
+        CPUENTRY(16);
+        CPUENTRY(17);
+        CPUENTRY(18);
+        CPUENTRY(19);
+        CPUENTRY(20);
+        CPUENTRY(21);
+        CPUENTRY(22);
+        CPUENTRY(23);
+        CPUENTRY(24);
+        CPUENTRY(25);
+        CPUENTRY(26);
+        CPUENTRY(27);
+        CPUENTRY(28);
+        CPUENTRY(29);
+        CPUENTRY(30);
+        CPUENTRY(31);
+       struct idprom idprom;
+       struct linux_nodeops nodeops;
+       struct linux_mlist_v0 *totphys_p;
+       struct linux_mlist_v0 totphys;
+       struct linux_mlist_v0 *avail_p;
+       struct linux_mlist_v0 avail;
+       struct linux_mlist_v0 *prommap_p;
+       void (*synchook) (void);
+       struct linux_arguments_v0 *bootargs_p;
+       struct linux_arguments_v0 bootargs;
+       struct linux_romvec romvec;
+       struct node nodes[35];
+       char s_device_type[12];
+       char s_cpu[4];
+       char s_mid[4];
+       char s_idprom[7];
+       char s_compatability[14];
+       char s_leon2[6];
+       char s_mmu_nctx[9];
+       char s_frequency[16];
+       char s_uart1_baud[11];
+       char s_uart2_baud[11];
+       char arg[256];
+};
+
+/* static prom info */
+static struct leon_prom_info PROM_DATA spi = {
+       CONFIG_SYS_CLK_FREQ / 1000,
+       256,
+       {
+#undef CPUENTRY
+#define        CPUENTRY(idx) idx
+        CPUENTRY(0),
+        CPUENTRY(1),
+        CPUENTRY(2),
+        CPUENTRY(3),
+        CPUENTRY(4),
+        CPUENTRY(5),
+        CPUENTRY(6),
+        CPUENTRY(7),
+        CPUENTRY(8),
+        CPUENTRY(9),
+        CPUENTRY(10),
+        CPUENTRY(11),
+        CPUENTRY(12),
+        CPUENTRY(13),
+        CPUENTRY(14),
+        CPUENTRY(15),
+        CPUENTRY(16),
+        CPUENTRY(17),
+        CPUENTRY(18),
+        CPUENTRY(19),
+        CPUENTRY(20),
+        CPUENTRY(21),
+        CPUENTRY(22),
+        CPUENTRY(23),
+        CPUENTRY(24),
+        CPUENTRY(25),
+        CPUENTRY(26),
+        CPUENTRY(27),
+        CPUENTRY(28),
+        CPUENTRY(29),
+        CPUENTRY(30),
+        31},
+       {38400, 38400},
+       {
+        __va(find_property),
+        __va(leon_strcmp),
+        __va(leon_memcpy),
+        __phy(leon_reboot_physical),
+        },
+       {
+        {__va(spi.s_device_type), __va(spi.s_idprom), 4},
+        {__va(spi.s_idprom), (char *)__va(&spi.idprom), sizeof(struct idprom)},
+        {__va(spi.s_compatability), __va(spi.s_leon2), 5},
+        {NULL, NULL, -1}
+        },
+       {
+        {__va(spi.s_device_type), __va(spi.s_cpu), 4},
+        {__va(spi.s_mid), __va(&spi.mids[0]), 4},
+        {__va(spi.s_mmu_nctx), (char *)__va(&spi.leon_nctx), 4},
+        {__va(spi.s_frequency), (char *)__va(&spi.freq_khz), 4},
+        {__va(spi.s_uart1_baud), (char *)__va(&spi.baudrates[0]), 4},
+        {__va(spi.s_uart2_baud), (char *)__va(&spi.baudrates[1]), 4},
+        {NULL, NULL, -1}
+        },
+#undef  CPUENTRY
+#define CPUENTRY(idx) \
+       { /* cpu_properties */                                          \
+               {__va(spi.s_device_type), __va(spi.s_cpu), 4},          \
+               {__va(spi.s_mid), __va(&spi.mids[idx]), 4},                     \
+               {__va(spi.s_frequency), (char *)__va(&spi.freq_khz), 4},        \
+               {NULL, NULL, -1}                                                \
+       }
+       CPUENTRY(1),
+       CPUENTRY(2),
+       CPUENTRY(3),
+       CPUENTRY(4),
+       CPUENTRY(5),
+       CPUENTRY(6),
+       CPUENTRY(7),
+       CPUENTRY(8),
+       CPUENTRY(9),
+       CPUENTRY(10),
+       CPUENTRY(11),
+       CPUENTRY(12),
+       CPUENTRY(13),
+       CPUENTRY(14),
+       CPUENTRY(15),
+       CPUENTRY(16),
+       CPUENTRY(17),
+       CPUENTRY(18),
+       CPUENTRY(19),
+       CPUENTRY(20),
+       CPUENTRY(21),
+       CPUENTRY(22),
+       CPUENTRY(23),
+       CPUENTRY(24),
+       CPUENTRY(25),
+       CPUENTRY(26),
+       CPUENTRY(27),
+       CPUENTRY(28),
+       CPUENTRY(29),
+       CPUENTRY(30),
+       CPUENTRY(31),
+       {
+        0x01,                  /* format */
+        M_LEON2 | M_LEON2_SOC, /* machine type */
+        {0, 0, 0, 0, 0, 0},    /* eth */
+        0,                     /* date */
+        0,                     /* sernum */
+        0,                     /* checksum */
+        {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}       /* reserved */
+        },
+       {
+        __va(no_nextnode),
+        __va(no_child),
+        __va(no_proplen),
+        __va(no_getprop),
+        __va(no_setprop),
+        __va(no_nextprop)
+        },
+       __va(&spi.totphys),
+       {
+        NULL,
+        (char *)CFG_SDRAM_BASE,
+        0,
+        },
+       __va(&spi.avail),
+       {
+        NULL,
+        (char *)CFG_SDRAM_BASE,
+        0,
+        },
+       NULL,                   /* prommap_p */
+       NULL,
+       __va(&spi.bootargs),
+       {
+        {NULL, __va(spi.arg), NULL /*... */ },
+        /*... */
+        },
+       {
+        0,
+        0,                     /* sun4c v0 prom */
+        0, 0,
+        {__va(&spi.totphys_p), __va(&spi.prommap_p), __va(&spi.avail_p)},
+        __va(&spi.nodeops),
+        NULL, {NULL /* ... */ },
+        NULL, NULL,
+        NULL, NULL,            /* pv_getchar, pv_putchar */
+        __va(leon_nbgetchar), __va(leon_nbputchar),
+        NULL,
+        __va(leon_reboot),
+        NULL,
+        NULL,
+        NULL,
+        __va(leon_halt),
+        __va(&spi.synchook),
+        {NULL},
+        __va(&spi.bootargs_p)
+        /*... */
+        },
+       {
+        {0, __va(spi.root_properties + 3) /* NULL, NULL, -1 */ },
+        {0, __va(spi.root_properties)},
+        /* cpu 0, must be spi.nodes[2] see leon_prom_init() */
+        {1, __va(spi.cpu_properties)},
+
+#undef  CPUENTRY
+#define CPUENTRY(idx) \
+         {1, __va(spi.cpu_properties##idx) }   /* cpu <idx> */
+        CPUENTRY(1),
+        CPUENTRY(2),
+        CPUENTRY(3),
+        CPUENTRY(4),
+        CPUENTRY(5),
+        CPUENTRY(6),
+        CPUENTRY(7),
+        CPUENTRY(8),
+        CPUENTRY(9),
+        CPUENTRY(10),
+        CPUENTRY(11),
+        CPUENTRY(12),
+        CPUENTRY(13),
+        CPUENTRY(14),
+        CPUENTRY(15),
+        CPUENTRY(16),
+        CPUENTRY(17),
+        CPUENTRY(18),
+        CPUENTRY(19),
+        CPUENTRY(20),
+        CPUENTRY(21),
+        CPUENTRY(22),
+        CPUENTRY(23),
+        CPUENTRY(24),
+        CPUENTRY(25),
+        CPUENTRY(26),
+        CPUENTRY(27),
+        CPUENTRY(28),
+        CPUENTRY(29),
+        CPUENTRY(30),
+        CPUENTRY(31),
+        {-1, __va(spi.root_properties + 3) /* NULL, NULL, -1 */ }
+        },
+       "device_type",
+       "cpu",
+       "mid",
+       "idprom",
+       "compatability",
+       "leon2",
+       "mmu-nctx",
+       "clock-frequency",
+       "uart1_baud",
+       "uart2_baud",
+       CONFIG_DEFAULT_KERNEL_COMMAND_LINE
+};
+
+/* from arch/sparc/kernel/setup.c */
+#define RAMDISK_LOAD_FLAG 0x4000
+extern unsigned short root_flags;
+extern unsigned short root_dev;
+extern unsigned short ram_flags;
+extern unsigned int sparc_ramdisk_image;
+extern unsigned int sparc_ramdisk_size;
+extern int root_mountflags;
+
+extern char initrd_end, initrd_start;
+
+/* Reboot the CPU = jump to beginning of flash again.
+ *
+ * Make sure that all function are inlined here.
+ */
+static void PROM_TEXT leon_reboot(char *bcommand)
+{
+       register char *arg = bcommand;
+       void __attribute__ ((noreturn)) (*reboot_physical) (char *cmd);
+
+       /* get physical address */
+       struct leon_prom_info *pspi =
+           (void *)(CFG_PROM_OFFSET + sizeof(srmmu_tables));
+
+       unsigned int *srmmu_ctx_table;
+
+       /* Turn of Interrupts */
+       set_pil(0xf);
+
+       /* Set kernel's context, context zero */
+       srmmu_set_context(0);
+
+       /* Get physical address of the MMU shutdown routine */
+       reboot_physical = (void *)
+           SPARC_BYPASS_READ(&pspi->reloc_funcs.reboot_physical);
+
+       /* Now that we know the physical address of the function
+        * we can make the MMU allow jumping to it.
+        */
+       srmmu_ctx_table = (unsigned int *)srmmu_get_ctable_ptr();
+
+       srmmu_ctx_table = (unsigned int *)SPARC_BYPASS_READ(srmmu_ctx_table);
+
+       /* get physical address of kernel's context table (assume ptd) */
+       srmmu_ctx_table = (unsigned int *)
+           (((unsigned int)srmmu_ctx_table & 0xfffffffc) << 4);
+
+       /* enable access to physical address of MMU shutdown function */
+       SPARC_BYPASS_WRITE(&srmmu_ctx_table
+                          [((unsigned int)reboot_physical) >> 24],
+                          (((unsigned int)reboot_physical & 0xff000000) >> 4) |
+                          0x1e);
+
+       /* flush TLB cache */
+       leon_flush_tlb_all();
+
+       /* flash instruction & data cache */
+       sparc_icache_flush_all();
+       sparc_dcache_flush_all();
+
+       /* jump to physical address function
+        * so that when the MMU is disabled
+        * we can continue to execute
+        */
+       reboot_physical(arg);
+}
+
+static void PROM_TEXT leon_reboot_physical(char *bcommand)
+{
+       void __attribute__ ((noreturn)) (*reset) (void);
+
+       /* Turn off MMU */
+       srmmu_set_mmureg(0);
+
+       /* Hardcoded start address */
+       reset = CFG_MONITOR_BASE;
+
+       /* flush data cache */
+       sparc_dcache_flush_all();
+
+       /* flush instruction cache */
+       sparc_icache_flush_all();
+
+       /* Jump to start in Flash */
+       reset();
+}
+
+static void PROM_TEXT leon_halt(void)
+{
+       while (1) ;
+}
+
+/* get single char, don't care for blocking*/
+static int PROM_TEXT leon_nbgetchar(void)
+{
+       return -1;
+}
+
+/* put single char, don't care for blocking*/
+static int PROM_TEXT leon_nbputchar(int c)
+{
+       LEON2_regs *leon2 = (LEON2_regs *) LEON2_PREGS;
+
+       /***** put char in buffer... ***********
+        * Make sure all functions are inline! *
+        ***************************************/
+
+       /* Wait for last character to go. */
+       while (!(SPARC_BYPASS_READ(&leon2->UART_Status_1)
+                & LEON2_UART_STAT_THE)) ;
+
+       /* Send data */
+       SPARC_BYPASS_WRITE(&leon2->UART_Channel_1, c);
+
+       /* Wait for data to be sent */
+       while (!(SPARC_BYPASS_READ(&leon2->UART_Status_1)
+                & LEON2_UART_STAT_TSE)) ;
+
+       return 0;
+}
+
+/* node ops */
+
+/*#define nodes ((struct node *)__va(&pspi->nodes))*/
+#define nodes ((struct node *)(pspi->nodes))
+
+static int PROM_TEXT no_nextnode(int node)
+{
+       /* get physical address */
+       struct leon_prom_info *pspi =
+           (void *)(CFG_PROM_OFFSET + sizeof(srmmu_tables));
+
+       /* convert into virtual address */
+       pspi = (struct leon_prom_info *)
+           (((unsigned int)pspi & 0x0fffffff) | PAGE_OFFSET);
+
+       if (nodes[node].level == nodes[node + 1].level)
+               return node + 1;
+       return -1;
+}
+
+static int PROM_TEXT no_child(int node)
+{
+       /* get physical address */
+       struct leon_prom_info *pspi = (struct leon_prom_info *)
+           (CFG_PROM_OFFSET + sizeof(srmmu_tables));
+
+       /* convert into virtual address */
+       pspi = (struct leon_prom_info *)
+           (((unsigned int)pspi & 0x0fffffff) | PAGE_OFFSET);
+
+       if (nodes[node].level == nodes[node + 1].level - 1)
+               return node + 1;
+       return -1;
+}
+
+static struct property PROM_TEXT *find_property(int node, char *name)
+{
+       /* get physical address */
+       struct leon_prom_info *pspi = (struct leon_prom_info *)
+           (CFG_PROM_OFFSET + sizeof(srmmu_tables));
+
+       /* convert into virtual address */
+       pspi = (struct leon_prom_info *)
+           (((unsigned int)pspi & 0x0fffffff) | PAGE_OFFSET);
+
+       struct property *prop = &nodes[node].properties[0];
+       while (prop && prop->name) {
+               if (pspi->reloc_funcs.strcmp(prop->name, name) == 0)
+                       return prop;
+               prop++;
+       }
+       return NULL;
+}
+
+static int PROM_TEXT no_proplen(int node, char *name)
+{
+       /* get physical address */
+       struct leon_prom_info *pspi = (struct leon_prom_info *)
+           (CFG_PROM_OFFSET + sizeof(srmmu_tables));
+
+       /* convert into virtual address */
+       pspi = (struct leon_prom_info *)
+           (((unsigned int)pspi & 0x0fffffff) | PAGE_OFFSET);
+
+       struct property *prop = pspi->reloc_funcs.find_property(node, name);
+       if (prop)
+               return prop->length;
+       return -1;
+}
+
+static int PROM_TEXT no_getprop(int node, char *name, char *value)
+{
+       /* get physical address */
+       struct leon_prom_info *pspi = (struct leon_prom_info *)
+           (CFG_PROM_OFFSET + sizeof(srmmu_tables));
+
+       /* convert into virtual address */
+       pspi = (struct leon_prom_info *)
+           (((unsigned int)pspi & 0x0fffffff) | PAGE_OFFSET);
+
+       struct property *prop = pspi->reloc_funcs.find_property(node, name);
+       if (prop) {
+               pspi->reloc_funcs.memcpy(value, prop->value, prop->length);
+               return 1;
+       }
+       return -1;
+}
+
+static int PROM_TEXT no_setprop(int node, char *name, char *value, int len)
+{
+       return -1;
+}
+
+static char PROM_TEXT *no_nextprop(int node, char *name)
+{
+       /* get physical address */
+       struct leon_prom_info *pspi = (struct leon_prom_info *)
+           (CFG_PROM_OFFSET + sizeof(srmmu_tables));
+       struct property *prop;
+
+       /* convert into virtual address */
+       pspi = (struct leon_prom_info *)
+           (((unsigned int)pspi & 0x0fffffff) | PAGE_OFFSET);
+
+       if (!name || !name[0])
+               return nodes[node].properties[0].name;
+
+       prop = pspi->reloc_funcs.find_property(node, name);
+       if (prop)
+               return prop[1].name;
+       return NULL;
+}
+
+static int PROM_TEXT leon_strcmp(const char *s1, const char *s2)
+{
+       register char result;
+
+       while (1) {
+               result = *s1 - *s2;
+               if (result || !*s1)
+                       break;
+               s2++;
+               s1++;
+       }
+
+       return result;
+}
+
+static void *PROM_TEXT leon_memcpy(void *dest, const void *src, size_t n)
+{
+       char *dst = (char *)dest, *source = (char *)src;
+
+       while (n--) {
+               *dst = *source;
+               dst++;
+               source++;
+       }
+       return dest;
+}
+
+#define GETREGSP(sp) __asm__ __volatile__("mov %%sp, %0" : "=r" (sp))
+
+void leon_prom_init(struct leon_prom_info *pspi)
+{
+       unsigned long i;
+       unsigned char cksum, *ptr;
+       char *addr_str, *end;
+       unsigned long sp;
+       GETREGSP(sp);
+
+       pspi->freq_khz = CONFIG_SYS_CLK_FREQ / 1000;
+
+       /* Set Available main memory size */
+       pspi->totphys.num_bytes = CFG_PROM_OFFSET - CFG_SDRAM_BASE;
+       pspi->avail.num_bytes = pspi->totphys.num_bytes;
+
+#undef nodes
+       pspi->nodes[3].level = -1;
+       pspi->nodes[3].properties = __va(spi.root_properties + 3);
+
+       /* Set Ethernet MAC address from environment */
+       if ((addr_str = getenv("ethaddr")) != NULL) {
+               for (i = 0; i < 6; i++) {
+                       pspi->idprom.id_ethaddr[i] = addr_str ?
+                           simple_strtoul(addr_str, &end, 16) : 0;
+                       if (addr_str) {
+                               addr_str = (*end) ? end + 1 : end;
+                       }
+               }
+       } else {
+               /* HW Address not found in environment,
+                * Set default HW address
+                */
+               pspi->idprom.id_ethaddr[0] = 0;
+               pspi->idprom.id_ethaddr[1] = 0;
+               pspi->idprom.id_ethaddr[2] = 0;
+               pspi->idprom.id_ethaddr[3] = 0;
+               pspi->idprom.id_ethaddr[4] = 0;
+               pspi->idprom.id_ethaddr[5] = 0;
+       }
+
+       ptr = (unsigned char *)&pspi->idprom;
+       for (i = cksum = 0; i <= 0x0E; i++)
+               cksum ^= *ptr++;
+       pspi->idprom.id_cksum = cksum;
+}
+
+static inline void set_cache(unsigned long regval)
+{
+       asm volatile ("sta %0, [%%g0] %1\n\t":: "r" (regval), "i"(2):"memory");
+}
+
+extern unsigned short bss_start, bss_end;
+
+/* mark as section .img.main.text, to be referenced in linker script */
+int prom_init(void)
+{
+       struct leon_prom_info *pspi = (void *)
+           ((((unsigned int)&spi) & PROM_SIZE_MASK) + CFG_PROM_OFFSET);
+
+       /* disable mmu */
+       srmmu_set_mmureg(0x00000000);
+       __asm__ __volatile__("flush\n\t");
+
+       /* init prom info struct */
+       leon_prom_init(pspi);
+
+       kernel_arg_promvec = &pspi->romvec;
+#ifdef PRINT_ROM_VEC
+       printf("Kernel rom vec: 0x%lx\n", (unsigned int)(&pspi->romvec));
+#endif
+       return 0;
+}
+
+/* Copy current kernel boot argument to ROMvec */
+void prepare_bootargs(char *bootargs)
+{
+       struct leon_prom_info *pspi;
+       char *src, *dst;
+       int left;
+
+       /* if no bootargs set, skip copying ==> default bootline */
+       if (bootargs && (*bootargs != '\0')) {
+               pspi = (void *)((((unsigned int)&spi) & PROM_SIZE_MASK) +
+                               CFG_PROM_OFFSET);
+               src = bootargs;
+               dst = &pspi->arg[0];
+               left = 255;     /* max len */
+               while (*src && left > 0) {
+                       *dst++ = *src++;
+                       left--;
+               }
+               /* terminate kernel command line string */
+               *dst = 0;
+       }
+}
+
+void srmmu_init_cpu(unsigned int entry)
+{
+       sparc_srmmu_setup *psrmmu_tables = (void *)
+           ((((unsigned int)&srmmu_tables) & PROM_SIZE_MASK) +
+            CFG_PROM_OFFSET);
+
+       /* Make context 0 (kernel's context) point
+        * to our prepared memory mapping
+        */
+#define PTD 1
+       psrmmu_tables->ctx_table[0] =
+           ((unsigned int)&psrmmu_tables->pgd_table[0x00]) >> 4 | PTD;
+
+       /* Set virtual kernel address 0xf0000000
+        * to SRAM/SDRAM address.
+        * Make it READ/WRITE/EXEC to SuperUser
+        */
+#define PTE 2
+#define ACC_SU_ALL 0x1c
+       psrmmu_tables->pgd_table[0xf0] =
+           (CFG_SDRAM_BASE >> 4) | ACC_SU_ALL | PTE;
+       psrmmu_tables->pgd_table[0xf1] =
+           ((CFG_SDRAM_BASE + 0x1000000) >> 4) | ACC_SU_ALL | PTE;
+       psrmmu_tables->pgd_table[0xf2] =
+           ((CFG_SDRAM_BASE + 0x2000000) >> 4) | ACC_SU_ALL | PTE;
+       psrmmu_tables->pgd_table[0xf3] =
+           ((CFG_SDRAM_BASE + 0x3000000) >> 4) | ACC_SU_ALL | PTE;
+       psrmmu_tables->pgd_table[0xf4] =
+           ((CFG_SDRAM_BASE + 0x4000000) >> 4) | ACC_SU_ALL | PTE;
+       psrmmu_tables->pgd_table[0xf5] =
+           ((CFG_SDRAM_BASE + 0x5000000) >> 4) | ACC_SU_ALL | PTE;
+       psrmmu_tables->pgd_table[0xf6] =
+           ((CFG_SDRAM_BASE + 0x6000000) >> 4) | ACC_SU_ALL | PTE;
+       psrmmu_tables->pgd_table[0xf7] =
+           ((CFG_SDRAM_BASE + 0x7000000) >> 4) | ACC_SU_ALL | PTE;
+
+       /* convert rom vec pointer to virtual address */
+       kernel_arg_promvec = (struct linux_romvec *)
+           (((unsigned int)kernel_arg_promvec & 0x0fffffff) | 0xf0000000);
+
+       /* Set Context pointer to point to context table
+        * 256 contexts supported.
+        */
+       srmmu_set_ctable_ptr((unsigned int)&psrmmu_tables->ctx_table[0]);
+
+       /* Set kernel's context, context zero */
+       srmmu_set_context(0);
+
+       /* Invalidate all Cache */
+       __asm__ __volatile__("flush\n\t");
+
+       srmmu_set_mmureg(0x00000001);
+       leon_flush_tlb_all();
+       leon_flush_cache_all();
+}
diff --git a/cpu/leon2/serial.c b/cpu/leon2/serial.c
new file mode 100644 (file)
index 0000000..ce9457f
--- /dev/null
@@ -0,0 +1,165 @@
+/* GRLIB APBUART Serial controller driver
+ *
+ * (C) Copyright 2008
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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/processor.h>
+#include <asm/leon.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/* Force cache miss each time a serial controller reg is read */
+#define CACHE_BYPASS 1
+
+#ifdef CACHE_BYPASS
+#define READ_BYTE(var)  SPARC_NOCACHE_READ_BYTE((unsigned int)&(var))
+#define READ_HWORD(var) SPARC_NOCACHE_READ_HWORD((unsigned int)&(var))
+#define READ_WORD(var)  SPARC_NOCACHE_READ((unsigned int)&(var))
+#define READ_DWORD(var) SPARC_NOCACHE_READ_DWORD((unsigned int)&(var))
+#endif
+
+int serial_init(void)
+{
+       LEON2_regs *leon2 = (LEON2_regs *) LEON2_PREGS;
+       LEON2_Uart_regs *regs;
+       unsigned int tmp;
+
+       /* Init LEON2 UART
+        *
+        * Set scaler / baud rate
+        *
+        * Receiver & transmitter enable
+        */
+#if LEON2_CONSOLE_SELECT == LEON_CONSOLE_UART1
+       regs = (LEON2_Uart_regs *) & leon2->UART_Channel_1;
+#else
+       regs = (LEON2_Uart_regs *) & leon2->UART_Channel_2;
+#endif
+
+       regs->UART_Scaler = CFG_LEON2_UART1_SCALER;
+
+       /* Let bit 11 be unchanged (debug bit for GRMON) */
+       tmp = READ_WORD(regs->UART_Control);
+
+       regs->UART_Control = ((tmp & LEON2_UART_CTRL_DBG) |
+                             (LEON2_UART1_LOOPBACK_ENABLE << 7) |
+                             (LEON2_UART1_FLOWCTRL_ENABLE << 6) |
+                             (LEON2_UART1_PARITY_ENABLE << 5) |
+                             (LEON2_UART1_ODDPAR_ENABLE << 4) |
+                             LEON2_UART_CTRL_RE | LEON2_UART_CTRL_TE);
+
+       return 0;
+}
+
+void serial_putc(const char c)
+{
+       if (c == '\n')
+               serial_putc_raw('\r');
+
+       serial_putc_raw(c);
+}
+
+void serial_putc_raw(const char c)
+{
+       LEON2_regs *leon2 = (LEON2_regs *) LEON2_PREGS;
+       LEON2_Uart_regs *regs;
+
+#if LEON2_CONSOLE_SELECT == LEON_CONSOLE_UART1
+       regs = (LEON2_Uart_regs *) & leon2->UART_Channel_1;
+#else
+       regs = (LEON2_Uart_regs *) & leon2->UART_Channel_2;
+#endif
+
+       /* Wait for last character to go. */
+       while (!(READ_WORD(regs->UART_Status) & LEON2_UART_STAT_THE)) ;
+
+       /* Send data */
+       regs->UART_Channel = c;
+
+#ifdef LEON_DEBUG
+       /* Wait for data to be sent */
+       while (!(READ_WORD(regs->UART_Status) & LEON2_UART_STAT_TSE)) ;
+#endif
+}
+
+void serial_puts(const char *s)
+{
+       while (*s) {
+               serial_putc(*s++);
+       }
+}
+
+int serial_getc(void)
+{
+       LEON2_regs *leon2 = (LEON2_regs *) LEON2_PREGS;
+       LEON2_Uart_regs *regs;
+
+#if LEON2_CONSOLE_SELECT == LEON_CONSOLE_UART1
+       regs = (LEON2_Uart_regs *) & leon2->UART_Channel_1;
+#else
+       regs = (LEON2_Uart_regs *) & leon2->UART_Channel_2;
+#endif
+
+       /* Wait for a character to arrive. */
+       while (!(READ_WORD(regs->UART_Status) & LEON2_UART_STAT_DR)) ;
+
+       /* read data */
+       return READ_WORD(regs->UART_Channel);
+}
+
+int serial_tstc(void)
+{
+       LEON2_regs *leon2 = (LEON2_regs *) LEON2_PREGS;
+       LEON2_Uart_regs *regs;
+
+#if LEON2_CONSOLE_SELECT == LEON_CONSOLE_UART1
+       regs = (LEON2_Uart_regs *) & leon2->UART_Channel_1;
+#else
+       regs = (LEON2_Uart_regs *) & leon2->UART_Channel_2;
+#endif
+
+       return (READ_WORD(regs->UART_Status) & LEON2_UART_STAT_DR);
+}
+
+/* set baud rate for uart */
+void serial_setbrg(void)
+{
+       /* update baud rate settings, read it from gd->baudrate */
+       unsigned int scaler;
+       LEON2_regs *leon2 = (LEON2_regs *) LEON2_PREGS;
+       LEON2_Uart_regs *regs;
+
+#if LEON2_CONSOLE_SELECT == LEON_CONSOLE_UART1
+       regs = (LEON2_Uart_regs *) & leon2->UART_Channel_1;
+#else
+       regs = (LEON2_Uart_regs *) & leon2->UART_Channel_2;
+#endif
+
+       if (gd->baudrate > 0) {
+               scaler =
+                   (((CONFIG_SYS_CLK_FREQ * 10) / (gd->baudrate * 8)) -
+                    5) / 10;
+               regs->UART_Scaler = scaler;
+       }
+}
diff --git a/cpu/leon2/start.S b/cpu/leon2/start.S
new file mode 100644 (file)
index 0000000..60d3fad
--- /dev/null
@@ -0,0 +1,661 @@
+/* This is where the SPARC/LEON3 starts
+ * Copyright (C) 2007,
+ * Daniel Hellstrom, daniel@gaisler.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 <asm/asmmacro.h>
+#include <asm/winmacro.h>
+#include <asm/psr.h>
+#include <asm/stack.h>
+#include <asm/leon.h>
+#include <version.h>
+
+/* Entry for traps which jump to a programmer-specified trap handler.  */
+#define TRAPR(H)  \
+       wr      %g0, 0xfe0, %psr; \
+       mov     %g0, %tbr; \
+       ba      (H); \
+       mov     %g0, %wim;
+
+#define TRAP(H) \
+       mov     %psr, %l0; \
+       ba      (H); \
+       nop; nop;
+
+#define TRAPI(ilevel) \
+       mov     ilevel, %l7; \
+       mov     %psr, %l0; \
+       b       _irq_entry; \
+       mov     %wim, %l3
+
+/* Unexcpected trap will halt the processor by forcing it to error state */
+#undef BAD_TRAP
+#define BAD_TRAP ta 0; nop; nop; nop;
+
+/* Software trap. Treat as BAD_TRAP for the time being... */
+#define SOFT_TRAP TRAP(_hwerr)
+
+#define PSR_INIT   0x1FC0      /* Disable traps, set s and ps */
+#define WIM_INIT   2
+
+/* All traps low-level code here must end with this macro. */
+#define RESTORE_ALL b ret_trap_entry; clr %l6;
+
+#define WRITE_PAUSE nop;nop;nop
+
+WINDOWSIZE = (16 * 4)
+ARGPUSHSIZE = (6 * 4)
+ARGPUSH = (WINDOWSIZE + 4)
+MINFRAME = (WINDOWSIZE + ARGPUSHSIZE + 4)
+
+/* Number of register windows */
+#ifndef CFG_SPARC_NWINDOWS
+#error Must define number of SPARC register windows, default is 8
+#endif
+
+#define STACK_ALIGN    8
+#define SA(X)  (((X)+(STACK_ALIGN-1)) & ~(STACK_ALIGN-1))
+
+       .section ".start", "ax"
+       .globl  _start, start, _trap_table
+       .globl  _irq_entry, nmi_trap
+       .globl  _reset_reloc
+
+/* at address 0
+ * Hardware traps
+ */
+start:
+_start:
+_trap_table:
+       TRAPR(_hardreset);              ! 00 reset trap
+       BAD_TRAP;                       ! 01 instruction_access_exception
+       BAD_TRAP;                       ! 02 illegal_instruction
+       BAD_TRAP;                       ! 03 priveleged_instruction
+       BAD_TRAP;                       ! 04 fp_disabled
+       TRAP(_window_overflow);         ! 05 window_overflow
+       TRAP(_window_underflow);        ! 06 window_underflow
+       BAD_TRAP;                       ! 07 Memory Address Not Aligned
+       BAD_TRAP;                       ! 08 Floating Point Exception
+       BAD_TRAP;                       ! 09 Data Miss Exception
+       BAD_TRAP;                       ! 0a Tagged Instruction Ovrflw
+       BAD_TRAP;                       ! 0b Watchpoint Detected
+       BAD_TRAP;                       ! 0c
+       BAD_TRAP;                       ! 0d
+       BAD_TRAP;                       ! 0e
+       BAD_TRAP;                       ! 0f
+       BAD_TRAP;                       ! 10
+       TRAPI(1);                       ! 11 IRQ level 1
+       TRAPI(2);                       ! 12 IRQ level 2
+       TRAPI(3);                       ! 13 IRQ level 3
+       TRAPI(4);                       ! 14 IRQ level 4
+       TRAPI(5);                       ! 15 IRQ level 5
+       TRAPI(6);                       ! 16 IRQ level 6
+       TRAPI(7);                       ! 17 IRQ level 7
+       TRAPI(8);                       ! 18 IRQ level 8
+       TRAPI(9);                       ! 19 IRQ level 9
+       TRAPI(10);                      ! 1a IRQ level 10
+       TRAPI(11);                      ! 1b IRQ level 11
+       TRAPI(12);                      ! 1c IRQ level 12
+       TRAPI(13);                      ! 1d IRQ level 13
+       TRAPI(14);                      ! 1e IRQ level 14
+       TRAP(_nmi_trap);                ! 1f IRQ level 15 /
+                                       ! NMI (non maskable interrupt)
+       BAD_TRAP;                       ! 20 r_register_access_error
+       BAD_TRAP;                       ! 21 instruction access error
+       BAD_TRAP;                       ! 22
+       BAD_TRAP;                       ! 23
+       BAD_TRAP;                       ! 24 co-processor disabled
+       BAD_TRAP;                       ! 25 uniplemented FLUSH
+       BAD_TRAP;                       ! 26
+       BAD_TRAP;                       ! 27
+       BAD_TRAP;                       ! 28 co-processor exception
+       BAD_TRAP;                       ! 29 data access error
+       BAD_TRAP;                       ! 2a division by zero
+       BAD_TRAP;                       ! 2b data store error
+       BAD_TRAP;                       ! 2c data access MMU miss
+       BAD_TRAP;                       ! 2d
+       BAD_TRAP;                       ! 2e
+       BAD_TRAP;                       ! 2f
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 30-33
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 34-37
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 38-3b
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 3c-3f
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 40-43
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 44-47
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 48-4b
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 4c-4f
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 50-53
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 54-57
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 58-5b
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 5c-5f
+
+       /* implementaion dependent */
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 60-63
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 64-67
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 68-6b
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 6c-6f
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 70-73
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 74-77
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 78-7b
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 7c-7f
+
+       /* Software traps, not handled */
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! 80-83
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! 84-87
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! 88-8b
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! 8c-8f
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! 90-93
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! 94-97
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! 98-9b
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! 9c-9f
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! a0-a3
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! a4-a7
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! a8-ab
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! ac-af
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! b0-b3
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! b4-b7
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! b8-bb
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! bc-bf
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! c0-c3
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! c4-c7
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! c8-cb
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! cc-cf
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! d0-d3
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! d4-d7
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! d8-db
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! dc-df
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! e0-e3
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! e4-e7
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! e8-eb
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! ec-ef
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! f0-f3
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! f4-f7
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! f8-fb
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! fc-ff
+/*
+ * Version string
+ */
+
+       .data
+       .globl  version_string
+version_string:
+       .ascii U_BOOT_VERSION
+       .ascii " (", __DATE__, " - ", __TIME__, ")"
+       .ascii CONFIG_IDENT_STRING, "\0"
+
+       .section        ".text"
+       .align 4
+
+_hardreset:
+1000:
+       flush
+       nop
+       nop
+       nop
+
+       /* Init Cache */
+       set     (LEON2_PREGS+LEON_REG_CACHECTRL_OFFSET), %g1
+       set     0x0081000f, %g2
+       st      %g2, [%g1]
+
+       mov     %g0, %y
+       clr     %g1
+       clr     %g2
+       clr     %g3
+       clr     %g4
+       clr     %g5
+       clr     %g6
+       clr     %g7
+
+       mov     %asr17, %g3
+       and     %g3, 0x1f, %g3
+clear_window:
+       mov     %g0, %l0
+       mov     %g0, %l1
+       mov     %g0, %l2
+       mov     %g0, %l3
+       mov     %g0, %l4
+       mov     %g0, %l5
+       mov     %g0, %l6
+       mov     %g0, %l7
+       mov     %g0, %o0
+       mov     %g0, %o1
+       mov     %g0, %o2
+       mov     %g0, %o3
+       mov     %g0, %o4
+       mov     %g0, %o5
+       mov     %g0, %o6
+       mov     %g0, %o7
+       subcc   %g3, 1, %g3
+       bge     clear_window
+       save
+
+leon2_init:
+       /* LEON2 Register Base in g1 */
+       set     LEON2_PREGS, %g1
+
+leon2_init_cache:
+       /* Set Cache control register */
+       set     0x1000f, %g2
+       st      %g2, [%g1 + 0x14]
+
+leon2_init_clear:
+
+       /* Clear LEON2 registers */
+       st      %g0, [%g1 + LEON2_ECTRL]
+       st      %g0, [%g1 + LEON2_IMASK]
+       st      %g0, [%g1 + LEON2_IPEND]
+       st      %g0, [%g1 + LEON2_IFORCE]
+       st      %g0, [%g1 + LEON2_ICLEAR]
+       st      %g0, [%g1 + LEON2_IOREG]
+       st      %g0, [%g1 + LEON2_IODIR]
+       st      %g0, [%g1 + LEON2_IOICONF]
+       st      %g0, [%g1 + LEON2_UCTRL0]
+       st      %g0, [%g1 + LEON2_UCTRL1]
+
+leon2_init_ioport:
+       /* I/O port initialization */
+       set     0xaa00, %g2
+       st      %g2, [%g1 + LEON2_IOREG]
+
+leon2_init_mctrl:
+
+       /* memory config register 1 */
+       set     CFG_GRLIB_MEMCFG1, %g2
+       ld      [%g1], %g3              !
+       and     %g3, 0x300, %g3
+       or      %g2, %g3, %g2
+       st      %g2, [%g1 + LEON2_MCFG1]
+       set     CFG_GRLIB_MEMCFG2, %g2          ! Load memory config register 2
+#if !( defined(TSIM) || !defined(BZIMAGE))
+       st      %g2, [%g1 + LEON2_MCFG2]        ! only for prom version, else done by "dumon -i"
+#endif
+       set     CFG_GRLIB_MEMCFG3, %g2          ! Init FT register
+       st      %g2, [%g1 + LEON2_ECTRL]
+       ld      [%g1 + LEON2_ECTRL], %g2
+       srl     %g2, 30, %g2
+       andcc   %g2, 3, %g6
+       bne,a   leon2_init_wim
+       mov     %g0, %asr16             ! clear err_reg
+
+leon2_init_wim:
+       set     WIM_INIT, %g3
+       mov     %g3, %wim
+
+leon2_init_psr:
+       set     0x1000, %g3
+       mov     %psr, %g2
+       wr      %g2, %g3, %psr
+       nop
+       nop
+       nop
+
+leon2_init_stackp:
+       set     CFG_INIT_SP_OFFSET, %fp
+       andn    %fp, 0x0f, %fp
+       sub     %fp, 64, %sp
+
+cpu_init_unreloc:
+       call    cpu_init_f
+       nop
+
+/* un relocated start address of monitor */
+#define TEXT_START _text
+
+/* un relocated end address of monitor */
+#define DATA_END __init_end
+
+reloc:
+       set     TEXT_START,%g2
+       set     DATA_END,%g3
+       set     CFG_RELOC_MONITOR_BASE,%g4
+reloc_loop:
+       ldd     [%g2],%l0
+       ldd     [%g2+8],%l2
+       std     %l0,[%g4]
+       std     %l2,[%g4+8]
+       inc     16,%g2
+       subcc   %g3,%g2,%g0
+       bne     reloc_loop
+       inc     16,%g4
+
+       clr     %l0
+       clr     %l1
+       clr     %l2
+       clr     %l3
+       clr     %g2
+
+/* register g4 contain address to start
+ * This means that BSS must be directly after data and code segments
+ *
+ * g3 is length of bss = (__bss_end-__bss_start)
+ *
+ */
+
+clr_bss:
+/* clear bss area (the relocated) */
+       set     __bss_start,%g2
+       set     __bss_end,%g3
+       sub     %g3,%g2,%g3
+       add     %g3,%g4,%g3
+       clr     %g1     /* std %g0 uses g0 and g1 */
+/* clearing 16byte a time ==> linker script need to align to 16 byte offset */
+clr_bss_16:
+       std     %g0,[%g4]
+       std     %g0,[%g4+8]
+       inc     16,%g4
+       cmp     %g3,%g4
+       bne     clr_bss_16
+       nop
+
+/* add offsets to GOT table */
+fixup_got:
+       set     __got_start,%g4
+       set     __got_end,%g3
+/*
+ * new got offset = (old GOT-PTR (read with ld) -
+ *   CFG_RELOC_MONITOR_BASE(from define) ) +
+ *   Destination Address (from define)
+ */
+       set     CFG_RELOC_MONITOR_BASE,%g2
+       set     TEXT_START, %g1
+       add     %g4,%g2,%g4
+       sub     %g4,%g1,%g4
+       add     %g3,%g2,%g3
+       sub     %g3,%g1,%g3
+       sub     %g2,%g1,%g2     ! prepare register with (new base address) -
+                               !  (old base address)
+got_loop:
+       ld      [%g4],%l0       ! load old GOT-PTR
+       add     %l0,%g2,%l0     ! increase with (new base address) -
+                               !  (old base)
+       st      %l0,[%g4]
+       inc     4,%g4
+       cmp     %g3,%g4
+       bne     got_loop
+       nop
+
+prom_relocate:
+       set     __prom_start, %g2
+       set     __prom_end, %g3
+       set     CFG_PROM_OFFSET, %g4
+
+prom_relocate_loop:
+       ldd     [%g2],%l0
+       ldd     [%g2+8],%l2
+       std     %l0,[%g4]
+       std     %l2,[%g4+8]
+       inc     16,%g2
+       subcc   %g3,%g2,%g0
+       bne     prom_relocate_loop
+       inc     16,%g4
+
+/* Trap table has been moved, lets tell CPU about
+ * the new trap table address
+ */
+
+       set     CFG_RELOC_MONITOR_BASE, %g2
+       wr      %g0, %g2, %tbr
+
+/*     call    relocate*/
+       nop
+/* Call relocated init functions */
+jump:
+       set     cpu_init_f2,%o1
+       set     CFG_RELOC_MONITOR_BASE,%o2
+       add     %o1,%o2,%o1
+       sub     %o1,%g1,%o1
+       call    %o1
+       clr     %o0
+
+       set     board_init_f,%o1
+       set     CFG_RELOC_MONITOR_BASE,%o2
+       add     %o1,%o2,%o1
+       sub     %o1,%g1,%o1
+       call    %o1
+       clr     %o0
+
+dead:  ta 0                            ! if call returns...
+       nop
+
+/* Interrupt handler caller,
+ * reg L7: interrupt number
+ * reg L0: psr after interrupt
+ * reg L1: PC
+ * reg L2: next PC
+ * reg L3: wim
+ */
+_irq_entry:
+       SAVE_ALL
+
+       or      %l0, PSR_PIL, %g2
+       wr      %g2, 0x0, %psr
+       WRITE_PAUSE
+       wr      %g2, PSR_ET, %psr
+       WRITE_PAUSE
+       mov     %l7, %o0                ! irq level
+       set     handler_irq, %o1
+       set     (CFG_RELOC_MONITOR_BASE-TEXT_BASE), %o2
+       add     %o1, %o2, %o1
+       call    %o1
+       add     %sp, SF_REGS_SZ, %o1    ! pt_regs ptr
+       or      %l0, PSR_PIL, %g2       ! restore PIL after handler_irq
+       wr      %g2, PSR_ET, %psr       ! keep ET up
+       WRITE_PAUSE
+
+       RESTORE_ALL
+
+!Window overflow trap handler.
+       .global _window_overflow
+
+_window_overflow:
+
+       mov     %wim, %l3               ! Calculate next WIM
+       mov     %g1, %l7
+       srl     %l3, 1, %g1
+       sll     %l3, (CFG_SPARC_NWINDOWS-1) , %l4
+       or      %l4, %g1, %g1
+
+       save                            ! Get into window to be saved.
+       mov     %g1, %wim
+       nop;
+       nop;
+       nop
+       st      %l0, [%sp + 0];
+       st      %l1, [%sp + 4];
+       st      %l2, [%sp + 8];
+       st      %l3, [%sp + 12];
+       st      %l4, [%sp + 16];
+       st      %l5, [%sp + 20];
+       st      %l6, [%sp + 24];
+       st      %l7, [%sp + 28];
+       st      %i0, [%sp + 32];
+       st      %i1, [%sp + 36];
+       st      %i2, [%sp + 40];
+       st      %i3, [%sp + 44];
+       st      %i4, [%sp + 48];
+       st      %i5, [%sp + 52];
+       st      %i6, [%sp + 56];
+       st      %i7, [%sp + 60];
+       restore                         ! Go back to trap window.
+       mov     %l7, %g1
+       jmp     %l1                     ! Re-execute save.
+       rett    %l2
+
+/* Window underflow trap handler.  */
+
+       .global  _window_underflow
+
+_window_underflow:
+
+       mov  %wim, %l3                  ! Calculate next WIM
+       sll  %l3, 1, %l4
+       srl  %l3, (CFG_SPARC_NWINDOWS-1), %l5
+       or   %l5, %l4, %l5
+       mov  %l5, %wim
+       nop; nop; nop
+       restore                         ! Two restores to get into the
+       restore                         ! window to restore
+       ld      [%sp + 0], %l0;         ! Restore window from the stack
+       ld      [%sp + 4], %l1;
+       ld      [%sp + 8], %l2;
+       ld      [%sp + 12], %l3;
+       ld      [%sp + 16], %l4;
+       ld      [%sp + 20], %l5;
+       ld      [%sp + 24], %l6;
+       ld      [%sp + 28], %l7;
+       ld      [%sp + 32], %i0;
+       ld      [%sp + 36], %i1;
+       ld      [%sp + 40], %i2;
+       ld      [%sp + 44], %i3;
+       ld      [%sp + 48], %i4;
+       ld      [%sp + 52], %i5;
+       ld      [%sp + 56], %i6;
+       ld      [%sp + 60], %i7;
+       save                            ! Get back to the trap window.
+       save
+       jmp     %l1                     ! Re-execute restore.
+       rett    %l2
+
+       retl
+
+_nmi_trap:
+       nop
+       jmp %l1
+       rett %l2
+
+_hwerr:
+       ta 0
+       nop
+       nop
+       b _hwerr                        ! loop infinite
+       nop
+
+/* Registers to not touch at all. */
+#define t_psr      l0 /* Set by caller */
+#define t_pc       l1 /* Set by caller */
+#define t_npc      l2 /* Set by caller */
+#define t_wim      l3 /* Set by caller */
+#define t_twinmask l4 /* Set at beginning of this entry routine. */
+#define t_kstack   l5 /* Set right before pt_regs frame is built */
+#define t_retpc    l6 /* If you change this, change winmacro.h header file */
+#define t_systable l7 /* Never touch this, could be the syscall table ptr. */
+#define curptr     g6 /* Set after pt_regs frame is built */
+
+trap_setup:
+/* build a pt_regs trap frame. */
+       sub     %fp, (SF_REGS_SZ + PT_REGS_SZ), %t_kstack
+       PT_STORE_ALL(t_kstack, t_psr, t_pc, t_npc, g2)
+
+       /* See if we are in the trap window. */
+       mov     1, %t_twinmask
+       sll     %t_twinmask, %t_psr, %t_twinmask ! t_twinmask = (1 << psr)
+       andcc   %t_twinmask, %t_wim, %g0
+       beq     1f              ! in trap window, clean up
+       nop
+
+       /*-------------------------------------------------
+        * Spill , adjust %wim and go.
+        */
+       srl     %t_wim, 0x1, %g2                ! begin computation of new %wim
+
+       set     (CFG_SPARC_NWINDOWS-1), %g3     !NWINDOWS-1
+
+       sll     %t_wim, %g3, %t_wim     ! NWINDOWS-1
+       or      %t_wim, %g2, %g2
+       and     %g2, 0xff, %g2
+
+       save    %g0, %g0, %g0           ! get in window to be saved
+
+       /* Set new %wim value */
+       wr      %g2, 0x0, %wim
+
+       /* Save the kernel window onto the corresponding stack. */
+       RW_STORE(sp)
+
+       restore %g0, %g0, %g0
+       /*-------------------------------------------------*/
+
+1:
+       /* Trap from kernel with a window available.
+        * Just do it...
+        */
+       jmpl    %t_retpc + 0x8, %g0     ! return to caller
+        mov    %t_kstack, %sp          ! jump onto new stack
+
+#define twin_tmp1 l4
+#define glob_tmp  g4
+#define curptr    g6
+ret_trap_entry:
+       wr      %t_psr, 0x0, %psr       ! enable nesting again, clear ET
+
+       /* Will the rett land us in the invalid window? */
+       mov     2, %g1
+       sll     %g1, %t_psr, %g1
+
+       set     CFG_SPARC_NWINDOWS, %g2 !NWINDOWS
+
+       srl     %g1, %g2, %g2
+       or      %g1, %g2, %g1
+       rd      %wim, %g2
+       andcc   %g2, %g1, %g0
+       be      1f              ! Nope, just return from the trap
+        sll    %g2, 0x1, %g1
+
+       /* We have to grab a window before returning. */
+       set     (CFG_SPARC_NWINDOWS-1), %g3     !NWINDOWS-1
+
+       srl     %g2, %g3,  %g2
+       or      %g1, %g2, %g1
+       and     %g1, 0xff, %g1
+
+       wr      %g1, 0x0, %wim
+
+       /* Grrr, make sure we load from the right %sp... */
+       PT_LOAD_ALL(sp, t_psr, t_pc, t_npc, g1)
+
+       restore %g0, %g0, %g0
+       RW_LOAD(sp)
+       b       2f
+       save    %g0, %g0, %g0
+
+       /* Reload the entire frame in case this is from a
+        * kernel system call or whatever...
+        */
+1:
+       PT_LOAD_ALL(sp, t_psr, t_pc, t_npc, g1)
+2:
+       wr      %t_psr, 0x0, %psr
+       nop;
+       nop;
+       nop
+
+       jmp     %t_pc
+       rett    %t_npc
+
+/* This is called from relocated C-code.
+ * It resets the system by jumping to _start
+ */
+_reset_reloc:
+       set     start, %l0
+       call    %l0
+       nop
similarity index 64%
rename from cpu/bf561/Makefile
rename to cpu/leon3/Makefile
index 418a437..182543d 100644 (file)
@@ -1,8 +1,5 @@
-# U-boot - Makefile
 #
-# Copyright (c) 2005-2007 Analog Devices Inc.
-#
-# (C) Copyright 2000-2004
+# (C) Copyright 2003-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 # 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
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
 #
 
 include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(CPU).a
 
-SOBJS  = start.o start1.o interrupt.o cache.o flush.o init_sdram.o
-COBJS  = cpu.o traps.o ints.o serial.o interrupts.o video.o
-
-EXTRA = init_sdram_bootrom_initblock.o
+START  = start.o
+SOBJS  =
+COBJS  = cpu_init.o serial.o cpu.o ambapp.o interrupts.o prom.o usb_uhci.o
 
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
 START  := $(addprefix $(obj),$(START))
 
-all:   $(obj).depend $(START) $(LIB) $(obj).depend $(EXTRA)
+all:   $(obj).depend $(START) $(LIB)
 
 $(LIB):        $(OBJS)
        $(AR) $(ARFLAGS) $@ $(OBJS)
@@ -47,6 +43,12 @@ $(LIB):      $(OBJS)
 # defines $(obj).depend target
 include $(SRCTREE)/rules.mk
 
+$(START): $(START:.o=.S)
+       $(CC) -D__ASSEMBLY__ $(DBGFLAGS) $(OPTFLAGS) -D__KERNEL__ -DTEXT_BASE=$(TEXT_BASE) \
+       -I$(TOPDIR)/include -fno-builtin -ffreestanding -nostdinc -isystem $(gccincdir) -pipe \
+       $(PLATFORM_CPPFLAGS) -Wall -Wstrict-prototypes \
+       -I$(TOPDIR)/board -c -o $(START) $(START:.o=.S)
+
 sinclude $(obj).depend
 
 #########################################################################
diff --git a/cpu/leon3/ambapp.c b/cpu/leon3/ambapp.c
new file mode 100644 (file)
index 0000000..efd41ae
--- /dev/null
@@ -0,0 +1,359 @@
+/* Gaisler AMBA Plug&Play bus scanning. Functions
+ * ending on _nomem is inteded to be used only during
+ * initialization, only registers are used (no ram).
+ *
+ * (C) Copyright 2007
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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 <command.h>
+#include <ambapp.h>
+
+#if defined(CONFIG_CMD_AMBAPP)
+extern void ambapp_print_apb(apbctrl_pp_dev * apb,
+                            ambapp_ahbdev * apbmst, int index);
+extern void ambapp_print_ahb(ahbctrl_pp_dev * ahb, int index);
+extern int ambapp_apb_print;
+extern int ambapp_ahb_print;
+#endif
+
+static int ambapp_apb_scan(unsigned int vendor,        /* Plug&Play Vendor ID */
+                          unsigned int driver, /* Plug&Play Device ID */
+                          ambapp_apbdev * dev, /* Result(s) is placed here */
+                          int index,   /* Index of device to start copying Plug&Play
+                                        * info into dev
+                                        */
+                          int max_cnt  /* Maximal count that dev can hold, if dev
+                                        * is NULL function will stop scanning after
+                                        * max_cnt devices are found.
+                                        */
+    )
+{
+       int i, cnt = 0;
+       unsigned int apbmst_base;
+       ambapp_ahbdev apbmst;
+       apbctrl_pp_dev *apb;
+
+       if (max_cnt == 0)
+               return 0;
+
+       /* Get AMBA APB Master */
+       if (ambapp_ahbslv_first(VENDOR_GAISLER, GAISLER_APBMST, &apbmst) != 1) {
+               return 0;
+       }
+
+       /* Get APB CTRL Plug&Play info area */
+       apbmst_base = apbmst.address[0] & LEON3_IO_AREA;
+       apb = (apbctrl_pp_dev *) (apbmst_base | LEON3_CONF_AREA);
+
+       for (i = 0; i < LEON3_APB_SLAVES; i++) {
+#if defined(CONFIG_CMD_AMBAPP)
+               if (ambapp_apb_print && amba_vendor(apb->conf)
+                   && amba_device(apb->conf)) {
+                       ambapp_print_apb(apb, &apbmst, i);
+               }
+#endif
+               if ((amba_vendor(apb->conf) == vendor) &&
+                   (amba_device(apb->conf) == driver) && ((index < 0)
+                                                          || (index-- == 0))) {
+                       /* Convert Plug&Play info into a more readable format */
+                       cnt++;
+                       if (dev) {
+                               dev->irq = amba_irq(apb->conf);
+                               dev->ver = amba_ver(apb->conf);
+                               dev->address =
+                                   (apbmst_base |
+                                    (((apb->
+                                       bar & 0xfff00000) >> 12))) & (((apb->
+                                                                       bar &
+                                                                       0x0000fff0)
+                                                                      << 4) |
+                                                                     0xfff00000);
+                               dev++;
+                       }
+                       /* found max devices? */
+                       if (cnt >= max_cnt)
+                               return cnt;
+               }
+               /* Get next Plug&Play entry */
+               apb++;
+       }
+       return cnt;
+}
+
+unsigned int ambapp_apb_next_nomem(register unsigned int vendor,       /* Plug&Play Vendor ID */
+                                  register unsigned int driver,        /* Plug&Play Device ID */
+                                  register int index)
+{
+       register int i;
+       register ahbctrl_pp_dev *apbmst;
+       register apbctrl_pp_dev *apb;
+       register unsigned int apbmst_base;
+
+       /* APBMST is a AHB Slave */
+       apbmst = ambapp_ahb_next_nomem(VENDOR_GAISLER, GAISLER_APBMST, 1, 0);
+       if (!apbmst)
+               return 0;
+
+       apbmst_base = amba_membar_start(apbmst->bars[0]);
+       if (amba_membar_type(apbmst->bars[0]) == AMBA_TYPE_AHBIO)
+               apbmst_base = AMBA_TYPE_AHBIO_ADDR(apbmst_base);
+       apbmst_base &= LEON3_IO_AREA;
+
+       /* Find the vendor/driver device on the first APB bus */
+       apb = (apbctrl_pp_dev *) (apbmst_base | LEON3_CONF_AREA);
+
+       for (i = 0; i < LEON3_APB_SLAVES; i++) {
+               if ((amba_vendor(apb->conf) == vendor) &&
+                   (amba_device(apb->conf) == driver) && ((index < 0)
+                                                          || (index-- == 0))) {
+                       /* Convert Plug&Play info info a more readable format */
+                       return (apbmst_base | (((apb->bar & 0xfff00000) >> 12)))
+                           & (((apb->bar & 0x0000fff0) << 4) | 0xfff00000);
+               }
+               /* Get next Plug&Play entry */
+               apb++;
+       }
+       return 0;
+}
+
+/****************************** APB SLAVES ******************************/
+
+int ambapp_apb_count(unsigned int vendor, unsigned int driver)
+{
+       return ambapp_apb_scan(vendor, driver, NULL, 0, LEON3_APB_SLAVES);
+}
+
+int ambapp_apb_first(unsigned int vendor,
+                    unsigned int driver, ambapp_apbdev * dev)
+{
+       return ambapp_apb_scan(vendor, driver, dev, 0, 1);
+}
+
+int ambapp_apb_next(unsigned int vendor,
+                   unsigned int driver, ambapp_apbdev * dev, int index)
+{
+       return ambapp_apb_scan(vendor, driver, dev, index, 1);
+}
+
+int ambapp_apbs_first(unsigned int vendor,
+                     unsigned int driver, ambapp_apbdev * dev, int max_cnt)
+{
+       return ambapp_apb_scan(vendor, driver, dev, 0, max_cnt);
+}
+
+enum {
+       AHB_SCAN_MASTER = 0,
+       AHB_SCAN_SLAVE = 1
+};
+
+/* Scan AMBA Plug&Play bus for AMBA AHB Masters or AHB Slaves
+ * for a certain matching Vendor and Device ID.
+ *
+ * Return number of devices found.
+ *
+ * Compact edition...
+ */
+static int ambapp_ahb_scan(unsigned int vendor,        /* Plug&Play Vendor ID */
+                          unsigned int driver, /* Plug&Play Device ID */
+                          ambapp_ahbdev * dev, /* Result(s) is placed here */
+                          int index,   /* Index of device to start copying Plug&Play
+                                        * info into dev
+                                        */
+                          int max_cnt, /* Maximal count that dev can hold, if dev
+                                        * is NULL function will stop scanning after
+                                        * max_cnt devices are found.
+                                        */
+                          int type     /* Selectes what type of devices to scan.
+                                        * 0=AHB Masters
+                                        * 1=AHB Slaves
+                                        */
+    )
+{
+       int i, j, cnt = 0, max_pp_devs;
+       unsigned int addr;
+       ahbctrl_info *info = (ahbctrl_info *) (LEON3_IO_AREA | LEON3_CONF_AREA);
+       ahbctrl_pp_dev *ahb;
+
+       if (max_cnt == 0)
+               return 0;
+
+       if (type == 0) {
+               max_pp_devs = LEON3_AHB_MASTERS;
+               ahb = info->masters;
+       } else {
+               max_pp_devs = LEON3_AHB_SLAVES;
+               ahb = info->slaves;
+       }
+
+       for (i = 0; i < max_pp_devs; i++) {
+#if defined(CONFIG_CMD_AMBAPP)
+               if (ambapp_ahb_print && amba_vendor(ahb->conf) &&
+                   amba_device(ahb->conf)) {
+                       ambapp_print_ahb(ahb, i);
+               }
+#endif
+               if ((amba_vendor(ahb->conf) == vendor) &&
+                   (amba_device(ahb->conf) == driver) &&
+                   ((index < 0) || (index-- == 0))) {
+                       /* Convert Plug&Play info info a more readable format */
+                       cnt++;
+                       if (dev) {
+                               dev->irq = amba_irq(ahb->conf);
+                               dev->ver = amba_ver(ahb->conf);
+                               dev->userdef[0] = ahb->userdef[0];
+                               dev->userdef[1] = ahb->userdef[1];
+                               dev->userdef[2] = ahb->userdef[2];
+                               for (j = 0; j < 4; j++) {
+                                       addr = amba_membar_start(ahb->bars[j]);
+                                       if (amba_membar_type(ahb->bars[j]) ==
+                                           AMBA_TYPE_AHBIO)
+                                               addr =
+                                                   AMBA_TYPE_AHBIO_ADDR(addr);
+                                       dev->address[j] = addr;
+                               }
+                               dev++;
+                       }
+                       /* found max devices? */
+                       if (cnt >= max_cnt)
+                               return cnt;
+               }
+               /* Get next Plug&Play entry */
+               ahb++;
+       }
+       return cnt;
+}
+
+unsigned int ambapp_ahb_get_info(ahbctrl_pp_dev * ahb, int info)
+{
+       register unsigned int ret;
+
+       if (!ahb)
+               return 0;
+
+       switch (info) {
+       default:
+               info = 0;
+       case 0:
+       case 1:
+       case 2:
+       case 3:
+               /* Get Address from PnP Info */
+               ret = amba_membar_start(ahb->bars[info]);
+               if (amba_membar_type(ahb->bars[info]) == AMBA_TYPE_AHBIO)
+                       ret = AMBA_TYPE_AHBIO_ADDR(ret);
+               return ret;
+       }
+       return 0;
+
+}
+
+ahbctrl_pp_dev *ambapp_ahb_next_nomem(register unsigned int vendor,    /* Plug&Play Vendor ID */
+                                     register unsigned int driver,     /* Plug&Play Device ID */
+                                     register unsigned int opts,       /* 1=slave, 0=master */
+                                     register int index)
+{
+       register ahbctrl_pp_dev *ahb;
+       register ahbctrl_info *info =
+           (ahbctrl_info *) (LEON3_IO_AREA | LEON3_CONF_AREA);
+       register int i;
+       register int max_pp_devs;
+
+       if (opts == 0) {
+               max_pp_devs = LEON3_AHB_MASTERS;
+               ahb = info->masters;
+       } else {
+               max_pp_devs = LEON3_AHB_SLAVES;
+               ahb = info->slaves;
+       }
+
+       for (i = 0; i < max_pp_devs; i++) {
+               if ((amba_vendor(ahb->conf) == vendor) &&
+                   (amba_device(ahb->conf) == driver) &&
+                   ((index < 0) || (index-- == 0))) {
+                       /* Convert Plug&Play info info a more readable format */
+                       return ahb;
+               }
+               /* Get next Plug&Play entry */
+               ahb++;
+       }
+       return 0;
+}
+
+/****************************** AHB MASTERS ******************************/
+int ambapp_ahbmst_count(unsigned int vendor, unsigned int driver)
+{
+       /* Get number of devices of this vendor&device ID */
+       return ambapp_ahb_scan(vendor, driver, NULL, 0, LEON3_AHB_MASTERS,
+                              AHB_SCAN_MASTER);
+}
+
+int ambapp_ahbmst_first(unsigned int vendor, unsigned int driver,
+                       ambapp_ahbdev * dev)
+{
+       /* find first device of this */
+       return ambapp_ahb_scan(vendor, driver, dev, 0, 1, AHB_SCAN_MASTER);
+}
+
+int ambapp_ahbmst_next(unsigned int vendor,
+                      unsigned int driver, ambapp_ahbdev * dev, int index)
+{
+       /* find first device of this */
+       return ambapp_ahb_scan(vendor, driver, dev, index, 1, AHB_SCAN_MASTER);
+}
+
+int ambapp_ahbmsts_first(unsigned int vendor,
+                        unsigned int driver, ambapp_ahbdev * dev, int max_cnt)
+{
+       /* find first device of this */
+       return ambapp_ahb_scan(vendor, driver, dev, 0, max_cnt,
+                              AHB_SCAN_MASTER);
+}
+
+/****************************** AHB SLAVES ******************************/
+int ambapp_ahbslv_count(unsigned int vendor, unsigned int driver)
+{
+       /* Get number of devices of this vendor&device ID */
+       return ambapp_ahb_scan(vendor, driver, NULL, 0, LEON3_AHB_SLAVES,
+                              AHB_SCAN_SLAVE);
+}
+
+int ambapp_ahbslv_first(unsigned int vendor, unsigned int driver,
+                       ambapp_ahbdev * dev)
+{
+       /* find first device of this */
+       return ambapp_ahb_scan(vendor, driver, dev, 0, 1, AHB_SCAN_SLAVE);
+}
+
+int ambapp_ahbslv_next(unsigned int vendor,
+                      unsigned int driver, ambapp_ahbdev * dev, int index)
+{
+       /* find first device of this */
+       return ambapp_ahb_scan(vendor, driver, dev, index, 1, AHB_SCAN_SLAVE);
+}
+
+int ambapp_ahbslvs_first(unsigned int vendor,
+                        unsigned int driver, ambapp_ahbdev * dev, int max_cnt)
+{
+       /* find first device of this */
+       return ambapp_ahb_scan(vendor, driver, dev, 0, max_cnt, AHB_SCAN_SLAVE);
+}
similarity index 78%
rename from cpu/bf537/config.mk
rename to cpu/leon3/config.mk
index fbbe75d..30b224a 100644 (file)
@@ -1,8 +1,5 @@
-# U-boot - config.mk
 #
-# Copyright (c) 2005-2007 Analog Devices Inc.
-#
-# (C) Copyright 2000-2004
+# (C) Copyright 2003
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 # 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
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
 #
 
-PLATFORM_RELFLAGS += -mcpu=bf537
+PLATFORM_RELFLAGS += -fPIC
+
+PLATFORM_CPPFLAGS += -DCONFIG_LEON
diff --git a/cpu/leon3/cpu.c b/cpu/leon3/cpu.c
new file mode 100644 (file)
index 0000000..306a210
--- /dev/null
@@ -0,0 +1,67 @@
+/* CPU specific code for the LEON3 CPU
+ *
+ * (C) Copyright 2007
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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 <watchdog.h>
+#include <command.h>
+
+#include <asm/io.h>
+#include <asm/processor.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+extern void _reset_reloc(void);
+
+int checkcpu(void)
+{
+       /* check LEON version here */
+       printf("CPU: LEON3\n");
+       return 0;
+}
+
+/* ------------------------------------------------------------------------- */
+
+void cpu_reset(void)
+{
+       /* Interrupts off */
+       disable_interrupts();
+
+       /* jump to restart in flash */
+       _reset_reloc();
+}
+
+int do_reset(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+{
+       cpu_reset();
+
+       return 1;
+
+}
+
+u64 flash_read64(void *addr)
+{
+       return __raw_readq(addr);
+}
+
+/* ------------------------------------------------------------------------- */
diff --git a/cpu/leon3/cpu_init.c b/cpu/leon3/cpu_init.c
new file mode 100644 (file)
index 0000000..4fe7d4b
--- /dev/null
@@ -0,0 +1,254 @@
+/* Initializes CPU and basic hardware such as memory
+ * controllers, IRQ controller and system timer 0.
+ *
+ * (C) Copyright 2007
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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/asi.h>
+#include <asm/leon.h>
+#include <ambapp.h>
+
+#include <config.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/* reset CPU (jump to 0, without reset) */
+void start(void);
+
+/* find & initialize the memory controller */
+int init_memory_ctrl(void);
+
+ambapp_dev_irqmp *irqmp = NULL;
+ambapp_dev_mctrl memctrl;
+ambapp_dev_gptimer *gptimer = NULL;
+unsigned int gptimer_irq = 0;
+int leon3_snooping_avail = 0;
+
+struct {
+       gd_t gd_area;
+       bd_t bd;
+} global_data;
+
+/*
+ * Breath some life into the CPU...
+ *
+ * Set up the memory map,
+ * initialize a bunch of registers.
+ *
+ * Run from FLASH/PROM:
+ *  - until memory controller is set up, only registers avaiable
+ *  - no global variables available for writing
+ *  - constants avaiable
+ */
+
+void cpu_init_f(void)
+{
+       /* these varaiable must not be initialized */
+       ambapp_dev_irqmp *irqmp;
+       ambapp_apbdev apbdev;
+       register unsigned int apbmst;
+
+       /* find AMBA APB Master */
+       apbmst = (unsigned int)
+           ambapp_ahb_next_nomem(VENDOR_GAISLER, GAISLER_APBMST, 1, 0);
+       if (!apbmst) {
+               /*
+                * no AHB/APB bridge, something is wrong
+                * ==> jump to start (or hang)
+                */
+               while (1) ;
+       }
+       /* Init memory controller */
+       if (init_memory_ctrl()) {
+               while (1) ;
+       }
+
+       /****************************************************
+        * From here we can use the main memory and the stack.
+        */
+
+       /* Find AMBA APB IRQMP Controller */
+       if (ambapp_apb_first(VENDOR_GAISLER, GAISLER_IRQMP, &apbdev) != 1) {
+               /* no IRQ controller, something is wrong
+                * ==> jump to start (or hang)
+                */
+               while (1) ;
+       }
+       irqmp = (ambapp_dev_irqmp *) apbdev.address;
+
+       /* initialize the IRQMP */
+       irqmp->ilevel = 0xf;    /* all IRQ off */
+       irqmp->iforce = 0;
+       irqmp->ipend = 0;
+       irqmp->iclear = 0xfffe; /* clear all old pending interrupts */
+       irqmp->cpu_mask[0] = 0; /* mask all IRQs on CPU 0 */
+       irqmp->cpu_force[0] = 0;        /* no force IRQ on CPU 0 */
+
+       /* cache */
+}
+
+void cpu_init_f2(void)
+{
+
+}
+
+/*
+ * initialize higher level parts of CPU like time base and timers
+ */
+int cpu_init_r(void)
+{
+       ambapp_apbdev apbdev;
+
+       /*
+        * Find AMBA APB IRQMP Controller,
+        * When we come so far we know there is a IRQMP available
+        */
+       ambapp_apb_first(VENDOR_GAISLER, GAISLER_IRQMP, &apbdev);
+       irqmp = (ambapp_dev_irqmp *) apbdev.address;
+
+       /* timer */
+       if (ambapp_apb_first(VENDOR_GAISLER, GAISLER_GPTIMER, &apbdev) != 1) {
+               printf("cpu_init_r: gptimer not found!\n");
+               return 1;
+       }
+       gptimer = (ambapp_dev_gptimer *) apbdev.address;
+       gptimer_irq = apbdev.irq;
+
+       /* initialize prescaler common to all timers to 1MHz */
+       gptimer->scalar = gptimer->scalar_reload =
+           (((CONFIG_SYS_CLK_FREQ / 1000) + 500) / 1000) - 1;
+
+       return (0);
+}
+
+/* find & setup memory controller */
+int init_memory_ctrl()
+{
+       register ambapp_dev_mctrl *mctrl;
+       register ambapp_dev_sdctrl *sdctrl;
+       register ambapp_dev_ddrspa *ddrspa;
+       register ambapp_dev_ddr2spa *ddr2spa;
+       register ahbctrl_pp_dev *ahb;
+       register unsigned int base;
+       register int not_found_mctrl = -1;
+
+       /* find ESA Memory controller */
+       base = ambapp_apb_next_nomem(VENDOR_ESA, ESA_MCTRL, 0);
+       if (base) {
+               mctrl = (ambapp_dev_mctrl *) base;
+
+               /* config MCTRL memory controller */
+               mctrl->mcfg1 = CFG_GRLIB_MEMCFG1 | (mctrl->mcfg1 & 0x300);
+               mctrl->mcfg2 = CFG_GRLIB_MEMCFG2;
+               mctrl->mcfg3 = CFG_GRLIB_MEMCFG3;
+               not_found_mctrl = 0;
+       }
+
+       /* find Gaisler Fault Tolerant Memory controller */
+       base = ambapp_apb_next_nomem(VENDOR_GAISLER, GAISLER_FTMCTRL, 0);
+       if (base) {
+               mctrl = (ambapp_dev_mctrl *) base;
+
+               /* config MCTRL memory controller */
+               mctrl->mcfg1 = CFG_GRLIB_FT_MEMCFG1 | (mctrl->mcfg1 & 0x300);
+               mctrl->mcfg2 = CFG_GRLIB_FT_MEMCFG2;
+               mctrl->mcfg3 = CFG_GRLIB_FT_MEMCFG3;
+               not_found_mctrl = 0;
+       }
+
+       /* find SDRAM controller */
+       base = ambapp_apb_next_nomem(VENDOR_GAISLER, GAISLER_SDCTRL, 0);
+       if (base) {
+               sdctrl = (ambapp_dev_sdctrl *) base;
+
+               /* config memory controller */
+               sdctrl->sdcfg = CFG_GRLIB_SDRAM;
+               not_found_mctrl = 0;
+       }
+
+       ahb = ambapp_ahb_next_nomem(VENDOR_GAISLER, GAISLER_DDR2SPA, 1, 0);
+       if (ahb) {
+               ddr2spa = (ambapp_dev_ddr2spa *) ambapp_ahb_get_info(ahb, 1);
+
+               /* Config DDR2 memory controller */
+               ddr2spa->cfg1 = CFG_GRLIB_DDR2_CFG1;
+               ddr2spa->cfg3 = CFG_GRLIB_DDR2_CFG3;
+               not_found_mctrl = 0;
+       }
+
+       ahb = ambapp_ahb_next_nomem(VENDOR_GAISLER, GAISLER_DDRSPA, 1, 0);
+       if (ahb) {
+               ddrspa = (ambapp_dev_ddrspa *) ambapp_ahb_get_info(ahb, 1);
+
+               /* Config DDR memory controller */
+               ddrspa->ctrl = CFG_GRLIB_DDR_CFG;
+               not_found_mctrl = 0;
+       }
+
+       /* failed to find any memory controller */
+       return not_found_mctrl;
+}
+
+/* Uses Timer 0 to get accurate
+ * pauses. Max 2 raised to 32 ticks
+ *
+ */
+void cpu_wait_ticks(unsigned long ticks)
+{
+       unsigned long start = get_timer(0);
+       while (get_timer(start) < ticks) ;
+}
+
+/* initiate and setup timer0 interrupt to 1MHz
+ * Return irq number for timer int or a negative number for
+ * dealing with self
+ */
+int timer_interrupt_init_cpu(void)
+{
+       /* 1ms ticks */
+       gptimer->e[0].val = 0;
+       gptimer->e[0].rld = 999;        /* (((1000000 / 100) - 1)) */
+       gptimer->e[0].ctrl =
+           (LEON3_GPTIMER_EN |
+            LEON3_GPTIMER_RL | LEON3_GPTIMER_LD | LEON3_GPTIMER_IRQEN);
+
+       return gptimer_irq;
+}
+
+/*
+ * This function is intended for SHORT delays only.
+ */
+unsigned long cpu_usec2ticks(unsigned long usec)
+{
+       /* timer set to 1kHz ==> 1 clk tick = 1 msec */
+       if (usec < 1000)
+               return 1;
+       return (usec / 1000);
+}
+
+unsigned long cpu_ticks2usec(unsigned long ticks)
+{
+       /* 1tick = 1usec */
+       return ticks * 1000;
+}
diff --git a/cpu/leon3/interrupts.c b/cpu/leon3/interrupts.c
new file mode 100644 (file)
index 0000000..2692632
--- /dev/null
@@ -0,0 +1,219 @@
+/*
+ * (C) Copyright 2007
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.com
+ *
+ * (C) Copyright 2006
+ * Detlev Zundel, DENX Software Engineering, dzu@denx.de
+ *
+ * (C) Copyright -2003
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * (C) Copyright 2001
+ * Josh Huber <huber@mclx.com>, Mission Critical Linux, 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 <asm/stack.h>
+#include <common.h>
+#include <asm/io.h>
+#include <asm/processor.h>
+#include <command.h>
+#include <asm/irq.h>
+
+#include <asm/leon.h>
+#include <ambapp.h>
+
+/* 15 normal irqs and a non maskable interrupt */
+#define NR_IRQS 15
+
+struct irq_action {
+       interrupt_handler_t *handler;
+       void *arg;
+       unsigned int count;
+};
+
+extern ambapp_dev_irqmp *irqmp;
+extern ambapp_dev_gptimer *gptimer;
+
+static struct irq_action irq_handlers[NR_IRQS] = { {0}, };
+static int spurious_irq_cnt = 0;
+static int spurious_irq = 0;
+
+static inline unsigned int irqmp_get_irqmask(unsigned int irq)
+{
+       if ((irq < 0) || (irq >= NR_IRQS)) {
+               return 0;
+       } else {
+               return (1 << irq);
+       }
+
+}
+
+static void leon3_ic_disable(unsigned int irq)
+{
+       unsigned int mask, pil;
+       if (!irqmp)
+               return;
+
+       pil = intLock();
+
+       /* get mask of interrupt */
+       mask = irqmp_get_irqmask(irq);
+
+       /* set int level */
+       irqmp->cpu_mask[0] = SPARC_NOCACHE_READ(&irqmp->cpu_mask[0]) & (~mask);
+
+       intUnlock(pil);
+}
+
+static void leon3_ic_enable(unsigned int irq)
+{
+       unsigned int mask, pil;
+       if (!irqmp)
+               return;
+
+       pil = intLock();
+
+       /* get mask of interrupt */
+       mask = irqmp_get_irqmask(irq);
+
+       /* set int level */
+       irqmp->cpu_mask[0] = SPARC_NOCACHE_READ(&irqmp->cpu_mask[0]) | mask;
+
+       intUnlock(pil);
+
+}
+
+void handler_irq(int irq, struct pt_regs *regs)
+{
+       if (irq_handlers[irq].handler) {
+               if (((unsigned int)irq_handlers[irq].handler > CFG_RAM_END) ||
+                   ((unsigned int)irq_handlers[irq].handler < CFG_RAM_BASE)
+                   ) {
+                       printf("handler_irq: bad handler: %x, irq number %d\n",
+                              (unsigned int)irq_handlers[irq].handler, irq);
+                       return;
+               }
+               irq_handlers[irq].handler(irq_handlers[irq].arg);
+               irq_handlers[irq].count++;
+       } else {
+               spurious_irq_cnt++;
+               spurious_irq = irq;
+       }
+}
+
+void leon3_force_int(int irq)
+{
+       if (!irqmp || (irq >= NR_IRQS) || (irq < 0))
+               return;
+       printf("Forcing interrupt %d\n", irq);
+
+       irqmp->iforce = SPARC_NOCACHE_READ(&irqmp->iforce) | (1 << irq);
+}
+
+/****************************************************************************/
+
+int interrupt_init_cpu(void)
+{
+
+       return (0);
+}
+
+/****************************************************************************/
+
+/* Handle Timer 0 IRQ */
+void timer_interrupt_cpu(void *arg)
+{
+       gptimer->e[0].ctrl = (LEON3_GPTIMER_EN |
+                             LEON3_GPTIMER_RL |
+                             LEON3_GPTIMER_LD | LEON3_GPTIMER_IRQEN);
+       /* nothing to do here */
+       return;
+}
+
+/****************************************************************************/
+
+/*
+ * Install and free a interrupt handler.
+ */
+
+void irq_install_handler(int irq, interrupt_handler_t * handler, void *arg)
+{
+       if (irq < 0 || irq >= NR_IRQS) {
+               printf("irq_install_handler: bad irq number %d\n", irq);
+               return;
+       }
+
+       if (irq_handlers[irq].handler != NULL)
+               printf("irq_install_handler: 0x%08lx replacing 0x%08lx\n",
+                      (ulong) handler, (ulong) irq_handlers[irq].handler);
+
+       if (((unsigned int)handler > CFG_RAM_END) ||
+           ((unsigned int)handler < CFG_RAM_BASE)
+           ) {
+               printf("irq_install_handler: bad handler: %x, irq number %d\n",
+                      (unsigned int)handler, irq);
+               return;
+       }
+       irq_handlers[irq].handler = handler;
+       irq_handlers[irq].arg = arg;
+
+       /* enable irq on IRQMP hardware */
+       leon3_ic_enable(irq);
+
+}
+
+void irq_free_handler(int irq)
+{
+       if (irq < 0 || irq >= NR_IRQS) {
+               printf("irq_free_handler: bad irq number %d\n", irq);
+               return;
+       }
+
+       /* disable irq on IRQMP hardware */
+       leon3_ic_disable(irq);
+
+       irq_handlers[irq].handler = NULL;
+       irq_handlers[irq].arg = NULL;
+}
+
+/****************************************************************************/
+
+#if defined(CONFIG_CMD_IRQ)
+void do_irqinfo(cmd_tbl_t * cmdtp, bd_t * bd, int flag, int argc, char *argv[])
+{
+       int irq;
+       unsigned int pil = get_pil();
+       printf("PIL level: %u\n\r", pil);
+       printf("Spurious IRQ: %u, last unknown IRQ: %d\n",
+              spurious_irq_cnt, spurious_irq);
+
+       puts("\nInterrupt-Information:\n" "Nr  Routine   Arg       Count\n");
+
+       for (irq = 0; irq < NR_IRQS; irq++) {
+               if (irq_handlers[irq].handler != NULL) {
+                       printf("%02d  %08lx  %08lx  %ld\n", irq,
+                              (unsigned int)irq_handlers[irq].handler,
+                              (unsigned int)irq_handlers[irq].arg,
+                              irq_handlers[irq].count);
+               }
+       }
+}
+#endif
diff --git a/cpu/leon3/prom.c b/cpu/leon3/prom.c
new file mode 100644 (file)
index 0000000..9fa2d04
--- /dev/null
@@ -0,0 +1,1078 @@
+/* prom.c - emulates a sparc v0 PROM for the linux kernel.
+ *
+ * Copyright (C) 2003 Konrad Eisele <eiselekd@web.de>
+ * Copyright (C) 2004 Stefan Holst <mail@s-holst.de>
+ * Copyright (C) 2007 Daniel Hellstrom <daniel@gaisler.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/prom.h>
+#include <asm/machines.h>
+#include <asm/srmmu.h>
+#include <asm/processor.h>
+#include <asm/irq.h>
+#include <asm/leon.h>
+#include <ambapp.h>
+
+#include <config.h>
+/*
+#define PRINT_ROM_VEC
+*/
+extern struct linux_romvec *kernel_arg_promvec;
+extern ambapp_dev_apbuart *leon3_apbuart;
+
+#define PROM_PGT __attribute__ ((__section__ (".prom.pgt")))
+#define PROM_TEXT __attribute__ ((__section__ (".prom.text")))
+#define PROM_DATA __attribute__ ((__section__ (".prom.data")))
+
+ambapp_dev_gptimer *gptimer;
+
+/* for __va */
+extern int __prom_start;
+#define PAGE_OFFSET 0xf0000000
+#define phys_base CFG_SDRAM_BASE
+#define PROM_OFFS 8192
+#define PROM_SIZE_MASK (PROM_OFFS-1)
+#define __va(x) ( \
+       (void *)( ((unsigned long)(x))-PROM_OFFS+ \
+       (CFG_PROM_OFFSET-phys_base)+PAGE_OFFSET-TEXT_BASE ) \
+       )
+#define __phy(x) ((void *)(((unsigned long)(x))-PROM_OFFS+CFG_PROM_OFFSET-TEXT_BASE))
+
+struct property {
+       char *name;
+       char *value;
+       int length;
+};
+
+struct node {
+       int level;
+       struct property *properties;
+};
+
+static void leon_reboot(char *bcommand);
+static void leon_halt(void);
+static int leon_nbputchar(int c);
+static int leon_nbgetchar(void);
+
+static int no_nextnode(int node);
+static int no_child(int node);
+static int no_proplen(int node, char *name);
+static int no_getprop(int node, char *name, char *value);
+static int no_setprop(int node, char *name, char *value, int len);
+static char *no_nextprop(int node, char *name);
+
+static struct property PROM_TEXT *find_property(int node, char *name);
+static int PROM_TEXT leon_strcmp(const char *s1, const char *s2);
+static void *PROM_TEXT leon_memcpy(void *dest, const void *src, size_t n);
+static void PROM_TEXT leon_reboot_physical(char *bcommand);
+
+void __inline__ leon_flush_cache_all(void)
+{
+       __asm__ __volatile__(" flush ");
+      __asm__ __volatile__("sta %%g0, [%%g0] %0\n\t"::"i"(ASI_DFLUSH):"memory");
+}
+
+void __inline__ leon_flush_tlb_all(void)
+{
+       leon_flush_cache_all();
+       __asm__ __volatile__("sta %%g0, [%0] %1\n\t"::"r"(0x400),
+                            "i"(ASI_MMUFLUSH):"memory");
+}
+
+typedef struct {
+       unsigned int ctx_table[256];
+       unsigned int pgd_table[256];
+} sparc_srmmu_setup;
+
+sparc_srmmu_setup srmmu_tables PROM_PGT = {
+       {0},
+       {0x1e,
+        0x10001e,
+        0x20001e,
+        0x30001e,
+        0x40001e,
+        0x50001e,
+        0x60001e,
+        0x70001e,
+        0x80001e,
+        0x90001e,
+        0xa0001e,
+        0xb0001e,
+        0xc0001e,
+        0xd0001e,
+        0xe0001e,
+        0xf0001e,
+        0x100001e,
+        0x110001e,
+        0x120001e,
+        0x130001e,
+        0x140001e,
+        0x150001e,
+        0x160001e,
+        0x170001e,
+        0x180001e,
+        0x190001e,
+        0x1a0001e,
+        0x1b0001e,
+        0x1c0001e,
+        0x1d0001e,
+        0x1e0001e,
+        0x1f0001e,
+        0x200001e,
+        0x210001e,
+        0x220001e,
+        0x230001e,
+        0x240001e,
+        0x250001e,
+        0x260001e,
+        0x270001e,
+        0x280001e,
+        0x290001e,
+        0x2a0001e,
+        0x2b0001e,
+        0x2c0001e,
+        0x2d0001e,
+        0x2e0001e,
+        0x2f0001e,
+        0x300001e,
+        0x310001e,
+        0x320001e,
+        0x330001e,
+        0x340001e,
+        0x350001e,
+        0x360001e,
+        0x370001e,
+        0x380001e,
+        0x390001e,
+        0x3a0001e,
+        0x3b0001e,
+        0x3c0001e,
+        0x3d0001e,
+        0x3e0001e,
+        0x3f0001e,
+        0x400001e,
+        0x410001e,
+        0x420001e,
+        0x430001e,
+        0x440001e,
+        0x450001e,
+        0x460001e,
+        0x470001e,
+        0x480001e,
+        0x490001e,
+        0x4a0001e,
+        0x4b0001e,
+        0x4c0001e,
+        0x4d0001e,
+        0x4e0001e,
+        0x4f0001e,
+        0x500001e,
+        0x510001e,
+        0x520001e,
+        0x530001e,
+        0x540001e,
+        0x550001e,
+        0x560001e,
+        0x570001e,
+        0x580001e,
+        0x590001e,
+        0x5a0001e,
+        0x5b0001e,
+        0x5c0001e,
+        0x5d0001e,
+        0x5e0001e,
+        0x5f0001e,
+        0x600001e,
+        0x610001e,
+        0x620001e,
+        0x630001e,
+        0x640001e,
+        0x650001e,
+        0x660001e,
+        0x670001e,
+        0x680001e,
+        0x690001e,
+        0x6a0001e,
+        0x6b0001e,
+        0x6c0001e,
+        0x6d0001e,
+        0x6e0001e,
+        0x6f0001e,
+        0x700001e,
+        0x710001e,
+        0x720001e,
+        0x730001e,
+        0x740001e,
+        0x750001e,
+        0x760001e,
+        0x770001e,
+        0x780001e,
+        0x790001e,
+        0x7a0001e,
+        0x7b0001e,
+        0x7c0001e,
+        0x7d0001e,
+        0x7e0001e,
+        0x7f0001e,
+        0x800001e,
+        0x810001e,
+        0x820001e,
+        0x830001e,
+        0x840001e,
+        0x850001e,
+        0x860001e,
+        0x870001e,
+        0x880001e,
+        0x890001e,
+        0x8a0001e,
+        0x8b0001e,
+        0x8c0001e,
+        0x8d0001e,
+        0x8e0001e,
+        0x8f0001e,
+        0x900001e,
+        0x910001e,
+        0x920001e,
+        0x930001e,
+        0x940001e,
+        0x950001e,
+        0x960001e,
+        0x970001e,
+        0x980001e,
+        0x990001e,
+        0x9a0001e,
+        0x9b0001e,
+        0x9c0001e,
+        0x9d0001e,
+        0x9e0001e,
+        0x9f0001e,
+        0xa00001e,
+        0xa10001e,
+        0xa20001e,
+        0xa30001e,
+        0xa40001e,
+        0xa50001e,
+        0xa60001e,
+        0xa70001e,
+        0xa80001e,
+        0xa90001e,
+        0xaa0001e,
+        0xab0001e,
+        0xac0001e,
+        0xad0001e,
+        0xae0001e,
+        0xaf0001e,
+        0xb00001e,
+        0xb10001e,
+        0xb20001e,
+        0xb30001e,
+        0xb40001e,
+        0xb50001e,
+        0xb60001e,
+        0xb70001e,
+        0xb80001e,
+        0xb90001e,
+        0xba0001e,
+        0xbb0001e,
+        0xbc0001e,
+        0xbd0001e,
+        0xbe0001e,
+        0xbf0001e,
+        0xc00001e,
+        0xc10001e,
+        0xc20001e,
+        0xc30001e,
+        0xc40001e,
+        0xc50001e,
+        0xc60001e,
+        0xc70001e,
+        0xc80001e,
+        0xc90001e,
+        0xca0001e,
+        0xcb0001e,
+        0xcc0001e,
+        0xcd0001e,
+        0xce0001e,
+        0xcf0001e,
+        0xd00001e,
+        0xd10001e,
+        0xd20001e,
+        0xd30001e,
+        0xd40001e,
+        0xd50001e,
+        0xd60001e,
+        0xd70001e,
+        0xd80001e,
+        0xd90001e,
+        0xda0001e,
+        0xdb0001e,
+        0xdc0001e,
+        0xdd0001e,
+        0xde0001e,
+        0xdf0001e,
+        0xe00001e,
+        0xe10001e,
+        0xe20001e,
+        0xe30001e,
+        0xe40001e,
+        0xe50001e,
+        0xe60001e,
+        0xe70001e,
+        0xe80001e,
+        0xe90001e,
+        0xea0001e,
+        0xeb0001e,
+        0xec0001e,
+        0xed0001e,
+        0xee0001e,
+        0xef0001e,
+        0x400001e              /* default */
+        }
+};
+
+/* a self contained prom info structure */
+struct leon_reloc_func {
+       struct property *(*find_property) (int node, char *name);
+       int (*strcmp) (char *s1, char *s2);
+       void *(*memcpy) (void *dest, const void *src, size_t n);
+       void (*reboot_physical) (char *cmd);
+       ambapp_dev_apbuart *leon3_apbuart;
+};
+
+struct leon_prom_info {
+       int freq_khz;
+       int leon_nctx;
+       int mids[32];
+       int baudrates[2];
+       struct leon_reloc_func reloc_funcs;
+       struct property root_properties[4];
+       struct property cpu_properties[7];
+#undef  CPUENTRY
+#define CPUENTRY(idx) struct property cpu_properties##idx[4]
+        CPUENTRY(1);
+        CPUENTRY(2);
+        CPUENTRY(3);
+        CPUENTRY(4);
+        CPUENTRY(5);
+        CPUENTRY(6);
+        CPUENTRY(7);
+        CPUENTRY(8);
+        CPUENTRY(9);
+        CPUENTRY(10);
+        CPUENTRY(11);
+        CPUENTRY(12);
+        CPUENTRY(13);
+        CPUENTRY(14);
+        CPUENTRY(15);
+        CPUENTRY(16);
+        CPUENTRY(17);
+        CPUENTRY(18);
+        CPUENTRY(19);
+        CPUENTRY(20);
+        CPUENTRY(21);
+        CPUENTRY(22);
+        CPUENTRY(23);
+        CPUENTRY(24);
+        CPUENTRY(25);
+        CPUENTRY(26);
+        CPUENTRY(27);
+        CPUENTRY(28);
+        CPUENTRY(29);
+        CPUENTRY(30);
+        CPUENTRY(31);
+       struct idprom idprom;
+       struct linux_nodeops nodeops;
+       struct linux_mlist_v0 *totphys_p;
+       struct linux_mlist_v0 totphys;
+       struct linux_mlist_v0 *avail_p;
+       struct linux_mlist_v0 avail;
+       struct linux_mlist_v0 *prommap_p;
+       void (*synchook) (void);
+       struct linux_arguments_v0 *bootargs_p;
+       struct linux_arguments_v0 bootargs;
+       struct linux_romvec romvec;
+       struct node nodes[35];
+       char s_device_type[12];
+       char s_cpu[4];
+       char s_mid[4];
+       char s_idprom[7];
+       char s_compatability[14];
+       char s_leon2[6];
+       char s_mmu_nctx[9];
+       char s_frequency[16];
+       char s_uart1_baud[11];
+       char s_uart2_baud[11];
+       char arg[256];
+};
+
+/* static prom info */
+static struct leon_prom_info PROM_DATA spi = {
+       CONFIG_SYS_CLK_FREQ / 1000,
+       256,
+       {
+#undef CPUENTRY
+#define        CPUENTRY(idx) idx
+        CPUENTRY(0),
+        CPUENTRY(1),
+        CPUENTRY(2),
+        CPUENTRY(3),
+        CPUENTRY(4),
+        CPUENTRY(5),
+        CPUENTRY(6),
+        CPUENTRY(7),
+        CPUENTRY(8),
+        CPUENTRY(9),
+        CPUENTRY(10),
+        CPUENTRY(11),
+        CPUENTRY(12),
+        CPUENTRY(13),
+        CPUENTRY(14),
+        CPUENTRY(15),
+        CPUENTRY(16),
+        CPUENTRY(17),
+        CPUENTRY(18),
+        CPUENTRY(19),
+        CPUENTRY(20),
+        CPUENTRY(21),
+        CPUENTRY(22),
+        CPUENTRY(23),
+        CPUENTRY(24),
+        CPUENTRY(25),
+        CPUENTRY(26),
+        CPUENTRY(27),
+        CPUENTRY(28),
+        CPUENTRY(29),
+        CPUENTRY(30),
+        31},
+       {38400, 38400},
+       {
+        __va(find_property),
+        __va(leon_strcmp),
+        __va(leon_memcpy),
+        __phy(leon_reboot_physical),
+        },
+       {
+        {__va(spi.s_device_type), __va(spi.s_idprom), 4},
+        {__va(spi.s_idprom), (char *)__va(&spi.idprom), sizeof(struct idprom)},
+        {__va(spi.s_compatability), __va(spi.s_leon2), 5},
+        {NULL, NULL, -1}
+        },
+       {
+        {__va(spi.s_device_type), __va(spi.s_cpu), 4},
+        {__va(spi.s_mid), __va(&spi.mids[0]), 4},
+        {__va(spi.s_mmu_nctx), (char *)__va(&spi.leon_nctx), 4},
+        {__va(spi.s_frequency), (char *)__va(&spi.freq_khz), 4},
+        {__va(spi.s_uart1_baud), (char *)__va(&spi.baudrates[0]), 4},
+        {__va(spi.s_uart2_baud), (char *)__va(&spi.baudrates[1]), 4},
+        {NULL, NULL, -1}
+        },
+#undef  CPUENTRY
+#define CPUENTRY(idx) \
+       { /* cpu_properties */                                          \
+               {__va(spi.s_device_type), __va(spi.s_cpu), 4},          \
+               {__va(spi.s_mid), __va(&spi.mids[idx]), 4},                     \
+               {__va(spi.s_frequency), (char *)__va(&spi.freq_khz), 4},        \
+               {NULL, NULL, -1}                                                \
+       }
+       CPUENTRY(1),
+       CPUENTRY(2),
+       CPUENTRY(3),
+       CPUENTRY(4),
+       CPUENTRY(5),
+       CPUENTRY(6),
+       CPUENTRY(7),
+       CPUENTRY(8),
+       CPUENTRY(9),
+       CPUENTRY(10),
+       CPUENTRY(11),
+       CPUENTRY(12),
+       CPUENTRY(13),
+       CPUENTRY(14),
+       CPUENTRY(15),
+       CPUENTRY(16),
+       CPUENTRY(17),
+       CPUENTRY(18),
+       CPUENTRY(19),
+       CPUENTRY(20),
+       CPUENTRY(21),
+       CPUENTRY(22),
+       CPUENTRY(23),
+       CPUENTRY(24),
+       CPUENTRY(25),
+       CPUENTRY(26),
+       CPUENTRY(27),
+       CPUENTRY(28),
+       CPUENTRY(29),
+       CPUENTRY(30),
+       CPUENTRY(31),
+       {
+        0x01,                  /* format */
+        M_LEON2 | M_LEON2_SOC, /* machine type */
+        {0, 0, 0, 0, 0, 0},    /* eth */
+        0,                     /* date */
+        0,                     /* sernum */
+        0,                     /* checksum */
+        {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}       /* reserved */
+        },
+       {
+        __va(no_nextnode),
+        __va(no_child),
+        __va(no_proplen),
+        __va(no_getprop),
+        __va(no_setprop),
+        __va(no_nextprop)
+        },
+       __va(&spi.totphys),
+       {
+        NULL,
+        (char *)CFG_SDRAM_BASE,
+        0,
+        },
+       __va(&spi.avail),
+       {
+        NULL,
+        (char *)CFG_SDRAM_BASE,
+        0,
+        },
+       NULL,                   /* prommap_p */
+       NULL,
+       __va(&spi.bootargs),
+       {
+        {NULL, __va(spi.arg), NULL /*... */ },
+        /*... */
+        },
+       {
+        0,
+        0,                     /* sun4c v0 prom */
+        0, 0,
+        {__va(&spi.totphys_p), __va(&spi.prommap_p), __va(&spi.avail_p)},
+        __va(&spi.nodeops),
+        NULL, {NULL /* ... */ },
+        NULL, NULL,
+        NULL, NULL,            /* pv_getchar, pv_putchar */
+        __va(leon_nbgetchar), __va(leon_nbputchar),
+        NULL,
+        __va(leon_reboot),
+        NULL,
+        NULL,
+        NULL,
+        __va(leon_halt),
+        __va(&spi.synchook),
+        {NULL},
+        __va(&spi.bootargs_p)
+        /*... */
+        },
+       {
+        {0, __va(spi.root_properties + 3) /* NULL, NULL, -1 */ },
+        {0, __va(spi.root_properties)},
+        /* cpu 0, must be spi.nodes[2] see leon_prom_init() */
+        {1, __va(spi.cpu_properties)},
+
+#undef  CPUENTRY
+#define CPUENTRY(idx) \
+         {1, __va(spi.cpu_properties##idx) }   /* cpu <idx> */
+        CPUENTRY(1),
+        CPUENTRY(2),
+        CPUENTRY(3),
+        CPUENTRY(4),
+        CPUENTRY(5),
+        CPUENTRY(6),
+        CPUENTRY(7),
+        CPUENTRY(8),
+        CPUENTRY(9),
+        CPUENTRY(10),
+        CPUENTRY(11),
+        CPUENTRY(12),
+        CPUENTRY(13),
+        CPUENTRY(14),
+        CPUENTRY(15),
+        CPUENTRY(16),
+        CPUENTRY(17),
+        CPUENTRY(18),
+        CPUENTRY(19),
+        CPUENTRY(20),
+        CPUENTRY(21),
+        CPUENTRY(22),
+        CPUENTRY(23),
+        CPUENTRY(24),
+        CPUENTRY(25),
+        CPUENTRY(26),
+        CPUENTRY(27),
+        CPUENTRY(28),
+        CPUENTRY(29),
+        CPUENTRY(30),
+        CPUENTRY(31),
+        {-1, __va(spi.root_properties + 3) /* NULL, NULL, -1 */ }
+        },
+       "device_type",
+       "cpu",
+       "mid",
+       "idprom",
+       "compatability",
+       "leon2",
+       "mmu-nctx",
+       "clock-frequency",
+       "uart1_baud",
+       "uart2_baud",
+       CONFIG_DEFAULT_KERNEL_COMMAND_LINE
+};
+
+/* from arch/sparc/kernel/setup.c */
+#define RAMDISK_LOAD_FLAG 0x4000
+extern unsigned short root_flags;
+extern unsigned short root_dev;
+extern unsigned short ram_flags;
+extern unsigned int sparc_ramdisk_image;
+extern unsigned int sparc_ramdisk_size;
+extern int root_mountflags;
+
+extern char initrd_end, initrd_start;
+
+/* Reboot the CPU = jump to beginning of flash again.
+ *
+ * Make sure that all function are inlined here.
+ */
+static void PROM_TEXT leon_reboot(char *bcommand)
+{
+       register char *arg = bcommand;
+       void __attribute__ ((noreturn)) (*reboot_physical) (char *cmd);
+
+       /* get physical address */
+       struct leon_prom_info *pspi =
+           (void *)(CFG_PROM_OFFSET + sizeof(srmmu_tables));
+
+       unsigned int *srmmu_ctx_table;
+
+       /* Turn of Interrupts */
+       set_pil(0xf);
+
+       /* Set kernel's context, context zero */
+       srmmu_set_context(0);
+
+       /* Get physical address of the MMU shutdown routine */
+       reboot_physical = (void *)
+           SPARC_BYPASS_READ(&pspi->reloc_funcs.reboot_physical);
+
+       /* Now that we know the physical address of the function
+        * we can make the MMU allow jumping to it.
+        */
+       srmmu_ctx_table = (unsigned int *)srmmu_get_ctable_ptr();
+
+       srmmu_ctx_table = (unsigned int *)SPARC_BYPASS_READ(srmmu_ctx_table);
+
+       /* get physical address of kernel's context table (assume ptd) */
+       srmmu_ctx_table = (unsigned int *)
+           (((unsigned int)srmmu_ctx_table & 0xfffffffc) << 4);
+
+       /* enable access to physical address of MMU shutdown function */
+       SPARC_BYPASS_WRITE(&srmmu_ctx_table
+                          [((unsigned int)reboot_physical) >> 24],
+                          (((unsigned int)reboot_physical & 0xff000000) >> 4) |
+                          0x1e);
+
+       /* flush TLB cache */
+       leon_flush_tlb_all();
+
+       /* flash instruction & data cache */
+       sparc_icache_flush_all();
+       sparc_dcache_flush_all();
+
+       /* jump to physical address function
+        * so that when the MMU is disabled
+        * we can continue to execute
+        */
+       reboot_physical(arg);
+}
+
+static void PROM_TEXT leon_reboot_physical(char *bcommand)
+{
+       void __attribute__ ((noreturn)) (*reset) (void);
+
+       /* Turn off MMU */
+       srmmu_set_mmureg(0);
+
+       /* Hardcoded start address */
+       reset = CFG_MONITOR_BASE;
+
+       /* flush data cache */
+       sparc_dcache_flush_all();
+
+       /* flush instruction cache */
+       sparc_icache_flush_all();
+
+       /* Jump to start in Flash */
+       reset();
+}
+
+static void PROM_TEXT leon_halt(void)
+{
+       while (1) ;
+}
+
+/* get single char, don't care for blocking*/
+static int PROM_TEXT leon_nbgetchar(void)
+{
+       return -1;
+}
+
+/* put single char, don't care for blocking*/
+static int PROM_TEXT leon_nbputchar(int c)
+{
+       ambapp_dev_apbuart *uart;
+
+       /* get physical address */
+       struct leon_prom_info *pspi =
+           (void *)(CFG_PROM_OFFSET + sizeof(srmmu_tables));
+
+       uart = (ambapp_dev_apbuart *)
+           SPARC_BYPASS_READ(&pspi->reloc_funcs.leon3_apbuart);
+
+       /* no UART? */
+       if (!uart)
+               return 0;
+
+       /***** put char in buffer... ***********
+        * Make sure all functions are inline! *
+        ***************************************/
+
+       /* Wait for last character to go. */
+       while (!(SPARC_BYPASS_READ(&uart->status)
+                & LEON_REG_UART_STATUS_THE)) ;
+
+       /* Send data */
+       SPARC_BYPASS_WRITE(&uart->data, c);
+
+       /* Wait for data to be sent */
+       while (!(SPARC_BYPASS_READ(&uart->status)
+                & LEON_REG_UART_STATUS_TSE)) ;
+
+       return 0;
+}
+
+/* node ops */
+
+/*#define nodes ((struct node *)__va(&pspi->nodes))*/
+#define nodes ((struct node *)(pspi->nodes))
+
+static int PROM_TEXT no_nextnode(int node)
+{
+       /* get physical address */
+       struct leon_prom_info *pspi =
+           (void *)(CFG_PROM_OFFSET + sizeof(srmmu_tables));
+
+       /* convert into virtual address */
+       pspi = (struct leon_prom_info *)
+           (((unsigned int)pspi & 0x0fffffff) | PAGE_OFFSET);
+
+       if (nodes[node].level == nodes[node + 1].level)
+               return node + 1;
+       return -1;
+}
+
+static int PROM_TEXT no_child(int node)
+{
+       /* get physical address */
+       struct leon_prom_info *pspi = (struct leon_prom_info *)
+           (CFG_PROM_OFFSET + sizeof(srmmu_tables));
+
+       /* convert into virtual address */
+       pspi = (struct leon_prom_info *)
+           (((unsigned int)pspi & 0x0fffffff) | PAGE_OFFSET);
+
+       if (nodes[node].level == nodes[node + 1].level - 1)
+               return node + 1;
+       return -1;
+}
+
+static struct property PROM_TEXT *find_property(int node, char *name)
+{
+       /* get physical address */
+       struct leon_prom_info *pspi = (struct leon_prom_info *)
+           (CFG_PROM_OFFSET + sizeof(srmmu_tables));
+
+       /* convert into virtual address */
+       pspi = (struct leon_prom_info *)
+           (((unsigned int)pspi & 0x0fffffff) | PAGE_OFFSET);
+
+       struct property *prop = &nodes[node].properties[0];
+       while (prop && prop->name) {
+               if (pspi->reloc_funcs.strcmp(prop->name, name) == 0)
+                       return prop;
+               prop++;
+       }
+       return NULL;
+}
+
+static int PROM_TEXT no_proplen(int node, char *name)
+{
+       /* get physical address */
+       struct leon_prom_info *pspi = (struct leon_prom_info *)
+           (CFG_PROM_OFFSET + sizeof(srmmu_tables));
+
+       /* convert into virtual address */
+       pspi = (struct leon_prom_info *)
+           (((unsigned int)pspi & 0x0fffffff) | PAGE_OFFSET);
+
+       struct property *prop = pspi->reloc_funcs.find_property(node, name);
+       if (prop)
+               return prop->length;
+       return -1;
+}
+
+static int PROM_TEXT no_getprop(int node, char *name, char *value)
+{
+       /* get physical address */
+       struct leon_prom_info *pspi = (struct leon_prom_info *)
+           (CFG_PROM_OFFSET + sizeof(srmmu_tables));
+
+       /* convert into virtual address */
+       pspi = (struct leon_prom_info *)
+           (((unsigned int)pspi & 0x0fffffff) | PAGE_OFFSET);
+
+       struct property *prop = pspi->reloc_funcs.find_property(node, name);
+       if (prop) {
+               pspi->reloc_funcs.memcpy(value, prop->value, prop->length);
+               return 1;
+       }
+       return -1;
+}
+
+static int PROM_TEXT no_setprop(int node, char *name, char *value, int len)
+{
+       return -1;
+}
+
+static char PROM_TEXT *no_nextprop(int node, char *name)
+{
+       /* get physical address */
+       struct leon_prom_info *pspi = (struct leon_prom_info *)
+           (CFG_PROM_OFFSET + sizeof(srmmu_tables));
+       struct property *prop;
+
+       /* convert into virtual address */
+       pspi = (struct leon_prom_info *)
+           (((unsigned int)pspi & 0x0fffffff) | PAGE_OFFSET);
+
+       if (!name || !name[0])
+               return nodes[node].properties[0].name;
+
+       prop = pspi->reloc_funcs.find_property(node, name);
+       if (prop)
+               return prop[1].name;
+       return NULL;
+}
+
+static int PROM_TEXT leon_strcmp(const char *s1, const char *s2)
+{
+       register char result;
+
+       while (1) {
+               result = *s1 - *s2;
+               if (result || !*s1)
+                       break;
+               s2++;
+               s1++;
+       }
+
+       return result;
+}
+
+static void *PROM_TEXT leon_memcpy(void *dest, const void *src, size_t n)
+{
+       char *dst = (char *)dest, *source = (char *)src;
+
+       while (n--) {
+               *dst = *source;
+               dst++;
+               source++;
+       }
+       return dest;
+}
+
+#define GETREGSP(sp) __asm__ __volatile__("mov %%sp, %0" : "=r" (sp))
+
+void leon_prom_init(struct leon_prom_info *pspi)
+{
+       unsigned long i;
+       unsigned char cksum, *ptr;
+       char *addr_str, *end;
+       unsigned long sp;
+       GETREGSP(sp);
+
+       pspi->freq_khz = CONFIG_SYS_CLK_FREQ / 1000;
+
+       /* Set Available main memory size */
+       pspi->totphys.num_bytes = CFG_PROM_OFFSET - CFG_SDRAM_BASE;
+       pspi->avail.num_bytes = pspi->totphys.num_bytes;
+
+       /* Set the pointer to the Console UART in romvec */
+       pspi->reloc_funcs.leon3_apbuart = leon3_apbuart;
+
+       {
+               int j = 1;
+#ifdef CONFIG_SMP
+               ambapp_dev_irqmp *b;
+               b = (ambapp_dev_irqmp *) leon3_getapbbase(VENDOR_GAISLER,
+                                                         GAISLER_IRQMP);
+               if (b) {
+                       j = 1 + ((LEON3_BYPASS_LOAD_PA(&(b->mpstatus))
+                                 >> LEON3_IRQMPSTATUS_CPUNR) & 0xf);
+               }
+#endif
+#undef nodes
+               pspi->nodes[2 + j].level = -1;
+               pspi->nodes[2 + j].properties = __va(spi.root_properties + 3);
+       }
+
+       /* Set Ethernet MAC address from environment */
+       if ((addr_str = getenv("ethaddr")) != NULL) {
+               for (i = 0; i < 6; i++) {
+                       pspi->idprom.id_ethaddr[i] = addr_str ?
+                           simple_strtoul(addr_str, &end, 16) : 0;
+                       if (addr_str) {
+                               addr_str = (*end) ? end + 1 : end;
+                       }
+               }
+       } else {
+               /* HW Address not found in environment,
+                * Set default HW address
+                */
+               pspi->idprom.id_ethaddr[0] = 0;
+               pspi->idprom.id_ethaddr[1] = 0;
+               pspi->idprom.id_ethaddr[2] = 0;
+               pspi->idprom.id_ethaddr[3] = 0;
+               pspi->idprom.id_ethaddr[4] = 0;
+               pspi->idprom.id_ethaddr[5] = 0;
+       }
+
+       ptr = (unsigned char *)&pspi->idprom;
+       for (i = cksum = 0; i <= 0x0E; i++)
+               cksum ^= *ptr++;
+       pspi->idprom.id_cksum = cksum;
+}
+
+static inline void set_cache(unsigned long regval)
+{
+       asm volatile ("sta %0, [%%g0] %1\n\t":: "r" (regval), "i"(2):"memory");
+}
+
+extern unsigned short bss_start, bss_end;
+
+/* mark as section .img.main.text, to be referenced in linker script */
+int prom_init(void)
+{
+       struct leon_prom_info *pspi = (void *)
+           ((((unsigned int)&spi) & PROM_SIZE_MASK) + CFG_PROM_OFFSET);
+
+       /* disable mmu */
+       srmmu_set_mmureg(0x00000000);
+       __asm__ __volatile__("flush\n\t");
+
+       /* init prom info struct */
+       leon_prom_init(pspi);
+
+       kernel_arg_promvec = &pspi->romvec;
+#ifdef PRINT_ROM_VEC
+       printf("Kernel rom vec: 0x%lx\n", (unsigned int)(&pspi->romvec));
+#endif
+       return 0;
+}
+
+/* Copy current kernel boot argument to ROMvec */
+void prepare_bootargs(char *bootargs)
+{
+       struct leon_prom_info *pspi;
+       char *src, *dst;
+       int left;
+
+       /* if no bootargs set, skip copying ==> default bootline */
+       if (bootargs && (*bootargs != '\0')) {
+               pspi = (void *)((((unsigned int)&spi) & PROM_SIZE_MASK) +
+                               CFG_PROM_OFFSET);
+               src = bootargs;
+               dst = &pspi->arg[0];
+               left = 255;     /* max len */
+               while (*src && left > 0) {
+                       *dst++ = *src++;
+                       left--;
+               }
+               /* terminate kernel command line string */
+               *dst = 0;
+       }
+}
+
+void srmmu_init_cpu(unsigned int entry)
+{
+       sparc_srmmu_setup *psrmmu_tables = (void *)
+           ((((unsigned int)&srmmu_tables) & PROM_SIZE_MASK) +
+            CFG_PROM_OFFSET);
+
+       /* Make context 0 (kernel's context) point
+        * to our prepared memory mapping
+        */
+#define PTD 1
+       psrmmu_tables->ctx_table[0] =
+           ((unsigned int)&psrmmu_tables->pgd_table[0x00]) >> 4 | PTD;
+
+       /* Set virtual kernel address 0xf0000000
+        * to SRAM/SDRAM address.
+        * Make it READ/WRITE/EXEC to SuperUser
+        */
+#define PTE 2
+#define ACC_SU_ALL 0x1c
+       psrmmu_tables->pgd_table[0xf0] =
+           (CFG_SDRAM_BASE >> 4) | ACC_SU_ALL | PTE;
+       psrmmu_tables->pgd_table[0xf1] =
+           ((CFG_SDRAM_BASE + 0x1000000) >> 4) | ACC_SU_ALL | PTE;
+       psrmmu_tables->pgd_table[0xf2] =
+           ((CFG_SDRAM_BASE + 0x2000000) >> 4) | ACC_SU_ALL | PTE;
+       psrmmu_tables->pgd_table[0xf3] =
+           ((CFG_SDRAM_BASE + 0x3000000) >> 4) | ACC_SU_ALL | PTE;
+       psrmmu_tables->pgd_table[0xf4] =
+           ((CFG_SDRAM_BASE + 0x4000000) >> 4) | ACC_SU_ALL | PTE;
+       psrmmu_tables->pgd_table[0xf5] =
+           ((CFG_SDRAM_BASE + 0x5000000) >> 4) | ACC_SU_ALL | PTE;
+       psrmmu_tables->pgd_table[0xf6] =
+           ((CFG_SDRAM_BASE + 0x6000000) >> 4) | ACC_SU_ALL | PTE;
+       psrmmu_tables->pgd_table[0xf7] =
+           ((CFG_SDRAM_BASE + 0x7000000) >> 4) | ACC_SU_ALL | PTE;
+
+       /* convert rom vec pointer to virtual address */
+       kernel_arg_promvec = (struct linux_romvec *)
+           (((unsigned int)kernel_arg_promvec & 0x0fffffff) | 0xf0000000);
+
+       /* Set Context pointer to point to context table
+        * 256 contexts supported.
+        */
+       srmmu_set_ctable_ptr((unsigned int)&psrmmu_tables->ctx_table[0]);
+
+       /* Set kernel's context, context zero */
+       srmmu_set_context(0);
+
+       /* Invalidate all Cache */
+       __asm__ __volatile__("flush\n\t");
+
+       srmmu_set_mmureg(0x00000001);
+       leon_flush_tlb_all();
+       leon_flush_cache_all();
+}
diff --git a/cpu/leon3/serial.c b/cpu/leon3/serial.c
new file mode 100644 (file)
index 0000000..27d5cd3
--- /dev/null
@@ -0,0 +1,139 @@
+/* GRLIB APBUART Serial controller driver
+ *
+ * (C) Copyright 2007
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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/processor.h>
+#include <asm/leon.h>
+#include <ambapp.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/* Force cache miss each time a serial controller reg is read */
+#define CACHE_BYPASS 1
+
+#ifdef CACHE_BYPASS
+#define READ_BYTE(var)  SPARC_NOCACHE_READ_BYTE((unsigned int)&(var))
+#define READ_HWORD(var) SPARC_NOCACHE_READ_HWORD((unsigned int)&(var))
+#define READ_WORD(var)  SPARC_NOCACHE_READ((unsigned int)&(var))
+#define READ_DWORD(var) SPARC_NOCACHE_READ_DWORD((unsigned int)&(var))
+#endif
+
+ambapp_dev_apbuart *leon3_apbuart = NULL;
+
+int serial_init(void)
+{
+       ambapp_apbdev apbdev;
+       unsigned int tmp;
+
+       /* find UART */
+       if (ambapp_apb_first(VENDOR_GAISLER, GAISLER_APBUART, &apbdev) == 1) {
+
+               leon3_apbuart = (ambapp_dev_apbuart *) apbdev.address;
+
+               /* found apbuart, let's init...
+                *
+                * Set scaler / baud rate
+                *
+                * Receiver & transmitter enable
+                */
+               leon3_apbuart->scaler = CFG_GRLIB_APBUART_SCALER;
+
+               /* Let bit 11 be unchanged (debug bit for GRMON) */
+               tmp = READ_WORD(leon3_apbuart->ctrl);
+
+               leon3_apbuart->ctrl = ((tmp & LEON_REG_UART_CTRL_DBG) |
+                                      LEON_REG_UART_CTRL_RE |
+                                      LEON_REG_UART_CTRL_TE);
+
+               return 0;
+       }
+       return -1;              /* didn't find hardware */
+}
+
+void serial_putc(const char c)
+{
+       if (c == '\n')
+               serial_putc_raw('\r');
+
+       serial_putc_raw(c);
+}
+
+void serial_putc_raw(const char c)
+{
+       if (!leon3_apbuart)
+               return;
+
+       /* Wait for last character to go. */
+       while (!(READ_WORD(leon3_apbuart->status) & LEON_REG_UART_STATUS_THE)) ;
+
+       /* Send data */
+       leon3_apbuart->data = c;
+
+#ifdef LEON_DEBUG
+       /* Wait for data to be sent */
+       while (!(READ_WORD(leon3_apbuart->status) & LEON_REG_UART_STATUS_TSE)) ;
+#endif
+}
+
+void serial_puts(const char *s)
+{
+       while (*s) {
+               serial_putc(*s++);
+       }
+}
+
+int serial_getc(void)
+{
+       if (!leon3_apbuart)
+               return 0;
+
+       /* Wait for a character to arrive. */
+       while (!(READ_WORD(leon3_apbuart->status) & LEON_REG_UART_STATUS_DR)) ;
+
+       /* read data */
+       return READ_WORD(leon3_apbuart->data);
+}
+
+int serial_tstc(void)
+{
+       if (leon3_apbuart)
+               return (READ_WORD(leon3_apbuart->status) &
+                       LEON_REG_UART_STATUS_DR);
+       return 0;
+}
+
+/* set baud rate for uart */
+void serial_setbrg(void)
+{
+       /* update baud rate settings, read it from gd->baudrate */
+       unsigned int scaler;
+       if (leon3_apbuart && (gd->baudrate > 0)) {
+               scaler =
+                   (((CONFIG_SYS_CLK_FREQ * 10) / (gd->baudrate * 8)) -
+                    5) / 10;
+               leon3_apbuart->scaler = scaler;
+       }
+       return;
+}
diff --git a/cpu/leon3/start.S b/cpu/leon3/start.S
new file mode 100644 (file)
index 0000000..2f1d099
--- /dev/null
@@ -0,0 +1,616 @@
+/* This is where the SPARC/LEON3 starts
+ * Copyright (C) 2007,
+ * Daniel Hellstrom, daniel@gaisler.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 <asm/asmmacro.h>
+#include <asm/winmacro.h>
+#include <asm/psr.h>
+#include <asm/stack.h>
+#include <asm/leon.h>
+#include <version.h>
+
+/* Entry for traps which jump to a programmer-specified trap handler.  */
+#define TRAPR(H)  \
+       wr      %g0, 0xfe0, %psr; \
+       mov     %g0, %tbr; \
+       ba      (H); \
+       mov     %g0, %wim;
+
+#define TRAP(H) \
+       mov     %psr, %l0; \
+       ba      (H); \
+       nop; nop;
+
+#define TRAPI(ilevel) \
+       mov     ilevel, %l7; \
+       mov     %psr, %l0; \
+       b       _irq_entry; \
+       mov     %wim, %l3
+
+/* Unexcpected trap will halt the processor by forcing it to error state */
+#undef BAD_TRAP
+#define BAD_TRAP ta 0; nop; nop; nop;
+
+/* Software trap. Treat as BAD_TRAP for the time being... */
+#define SOFT_TRAP TRAP(_hwerr)
+
+#define PSR_INIT   0x1FC0      /* Disable traps, set s and ps */
+#define WIM_INIT   2
+
+/* All traps low-level code here must end with this macro. */
+#define RESTORE_ALL b ret_trap_entry; clr %l6;
+
+#define WRITE_PAUSE nop;nop;nop
+
+WINDOWSIZE = (16 * 4)
+ARGPUSHSIZE = (6 * 4)
+ARGPUSH = (WINDOWSIZE + 4)
+MINFRAME = (WINDOWSIZE + ARGPUSHSIZE + 4)
+
+/* Number of register windows */
+#ifndef CFG_SPARC_NWINDOWS
+#error Must define number of SPARC register windows, default is 8
+#endif
+
+#define STACK_ALIGN    8
+#define SA(X)  (((X)+(STACK_ALIGN-1)) & ~(STACK_ALIGN-1))
+
+       .section ".start", "ax"
+       .globl  _start, start, _trap_table
+       .globl  _irq_entry, nmi_trap
+       .globl  _reset_reloc
+
+/* at address 0
+ * Hardware traps
+ */
+start:
+_start:
+_trap_table:
+       TRAPR(_hardreset);              ! 00 reset trap
+       BAD_TRAP;                       ! 01 instruction_access_exception
+       BAD_TRAP;                       ! 02 illegal_instruction
+       BAD_TRAP;                       ! 03 priveleged_instruction
+       BAD_TRAP;                       ! 04 fp_disabled
+       TRAP(_window_overflow);         ! 05 window_overflow
+       TRAP(_window_underflow);        ! 06 window_underflow
+       BAD_TRAP;                       ! 07 Memory Address Not Aligned
+       BAD_TRAP;                       ! 08 Floating Point Exception
+       BAD_TRAP;                       ! 09 Data Miss Exception
+       BAD_TRAP;                       ! 0a Tagged Instruction Ovrflw
+       BAD_TRAP;                       ! 0b Watchpoint Detected
+       BAD_TRAP;                       ! 0c
+       BAD_TRAP;                       ! 0d
+       BAD_TRAP;                       ! 0e
+       BAD_TRAP;                       ! 0f
+       BAD_TRAP;                       ! 10
+       TRAPI(1);                       ! 11 IRQ level 1
+       TRAPI(2);                       ! 12 IRQ level 2
+       TRAPI(3);                       ! 13 IRQ level 3
+       TRAPI(4);                       ! 14 IRQ level 4
+       TRAPI(5);                       ! 15 IRQ level 5
+       TRAPI(6);                       ! 16 IRQ level 6
+       TRAPI(7);                       ! 17 IRQ level 7
+       TRAPI(8);                       ! 18 IRQ level 8
+       TRAPI(9);                       ! 19 IRQ level 9
+       TRAPI(10);                      ! 1a IRQ level 10
+       TRAPI(11);                      ! 1b IRQ level 11
+       TRAPI(12);                      ! 1c IRQ level 12
+       TRAPI(13);                      ! 1d IRQ level 13
+       TRAPI(14);                      ! 1e IRQ level 14
+       TRAP(_nmi_trap);                ! 1f IRQ level 15 /
+                                       ! NMI (non maskable interrupt)
+       BAD_TRAP;                       ! 20 r_register_access_error
+       BAD_TRAP;                       ! 21 instruction access error
+       BAD_TRAP;                       ! 22
+       BAD_TRAP;                       ! 23
+       BAD_TRAP;                       ! 24 co-processor disabled
+       BAD_TRAP;                       ! 25 uniplemented FLUSH
+       BAD_TRAP;                       ! 26
+       BAD_TRAP;                       ! 27
+       BAD_TRAP;                       ! 28 co-processor exception
+       BAD_TRAP;                       ! 29 data access error
+       BAD_TRAP;                       ! 2a division by zero
+       BAD_TRAP;                       ! 2b data store error
+       BAD_TRAP;                       ! 2c data access MMU miss
+       BAD_TRAP;                       ! 2d
+       BAD_TRAP;                       ! 2e
+       BAD_TRAP;                       ! 2f
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 30-33
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 34-37
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 38-3b
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 3c-3f
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 40-43
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 44-47
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 48-4b
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 4c-4f
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 50-53
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 54-57
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 58-5b
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 5c-5f
+
+       /* implementaion dependent */
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 60-63
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 64-67
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 68-6b
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 6c-6f
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 70-73
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 74-77
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 78-7b
+       BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 7c-7f
+
+       /* Software traps, not handled */
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! 80-83
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! 84-87
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! 88-8b
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! 8c-8f
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! 90-93
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! 94-97
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! 98-9b
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! 9c-9f
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! a0-a3
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! a4-a7
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! a8-ab
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! ac-af
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! b0-b3
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! b4-b7
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! b8-bb
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! bc-bf
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! c0-c3
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! c4-c7
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! c8-cb
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! cc-cf
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! d0-d3
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! d4-d7
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! d8-db
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! dc-df
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! e0-e3
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! e4-e7
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! e8-eb
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! ec-ef
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! f0-f3
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! f4-f7
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! f8-fb
+       SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP;     ! fc-ff
+/*
+ * Version string
+ */
+
+       .data
+       .extern leon3_snooping_avail
+       .globl  version_string
+version_string:
+       .ascii U_BOOT_VERSION
+       .ascii " (", __DATE__, " - ", __TIME__, ")"
+       .ascii CONFIG_IDENT_STRING, "\0"
+
+       .section        ".text"
+       .align 4
+
+_hardreset:
+1000:
+       flush
+
+       /* Enable I/D-Cache and Snooping */
+       set     0x0081000f, %g2
+       sta     %g2, [%g0] 2
+
+       mov     %g0, %y
+       clr     %g1
+       clr     %g2
+       clr     %g3
+       clr     %g4
+       clr     %g5
+       clr     %g6
+       clr     %g7
+
+       mov     %asr17, %g3
+       and     %g3, 0x1f, %g3
+clear_window:
+       mov     %g0, %l0
+       mov     %g0, %l1
+       mov     %g0, %l2
+       mov     %g0, %l3
+       mov     %g0, %l4
+       mov     %g0, %l5
+       mov     %g0, %l6
+       mov     %g0, %l7
+       mov     %g0, %o0
+       mov     %g0, %o1
+       mov     %g0, %o2
+       mov     %g0, %o3
+       mov     %g0, %o4
+       mov     %g0, %o5
+       mov     %g0, %o6
+       mov     %g0, %o7
+       subcc   %g3, 1, %g3
+       bge     clear_window
+       save
+
+wininit:
+       set     WIM_INIT, %g3
+       mov     %g3, %wim
+
+stackp:
+       set     CFG_INIT_SP_OFFSET, %fp
+       andn    %fp, 0x0f, %fp
+       sub     %fp, 64, %sp
+
+cpu_init_unreloc:
+       call    cpu_init_f
+       nop
+
+/* un relocated start address of monitor */
+#define TEXT_START _text
+
+/* un relocated end address of monitor */
+#define DATA_END __init_end
+
+reloc:
+       set     TEXT_START,%g2
+       set     DATA_END,%g3
+       set     CFG_RELOC_MONITOR_BASE,%g4
+reloc_loop:
+       ldd     [%g2],%l0
+       ldd     [%g2+8],%l2
+       std     %l0,[%g4]
+       std     %l2,[%g4+8]
+       inc     16,%g2
+       subcc   %g3,%g2,%g0
+       bne     reloc_loop
+       inc     16,%g4
+
+       clr     %l0
+       clr     %l1
+       clr     %l2
+       clr     %l3
+       clr     %g2
+
+/* register g4 contain address to start
+ * This means that BSS must be directly after data and code segments
+ *
+ * g3 is length of bss = (__bss_end-__bss_start)
+ *
+ */
+
+clr_bss:
+/* clear bss area (the relocated) */
+       set     __bss_start,%g2
+       set     __bss_end,%g3
+       sub     %g3,%g2,%g3
+       add     %g3,%g4,%g3
+       clr     %g1     /* std %g0 uses g0 and g1 */
+/* clearing 16byte a time ==> linker script need to align to 16 byte offset */
+clr_bss_16:
+       std     %g0,[%g4]
+       std     %g0,[%g4+8]
+       inc     16,%g4
+       cmp     %g3,%g4
+       bne     clr_bss_16
+       nop
+
+/* add offsets to GOT table */
+fixup_got:
+       set     __got_start,%g4
+       set     __got_end,%g3
+/*
+ * new got offset = (old GOT-PTR (read with ld) -
+ *   CFG_RELOC_MONITOR_BASE(from define) ) +
+ *   Destination Address (from define)
+ */
+       set     CFG_RELOC_MONITOR_BASE,%g2
+       set     TEXT_START, %g1
+       add     %g4,%g2,%g4
+       sub     %g4,%g1,%g4
+       add     %g3,%g2,%g3
+       sub     %g3,%g1,%g3
+       sub     %g2,%g1,%g2     ! prepare register with (new base address) -
+                               !  (old base address)
+got_loop:
+       ld      [%g4],%l0       ! load old GOT-PTR
+       add     %l0,%g2,%l0     ! increase with (new base address) -
+                               !  (old base)
+       st      %l0,[%g4]
+       inc     4,%g4
+       cmp     %g3,%g4
+       bne     got_loop
+       nop
+
+prom_relocate:
+       set     __prom_start, %g2
+       set     __prom_end, %g3
+       set     CFG_PROM_OFFSET, %g4
+
+prom_relocate_loop:
+       ldd     [%g2],%l0
+       ldd     [%g2+8],%l2
+       std     %l0,[%g4]
+       std     %l2,[%g4+8]
+       inc     16,%g2
+       subcc   %g3,%g2,%g0
+       bne     prom_relocate_loop
+       inc     16,%g4
+
+/* Trap table has been moved, lets tell CPU about
+ * the new trap table address
+ */
+
+       set     CFG_RELOC_MONITOR_BASE, %g2
+       wr      %g0, %g2, %tbr
+       nop
+       nop
+       nop
+
+/* If CACHE snooping is available in hardware the
+ * variable leon3_snooping_avail will be set to
+ * 0x800000 else 0.
+ */
+snoop_detect:
+       sethi   %hi(0x00800000), %o0
+       lda     [%g0] 2, %o1
+       and     %o0, %o1, %o0
+       sethi   %hi(leon3_snooping_avail+CFG_RELOC_MONITOR_BASE-TEXT_BASE), %o1
+       st      %o0, [%lo(leon3_snooping_avail+CFG_RELOC_MONITOR_BASE-TEXT_BASE)+%o1]
+
+/*     call    relocate*/
+       nop
+/* Call relocated init functions */
+jump:
+       set     cpu_init_f2,%o1
+       set     CFG_RELOC_MONITOR_BASE,%o2
+       add     %o1,%o2,%o1
+       sub     %o1,%g1,%o1
+       call    %o1
+       clr     %o0
+
+       set     board_init_f,%o1
+       set     CFG_RELOC_MONITOR_BASE,%o2
+       add     %o1,%o2,%o1
+       sub     %o1,%g1,%o1
+       call    %o1
+       clr     %o0
+
+dead:  ta 0                            ! if call returns...
+       nop
+
+/* Interrupt handler caller,
+ * reg L7: interrupt number
+ * reg L0: psr after interrupt
+ * reg L1: PC
+ * reg L2: next PC
+ * reg L3: wim
+ */
+_irq_entry:
+       SAVE_ALL
+
+       or      %l0, PSR_PIL, %g2
+       wr      %g2, 0x0, %psr
+       WRITE_PAUSE
+       wr      %g2, PSR_ET, %psr
+       WRITE_PAUSE
+       mov     %l7, %o0                ! irq level
+       set     handler_irq, %o1
+       set     (CFG_RELOC_MONITOR_BASE-TEXT_BASE), %o2
+       add     %o1, %o2, %o1
+       call    %o1
+       add     %sp, SF_REGS_SZ, %o1    ! pt_regs ptr
+       or      %l0, PSR_PIL, %g2       ! restore PIL after handler_irq
+       wr      %g2, PSR_ET, %psr       ! keep ET up
+       WRITE_PAUSE
+
+       RESTORE_ALL
+
+!Window overflow trap handler.
+       .global _window_overflow
+
+_window_overflow:
+
+       mov     %wim, %l3               ! Calculate next WIM
+       mov     %g1, %l7
+       srl     %l3, 1, %g1
+       sll     %l3, (CFG_SPARC_NWINDOWS-1) , %l4
+       or      %l4, %g1, %g1
+
+       save                            ! Get into window to be saved.
+       mov     %g1, %wim
+       nop;
+       nop;
+       nop
+       st      %l0, [%sp + 0];
+       st      %l1, [%sp + 4];
+       st      %l2, [%sp + 8];
+       st      %l3, [%sp + 12];
+       st      %l4, [%sp + 16];
+       st      %l5, [%sp + 20];
+       st      %l6, [%sp + 24];
+       st      %l7, [%sp + 28];
+       st      %i0, [%sp + 32];
+       st      %i1, [%sp + 36];
+       st      %i2, [%sp + 40];
+       st      %i3, [%sp + 44];
+       st      %i4, [%sp + 48];
+       st      %i5, [%sp + 52];
+       st      %i6, [%sp + 56];
+       st      %i7, [%sp + 60];
+       restore                         ! Go back to trap window.
+       mov     %l7, %g1
+       jmp     %l1                     ! Re-execute save.
+       rett    %l2
+
+/* Window underflow trap handler.  */
+
+       .global  _window_underflow
+
+_window_underflow:
+
+       mov  %wim, %l3                  ! Calculate next WIM
+       sll  %l3, 1, %l4
+       srl  %l3, (CFG_SPARC_NWINDOWS-1), %l5
+       or   %l5, %l4, %l5
+       mov  %l5, %wim
+       nop; nop; nop
+       restore                         ! Two restores to get into the
+       restore                         ! window to restore
+       ld      [%sp + 0], %l0;         ! Restore window from the stack
+       ld      [%sp + 4], %l1;
+       ld      [%sp + 8], %l2;
+       ld      [%sp + 12], %l3;
+       ld      [%sp + 16], %l4;
+       ld      [%sp + 20], %l5;
+       ld      [%sp + 24], %l6;
+       ld      [%sp + 28], %l7;
+       ld      [%sp + 32], %i0;
+       ld      [%sp + 36], %i1;
+       ld      [%sp + 40], %i2;
+       ld      [%sp + 44], %i3;
+       ld      [%sp + 48], %i4;
+       ld      [%sp + 52], %i5;
+       ld      [%sp + 56], %i6;
+       ld      [%sp + 60], %i7;
+       save                            ! Get back to the trap window.
+       save
+       jmp     %l1                     ! Re-execute restore.
+       rett    %l2
+
+       retl
+
+_nmi_trap:
+       nop
+       jmp %l1
+       rett %l2
+
+_hwerr:
+       ta 0
+       nop
+       nop
+       b _hwerr                        ! loop infinite
+       nop
+
+/* Registers to not touch at all. */
+#define t_psr      l0 /* Set by caller */
+#define t_pc       l1 /* Set by caller */
+#define t_npc      l2 /* Set by caller */
+#define t_wim      l3 /* Set by caller */
+#define t_twinmask l4 /* Set at beginning of this entry routine. */
+#define t_kstack   l5 /* Set right before pt_regs frame is built */
+#define t_retpc    l6 /* If you change this, change winmacro.h header file */
+#define t_systable l7 /* Never touch this, could be the syscall table ptr. */
+#define curptr     g6 /* Set after pt_regs frame is built */
+
+trap_setup:
+/* build a pt_regs trap frame. */
+       sub     %fp, (SF_REGS_SZ + PT_REGS_SZ), %t_kstack
+       PT_STORE_ALL(t_kstack, t_psr, t_pc, t_npc, g2)
+
+       /* See if we are in the trap window. */
+       mov     1, %t_twinmask
+       sll     %t_twinmask, %t_psr, %t_twinmask ! t_twinmask = (1 << psr)
+       andcc   %t_twinmask, %t_wim, %g0
+       beq     1f              ! in trap window, clean up
+       nop
+
+       /*-------------------------------------------------
+        * Spill , adjust %wim and go.
+        */
+       srl     %t_wim, 0x1, %g2                ! begin computation of new %wim
+
+       set     (CFG_SPARC_NWINDOWS-1), %g3     !NWINDOWS-1
+
+       sll     %t_wim, %g3, %t_wim     ! NWINDOWS-1
+       or      %t_wim, %g2, %g2
+       and     %g2, 0xff, %g2
+
+       save    %g0, %g0, %g0           ! get in window to be saved
+
+       /* Set new %wim value */
+       wr      %g2, 0x0, %wim
+
+       /* Save the kernel window onto the corresponding stack. */
+       RW_STORE(sp)
+
+       restore %g0, %g0, %g0
+       /*-------------------------------------------------*/
+
+1:
+       /* Trap from kernel with a window available.
+        * Just do it...
+        */
+       jmpl    %t_retpc + 0x8, %g0     ! return to caller
+        mov    %t_kstack, %sp          ! jump onto new stack
+
+#define twin_tmp1 l4
+#define glob_tmp  g4
+#define curptr    g6
+ret_trap_entry:
+       wr      %t_psr, 0x0, %psr       ! enable nesting again, clear ET
+
+       /* Will the rett land us in the invalid window? */
+       mov     2, %g1
+       sll     %g1, %t_psr, %g1
+
+       set     CFG_SPARC_NWINDOWS, %g2 !NWINDOWS
+
+       srl     %g1, %g2, %g2
+       or      %g1, %g2, %g1
+       rd      %wim, %g2
+       andcc   %g2, %g1, %g0
+       be      1f              ! Nope, just return from the trap
+        sll    %g2, 0x1, %g1
+
+       /* We have to grab a window before returning. */
+       set     (CFG_SPARC_NWINDOWS-1), %g3     !NWINDOWS-1
+
+       srl     %g2, %g3,  %g2
+       or      %g1, %g2, %g1
+       and     %g1, 0xff, %g1
+
+       wr      %g1, 0x0, %wim
+
+       /* Grrr, make sure we load from the right %sp... */
+       PT_LOAD_ALL(sp, t_psr, t_pc, t_npc, g1)
+
+       restore %g0, %g0, %g0
+       RW_LOAD(sp)
+       b       2f
+       save    %g0, %g0, %g0
+
+       /* Reload the entire frame in case this is from a
+        * kernel system call or whatever...
+        */
+1:
+       PT_LOAD_ALL(sp, t_psr, t_pc, t_npc, g1)
+2:
+       wr      %t_psr, 0x0, %psr
+       nop;
+       nop;
+       nop
+
+       jmp     %t_pc
+       rett    %t_npc
+
+/* This is called from relocated C-code.
+ * It resets the system by jumping to _start
+ */
+_reset_reloc:
+       set     start, %l0
+       call    %l0
+       nop
diff --git a/cpu/leon3/usb_uhci.c b/cpu/leon3/usb_uhci.c
new file mode 100644 (file)
index 0000000..7910beb
--- /dev/null
@@ -0,0 +1,1313 @@
+/*
+ * Part of this code has been derived from linux:
+ * Universal Host Controller Interface driver for USB (take II).
+ *
+ * (c) 1999-2001 Georg Acher, acher@in.tum.de (executive slave) (base guitar)
+ *               Deti Fliegl, deti@fliegl.de (executive slave) (lead voice)
+ *               Thomas Sailer, sailer@ife.ee.ethz.ch (chief consultant) (cheer leader)
+ *               Roman Weissgaerber, weissg@vienna.at (virt root hub) (studio porter)
+ * (c) 2000      Yggdrasil Computing, Inc. (port of new PCI interface support
+ *               from usb-ohci.c by Adam Richter, adam@yggdrasil.com).
+ * (C) 2000      David Brownell, david-b@pacbell.net (usb-ohci.c)
+ *
+ * HW-initalization based on material of
+ *
+ * (C) Copyright 1999 Linus Torvalds
+ * (C) Copyright 1999 Johannes Erdfelt
+ * (C) Copyright 1999 Randy Dunlap
+ * (C) Copyright 1999 Gregory P. Smith
+ *
+ *
+ * Adapted for U-Boot:
+ * (C) Copyright 2001 Denis Peter, MPL AG Switzerland
+ * (C) Copyright 2008, Daniel Hellström, daniel@gaisler.com
+ *     Added AMBA Plug&Play detection of GRUSB, modified interrupt handler.
+ *     Added cache flushes where needed.
+ *
+ * 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
+ *
+ *
+ */
+
+/**********************************************************************
+ * How it works:
+ * -------------
+ * The framelist / Transfer descriptor / Queue Heads are similar like
+ * in the linux usb_uhci.c.
+ *
+ * During initialization, the following skeleton is allocated in init_skel:
+ *
+ *         framespecific           |           common chain
+ *
+ * framelist[]
+ * [  0 ]-----> TD ---------\
+ * [  1 ]-----> TD ----------> TD ------> QH -------> QH -------> QH ---> NULL
+ *   ...        TD ---------/
+ * [1023]-----> TD --------/
+ *
+ *              ^^             ^^         ^^          ^^          ^^
+ *              7 TDs for      1 TD for   Start of    Start of    End Chain
+ *              INT (2-128ms)  1ms-INT    CTRL Chain  BULK Chain
+ *
+ *
+ * Since this is a bootloader, the isochronous transfer descriptor have been removed.
+ *
+ * Interrupt Transfers.
+ * --------------------
+ * For Interupt transfers USB_MAX_TEMP_INT_TD Transfer descriptor are available. They
+ * will be inserted after the appropriate (depending the interval setting) skeleton TD.
+ * If an interrupt has been detected the dev->irqhandler is called. The status and number
+ * of transfered bytes is stored in dev->irq_status resp. dev->irq_act_len. If the
+ * dev->irqhandler returns 0, the interrupt TD is removed and disabled. If an 1 is returned,
+ * the interrupt TD will be reactivated.
+ *
+ * Control Transfers
+ * -----------------
+ * Control Transfers are issued by filling the tmp_td with the appropriate data and connect
+ * them to the qh_cntrl queue header. Before other control/bulk transfers can be issued,
+ * the programm has to wait for completion. This does not allows asynchronous data transfer.
+ *
+ * Bulk Transfers
+ * --------------
+ * Bulk Transfers are issued by filling the tmp_td with the appropriate data and connect
+ * them to the qh_bulk queue header. Before other control/bulk transfers can be issued,
+ * the programm has to wait for completion. This does not allows asynchronous data transfer.
+ *
+ *
+ */
+
+#include <common.h>
+#include <ambapp.h>
+#include <asm/leon.h>
+#include <asm/leon3.h>
+#include <asm/processor.h>
+
+#ifdef CONFIG_USB_UHCI
+
+#include <usb.h>
+#include "usb_uhci.h"
+
+#define USB_MAX_TEMP_TD      128       /* number of temporary TDs for bulk and control transfers */
+#define USB_MAX_TEMP_INT_TD  32        /* number of temporary TDs for Interrupt transfers */
+
+extern int leon3_snooping_avail;
+/*
+#define out16r(address,data) (*(unsigned short *)(address) = \
+ (unsigned short)( \
+ (((unsigned short)(data)&0xff)<<8) | \
+ (((unsigned short)(data)&0xff00)>>8) \
+ ))
+ */
+#define out16r(address,data) _out16r((unsigned int)(address), (unsigned short)(data))
+void _out16r(unsigned int address, unsigned short data)
+{
+       unsigned short val = (unsigned short)((((unsigned short)(data) & 0xff)
+                                              << 8) | (((unsigned short)(data)
+                                                        & 0xff00) >> 8));
+#ifdef UHCI_DEBUG_REGS
+       printf("out16r(0x%lx,0x%04x = 0x%04x)\n", address, val, data);
+#endif
+       *(unsigned short *)(address) = val;
+}
+
+#define out32r(address,data) _out32r((unsigned int)(address), (unsigned int)(data))
+void _out32r(unsigned int address, unsigned int data)
+{
+       unsigned int val = (unsigned int)((((unsigned int)(data) & 0x000000ff)
+                                          << 24) | (((unsigned int)(data) &
+                                                     0x0000ff00) << 8) |
+                                         (((unsigned int)(data) & 0x00ff0000)
+                                          >> 8) | (((unsigned int)(data) &
+                                                    0xff000000) >> 24));
+#ifdef UHCI_DEBUG_REGS
+       printf("out32r(0x%lx,0x%lx = 0x%lx)\n", address, val, data);
+#endif
+       *(unsigned int *)address = val;
+}
+
+#define in16r(address) _in16r((unsigned int)(address))
+unsigned short _in16r(unsigned int address)
+{
+       unsigned short val = sparc_load_reg_cachemiss_word(address);
+       val = ((val << 8) & 0xff00) | ((val >> 8) & 0xff);
+#ifdef UHCI_DEBUG_REGS
+       printf("in16r(0x%lx): 0x%04x\n", address, val);
+#endif
+       return val;
+}
+
+#define in32r(address) _in32r((unsigned int)(address))
+unsigned int _in32r(unsigned int address)
+{
+       unsigned int val = sparc_load_reg_cachemiss(address);
+       val =
+           ((val << 24) & 0xff000000) | ((val << 8) & 0xff0000) | ((val >> 8) &
+                                                                   0xff00) |
+           ((val >> 24) & 0xff);
+#ifdef UHCI_DEBUG_REGS
+       printf("in32r(0x%lx): 0x%08x\n", address, val);
+#endif
+       return val;
+}
+
+#define READ32(address) sparc_load_reg_cachemiss((unsigned int)(address))
+
+/*#define USB_UHCI_DEBUG*/
+#undef USB_UHCI_DEBUG
+
+void usb_show_td(int max);
+#ifdef USB_UHCI_DEBUG
+void grusb_show_regs(void);
+#define        USB_UHCI_PRINTF(fmt,args...)    printf (fmt ,##args)
+#else
+#define USB_UHCI_PRINTF(fmt,args...)
+#endif
+
+static int grusb_irq = -1;     /* irq vector, if -1 uhci is stopped / reseted */
+unsigned int usb_base_addr;    /* base address */
+
+static uhci_td_t td_int[8] __attribute__ ((aligned(16)));      /* Interrupt Transfer descriptors */
+static uhci_qh_t qh_cntrl __attribute__ ((aligned(16)));       /* control Queue Head */
+static uhci_qh_t qh_bulk __attribute__ ((aligned(16)));        /*  bulk Queue Head */
+static uhci_qh_t qh_end __attribute__ ((aligned(16))); /* end Queue Head */
+static uhci_td_t td_last __attribute__ ((aligned(16)));        /* last TD (linked with end chain) */
+
+/* temporary tds */
+static uhci_td_t tmp_td[USB_MAX_TEMP_TD] __attribute__ ((aligned(16)));        /* temporary bulk/control td's  */
+static uhci_td_t tmp_int_td[USB_MAX_TEMP_INT_TD] __attribute__ ((aligned(16)));        /* temporary interrupt td's  */
+
+static unsigned long framelist[1024] __attribute__ ((aligned(0x1000)));        /* frame list */
+
+static struct virt_root_hub rh;        /* struct for root hub */
+
+/**********************************************************************
+ * some forward decleration
+ */
+int uhci_submit_rh_msg(struct usb_device *dev, unsigned long pipe,
+                      void *buffer, int transfer_len,
+                      struct devrequest *setup);
+
+/* fill a td with the approproiate data. Link, status, info and buffer
+ * are used by the USB controller itselfes, dev is used to identify the
+ * "connected" device
+ */
+void usb_fill_td(uhci_td_t * td, unsigned long link, unsigned long status,
+                unsigned long info, unsigned long buffer, unsigned long dev)
+{
+       td->link = swap_32(link);
+       td->status = swap_32(status);
+       if ((info & UHCI_PID) == 0)
+               info |= USB_PID_OUT;
+       td->info = swap_32(info);
+       td->buffer = swap_32(buffer);
+       td->dev_ptr = dev;
+}
+
+/* fill a qh with the approproiate data. Head and element are used by the USB controller
+ * itselfes. As soon as a valid dev_ptr is filled, a td chain is connected to the qh.
+ * Please note, that after completion of the td chain, the entry element is removed /
+ * marked invalid by the USB controller.
+ */
+void usb_fill_qh(uhci_qh_t * qh, unsigned long head, unsigned long element)
+{
+       qh->head = swap_32(head);
+       qh->element = swap_32(element);
+       qh->dev_ptr = 0L;
+}
+
+/* get the status of a td->status
+ */
+unsigned long usb_uhci_td_stat(unsigned long status)
+{
+       unsigned long result = 0;
+       result |= (status & TD_CTRL_NAK) ? USB_ST_NAK_REC : 0;
+       result |= (status & TD_CTRL_STALLED) ? USB_ST_STALLED : 0;
+       result |= (status & TD_CTRL_DBUFERR) ? USB_ST_BUF_ERR : 0;
+       result |= (status & TD_CTRL_BABBLE) ? USB_ST_BABBLE_DET : 0;
+       result |= (status & TD_CTRL_CRCTIMEO) ? USB_ST_CRC_ERR : 0;
+       result |= (status & TD_CTRL_BITSTUFF) ? USB_ST_BIT_ERR : 0;
+       result |= (status & TD_CTRL_ACTIVE) ? USB_ST_NOT_PROC : 0;
+       return result;
+}
+
+/* get the status and the transfered len of a td chain.
+ * called from the completion handler
+ */
+int usb_get_td_status(uhci_td_t * td, struct usb_device *dev)
+{
+       unsigned long temp, info;
+       unsigned long stat;
+       uhci_td_t *mytd = td;
+
+       if (dev->devnum == rh.devnum)
+               return 0;
+       dev->act_len = 0;
+       stat = 0;
+       do {
+               temp = swap_32((unsigned long)READ32(&mytd->status));
+               stat = usb_uhci_td_stat(temp);
+               info = swap_32((unsigned long)READ32(&mytd->info));
+               if (((info & 0xff) != USB_PID_SETUP) && (((info >> 21) & 0x7ff) != 0x7ff) && (temp & 0x7FF) != 0x7ff) { /* if not setup and not null data pack */
+                       dev->act_len += (temp & 0x7FF) + 1;     /* the transfered len is act_len + 1 */
+               }
+               if (stat) {     /* status no ok */
+                       dev->status = stat;
+                       return -1;
+               }
+               temp = swap_32((unsigned long)READ32(&mytd->link));
+               mytd = (uhci_td_t *) (temp & 0xfffffff0);
+       } while ((temp & 0x1) == 0);    /* process all TDs */
+       dev->status = stat;
+       return 0;               /* Ok */
+}
+
+/*-------------------------------------------------------------------
+ *                         LOW LEVEL STUFF
+ *          assembles QHs und TDs for control, bulk and iso
+ *-------------------------------------------------------------------*/
+int dummy(void)
+{
+       USB_UHCI_PRINTF("DUMMY\n");
+       return 0;
+}
+
+/* Submits a control message. That is a Setup, Data and Status transfer.
+ * Routine does not wait for completion.
+ */
+int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
+                      int transfer_len, struct devrequest *setup)
+{
+       unsigned long destination, status;
+       int maxsze = usb_maxpacket(dev, pipe);
+       unsigned long dataptr;
+       int len;
+       int pktsze;
+       int i = 0;
+
+       if (!maxsze) {
+               USB_UHCI_PRINTF
+                   ("uhci_submit_control_urb: pipesize for pipe %lx is zero\n",
+                    pipe);
+               return -1;
+       }
+       if (((pipe >> 8) & 0x7f) == rh.devnum) {
+               /* this is the root hub -> redirect it */
+               return uhci_submit_rh_msg(dev, pipe, buffer, transfer_len,
+                                         setup);
+       }
+       USB_UHCI_PRINTF("uhci_submit_control start len %x, maxsize %x\n",
+                       transfer_len, maxsze);
+       /* The "pipe" thing contains the destination in bits 8--18 */
+       destination = (pipe & PIPE_DEVEP_MASK) | USB_PID_SETUP; /* Setup stage */
+       /* 3 errors */
+       status = (pipe & TD_CTRL_LS) | TD_CTRL_ACTIVE | (3 << 27);
+       /* (urb->transfer_flags & USB_DISABLE_SPD ? 0 : TD_CTRL_SPD); */
+       /*  Build the TD for the control request, try forever, 8 bytes of data */
+       usb_fill_td(&tmp_td[i], UHCI_PTR_TERM, status, destination | (7 << 21),
+                   (unsigned long)setup, (unsigned long)dev);
+#ifdef DEBUG_EXTRA
+       {
+               char *sp = (char *)setup;
+               printf("SETUP to pipe %lx: %x %x %x %x %x %x %x %x\n", pipe,
+                      sp[0], sp[1], sp[2], sp[3], sp[4], sp[5], sp[6], sp[7]);
+       }
+#endif
+       dataptr = (unsigned long)buffer;
+       len = transfer_len;
+
+       /* If direction is "send", change the frame from SETUP (0x2D)
+          to OUT (0xE1). Else change it from SETUP to IN (0x69). */
+       destination =
+           (pipe & PIPE_DEVEP_MASK) | ((pipe & USB_DIR_IN) ==
+                                       0 ? USB_PID_OUT : USB_PID_IN);
+       while (len > 0) {
+               /* data stage */
+               pktsze = len;
+               i++;
+               if (pktsze > maxsze)
+                       pktsze = maxsze;
+               destination ^= 1 << TD_TOKEN_TOGGLE;    /* toggle DATA0/1 */
+               usb_fill_td(&tmp_td[i], UHCI_PTR_TERM, status, destination | ((pktsze - 1) << 21), dataptr, (unsigned long)dev);        /* Status, pktsze bytes of data */
+               tmp_td[i - 1].link = swap_32((unsigned long)&tmp_td[i]);
+
+               dataptr += pktsze;
+               len -= pktsze;
+       }
+
+       /*  Build the final TD for control status */
+       /* It's only IN if the pipe is out AND we aren't expecting data */
+
+       destination &= ~UHCI_PID;
+       if (((pipe & USB_DIR_IN) == 0) || (transfer_len == 0))
+               destination |= USB_PID_IN;
+       else
+               destination |= USB_PID_OUT;
+       destination |= 1 << TD_TOKEN_TOGGLE;    /* End in Data1 */
+       i++;
+       status &= ~TD_CTRL_SPD;
+       /* no limit on errors on final packet , 0 bytes of data */
+       usb_fill_td(&tmp_td[i], UHCI_PTR_TERM, status | TD_CTRL_IOC,
+                   destination | (UHCI_NULL_DATA_SIZE << 21), 0,
+                   (unsigned long)dev);
+       tmp_td[i - 1].link = swap_32((unsigned long)&tmp_td[i]);        /* queue status td */
+       /* usb_show_td(i+1); */
+       USB_UHCI_PRINTF("uhci_submit_control end (%d tmp_tds used)\n", i);
+       /* first mark the control QH element terminated */
+       qh_cntrl.element = 0xffffffffL;
+       /* set qh active */
+       qh_cntrl.dev_ptr = (unsigned long)dev;
+       /* fill in tmp_td_chain */
+       dummy();
+       qh_cntrl.element = swap_32((unsigned long)&tmp_td[0]);
+       return 0;
+}
+
+/*-------------------------------------------------------------------
+ * Prepare TDs for bulk transfers.
+ */
+int submit_bulk_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
+                   int transfer_len)
+{
+       unsigned long destination, status, info;
+       unsigned long dataptr;
+       int maxsze = usb_maxpacket(dev, pipe);
+       int len;
+       int i = 0;
+
+       if (transfer_len < 0) {
+               printf("Negative transfer length in submit_bulk\n");
+               return -1;
+       }
+       if (!maxsze)
+               return -1;
+       /* The "pipe" thing contains the destination in bits 8--18. */
+       destination = (pipe & PIPE_DEVEP_MASK) | usb_packetid(pipe);
+       /* 3 errors */
+       status = (pipe & TD_CTRL_LS) | TD_CTRL_ACTIVE | (3 << 27);
+       /*      ((urb->transfer_flags & USB_DISABLE_SPD) ? 0 : TD_CTRL_SPD) | (3 << 27); */
+       /* Build the TDs for the bulk request */
+       len = transfer_len;
+       dataptr = (unsigned long)buffer;
+       do {
+               int pktsze = len;
+               if (pktsze > maxsze)
+                       pktsze = maxsze;
+               /* pktsze bytes of data  */
+               info =
+                   destination | (((pktsze - 1) & UHCI_NULL_DATA_SIZE) << 21) |
+                   (usb_gettoggle
+                    (dev, usb_pipeendpoint(pipe),
+                     usb_pipeout(pipe)) << TD_TOKEN_TOGGLE);
+
+               if ((len - pktsze) == 0)
+                       status |= TD_CTRL_IOC;  /* last one generates INT */
+
+               usb_fill_td(&tmp_td[i], UHCI_PTR_TERM, status, info, dataptr, (unsigned long)dev);      /* Status, pktsze bytes of data */
+               if (i > 0)
+                       tmp_td[i - 1].link = swap_32((unsigned long)&tmp_td[i]);
+               i++;
+               dataptr += pktsze;
+               len -= pktsze;
+               usb_dotoggle(dev, usb_pipeendpoint(pipe), usb_pipeout(pipe));
+       } while (len > 0);
+       /* first mark the bulk QH element terminated */
+       qh_bulk.element = 0xffffffffL;
+       /* set qh active */
+       qh_bulk.dev_ptr = (unsigned long)dev;
+       /* fill in tmp_td_chain */
+       qh_bulk.element = swap_32((unsigned long)&tmp_td[0]);
+       return 0;
+}
+
+/* search a free interrupt td
+ */
+uhci_td_t *uhci_alloc_int_td(void)
+{
+       int i;
+       for (i = 0; i < USB_MAX_TEMP_INT_TD; i++) {
+               if (tmp_int_td[i].dev_ptr == 0) /* no device assigned -> free TD */
+                       return &tmp_int_td[i];
+       }
+       return NULL;
+}
+
+/*-------------------------------------------------------------------
+ * submits USB interrupt (ie. polling ;-)
+ */
+int submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
+                  int transfer_len, int interval)
+{
+       int nint, n;
+       unsigned long status, destination;
+       unsigned long info, tmp;
+       uhci_td_t *mytd;
+       if (interval < 0 || interval >= 256)
+               return -1;
+
+       if (interval == 0)
+               nint = 0;
+       else {
+               for (nint = 0, n = 1; nint <= 8; nint++, n += n) {      /* round interval down to 2^n */
+                       if (interval < n) {
+                               interval = n / 2;
+                               break;
+                       }
+               }
+               nint--;
+       }
+
+       USB_UHCI_PRINTF("Rounded interval to %i, chain  %i\n", interval, nint);
+       mytd = uhci_alloc_int_td();
+       if (mytd == NULL) {
+               printf("No free INT TDs found\n");
+               return -1;
+       }
+       status = (pipe & TD_CTRL_LS) | TD_CTRL_ACTIVE | TD_CTRL_IOC | (3 << 27);
+/*             (urb->transfer_flags & USB_DISABLE_SPD ? 0 : TD_CTRL_SPD) | (3 << 27);
+*/
+
+       destination =
+           (pipe & PIPE_DEVEP_MASK) | usb_packetid(pipe) |
+           (((transfer_len - 1) & 0x7ff) << 21);
+
+       info =
+           destination |
+           (usb_gettoggle(dev, usb_pipeendpoint(pipe), usb_pipeout(pipe)) <<
+            TD_TOKEN_TOGGLE);
+       tmp = swap_32(td_int[nint].link);
+       usb_fill_td(mytd, tmp, status, info, (unsigned long)buffer,
+                   (unsigned long)dev);
+       /* Link it */
+       tmp = swap_32((unsigned long)mytd);
+       td_int[nint].link = tmp;
+
+       usb_dotoggle(dev, usb_pipeendpoint(pipe), usb_pipeout(pipe));
+
+       return 0;
+}
+
+/**********************************************************************
+ * Low Level functions
+ */
+
+void reset_hc(void)
+{
+
+       /* Global reset for 100ms */
+       out16r(usb_base_addr + USBPORTSC1, 0x0204);
+       out16r(usb_base_addr + USBPORTSC2, 0x0204);
+       out16r(usb_base_addr + USBCMD, USBCMD_GRESET | USBCMD_RS);
+       /* Turn off all interrupts */
+       out16r(usb_base_addr + USBINTR, 0);
+       wait_ms(50);
+       out16r(usb_base_addr + USBCMD, 0);
+       wait_ms(10);
+}
+
+void start_hc(void)
+{
+       int timeout = 1000;
+
+       while (in16r(usb_base_addr + USBCMD) & USBCMD_HCRESET) {
+               if (!--timeout) {
+                       printf("USBCMD_HCRESET timed out!\n");
+                       break;
+               }
+       }
+       /* Turn on all interrupts */
+       out16r(usb_base_addr + USBINTR,
+              USBINTR_TIMEOUT | USBINTR_RESUME | USBINTR_IOC | USBINTR_SP);
+       /* Start at frame 0 */
+       out16r(usb_base_addr + USBFRNUM, 0);
+       /* set Framebuffer base address */
+       out32r(usb_base_addr + USBFLBASEADD, (unsigned long)&framelist);
+       /* Run and mark it configured with a 64-byte max packet */
+       out16r(usb_base_addr + USBCMD, USBCMD_RS | USBCMD_CF | USBCMD_MAXP);
+}
+
+/* Initialize the skeleton
+ */
+void usb_init_skel(void)
+{
+       unsigned long temp;
+       int n;
+
+       for (n = 0; n < USB_MAX_TEMP_INT_TD; n++)
+               tmp_int_td[n].dev_ptr = 0L;     /* no devices connected */
+       /* last td */
+       usb_fill_td(&td_last, UHCI_PTR_TERM, TD_CTRL_IOC, USB_PID_OUT, 0, 0L);
+       /* usb_fill_td(&td_last,UHCI_PTR_TERM,0,0,0); */
+       /* End Queue Header */
+       usb_fill_qh(&qh_end, UHCI_PTR_TERM, (unsigned long)&td_last);
+       /* Bulk Queue Header */
+       temp = (unsigned long)&qh_end;
+       usb_fill_qh(&qh_bulk, temp | UHCI_PTR_QH, UHCI_PTR_TERM);
+       /* Control Queue Header */
+       temp = (unsigned long)&qh_bulk;
+       usb_fill_qh(&qh_cntrl, temp | UHCI_PTR_QH, UHCI_PTR_TERM);
+       /* 1ms Interrupt td */
+       temp = (unsigned long)&qh_cntrl;
+       usb_fill_td(&td_int[0], temp | UHCI_PTR_QH, 0, USB_PID_OUT, 0, 0L);
+       temp = (unsigned long)&td_int[0];
+       for (n = 1; n < 8; n++)
+               usb_fill_td(&td_int[n], temp, 0, USB_PID_OUT, 0, 0L);
+       for (n = 0; n < 1024; n++) {
+               /* link all framelist pointers to one of the interrupts */
+               int m, o;
+               if ((n & 127) == 127)
+                       framelist[n] = swap_32((unsigned long)&td_int[0]);
+               else
+                       for (o = 1, m = 2; m <= 128; o++, m += m)
+                               if ((n & (m - 1)) == ((m - 1) / 2))
+                                       framelist[n] =
+                                           swap_32((unsigned long)&td_int[o]);
+
+       }
+}
+
+/* check the common skeleton for completed transfers, and update the status
+ * of the "connected" device. Called from the IRQ routine.
+ */
+void usb_check_skel(void)
+{
+       struct usb_device *dev;
+       /* start with the control qh */
+       if (qh_cntrl.dev_ptr != 0) {    /* it's a device assigned check if this caused IRQ */
+               dev = (struct usb_device *)qh_cntrl.dev_ptr;
+               /* Flush cache now that hardware updated DATA and TDs/QHs */
+               if (!leon3_snooping_avail)
+                       sparc_dcache_flush_all();
+               usb_get_td_status(&tmp_td[0], dev);     /* update status */
+               if (!(dev->status & USB_ST_NOT_PROC)) { /* is not active anymore, disconnect devices */
+                       qh_cntrl.dev_ptr = 0;
+               }
+       }
+       /* now process the bulk */
+       if (qh_bulk.dev_ptr != 0) {     /* it's a device assigned check if this caused IRQ */
+               dev = (struct usb_device *)qh_bulk.dev_ptr;
+               /* Flush cache now that hardware updated DATA and TDs/QHs */
+               if (!leon3_snooping_avail)
+                       sparc_dcache_flush_all();
+               usb_get_td_status(&tmp_td[0], dev);     /* update status */
+               if (!(dev->status & USB_ST_NOT_PROC)) { /* is not active anymore, disconnect devices */
+                       qh_bulk.dev_ptr = 0;
+               }
+       }
+}
+
+/* check the interrupt chain, ubdate the status of the appropriate device,
+ * call the appropriate irqhandler and reactivate the TD if the irqhandler
+ * returns with 1
+ */
+void usb_check_int_chain(void)
+{
+       int i, res;
+       unsigned long link, status;
+       struct usb_device *dev;
+       uhci_td_t *td, *prevtd;
+
+       for (i = 0; i < 8; i++) {
+               prevtd = &td_int[i];    /* the first previous td is the skeleton td */
+               link = swap_32(READ32(&td_int[i].link)) & 0xfffffff0;   /* next in chain */
+               td = (uhci_td_t *) link;        /* assign it */
+               /* all interrupt TDs are finally linked to the td_int[0].
+                * so we process all until we find the td_int[0].
+                * if int0 chain points to a QH, we're also done
+                */
+               while (((i > 0) && (link != (unsigned long)&td_int[0])) ||
+                      ((i == 0)
+                       && !(swap_32(READ32(&td->link)) & UHCI_PTR_QH))) {
+                       /* check if a device is assigned with this td */
+                       status = swap_32(READ32(&td->status));
+                       if ((td->dev_ptr != 0L) && !(status & TD_CTRL_ACTIVE)) {
+                               /* td is not active and a device is assigned -> call irqhandler */
+                               dev = (struct usb_device *)td->dev_ptr;
+                               dev->irq_act_len = ((status & 0x7FF) == 0x7FF) ? 0 : (status & 0x7FF) + 1;      /* transfered length */
+                               dev->irq_status = usb_uhci_td_stat(status);     /* get status */
+                               res = dev->irq_handle(dev);     /* call irqhandler */
+                               if (res == 1) {
+                                       /* reactivate */
+                                       status |= TD_CTRL_ACTIVE;
+                                       td->status = swap_32(status);
+                                       prevtd = td;    /* previous td = this td */
+                               } else {
+                                       prevtd->link = READ32(&td->link);       /* link previous td directly to the nex td -> unlinked */
+                                       /* remove device pointer */
+                                       td->dev_ptr = 0L;
+                               }
+                       }       /* if we call the irq handler */
+                       link = swap_32(READ32(&td->link)) & 0xfffffff0; /* next in chain */
+                       td = (uhci_td_t *) link;        /* assign it */
+               }               /* process all td in this int chain */
+       }                       /* next interrupt chain */
+}
+
+/* usb interrupt service routine.
+ */
+void handle_usb_interrupt(void)
+{
+       unsigned short status;
+       static int error = 0;
+
+       /*
+        * Read the interrupt status, and write it back to clear the
+        * interrupt cause
+        */
+
+       status = in16r(usb_base_addr + USBSTS);
+
+       if (!status)            /* shared interrupt, not mine */
+               return;
+       if (status != 1) {
+               /* remove host controller halted state */
+               if ((status & (USBSTS_HCPE | USBSTS_HCH)) ==
+                   (USBSTS_HCPE | USBSTS_HCH)) {
+                       /* Stop due to bug in driver, or hardware */
+                       out16r(usb_base_addr + USBSTS, status);
+                       out16r(usb_base_addr + USBCMD,
+                              USBCMD_HCRESET | USBCMD_GRESET);
+                       printf
+                           ("GRUSB: HW detected error(s) in USB Descriptors (STS: 0x%x)\n",
+                            status);
+                       usb_show_td(8);
+                       return;
+               } else if ((status & 0x20)
+                          && ((in16r(usb_base_addr + USBCMD) & USBCMD_RS) ==
+                              0)) {
+                       if (error < 10) {
+                               out16r(usb_base_addr + USBCMD,
+                                      USBCMD_RS | in16r(usb_base_addr +
+                                                        USBCMD));
+                               error++;
+                       }
+               } else
+                       error = 0;
+       }
+       usb_check_int_chain();  /* call interrupt handlers for int tds */
+       usb_check_skel();       /* call completion handler for common transfer routines */
+       out16r(usb_base_addr + USBSTS, status);
+}
+
+/* init uhci
+ */
+int usb_lowlevel_init(void)
+{
+       unsigned char temp;
+       ambapp_ahbdev ahbdev;
+
+       /* Find GRUSB core using AMBA Plug&Play information */
+       if (ambapp_ahbslv_first(VENDOR_GAISLER, GAISLER_UHCI, &ahbdev) != 1) {
+               printf("USB UHCI: Failed to find GRUSB controller\n");
+               return -1;
+       }
+       usb_base_addr = ahbdev.address[0];
+       grusb_irq = ahbdev.irq;
+       /*
+          usb_base_addr = 0xfffa0000;
+          grusb_irq = 10;
+        */
+#ifdef USB_UHCI_DEBUG
+       grusb_show_regs();
+#endif
+       memset(td_int, 0, sizeof(td_int));
+       memset(tmp_td, 0, sizeof(tmp_td));
+       memset(tmp_int_td, 0, sizeof(tmp_int_td));
+       memset(&qh_cntrl, 0, sizeof(qh_cntrl));
+       memset(&qh_end, 0, sizeof(qh_end));
+       memset(&td_last, 0, sizeof(td_last));
+
+       irq_free_handler(grusb_irq);
+       USB_UHCI_PRINTF("GRUSB: at 0x%lx irq %d\n", usb_base_addr, grusb_irq);
+       rh.devnum = 0;
+       usb_init_skel();
+       reset_hc();
+       start_hc();
+       irq_install_handler(grusb_irq,
+                           (interrupt_handler_t *) handle_usb_interrupt, NULL);
+       return 0;
+}
+
+/* stop uhci
+ */
+int usb_lowlevel_stop(void)
+{
+       if (grusb_irq == -1)
+               return 1;
+       irq_free_handler(grusb_irq);
+       reset_hc();
+       grusb_irq = -1;
+       return 0;
+}
+
+/*******************************************************************************************
+ * Virtual Root Hub
+ * Since the uhci does not have a real HUB, we simulate one ;-)
+ */
+#undef USB_RH_DEBUG
+
+#ifdef USB_RH_DEBUG
+#define        USB_RH_PRINTF(fmt,args...)      printf (fmt ,##args)
+static void usb_display_wValue(unsigned short wValue, unsigned short wIndex);
+static void usb_display_Req(unsigned short req);
+#else
+#define USB_RH_PRINTF(fmt,args...)
+static void usb_display_wValue(unsigned short wValue, unsigned short wIndex)
+{
+}
+static void usb_display_Req(unsigned short req)
+{
+}
+#endif
+
+static unsigned char root_hub_dev_des[] = {
+       0x12,                   /*  __u8  bLength; */
+       0x01,                   /*  __u8  bDescriptorType; Device */
+       0x00,                   /*  __u16 bcdUSB; v1.0 */
+       0x01,
+       0x09,                   /*  __u8  bDeviceClass; HUB_CLASSCODE */
+       0x00,                   /*  __u8  bDeviceSubClass; */
+       0x00,                   /*  __u8  bDeviceProtocol; */
+       0x08,                   /*  __u8  bMaxPacketSize0; 8 Bytes */
+       0x00,                   /*  __u16 idVendor; */
+       0x00,
+       0x00,                   /*  __u16 idProduct; */
+       0x00,
+       0x00,                   /*  __u16 bcdDevice; */
+       0x00,
+       0x01,                   /*  __u8  iManufacturer; */
+       0x00,                   /*  __u8  iProduct; */
+       0x00,                   /*  __u8  iSerialNumber; */
+       0x01                    /*  __u8  bNumConfigurations; */
+};
+
+/* Configuration descriptor */
+static unsigned char root_hub_config_des[] = {
+       0x09,                   /*  __u8  bLength; */
+       0x02,                   /*  __u8  bDescriptorType; Configuration */
+       0x19,                   /*  __u16 wTotalLength; */
+       0x00,
+       0x01,                   /*  __u8  bNumInterfaces; */
+       0x01,                   /*  __u8  bConfigurationValue; */
+       0x00,                   /*  __u8  iConfiguration; */
+       0x40,                   /*  __u8  bmAttributes;
+                                  Bit 7: Bus-powered, 6: Self-powered, 5 Remote-wakwup, 4..0: resvd */
+       0x00,                   /*  __u8  MaxPower; */
+
+       /* interface */
+       0x09,                   /*  __u8  if_bLength; */
+       0x04,                   /*  __u8  if_bDescriptorType; Interface */
+       0x00,                   /*  __u8  if_bInterfaceNumber; */
+       0x00,                   /*  __u8  if_bAlternateSetting; */
+       0x01,                   /*  __u8  if_bNumEndpoints; */
+       0x09,                   /*  __u8  if_bInterfaceClass; HUB_CLASSCODE */
+       0x00,                   /*  __u8  if_bInterfaceSubClass; */
+       0x00,                   /*  __u8  if_bInterfaceProtocol; */
+       0x00,                   /*  __u8  if_iInterface; */
+
+       /* endpoint */
+       0x07,                   /*  __u8  ep_bLength; */
+       0x05,                   /*  __u8  ep_bDescriptorType; Endpoint */
+       0x81,                   /*  __u8  ep_bEndpointAddress; IN Endpoint 1 */
+       0x03,                   /*  __u8  ep_bmAttributes; Interrupt */
+       0x08,                   /*  __u16 ep_wMaxPacketSize; 8 Bytes */
+       0x00,
+       0xff                    /*  __u8  ep_bInterval; 255 ms */
+};
+
+static unsigned char root_hub_hub_des[] = {
+       0x09,                   /*  __u8  bLength; */
+       0x29,                   /*  __u8  bDescriptorType; Hub-descriptor */
+       0x02,                   /*  __u8  bNbrPorts; */
+       0x00,                   /* __u16  wHubCharacteristics; */
+       0x00,
+       0x01,                   /*  __u8  bPwrOn2pwrGood; 2ms */
+       0x00,                   /*  __u8  bHubContrCurrent; 0 mA */
+       0x00,                   /*  __u8  DeviceRemovable; *** 7 Ports max *** */
+       0xff                    /*  __u8  PortPwrCtrlMask; *** 7 ports max *** */
+};
+
+static unsigned char root_hub_str_index0[] = {
+       0x04,                   /*  __u8  bLength; */
+       0x03,                   /*  __u8  bDescriptorType; String-descriptor */
+       0x09,                   /*  __u8  lang ID */
+       0x04,                   /*  __u8  lang ID */
+};
+
+static unsigned char root_hub_str_index1[] = {
+       28,                     /*  __u8  bLength; */
+       0x03,                   /*  __u8  bDescriptorType; String-descriptor */
+       'U',                    /*  __u8  Unicode */
+       0,                      /*  __u8  Unicode */
+       'H',                    /*  __u8  Unicode */
+       0,                      /*  __u8  Unicode */
+       'C',                    /*  __u8  Unicode */
+       0,                      /*  __u8  Unicode */
+       'I',                    /*  __u8  Unicode */
+       0,                      /*  __u8  Unicode */
+       ' ',                    /*  __u8  Unicode */
+       0,                      /*  __u8  Unicode */
+       'R',                    /*  __u8  Unicode */
+       0,                      /*  __u8  Unicode */
+       'o',                    /*  __u8  Unicode */
+       0,                      /*  __u8  Unicode */
+       'o',                    /*  __u8  Unicode */
+       0,                      /*  __u8  Unicode */
+       't',                    /*  __u8  Unicode */
+       0,                      /*  __u8  Unicode */
+       ' ',                    /*  __u8  Unicode */
+       0,                      /*  __u8  Unicode */
+       'H',                    /*  __u8  Unicode */
+       0,                      /*  __u8  Unicode */
+       'u',                    /*  __u8  Unicode */
+       0,                      /*  __u8  Unicode */
+       'b',                    /*  __u8  Unicode */
+       0,                      /*  __u8  Unicode */
+};
+
+/*
+ * Root Hub Control Pipe (interrupt Pipes are not supported)
+ */
+
+int uhci_submit_rh_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
+                      int transfer_len, struct devrequest *cmd)
+{
+       void *data = buffer;
+       int leni = transfer_len;
+       int len = 0;
+       int status = 0;
+       int stat = 0;
+       int i;
+
+       unsigned short cstatus;
+
+       unsigned short bmRType_bReq;
+       unsigned short wValue;
+       unsigned short wIndex;
+       unsigned short wLength;
+
+       if ((pipe & PIPE_INTERRUPT) == PIPE_INTERRUPT) {
+               printf("Root-Hub submit IRQ: NOT implemented\n");
+               return 0;
+       }
+       bmRType_bReq = cmd->requesttype | cmd->request << 8;
+       wValue = swap_16(cmd->value);
+       wIndex = swap_16(cmd->index);
+       wLength = swap_16(cmd->length);
+       usb_display_Req(bmRType_bReq);
+       for (i = 0; i < 8; i++)
+               rh.c_p_r[i] = 0;
+       USB_RH_PRINTF("Root-Hub: adr: %2x cmd(%1x): %02x%02x %04x %04x %04x\n",
+                     dev->devnum, 8, cmd->requesttype, cmd->request, wValue,
+                     wIndex, wLength);
+
+       switch (bmRType_bReq) {
+               /* Request Destination:
+                  without flags: Device,
+                  RH_INTERFACE: interface,
+                  RH_ENDPOINT: endpoint,
+                  RH_CLASS means HUB here,
+                  RH_OTHER | RH_CLASS  almost ever means HUB_PORT here
+                */
+
+       case RH_GET_STATUS:
+               *(unsigned short *)data = swap_16(1);
+               len = 2;
+               break;
+       case RH_GET_STATUS | RH_INTERFACE:
+               *(unsigned short *)data = swap_16(0);
+               len = 2;
+               break;
+       case RH_GET_STATUS | RH_ENDPOINT:
+               *(unsigned short *)data = swap_16(0);
+               len = 2;
+               break;
+       case RH_GET_STATUS | RH_CLASS:
+               *(unsigned long *)data = swap_32(0);
+               len = 4;
+               break;          /* hub power ** */
+       case RH_GET_STATUS | RH_OTHER | RH_CLASS:
+
+               status = in16r(usb_base_addr + USBPORTSC1 + 2 * (wIndex - 1));
+               cstatus = ((status & USBPORTSC_CSC) >> (1 - 0)) |
+                   ((status & USBPORTSC_PEC) >> (3 - 1)) |
+                   (rh.c_p_r[wIndex - 1] << (0 + 4));
+               status = (status & USBPORTSC_CCS) | ((status & USBPORTSC_PE) >> (2 - 1)) | ((status & USBPORTSC_SUSP) >> (12 - 2)) | ((status & USBPORTSC_PR) >> (9 - 4)) | (1 << 8) |  /* power on ** */
+                   ((status & USBPORTSC_LSDA) << (-8 + 9));
+
+               *(unsigned short *)data = swap_16(status);
+               *(unsigned short *)(data + 2) = swap_16(cstatus);
+               len = 4;
+               break;
+       case RH_CLEAR_FEATURE | RH_ENDPOINT:
+               switch (wValue) {
+               case (RH_ENDPOINT_STALL):
+                       len = 0;
+                       break;
+               }
+               break;
+
+       case RH_CLEAR_FEATURE | RH_CLASS:
+               switch (wValue) {
+               case (RH_C_HUB_OVER_CURRENT):
+                       len = 0;        /* hub power over current ** */
+                       break;
+               }
+               break;
+
+       case RH_CLEAR_FEATURE | RH_OTHER | RH_CLASS:
+               usb_display_wValue(wValue, wIndex);
+               switch (wValue) {
+               case (RH_PORT_ENABLE):
+                       status =
+                           in16r(usb_base_addr + USBPORTSC1 +
+                                 2 * (wIndex - 1));
+                       status = (status & 0xfff5) & ~USBPORTSC_PE;
+                       out16r(usb_base_addr + USBPORTSC1 + 2 * (wIndex - 1),
+                              status);
+                       len = 0;
+                       break;
+               case (RH_PORT_SUSPEND):
+                       status =
+                           in16r(usb_base_addr + USBPORTSC1 +
+                                 2 * (wIndex - 1));
+                       status = (status & 0xfff5) & ~USBPORTSC_SUSP;
+                       out16r(usb_base_addr + USBPORTSC1 + 2 * (wIndex - 1),
+                              status);
+                       len = 0;
+                       break;
+               case (RH_PORT_POWER):
+                       len = 0;        /* port power ** */
+                       break;
+               case (RH_C_PORT_CONNECTION):
+                       status =
+                           in16r(usb_base_addr + USBPORTSC1 +
+                                 2 * (wIndex - 1));
+                       status = (status & 0xfff5) | USBPORTSC_CSC;
+                       out16r(usb_base_addr + USBPORTSC1 + 2 * (wIndex - 1),
+                              status);
+                       len = 0;
+                       break;
+               case (RH_C_PORT_ENABLE):
+                       status =
+                           in16r(usb_base_addr + USBPORTSC1 +
+                                 2 * (wIndex - 1));
+                       status = (status & 0xfff5) | USBPORTSC_PEC;
+                       out16r(usb_base_addr + USBPORTSC1 + 2 * (wIndex - 1),
+                              status);
+                       len = 0;
+                       break;
+               case (RH_C_PORT_SUSPEND):
+/*** WR_RH_PORTSTAT(RH_PS_PSSC); */
+                       len = 0;
+                       break;
+               case (RH_C_PORT_OVER_CURRENT):
+                       len = 0;
+                       break;
+               case (RH_C_PORT_RESET):
+                       rh.c_p_r[wIndex - 1] = 0;
+                       len = 0;
+                       break;
+               }
+               break;
+       case RH_SET_FEATURE | RH_OTHER | RH_CLASS:
+               usb_display_wValue(wValue, wIndex);
+               switch (wValue) {
+               case (RH_PORT_SUSPEND):
+                       status =
+                           in16r(usb_base_addr + USBPORTSC1 +
+                                 2 * (wIndex - 1));
+                       status = (status & 0xfff5) | USBPORTSC_SUSP;
+                       out16r(usb_base_addr + USBPORTSC1 + 2 * (wIndex - 1),
+                              status);
+                       len = 0;
+                       break;
+               case (RH_PORT_RESET):
+                       status =
+                           in16r(usb_base_addr + USBPORTSC1 +
+                                 2 * (wIndex - 1));
+                       status = (status & 0xfff5) | USBPORTSC_PR;
+                       out16r(usb_base_addr + USBPORTSC1 + 2 * (wIndex - 1),
+                              status);
+                       wait_ms(10);
+                       status = (status & 0xfff5) & ~USBPORTSC_PR;
+                       out16r(usb_base_addr + USBPORTSC1 + 2 * (wIndex - 1),
+                              status);
+                       udelay(10);
+                       status = (status & 0xfff5) | USBPORTSC_PE;
+                       out16r(usb_base_addr + USBPORTSC1 + 2 * (wIndex - 1),
+                              status);
+                       wait_ms(10);
+                       status = (status & 0xfff5) | 0xa;
+                       out16r(usb_base_addr + USBPORTSC1 + 2 * (wIndex - 1),
+                              status);
+                       len = 0;
+                       break;
+               case (RH_PORT_POWER):
+                       len = 0;        /* port power ** */
+                       break;
+               case (RH_PORT_ENABLE):
+                       status =
+                           in16r(usb_base_addr + USBPORTSC1 +
+                                 2 * (wIndex - 1));
+                       status = (status & 0xfff5) | USBPORTSC_PE;
+                       out16r(usb_base_addr + USBPORTSC1 + 2 * (wIndex - 1),
+                              status);
+                       len = 0;
+                       break;
+               }
+               break;
+
+       case RH_SET_ADDRESS:
+               rh.devnum = wValue;
+               len = 0;
+               break;
+       case RH_GET_DESCRIPTOR:
+               switch ((wValue & 0xff00) >> 8) {
+               case (0x01):    /* device descriptor */
+                       i = sizeof(root_hub_config_des);
+                       status = i > wLength ? wLength : i;
+                       len = leni > status ? status : leni;
+                       memcpy(data, root_hub_dev_des, len);
+                       break;
+               case (0x02):    /* configuration descriptor */
+                       i = sizeof(root_hub_config_des);
+                       status = i > wLength ? wLength : i;
+                       len = leni > status ? status : leni;
+                       memcpy(data, root_hub_config_des, len);
+                       break;
+               case (0x03):    /*string descriptors */
+                       if (wValue == 0x0300) {
+                               i = sizeof(root_hub_str_index0);
+                               status = i > wLength ? wLength : i;
+                               len = leni > status ? status : leni;
+                               memcpy(data, root_hub_str_index0, len);
+                               break;
+                       }
+                       if (wValue == 0x0301) {
+                               i = sizeof(root_hub_str_index1);
+                               status = i > wLength ? wLength : i;
+                               len = leni > status ? status : leni;
+                               memcpy(data, root_hub_str_index1, len);
+                               break;
+                       }
+                       stat = USB_ST_STALLED;
+               }
+               break;
+
+       case RH_GET_DESCRIPTOR | RH_CLASS:
+               root_hub_hub_des[2] = 2;
+               i = sizeof(root_hub_hub_des);
+               status = i > wLength ? wLength : i;
+               len = leni > status ? status : leni;
+               memcpy(data, root_hub_hub_des, len);
+               break;
+       case RH_GET_CONFIGURATION:
+               *(unsigned char *)data = 0x01;
+               len = 1;
+               break;
+       case RH_SET_CONFIGURATION:
+               len = 0;
+               break;
+       default:
+               stat = USB_ST_STALLED;
+       }
+       USB_RH_PRINTF("Root-Hub stat %lx port1: %x port2: %x\n\n", stat,
+                     in16r(usb_base_addr + USBPORTSC1),
+                     in16r(usb_base_addr + USBPORTSC2));
+       dev->act_len = len;
+       dev->status = stat;
+       return stat;
+
+}
+
+/********************************************************************************
+ * Some Debug Routines
+ */
+
+#ifdef USB_RH_DEBUG
+
+static void usb_display_Req(unsigned short req)
+{
+       USB_RH_PRINTF("- Root-Hub Request: ");
+       switch (req) {
+       case RH_GET_STATUS:
+               USB_RH_PRINTF("Get Status ");
+               break;
+       case RH_GET_STATUS | RH_INTERFACE:
+               USB_RH_PRINTF("Get Status Interface ");
+               break;
+       case RH_GET_STATUS | RH_ENDPOINT:
+               USB_RH_PRINTF("Get Status Endpoint ");
+               break;
+       case RH_GET_STATUS | RH_CLASS:
+               USB_RH_PRINTF("Get Status Class");
+               break;          /* hub power ** */
+       case RH_GET_STATUS | RH_OTHER | RH_CLASS:
+               USB_RH_PRINTF("Get Status Class Others");
+               break;
+       case RH_CLEAR_FEATURE | RH_ENDPOINT:
+               USB_RH_PRINTF("Clear Feature Endpoint ");
+               break;
+       case RH_CLEAR_FEATURE | RH_CLASS:
+               USB_RH_PRINTF("Clear Feature Class ");
+               break;
+       case RH_CLEAR_FEATURE | RH_OTHER | RH_CLASS:
+               USB_RH_PRINTF("Clear Feature Other Class ");
+               break;
+       case RH_SET_FEATURE | RH_OTHER | RH_CLASS:
+               USB_RH_PRINTF("Set Feature Other Class ");
+               break;
+       case RH_SET_ADDRESS:
+               USB_RH_PRINTF("Set Address ");
+               break;
+       case RH_GET_DESCRIPTOR:
+               USB_RH_PRINTF("Get Descriptor ");
+               break;
+       case RH_GET_DESCRIPTOR | RH_CLASS:
+               USB_RH_PRINTF("Get Descriptor Class ");
+               break;
+       case RH_GET_CONFIGURATION:
+               USB_RH_PRINTF("Get Configuration ");
+               break;
+       case RH_SET_CONFIGURATION:
+               USB_RH_PRINTF("Get Configuration ");
+               break;
+       default:
+               USB_RH_PRINTF("****UNKNOWN**** 0x%04X ", req);
+       }
+       USB_RH_PRINTF("\n");
+
+}
+
+static void usb_display_wValue(unsigned short wValue, unsigned short wIndex)
+{
+       switch (wValue) {
+       case (RH_PORT_ENABLE):
+               USB_RH_PRINTF("Root-Hub: Enable Port %d\n", wIndex);
+               break;
+       case (RH_PORT_SUSPEND):
+               USB_RH_PRINTF("Root-Hub: Suspend Port %d\n", wIndex);
+               break;
+       case (RH_PORT_POWER):
+               USB_RH_PRINTF("Root-Hub: Port Power %d\n", wIndex);
+               break;
+       case (RH_C_PORT_CONNECTION):
+               USB_RH_PRINTF("Root-Hub: C Port Connection Port %d\n", wIndex);
+               break;
+       case (RH_C_PORT_ENABLE):
+               USB_RH_PRINTF("Root-Hub: C Port Enable Port %d\n", wIndex);
+               break;
+       case (RH_C_PORT_SUSPEND):
+               USB_RH_PRINTF("Root-Hub: C Port Suspend Port %d\n", wIndex);
+               break;
+       case (RH_C_PORT_OVER_CURRENT):
+               USB_RH_PRINTF("Root-Hub: C Port Over Current Port %d\n",
+                             wIndex);
+               break;
+       case (RH_C_PORT_RESET):
+               USB_RH_PRINTF("Root-Hub: C Port reset Port %d\n", wIndex);
+               break;
+       default:
+               USB_RH_PRINTF("Root-Hub: unknown %x %x\n", wValue, wIndex);
+               break;
+       }
+}
+
+#endif
+
+/*#ifdef       USB_UHCI_DEBUG*/
+
+static int usb_display_td(uhci_td_t * td)
+{
+       unsigned long tmp;
+       int valid;
+
+       printf("TD at %p:\n", td);
+
+       tmp = swap_32(READ32(&td->link));
+       printf("Link points to 0x%08lX, %s first, %s, %s\n", tmp & 0xfffffff0,
+              ((tmp & 0x4) == 0x4) ? "Depth" : "Breath",
+              ((tmp & 0x2) == 0x2) ? "QH" : "TD",
+              ((tmp & 0x1) == 0x1) ? "invalid" : "valid");
+       valid = ((tmp & 0x1) == 0x0);
+       tmp = swap_32(READ32(&td->status));
+       printf
+           ("     %s %ld Errors %s %s %s \n     %s %s %s %s %s %s\n     Len 0x%lX\n",
+            (((tmp >> 29) & 0x1) == 0x1) ? "SPD Enable" : "SPD Disable",
+            ((tmp >> 28) & 0x3),
+            (((tmp >> 26) & 0x1) == 0x1) ? "Low Speed" : "Full Speed",
+            (((tmp >> 25) & 0x1) == 0x1) ? "ISO " : "",
+            (((tmp >> 24) & 0x1) == 0x1) ? "IOC " : "",
+            (((tmp >> 23) & 0x1) == 0x1) ? "Active " : "Inactive ",
+            (((tmp >> 22) & 0x1) == 0x1) ? "Stalled" : "",
+            (((tmp >> 21) & 0x1) == 0x1) ? "Data Buffer Error" : "",
+            (((tmp >> 20) & 0x1) == 0x1) ? "Babble" : "",
+            (((tmp >> 19) & 0x1) == 0x1) ? "NAK" : "",
+            (((tmp >> 18) & 0x1) == 0x1) ? "Bitstuff Error" : "",
+            (tmp & 0x7ff));
+       tmp = swap_32(READ32(&td->info));
+       printf("     MaxLen 0x%lX\n", ((tmp >> 21) & 0x7FF));
+       printf("     %sEndpoint 0x%lX Dev Addr 0x%lX PID 0x%lX\n",
+              ((tmp >> 19) & 0x1) == 0x1 ? "TOGGLE " : "", ((tmp >> 15) & 0xF),
+              ((tmp >> 8) & 0x7F), tmp & 0xFF);
+       tmp = swap_32(READ32(&td->buffer));
+       printf("     Buffer 0x%08lX\n", tmp);
+       printf("     DEV %08lX\n", td->dev_ptr);
+       return valid;
+}
+
+void usb_show_td(int max)
+{
+       int i;
+       if (max > 0) {
+               for (i = 0; i < max; i++) {
+                       usb_display_td(&tmp_td[i]);
+               }
+       } else {
+               i = 0;
+               do {
+                       printf("tmp_td[%d]\n", i);
+               } while (usb_display_td(&tmp_td[i++]));
+       }
+}
+
+void grusb_show_regs(void)
+{
+       unsigned int tmp;
+
+       tmp = in16r(usb_base_addr + USBCMD);
+       printf(" USBCMD:   0x%04x\n", tmp);
+       tmp = in16r(usb_base_addr + USBSTS);
+       printf(" USBSTS:   0x%04x\n", tmp);
+       tmp = in16r(usb_base_addr + USBINTR);
+       printf(" USBINTR:   0x%04x\n", tmp);
+       tmp = in16r(usb_base_addr + USBFRNUM);
+       printf(" FRNUM:   0x%04x\n", tmp);
+       tmp = in32r(usb_base_addr + USBFLBASEADD);
+       printf(" FLBASEADD:   0x%08x\n", tmp);
+       tmp = in16r(usb_base_addr + USBSOF);
+       printf(" SOFMOD:   0x%04x\n", tmp);
+       tmp = in16r(usb_base_addr + USBPORTSC1);
+       printf(" PORTSC1:   0x%04x\n", tmp);
+}
+
+/*#endif*/
+#endif                         /* CONFIG_USB_UHCI */
+
+/* EOF */
diff --git a/cpu/leon3/usb_uhci.h b/cpu/leon3/usb_uhci.h
new file mode 100644 (file)
index 0000000..bf572a6
--- /dev/null
@@ -0,0 +1,184 @@
+/*
+ * (C) Copyright 2001
+ * Denis Peter, MPL AG Switzerland
+ *
+ * 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
+ *
+ * Note: Part of this code has been derived from linux
+ *
+ */
+#ifndef _USB_UHCI_H_
+#define _USB_UHCI_H_
+
+/* Command register */
+#define USBCMD         0
+#define   USBCMD_RS       0x0001       /* Run/Stop */
+#define   USBCMD_HCRESET  0x0002       /* Host reset */
+#define   USBCMD_GRESET   0x0004       /* Global reset */
+#define   USBCMD_EGSM     0x0008       /* Global Suspend Mode */
+#define   USBCMD_FGR      0x0010       /* Force Global Resume */
+#define   USBCMD_SWDBG    0x0020       /* SW Debug mode */
+#define   USBCMD_CF       0x0040       /* Config Flag (sw only) */
+#define   USBCMD_MAXP     0x0080       /* Max Packet (0 = 32, 1 = 64) */
+
+/* Status register */
+#define USBSTS         2
+#define   USBSTS_USBINT   0x0001       /* Interrupt due to IOC */
+#define   USBSTS_ERROR    0x0002       /* Interrupt due to error */
+#define   USBSTS_RD       0x0004       /* Resume Detect */
+#define   USBSTS_HSE      0x0008       /* Host System Error - basically PCI problems */
+#define   USBSTS_HCPE     0x0010       /* Host Controller Process Error - the scripts were buggy */
+#define   USBSTS_HCH      0x0020       /* HC Halted */
+
+/* Interrupt enable register */
+#define USBINTR                4
+#define   USBINTR_TIMEOUT 0x0001       /* Timeout/CRC error enable */
+#define   USBINTR_RESUME  0x0002       /* Resume interrupt enable */
+#define   USBINTR_IOC     0x0004       /* Interrupt On Complete enable */
+#define   USBINTR_SP      0x0008       /* Short packet interrupt enable */
+
+#define USBFRNUM      6
+#define USBFLBASEADD  8
+#define USBSOF        12
+
+/* USB port status and control registers */
+#define USBPORTSC1     16
+#define USBPORTSC2     18
+#define   USBPORTSC_CCS   0x0001       /* Current Connect Status ("device present") */
+#define   USBPORTSC_CSC   0x0002       /* Connect Status Change */
+#define   USBPORTSC_PE    0x0004       /* Port Enable */
+#define   USBPORTSC_PEC   0x0008       /* Port Enable Change */
+#define   USBPORTSC_LS    0x0030       /* Line Status */
+#define   USBPORTSC_RD    0x0040       /* Resume Detect */
+#define   USBPORTSC_LSDA  0x0100       /* Low Speed Device Attached */
+#define   USBPORTSC_PR    0x0200       /* Port Reset */
+#define   USBPORTSC_SUSP  0x1000       /* Suspend */
+
+/* Legacy support register */
+#define USBLEGSUP 0xc0
+#define USBLEGSUP_DEFAULT 0x2000       /* only PIRQ enable set */
+
+#define UHCI_NULL_DATA_SIZE 0x7ff      /* for UHCI controller TD */
+#define UHCI_PID            0xff       /* PID MASK */
+
+#define UHCI_PTR_BITS       0x000F
+#define UHCI_PTR_TERM       0x0001
+#define UHCI_PTR_QH         0x0002
+#define UHCI_PTR_DEPTH      0x0004
+
+/* for TD <status>: */
+#define TD_CTRL_SPD         (1 << 29)  /* Short Packet Detect */
+#define TD_CTRL_C_ERR_MASK  (3 << 27)  /* Error Counter bits */
+#define TD_CTRL_LS          (1 << 26)  /* Low Speed Device */
+#define TD_CTRL_IOS         (1 << 25)  /* Isochronous Select */
+#define TD_CTRL_IOC         (1 << 24)  /* Interrupt on Complete */
+#define TD_CTRL_ACTIVE      (1 << 23)  /* TD Active */
+#define TD_CTRL_STALLED     (1 << 22)  /* TD Stalled */
+#define TD_CTRL_DBUFERR     (1 << 21)  /* Data Buffer Error */
+#define TD_CTRL_BABBLE      (1 << 20)  /* Babble Detected */
+#define TD_CTRL_NAK         (1 << 19)  /* NAK Received */
+#define TD_CTRL_CRCTIMEO    (1 << 18)  /* CRC/Time Out Error */
+#define TD_CTRL_BITSTUFF    (1 << 17)  /* Bit Stuff Error */
+#define TD_CTRL_ACTLEN_MASK 0x7ff      /* actual length, encoded as n - 1 */
+
+#define TD_CTRL_ANY_ERROR      (TD_CTRL_STALLED | TD_CTRL_DBUFERR | \
+                                TD_CTRL_BABBLE | TD_CTRL_CRCTIME | TD_CTRL_BITSTUFF)
+
+#define TD_TOKEN_TOGGLE                19
+
+/* ------------------------------------------------------------------------------------
+   Virtual Root HUB
+   ------------------------------------------------------------------------------------ */
+/* destination of request */
+#define RH_INTERFACE               0x01
+#define RH_ENDPOINT                0x02
+#define RH_OTHER                   0x03
+
+#define RH_CLASS                   0x20
+#define RH_VENDOR                  0x40
+
+/* Requests: bRequest << 8 | bmRequestType */
+#define RH_GET_STATUS           0x0080
+#define RH_CLEAR_FEATURE        0x0100
+#define RH_SET_FEATURE          0x0300
+#define RH_SET_ADDRESS          0x0500
+#define RH_GET_DESCRIPTOR       0x0680
+#define RH_SET_DESCRIPTOR       0x0700
+#define RH_GET_CONFIGURATION    0x0880
+#define RH_SET_CONFIGURATION    0x0900
+#define RH_GET_STATE            0x0280
+#define RH_GET_INTERFACE        0x0A80
+#define RH_SET_INTERFACE        0x0B00
+#define RH_SYNC_FRAME           0x0C80
+/* Our Vendor Specific Request */
+#define RH_SET_EP               0x2000
+
+/* Hub port features */
+#define RH_PORT_CONNECTION         0x00
+#define RH_PORT_ENABLE             0x01
+#define RH_PORT_SUSPEND            0x02
+#define RH_PORT_OVER_CURRENT       0x03
+#define RH_PORT_RESET              0x04
+#define RH_PORT_POWER              0x08
+#define RH_PORT_LOW_SPEED          0x09
+#define RH_C_PORT_CONNECTION       0x10
+#define RH_C_PORT_ENABLE           0x11
+#define RH_C_PORT_SUSPEND          0x12
+#define RH_C_PORT_OVER_CURRENT     0x13
+#define RH_C_PORT_RESET            0x14
+
+/* Hub features */
+#define RH_C_HUB_LOCAL_POWER       0x00
+#define RH_C_HUB_OVER_CURRENT      0x01
+
+#define RH_DEVICE_REMOTE_WAKEUP    0x00
+#define RH_ENDPOINT_STALL          0x01
+
+/* Our Vendor Specific feature */
+#define RH_REMOVE_EP               0x00
+
+#define RH_ACK                     0x01
+#define RH_REQ_ERR                 -1
+#define RH_NACK                    0x00
+
+/* Transfer descriptor structure */
+typedef struct {
+       unsigned long link;     /* next td/qh (LE) */
+       unsigned long status;   /* status of the td */
+       unsigned long info;     /* Max Lenght / Endpoint / device address and PID */
+       unsigned long buffer;   /* pointer to data buffer (LE) */
+       unsigned long dev_ptr;  /* pointer to the assigned device (BE) */
+       unsigned long res[3];   /* reserved (TDs must be 8Byte aligned) */
+} uhci_td_t, *puhci_td_t;
+
+/* Queue Header structure */
+typedef struct {
+       unsigned long head;     /* Next QH (LE) */
+       unsigned long element;  /* Queue element pointer (LE) */
+       unsigned long res[5];   /* reserved */
+       unsigned long dev_ptr;  /* if 0 no tds have been assigned to this qh */
+} uhci_qh_t, *puhci_qh_t;
+
+struct virt_root_hub {
+       int devnum;             /* Address of Root Hub endpoint */
+       int numports;           /* number of ports */
+       int c_p_r[8];           /* C_PORT_RESET */
+};
+
+#endif                         /* _USB_UHCI_H_ */
index 0e2db12..1b47c97 100644 (file)
@@ -354,3 +354,4 @@ version_string:
        .ascii U_BOOT_VERSION
        .ascii " (", __DATE__, " - ", __TIME__, ")"
        .ascii CONFIG_IDENT_STRING, "\0"
+       .align 4
index 2bd603d..ad04c09 100644 (file)
@@ -338,3 +338,4 @@ version_string:
        .ascii U_BOOT_VERSION
        .ascii " (", __DATE__, " - ", __TIME__, ")"
        .ascii CONFIG_IDENT_STRING, "\0"
+       .align 4
index c3899c5..650e340 100644 (file)
@@ -30,6 +30,7 @@ is5249:=$(shell grep CONFIG_M5249 $(TOPDIR)/include/$(cfg))
 is5253:=$(shell grep CONFIG_M5253 $(TOPDIR)/include/$(cfg))
 is5271:=$(shell grep CONFIG_M5271 $(TOPDIR)/include/$(cfg))
 is5272:=$(shell grep CONFIG_M5272 $(TOPDIR)/include/$(cfg))
+is5275:=$(shell grep CONFIG_M5275 $(TOPDIR)/include/$(cfg))
 is5282:=$(shell grep CONFIG_M5282 $(TOPDIR)/include/$(cfg))
 
 
@@ -47,6 +48,9 @@ endif
 ifneq (,$(findstring CONFIG_M5272,$(is5272)))
 PLATFORM_CPPFLAGS += -mcpu=5272
 endif
+ifneq (,$(findstring CONFIG_M5275,$(is5275)))
+PLATFORM_CPPFLAGS += -mcpu=5275
+endif
 ifneq (,$(findstring CONFIG_M5282,$(is5282)))
 PLATFORM_CPPFLAGS += -mcpu=5282
 endif
index 71ea408..d5d3d33 100644 (file)
@@ -6,6 +6,9 @@
  * (C) Copyright 2005
  * BuS Elektronik GmbH & Co. KG <esw@bus-elektronik.de>
  *
+ * MCF5275 additions
+ * Copyright (C) 2008 Arthur Shipkowski (art@videon-central.com)
+ *
  * See file CREDITS for list of people who contributed to this
  * project.
  *
@@ -180,6 +183,69 @@ int watchdog_init(void)
 
 #endif                         /* #ifdef CONFIG_M5272 */
 
+#ifdef CONFIG_M5275
+int do_reset(cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
+{
+       volatile rcm_t *rcm = (rcm_t *)(MMAP_RCM);
+
+       udelay(1000);
+
+       rcm->rcr = RCM_RCR_SOFTRST;
+
+       /* we don't return! */
+       return 0;
+};
+
+int checkcpu(void)
+{
+       char buf[32];
+
+       printf("CPU:   Freescale Coldfire MCF5275 at %s MHz\n",
+                       strmhz(buf, CFG_CLK));
+       return 0;
+};
+
+
+#if defined(CONFIG_WATCHDOG)
+/* Called by macro WATCHDOG_RESET */
+void watchdog_reset(void)
+{
+       volatile wdog_t *wdt = (volatile wdog_t *)(MMAP_WDOG);
+       wdt->wsr = 0x5555;
+       wdt->wsr = 0xAAAA;
+}
+
+int watchdog_disable(void)
+{
+       volatile wdog_t *wdt = (volatile wdog_t *)(MMAP_WDOG);
+
+       wdt->wsr = 0x5555; /* reset watchdog counter */
+       wdt->wsr = 0xAAAA;
+       wdt->wcr = 0;   /* disable watchdog timer */
+
+       puts("WATCHDOG:disabled\n");
+       return (0);
+}
+
+int watchdog_init(void)
+{
+       volatile wdog_t *wdt = (volatile wdog_t *)(MMAP_WDOG);
+
+       wdt->wcr = 0;   /* disable watchdog */
+
+       /* set timeout and enable watchdog */
+       wdt->wmr =
+               ((CONFIG_WATCHDOG_TIMEOUT * CFG_HZ) / (32768 * 1000)) - 1;
+       wdt->wsr = 0x5555; /* reset watchdog counter */
+       wdt->wsr = 0xAAAA;
+
+       puts("WATCHDOG:enabled\n");
+       return (0);
+}
+#endif                         /* #ifdef CONFIG_WATCHDOG */
+
+#endif                         /* #ifdef CONFIG_M5275 */
+
 #ifdef CONFIG_M5282
 int checkcpu(void)
 {
index 458b85e..207a37e 100644 (file)
@@ -10,6 +10,9 @@
  * TsiChung Liew (Tsi-Chung.Liew@freescale.com)
  * Hayden Fraser (Hayden.Fraser@freescale.com)
  *
+ * MCF5275 additions
+ * Copyright (C) 2008 Arthur Shipkowski (art@videon-central.com)
+ *
  * See file CREDITS for list of people who contributed to this
  * project.
  *
@@ -245,6 +248,114 @@ void uart_port_conf(void)
 }
 #endif                         /* #if defined(CONFIG_M5272) */
 
+#if defined(CONFIG_M5275)
+
+/*
+ * Breathe some life into the CPU...
+ *
+ * Set up the memory map,
+ * initialize a bunch of registers,
+ * initialize the UPM's
+ */
+void cpu_init_f(void)
+{
+       /* if we come from RAM we assume the CPU is
+        * already initialized.
+        */
+
+#ifndef CONFIG_MONITOR_IS_IN_RAM
+       volatile wdog_t *wdog_reg = (wdog_t *)(MMAP_WDOG);
+       volatile gpio_t *gpio_reg = (gpio_t *)(MMAP_GPIO);
+       volatile csctrl_t *csctrl_reg = (csctrl_t *)(MMAP_FBCS);
+
+       /* Kill watchdog so we can initialize the PLL */
+       wdog_reg->wcr = 0;
+
+       /* Memory Controller: */
+       /* Flash */
+       csctrl_reg->ar0 = CFG_AR0_PRELIM;
+       csctrl_reg->cr0 = CFG_CR0_PRELIM;
+       csctrl_reg->mr0 = CFG_MR0_PRELIM;
+
+#if (defined(CFG_AR1_PRELIM) && defined(CFG_CR1_PRELIM) && defined(CFG_MR1_PRELIM))
+       csctrl_reg->ar1 = CFG_AR1_PRELIM;
+       csctrl_reg->cr1 = CFG_CR1_PRELIM;
+       csctrl_reg->mr1 = CFG_MR1_PRELIM;
+#endif
+
+#if (defined(CFG_AR2_PRELIM) && defined(CFG_CR2_PRELIM) && defined(CFG_MR2_PRELIM))
+       csctrl_reg->ar2 = CFG_AR2_PRELIM;
+       csctrl_reg->cr2 = CFG_CR2_PRELIM;
+       csctrl_reg->mr2 = CFG_MR2_PRELIM;
+#endif
+
+#if (defined(CFG_AR3_PRELIM) && defined(CFG_CR3_PRELIM) && defined(CFG_MR3_PRELIM))
+       csctrl_reg->ar3 = CFG_AR3_PRELIM;
+       csctrl_reg->cr3 = CFG_CR3_PRELIM;
+       csctrl_reg->mr3 = CFG_MR3_PRELIM;
+#endif
+
+#if (defined(CFG_AR4_PRELIM) && defined(CFG_CR4_PRELIM) && defined(CFG_MR4_PRELIM))
+       csctrl_reg->ar4 = CFG_AR4_PRELIM;
+       csctrl_reg->cr4 = CFG_CR4_PRELIM;
+       csctrl_reg->mr4 = CFG_MR4_PRELIM;
+#endif
+
+#if (defined(CFG_AR5_PRELIM) && defined(CFG_CR5_PRELIM) && defined(CFG_MR5_PRELIM))
+       csctrl_reg->ar5 = CFG_AR5_PRELIM;
+       csctrl_reg->cr5 = CFG_CR5_PRELIM;
+       csctrl_reg->mr5 = CFG_MR5_PRELIM;
+#endif
+
+#if (defined(CFG_AR6_PRELIM) && defined(CFG_CR6_PRELIM) && defined(CFG_MR6_PRELIM))
+       csctrl_reg->ar6 = CFG_AR6_PRELIM;
+       csctrl_reg->cr6 = CFG_CR6_PRELIM;
+       csctrl_reg->mr6 = CFG_MR6_PRELIM;
+#endif
+
+#if (defined(CFG_AR7_PRELIM) && defined(CFG_CR7_PRELIM) && defined(CFG_MR7_PRELIM))
+       csctrl_reg->ar7 = CFG_AR7_PRELIM;
+       csctrl_reg->cr7 = CFG_CR7_PRELIM;
+       csctrl_reg->mr7 = CFG_MR7_PRELIM;
+#endif
+
+#endif                         /* #ifndef CONFIG_MONITOR_IS_IN_RAM */
+
+#ifdef CONFIG_FSL_I2C
+       gpio_reg->par_feci2c = 0x000F;
+#endif
+
+       /* enable instruction cache now */
+       icache_enable();
+}
+
+/*
+ * initialize higher level parts of CPU like timers
+ */
+int cpu_init_r(void)
+{
+       return (0);
+}
+
+void uart_port_conf(void)
+{
+       volatile gpio_t *gpio = (gpio_t *)MMAP_GPIO;
+
+       /* Setup Ports: */
+       switch (CFG_UART_PORT) {
+       case 0:
+               gpio->par_uart |= UART0_ENABLE_MASK;
+               break;
+       case 1:
+               gpio->par_uart |= UART1_ENABLE_MASK;
+               break;
+       case 2:
+               gpio->par_uart |= UART2_ENABLE_MASK;
+               break;
+       }
+}
+#endif                         /* #if defined(CONFIG_M5275) */
+
 #if defined(CONFIG_M5282)
 /*
  * Breath some life into the CPU...
index 9167cec..b8fb7bb 100644 (file)
@@ -59,7 +59,7 @@ void dtimer_intr_setup(void)
 #endif                         /* CONFIG_MCFTMR */
 #endif                         /* CONFIG_M5272 */
 
-#if defined(CONFIG_M5282) || defined(CONFIG_M5271)
+#if defined(CONFIG_M5282) || defined(CONFIG_M5271) || defined(CONFIG_M5275)
 int interrupt_init(void)
 {
        volatile int0_t *intp = (int0_t *) (CFG_INTR_BASE);
@@ -81,7 +81,7 @@ void dtimer_intr_setup(void)
        intp->imrl0 &= ~CFG_TMRINTR_MASK;
 }
 #endif                         /* CONFIG_MCFTMR */
-#endif                         /* CONFIG_M5282 | CONFIG_M5271 */
+#endif                         /* CONFIG_M5282 | CONFIG_M5271 | CONFIG_M5275 */
 
 #if defined(CONFIG_M5249) || defined(CONFIG_M5253)
 int interrupt_init(void)
index bc1e200..5fafcd8 100644 (file)
@@ -64,8 +64,20 @@ int get_clocks (void)
 
 #endif                         /* CONFIG_M5249 || CONFIG_M5253 */
 
+#if defined(CONFIG_M5275)
+       volatile pll_t *pll = (volatile pll_t *)(MMAP_PLL);
+
+       /* Setup PLL */
+       pll->syncr = 0x01080000;
+       while (!(pll->synsr & FMPLL_SYNSR_LOCK)
+               ;
+       pll->syncr = 0x01000000;
+       while (!(pll->synsr & FMPLL_SYNSR_LOCK))
+               ;
+#endif
+
        gd->cpu_clk = CFG_CLK;
-#if defined(CONFIG_M5249) || defined(CONFIG_M5253)
+#if defined(CONFIG_M5249) || defined(CONFIG_M5253) || defined(CONFIG_M5275)
        gd->bus_clk = gd->cpu_clk / 2;
 #else
        gd->bus_clk = gd->cpu_clk;
index 260a09a..2bc0df3 100644 (file)
@@ -56,9 +56,7 @@
 _vectors:
 
 .long  0x00000000              /* Flash offset is 0 until we setup CS0 */
-#if defined(CONFIG_R5200)
-.long  0x400
-#elif defined(CONFIG_M5282) && (TEXT_BASE == CFG_INT_FLASH_BASE)
+#if defined(CONFIG_M5282) && (TEXT_BASE == CFG_INT_FLASH_BASE)
 .long  _start - TEXT_BASE
 #else
 .long  _START
@@ -160,7 +158,7 @@ _copy_flash:
 _flashbar_setup:
        /* Initialize FLASHBAR: locate internal Flash and validate it */
        move.l  #(CFG_INT_FLASH_BASE + CFG_INT_FLASH_ENABLE), %d0
-       movec   %d0, %RAMBAR0
+       movec   %d0, %FLASHBAR
        jmp _after_flashbar_copy.L      /* Force jump to absolute address */
 _flashbar_setup_end:
        nop
@@ -168,7 +166,7 @@ _after_flashbar_copy:
 #else
        /* Setup code to initialize FLASHBAR, if start from external Memory */
        move.l  #(CFG_INT_FLASH_BASE + CFG_INT_FLASH_ENABLE), %d0
-       movec   %d0, %RAMBAR0
+       movec   %d0, %RAMBAR1
 #endif /* (TEXT_BASE == CFG_INT_FLASH_BASE) */
 
 #endif
@@ -185,16 +183,15 @@ _after_flashbar_copy:
        movec   %d0, %VBR
 #endif
 
-#ifdef CONFIG_R5200
-       move.l  #(_flash_setup-CFG_FLASH_BASE), %a0
-       move.l  #(_flash_setup_end-CFG_FLASH_BASE), %a1
-       move.l  #(CFG_INIT_RAM_ADDR), %a2
-_copy_flash:
-       move.l  (%a0)+, (%a2)+
-       cmp.l   %a0, %a1
-       bgt.s   _copy_flash
-       jmp     CFG_INIT_RAM_ADDR
-_after_flash_copy:
+#ifdef CONFIG_M5275
+       /* Initialize IPSBAR */
+       move.l  #(CFG_MBAR + 1), %d0            /* set IPSBAR address + valid flag */
+       move.l  %d0, 0x40000000
+/*     movec   %d0, %MBAR */
+
+       /* Initialize RAMBAR: locate SRAM and validate it */
+       move.l  #(CFG_INIT_RAM_ADDR + 0x21), %d0
+       movec   %d0, %RAMBAR1
 #endif
 
 #if 0
@@ -219,24 +216,6 @@ _after_flash_copy:
 
 /*------------------------------------------------------------------------------*/
 
-#ifdef CONFIG_R5200
-_flash_setup:
-       /* CSAR0 */
-       move.l  #((CFG_FLASH_BASE & 0xffff0000) >> 16), %d0
-       move.w  %d0, 0x40000080
-
-       /* CSCR0 */
-       move.l  #0x2180, %d0            /* 8 wait states, 16bit port, auto ack,  */
-       move.w  %d0, 0x4000008A
-
-       /* CSMR0 */
-       move.l  #0x001f0001, %d0        /* 2 MB, valid */
-       move.l  %d0, 0x40000084
-
-       jmp     _after_flash_copy.L
-_flash_setup_end:
-#endif
-
 /*
  * void relocate_code (addr_sp, gd, addr_moni)
  *
@@ -394,6 +373,25 @@ icache_enable:
        rts
 #endif
 
+#if  defined(CONFIG_M5275)
+/*
+ * Instruction cache only
+ */
+       .globl  icache_enable
+icache_enable:
+       move.l  #0x01400000, %d0                /* Invalidate cache cmd */
+       movec   %d0, %CACR                      /* Invalidate cache */
+       move.l  #0x0000c000, %d0                /* Setup SDRAM caching */
+       movec   %d0, %ACR0                      /* Enable cache */
+       move.l  #0x00000000, %d0                /* No other caching */
+       movec   %d0, %ACR1                      /* Enable cache */
+       move.l  #0x80400100, %d0                /* Setup cache mask */
+       movec   %d0, %CACR                      /* Enable cache */
+       moveq   #1, %d0
+       move.l  %d0, icache_state
+       rts
+#endif
+
 #ifdef CONFIG_M5282
        .globl  icache_enable
 icache_enable:
@@ -478,3 +476,4 @@ version_string:
        .ascii U_BOOT_VERSION
        .ascii " (", __DATE__, " - ", __TIME__, ")"
        .ascii CONFIG_IDENT_STRING, "\0"
+       .align 4
index 61be2ea..a524f70 100644 (file)
@@ -333,3 +333,4 @@ version_string:
        .ascii U_BOOT_VERSION
        .ascii " (", __DATE__, " - ", __TIME__, ")"
        .ascii CONFIG_IDENT_STRING, "\0"
+       .align 4
index 26ec298..a549fdd 100644 (file)
@@ -28,7 +28,7 @@ include $(TOPDIR)/config.mk
 LIB    = lib$(CPU).a
 
 START  = start.o
-COBJS  = cpu.o speed.o cpu_init.o interrupts.o pci.o
+COBJS  = cpu.o speed.o cpu_init.o interrupts.o pci.o dspi.o
 
 SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
diff --git a/cpu/mcf5445x/dspi.c b/cpu/mcf5445x/dspi.c
new file mode 100644 (file)
index 0000000..44d8505
--- /dev/null
@@ -0,0 +1,73 @@
+/*
+ *
+ * (C) Copyright 2000-2003
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * Copyright (C) 2004-2008 Freescale Semiconductor, Inc.
+ * TsiChung Liew (Tsi-Chung.Liew@freescale.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 <spi.h>
+
+#if defined(CONFIG_CF_DSPI)
+#include <asm/immap.h>
+void dspi_init(void)
+{
+       volatile gpio_t *gpio = (gpio_t *) MMAP_GPIO;
+       volatile dspi_t *dspi = (dspi_t *) MMAP_DSPI;
+
+       gpio->par_dspi = GPIO_PAR_DSPI_PCS5_PCS5 | GPIO_PAR_DSPI_PCS2_PCS2 |
+           GPIO_PAR_DSPI_PCS1_PCS1 | GPIO_PAR_DSPI_PCS0_PCS0 |
+           GPIO_PAR_DSPI_SIN_SIN | GPIO_PAR_DSPI_SOUT_SOUT |
+           GPIO_PAR_DSPI_SCK_SCK;
+
+       dspi->dmcr = DSPI_DMCR_MSTR | DSPI_DMCR_CSIS7 | DSPI_DMCR_CSIS6 |
+           DSPI_DMCR_CSIS5 | DSPI_DMCR_CSIS4 | DSPI_DMCR_CSIS3 |
+           DSPI_DMCR_CSIS2 | DSPI_DMCR_CSIS1 | DSPI_DMCR_CSIS0 |
+           DSPI_DMCR_CRXF | DSPI_DMCR_CTXF;
+
+       dspi->dctar0 = DSPI_DCTAR_TRSZ(7) | DSPI_DCTAR_CPOL | DSPI_DCTAR_CPHA |
+           DSPI_DCTAR_PCSSCK_1CLK | DSPI_DCTAR_PASC(0) |
+           DSPI_DCTAR_PDT(0) | DSPI_DCTAR_CSSCK(0) |
+           DSPI_DCTAR_ASC(0) | DSPI_DCTAR_PBR(0) |
+           DSPI_DCTAR_DT(1) | DSPI_DCTAR_BR(1);
+}
+
+void dspi_tx(int chipsel, u8 attrib, u16 data)
+{
+       volatile dspi_t *dspi = (dspi_t *) MMAP_DSPI;
+
+       while ((dspi->dsr & 0x0000F000) >= 4) ;
+
+       dspi->dtfr = (attrib << 24) | ((1 << chipsel) << 16) | data;
+}
+
+u16 dspi_rx(void)
+{
+       volatile dspi_t *dspi = (dspi_t *) MMAP_DSPI;
+
+       while ((dspi->dsr & 0x000000F0) == 0) ;
+
+       return (dspi->drfr & 0xFFFF);
+}
+
+#endif                         /* CONFIG_HARD_SPI */
index d64c5af..0c5194a 100644 (file)
@@ -379,3 +379,4 @@ version_string:
        .ascii U_BOOT_VERSION
        .ascii " (", __DATE__, " - ", __TIME__, ")"
        .ascii CONFIG_IDENT_STRING, "\0"
+       .align 4
index 442665f..c12d7a0 100644 (file)
@@ -359,3 +359,4 @@ version_string:
        .ascii U_BOOT_VERSION
        .ascii " (", __DATE__, " - ", __TIME__, ")"
        .ascii CONFIG_IDENT_STRING, "\0"
+       .align 4
index 443240e..f593968 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Cache-handling routined for MIPS 4K CPUs
+ *  Cache-handling routined for MIPS CPUs
  *
  *  Copyright (c) 2003 Wolfgang Denk <wd@denx.de>
  *
 
 #include <config.h>
 #include <version.h>
+#include <asm/asm.h>
 #include <asm/regdef.h>
 #include <asm/mipsregs.h>
 #include <asm/addrspace.h>
 #include <asm/cacheops.h>
 
-       /* 16KB is the maximum size of instruction and data caches on
-        * MIPS 4K.
-        */
-#define MIPS_MAX_CACHE_SIZE    0x4000
+#define RA             t8
+
+/*
+ * 16kB is the maximum size of instruction and data caches on MIPS 4K,
+ * 64kB is on 4KE, 24K, 5K, etc. Set bigger size for convenience.
+ *
+ * Note that the above size is the maximum size of primary cache. U-Boot
+ * doesn't have L2 cache support for now.
+ */
+#define MIPS_MAX_CACHE_SIZE    0x10000
+
+#define INDEX_BASE     KSEG0
+
+       .macro  cache_op op addr
+       .set    push
+       .set    noreorder
+       .set    mips3
+       cache   \op, 0(\addr)
+       .set    pop
+       .endm
 
 /*
  * cacheop macro to automate cache operations
 #define icacheop(kva, n, cacheSize, cacheLineSize, op) \
    icacheopn(kva, n, cacheSize, cacheLineSize, 1, (op))
 
+       .macro  f_fill64 dst, offset, val
+       LONG_S  \val, (\offset +  0 * LONGSIZE)(\dst)
+       LONG_S  \val, (\offset +  1 * LONGSIZE)(\dst)
+       LONG_S  \val, (\offset +  2 * LONGSIZE)(\dst)
+       LONG_S  \val, (\offset +  3 * LONGSIZE)(\dst)
+       LONG_S  \val, (\offset +  4 * LONGSIZE)(\dst)
+       LONG_S  \val, (\offset +  5 * LONGSIZE)(\dst)
+       LONG_S  \val, (\offset +  6 * LONGSIZE)(\dst)
+       LONG_S  \val, (\offset +  7 * LONGSIZE)(\dst)
+#if LONGSIZE == 4
+       LONG_S  \val, (\offset +  8 * LONGSIZE)(\dst)
+       LONG_S  \val, (\offset +  9 * LONGSIZE)(\dst)
+       LONG_S  \val, (\offset + 10 * LONGSIZE)(\dst)
+       LONG_S  \val, (\offset + 11 * LONGSIZE)(\dst)
+       LONG_S  \val, (\offset + 12 * LONGSIZE)(\dst)
+       LONG_S  \val, (\offset + 13 * LONGSIZE)(\dst)
+       LONG_S  \val, (\offset + 14 * LONGSIZE)(\dst)
+       LONG_S  \val, (\offset + 15 * LONGSIZE)(\dst)
+#endif
+       .endm
+
+/*
+ * mips_init_icache(uint PRId, ulong icache_size, unchar icache_linesz)
+ */
+LEAF(mips_init_icache)
+       blez    a1, 9f
+       mtc0    zero, CP0_TAGLO
+       /* clear tag to invalidate */
+       PTR_LI          t0, INDEX_BASE
+       PTR_ADDU        t1, t0, a1
+1:     cache_op        Index_Store_Tag_I t0
+       PTR_ADDU        t0, a2
+       bne             t0, t1, 1b
+       /* fill once, so data field parity is correct */
+       PTR_LI          t0, INDEX_BASE
+2:     cache_op        Fill t0
+       PTR_ADDU        t0, a2
+       bne             t0, t1, 2b
+       /* invalidate again - prudent but not strictly neccessary */
+       PTR_LI          t0, INDEX_BASE
+1:     cache_op        Index_Store_Tag_I t0
+       PTR_ADDU        t0, a2
+       bne             t0, t1, 1b
+9:     jr      ra
+       END(mips_init_icache)
+
+/*
+ * mips_init_dcache(uint PRId, ulong dcache_size, unchar dcache_linesz)
+ */
+LEAF(mips_init_dcache)
+       blez    a1, 9f
+       mtc0    zero, CP0_TAGLO
+       /* clear all tags */
+       PTR_LI          t0, INDEX_BASE
+       PTR_ADDU        t1, t0, a1
+1:     cache_op        Index_Store_Tag_D t0
+       PTR_ADDU        t0, a2
+       bne             t0, t1, 1b
+       /* load from each line (in cached space) */
+       PTR_LI          t0, INDEX_BASE
+2:     LONG_L          zero, 0(t0)
+       PTR_ADDU        t0, a2
+       bne             t0, t1, 2b
+       /* clear all tags */
+       PTR_LI          t0, INDEX_BASE
+1:     cache_op        Index_Store_Tag_D t0
+       PTR_ADDU        t0, a2
+       bne             t0, t1, 1b
+9:     jr      ra
+       END(mips_init_dcache)
+
 /*******************************************************************************
 *
 * mips_cache_reset - low level initialisation of the primary caches
 * RETURNS: N/A
 *
 */
-       .globl  mips_cache_reset
-       .ent    mips_cache_reset
-mips_cache_reset:
-
+NESTED(mips_cache_reset, 0, ra)
+       move    RA, ra
        li      t2, CFG_ICACHE_SIZE
        li      t3, CFG_DCACHE_SIZE
        li      t4, CFG_CACHELINE_SIZE
@@ -130,27 +216,14 @@ mips_cache_reset:
 
        li      v0, MIPS_MAX_CACHE_SIZE
 
-       /* Now clear that much memory starting from zero.
-        */
-
-       li      a0, KSEG1
-       addu    a1, a0, v0
-2:
-       sw      zero, 0(a0)
-       sw      zero, 4(a0)
-       sw      zero, 8(a0)
-       sw      zero, 12(a0)
-       sw      zero, 16(a0)
-       sw      zero, 20(a0)
-       sw      zero, 24(a0)
-       sw      zero, 28(a0)
-       addu    a0, 32
-       bltu    a0, a1, 2b
-
-       /* Set invalid tag.
+       /*
+        * Now clear that much memory starting from zero.
         */
-
-       mtc0    zero, CP0_TAGLO
+       PTR_LI          a0, KSEG1
+       PTR_ADDU        a1, a0, v0
+2:     PTR_ADDIU       a0, 64
+       f_fill64        a0, -64, zero
+       bne             a0, a1, 2b
 
        /*
         * The caches are probably in an indeterminate state,
@@ -158,48 +231,26 @@ mips_cache_reset:
         * invalidate, load/fill, invalidate for each line.
         */
 
-       /* Assume bottom of RAM will generate good parity for the cache.
-        */
-
-       li      a0, K0BASE
-       move    a2, t2          # icacheSize
-       move    a3, t4          # icacheLineSize
-       move    a1, a2
-       icacheopn(a0,a1,a2,a3,121,(Index_Store_Tag_I,Fill))
-
-       /* To support Orion/R4600, we initialise the data cache in 3 passes.
-        */
-
-       /* 1: initialise dcache tags.
+       /*
+        * Assume bottom of RAM will generate good parity for the cache.
         */
 
-       li      a0, K0BASE
-       move    a2, t3          # dcacheSize
-       move    a3, t5          # dcacheLineSize
-       move    a1, a2
-       icacheop(a0,a1,a2,a3,Index_Store_Tag_D)
-
-       /* 2: fill dcache.
+       /*
+        * Initialize the I-cache first,
         */
+       move    a1, t2
+       move    a2, t4
+       bal     mips_init_icache
 
-       li      a0, K0BASE
-       move    a2, t3          # dcacheSize
-       move    a3, t5          # dcacheLineSize
-       move    a1, a2
-       icacheopn(a0,a1,a2,a3,1lw,(dummy))
-
-       /* 3: clear dcache tags.
+       /*
+        * then initialize D-cache.
         */
+       move    a1, t3
+       move    a2, t5
+       bal     mips_init_dcache
 
-       li      a0, K0BASE
-       move    a2, t3          # dcacheSize
-       move    a3, t5          # dcacheLineSize
-       move    a1, a2
-       icacheop(a0,a1,a2,a3,Index_Store_Tag_D)
-
-       j       ra
-
-       .end    mips_cache_reset
+       jr      RA
+       END(mips_cache_reset)
 
 /*******************************************************************************
 *
@@ -208,15 +259,15 @@ mips_cache_reset:
 * RETURNS: 0 - cache disabled; 1 - cache enabled
 *
 */
-       .globl  dcache_status
-       .ent    dcache_status
-dcache_status:
-
-       mfc0    v0, CP0_CONFIG
-       andi    v0, v0, 1
-       j       ra
-
-       .end    dcache_status
+LEAF(dcache_status)
+       mfc0    t0, CP0_CONFIG
+       li      t1, CONF_CM_UNCACHED
+       andi    t0, t0, CONF_CM_CMASK
+       move    v0, zero
+       beq     t0, t1, 2f
+       li      v0, 1
+2:     jr      ra
+       END(dcache_status)
 
 /*******************************************************************************
 *
@@ -225,19 +276,16 @@ dcache_status:
 * RETURNS: N/A
 *
 */
-       .globl  dcache_disable
-       .ent    dcache_disable
-dcache_disable:
-
+LEAF(dcache_disable)
        mfc0    t0, CP0_CONFIG
        li      t1, -8
        and     t0, t0, t1
        ori     t0, t0, CONF_CM_UNCACHED
        mtc0    t0, CP0_CONFIG
-       j       ra
-
-       .end    dcache_disable
+       jr      ra
+       END(dcache_disable)
 
+#ifdef CFG_INIT_RAM_LOCK_MIPS
 /*******************************************************************************
 *
 * mips_cache_lock - lock RAM area pointed to by a0 in cache.
@@ -260,6 +308,7 @@ mips_cache_lock:
        move    a1, a2
        icacheop(a0,a1,a2,a3,0x1d)
 
-       j       ra
+       jr      ra
 
        .end    mips_cache_lock
+#endif /* CFG_INIT_RAM_LOCK_MIPS */
index 7559ac6..e267bba 100644 (file)
 
 #include <common.h>
 #include <command.h>
-#include <asm/inca-ip.h>
 #include <asm/mipsregs.h>
+#include <asm/cacheops.h>
+#include <asm/reboot.h>
+
+#define cache_op(op,addr)                                              \
+       __asm__ __volatile__(                                           \
+       "       .set    push                                    \n"     \
+       "       .set    noreorder                               \n"     \
+       "       .set    mips3\n\t                               \n"     \
+       "       cache   %0, %1                                  \n"     \
+       "       .set    pop                                     \n"     \
+       :                                                               \
+       : "i" (op), "R" (*(unsigned char *)(addr)))
+
+void __attribute__((weak)) _machine_restart(void)
+{
+}
 
 int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
-#if defined(CONFIG_INCA_IP)
-       *INCA_IP_WDT_RST_REQ = 0x3f;
-#elif defined(CONFIG_PURPLE) || defined(CONFIG_TB0229)
-       void (*f)(void) = (void *) 0xbfc00000;
+       _machine_restart();
 
-       f();
-#endif
        fprintf(stderr, "*** reset failed ***\n");
        return 0;
 }
 
 void flush_cache(ulong start_addr, ulong size)
 {
+       unsigned long lsize = CFG_CACHELINE_SIZE;
+       unsigned long addr = start_addr & ~(lsize - 1);
+       unsigned long aend = (start_addr + size - 1) & ~(lsize - 1);
+
+       while (1) {
+               cache_op(Hit_Writeback_Inv_D, addr);
+               cache_op(Hit_Invalidate_I, addr);
+               if (addr == aend)
+                       break;
+               addr += lsize;
+       }
 }
 
 void write_one_tlb(int index, u32 pagemask, u32 hi, u32 low0, u32 low1)
index 71adaa1..2ebcc91 100644 (file)
@@ -68,5 +68,5 @@ disable_incaip_wdt:
        li      t1, WD_WRITE_ENDINIT
        sw      t1, WD_CON0(t0)         /* end command */
 
-       j       ra
+       jr      ra
        nop
index c92b162..6e1a78c 100644 (file)
 #include <asm/regdef.h>
 #include <asm/mipsregs.h>
 
+       /*
+        * For the moment disable interrupts, mark the kernel mode and
+        * set ST0_KX so that the CPU does not spit fire when using
+        * 64-bit addresses.
+        */
+       .macro  setup_c0_status set clr
+       .set    push
+       mfc0    t0, CP0_STATUS
+       or      t0, ST0_CU0 | \set | 0x1f | \clr
+       xor     t0, 0x1f | \clr
+       mtc0    t0, CP0_STATUS
+       .set    noreorder
+       sll     zero, 3                         # ehb
+       .set    pop
+       .endm
+
+       .macro  setup_c0_status_reset
+#ifdef CONFIG_64BIT
+       setup_c0_status ST0_KX 0
+#else
+       setup_c0_status 0 0
+#endif
+       .endm
+
 #define RVECENT(f,n) \
    b f; nop
 #define XVECENT(f,bev) \
@@ -211,19 +235,11 @@ reset:
        mtc0    zero, CP0_WATCHLO
        mtc0    zero, CP0_WATCHHI
 
-       /* STATUS register */
-#ifdef  CONFIG_TB0229
-       li      k0, ST0_CU0
-#else
-       mfc0    k0, CP0_STATUS
-#endif
-       li      k1, ~ST0_IE
-       and     k0, k1
-       mtc0    k0, CP0_STATUS
-
-       /* CAUSE register */
+       /* WP(Watch Pending), SW0/1 should be cleared. */
        mtc0    zero, CP0_CAUSE
 
+       setup_c0_status_reset
+
        /* Init Timer */
        mtc0    zero, CP0_COUNT
        mtc0    zero, CP0_COMPARE
@@ -240,14 +256,6 @@ reset:
 1:
        lw      gp, 0(ra)
 
-#ifdef CONFIG_INCA_IP
-       /* Disable INCA-IP Watchdog.
-        */
-       la      t9, disable_incaip_wdt
-       jalr    t9
-       nop
-#endif
-
        /* Initialize any external memory.
         */
        la      t9, lowlevel_init
@@ -267,16 +275,18 @@ reset:
 
        /* Set up temporary stack.
         */
+#ifdef CFG_INIT_RAM_LOCK_MIPS
        li      a0, CFG_INIT_SP_OFFSET
        la      t9, mips_cache_lock
        jalr    t9
        nop
+#endif
 
        li      t0, CFG_SDRAM_BASE + CFG_INIT_SP_OFFSET
        la      sp, 0(t0)
 
        la      t9, board_init_f
-       j       t9
+       jr      t9
        nop
 
 /*
@@ -332,7 +342,7 @@ relocate_code:
        /* Jump to where we've relocated ourselves.
         */
        addi    t0, a2, in_ram - _start
-       j       t0
+       jr      t0
        nop
 
        .gpword _GLOBAL_OFFSET_TABLE_   /* _GLOBAL_OFFSET_TABLE_ - _gp  */
@@ -377,7 +387,7 @@ in_ram:
 
        move    a0, a1
        la      t9, board_init_r
-       j       t9
+       jr      t9
        move    a1, a2          /* delay slot                   */
 
        .end    relocate_code
index ca1de95..386a6e0 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index e4d6168..ace1653 100644 (file)
@@ -114,12 +114,14 @@ unsigned long get_tbclk (void)
 
 /* ------------------------------------------------------------------------- */
 
-#ifdef CONFIG_OF_LIBFDT
+#if defined(CONFIG_OF_LIBFDT) && defined (CONFIG_OF_BOARD_SETUP)
 void ft_cpu_setup(void *blob, bd_t *bd)
 {
        int div = in_8((void*)CFG_MBAR + 0x204) & 0x0020 ? 8 : 4;
        char * cpu_path = "/cpus/" OF_CPU;
+#ifdef CONFIG_MPC5xxx_FEC
        char * eth_path = "/" OF_SOC "/ethernet@3000";
+#endif
 
        do_fixup_by_path_u32(blob, cpu_path, "timebase-frequency", OF_TBCLK, 1);
        do_fixup_by_path_u32(blob, cpu_path, "bus-frequency", bd->bi_busfreq, 1);
@@ -127,7 +129,9 @@ void ft_cpu_setup(void *blob, bd_t *bd)
        do_fixup_by_path_u32(blob, "/" OF_SOC, "bus-frequency", bd->bi_ipbfreq, 1);
        do_fixup_by_path_u32(blob, "/" OF_SOC, "system-frequency",
                                bd->bi_busfreq*div, 1);
+#ifdef CONFIG_MPC5xxx_FEC
        do_fixup_by_path(blob, eth_path, "mac-address", bd->bi_enetaddr, 6, 0);
        do_fixup_by_path(blob, eth_path, "local-mac-address", bd->bi_enetaddr, 6, 0);
+#endif
 }
 #endif
index 4e10ddb..bbb6cf8 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index bb2747b..db6c6f2 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 98b0a79..ff4f3dc 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 036e61b..1f2e7d7 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 55e61a1..414759e 100644 (file)
@@ -300,7 +300,7 @@ void watchdog_reset (void)
 #endif /* CONFIG_WATCHDOG */
 
 /* ------------------------------------------------------------------------- */
-#if defined(CONFIG_OF_LIBFDT)
+#if defined(CONFIG_OF_LIBFDT) && defined (CONFIG_OF_BOARD_SETUP)
 void ft_cpu_setup (void *blob, bd_t *bd)
 {
        char * cpu_path = "/cpus/" OF_CPU;
index 8384549..6f500c4 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 OUTPUT_ARCH(powerpc)
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS
index 94a3cb8..fcb6a52 100644 (file)
@@ -28,9 +28,20 @@ include $(TOPDIR)/config.mk
 LIB    = $(obj)lib$(CPU).a
 
 START  = start.o
-COBJS  = traps.o cpu.o cpu_init.o speed.o interrupts.o \
-         spd_sdram.o ecc.o qe_io.o pci.o fdt.o
 
+COBJS-y += traps.o
+COBJS-y += cpu.o
+COBJS-y += cpu_init.o
+COBJS-y += speed.o
+COBJS-y += interrupts.o
+COBJS-y += spd_sdram.o
+COBJS-y += ecc.o
+COBJS-$(CONFIG_QE) += qe_io.o
+COBJS-$(CONFIG_FSL_SERDES) += serdes.o
+COBJS-$(CONFIG_83XX_GENERIC_PCI) += pci.o
+COBJS-$(CONFIG_OF_LIBFDT) += fdt.o
+
+COBJS  := $(COBJS-y)
 SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
 START  := $(addprefix $(obj),$(START))
index bff3cef..36de78d 100644 (file)
@@ -42,6 +42,30 @@ int checkcpu(void)
        u32 pvr = get_pvr();
        u32 spridr;
        char buf[32];
+       int i;
+
+#define CPU_TYPE_ENTRY(x) {#x, SPR_##x}
+       const struct cpu_type {
+               char name[15];
+               u32 partid;
+       } cpu_type_list [] = {
+               CPU_TYPE_ENTRY(8311),
+               CPU_TYPE_ENTRY(8313),
+               CPU_TYPE_ENTRY(8314),
+               CPU_TYPE_ENTRY(8315),
+               CPU_TYPE_ENTRY(8321),
+               CPU_TYPE_ENTRY(8323),
+               CPU_TYPE_ENTRY(8343),
+               CPU_TYPE_ENTRY(8347_TBGA_),
+               CPU_TYPE_ENTRY(8347_PBGA_),
+               CPU_TYPE_ENTRY(8349),
+               CPU_TYPE_ENTRY(8358_TBGA_),
+               CPU_TYPE_ENTRY(8358_PBGA_),
+               CPU_TYPE_ENTRY(8360),
+               CPU_TYPE_ENTRY(8377),
+               CPU_TYPE_ENTRY(8378),
+               CPU_TYPE_ENTRY(8379),
+       };
 
        immr = (immap_t *)CFG_IMMR;
 
@@ -69,130 +93,26 @@ int checkcpu(void)
        }
 
        spridr = immr->sysconf.spridr;
-       switch(spridr) {
-       case SPR_8349E_REV10:
-       case SPR_8349E_REV11:
-       case SPR_8349E_REV31:
-               puts("MPC8349E, ");
-               break;
-       case SPR_8349_REV10:
-       case SPR_8349_REV11:
-       case SPR_8349_REV31:
-               puts("MPC8349, ");
-               break;
-       case SPR_8347E_REV10_TBGA:
-       case SPR_8347E_REV11_TBGA:
-       case SPR_8347E_REV31_TBGA:
-       case SPR_8347E_REV10_PBGA:
-       case SPR_8347E_REV11_PBGA:
-       case SPR_8347E_REV31_PBGA:
-               puts("MPC8347E, ");
-               break;
-       case SPR_8347_REV10_TBGA:
-       case SPR_8347_REV11_TBGA:
-       case SPR_8347_REV31_TBGA:
-       case SPR_8347_REV10_PBGA:
-       case SPR_8347_REV11_PBGA:
-       case SPR_8347_REV31_PBGA:
-               puts("MPC8347, ");
-               break;
-       case SPR_8343E_REV10:
-       case SPR_8343E_REV11:
-       case SPR_8343E_REV31:
-               puts("MPC8343E, ");
-               break;
-       case SPR_8343_REV10:
-       case SPR_8343_REV11:
-       case SPR_8343_REV31:
-               puts("MPC8343, ");
-               break;
-       case SPR_8360E_REV10:
-       case SPR_8360E_REV11:
-       case SPR_8360E_REV12:
-       case SPR_8360E_REV20:
-       case SPR_8360E_REV21:
-               puts("MPC8360E, ");
-               break;
-       case SPR_8360_REV10:
-       case SPR_8360_REV11:
-       case SPR_8360_REV12:
-       case SPR_8360_REV20:
-       case SPR_8360_REV21:
-               puts("MPC8360, ");
-               break;
-       case SPR_8323E_REV10:
-       case SPR_8323E_REV11:
-               puts("MPC8323E, ");
-               break;
-       case SPR_8323_REV10:
-       case SPR_8323_REV11:
-               puts("MPC8323, ");
-               break;
-       case SPR_8321E_REV10:
-       case SPR_8321E_REV11:
-               puts("MPC8321E, ");
-               break;
-       case SPR_8321_REV10:
-       case SPR_8321_REV11:
-               puts("MPC8321, ");
-               break;
-       case SPR_8311_REV10:
-               puts("MPC8311, ");
-               break;
-       case SPR_8311E_REV10:
-               puts("MPC8311E, ");
-               break;
-       case SPR_8313_REV10:
-               puts("MPC8313, ");
-               break;
-       case SPR_8313E_REV10:
-               puts("MPC8313E, ");
-               break;
-       case SPR_8315E_REV10:
-               puts("MPC8315E, ");
-               break;
-       case SPR_8315_REV10:
-               puts("MPC8315, ");
-               break;
-       case SPR_8314E_REV10:
-               puts("MPC8314E, ");
-               break;
-       case SPR_8314_REV10:
-               puts("MPC8314, ");
-               break;
-       case SPR_8379E_REV10:
-               puts("MPC8379E, ");
-               break;
-       case SPR_8379_REV10:
-               puts("MPC8379, ");
-               break;
-       case SPR_8378E_REV10:
-               puts("MPC8378E, ");
-               break;
-       case SPR_8378_REV10:
-               puts("MPC8378, ");
-               break;
-       case SPR_8377E_REV10:
-               puts("MPC8377E, ");
-               break;
-       case SPR_8377_REV10:
-               puts("MPC8377, ");
-               break;
-       default:
-               printf("Rev: Unknown revision number:%08x\n"
-                       "Warning: Unsupported cpu revision!\n",spridr);
-               return 0;
-       }
 
-#if defined(CONFIG_MPC834X)
-       /* Multiple revisons of 834x processors may have the same SPRIDR value.
-        * So use PVR to identify the revision number.
-        */
-       printf("Rev: %02x at %s MHz", PVR_MAJ(pvr)<<4 | PVR_MIN(pvr), strmhz(buf, clock));
-#else
-       printf("Rev: %02x at %s MHz", spridr & 0x0000FFFF, strmhz(buf, clock));
-#endif
-       printf(", CSB: %4d MHz\n", gd->csb_clk / 1000000);
+       for (i = 0; i < ARRAY_SIZE(cpu_type_list); i++)
+               if (cpu_type_list[i].partid == PARTID_NO_E(spridr)) {
+                       puts("MPC");
+                       puts(cpu_type_list[i].name);
+                       if (IS_E_PROCESSOR(spridr))
+                               puts("E");
+                       if (REVID_MAJOR(spridr) >= 2)
+                               puts("A");
+                       printf(", Rev: %d.%d", REVID_MAJOR(spridr),
+                              REVID_MINOR(spridr));
+                       break;
+               }
+
+       if (i == ARRAY_SIZE(cpu_type_list))
+               printf("(SPRIDR %08x unknown), ", spridr);
+
+       printf(" at %s MHz, ", strmhz(buf, clock));
+
+       printf("CSB: %s MHz\n", strmhz(buf, gd->csb_clk));
 
        return 0;
 }
index e643037..fba5b02 100644 (file)
@@ -79,6 +79,12 @@ void cpu_init_f (volatile immap_t * im)
                          (CFG_ACR_RPTCNT << ACR_RPTCNT_SHIFT);
 #endif
 
+#ifdef CFG_SPCR_OPT
+       /* Optimize transactions between CSB and other devices */
+       im->sysconf.spcr = (im->sysconf.spcr & ~SPCR_OPT) |
+                          (CFG_SPCR_OPT << SPCR_OPT_SHIFT);
+#endif
+
 #ifdef CFG_SPCR_TSECEP
        /* all eTSEC's Emergency priority */
        im->sysconf.spcr = (im->sysconf.spcr & ~SPCR_TSECEP) |
index 6f55932..b39f678 100644 (file)
@@ -24,9 +24,6 @@
  */
 
 #include <common.h>
-
-#if defined(CONFIG_OF_LIBFDT)
-
 #include <libfdt.h>
 #include <fdt_support.h>
 
@@ -49,6 +46,14 @@ void ft_cpu_setup(void *blob, bd_t *bd)
                "clock-frequency", gd->core_clk, 1);
        do_fixup_by_prop_u32(blob, "device_type", "soc", 4,
                "bus-frequency", bd->bi_busfreq, 1);
+       do_fixup_by_compat_u32(blob, "fsl,soc",
+               "bus-frequency", bd->bi_busfreq, 1);
+       do_fixup_by_compat_u32(blob, "fsl,soc",
+               "clock-frequency", bd->bi_busfreq, 1);
+       do_fixup_by_compat_u32(blob, "fsl,immr",
+               "bus-frequency", bd->bi_busfreq, 1);
+       do_fixup_by_compat_u32(blob, "fsl,immr",
+               "clock-frequency", bd->bi_busfreq, 1);
 #ifdef CONFIG_QE
        ft_qe_setup(blob);
 #endif
@@ -68,4 +73,3 @@ void ft_cpu_setup(void *blob, bd_t *bd)
 
        fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
 }
-#endif /* CONFIG_OF_LIBFDT */
index 18558db..adabf7a 100644 (file)
@@ -33,7 +33,6 @@
 
 #include <asm/mpc8349_pci.h>
 
-#ifdef CONFIG_83XX_GENERIC_PCI
 #define MAX_BUSES 2
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -209,4 +208,3 @@ void ft_pci_setup(void *blob, bd_t *bd)
        }
 }
 #endif /* CONFIG_OF_LIBFDT */
-#endif /* CONFIG_83XX_GENERIC_PCI */
index 8b3937a..ce91a07 100644 (file)
@@ -25,7 +25,6 @@
 #include "asm/io.h"
 #include "asm/immap_83xx.h"
 
-#if defined(CONFIG_QE)
 #define        NUM_OF_PINS     32
 void qe_config_iopin(u8 port, u8 pin, int dir, int open_drain, int assign)
 {
@@ -81,5 +80,3 @@ void qe_config_iopin(u8 port, u8 pin, int dir, int open_drain, int assign)
                out_be32(&par_io->ioport[port].ppar1, pin_2bit_assign | tmp_val);
        }
 }
-
-#endif /* CONFIG_QE */
diff --git a/cpu/mpc83xx/serdes.c b/cpu/mpc83xx/serdes.c
new file mode 100644 (file)
index 0000000..020c4c8
--- /dev/null
@@ -0,0 +1,145 @@
+/*
+ * Freescale SerDes initialization routine
+ *
+ * Copyright (C) 2007 Freescale Semicondutor, Inc. All rights reserved.
+ * Copyright (C) 2008 MontaVista Software, Inc. All rights reserved.
+ *
+ * Author: Li Yang <leoli@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/fsl_serdes.h>
+
+/* SerDes registers */
+#define FSL_SRDSCR0_OFFS               0x0
+#define FSL_SRDSCR0_DPP_1V2            0x00008800
+#define FSL_SRDSCR1_OFFS               0x4
+#define FSL_SRDSCR1_PLLBW              0x00000040
+#define FSL_SRDSCR2_OFFS               0x8
+#define FSL_SRDSCR2_VDD_1V2            0x00800000
+#define FSL_SRDSCR2_SEIC_MASK          0x00001c1c
+#define FSL_SRDSCR2_SEIC_SATA          0x00001414
+#define FSL_SRDSCR2_SEIC_PEX           0x00001010
+#define FSL_SRDSCR2_SEIC_SGMII         0x00000101
+#define FSL_SRDSCR3_OFFS               0xc
+#define FSL_SRDSCR3_KFR_SATA           0x10100000
+#define FSL_SRDSCR3_KPH_SATA           0x04040000
+#define FSL_SRDSCR3_SDFM_SATA_PEX      0x01010000
+#define FSL_SRDSCR3_SDTXL_SATA         0x00000505
+#define FSL_SRDSCR4_OFFS               0x10
+#define FSL_SRDSCR4_PROT_SATA          0x00000808
+#define FSL_SRDSCR4_PROT_PEX           0x00000101
+#define FSL_SRDSCR4_PROT_SGMII         0x00000505
+#define FSL_SRDSCR4_PLANE_X2           0x01000000
+#define FSL_SRDSRSTCTL_OFFS            0x20
+#define FSL_SRDSRSTCTL_RST             0x80000000
+#define FSL_SRDSRSTCTL_SATA_RESET      0xf
+
+void fsl_setup_serdes(u32 offset, char proto, char rfcks, char vdd)
+{
+       void *regs = (void *)CFG_IMMR + offset;
+       u32 tmp;
+
+       /* 1.0V corevdd */
+       if (vdd) {
+               /* DPPE/DPPA = 0 */
+               tmp = in_be32(regs + FSL_SRDSCR0_OFFS);
+               tmp &= ~FSL_SRDSCR0_DPP_1V2;
+               out_be32(regs + FSL_SRDSCR0_OFFS, tmp);
+
+               /* VDD = 0 */
+               tmp = in_be32(regs + FSL_SRDSCR2_OFFS);
+               tmp &= ~FSL_SRDSCR2_VDD_1V2;
+               out_be32(regs + FSL_SRDSCR2_OFFS, tmp);
+       }
+
+       /* protocol specific configuration */
+       switch (proto) {
+       case FSL_SERDES_PROTO_SATA:
+               /* Set and clear reset bits */
+               tmp = in_be32(regs + FSL_SRDSRSTCTL_OFFS);
+               tmp |= FSL_SRDSRSTCTL_SATA_RESET;
+               out_be32(regs + FSL_SRDSRSTCTL_OFFS, tmp);
+               udelay(1000);
+               tmp &= ~FSL_SRDSRSTCTL_SATA_RESET;
+               out_be32(regs + FSL_SRDSRSTCTL_OFFS, tmp);
+
+               /* Configure SRDSCR1 */
+               tmp = in_be32(regs + FSL_SRDSCR1_OFFS);
+               tmp &= ~FSL_SRDSCR1_PLLBW;
+               out_be32(regs + FSL_SRDSCR1_OFFS, tmp);
+
+               /* Configure SRDSCR2 */
+               tmp = in_be32(regs + FSL_SRDSCR2_OFFS);
+               tmp &= ~FSL_SRDSCR2_SEIC_MASK;
+               tmp |= FSL_SRDSCR2_SEIC_SATA;
+               out_be32(regs + FSL_SRDSCR2_OFFS, tmp);
+
+               /* Configure SRDSCR3 */
+               tmp = FSL_SRDSCR3_KFR_SATA | FSL_SRDSCR3_KPH_SATA |
+                       FSL_SRDSCR3_SDFM_SATA_PEX |
+                       FSL_SRDSCR3_SDTXL_SATA;
+               out_be32(regs + FSL_SRDSCR3_OFFS, tmp);
+
+               /* Configure SRDSCR4 */
+               tmp = rfcks | FSL_SRDSCR4_PROT_SATA;
+               out_be32(regs + FSL_SRDSCR4_OFFS, tmp);
+               break;
+       case FSL_SERDES_PROTO_PEX:
+       case FSL_SERDES_PROTO_PEX_X2:
+               /* Configure SRDSCR1 */
+               tmp = in_be32(regs + FSL_SRDSCR1_OFFS);
+               tmp |= FSL_SRDSCR1_PLLBW;
+               out_be32(regs + FSL_SRDSCR1_OFFS, tmp);
+
+               /* Configure SRDSCR2 */
+               tmp = in_be32(regs + FSL_SRDSCR2_OFFS);
+               tmp &= ~FSL_SRDSCR2_SEIC_MASK;
+               tmp |= FSL_SRDSCR2_SEIC_PEX;
+               out_be32(regs + FSL_SRDSCR2_OFFS, tmp);
+
+               /* Configure SRDSCR3 */
+               tmp = FSL_SRDSCR3_SDFM_SATA_PEX;
+               out_be32(regs + FSL_SRDSCR3_OFFS, tmp);
+
+               /* Configure SRDSCR4 */
+               tmp = rfcks | FSL_SRDSCR4_PROT_PEX;
+               if (proto == FSL_SERDES_PROTO_PEX_X2)
+                       tmp |= FSL_SRDSCR4_PLANE_X2;
+               out_be32(regs + FSL_SRDSCR4_OFFS, tmp);
+               break;
+       case FSL_SERDES_PROTO_SGMII:
+               /* Configure SRDSCR1 */
+               tmp = in_be32(regs + FSL_SRDSCR1_OFFS);
+               tmp &= ~FSL_SRDSCR1_PLLBW;
+               out_be32(regs + FSL_SRDSCR1_OFFS, tmp);
+
+               /* Configure SRDSCR2 */
+               tmp = in_be32(regs + FSL_SRDSCR2_OFFS);
+               tmp &= ~FSL_SRDSCR2_SEIC_MASK;
+               tmp |= FSL_SRDSCR2_SEIC_SGMII;
+               out_be32(regs + FSL_SRDSCR2_OFFS, tmp);
+
+               /* Configure SRDSCR3 */
+               out_be32(regs + FSL_SRDSCR3_OFFS, 0);
+
+               /* Configure SRDSCR4 */
+               tmp = rfcks | FSL_SRDSCR4_PROT_SGMII;
+               out_be32(regs + FSL_SRDSCR4_OFFS, tmp);
+               break;
+       default:
+               return;
+       }
+
+       /* Do a software reset */
+       tmp = in_be32(regs + FSL_SRDSRSTCTL_OFFS);
+       tmp |= FSL_SRDSRSTCTL_RST;
+       out_be32(regs + FSL_SRDSRSTCTL_OFFS, tmp);
+}
index 0acca47..70cd410 100644 (file)
 #include <asm/mmu.h>
 #include <spd_sdram.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 void board_add_ram_info(int use_default)
 {
        volatile immap_t *immap = (immap_t *) CFG_IMMR;
        volatile ddr83xx_t *ddr = &immap->ddr;
+       char buf[32];
 
        printf(" (DDR%d", ((ddr->sdram_cfg & SDRAM_CFG_SDRAM_TYPE_MASK)
                           >> SDRAM_CFG_SDRAM_TYPE_SHIFT) - 1);
@@ -48,9 +51,11 @@ void board_add_ram_info(int use_default)
                puts(", 64-bit");
 
        if (ddr->sdram_cfg & SDRAM_CFG_ECC_EN)
-               puts(", ECC on)");
+               puts(", ECC on");
        else
-               puts(", ECC off)");
+               puts(", ECC off");
+
+       printf(", %s MHz)", strmhz(buf, gd->mem_clk));
 
 #if defined(CFG_LB_SDRAM) && defined(CFG_LBC_SDRAM_SIZE)
        puts("\nSDRAM: ");
@@ -60,8 +65,6 @@ void board_add_ram_info(int use_default)
 
 #ifdef CONFIG_SPD_EEPROM
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRC)
 extern void dma_init(void);
 extern uint dma_check(void);
@@ -78,12 +81,12 @@ extern int dma_xfer(void *dest, uint count, void *src);
 int
 picos_to_clk(int picos)
 {
-       unsigned int ddr_bus_clk;
+       unsigned int mem_bus_clk;
        int clks;
 
-       ddr_bus_clk = gd->ddr_clk >> 1;
-       clks = picos / (1000000000 / (ddr_bus_clk / 1000));
-       if (picos % (1000000000 / (ddr_bus_clk / 1000)) != 0)
+       mem_bus_clk = gd->mem_clk >> 1;
+       clks = picos / (1000000000 / (mem_bus_clk / 1000));
+       if (picos % (1000000000 / (mem_bus_clk / 1000)) != 0)
                clks++;
 
        return clks;
@@ -313,7 +316,7 @@ long int spd_sdram()
 
        debug("DDR:Module maximum data rate is: %dMhz\n", max_data_rate);
 
-       ddrc_clk = gd->ddr_clk / 1000000;
+       ddrc_clk = gd->mem_clk / 1000000;
        effective_data_rate = 0;
 
        if (max_data_rate >= 390 && max_data_rate < 460) { /* it is DDR 400 */
@@ -598,7 +601,7 @@ long int spd_sdram()
        debug("DDR:timing_cfg_2=0x%08x\n", ddr->timing_cfg_2);
 
        /* Check DIMM data bus width */
-       if (spd.dataw_lsb == 0x20) {
+       if (spd.dataw_lsb < 64) {
                if (spd.mem_type == SPD_MEMTYPE_DDR)
                        burstlen = 0x03; /* 32 bit data bus, burst len is 8 */
                else
@@ -760,7 +763,7 @@ long int spd_sdram()
                sdram_cfg |= SDRAM_CFG_RD_EN;
 
        /* The DIMM is 32bit width */
-       if (spd.dataw_lsb == 0x20) {
+       if (spd.dataw_lsb < 64) {
                if (spd.mem_type == SPD_MEMTYPE_DDR)
                        sdram_cfg |= SDRAM_CFG_32_BE | SDRAM_CFG_8_BE;
                if (spd.mem_type == SPD_MEMTYPE_DDR2)
index f598699..16145dd 100644 (file)
@@ -122,9 +122,9 @@ int get_clocks(void)
        u32 enc_clk;
        u32 lbiu_clk;
        u32 lclk_clk;
-       u32 ddr_clk;
+       u32 mem_clk;
 #if defined(CONFIG_MPC8360)
-       u32 ddr_sec_clk;
+       u32 mem_sec_clk;
 #endif
 #if defined(CONFIG_MPC8360) || defined(CONFIG_MPC832X)
        u32 qepmf;
@@ -400,11 +400,11 @@ int get_clocks(void)
                return -12;
        }
 
-       ddr_clk = csb_clk *
+       mem_clk = csb_clk *
                  (1 + ((im->reset.rcwl & HRCWL_DDRCM) >> HRCWL_DDRCM_SHIFT));
        corepll = (im->reset.rcwl & HRCWL_COREPLL) >> HRCWL_COREPLL_SHIFT;
 #if defined(CONFIG_MPC8360)
-       ddr_sec_clk = csb_clk * (1 +
+       mem_sec_clk = csb_clk * (1 +
                       ((im->reset.rcwl & HRCWL_LBIUCM) >> HRCWL_LBIUCM_SHIFT));
 #endif
 
@@ -466,9 +466,9 @@ int get_clocks(void)
        gd->enc_clk = enc_clk;
        gd->lbiu_clk = lbiu_clk;
        gd->lclk_clk = lclk_clk;
-       gd->ddr_clk = ddr_clk;
+       gd->mem_clk = mem_clk;
 #if defined(CONFIG_MPC8360)
-       gd->ddr_sec_clk = ddr_sec_clk;
+       gd->mem_sec_clk = mem_sec_clk;
 #endif
 #if defined(CONFIG_MPC8360) || defined(CONFIG_MPC832X)
        gd->qe_clk = qe_clk;
@@ -508,9 +508,9 @@ int do_clocks (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 #endif
        printf("  Local Bus Controller:%4d MHz\n", gd->lbiu_clk / 1000000);
        printf("  Local Bus:           %4d MHz\n", gd->lclk_clk / 1000000);
-       printf("  DDR:                 %4d MHz\n", gd->ddr_clk / 1000000);
+       printf("  DDR:                 %4d MHz\n", gd->mem_clk / 1000000);
 #if defined(CONFIG_MPC8360)
-       printf("  DDR Secondary:       %4d MHz\n", gd->ddr_sec_clk / 1000000);
+       printf("  DDR Secondary:       %4d MHz\n", gd->mem_sec_clk / 1000000);
 #endif
        printf("  SEC:                 %4d MHz\n", gd->enc_clk / 1000000);
        printf("  I2C1:                %4d MHz\n", gd->i2c1_clk / 1000000);
index 2205dca..adbc585 100644 (file)
@@ -29,6 +29,9 @@ include $(TOPDIR)/config.mk
 LIB    = $(obj)lib$(CPU).a
 
 START  = start.o resetvec.o
+SOBJS-$(CONFIG_MP) += release.o
+SOBJS  = $(SOBJS-y)
+COBJS-$(CONFIG_MP) += mp.o
 COBJS-$(CONFIG_OF_LIBFDT) += fdt.o
 COBJS  = traps.o cpu.o cpu_init.o speed.o interrupts.o tlb.o \
          pci.o serial_scc.o commproc.o ether_fcc.o spd_sdram.o qe_io.o \
index ac8b018..74b210c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004,2007 Freescale Semiconductor, Inc.
+ * Copyright 2004,2007,2008 Freescale Semiconductor, Inc.
  * (C) Copyright 2002, 2003 Motorola Inc.
  * Xianghua Xiao (X.Xiao@motorola.com)
  *
 #include <command.h>
 #include <asm/cache.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
+struct cpu_type {
+       char name[15];
+       u32 soc_ver;
+};
+
+#define CPU_TYPE_ENTRY(x) {#x, SVR_##x}
+
+struct cpu_type cpu_type_list [] = {
+       CPU_TYPE_ENTRY(8533),
+       CPU_TYPE_ENTRY(8533_E),
+       CPU_TYPE_ENTRY(8540),
+       CPU_TYPE_ENTRY(8541),
+       CPU_TYPE_ENTRY(8541_E),
+       CPU_TYPE_ENTRY(8543),
+       CPU_TYPE_ENTRY(8543_E),
+       CPU_TYPE_ENTRY(8544),
+       CPU_TYPE_ENTRY(8544_E),
+       CPU_TYPE_ENTRY(8545),
+       CPU_TYPE_ENTRY(8545_E),
+       CPU_TYPE_ENTRY(8547_E),
+       CPU_TYPE_ENTRY(8548),
+       CPU_TYPE_ENTRY(8548_E),
+       CPU_TYPE_ENTRY(8555),
+       CPU_TYPE_ENTRY(8555_E),
+       CPU_TYPE_ENTRY(8560),
+       CPU_TYPE_ENTRY(8567),
+       CPU_TYPE_ENTRY(8567_E),
+       CPU_TYPE_ENTRY(8568),
+       CPU_TYPE_ENTRY(8568_E),
+       CPU_TYPE_ENTRY(8572),
+       CPU_TYPE_ENTRY(8572_E),
+};
+
 int checkcpu (void)
 {
        sys_info_t sysinfo;
@@ -39,47 +74,26 @@ int checkcpu (void)
        uint fam;
        uint ver;
        uint major, minor;
+       int i;
        u32 ddr_ratio;
        volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
 
        svr = get_svr();
-       ver = SVR_VER(svr);
+       ver = SVR_SOC_VER(svr);
        major = SVR_MAJ(svr);
        minor = SVR_MIN(svr);
 
        puts("CPU:   ");
-       switch (ver) {
-       case SVR_8540:
-               puts("8540");
-               break;
-       case SVR_8541:
-               puts("8541");
-               break;
-       case SVR_8555:
-               puts("8555");
-               break;
-       case SVR_8560:
-               puts("8560");
-               break;
-       case SVR_8548:
-               puts("8548");
-               break;
-       case SVR_8548_E:
-               puts("8548_E");
-               break;
-       case SVR_8544:
-               puts("8544");
-               break;
-       case SVR_8544_E:
-               puts("8544_E");
-               break;
-       case SVR_8568_E:
-               puts("8568_E");
-               break;
-       default:
+
+       for (i = 0; i < ARRAY_SIZE(cpu_type_list); i++)
+               if (cpu_type_list[i].soc_ver == ver) {
+                       puts(cpu_type_list[i].name);
+                       break;
+               }
+
+       if (i == ARRAY_SIZE(cpu_type_list))
                puts("Unknown");
-               break;
-       }
+
        printf(", Version: %d.%d, (0x%08x)\n", major, minor, svr);
 
        pvr = get_pvr();
@@ -102,19 +116,21 @@ int checkcpu (void)
        get_sys_info(&sysinfo);
 
        puts("Clock Configuration:\n");
-       printf("       CPU:%4lu MHz, ", sysinfo.freqProcessor / 1000000);
-       printf("CCB:%4lu MHz,\n", sysinfo.freqSystemBus / 1000000);
-
+       printf("       CPU:%4lu MHz, ", DIV_ROUND_UP(sysinfo.freqProcessor,1000000));
+       printf("CCB:%4lu MHz,\n", DIV_ROUND_UP(sysinfo.freqSystemBus,1000000));
        ddr_ratio = ((gur->porpllsr) & 0x00003e00) >> 9;
        switch (ddr_ratio) {
        case 0x0:
-               printf("       DDR:%4lu MHz, ", sysinfo.freqDDRBus / 2000000);
+               printf("       DDR:%4lu MHz (%lu MT/s data rate), ",
+               DIV_ROUND_UP(sysinfo.freqDDRBus,2000000), DIV_ROUND_UP(sysinfo.freqDDRBus,1000000));
                break;
        case 0x7:
-               printf("       DDR:%4lu MHz (Synchronous), ", sysinfo.freqDDRBus / 2000000);
+               printf("       DDR:%4lu MHz (%lu MT/s data rate) (Synchronous), ",
+               DIV_ROUND_UP(sysinfo.freqDDRBus, 2000000), DIV_ROUND_UP(sysinfo.freqDDRBus, 1000000));
                break;
        default:
-               printf("       DDR:%4lu MHz (Asynchronous), ", sysinfo.freqDDRBus / 2000000);
+               printf("       DDR:%4lu MHz (%lu MT/s data rate) (Asynchronous), ",
+               DIV_ROUND_UP(sysinfo.freqDDRBus, 2000000), DIV_ROUND_UP(sysinfo.freqDDRBus,1000000));
                break;
        }
 
@@ -137,15 +153,14 @@ int checkcpu (void)
                 clkdiv *= 2;
 #endif
                printf("LBC:%4lu MHz\n",
-                      sysinfo.freqSystemBus / 1000000 / clkdiv);
+                      DIV_ROUND_UP(sysinfo.freqSystemBus, 1000000) / clkdiv);
        } else {
                printf("LBC: unknown (lcrr: 0x%08x)\n", lcrr);
        }
 
-       if (ver == SVR_8560) {
-               printf("CPM:  %lu Mhz\n",
-                      sysinfo.freqSystemBus / 1000000);
-       }
+#ifdef CONFIG_CPM2
+       printf("CPM:  %lu Mhz\n", sysinfo.freqSystemBus / 1000000);
+#endif
 
        puts("L1:    D-cache 32 kB enabled\n       I-cache 32 kB enabled\n");
 
@@ -190,11 +205,7 @@ int do_reset (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
  */
 unsigned long get_tbclk (void)
 {
-
-       sys_info_t  sys_info;
-
-       get_sys_info(&sys_info);
-       return ((sys_info.freqSystemBus + 7L) / 8L);
+       return (gd->bus_clk + 4UL)/8UL;
 }
 
 
index c0ff1d5..e3240b5 100644 (file)
@@ -33,6 +33,7 @@
 #include <asm/io.h>
 #include <asm/mmu.h>
 #include <asm/fsl_law.h>
+#include "mp.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -127,12 +128,12 @@ void config_8560_ioports (volatile ccsr_cpm_t * cpm)
 /* We run cpu_init_early_f in AS = 1 */
 void cpu_init_early_f(void)
 {
-       set_tlb(0, CFG_CCSRBAR, CFG_CCSRBAR,
+       set_tlb(0, CFG_CCSRBAR, CFG_CCSRBAR_PHYS,
                MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
                1, 0, BOOKE_PAGESZ_4K, 0);
 
        /* set up CCSR if we want it moved */
-#if (CFG_CCSRBAR_DEFAULT != CFG_CCSRBAR)
+#if (CFG_CCSRBAR_DEFAULT != CFG_CCSRBAR_PHYS)
        {
                u32 temp;
 
@@ -141,7 +142,7 @@ void cpu_init_early_f(void)
                        1, 1, BOOKE_PAGESZ_4K, 0);
 
                temp = in_be32((volatile u32 *)CFG_CCSRBAR_DEFAULT);
-               out_be32((volatile u32 *)CFG_CCSRBAR_DEFAULT, CFG_CCSRBAR >> 12);
+               out_be32((volatile u32 *)CFG_CCSRBAR_DEFAULT, CFG_CCSRBAR_PHYS >> 12);
 
                temp = in_be32((volatile u32 *)CFG_CCSRBAR);
        }
@@ -271,7 +272,7 @@ int cpu_init_r(void)
        uint l2srbar;
 
        svr = get_svr();
-       ver = SVR_VER(svr);
+       ver = SVR_SOC_VER(svr);
 
        asm("msync;isync");
        cache_ctl = l2cache->l2ctl;
@@ -328,5 +329,8 @@ int cpu_init_r(void)
        qe_reset();
 #endif
 
+#if defined(CONFIG_MP)
+       setup_mp();
+#endif
        return 0;
 }
index a6b014c..bb87740 100644 (file)
 #include <fdt_support.h>
 
 extern void ft_qe_setup(void *blob);
+#ifdef CONFIG_MP
+#include "mp.h"
+DECLARE_GLOBAL_DATA_PTR;
+
+void ft_fixup_cpu(void *blob, u64 memory_limit)
+{
+       int off;
+       ulong spin_tbl_addr = get_spin_addr();
+       u32 bootpg, id = get_my_id();
+
+       /* if we have 4G or more of memory, put the boot page at 4Gb-4k */
+       if ((u64)gd->ram_size > 0xfffff000)
+               bootpg = 0xfffff000;
+       else
+               bootpg = gd->ram_size - 4096;
+
+       off = fdt_node_offset_by_prop_value(blob, -1, "device_type", "cpu", 4);
+       while (off != -FDT_ERR_NOTFOUND) {
+               u32 *reg = (u32 *)fdt_getprop(blob, off, "reg", 0);
+
+               if (reg) {
+                       if (*reg == id) {
+                               fdt_setprop_string(blob, off, "status", "okay");
+                       } else {
+                               u64 val = *reg * SIZE_BOOT_ENTRY + spin_tbl_addr;
+                               val = cpu_to_fdt32(val);
+                               fdt_setprop_string(blob, off, "status",
+                                                               "disabled");
+                               fdt_setprop_string(blob, off, "enable-method",
+                                                               "spin-table");
+                               fdt_setprop(blob, off, "cpu-release-addr",
+                                               &val, sizeof(val));
+                       }
+               } else {
+                       printf ("cpu NULL\n");
+               }
+               off = fdt_node_offset_by_prop_value(blob, off,
+                               "device_type", "cpu", 4);
+       }
+
+       /* Reserve the boot page so OSes dont use it */
+       if ((u64)bootpg < memory_limit) {
+               off = fdt_add_mem_rsv(blob, bootpg, (u64)4096);
+               if (off < 0)
+                       printf("%s: %s\n", __FUNCTION__, fdt_strerror(off));
+       }
+}
+#endif
 
 void ft_cpu_setup(void *blob, bd_t *bd)
 {
@@ -62,4 +110,8 @@ void ft_cpu_setup(void *blob, bd_t *bd)
 #endif
 
        fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
+
+#ifdef CONFIG_MP
+       ft_fixup_cpu(blob, (u64)bd->bi_memstart + (u64)bd->bi_memsize);
+#endif
 }
diff --git a/cpu/mpc85xx/mp.c b/cpu/mpc85xx/mp.c
new file mode 100644 (file)
index 0000000..e733f7b
--- /dev/null
@@ -0,0 +1,214 @@
+/*
+ * Copyright 2008 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
+ */
+
+#include <common.h>
+#include <asm/processor.h>
+#include <ioports.h>
+#include <lmb.h>
+#include <asm/io.h>
+#include "mp.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+u32 get_my_id()
+{
+       return mfspr(SPRN_PIR);
+}
+
+int cpu_reset(int nr)
+{
+       volatile ccsr_pic_t *pic = (void *)(CFG_MPC85xx_PIC_ADDR);
+       out_be32(&pic->pir, 1 << nr);
+       (void)in_be32(&pic->pir);
+       out_be32(&pic->pir, 0x0);
+
+       return 0;
+}
+
+int cpu_status(int nr)
+{
+       u32 *table, id = get_my_id();
+
+       if (nr == id) {
+               table = (u32 *)get_spin_addr();
+               printf("table base @ 0x%08x\n", table);
+       } else {
+               table = (u32 *)get_spin_addr() + nr * NUM_BOOT_ENTRY;
+               printf("Running on cpu %d\n", id);
+               printf("\n");
+               printf("table @ 0x%08x:\n", table);
+               printf("   addr - 0x%08x\n", table[BOOT_ENTRY_ADDR_LOWER]);
+               printf("   pir  - 0x%08x\n", table[BOOT_ENTRY_PIR]);
+               printf("   r3   - 0x%08x\n", table[BOOT_ENTRY_R3_LOWER]);
+               printf("   r6   - 0x%08x\n", table[BOOT_ENTRY_R6_LOWER]);
+       }
+
+       return 0;
+}
+
+static u8 boot_entry_map[4] = {
+       0,
+       BOOT_ENTRY_PIR,
+       BOOT_ENTRY_R3_LOWER,
+       BOOT_ENTRY_R6_LOWER,
+};
+
+int cpu_release(int nr, int argc, char *argv[])
+{
+       u32 i, val, *table = (u32 *)get_spin_addr() + nr * NUM_BOOT_ENTRY;
+       u64 boot_addr;
+
+       if (nr == get_my_id()) {
+               printf("Invalid to release the boot core.\n\n");
+               return 1;
+       }
+
+       if (argc != 4) {
+               printf("Invalid number of arguments to release.\n\n");
+               return 1;
+       }
+
+#ifdef CFG_64BIT_STRTOUL
+       boot_addr = simple_strtoull(argv[0], NULL, 16);
+#else
+       boot_addr = simple_strtoul(argv[0], NULL, 16);
+#endif
+
+       /* handle pir, r3, r6 */
+       for (i = 1; i < 4; i++) {
+               if (argv[i][0] != '-') {
+                       u8 entry = boot_entry_map[i];
+                       val = simple_strtoul(argv[i], NULL, 16);
+                       table[entry] = val;
+               }
+       }
+
+       table[BOOT_ENTRY_ADDR_UPPER] = (u32)(boot_addr >> 32);
+       table[BOOT_ENTRY_ADDR_LOWER] = (u32)(boot_addr & 0xffffffff);
+
+       return 0;
+}
+
+ulong get_spin_addr(void)
+{
+       extern ulong __secondary_start_page;
+       extern ulong __spin_table;
+
+       ulong addr =
+               (ulong)&__spin_table - (ulong)&__secondary_start_page;
+       addr += 0xfffff000;
+
+       return addr;
+}
+
+static void pq3_mp_up(unsigned long bootpg)
+{
+       u32 up, cpu_up_mask, whoami;
+       u32 *table = (u32 *)get_spin_addr();
+       volatile u32 bpcr;
+       volatile ccsr_local_ecm_t *ecm = (void *)(CFG_MPC85xx_ECM_ADDR);
+       volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
+       volatile ccsr_pic_t *pic = (void *)(CFG_MPC85xx_PIC_ADDR);
+       u32 devdisr;
+       int timeout = 10;
+
+       whoami = in_be32(&pic->whoami);
+       out_be32(&ecm->bptr, 0x80000000 | (bootpg >> 12));
+
+       /* disable time base at the platform */
+       devdisr = in_be32(&gur->devdisr);
+       if (whoami)
+               devdisr |= MPC85xx_DEVDISR_TB0;
+       else
+               devdisr |= MPC85xx_DEVDISR_TB1;
+       out_be32(&gur->devdisr, devdisr);
+
+       /* release the hounds */
+       up = ((1 << CONFIG_NR_CPUS) - 1);
+       bpcr = in_be32(&ecm->eebpcr);
+       bpcr |= (up << 24);
+       out_be32(&ecm->eebpcr, bpcr);
+       asm("sync; isync; msync");
+
+       cpu_up_mask = 1 << whoami;
+       /* wait for everyone */
+       while (timeout) {
+               int i;
+               for (i = 1; i < CONFIG_NR_CPUS; i++) {
+                       if (table[i * NUM_BOOT_ENTRY + BOOT_ENTRY_ADDR_LOWER])
+                               cpu_up_mask |= (1 << i);
+               };
+
+               if ((cpu_up_mask & up) == up)
+                       break;
+
+               udelay(100);
+               timeout--;
+       }
+
+       if (timeout == 0)
+               printf("CPU up timeout. CPU up mask is %x should be %x\n",
+                       cpu_up_mask, up);
+
+       /* enable time base at the platform */
+       if (whoami)
+               devdisr |= MPC85xx_DEVDISR_TB1;
+       else
+               devdisr |= MPC85xx_DEVDISR_TB0;
+       out_be32(&gur->devdisr, devdisr);
+       mtspr(SPRN_TBWU, 0);
+       mtspr(SPRN_TBWL, 0);
+
+       devdisr &= ~(MPC85xx_DEVDISR_TB0 | MPC85xx_DEVDISR_TB1);
+       out_be32(&gur->devdisr, devdisr);
+}
+
+void cpu_mp_lmb_reserve(struct lmb *lmb)
+{
+       u32 bootpg;
+
+       /* if we have 4G or more of memory, put the boot page at 4Gb-4k */
+       if ((u64)gd->ram_size > 0xfffff000)
+               bootpg = 0xfffff000;
+       else
+               bootpg = gd->ram_size - 4096;
+
+       lmb_reserve(lmb, bootpg, 4096);
+}
+
+void setup_mp(void)
+{
+       extern ulong __secondary_start_page;
+       ulong fixup = (ulong)&__secondary_start_page;
+       u32 bootpg;
+
+       /* if we have 4G or more of memory, put the boot page at 4Gb-4k */
+       if ((u64)gd->ram_size > 0xfffff000)
+               bootpg = 0xfffff000;
+       else
+               bootpg = gd->ram_size - 4096;
+
+       memcpy((void *)bootpg, (void *)fixup, 4096);
+       flush_cache(bootpg, 4096);
+
+       pq3_mp_up(bootpg);
+}
diff --git a/cpu/mpc85xx/mp.h b/cpu/mpc85xx/mp.h
new file mode 100644 (file)
index 0000000..4329286
--- /dev/null
@@ -0,0 +1,20 @@
+#ifndef __MPC85XX_MP_H_
+#define __MPC85XX_MP_H_
+
+ulong get_spin_addr(void);
+void setup_mp(void);
+u32 get_my_id(void);
+void cpu_mp_lmb_reserve(struct lmb *lmb);
+
+#define BOOT_ENTRY_ADDR_UPPER  0
+#define BOOT_ENTRY_ADDR_LOWER  1
+#define BOOT_ENTRY_R3_UPPER    2
+#define BOOT_ENTRY_R3_LOWER    3
+#define BOOT_ENTRY_RESV                4
+#define BOOT_ENTRY_PIR         5
+#define BOOT_ENTRY_R6_UPPER    6
+#define BOOT_ENTRY_R6_LOWER    7
+#define NUM_BOOT_ENTRY         8
+#define SIZE_BOOT_ENTRY                (NUM_BOOT_ENTRY * sizeof(u32))
+
+#endif
diff --git a/cpu/mpc85xx/release.S b/cpu/mpc85xx/release.S
new file mode 100644 (file)
index 0000000..3b7366f
--- /dev/null
@@ -0,0 +1,182 @@
+#include <config.h>
+#include <mpc85xx.h>
+#include <version.h>
+
+#define _LINUX_CONFIG_H 1      /* avoid reading Linux autoconf.h file  */
+
+#include <ppc_asm.tmpl>
+#include <ppc_defs.h>
+
+#include <asm/cache.h>
+#include <asm/mmu.h>
+
+/* To boot secondary cpus, we need a place for them to start up.
+ * Normally, they start at 0xfffffffc, but that's usually the
+ * firmware, and we don't want to have to run the firmware again.
+ * Instead, the primary cpu will set the BPTR to point here to
+ * this page.  We then set up the core, and head to
+ * start_secondary.  Note that this means that the code below
+ * must never exceed 1023 instructions (the branch at the end
+ * would then be the 1024th).
+ */
+       .globl  __secondary_start_page
+       .align  12
+__secondary_start_page:
+/* First do some preliminary setup */
+       lis     r3, HID0_EMCP@h         /* enable machine check */
+       ori     r3,r3,HID0_TBEN@l       /* enable Timebase */
+#ifdef CONFIG_PHYS_64BIT
+       ori     r3,r3,HID0_ENMAS7@l     /* enable MAS7 updates */
+#endif
+       mtspr   SPRN_HID0,r3
+
+       li      r3,(HID1_ASTME|HID1_ABE)@l      /* Addr streaming & broadcast */
+       mtspr   SPRN_HID1,r3
+
+       /* Enable branch prediction */
+       li      r3,0x201
+       mtspr   SPRN_BUCSR,r3
+
+       /* Enable/invalidate the I-Cache */
+       mfspr   r0,SPRN_L1CSR1
+       ori     r0,r0,(L1CSR1_ICFI|L1CSR1_ICE)
+       mtspr   SPRN_L1CSR1,r0
+       isync
+
+       /* Enable/invalidate the D-Cache */
+       mfspr   r0,SPRN_L1CSR0
+       ori     r0,r0,(L1CSR0_DCFI|L1CSR0_DCE)
+       msync
+       isync
+       mtspr   SPRN_L1CSR0,r0
+       isync
+
+#define toreset(x) (x - __secondary_start_page + 0xfffff000)
+
+       /* get our PIR to figure out our table entry */
+       lis     r3,toreset(__spin_table)@h
+       ori     r3,r3,toreset(__spin_table)@l
+
+       /* r10 has the base address for the entry */
+       mfspr   r0,SPRN_PIR
+       mr      r4,r0
+       slwi    r8,r4,5
+       add     r10,r3,r8
+
+#define EPAPR_MAGIC            (0x45504150)
+#define ENTRY_ADDR_UPPER       0
+#define ENTRY_ADDR_LOWER       4
+#define ENTRY_R3_UPPER         8
+#define ENTRY_R3_LOWER         12
+#define ENTRY_RESV             16
+#define ENTRY_PIR              20
+#define ENTRY_R6_UPPER         24
+#define ENTRY_R6_LOWER         28
+#define ENTRY_SIZE             32
+
+       /* setup the entry */
+       li      r3,0
+       li      r8,1
+       stw     r0,ENTRY_PIR(r10)
+       stw     r3,ENTRY_ADDR_UPPER(r10)
+       stw     r8,ENTRY_ADDR_LOWER(r10)
+       stw     r3,ENTRY_R3_UPPER(r10)
+       stw     r4,ENTRY_R3_LOWER(r10)
+       stw     r3,ENTRY_R6_UPPER(r10)
+       stw     r3,ENTRY_R6_LOWER(r10)
+
+       /* setup mapping for AS = 1, and jump there */
+       lis     r11,(MAS0_TLBSEL(1)|MAS0_ESEL(1))@h
+       mtspr   SPRN_MAS0,r11
+       lis     r11,(MAS1_VALID|MAS1_IPROT)@h
+       ori     r11,r11,(MAS1_TS|MAS1_TSIZE(BOOKE_PAGESZ_4K))@l
+       mtspr   SPRN_MAS1,r11
+       lis     r11,(0xfffff000|MAS2_I)@h
+       ori     r11,r11,(0xfffff000|MAS2_I)@l
+       mtspr   SPRN_MAS2,r11
+       lis     r11,(0xfffff000|MAS3_SX|MAS3_SW|MAS3_SR)@h
+       ori     r11,r11,(0xfffff000|MAS3_SX|MAS3_SW|MAS3_SR)@l
+       mtspr   SPRN_MAS3,r11
+       tlbwe
+
+       bl      1f
+1:     mflr    r11
+       addi    r11,r11,28
+       mfmsr   r13
+       ori     r12,r13,MSR_IS|MSR_DS@l
+
+       mtspr   SPRN_SRR0,r11
+       mtspr   SPRN_SRR1,r12
+       rfi
+
+       /* spin waiting for addr */
+2:
+       lwz     r4,ENTRY_ADDR_LOWER(r10)
+       andi.   r11,r4,1
+       bne     2b
+
+       /* get the upper bits of the addr */
+       lwz     r11,ENTRY_ADDR_UPPER(r10)
+
+       /* setup branch addr */
+       mtspr   SPRN_SRR0,r4
+
+       /* mark the entry as released */
+       li      r8,3
+       stw     r8,ENTRY_ADDR_LOWER(r10)
+
+       /* mask by ~64M to setup our tlb we will jump to */
+       rlwinm  r12,r4,0,0,5
+
+       /* setup r3, r4, r5, r6, r7, r8, r9 */
+       lwz     r3,ENTRY_R3_LOWER(r10)
+       li      r4,0
+       li      r5,0
+       lwz     r6,ENTRY_R6_LOWER(r10)
+       lis     r7,(64*1024*1024)@h
+       li      r8,0
+       li      r9,0
+
+       /* load up the pir */
+       lwz     r0,ENTRY_PIR(r10)
+       mtspr   SPRN_PIR,r0
+       mfspr   r0,SPRN_PIR
+       stw     r0,ENTRY_PIR(r10)
+
+/*
+ * Coming here, we know the cpu has one TLB mapping in TLB1[0]
+ * which maps 0xfffff000-0xffffffff one-to-one.  We set up a
+ * second mapping that maps addr 1:1 for 64M, and then we jump to
+ * addr
+ */
+       lis     r10,(MAS0_TLBSEL(1)|MAS0_ESEL(0))@h
+       mtspr   SPRN_MAS0,r10
+       lis     r10,(MAS1_VALID|MAS1_IPROT)@h
+       ori     r10,r10,(MAS1_TSIZE(BOOKE_PAGESZ_64M))@l
+       mtspr   SPRN_MAS1,r10
+       /* WIMGE = 0b00000 for now */
+       mtspr   SPRN_MAS2,r12
+       ori     r12,r12,(MAS3_SX|MAS3_SW|MAS3_SR)
+       mtspr   SPRN_MAS3,r12
+#ifdef CONFIG_ENABLE_36BIT_PHYS
+       mtspr   SPRN_MAS7,r11
+#endif
+       tlbwe
+
+/* Now we have another mapping for this page, so we jump to that
+ * mapping
+ */
+       mtspr   SPRN_SRR1,r13
+       rfi
+
+       .align 3
+       .globl __spin_table
+__spin_table:
+       .space CONFIG_NR_CPUS*ENTRY_SIZE
+
+       /* Fill in the empty space.  The actual reset vector is
+        * the last word of the page */
+__secondary_start_code_end:
+       .space 4092 - (__secondary_start_code_end - __secondary_start_page)
+__secondary_reset_vector:
+       b       __secondary_start_page
index abc63c4..435458a 100644 (file)
@@ -306,7 +306,7 @@ spd_sdram(void)
         * Adjust DDR II IO voltage biasing.
         * Only 8548 rev 1 needs the fix
         */
-       if ((SVR_VER(get_svr()) == SVR_8548_E) &&
+       if ((SVR_SOC_VER(get_svr()) == SVR_8548_E) &&
                        (SVR_MJREV(get_svr()) == 1) &&
                        (spd.mem_type == SPD_MEMTYPE_DDR2)) {
                volatile ccsr_gur_t *gur = (void *)(CFG_MPC85xx_GUTS_ADDR);
index 952f30c..699441b 100644 (file)
@@ -48,6 +48,8 @@ void get_sys_info (sys_info_t * sysInfo)
         * overflow for processor speeds above 2GHz */
        half_freqSystemBus = sysInfo->freqSystemBus/2;
        sysInfo->freqProcessor = e500_ratio*half_freqSystemBus;
+
+       /* Note: freqDDRBus is the MCLK frequency, not the data rate. */
        sysInfo->freqDDRBus = sysInfo->freqSystemBus;
 
 #ifdef CONFIG_DDR_CLK_FREQ
@@ -63,6 +65,9 @@ void get_sys_info (sys_info_t * sysInfo)
 int get_clocks (void)
 {
        sys_info_t sys_info;
+#ifdef CONFIG_MPC8544
+       volatile ccsr_gur_t *gur = (void *) CFG_MPC85xx_GUTS_ADDR;
+#endif
 #if defined(CONFIG_CPM2)
        volatile ccsr_cpm_t *cpm = (ccsr_cpm_t *)CFG_MPC85xx_CPM_ADDR;
        uint sccr, dfbrg;
@@ -75,8 +80,35 @@ int get_clocks (void)
        get_sys_info (&sys_info);
        gd->cpu_clk = sys_info.freqProcessor;
        gd->bus_clk = sys_info.freqSystemBus;
+       gd->mem_clk = sys_info.freqDDRBus;
+
+       /*
+        * The base clock for I2C depends on the actual SOC.  Unfortunately,
+        * there is no pattern that can be used to determine the frequency, so
+        * the only choice is to look up the actual SOC number and use the value
+        * for that SOC. This information is taken from application note
+        * AN2919.
+        */
+#if defined(CONFIG_MPC8540) || defined(CONFIG_MPC8541) || \
+       defined(CONFIG_MPC8560) || defined(CONFIG_MPC8555)
        gd->i2c1_clk = sys_info.freqSystemBus;
-       gd->i2c2_clk = sys_info.freqSystemBus;
+#elif defined(CONFIG_MPC8544)
+       /*
+        * On the 8544, the I2C clock is the same as the SEC clock.  This can be
+        * either CCB/2 or CCB/3, depending on the value of cfg_sec_freq. See
+        * 4.4.3.3 of the 8544 RM.  Note that this might actually work for all
+        * 85xx, but only the 8544 has cfg_sec_freq, so it's unknown if the
+        * PORDEVSR2_SEC_CFG bit is 0 on all 85xx boards that are not an 8544.
+        */
+       if (gur->pordevsr2 & MPC85xx_PORDEVSR2_SEC_CFG)
+               gd->i2c1_clk = sys_info.freqSystemBus / 3;
+       else
+               gd->i2c1_clk = sys_info.freqSystemBus / 2;
+#else
+       /* Most 85xx SOCs use CCB/2, so this is the default behavior. */
+       gd->i2c1_clk = sys_info.freqSystemBus / 2;
+#endif
+       gd->i2c2_clk = gd->i2c1_clk;
 
 #if defined(CONFIG_CPM2)
        gd->vco_out = 2*sys_info.freqSystemBus;
@@ -96,14 +128,7 @@ int get_clocks (void)
  *********************************************/
 ulong get_bus_freq (ulong dummy)
 {
-       ulong val;
-
-       sys_info_t sys_info;
-
-       get_sys_info (&sys_info);
-       val = sys_info.freqSystemBus;
-
-       return val;
+       return gd->bus_clk;
 }
 
 /********************************************
@@ -112,12 +137,5 @@ ulong get_bus_freq (ulong dummy)
  *********************************************/
 ulong get_ddr_freq (ulong dummy)
 {
-       ulong val;
-
-       sys_info_t sys_info;
-
-       get_sys_info (&sys_info);
-       val = sys_info.freqDDRBus;
-
-       return val;
+       return gd->mem_clk;
 }
index bf4e651..3c74764 100644 (file)
@@ -69,7 +69,7 @@ checkcpu(void)
        printf(", Version: %d.%d, (0x%08x)\n", major, minor, pvr);
 
        svr = get_svr();
-       ver = SVR_VER(svr);
+       ver = SVR_SOC_VER(svr);
        major = SVR_MAJ(svr);
        minor = SVR_MIN(svr);
 
index 223b30c..5f70459 100644 (file)
@@ -27,16 +27,29 @@ include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(CPU).a
 
-START  = start.o kgdb.o
-COBJS  = bedbug_860.o commproc.o cpu.o cpu_init.o      \
-         fec.o i2c.o interrupts.o lcd.o scc.o          \
-         serial.o speed.o spi.o \
-         traps.o upatch.o video.o
-SOBJS  = plprcr_write.o
-
-SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
-START  := $(addprefix $(obj),$(START))
+START-y        += start.o
+START-y        += kgdb.o
+COBJS-y        += bedbug_860.o
+COBJS-y        += commproc.o
+COBJS-y        += cpu.o
+COBJS-y        += cpu_init.o
+COBJS-y        += fec.o
+COBJS-$(CONFIG_OF_LIBFDT) += fdt.o
+COBJS-y        += i2c.o
+COBJS-y        += interrupts.o
+COBJS-y        += lcd.o
+COBJS-y        += scc.o
+COBJS-y        += serial.o
+COBJS-y        += speed.o
+COBJS-y        += spi.o
+COBJS-y        += traps.o
+COBJS-y        += upatch.o
+COBJS-y        += video.o
+SOBJS-y        += plprcr_write.o
+
+SRCS   := $(START-y:.o=.S) $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
+START  := $(addprefix $(obj),$(START-y))
 
 all:   $(obj).depend $(START) $(LIB)
 
index c878352..ec6a3fd 100644 (file)
@@ -634,17 +634,4 @@ void reset_8xx_watchdog (volatile immap_t * immr)
        immr->im_siu_conf.sc_swsr = 0xaa39;     /* write magic2 */
 # endif /* CONFIG_LWMON */
 }
-
 #endif /* CONFIG_WATCHDOG */
-
-/* ------------------------------------------------------------------------- */
-#if defined(CONFIG_OF_LIBFDT)
-void ft_cpu_setup (void *blob, bd_t *bd)
-{
-       char * cpu_path = "/cpus/" OF_CPU;
-
-       do_fixup_by_path_u32(blob, cpu_path, "bus-frequency", bd->bi_busfreq, 1);
-       do_fixup_by_path_u32(blob, cpu_path, "timebase-frequency", OF_TBCLK, 1);
-       do_fixup_by_path_u32(blob, cpu_path, "clock-frequency", bd->bi_intfreq, 1);
-}
-#endif /* CONFIG_OF_LIBFDT */
diff --git a/cpu/mpc8xx/fdt.c b/cpu/mpc8xx/fdt.c
new file mode 100644 (file)
index 0000000..567094a
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2008 (C) Bryan O'Donoghue
+ *
+ * Code copied & edited from Freescale mpc85xx stuff.
+ *
+ * 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 <libfdt.h>
+#include <fdt_support.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+void ft_cpu_setup(void *blob, bd_t *bd)
+{
+       do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
+               "timebase-frequency", get_tbclk(), 1);
+       do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
+               "bus-frequency", bd->bi_busfreq, 1);
+       do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
+               "clock-frequency", bd->bi_intfreq, 1);
+       do_fixup_by_compat_u32(blob, "fsl,cpm-brg", "clock-frequency",
+               gd->brg_clk, 1);
+
+       /* Fixup ethernet MAC addresses */
+       fdt_fixup_ethernet(blob, bd);
+
+       fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
+}
index 11b0893..070babc 100644 (file)
@@ -174,6 +174,27 @@ unsigned long measure_gclk(void)
 
 #endif
 
+void get_brgclk(uint sccr)
+{
+       uint divider = 0;
+
+       switch((sccr&SCCR_DFBRG11)>>11){
+               case 0:
+                       divider = 1;
+                       break;
+               case 1:
+                       divider = 4;
+                       break;
+               case 2:
+                       divider = 16;
+                       break;
+               case 3:
+                       divider = 64;
+                       break;
+       }
+       gd->brg_clk = gd->cpu_clk/divider;
+}
+
 #if !defined(CONFIG_8xx_CPUCLK_DEFAULT)
 
 /*
@@ -223,6 +244,8 @@ int get_clocks (void)
                gd->bus_clk = gd->cpu_clk / 2;
        }
 
+       get_brgclk(sccr);
+
        return (0);
 }
 
@@ -254,6 +277,8 @@ int get_clocks_866 (void)
        gd->cpu_clk = measure_gclk ();
 #endif
 
+       get_brgclk(immr->im_clkrst.car_sccr);
+
        /* if cpu clock <= 66 MHz then set bus division factor to 1,
         * otherwise set it to 2
         */
index d990250..c40e0ca 100644 (file)
@@ -274,7 +274,7 @@ static void emac_loopback_disable(EMAC_4XX_HW_PST hw_p)
 static void ppc_4xx_eth_halt (struct eth_device *dev)
 {
        EMAC_4XX_HW_PST hw_p = dev->priv;
-       uint32_t failsafe = 10000;
+       u32 val = 10000;
 
        out_be32((void *)EMAC_IER + hw_p->hw_addr, 0x00000000); /* disable emac interrupts */
 
@@ -290,8 +290,8 @@ static void ppc_4xx_eth_halt (struct eth_device *dev)
        /* wait for reset */
        while (mfdcr (malrxcasr) & (MAL_CR_MMSR >> hw_p->devnum)) {
                udelay (1000);  /* Delay 1 MS so as not to hammer the register */
-               failsafe--;
-               if (failsafe == 0)
+               val--;
+               if (val == 0)
                        break;
        }
 
@@ -308,6 +308,13 @@ static void ppc_4xx_eth_halt (struct eth_device *dev)
        hw_p->print_speed = 1;  /* print speed message again next time */
 #endif
 
+#if defined(CONFIG_460EX) || defined(CONFIG_460GT)
+       /* don't bypass the TAHOE0/TAHOE1 cores for Linux */
+       mfsdr(SDR0_ETH_CFG, val);
+       val &= ~(SDR0_ETH_CFG_TAHOE0_BYPASS | SDR0_ETH_CFG_TAHOE1_BYPASS);
+       mtsdr(SDR0_ETH_CFG, val);
+#endif
+
        return;
 }
 
@@ -494,11 +501,18 @@ int ppc_4xx_eth_setup_bridge(int devnum, bd_t * bis)
        u32 zmiifer;            /* ZMII0_FER reg. */
        u32 rmiifer;            /* RGMII0_FER reg. Bridge 0 */
        u32 rmiifer1;           /* RGMII0_FER reg. Bridge 1 */
+       int mode;
 
        zmiifer  = 0;
        rmiifer  = 0;
        rmiifer1 = 0;
 
+#if defined(CONFIG_460EX)
+       mode = 9;
+#else
+       mode = 10;
+#endif
+
        /* TODO:
         * NOTE: 460GT has 2 RGMII bridge cores:
         *              emac0 ------ RGMII0_BASE
@@ -520,7 +534,7 @@ int ppc_4xx_eth_setup_bridge(int devnum, bd_t * bis)
         * Right now only 2*RGMII is supported. Please extend when needed.
         * sr - 2008-02-19
         */
-       switch (9) {
+       switch (mode) {
        case 1:
                /* 1 MII - 460EX */
                /* GMC0 EMAC4_0, ZMII Bridge */
@@ -703,6 +717,11 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis)
 #ifdef CONFIG_4xx_DCACHE
        static u32 last_used_ea = 0;
 #endif
+#if defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
+    defined(CONFIG_460EX) || defined(CONFIG_460GT) || \
+    defined(CONFIG_405EX)
+       int rgmii_channel;
+#endif
 
        EMAC_4XX_HW_PST hw_p = dev->priv;
 
@@ -836,10 +855,12 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis)
                reg = CONFIG_PHY1_ADDR;
                break;
 #endif
-#if defined (CONFIG_440GX)
+#if defined (CONFIG_PHY2_ADDR)
        case 2:
                reg = CONFIG_PHY2_ADDR;
                break;
+#endif
+#if defined (CONFIG_PHY3_ADDR)
        case 3:
                reg = CONFIG_PHY3_ADDR;
                break;
@@ -1006,12 +1027,17 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis)
 #if defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
     defined(CONFIG_460EX) || defined(CONFIG_460GT) || \
     defined(CONFIG_405EX)
+       if (devnum >= 2)
+               rgmii_channel = devnum - 2;
+       else
+               rgmii_channel = devnum;
+
        if (speed == 1000)
-               reg = (RGMII_SSR_SP_1000MBPS << RGMII_SSR_V (devnum));
+               reg = (RGMII_SSR_SP_1000MBPS << RGMII_SSR_V(rgmii_channel));
        else if (speed == 100)
-               reg = (RGMII_SSR_SP_100MBPS << RGMII_SSR_V (devnum));
+               reg = (RGMII_SSR_SP_100MBPS << RGMII_SSR_V(rgmii_channel));
        else if (speed == 10)
-               reg = (RGMII_SSR_SP_10MBPS << RGMII_SSR_V (devnum));
+               reg = (RGMII_SSR_SP_10MBPS << RGMII_SSR_V(rgmii_channel));
        else {
                printf("Error in RGMII Speed\n");
                return -1;
@@ -1057,7 +1083,11 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis)
 #ifdef CONFIG_4xx_DCACHE
                flush_dcache_range(bd_cached, bd_cached + MAL_ALLOC_SIZE);
                if (!last_used_ea)
+#if defined(CFG_MEM_TOP_HIDE)
+                       bd_uncached = bis->bi_memsize + CFG_MEM_TOP_HIDE;
+#else
                        bd_uncached = bis->bi_memsize;
+#endif
                else
                        bd_uncached = last_used_ea + MAL_ALLOC_SIZE;
 
@@ -1131,7 +1161,7 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis)
 #endif
 
 #if defined(CONFIG_460EX) || defined(CONFIG_460GT)
-               mtdcr (malrxctp8r, hw_p->rx);
+               mtdcr (malrxctp8r, hw_p->rx_phys);
                /* set RX buffer size */
                mtdcr (malrcbs8, ENET_MAX_MTU_ALIGNED / 16);
 #else
@@ -1160,6 +1190,26 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis)
                mtdcr (malrcbs3, ENET_MAX_MTU_ALIGNED / 16);
                break;
 #endif /* CONFIG_440GX */
+#if defined (CONFIG_460GT)
+       case 2:
+               /* setup MAL tx & rx channel pointers */
+               mtdcr (maltxbattr, 0x0);
+               mtdcr (malrxbattr, 0x0);
+               mtdcr (maltxctp2r, hw_p->tx_phys);
+               mtdcr (malrxctp16r, hw_p->rx_phys);
+               /* set RX buffer size */
+               mtdcr (malrcbs16, ENET_MAX_MTU_ALIGNED / 16);
+               break;
+       case 3:
+               /* setup MAL tx & rx channel pointers */
+               mtdcr (maltxbattr, 0x0);
+               mtdcr (malrxbattr, 0x0);
+               mtdcr (maltxctp3r, hw_p->tx_phys);
+               mtdcr (malrxctp24r, hw_p->rx_phys);
+               /* set RX buffer size */
+               mtdcr (malrcbs24, ENET_MAX_MTU_ALIGNED / 16);
+               break;
+#endif /* CONFIG_460GT */
        case 0:
        default:
                /* setup MAL tx & rx channel pointers */
@@ -1866,14 +1916,22 @@ int ppc_4xx_eth_initialize (bd_t * bis)
                case 2:
                        memcpy(ethaddr[eth_num + CONFIG_EMAC_NR_START],
                               bis->bi_enet2addr, 6);
+#if defined(CONFIG_460GT)
+                       hw_addr[eth_num] = 0x300;
+#else
                        hw_addr[eth_num] = 0x400;
+#endif
                        break;
 #endif
 #ifdef CONFIG_HAS_ETH3
                case 3:
                        memcpy(ethaddr[eth_num + CONFIG_EMAC_NR_START],
                               bis->bi_enet3addr, 6);
+#if defined(CONFIG_460GT)
+                       hw_addr[eth_num] = 0x400;
+#else
                        hw_addr[eth_num] = 0x600;
+#endif
                        break;
 #endif
                }
index 5124dec..ceb3ec0 100644 (file)
@@ -166,9 +166,11 @@ _GLOBAL(invalidate_dcache)
 #ifdef CONFIG_440
 
        .globl  dcache_disable
+       .globl  dcache_enable
        .globl  icache_disable
        .globl  icache_enable
 dcache_disable:
+dcache_enable:
 icache_disable:
 icache_enable:
        blr
index 5d15e2f..42eabfe 100644 (file)
@@ -99,10 +99,107 @@ DECLARE_GLOBAL_DATA_PTR;
 # endif
 #endif /* CFG_INIT_DCACHE_CS */
 
+#ifndef CFG_PLL_RECONFIG
+#define CFG_PLL_RECONFIG       0
+#endif
+
+void reconfigure_pll(u32 new_cpu_freq)
+{
+#if defined(CONFIG_440EPX)
+       int     reset_needed = 0;
+       u32     reg, temp;
+       u32     prbdv0, target_prbdv0,                          /* CLK_PRIMBD */
+               fwdva, target_fwdva, fwdvb, target_fwdvb,       /* CLK_PLLD */
+               fbdv, target_fbdv, lfbdv, target_lfbdv,
+               perdv0, target_perdv0,                          /* CLK_PERD */
+               spcid0, target_spcid0;                          /* CLK_SPCID */
+
+       /* Reconfigure clocks if necessary.
+        * See PPC440EPx User's Manual, sections 8.2 and 14 */
+       if (new_cpu_freq == 667) {
+               target_prbdv0 = 2;
+               target_fwdva = 2;
+               target_fwdvb = 4;
+               target_fbdv = 20;
+               target_lfbdv = 1;
+               target_perdv0 = 4;
+               target_spcid0 = 4;
+
+               mfcpr(clk_primbd, reg);
+               temp = (reg & PRBDV_MASK) >> 24;
+               prbdv0 = temp ? temp : 8;
+               if (prbdv0 != target_prbdv0) {
+                       reg &= ~PRBDV_MASK;
+                       reg |= ((target_prbdv0 == 8 ? 0 : target_prbdv0) << 24);
+                       mtcpr(clk_primbd, reg);
+                       reset_needed = 1;
+               }
+
+               mfcpr(clk_plld, reg);
+
+               temp = (reg & PLLD_FWDVA_MASK) >> 16;
+               fwdva = temp ? temp : 16;
+
+               temp = (reg & PLLD_FWDVB_MASK) >> 8;
+               fwdvb = temp ? temp : 8;
+
+               temp = (reg & PLLD_FBDV_MASK) >> 24;
+               fbdv = temp ? temp : 32;
+
+               temp = (reg & PLLD_LFBDV_MASK);
+               lfbdv = temp ? temp : 64;
+
+               if (fwdva != target_fwdva || fbdv != target_fbdv || lfbdv != target_lfbdv) {
+                       reg &= ~(PLLD_FWDVA_MASK | PLLD_FWDVB_MASK |
+                                PLLD_FBDV_MASK | PLLD_LFBDV_MASK);
+                       reg |= ((target_fwdva == 16 ? 0 : target_fwdva) << 16) |
+                               ((target_fwdvb == 8 ? 0 : target_fwdvb) << 8) |
+                               ((target_fbdv == 32 ? 0 : target_fbdv) << 24) |
+                               (target_lfbdv == 64 ? 0 : target_lfbdv);
+                       mtcpr(clk_plld, reg);
+                       reset_needed = 1;
+               }
+
+               mfcpr(clk_perd, reg);
+               perdv0 = (reg & CPR0_PERD_PERDV0_MASK) >> 24;
+               if (perdv0 != target_perdv0) {
+                       reg &= ~CPR0_PERD_PERDV0_MASK;
+                       reg |= (target_perdv0 << 24);
+                       mtcpr(clk_perd, reg);
+                       reset_needed = 1;
+               }
+
+               mfcpr(clk_spcid, reg);
+               temp = (reg & CPR0_SPCID_SPCIDV0_MASK) >> 24;
+               spcid0 = temp ? temp : 4;
+               if (spcid0 != target_spcid0) {
+                       reg &= ~CPR0_SPCID_SPCIDV0_MASK;
+                       reg |= ((target_spcid0 == 4 ? 0 : target_spcid0) << 24);
+                       mtcpr(clk_spcid, reg);
+                       reset_needed = 1;
+               }
+
+               /* Set reload inhibit so configuration will persist across
+                * processor resets */
+               mfcpr(clk_icfg, reg);
+               reg &= ~CPR0_ICFG_RLI_MASK;
+               reg |= 1 << 31;
+               mtcpr(clk_icfg, reg);
+       }
+
+       /* Reset processor if configuration changed */
+       if (reset_needed) {
+               __asm__ __volatile__ ("sync; isync");
+               mtspr(dbcr0, 0x20000000);
+       }
+#endif
+}
+
 /*
  * Breath some life into the CPU...
  *
- * Set up the memory map,
+ * Reconfigure PLL if necessary,
+ * set up the memory map,
  * initialize a bunch of registers
  */
 void
@@ -111,6 +208,7 @@ cpu_init_f (void)
 #if defined(CONFIG_WATCHDOG)
        unsigned long val;
 #endif
+       reconfigure_pll(CFG_PLL_RECONFIG);
 
 #if (defined(CONFIG_405EP) || defined (CONFIG_405EX)) && !defined(CFG_4xx_GPIO_TABLE)
        /*
@@ -135,6 +233,7 @@ cpu_init_f (void)
 #if defined (CFG_GPIO0_TCR)
        out32(GPIO0_TCR, CFG_GPIO0_TCR);        /* enable output driver for outputs     */
 #endif
+#endif /* CONFIG_405EP ... && !CFG_4xx_GPIO_TABLE */
 
 #if defined (CONFIG_405EP)
        /*
@@ -147,7 +246,6 @@ cpu_init_f (void)
         */
        mtdcr(cpc0_pci, mfdcr(cpc0_pci) | CPC0_PCI_HOST_CFG_EN | CPC0_PCI_ARBIT_EN);
 #endif /* CONFIG_405EP */
-#endif /* CONFIG_405EP */
 
 #if defined(CFG_4xx_GPIO_TABLE)
        gpio_set_chip_configuration();
index 60f89c9..e20c9eb 100644 (file)
@@ -1093,10 +1093,10 @@ long int initdram(int board_type)
 
        program_ddr0_06(dimm_ranks, iic0_dimm_addr, num_dimm_banks, sdram_freq);
 
-       /*------------------------------------------------------------------
+       /*
         * TODO: tFAW not found in SPD.  Value of 13 taken from Sequoia
-        * board SDRAM, but may be overly concervate.
-        *-----------------------------------------------------------------*/
+        * board SDRAM, but may be overly conservative.
+        */
        mtsdram(DDR0_07, DDR0_07_NO_CMD_INIT_ENCODE(0) |
                DDR0_07_TFAW_ENCODE(13) |
                DDR0_07_AUTO_REFRESH_MODE_ENCODE(1) |
@@ -1181,26 +1181,29 @@ long int initdram(int board_type)
        denali_wait_for_dlllock();
 
 #if defined(CONFIG_DDR_DATA_EYE)
-       /* -----------------------------------------------------------+
-        * Perform data eye search if requested.
-        * ----------------------------------------------------------*/
-       program_tlb(0, CFG_SDRAM_BASE, dram_size, TLB_WORD2_I_ENABLE);
+       /*
+        * Map the first 1 MiB of memory in the TLB, and perform the data eye
+        * search.
+        */
+       program_tlb(0, CFG_SDRAM_BASE, TLB_1MB_SIZE, TLB_WORD2_I_ENABLE);
        denali_core_search_data_eye();
        denali_sdram_register_dump();
-       remove_tlb(CFG_SDRAM_BASE, dram_size);
+       remove_tlb(CFG_SDRAM_BASE, TLB_1MB_SIZE);
 #endif
 
 #if defined(CONFIG_ZERO_SDRAM) || defined(CONFIG_DDR_ECC)
        program_tlb(0, CFG_SDRAM_BASE, dram_size, 0);
        sync();
-       eieio();
        /* Zero the memory */
        debug("Zeroing SDRAM...");
-       dcbz_area(CFG_SDRAM_BASE, dram_size);
+#if defined(CFG_MEM_TOP_HIDE)
+       dcbz_area(CFG_SDRAM_BASE, dram_size - CFG_MEM_TOP_HIDE);
+#else
+#error Please define CFG_MEM_TOP_HIDE (see README) in your board config file
+#endif
        dflush();
        debug("Completed\n");
        sync();
-       eieio();
        remove_tlb(CFG_SDRAM_BASE, dram_size);
 
 #if defined(CONFIG_DDR_ECC)
@@ -1211,7 +1214,6 @@ long int initdram(int board_type)
                u32 val;
 
                sync();
-               eieio();
                /* Clear error status */
                mfsdram(DDR0_00, val);
                mtsdram(DDR0_00, val | DDR0_00_INT_ACK_ALL);
@@ -1229,7 +1231,6 @@ long int initdram(int board_type)
                print_mcsr();
 #endif
                sync();
-               eieio();
        }
 #endif /* defined(CONFIG_DDR_ECC) */
 #endif /* defined(CONFIG_ZERO_SDRAM) || defined(CONFIG_DDR_ECC) */
index 698bcb5..8620e2b 100644 (file)
@@ -218,15 +218,16 @@ static void uic_interrupt(u32 uic_base, int vec_base)
                        } else {
                                set_dcr(uic_base + UIC_ER,
                                        get_dcr(uic_base + UIC_ER) &
-                                       ~(0x80000000 >> vec));
+                                       ~(0x80000000 >> (vec & 0x1f)));
                                printf("Masking bogus interrupt vector %d"
                                       " (UIC_BASE=0x%x)\n", vec, uic_base);
                        }
 
                        /*
-                        * After servicing the interrupt, we have to remove the status indicator.
+                        * After servicing the interrupt, we have to remove the
+                        * status indicator
                         */
-                       set_dcr(uic_base + UIC_SR, (0x80000000 >> vec));
+                       set_dcr(uic_base + UIC_SR, (0x80000000 >> (vec & 0x1f)));
                }
 
                /*
index fa79952..05b42fe 100644 (file)
@@ -165,6 +165,8 @@ void get_sys_info (PPC4xx_SYS_INFO * sysInfo)
                }
        }
 
+       sysInfo->freqEBC = sysInfo->freqPLB / sysInfo->pllExtBusDiv;
+
        sysInfo->freqUART = sysInfo->freqProcessor;
 }
 
index 2bfcba1..f44822d 100644 (file)
@@ -149,7 +149,9 @@ void change_tlb(u32 vaddr, u32 size, u32 tlb_word2_i_value)
                        /*
                         * Now check the end-address if it's in the range
                         */
-                       if ((tlb_vaddr + tlb_size - 1) <= (vaddr + size - 1)) {
+                       if (((tlb_vaddr + tlb_size - 1) <= (vaddr + size - 1)) ||
+                           ((tlb_vaddr < (vaddr + size - 1)) &&
+                            ((tlb_vaddr + tlb_size - 1) > (vaddr + size - 1)))) {
                                /*
                                 * Found a TLB in the range.
                                 * Change cache attribute in tlb2 word.
index 5d50b3c..eae6adb 100644 (file)
@@ -155,7 +155,7 @@ int dcache_status (void)
        #define HEX2BCD(x) ((((x) / 10) << 4) + (x) % 10)
 #endif
 
-void rtc_get (struct rtc_time* tm)
+int rtc_get (struct rtc_time* tm)
 {
        RTCCON |= 1;
        tm->tm_year  = BCD2HEX(BCDYEAR);
@@ -184,6 +184,8 @@ void rtc_get (struct rtc_time* tm)
                tm->tm_year += 1900;
        else
                tm->tm_year += 2000;
+
+       return 0;
 }
 
 void rtc_set (struct rtc_time* tm)
index 0ebf951..d94e139 100644 (file)
@@ -24,6 +24,7 @@
 #include <common.h>
 #include <command.h>
 #include <asm/processor.h>
+#include <asm/cache.h>
 
 int checkcpu(void)
 {
@@ -51,7 +52,7 @@ int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
 void flush_cache (unsigned long addr, unsigned long size)
 {
-
+       dcache_invalid_range( addr , addr + size );
 }
 
 void icache_enable (void)
index 56b9427..3c71208 100644 (file)
@@ -35,6 +35,7 @@
 #endif
 
 #if (defined(CONFIG_CMD_IDE) || \
+     defined(CONFIG_CMD_SATA) || \
      defined(CONFIG_CMD_SCSI) || \
      defined(CONFIG_CMD_USB) || \
      defined(CONFIG_MMC) || \
@@ -49,6 +50,9 @@ static const struct block_drvr block_drvr[] = {
 #if defined(CONFIG_CMD_IDE)
        { .name = "ide", .get_dev = ide_get_dev, },
 #endif
+#if defined(CONFIG_CMD_SATA)
+       {.name = "sata", .get_dev = sata_get_dev, },
+#endif
 #if defined(CONFIG_CMD_SCSI)
        { .name = "scsi", .get_dev = scsi_get_dev, },
 #endif
@@ -87,6 +91,7 @@ block_dev_desc_t *get_dev(char* ifname, int dev)
 #endif
 
 #if (defined(CONFIG_CMD_IDE) || \
+     defined(CONFIG_CMD_SATA) || \
      defined(CONFIG_CMD_SCSI) || \
      defined(CONFIG_CMD_USB) || \
      defined(CONFIG_MMC) || \
@@ -116,6 +121,12 @@ void dev_print (block_dev_desc_t *dev_desc)
                        dev_desc->vendor,
                        dev_desc->revision,
                        dev_desc->product);
+       }
+       if (dev_desc->if_type==IF_TYPE_SATA) {
+               printf ("Model: %s Firm: %s Ser#: %s\n",
+                       dev_desc->vendor,
+                       dev_desc->revision,
+                       dev_desc->product);
        } else {
                printf ("Vendor: %s Prod.: %s Rev: %s\n",
                        dev_desc->vendor,
@@ -177,6 +188,7 @@ void dev_print (block_dev_desc_t *dev_desc)
 #endif
 
 #if (defined(CONFIG_CMD_IDE) || \
+     defined(CONFIG_CMD_SATA) || \
      defined(CONFIG_CMD_SCSI) || \
      defined(CONFIG_CMD_USB) || \
      defined(CONFIG_MMC)               || \
@@ -271,6 +283,8 @@ static void print_part_header (const char *type, block_dev_desc_t * dev_desc)
        switch (dev_desc->if_type) {
                case IF_TYPE_IDE:       puts ("IDE");
                                        break;
+               case IF_TYPE_SATA:      puts ("SATA");
+                                       break;
                case IF_TYPE_SCSI:      puts ("SCSI");
                                        break;
                case IF_TYPE_ATAPI:     puts ("ATAPI");
index 4707f80..4d778ec 100644 (file)
@@ -36,6 +36,7 @@
 #include "part_dos.h"
 
 #if (defined(CONFIG_CMD_IDE) || \
+     defined(CONFIG_CMD_SATA) || \
      defined(CONFIG_CMD_SCSI) || \
      defined(CONFIG_CMD_USB) || \
      defined(CONFIG_MMC) || \
@@ -194,6 +195,7 @@ static int get_partition_info_extended (block_dev_desc_t *dev_desc, int ext_part
                        info->size  = le32_to_int (pt->size4);
                        switch(dev_desc->if_type) {
                                case IF_TYPE_IDE:
+                               case IF_TYPE_SATA:
                                case IF_TYPE_ATAPI:
                                        sprintf ((char *)info->name, "hd%c%d\n", 'a' + dev_desc->dev, part_num);
                                        break;
index 06dd75e..4894630 100644 (file)
@@ -27,6 +27,7 @@
 
 #if (defined(CONFIG_CMD_IDE) || \
      defined(CONFIG_CMD_SCSI) || \
+     defined(CONFIG_CMD_SATA) || \
      defined(CONFIG_CMD_USB) || \
      defined(CONFIG_MMC) || \
      defined(CONFIG_SYSTEMACE) ) && defined(CONFIG_ISO_PARTITION)
@@ -157,6 +158,7 @@ int get_partition_info_iso_verb(block_dev_desc_t * dev_desc, int part_num, disk_
        sprintf ((char *)info->type, "U-Boot");
        switch(dev_desc->if_type) {
                case IF_TYPE_IDE:
+               case IF_TYPE_SATA:
                case IF_TYPE_ATAPI:
                        sprintf ((char *)info->name, "hd%c%d\n", 'a' + dev_desc->dev, part_num);
                        break;
index d303a73..1922fe5 100644 (file)
@@ -36,6 +36,7 @@
 
 #if (defined(CONFIG_CMD_IDE) || \
      defined(CONFIG_CMD_SCSI) || \
+     defined(CONFIG_CMD_SATA) || \
      defined(CONFIG_CMD_USB) || \
      defined(CONFIG_MMC) || \
      defined(CONFIG_SYSTEMACE) ) && defined(CONFIG_MAC_PARTITION)
diff --git a/doc/README.korat b/doc/README.korat
new file mode 100644 (file)
index 0000000..0a59f40
--- /dev/null
@@ -0,0 +1,51 @@
+The Korat board has two NOR flashes, FLASH0 and FLASH1, which are connected to
+chip select 0 and 1, respectively.  FLASH0 contains 16 MiB, and is mapped to
+addresses 0xFF000000 - 0xFFFFFFFF as U-Boot Flash Bank #2.  FLASH1 contains
+from 16 to 128 MiB, and is mapped to 0xF?000000 - 0xF7FFFFFF as U-Boot Flash
+Bank #1 (with the starting address depending on the flash size detected at
+runtime).  The write-enable pin on FLASH0 is disabled, so the contents of FLASH0
+cannot be modified in the field.  This also prevents FLASH0 from executing
+commands to return chip information, so its configuration is hard-coded in
+U-Boot.
+
+There are two versions of U-Boot for Korat: "permanent" and "upgradable".  The
+permanent U-Boot is pre-programmed at the top of FLASH0, e.g., at addresses
+0xFFFA0000 - 0xFFFFFFFF for the current 384 KiB size.  The upgradable U-Boot is
+located 256 KiB from the top of FLASH1, e.g. at addresses 0xF7F6000 - 0xF7FC0000
+for the current 384 KiB size.  FLASH1 addresses 0xF7FE0000 - 0xF7FF0000 are
+used for the U-Boot environmental parameters, and addresses 0xF7FC0000 -
+0xF7FDFFFF are used for the redundant copy of the parameters.  These locations
+are used by both versions of U-Boot.
+
+On booting, the permanent U-Boot in FLASH0 begins executing.  After performing
+minimal setup, it monitors the state of the board's Reset switch (GPIO47).  If
+the switch is sensed as open before a timeout period, then U-Boot branches to
+address 0xF7FBFFFC.  This causes the upgradable U-Boot to execute from the
+beginning.  If the switch remains closed thoughout the timeout period, the
+permanent U-Boot activates the on-board buzzer until the switch is sensed as
+opened.  It then continues to execute without branching to FLASH1.  The effect
+of this is that normally the Korat board boots its upgradable U-Boot, but, if
+this has been corrupted, the user can boot the permanent U-Boot, which can then
+be used to erase and reload FLASH1 as needed.
+
+Note that it is not necessary for the permanent U-Boot to have all the latest
+features, but only that it have sufficient functionality (working "tftp",
+"erase", "cp.b", etc.) to repair FLASH1.  Also, the permanent U-Boot makes no
+assumptions about the size of FLASH1 or the size of the upgradable U-Boot: it is
+sufficient that the upgradable U-Boot can be started by a branch to 0xF7FBFFFC.
+
+The build sequence:
+
+       make korat_config
+       make all perm=1
+
+builds the permanent U-Boot by selecting loader file "u-boot.lds" and defining
+preprocessor symbol "CONFIG_KORAT_PERMANENT".  The default build:
+
+       make korat_config
+       make all
+
+creates the upgradable U-Boot but selecting loader file "u-boot-F7FC.lds" and
+leaving preprocessor symbol "CONFIG_KORAT_PERMANENT" undefined.
+
+2008-02-22, Larry Johnson <lrj@acm.org>
diff --git a/doc/README.mips b/doc/README.mips
new file mode 100644 (file)
index 0000000..85dea40
--- /dev/null
@@ -0,0 +1,57 @@
+
+Notes for the MIPS architecture port of U-Boot
+
+Toolchains
+----------
+
+  http://www.denx.de/wiki/DULG/ELDK
+  ELDK < DULG < DENX
+
+  http://www.emdebian.org/crosstools.html
+  Embedded Debian -- Cross-development toolchains
+
+  http://buildroot.uclibc.org/
+  Buildroot
+
+Known Issues
+------------
+
+  * Little endian build problem
+
+    If use non-ELDK toolchains, -EB will be set to CPPFLAGS. Therefore all
+    objects will be generated in big-endian format.
+
+  * Cache incoherency issue caused by do_bootelf_exec() at cmd_elf.c
+
+    Cache will be disabled before entering the loaded ELF image without
+    writing back and invalidating cache lines. This leads to cache
+    incoherency in most cases, unless the code gets loaded after U-Boot
+    re-initializes the cache. The more common uImage 'bootm' command does
+    not suffer this problem.
+
+    [workaround] To avoid this cache incoherency,
+    1) insert flush_cache(all) before calling dcache_disable(), or
+    2) fix dcache_disable() to do both flushing and disabling cache.
+
+  * Note that Linux users need to kill dcache_disable() in do_bootelf_exec()
+    or override do_bootelf_exec() not to disable I-/D-caches, because most
+    Linux/MIPS ports don't re-enable caches after entering kernel_entry.
+
+TODOs
+-----
+
+  * Probe CPU types, I-/D-cache and TLB size etc. automatically
+
+  * Secondary cache support missing
+
+  * Centralize the link directive files
+
+  * Initialize TLB entries redardless of their use
+
+  * R2000/R3000 class parts are not supported
+
+  * Limited testing across different MIPS variants
+
+  * Due to cache initialization issues, the DRAM on board must be
+    initialized in board specific assembler language before the cache init
+    code is run -- that is, initialize the DRAM in lowlevel_init().
diff --git a/doc/README.sata b/doc/README.sata
new file mode 100644 (file)
index 0000000..d0ce667
--- /dev/null
@@ -0,0 +1,68 @@
+1. SATA usage in U-boot
+
+       There are two ways to operate the hard disk
+
+       * Read/write raw blocks from/to SATA hard disk
+       * ext2load to read a file from ext2 file system
+
+1.0 How to read the SATA hard disk's information?
+
+       => sata info
+
+SATA device 0: Model: ST3320620AS Firm: 3.AAD Ser#:            4QF01ZTN
+           Type: Hard Disk
+           Supports 48-bit addressing
+           Capacity: 305245.3 MB = 298.0 GB (625142448 x 512)
+
+1.1 How to raw write the kernel, file system, dtb to a SATA hard disk?
+
+       Notes: Hard disk sectors are normally 512 bytes, so
+               0x1000 sectors = 2 MBytes
+
+       write kernel
+       => tftp 40000 /tftpboot/uImage.837x
+       => sata write 40000 0 2000
+
+       write ramdisk
+       => tftp 40000 /tftpboot/ramdisk.837x
+       => sata write 40000 2000 8000
+
+       write dtb
+       => tftp 40000 /tftpboot/mpc837xemds.dtb
+       => sata write 40000 a000 1000
+
+1.2 How to raw read the kernel, file system, dtb from a SATA hard disk?
+
+       load kernel
+       => sata read 200000 0 2000
+
+       load ramdisk
+       => sata read 1000000 2000 8000
+
+       load dtb
+       => sata read 2000000 a000 1000
+
+       boot
+       => bootm 200000 1000000 2000000
+
+1.3 How to load an image from an ext2 file system in U-boot?
+
+       U-boot doesn't support writing to an ext2 file system, so the
+       files must be written by other means (e.g. linux).
+
+       => ext2ls sata 0:1 /
+       <DIR>       4096 .
+       <DIR>       4096 ..
+       <DIR>      16384 lost+found
+                1352023 uImage.837x
+                3646377 ramdisk.837x
+                  12288 mpc837xemds.dtb
+                     12 hello.txt
+
+       => ext2load sata 0:1 200000 /uImage.837x
+
+       => ext2load sata 0:1 1000000 /ramdisk.837x
+
+       => ext2load sata 0:1 2000000 /mpc837xemds.dtb
+
+       => bootm 200000 1000000 2000000
index 075d360..6baee08 100644 (file)
@@ -1,6 +1,6 @@
 
 U-Boot for Renesas SuperH
-       Last update 08/10/2007 by Nobuhiro Iwamatsu
+       Last update 01/18/2008 by Nobuhiro Iwamatsu
 
 ================================================================================
 0. What's this?
@@ -18,7 +18,19 @@ U-Boot for Renesas SuperH
 2. Supported CPUs
 
        2.1. Renesas SH7750/SH7750R
+               This CPU has the SH4 core.
+
        2.2. Renesas SH7722
+               This CPU has the SH4AL-DSP core.
+
+       2.3. Renesas SH7720
+               This CPU has the SH3 core.
+
+       2.4. Renesas SH7710/SH7712
+               This CPU has the SH3-DSP core and Ethernet controller.
+
+       2.5. Renesas SH7780
+               This CPU has the SH4A core.
 
 ================================================================================
 3. Supported Boards
@@ -26,10 +38,42 @@ U-Boot for Renesas SuperH
        3.1. Hitachi UL MS7750SE01/MS7750RSE01
                Board specific code is in board/ms7750se
                To use this board, type "make ms7750se_config".
+               Support devices are :
+                       - SCIF
+                       - SDRAM
+                       - NOR Flash
+                       - Marubun PCMCIA
 
        3.2. Hitachi UL MS7722SE01
                Board specific code is in board/ms7722se
                To use this board, type "make ms7722se_config".
+               Support devices are :
+                       - SCIF
+                       - SDRAM
+                       - NOR Flash
+                       - Marubun PCMCIA
+                       - SMC91x ethernet
+
+       3.2. Hitachi UL MS7720ERP01
+               Board specific code is in board/ms7720se
+               To use this board, type "make ms7720se_config".
+               Support devices are :
+                       - SCIF
+                       - SDRAM
+                       - NOR Flash
+                       - Marubun PCMCIA
+
+       3.3. Renesas R7780MP
+               Board specific code is in board/r7780mp
+               To use this board, type "make r7780mp_config".
+               Support devices are :
+                       - SCIF
+                       - DDR-SDRAM
+                       - NOR Flash
+                       - Compact Flash
+                       - ASIX ethernet
+                       - SH7780 PCI bridge
+                       - RTL8110 ethernet
 
        ** README **
                In SuperH, S-record and binary of made u-boot work on the memory.
@@ -49,13 +93,12 @@ U-Boot for Renesas SuperH
 5. Future
        I plan to support the following CPUs and boards.
                5.1. CPUs
-                       - SH7710/SH7712 (SH3)
-                       - SH7780(SH4)
+                       - SH7751R(SH4)
                        - SH7785(SH4)
 
                5.2. Boards
                        - Many boards ;-)
 
 ================================================================================
-Copyright (c) 2007
+Copyright (c) 2007,2008
     Nobuhiro Iwamatsu <iwamatsu@nigaur.org>
diff --git a/doc/uImage.FIT/command_syntax_extensions.txt b/doc/uImage.FIT/command_syntax_extensions.txt
new file mode 100644 (file)
index 0000000..6185cd8
--- /dev/null
@@ -0,0 +1,191 @@
+Command syntax extensions for the new uImage format
+===================================================
+
+Author: Bartlomiej Sieka <tur@semihalf.com>
+
+With the introduction of the new uImage format, bootm command (and other
+commands as well) have to understand new syntax of the arguments. This is
+necessary in order to specify objects contained in the new uImage, on which
+bootm has to operate. This note attempts to first summarize bootm usage
+scenarios, and then introduces new argument syntax.
+
+
+bootm usage scenarios
+---------------------
+
+Below is a summary of bootm usage scenarios, focused on booting a PowerPC
+Linux kernel. The purpose of the following list is to document a complete list
+of supported bootm usages.
+
+Note: U-Boot supports two methods of booting a PowerPC Linux kernel: old way,
+i.e., without passing the Flattened Device Tree (FDT), and new way, where the
+kernel is passed a pointer to the FDT. The boot method is indicated for each
+scenario.
+
+
+1.  bootm              boot image at the current address, equivalent to 2,3,8
+
+Old uImage:
+2.  bootm <addr1>                  /* single image at <addr1> */
+3.  bootm <addr1>                  /* multi-image at <addr1>  */
+4.  bootm <addr1> -                /* multi-image at <addr1>  */
+5.  bootm <addr1> <addr2>          /* single image at <addr1> */
+6.  bootm <addr1> <addr2> <addr3>   /* single image at <addr1> */
+7.  bootm <addr1> -      <addr3>   /* single image at <addr1> */
+
+New uImage:
+8.  bootm <addr1>
+9.  bootm [<addr1>]:<subimg1>
+10. bootm [<addr1>]#<conf>
+11. bootm [<addr1>]:<subimg1> [<addr2>]:<subimg2>
+12. bootm [<addr1>]:<subimg1> [<addr2>]:<subimg2> [<addr3>]:<subimg3>
+13. bootm [<addr1>]:<subimg1> [<addr2>]:<subimg2> <addr3>
+14. bootm [<addr1>]:<subimg1> -                          [<addr3>]:<subimg3>
+15. bootm [<addr1>]:<subimg1> -                          <addr3>
+
+
+Ad. 1. This is equivalent to cases 2,3,8, depending on the type of image at
+the current image address.
+- boot method: see cases 2,3,8
+
+Ad. 2. Boot kernel image located at <addr1>.
+- boot method: non-FDT
+
+Ad. 3. First and second components of the image at <addr1> are assumed to be a
+kernel and a ramdisk, respectively. The kernel is booted with initrd loaded
+with the ramdisk from the image.
+- boot method: depends on the number of components at <addr1>, and on whether
+  U-Boot is compiled with OF support:
+
+                   |          2 components |          3 components |
+                   |      (kernel, initrd) | (kernel, initrd, fdt) |
+---------------------------------------------------------------------
+#ifdef CONFIG_OF_*  |              non-FDT |                   FDT |
+#ifndef CONFIG_OF_* |              non-FDT |               non-FDT |
+
+Ad. 4. Similar to case 3, but the kernel is booted without initrd.  Second
+component of the multi-image is irrelevant (it can be a dummy, 1-byte file).
+- boot method: see case 3
+
+Ad. 5. Boot kernel image located at <addr1> with initrd loaded with ramdisk
+from the image at <addr2>.
+- boot method: non-FDT
+
+Ad. 6. <addr1> is the address of a kernel image, <addr2> is the address of a
+ramdisk image, and <addr3> is the address of a FDT binary blob.  Kernel is
+booted with initrd loaded with ramdisk from the image at <addr2>.
+- boot method: FDT
+
+Ad. 7. <addr1> is the address of a kernel image and <addr3> is the address of
+a FDT binary blob. Kernel is booted without initrd.
+- boot method: FDT
+
+Ad. 8. Image at <addr1> is assumed to contain a default configuration, which
+is booted.
+- boot method: FDT or non-FDT, depending on whether the default configuration
+  defines FDT
+
+Ad. 9. Similar to case 2: boot kernel stored in <subimg1> from the image at
+address <addr1>.
+- boot method: non-FDT
+
+Ad. 10. Boot configuration <conf> from the image at <addr1>.
+- boot method: FDT or non-FDT, depending on whether the configuration given
+  defines FDT
+
+Ad. 11. Equivalent to case 5: boot kernel stored in <subimg1> from the image
+at <addr1> with initrd loaded with ramdisk <subimg2> from the image at
+<addr2>.
+- boot method: non-FDT
+
+Ad. 12. Equivalent to case 6: boot kernel stored in <subimg1> from the image
+at <addr1> with initrd loaded with ramdisk <subimg2> from the image at
+<addr2>, and pass FDT blob <subimg3> from the image at <addr3>.
+- boot method: FDT
+
+Ad. 13. Similar to case 12, the difference being that <addr3> is the address
+of FDT binary blob that is to be passed to the kernel.
+- boot method: FDT
+
+Ad. 14. Equivalent to case 7: boot kernel stored in <subimg1> from the image
+at <addr1>, without initrd, and pass FDT blob <subimg3> from the image at
+<addr3>.
+- boot method: FDT
+
+Ad. 15. Similar to case 14, the difference being that <addr3> is the address
+of the FDT binary blob that is to be passed to the kernel.
+- boot method: FDT
+
+
+New uImage argument syntax
+--------------------------
+
+New uImage support introduces two new forms for bootm arguments, with the
+following syntax:
+
+- new uImage sub-image specification
+<addr>:<sub-image unit_name>
+
+- new uImage configuration specification
+<addr>#<configuration unit_name>
+
+
+Examples:
+
+- boot kernel "kernel@1" stored in a new uImage located at 200000:
+bootm 200000:kernel@1
+
+- boot configuration "cfg@1" from a new uImage located at 200000:
+bootm 200000#cfg@1
+
+- boot "kernel@1" from a new uImage at 200000 with initrd "ramdisk@2" found in
+  some other new uImage stored at address 800000:
+bootm 200000:kernel@1 800000:ramdisk@2
+
+- boot "kernel@2" from a new uImage at 200000, with initrd "ramdisk@1" and FDT
+  "fdt@1", both stored in some other new uImage located at 800000:
+bootm 200000:kernel@1 800000:ramdisk@1 800000:fdt@1
+
+- boot kernel "kernel@2" with initrd "ramdisk@2", both stored in a new uImage
+  at address 200000, with a raw FDT blob stored at address 600000:
+bootm 200000:kernel@2 200000:ramdisk@2 600000
+
+- boot kernel "kernel@2" from new uImage at 200000 with FDT "fdt@1" from the
+  same new uImage:
+bootm 200000:kernel@2 - 200000:fdt@1
+
+
+Note on current image address
+-----------------------------
+
+When bootm is called without arguments, the image at current image address is
+booted. The current image address is the address set most recently by a load
+command, etc, and is by default equal to CFG_LOAD_ADDR. For example, consider
+the following commands:
+
+tftp 200000 /tftpboot/kernel
+bootm
+Last command is equivalent to:
+bootm 200000
+
+In case of the new uImage argument syntax, the address portion of any argument
+can be omitted. If <addr3> is omitted, then it is assumed that image at
+<addr2> should be used. Similarly, when <addr2> is omitted, is is assumed that
+image at <addr1> should be used. If <addr1> is omitted, it is assumed that the
+current image address is to be used. For example, consider the following
+commands:
+
+tftp 200000 /tftpboot/uImage
+bootm :kernel@1
+Last command is equivalent to:
+bootm 200000:kernel@1
+
+tftp 200000 /tftpboot/uImage
+bootm 400000:kernel@1 :ramdisk@1
+Last command is equivalent to:
+bootm 400000:kernel@1 400000:ramdisk@1
+
+tftp 200000 /tftpboot/uImage
+bootm :kernel@1 400000:ramdisk@1 :fdt@1
+Last command is equivalent to:
+bootm 200000:kernel@1 400000:ramdisk@1 400000:fdt@1
diff --git a/doc/uImage.FIT/howto.txt b/doc/uImage.FIT/howto.txt
new file mode 100644 (file)
index 0000000..8065e9e
--- /dev/null
@@ -0,0 +1,297 @@
+How to use images in the new image format
+=========================================
+
+Author: Bartlomiej Sieka <tur@semihalf.com>
+
+
+Overview
+--------
+
+The new uImage format allows more flexibility in handling images of various
+types (kernel, ramdisk, etc.), it also enhances integrity protection of images
+with sha1 and md5 checksums.
+
+Two auxiliary tools are needed on the development host system in order to
+create an uImage in the new format: mkimage and dtc, although only one
+(mkimage) is invoked directly. dtc is called from within mkimage and operates
+behind the scenes, but needs to be present in the $PATH nevertheless. It is
+important that the dtc used has support for binary includes -- refer to
+www.jdl.com for its latest version. mkimage (together with dtc) takes as input
+an image source file, which describes the contents of the image and defines
+its various properties used during booting. By convention, image source file
+has the ".its" extension, also, the details of its format are given in
+doc/source_file_format.txt. The actual data that is to be included in the
+uImage (kernel, ramdisk, etc.) is specified in the image source file in the
+form of paths to appropriate data files. The outcome of the image creation
+process is a binary file (by convention with the ".itb" extension) that
+contains all the referenced data (kernel, ramdisk, etc.) and other information
+needed by U-Boot to handle the uImage properly. The uImage file is then
+transferred to the target (e.g., via tftp) and booted using the bootm command.
+
+To summarize the prerequisites needed for new uImage creation:
+- mkimage
+- dtc (with support for binary includes)
+- image source file (*.its)
+- image data file(s)
+
+
+Here's a graphical overview of the image creation and booting process:
+
+image source file     mkimage + dtc              transfer to target
+       +            ---------------> image file --------------------> bootm
+image data files(s)
+
+
+Example 1 -- old-style (non-FDT) kernel booting
+-----------------------------------------------
+
+Consider a simple scenario, where a PPC Linux kernel built from sources on the
+development host is to be booted old-style (non-FDT) by U-Boot on an embedded
+target. Assume that the outcome of the build is vmlinux.bin.gz, a file which
+contains a gzip-compressed PPC Linux kernel (the only data file in this case).
+The uImage can be produced using the image source file
+doc/uImage.FIT/kernel.its (note that kernel.its assumes that vmlinux.bin.gz is
+in the current working directory; if desired, an alternative path can be
+specified in the kernel.its file). Here's how to create the image and inspect
+its contents:
+
+[on the host system]
+$ mkimage -f kernel.its kernel.itb
+DTC: dts->dtb  on file "kernel.its"
+$
+$ mkimage -l kernel.itb
+FIT description: Simple image with single Linux kernel
+Created:        Tue Mar 11 17:26:15 2008
+ Image 0 (kernel@1)
+  Description: Vanilla Linux kernel
+  Type:                Kernel Image
+  Compression: gzip compressed
+  Data Size:   943347 Bytes = 921.24 kB = 0.90 MB
+  Architecture: PowerPC
+  OS:          Linux
+  Load Address: 0x00000000
+  Entry Point: 0x00000000
+  Hash algo:   crc32
+  Hash value:  2ae2bb40
+  Hash algo:   sha1
+  Hash value:  3c200f34e2c226ddc789240cca0c59fc54a67cf4
+ Default Configuration: 'config@1'
+ Configuration 0 (config@1)
+  Description: Boot Linux kernel
+  Kernel:      kernel@1
+
+
+The resulting image file kernel.itb can be now transferred to the target,
+inspected and booted (note that first three U-Boot commands below are shown
+for completeness -- they are part of the standard booting procedure and not
+specific to the new image format).
+
+[on the target system]
+=> print nfsargs
+nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${rootpath}
+=> print addip
+addip=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}:off panic=1
+=> run nfsargs addip
+=> tftp 900000 /path/to/tftp/location/kernel.itb
+Using FEC ETHERNET device
+TFTP from server 192.168.1.1; our IP address is 192.168.160.5
+Filename '/path/to/tftp/location/kernel.itb'.
+Load address: 0x900000
+Loading: #################################################################
+done
+Bytes transferred = 944464 (e6950 hex)
+=> iminfo
+
+## Checking Image at 00900000 ...
+   FIT image found
+   FIT description: Simple image with single Linux kernel
+   Created:        2008-03-11  16:26:15 UTC
+    Image 0 (kernel@1)
+     Description:  Vanilla Linux kernel
+     Type:        Kernel Image
+     Compression:  gzip compressed
+     Data Start:   0x009000e0
+     Data Size:    943347 Bytes = 921.2 kB
+     Architecture: PowerPC
+     OS:          Linux
+     Load Address: 0x00000000
+     Entry Point:  0x00000000
+     Hash algo:    crc32
+     Hash value:   2ae2bb40
+     Hash algo:    sha1
+     Hash value:   3c200f34e2c226ddc789240cca0c59fc54a67cf4
+    Default Configuration: 'config@1'
+    Configuration 0 (config@1)
+     Description:  Boot Linux kernel
+     Kernel:      kernel@1
+
+=> bootm
+## Booting kernel from FIT Image at 00900000 ...
+   Using 'config@1' configuration
+   Trying 'kernel@1' kernel subimage
+     Description:  Vanilla Linux kernel
+     Type:        Kernel Image
+     Compression:  gzip compressed
+     Data Start:   0x009000e0
+     Data Size:    943347 Bytes = 921.2 kB
+     Architecture: PowerPC
+     OS:          Linux
+     Load Address: 0x00000000
+     Entry Point:  0x00000000
+     Hash algo:    crc32
+     Hash value:   2ae2bb40
+     Hash algo:    sha1
+     Hash value:   3c200f34e2c226ddc789240cca0c59fc54a67cf4
+   Verifying Hash Integrity ... crc32+ sha1+ OK
+   Uncompressing Kernel Image ... OK
+Memory BAT mapping: BAT2=256Mb, BAT3=0Mb, residual: 0Mb
+Linux version 2.4.25 (m8@hekate) (gcc version 4.0.0 (DENX ELDK 4.0 4.0.0)) #2 czw lip 5 17:56:18 CEST 2007
+On node 0 totalpages: 65536
+zone(0): 65536 pages.
+zone(1): 0 pages.
+zone(2): 0 pages.
+Kernel command line: root=/dev/nfs rw nfsroot=192.168.1.1:/opt/eldk-4.1/ppc_6xx ip=192.168.160.5:192.168.1.1::255.255.0.0:lite5200b:eth0:off panic=1
+Calibrating delay loop... 307.20 BogoMIPS
+
+
+Example 2 -- new-style (FDT) kernel booting
+-------------------------------------------
+
+Consider another simple scenario, where a PPC Linux kernel is to be booted
+new-style, i.e., with a FDT blob. In this case there are two prerequisite data
+files: vmlinux.bin.gz (Linux kernel) and target.dtb (FDT blob). The uImage can
+be produced using image source file doc/uImage.FIT/kernel_fdt.its like this
+(note again, that both prerequisite data files are assumed to be present in
+the current working directory -- image source file kernel_fdt.its can be
+modified to take the files from some other location if needed):
+
+[on the host system]
+$ mkimage -f kernel_fdt.its kernel_fdt.itb
+DTC: dts->dtb  on file "kernel_fdt.its"
+$
+$ mkimage -l kernel_fdt.itb
+FIT description: Simple image with single Linux kernel and FDT blob
+Created:        Tue Mar 11 16:29:22 2008
+ Image 0 (kernel@1)
+  Description: Vanilla Linux kernel
+  Type:                Kernel Image
+  Compression: gzip compressed
+  Data Size:   1092037 Bytes = 1066.44 kB = 1.04 MB
+  Architecture: PowerPC
+  OS:          Linux
+  Load Address: 0x00000000
+  Entry Point: 0x00000000
+  Hash algo:   crc32
+  Hash value:  2c0cc807
+  Hash algo:   sha1
+  Hash value:  264b59935470e42c418744f83935d44cdf59a3bb
+ Image 1 (fdt@1)
+  Description: Flattened Device Tree blob
+  Type:                Flat Device Tree
+  Compression: uncompressed
+  Data Size:   16384 Bytes = 16.00 kB = 0.02 MB
+  Architecture: PowerPC
+  Hash algo:   crc32
+  Hash value:  0d655d71
+  Hash algo:   sha1
+  Hash value:  25ab4e15cd4b8a5144610394560d9c318ce52def
+ Default Configuration: 'conf@1'
+ Configuration 0 (conf@1)
+  Description: Boot Linux kernel with FDT blob
+  Kernel:      kernel@1
+  FDT:         fdt@1
+
+
+The resulting image file kernel_fdt.itb can be now transferred to the target,
+inspected and booted:
+
+[on the target system]
+=> tftp 900000 /path/to/tftp/location/kernel_fdt.itb
+Using FEC ETHERNET device
+TFTP from server 192.168.1.1; our IP address is 192.168.160.5
+Filename '/path/to/tftp/location/kernel_fdt.itb'.
+Load address: 0x900000
+Loading: #################################################################
+        ###########
+done
+Bytes transferred = 1109776 (10ef10 hex)
+=> iminfo
+
+## Checking Image at 00900000 ...
+   FIT image found
+   FIT description: Simple image with single Linux kernel and FDT blob
+   Created:        2008-03-11  15:29:22 UTC
+    Image 0 (kernel@1)
+     Description:  Vanilla Linux kernel
+     Type:        Kernel Image
+     Compression:  gzip compressed
+     Data Start:   0x009000ec
+     Data Size:    1092037 Bytes =  1 MB
+     Architecture: PowerPC
+     OS:          Linux
+     Load Address: 0x00000000
+     Entry Point:  0x00000000
+     Hash algo:    crc32
+     Hash value:   2c0cc807
+     Hash algo:    sha1
+     Hash value:   264b59935470e42c418744f83935d44cdf59a3bb
+    Image 1 (fdt@1)
+     Description:  Flattened Device Tree blob
+     Type:        Flat Device Tree
+     Compression:  uncompressed
+     Data Start:   0x00a0abdc
+     Data Size:    16384 Bytes = 16 kB
+     Architecture: PowerPC
+     Hash algo:    crc32
+     Hash value:   0d655d71
+     Hash algo:    sha1
+     Hash value:   25ab4e15cd4b8a5144610394560d9c318ce52def
+    Default Configuration: 'conf@1'
+    Configuration 0 (conf@1)
+     Description:  Boot Linux kernel with FDT blob
+     Kernel:      kernel@1
+     FDT:         fdt@1
+=> bootm
+## Booting kernel from FIT Image at 00900000 ...
+   Using 'conf@1' configuration
+   Trying 'kernel@1' kernel subimage
+     Description:  Vanilla Linux kernel
+     Type:        Kernel Image
+     Compression:  gzip compressed
+     Data Start:   0x009000ec
+     Data Size:    1092037 Bytes =  1 MB
+     Architecture: PowerPC
+     OS:          Linux
+     Load Address: 0x00000000
+     Entry Point:  0x00000000
+     Hash algo:    crc32
+     Hash value:   2c0cc807
+     Hash algo:    sha1
+     Hash value:   264b59935470e42c418744f83935d44cdf59a3bb
+   Verifying Hash Integrity ... crc32+ sha1+ OK
+   Uncompressing Kernel Image ... OK
+## Flattened Device Tree from FIT Image at 00900000
+   Using 'conf@1' configuration
+   Trying 'fdt@1' FDT blob subimage
+     Description:  Flattened Device Tree blob
+     Type:        Flat Device Tree
+     Compression:  uncompressed
+     Data Start:   0x00a0abdc
+     Data Size:    16384 Bytes = 16 kB
+     Architecture: PowerPC
+     Hash algo:    crc32
+     Hash value:   0d655d71
+     Hash algo:    sha1
+     Hash value:   25ab4e15cd4b8a5144610394560d9c318ce52def
+   Verifying Hash Integrity ... crc32+ sha1+ OK
+   Booting using the fdt blob at 0xa0abdc
+   Loading Device Tree to 007fc000, end 007fffff ... OK
+[    0.000000] Using lite5200 machine description
+[    0.000000] Linux version 2.6.24-rc6-gaebecdfc (m8@hekate) (gcc version 4.0.0 (DENX ELDK 4.1 4.0.0)) #1 Sat Jan 12 15:38:48 CET 2008
+
+
+Example 3 -- advanced booting
+-----------------------------
+
+Refer to doc/uImage.FIT/multi.its for an image source file that allows more
+sophisticated booting scenarios (multiple kernels, ramdisks and fdt blobs).
diff --git a/doc/uImage.FIT/kernel.its b/doc/uImage.FIT/kernel.its
new file mode 100644 (file)
index 0000000..d1a5939
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Simple U-boot uImage source file containing a single kernel
+ */
+/ {
+       description = "Simple image with single Linux kernel";
+       #address-cells = <1>;
+
+       images {
+               kernel@1 {
+                       description = "Vanilla Linux kernel";
+                       data = /incbin/("./vmlinux.bin.gz");
+                       type = "kernel";
+                       arch = "ppc";
+                       os = "linux";
+                       compression = "gzip";
+                       load = <00000000>;
+                       entry = <00000000>;
+                       hash@1 {
+                               algo = "crc32";
+                       };
+                       hash@2 {
+                               algo = "sha1";
+                       };
+               };
+       };
+
+       configurations {
+               default = "config@1";
+               config@1 {
+                       description = "Boot Linux kernel";
+                       kernel = "kernel@1";
+               };
+       };
+};
diff --git a/doc/uImage.FIT/kernel_fdt.its b/doc/uImage.FIT/kernel_fdt.its
new file mode 100644 (file)
index 0000000..fd6dee2
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Simple U-boot uImage source file containing a single kernel and FDT blob
+ */
+/ {
+       description = "Simple image with single Linux kernel and FDT blob";
+       #address-cells = <1>;
+
+       images {
+               kernel@1 {
+                       description = "Vanilla Linux kernel";
+                       data = /incbin/("./vmlinux.bin.gz");
+                       type = "kernel";
+                       arch = "ppc";
+                       os = "linux";
+                       compression = "gzip";
+                       load = <00000000>;
+                       entry = <00000000>;
+                       hash@1 {
+                               algo = "crc32";
+                       };
+                       hash@2 {
+                               algo = "sha1";
+                       };
+               };
+               fdt@1 {
+                       description = "Flattened Device Tree blob";
+                       data = /incbin/("./target.dtb");
+                       type = "flat_dt";
+                       arch = "ppc";
+                       compression = "none";
+                       hash@1 {
+                               algo = "crc32";
+                       };
+                       hash@2 {
+                               algo = "sha1";
+                       };
+               };
+       };
+
+       configurations {
+               default = "conf@1";
+               conf@1 {
+                       description = "Boot Linux kernel with FDT blob";
+                       kernel = "kernel@1";
+                       fdt = "fdt@1";
+               };
+       };
+};
diff --git a/doc/uImage.FIT/multi.its b/doc/uImage.FIT/multi.its
new file mode 100644 (file)
index 0000000..b992962
--- /dev/null
@@ -0,0 +1,124 @@
+/*
+ * U-boot uImage source file with multiple kernels, ramdisks and FDT blobs
+ */
+/ {
+       description = "Various kernels, ramdisks and FDT blobs";
+       #address-cells = <1>;
+
+       images {
+               kernel@1 {
+                       description = "vanilla-2.6.23";
+                       data = /incbin/("./vmlinux.bin.gz");
+                       type = "kernel";
+                       arch = "ppc";
+                       os = "linux";
+                       compression = "gzip";
+                       load = <00000000>;
+                       entry = <00000000>;
+                       hash@1 {
+                               algo = "md5";
+                       };
+                       hash@2 {
+                               algo = "sha1";
+                       };
+               };
+
+               kernel@2 {
+                       description = "2.6.23-denx";
+                       data = /incbin/("./2.6.23-denx.bin.gz");
+                       type = "kernel";
+                       arch = "ppc";
+                       os = "linux";
+                       compression = "gzip";
+                       load = <00000000>;
+                       entry = <00000000>;
+                       hash@1 {
+                               algo = "sha1";
+                       };
+               };
+
+               kernel@3 {
+                       description = "2.4.25-denx";
+                       data = /incbin/("./2.4.25-denx.bin.gz");
+                       type = "kernel";
+                       arch = "ppc";
+                       os = "linux";
+                       compression = "gzip";
+                       load = <00000000>;
+                       entry = <00000000>;
+                       hash@1 {
+                               algo = "md5";
+                       };
+               };
+
+               ramdisk@1 {
+                       description = "eldk-4.2-ramdisk";
+                       data = /incbin/("./eldk-4.2-ramdisk");
+                       type = "ramdisk";
+                       arch = "ppc";
+                       compression = "gzip";
+                       hash@1 {
+                               algo = "sha1";
+                       };
+               };
+
+               ramdisk@2 {
+                       description = "eldk-3.1-ramdisk";
+                       data = /incbin/("./eldk-3.1-ramdisk");
+                       type = "ramdisk";
+                       arch = "ppc";
+                       compression = "gzip";
+                       hash@1 {
+                               algo = "crc32";
+                       };
+               };
+
+               fdt@1 {
+                       description = "tqm5200-fdt";
+                       data = /incbin/("./tqm5200.dtb");
+                       type = "flat_dt";
+                       arch = "ppc";
+                       compression = "none";
+                       hash@1 {
+                               algo = "crc32";
+                       };
+               };
+
+               fdt@2 {
+                       description = "tqm5200s-fdt";
+                       data = /incbin/("./tqm5200s.dtb");
+                       type = "flat_dt";
+                       arch = "ppc";
+                       compression = "none";
+                       load = <00700000>;
+                       hash@1 {
+                               algo = "sha1";
+                       };
+               };
+
+       };
+
+       configurations {
+               default = "config@1";
+
+               config@1 {
+                       description = "tqm5200 vanilla-2.6.23 configuration";
+                       kernel = "kernel@1";
+                       ramdisk = "ramdisk@1";
+                       fdt = "fdt@1";
+               };
+
+               config@2 {
+                       description = "tqm5200s denx-2.6.23 configuration";
+                       kernel = "kernel@2";
+                       ramdisk = "ramdisk@1";
+                       fdt = "fdt@2";
+               };
+
+               config@3 {
+                       description = "tqm5200s denx-2.4.25 configuration";
+                       kernel = "kernel@3";
+                       ramdisk = "ramdisk@2";
+               };
+       };
+};
diff --git a/doc/uImage.FIT/source_file_format.txt b/doc/uImage.FIT/source_file_format.txt
new file mode 100644 (file)
index 0000000..c1244fb
--- /dev/null
@@ -0,0 +1,262 @@
+U-boot new uImage source file format (bindings definition)
+==========================================================
+
+Author: Marian Balakowicz <m8@semihalf.com>
+
+1) Introduction
+---------------
+
+Evolution of the 2.6 Linux kernel for embedded PowerPC systems introduced new
+booting method which requires that hardware description is available to the
+kernel in the form of Flattened Device Tree.
+
+Booting with a Flattened Device Tree is much more flexible and is intended to
+replace direct passing of 'struct bd_info' which was used to boot pre-FDT
+kernels.
+
+However, U-boot needs to support both techniques to provide backward
+compatibility for platforms which are not FDT ready. Number of elements
+playing role in the booting process has increased and now includes the FDT
+blob. Kernel image, FDT blob and possibly ramdisk image - all must be placed
+in the system memory and passed to bootm as a arguments. Some of them may be
+missing: FDT is not present for legacy platforms, ramdisk is always optional.
+Additionally, old uImage format has been extended to support multi sub-images
+but the support is limited by simple format of the legacy uImage structure.
+Single binary header 'struct image_header' is not flexible enough to cover all
+possible scenarios.
+
+All those factors combined clearly show that there is a need for new, more
+flexible, multi component uImage format.
+
+
+2) New uImage format assumptions
+--------------------------------
+
+a) Implementation
+
+Libfdt has been selected for the new uImage format implementation as (1) it
+provides needed functionality, (2) is actively maintained and developed and
+(3) increases code reuse as it is already part of the U-boot source tree.
+
+b) Terminology
+
+This document defines new uImage structure by providing FDT bindings for new
+uImage internals. Bindings are defined from U-boot perspective, i.e. describe
+final form of the uImage at the moment when it reaches U-boot. User
+perspective may be simpler, as some of the properties (like timestamps and
+hashes) will need to be filled in automatically by the U-boot mkimage tool.
+
+To avoid confusion with the kernel FDT the following naming convention is
+proposed for the new uImage format related terms:
+
+FIT    - Flattened uImage Tree
+
+FIT is formally a flattened device tree (in the libfdt meaning), which
+conforms to bindings defined in this document.
+
+.its   - image tree source
+.itb   - image tree blob
+
+c) Image building procedure
+
+The following picture shows how the new uImage is prepared. Input consists of
+image source file (.its) and a set of data files. Image is created with the
+help of standard U-boot mkimage tool which in turn uses dtc (device tree
+compiler) to produce image tree blob (.itb).  Resulting .itb file is is the
+actual binary of a new uImage.
+
+
+tqm5200.its
++
+vmlinux.bin.gz    mkimage + dtc               xfer to target
+eldk-4.2-ramdisk  --------------> tqm5200.itb --------------> bootm
+tqm5200.dtb                         /|\
+...                                  |
+                                'new uImage'
+
+       - create .its file, automatically filled-in properties are omitted
+       - call mkimage tool on a .its file
+       - mkimage calls dtc to create .itb image and assures that
+         missing properties are added
+       - .itb (new uImage) is uploaded onto the target and used therein
+
+
+d) Unique identifiers
+
+To identify FIT sub-nodes representing images, hashes, configurations (which
+are defined in the following sections), the "unit name" of the given sub-node
+is used as it's identifier as it assures uniqueness without additional
+checking required.
+
+
+3) Root node properties
+-----------------------
+
+Root node of the uImage Tree should have the following layout:
+
+/ o image-tree
+    |- description = "image description"
+    |- timestamp = <12399321>
+    |- #address-cells = <1>
+    |
+    o images
+    | |
+    | o img@1 {...}
+    | o img@2 {...}
+    | ...
+    |
+    o configurations
+      |- default = "cfg@1"
+      |
+      o cfg@1 {...}
+      o cfg@2 {...}
+      ...
+
+
+  Optional property:
+  - description : Textual description of the uImage
+
+  Mandatory property:
+  - timestamp : Last image modification time being counted in seconds since
+    1970-01-01 00:00:00 - to be automatically calculated by mkimage tool.
+
+  Conditionally mandatory property:
+  - #address-cells : Number of 32bit cells required to represent entry and
+    load addresses supplied within sub-image nodes. May be omitted when no
+    entry or load addresses are used.
+
+  Mandatory node:
+  - images : This node contains a set of sub-nodes, each of them representing
+    single component sub-image (like kernel, ramdisk, etc.). At least one
+    sub-image is required.
+
+  Optional node:
+  - configurations : Contains a set of available configuration nodes and
+    defines a default configuration.
+
+
+4) '/images' node
+-----------------
+
+This node is a container node for component sub-image nodes. Each sub-node of
+the '/images' node should have the following layout:
+
+ o image@1
+   |- description = "component sub-image description"
+   |- data = /incbin/("path/to/data/file.bin")
+   |- type = "sub-image type name"
+   |- arch = "ARCH name"
+   |- os = "OS name"
+   |- compression = "compression name"
+   |- load = <00000000>
+   |- entry = <00000000>
+   |
+   o hash@1 {...}
+   o hash@2 {...}
+   ...
+
+  Mandatory properties:
+  - description : Textual description of the component sub-image
+  - type : Name of component sub-image type, supported types are:
+    "standalone", "kernel", "ramdisk", "firmware", "script", "filesystem",
+    "fdt".
+  - data : Path to the external file which contains this node's binary data.
+  - compression : Compression used by included data. Supported compressions
+    are "gzip" and "bzip2". If no compression is used compression property
+    should be set to "none".
+
+  Conditionally mandatory property:
+  - os : OS name, mandatory for type="kernel", valid OS names are: "openbsd",
+    "netbsd", "freebsd", "4_4bsd", "linux", "svr4", "esix", "solaris", "irix",
+    "sco", "dell", "ncr", "lynxos", "vxworks", "psos", "qnx", "u_boot",
+    "rtems", "artos", "unity".
+  - arch : Architecture name, mandatory for types: "standalone", "kernel",
+    "firmware", "ramdisk" and "fdt". Valid architecture names are: "alpha",
+    "arm", "i386", "ia64", "mips", "mips64", "ppc", "s390", "sh", "sparc",
+    "sparc64", "m68k", "nios", "microblaze", "nios2", "blackfin", "avr32",
+    "st200".
+  - entry : entry point address, address size is determined by
+    '#address-cells' property of the root node. Mandatory for for types:
+    "standalone" and "kernel".
+  - load : load address, address size is determined by '#address-cells'
+    property of the root node. Mandatory for types: "standalone" and "kernel".
+
+  Optional nodes:
+  - hash@1 : Each hash sub-node represents separate hash or checksum
+    calculated for node's data according to specified algorithm.
+
+
+5) Hash nodes
+-------------
+
+o hash@1
+  |- algo = "hash or checksum algorithm name"
+  |- value = [hash or checksum value]
+
+  Mandatory properties:
+  - algo : Algorithm name, supported are "crc32", "md5" and "sha1".
+  - value : Actual checksum or hash value, correspondingly 4, 16 or 20 bytes
+    long.
+
+
+6) '/configurations' node
+-------------------------
+
+The 'configurations' node is optional. If present, it allows to create a
+convenient, labeled boot configurations, which combine together kernel images
+with their ramdisks and fdt blobs.
+
+The 'configurations' node has has the following structure:
+
+o configurations
+  |- default = "default configuration sub-node unit name"
+  |
+  o config@1 {...}
+  o config@2 {...}
+  ...
+
+
+  Optional property:
+  - default : Selects one of the configuration sub-nodes as a default
+    configuration.
+
+  Mandatory nodes:
+  - configuration-sub-node-unit-name : At least one of the configuration
+    sub-nodes is required.
+
+
+7) Configuration nodes
+----------------------
+
+Each configuration has the following structure:
+
+o config@1
+  |- description = "configuration description"
+  |- kernel = "kernel sub-node unit name"
+  |- ramdisk = "ramdisk sub-node unit name"
+  |- fdt = "fdt sub-node unit-name"
+
+
+  Mandatory properties:
+  - description : Textual configuration description.
+  - kernel : Unit name of the corresponding kernel image (image sub-node of a
+    "kernel" type).
+
+  Optional properties:
+  - ramdisk : Unit name of the corresponding ramdisk image (component image
+    node of a "ramdisk" type).
+  - fdt : Unit name of the corresponding fdt blob (component image node of a
+    "fdt type").
+
+The FDT blob is required to properly boot FDT based kernel, so the minimal
+configuration for 2.6 FDT kernel is (kernel, fdt) pair.
+
+Older, 2.4 kernel and 2.6 non-FDT kernel do not use FDT blob, in such cases
+'struct bd_info' must be passed instead of FDT blob, thus fdt property *must
+not* be specified in a configuration node.
+
+
+8) Examples
+-----------
+
+Please see doc/uImage.FIT/*.its for actual image source files.
index e069969..dca3547 100644 (file)
@@ -27,6 +27,8 @@ LIB   := $(obj)libblock.a
 
 COBJS-y += ahci.o
 COBJS-y += ata_piix.o
+COBJS-$(CONFIG_FSL_SATA) += fsl_sata.o
+COBJS-$(CONFIG_LIBATA) += libata.o
 COBJS-y += sil680.o
 COBJS-y += sym53c8xx.o
 COBJS-y += systemace.o
index 42456d7..441a4dc 100644 (file)
  */
 
 #include <common.h>
+#include <asm/io.h>
 #include <pci.h>
 #include <command.h>
 #include <config.h>
 #include <asm/byteorder.h>
+#include <part.h>
 #include <ide.h>
 #include <ata.h>
 
 #ifdef CFG_ATA_PIIX            /*ata_piix driver */
 
+extern block_dev_desc_t sata_dev_desc[CFG_SATA_MAX_DEVICE];
+extern int curr_device;
+
 #define DEBUG_SATA 0           /*For debug prints set DEBUG_SATA to 1 */
 
+#define SATA_DECL
 #define DRV_DECL               /*For file specific declarations */
-#include <sata.h>
-#undef DRV_DECL
+#include "ata_piix.h"
 
 /*Macros realted to PCI*/
 #define PCI_SATA_BUS   0x00
@@ -142,19 +147,15 @@ sata_bus_probe (int port_no)
 }
 
 int
-init_sata (void)
+init_sata (int dev)
 {
+       static int done = 0;
        u8 i, rv = 0;
 
-       for (i = 0; i < CFG_SATA_MAXDEVICES; i++) {
-               sata_dev_desc[i].type = DEV_TYPE_UNKNOWN;
-               sata_dev_desc[i].if_type = IF_TYPE_IDE;
-               sata_dev_desc[i].dev = i;
-               sata_dev_desc[i].part_type = PART_TYPE_UNKNOWN;
-               sata_dev_desc[i].blksz = 0;
-               sata_dev_desc[i].lba = 0;
-               sata_dev_desc[i].block_read = sata_read;
-       }
+       if (!done)
+               done = 1;
+       else
+               return 0;
 
        rv = pci_sata_init ();
        if (rv == 1) {
@@ -205,12 +206,555 @@ init_sata (void)
                                dev_print (&sata_dev_desc[devno]);
                                /* initialize partition type */
                                init_part (&sata_dev_desc[devno]);
-                               if (curr_dev < 0)
-                                       curr_dev =
+                               if (curr_device < 0)
+                                       curr_device =
                                            i * CFG_SATA_DEVS_PER_BUS + j;
                        }
                }
        }
        return 0;
 }
+
+static u8 __inline__
+sata_inb (unsigned long ioaddr)
+{
+       return inb (ioaddr);
+}
+
+static void __inline__
+sata_outb (unsigned char val, unsigned long ioaddr)
+{
+       outb (val, ioaddr);
+}
+
+static void
+output_data (struct sata_ioports *ioaddr, ulong * sect_buf, int words)
+{
+       outsw (ioaddr->data_addr, sect_buf, words << 1);
+}
+
+static int
+input_data (struct sata_ioports *ioaddr, ulong * sect_buf, int words)
+{
+       insw (ioaddr->data_addr, sect_buf, words << 1);
+       return 0;
+}
+
+static void
+sata_cpy (unsigned char *dst, unsigned char *src, unsigned int len)
+{
+       unsigned char *end, *last;
+
+       last = dst;
+       end = src + len - 1;
+
+       /* reserve space for '\0' */
+       if (len < 2)
+               goto OUT;
+
+       /* skip leading white space */
+       while ((*src) && (src < end) && (*src == ' '))
+               ++src;
+
+       /* copy string, omitting trailing white space */
+       while ((*src) && (src < end)) {
+               *dst++ = *src;
+               if (*src++ != ' ')
+                       last = dst;
+       }
+      OUT:
+       *last = '\0';
+}
+
+int
+sata_bus_softreset (int num)
+{
+       u8 dev = 0, status = 0, i;
+
+       port[num].dev_mask = 0;
+
+       for (i = 0; i < CFG_SATA_DEVS_PER_BUS; i++) {
+               if (!(sata_devchk (&port[num].ioaddr, i))) {
+                       PRINTF ("dev_chk failed for dev#%d\n", i);
+               } else {
+                       port[num].dev_mask |= (1 << i);
+                       PRINTF ("dev_chk passed for dev#%d\n", i);
+               }
+       }
+
+       if (!(port[num].dev_mask)) {
+               printf ("no devices on port%d\n", num);
+               return 1;
+       }
+
+       dev_select (&port[num].ioaddr, dev);
+
+       port[num].ctl_reg = 0x08;       /*Default value of control reg */
+       sata_outb (port[num].ctl_reg, port[num].ioaddr.ctl_addr);
+       udelay (10);
+       sata_outb (port[num].ctl_reg | ATA_SRST, port[num].ioaddr.ctl_addr);
+       udelay (10);
+       sata_outb (port[num].ctl_reg, port[num].ioaddr.ctl_addr);
+
+       /* spec mandates ">= 2ms" before checking status.
+        * We wait 150ms, because that was the magic delay used for
+        * ATAPI devices in Hale Landis's ATADRVR, for the period of time
+        * between when the ATA command register is written, and then
+        * status is checked.  Because waiting for "a while" before
+        * checking status is fine, post SRST, we perform this magic
+        * delay here as well.
+        */
+       msleep (150);
+       status = sata_busy_wait (&port[num].ioaddr, ATA_BUSY, 300);
+       while ((status & ATA_BUSY)) {
+               msleep (100);
+               status = sata_busy_wait (&port[num].ioaddr, ATA_BUSY, 3);
+       }
+
+       if (status & ATA_BUSY)
+               printf ("ata%u is slow to respond,plz be patient\n", port);
+
+       while ((status & ATA_BUSY)) {
+               msleep (100);
+               status = sata_chk_status (&port[num].ioaddr);
+       }
+
+       if (status & ATA_BUSY) {
+               printf ("ata%u failed to respond : ", port);
+               printf ("bus reset failed\n");
+               return 1;
+       }
+       return 0;
+}
+
+void
+sata_identify (int num, int dev)
+{
+       u8 cmd = 0, status = 0, devno = num * CFG_SATA_DEVS_PER_BUS + dev;
+       u16 iobuf[ATA_SECT_SIZE];
+       u64 n_sectors = 0;
+       u8 mask = 0;
+
+       memset (iobuf, 0, sizeof (iobuf));
+       hd_driveid_t *iop = (hd_driveid_t *) iobuf;
+
+       if (dev == 0)
+               mask = 0x01;
+       else
+               mask = 0x02;
+
+       if (!(port[num].dev_mask & mask)) {
+               printf ("dev%d is not present on port#%d\n", dev, num);
+               return;
+       }
+
+       printf ("port=%d dev=%d\n", num, dev);
+
+       dev_select (&port[num].ioaddr, dev);
+
+       status = 0;
+       cmd = ATA_CMD_IDENT;    /*Device Identify Command */
+       sata_outb (cmd, port[num].ioaddr.command_addr);
+       sata_inb (port[num].ioaddr.altstatus_addr);
+       udelay (10);
+
+       status = sata_busy_wait (&port[num].ioaddr, ATA_BUSY, 1000);
+       if (status & ATA_ERR) {
+               printf ("\ndevice not responding\n");
+               port[num].dev_mask &= ~mask;
+               return;
+       }
+
+       input_data (&port[num].ioaddr, (ulong *) iobuf, ATA_SECTORWORDS);
+
+       PRINTF ("\nata%u: dev %u cfg 49:%04x 82:%04x 83:%04x 84:%04x85:%04x"
+               "86:%04x" "87:%04x 88:%04x\n", num, dev, iobuf[49],
+               iobuf[82], iobuf[83], iobuf[84], iobuf[85], iobuf[86],
+               iobuf[87], iobuf[88]);
+
+       /* we require LBA and DMA support (bits 8 & 9 of word 49) */
+       if (!ata_id_has_dma (iobuf) || !ata_id_has_lba (iobuf)) {
+               PRINTF ("ata%u: no dma/lba\n", num);
+       }
+       ata_dump_id (iobuf);
+
+       if (ata_id_has_lba48 (iobuf)) {
+               n_sectors = ata_id_u64 (iobuf, 100);
+       } else {
+               n_sectors = ata_id_u32 (iobuf, 60);
+       }
+       PRINTF ("no. of sectors %u\n", ata_id_u64 (iobuf, 100));
+       PRINTF ("no. of sectors %u\n", ata_id_u32 (iobuf, 60));
+
+       if (n_sectors == 0) {
+               port[num].dev_mask &= ~mask;
+               return;
+       }
+
+       sata_cpy (sata_dev_desc[devno].revision, iop->fw_rev,
+                 sizeof (sata_dev_desc[devno].revision));
+       sata_cpy (sata_dev_desc[devno].vendor, iop->model,
+                 sizeof (sata_dev_desc[devno].vendor));
+       sata_cpy (sata_dev_desc[devno].product, iop->serial_no,
+                 sizeof (sata_dev_desc[devno].product));
+       strswab (sata_dev_desc[devno].revision);
+       strswab (sata_dev_desc[devno].vendor);
+
+       if ((iop->config & 0x0080) == 0x0080) {
+               sata_dev_desc[devno].removable = 1;
+       } else {
+               sata_dev_desc[devno].removable = 0;
+       }
+
+       sata_dev_desc[devno].lba = iop->lba_capacity;
+       PRINTF ("lba=0x%x", sata_dev_desc[devno].lba);
+
+#ifdef CONFIG_LBA48
+       if (iop->command_set_2 & 0x0400) {
+               sata_dev_desc[devno].lba48 = 1;
+               lba = (unsigned long long) iop->lba48_capacity[0] |
+                   ((unsigned long long) iop->lba48_capacity[1] << 16) |
+                   ((unsigned long long) iop->lba48_capacity[2] << 32) |
+                   ((unsigned long long) iop->lba48_capacity[3] << 48);
+       } else {
+               sata_dev_desc[devno].lba48 = 0;
+       }
+#endif
+
+       /* assuming HD */
+       sata_dev_desc[devno].type = DEV_TYPE_HARDDISK;
+       sata_dev_desc[devno].blksz = ATA_BLOCKSIZE;
+       sata_dev_desc[devno].lun = 0;   /* just to fill something in... */
+}
+
+void
+set_Feature_cmd (int num, int dev)
+{
+       u8 mask = 0x00, status = 0;
+
+       if (dev == 0)
+               mask = 0x01;
+       else
+               mask = 0x02;
+
+       if (!(port[num].dev_mask & mask)) {
+               PRINTF ("dev%d is not present on port#%d\n", dev, num);
+               return;
+       }
+
+       dev_select (&port[num].ioaddr, dev);
+
+       sata_outb (SETFEATURES_XFER, port[num].ioaddr.feature_addr);
+       sata_outb (XFER_PIO_4, port[num].ioaddr.nsect_addr);
+       sata_outb (0, port[num].ioaddr.lbal_addr);
+       sata_outb (0, port[num].ioaddr.lbam_addr);
+       sata_outb (0, port[num].ioaddr.lbah_addr);
+
+       sata_outb (ATA_DEVICE_OBS, port[num].ioaddr.device_addr);
+       sata_outb (ATA_CMD_SETF, port[num].ioaddr.command_addr);
+
+       udelay (50);
+       msleep (150);
+
+       status = sata_busy_wait (&port[num].ioaddr, ATA_BUSY, 5000);
+       if ((status & (ATA_STAT_BUSY | ATA_STAT_ERR))) {
+               printf ("Error  : status 0x%02x\n", status);
+               port[num].dev_mask &= ~mask;
+       }
+}
+
+void
+sata_port (struct sata_ioports *ioport)
+{
+       ioport->data_addr = ioport->cmd_addr + ATA_REG_DATA;
+       ioport->error_addr = ioport->cmd_addr + ATA_REG_ERR;
+       ioport->feature_addr = ioport->cmd_addr + ATA_REG_FEATURE;
+       ioport->nsect_addr = ioport->cmd_addr + ATA_REG_NSECT;
+       ioport->lbal_addr = ioport->cmd_addr + ATA_REG_LBAL;
+       ioport->lbam_addr = ioport->cmd_addr + ATA_REG_LBAM;
+       ioport->lbah_addr = ioport->cmd_addr + ATA_REG_LBAH;
+       ioport->device_addr = ioport->cmd_addr + ATA_REG_DEVICE;
+       ioport->status_addr = ioport->cmd_addr + ATA_REG_STATUS;
+       ioport->command_addr = ioport->cmd_addr + ATA_REG_CMD;
+}
+
+int
+sata_devchk (struct sata_ioports *ioaddr, int dev)
+{
+       u8 nsect, lbal;
+
+       dev_select (ioaddr, dev);
+
+       sata_outb (0x55, ioaddr->nsect_addr);
+       sata_outb (0xaa, ioaddr->lbal_addr);
+
+       sata_outb (0xaa, ioaddr->nsect_addr);
+       sata_outb (0x55, ioaddr->lbal_addr);
+
+       sata_outb (0x55, ioaddr->nsect_addr);
+       sata_outb (0xaa, ioaddr->lbal_addr);
+
+       nsect = sata_inb (ioaddr->nsect_addr);
+       lbal = sata_inb (ioaddr->lbal_addr);
+
+       if ((nsect == 0x55) && (lbal == 0xaa))
+               return 1;       /* we found a device */
+       else
+               return 0;       /* nothing found */
+}
+
+void
+dev_select (struct sata_ioports *ioaddr, int dev)
+{
+       u8 tmp = 0;
+
+       if (dev == 0)
+               tmp = ATA_DEVICE_OBS;
+       else
+               tmp = ATA_DEVICE_OBS | ATA_DEV1;
+
+       sata_outb (tmp, ioaddr->device_addr);
+       sata_inb (ioaddr->altstatus_addr);
+       udelay (5);
+}
+
+u8
+sata_busy_wait (struct sata_ioports *ioaddr, int bits, unsigned int max)
+{
+       u8 status;
+
+       do {
+               udelay (1000);
+               status = sata_chk_status (ioaddr);
+               max--;
+       } while ((status & bits) && (max > 0));
+
+       return status;
+}
+
+u8
+sata_chk_status (struct sata_ioports * ioaddr)
+{
+       return sata_inb (ioaddr->status_addr);
+}
+
+void
+msleep (int count)
+{
+       int i;
+
+       for (i = 0; i < count; i++)
+               udelay (1000);
+}
+
+ulong
+sata_read (int device, ulong blknr,lbaint_t blkcnt, void * buff)
+{
+       ulong n = 0, *buffer = (ulong *)buff;
+       u8 dev = 0, num = 0, mask = 0, status = 0;
+
+#ifdef CONFIG_LBA48
+       unsigned char lba48 = 0;
+
+       if (blknr & 0x0000fffff0000000) {
+               if (!sata_dev_desc[devno].lba48) {
+                       printf ("Drive doesn't support 48-bit addressing\n");
+                       return 0;
+               }
+               /* more than 28 bits used, use 48bit mode */
+               lba48 = 1;
+       }
+#endif
+       /*Port Number */
+       num = device / CFG_SATA_DEVS_PER_BUS;
+       /*dev on the port */
+       if (device >= CFG_SATA_DEVS_PER_BUS)
+               dev = device - CFG_SATA_DEVS_PER_BUS;
+       else
+               dev = device;
+
+       if (dev == 0)
+               mask = 0x01;
+       else
+               mask = 0x02;
+
+       if (!(port[num].dev_mask & mask)) {
+               printf ("dev%d is not present on port#%d\n", dev, num);
+               return 0;
+       }
+
+       /* Select device */
+       dev_select (&port[num].ioaddr, dev);
+
+       status = sata_busy_wait (&port[num].ioaddr, ATA_BUSY, 500);
+       if (status & ATA_BUSY) {
+               printf ("ata%u failed to respond\n", port[num].port_no);
+               return n;
+       }
+       while (blkcnt-- > 0) {
+               status = sata_busy_wait (&port[num].ioaddr, ATA_BUSY, 500);
+               if (status & ATA_BUSY) {
+                       printf ("ata%u failed to respond\n", 0);
+                       return n;
+               }
+#ifdef CONFIG_LBA48
+               if (lba48) {
+                       /* write high bits */
+                       sata_outb (0, port[num].ioaddr.nsect_addr);
+                       sata_outb ((blknr >> 24) & 0xFF,
+                                  port[num].ioaddr.lbal_addr);
+                       sata_outb ((blknr >> 32) & 0xFF,
+                                  port[num].ioaddr.lbam_addr);
+                       sata_outb ((blknr >> 40) & 0xFF,
+                                  port[num].ioaddr.lbah_addr);
+               }
+#endif
+               sata_outb (1, port[num].ioaddr.nsect_addr);
+               sata_outb (((blknr) >> 0) & 0xFF,
+                          port[num].ioaddr.lbal_addr);
+               sata_outb ((blknr >> 8) & 0xFF, port[num].ioaddr.lbam_addr);
+               sata_outb ((blknr >> 16) & 0xFF, port[num].ioaddr.lbah_addr);
+
+#ifdef CONFIG_LBA48
+               if (lba48) {
+                       sata_outb (ATA_LBA, port[num].ioaddr.device_addr);
+                       sata_outb (ATA_CMD_READ_EXT,
+                                  port[num].ioaddr.command_addr);
+               } else
+#endif
+               {
+                       sata_outb (ATA_LBA | ((blknr >> 24) & 0xF),
+                                  port[num].ioaddr.device_addr);
+                       sata_outb (ATA_CMD_READ,
+                                  port[num].ioaddr.command_addr);
+               }
+
+               msleep (50);
+               /*may take up to 4 sec */
+               status = sata_busy_wait (&port[num].ioaddr, ATA_BUSY, 4000);
+
+               if ((status & (ATA_STAT_DRQ | ATA_STAT_BUSY | ATA_STAT_ERR))
+                   != ATA_STAT_DRQ) {
+                       u8 err = 0;
+
+                       printf ("Error no DRQ dev %d blk %ld: sts 0x%02x\n",
+                               device, (ulong) blknr, status);
+                       err = sata_inb (port[num].ioaddr.error_addr);
+                       printf ("Error reg = 0x%x\n", err);
+                       return (n);
+               }
+               input_data (&port[num].ioaddr, buffer, ATA_SECTORWORDS);
+               sata_inb (port[num].ioaddr.altstatus_addr);
+               udelay (50);
+
+               ++n;
+               ++blknr;
+               buffer += ATA_SECTORWORDS;
+       }
+       return n;
+}
+
+ulong
+sata_write (int device, ulong blknr,lbaint_t blkcnt, void * buff)
+{
+       ulong n = 0, *buffer = (ulong *)buff;
+       unsigned char status = 0, num = 0, dev = 0, mask = 0;
+
+#ifdef CONFIG_LBA48
+       unsigned char lba48 = 0;
+
+       if (blknr & 0x0000fffff0000000) {
+               if (!sata_dev_desc[devno].lba48) {
+                       printf ("Drive doesn't support 48-bit addressing\n");
+                       return 0;
+               }
+               /* more than 28 bits used, use 48bit mode */
+               lba48 = 1;
+       }
+#endif
+       /*Port Number */
+       num = device / CFG_SATA_DEVS_PER_BUS;
+       /*dev on the Port */
+       if (device >= CFG_SATA_DEVS_PER_BUS)
+               dev = device - CFG_SATA_DEVS_PER_BUS;
+       else
+               dev = device;
+
+       if (dev == 0)
+               mask = 0x01;
+       else
+               mask = 0x02;
+
+       /* Select device */
+       dev_select (&port[num].ioaddr, dev);
+
+       status = sata_busy_wait (&port[num].ioaddr, ATA_BUSY, 500);
+       if (status & ATA_BUSY) {
+               printf ("ata%u failed to respond\n", port[num].port_no);
+               return n;
+       }
+
+       while (blkcnt-- > 0) {
+               status = sata_busy_wait (&port[num].ioaddr, ATA_BUSY, 500);
+               if (status & ATA_BUSY) {
+                       printf ("ata%u failed to respond\n",
+                               port[num].port_no);
+                       return n;
+               }
+#ifdef CONFIG_LBA48
+               if (lba48) {
+                       /* write high bits */
+                       sata_outb (0, port[num].ioaddr.nsect_addr);
+                       sata_outb ((blknr >> 24) & 0xFF,
+                                  port[num].ioaddr.lbal_addr);
+                       sata_outb ((blknr >> 32) & 0xFF,
+                                  port[num].ioaddr.lbam_addr);
+                       sata_outb ((blknr >> 40) & 0xFF,
+                                  port[num].ioaddr.lbah_addr);
+               }
+#endif
+               sata_outb (1, port[num].ioaddr.nsect_addr);
+               sata_outb ((blknr >> 0) & 0xFF, port[num].ioaddr.lbal_addr);
+               sata_outb ((blknr >> 8) & 0xFF, port[num].ioaddr.lbam_addr);
+               sata_outb ((blknr >> 16) & 0xFF, port[num].ioaddr.lbah_addr);
+#ifdef CONFIG_LBA48
+               if (lba48) {
+                       sata_outb (ATA_LBA, port[num].ioaddr.device_addr);
+                       sata_outb (ATA_CMD_WRITE_EXT,
+                                  port[num].ioaddr.command_addr);
+               } else
+#endif
+               {
+                       sata_outb (ATA_LBA | ((blknr >> 24) & 0xF),
+                                  port[num].ioaddr.device_addr);
+                       sata_outb (ATA_CMD_WRITE,
+                                  port[num].ioaddr.command_addr);
+               }
+
+               msleep (50);
+               /*may take up to 4 sec */
+               status = sata_busy_wait (&port[num].ioaddr, ATA_BUSY, 4000);
+               if ((status & (ATA_STAT_DRQ | ATA_STAT_BUSY | ATA_STAT_ERR))
+                   != ATA_STAT_DRQ) {
+                       printf ("Error no DRQ dev %d blk %ld: sts 0x%02x\n",
+                               device, (ulong) blknr, status);
+                       return (n);
+               }
+
+               output_data (&port[num].ioaddr, buffer, ATA_SECTORWORDS);
+               sata_inb (port[num].ioaddr.altstatus_addr);
+               udelay (50);
+
+               ++n;
+               ++blknr;
+               buffer += ATA_SECTORWORDS;
+       }
+       return n;
+}
+
+int scan_sata(int dev)
+{
+       return 0;
+}
+
 #endif
diff --git a/drivers/block/ata_piix.h b/drivers/block/ata_piix.h
new file mode 100644 (file)
index 0000000..f9f0194
--- /dev/null
@@ -0,0 +1,94 @@
+#ifndef __ATA_PIIX_H__
+#define __ATA_PIIX_H__
+
+#if (DEBUG_SATA)
+#define PRINTF(fmt,args...)    printf (fmt ,##args)
+#else
+#define PRINTF(fmt,args...)
+#endif
+
+struct sata_ioports {
+       unsigned long cmd_addr;
+       unsigned long data_addr;
+       unsigned long error_addr;
+       unsigned long feature_addr;
+       unsigned long nsect_addr;
+       unsigned long lbal_addr;
+       unsigned long lbam_addr;
+       unsigned long lbah_addr;
+       unsigned long device_addr;
+       unsigned long status_addr;
+       unsigned long command_addr;
+       unsigned long altstatus_addr;
+       unsigned long ctl_addr;
+       unsigned long bmdma_addr;
+       unsigned long scr_addr;
+};
+
+struct sata_port {
+       unsigned char port_no;          /* primary=0, secondary=1       */
+       struct sata_ioports ioaddr;     /* ATA cmd/ctl/dma reg blks     */
+       unsigned char ctl_reg;
+       unsigned char last_ctl;
+       unsigned char port_state;       /* 1-port is available and      */
+                                       /* 0-port is not available      */
+       unsigned char dev_mask;
+};
+
+/***********SATA LIBRARY SPECIFIC DEFINITIONS AND DECLARATIONS**************/
+#ifdef SATA_DECL               /*SATA library specific declarations */
+#define ata_id_has_lba48(id)    ((id)[83] & (1 << 10))
+#define ata_id_has_lba(id)      ((id)[49] & (1 << 9))
+#define ata_id_has_dma(id)      ((id)[49] & (1 << 8))
+#define ata_id_u32(id,n)        \
+       (((u32) (id)[(n) + 1] << 16) | ((u32) (id)[(n)]))
+#define ata_id_u64(id,n)        \
+       (((u64) (id)[(n) + 3] << 48) | \
+       ((u64) (id)[(n) + 2] << 32) | \
+       ((u64) (id)[(n) + 1] << 16) | \
+       ((u64) (id)[(n) + 0]) )
+#endif
+
+#ifdef SATA_DECL               /*SATA library specific declarations */
+static inline void
+ata_dump_id (u16 * id)
+{
+       PRINTF ("49 = 0x%04x  "
+               "53 = 0x%04x  "
+               "63 = 0x%04x  "
+               "64 = 0x%04x  "
+               "75 = 0x%04x  \n", id[49], id[53], id[63], id[64], id[75]);
+       PRINTF ("80 = 0x%04x  "
+               "81 = 0x%04x  "
+               "82 = 0x%04x  "
+               "83 = 0x%04x  "
+               "84 = 0x%04x  \n", id[80], id[81], id[82], id[83], id[84]);
+       PRINTF ("88 = 0x%04x  " "93 = 0x%04x\n", id[88], id[93]);
+}
+#endif
+
+#ifdef SATA_DECL               /*SATA library specific declarations */
+int sata_bus_softreset (int num);
+void sata_identify (int num, int dev);
+void sata_port (struct sata_ioports *ioport);
+void set_Feature_cmd (int num, int dev);
+int sata_devchk (struct sata_ioports *ioaddr, int dev);
+void dev_select (struct sata_ioports *ioaddr, int dev);
+u8 sata_busy_wait (struct sata_ioports *ioaddr, int bits, unsigned int max);
+u8 sata_chk_status (struct sata_ioports *ioaddr);
+ulong sata_read (int device, ulong blknr,lbaint_t blkcnt, void * buffer);
+ulong sata_write (int device,ulong blknr, lbaint_t blkcnt, void * buffer);
+void msleep (int count);
+#endif
+
+/************DRIVER SPECIFIC DEFINITIONS AND DECLARATIONS**************/
+
+#ifdef DRV_DECL                        /*Driver specific declaration */
+int init_sata (int dev);
+#endif
+
+#ifdef DRV_DECL                        /*Defines Driver Specific variables */
+struct sata_port port[CFG_SATA_MAXBUS];
+#endif
+
+#endif /* __ATA_PIIX_H__ */
diff --git a/drivers/block/fsl_sata.c b/drivers/block/fsl_sata.c
new file mode 100644 (file)
index 0000000..d14f5bc
--- /dev/null
@@ -0,0 +1,916 @@
+/*
+ * Copyright (C) 2008 Freescale Semiconductor, Inc.
+ *             Dave Liu <daveliu@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 <command.h>
+#include <asm/io.h>
+#include <malloc.h>
+#include <libata.h>
+#include <fis.h>
+#include "fsl_sata.h"
+
+extern block_dev_desc_t sata_dev_desc[CFG_SATA_MAX_DEVICE];
+
+#ifndef CFG_SATA1_FLAGS
+       #define CFG_SATA1_FLAGS FLAGS_DMA
+#endif
+#ifndef CFG_SATA2_FLAGS
+       #define CFG_SATA2_FLAGS FLAGS_DMA
+#endif
+
+static struct fsl_sata_info fsl_sata_info[] = {
+#ifdef CONFIG_SATA1
+       {CFG_SATA1, CFG_SATA1_FLAGS},
+#else
+       {0, 0},
+#endif
+#ifdef CONFIG_SATA2
+       {CFG_SATA2, CFG_SATA2_FLAGS},
+#else
+       {0, 0},
+#endif
+};
+
+static inline void mdelay(unsigned long msec)
+{
+       unsigned long i;
+       for (i = 0; i < msec; i++)
+               udelay(1000);
+}
+
+static inline void sdelay(unsigned long sec)
+{
+       unsigned long i;
+       for (i = 0; i < sec; i++)
+               mdelay(1000);
+}
+
+void dprint_buffer(unsigned char *buf, int len)
+{
+       int i, j;
+
+       i = 0;
+       j = 0;
+       printf("\n\r");
+
+       for (i = 0; i < len; i++) {
+               printf("%02x ", *buf++);
+               j++;
+               if (j == 16) {
+                       printf("\n\r");
+                       j = 0;
+               }
+       }
+       printf("\n\r");
+}
+
+static void fsl_sata_dump_sfis(struct sfis *s)
+{
+       printf("Status FIS dump:\n\r");
+       printf("fis_type:               %02x\n\r", s->fis_type);
+       printf("pm_port_i:              %02x\n\r", s->pm_port_i);
+       printf("status:                 %02x\n\r", s->status);
+       printf("error:                  %02x\n\r", s->error);
+       printf("lba_low:                %02x\n\r", s->lba_low);
+       printf("lba_mid:                %02x\n\r", s->lba_mid);
+       printf("lba_high:               %02x\n\r", s->lba_high);
+       printf("device:                 %02x\n\r", s->device);
+       printf("lba_low_exp:            %02x\n\r", s->lba_low_exp);
+       printf("lba_mid_exp:            %02x\n\r", s->lba_mid_exp);
+       printf("lba_high_exp:           %02x\n\r", s->lba_high_exp);
+       printf("res1:                   %02x\n\r", s->res1);
+       printf("sector_count:           %02x\n\r", s->sector_count);
+       printf("sector_count_exp:       %02x\n\r", s->sector_count_exp);
+}
+
+static int ata_wait_register(volatile unsigned *addr, u32 mask,
+                        u32 val, u32 timeout_msec)
+{
+       int i;
+       u32 temp;
+
+       for (i = 0; (((temp = in_le32(addr)) & mask) != val)
+                        && i < timeout_msec; i++)
+               mdelay(1);
+       return (i < timeout_msec) ? 0 : -1;
+}
+
+int init_sata(int dev)
+{
+       u32 length, align;
+       cmd_hdr_tbl_t *cmd_hdr;
+       u32 cda;
+       u32 val32;
+       fsl_sata_reg_t *reg;
+       u32 sig;
+       int i;
+       fsl_sata_t *sata;
+
+       if (dev < 0 || dev > (CFG_SATA_MAX_DEVICE - 1)) {
+               printf("the sata index %d is out of ranges\n\r", dev);
+               return -1;
+       }
+
+       /* Allocate SATA device driver struct */
+       sata = (fsl_sata_t *)malloc(sizeof(fsl_sata_t));
+       if (!sata) {
+               printf("alloc the sata device struct failed\n\r");
+               return -1;
+       }
+       /* Zero all of the device driver struct */
+       memset((void *)sata, 0, sizeof(fsl_sata_t));
+
+       /* Save the private struct to block device struct */
+       sata_dev_desc[dev].priv = (void *)sata;
+
+       sprintf(sata->name, "SATA%d", dev);
+
+       /* Set the controller register base address to device struct */
+       reg = (fsl_sata_reg_t *)(fsl_sata_info[dev].sata_reg_base);
+       sata->reg_base = reg;
+
+       /* Allocate the command header table, 4 bytes aligned */
+       length = sizeof(struct cmd_hdr_tbl);
+       align = SATA_HC_CMD_HDR_TBL_ALIGN;
+       sata->cmd_hdr_tbl_offset = (void *)malloc(length + align);
+       if (!sata) {
+               printf("alloc the command header failed\n\r");
+               return -1;
+       }
+
+       cmd_hdr = (cmd_hdr_tbl_t *)(((u32)sata->cmd_hdr_tbl_offset + align)
+                                               & ~(align - 1));
+       sata->cmd_hdr = cmd_hdr;
+
+       /* Zero all of the command header table */
+       memset((void *)sata->cmd_hdr_tbl_offset, 0, length + align);
+
+       /* Allocate command descriptor for all command */
+       length = sizeof(struct cmd_desc) * SATA_HC_MAX_CMD;
+       align = SATA_HC_CMD_DESC_ALIGN;
+       sata->cmd_desc_offset = (void *)malloc(length + align);
+       if (!sata->cmd_desc_offset) {
+               printf("alloc the command descriptor failed\n\r");
+               return -1;
+       }
+       sata->cmd_desc = (cmd_desc_t *)(((u32)sata->cmd_desc_offset + align)
+                                               & ~(align - 1));
+       /* Zero all of command descriptor */
+       memset((void *)sata->cmd_desc_offset, 0, length + align);
+
+       /* Link the command descriptor to command header */
+       for (i = 0; i < SATA_HC_MAX_CMD; i++) {
+               cda = ((u32)sata->cmd_desc + SATA_HC_CMD_DESC_SIZE * i)
+                                        & ~(CMD_HDR_CDA_ALIGN - 1);
+               cmd_hdr->cmd_slot[i].cda = cpu_to_le32(cda);
+       }
+
+       /* To have safe state, force the controller offline */
+       val32 = in_le32(&reg->hcontrol);
+       val32 &= ~HCONTROL_ONOFF;
+       val32 |= HCONTROL_FORCE_OFFLINE;
+       out_le32(&reg->hcontrol, val32);
+
+       /* Wait the controller offline */
+       ata_wait_register(&reg->hstatus, HSTATUS_ONOFF, 0, 1000);
+
+       /* Set the command header base address to CHBA register to tell DMA */
+       out_le32(&reg->chba, (u32)cmd_hdr & ~0x3);
+
+       /* Snoop for the command header */
+       val32 = in_le32(&reg->hcontrol);
+       val32 |= HCONTROL_HDR_SNOOP;
+       out_le32(&reg->hcontrol, val32);
+
+       /* Disable all of interrupts */
+       val32 = in_le32(&reg->hcontrol);
+       val32 &= ~HCONTROL_INT_EN_ALL;
+       out_le32(&reg->hcontrol, val32);
+
+       /* Clear all of interrupts */
+       val32 = in_le32(&reg->hstatus);
+       out_le32(&reg->hstatus, val32);
+
+       /* Set the ICC, no interrupt coalescing */
+       out_le32(&reg->icc, 0x01000000);
+
+       /* No PM attatched, the SATA device direct connect */
+       out_le32(&reg->cqpmp, 0);
+
+       /* Clear SError register */
+       val32 = in_le32(&reg->serror);
+       out_le32(&reg->serror, val32);
+
+       /* Clear CER register */
+       val32 = in_le32(&reg->cer);
+       out_le32(&reg->cer, val32);
+
+       /* Clear DER register */
+       val32 = in_le32(&reg->der);
+       out_le32(&reg->der, val32);
+
+       /* No device detection or initialization action requested */
+       out_le32(&reg->scontrol, 0x00000300);
+
+       /* Configure the transport layer, default value */
+       out_le32(&reg->transcfg, 0x08000016);
+
+       /* Configure the link layer, default value */
+       out_le32(&reg->linkcfg, 0x0000ff34);
+
+       /* Bring the controller online */
+       val32 = in_le32(&reg->hcontrol);
+       val32 |= HCONTROL_ONOFF;
+       out_le32(&reg->hcontrol, val32);
+
+       mdelay(100);
+
+       /* print sata device name */
+       if (!dev)
+               printf("%s ", sata->name);
+       else
+               printf("       %s ", sata->name);
+
+       /* Check PHYRDY */
+       val32 = in_le32(&reg->hstatus);
+       if (val32 & HSTATUS_PHY_RDY) {
+               sata->link = 1;
+       } else {
+               sata->link = 0;
+               printf("(No RDY)\n\r");
+               return -1;
+       }
+
+       if (val32 & HSTATUS_SIGNATURE) {
+               sig = in_le32(&reg->sig);
+               debug("Signature updated, the sig =%08x\n\r", sig);
+               sata->ata_device_type = ata_dev_classify(sig);
+       }
+
+       /* Check the speed */
+       val32 = in_le32(&reg->sstatus);
+       if ((val32 & SSTATUS_SPD_MASK) == SSTATUS_SPD_GEN1)
+               printf("(1.5 Gbps)\n\r");
+       else if ((val32 & SSTATUS_SPD_MASK) == SSTATUS_SPD_GEN2)
+               printf("(3 Gbps)\n\r");
+
+       return 0;
+}
+
+/* Hardware reset, like Power-on and COMRESET */
+void fsl_sata_hardware_reset(u32 reg_base)
+{
+       fsl_sata_reg_t *reg = (fsl_sata_reg_t *)reg_base;
+       u32 scontrol;
+
+       /* Disable the SATA interface and put PHY offline */
+       scontrol = in_le32(&reg->scontrol);
+       scontrol = (scontrol & 0x0f0) | 0x304;
+       out_le32(&reg->scontrol, scontrol);
+
+       /* No speed strict */
+       scontrol = in_le32(&reg->scontrol);
+       scontrol = scontrol & ~0x0f0;
+       out_le32(&reg->scontrol, scontrol);
+
+       /* Issue PHY wake/reset, Hardware_reset_asserted */
+       scontrol = in_le32(&reg->scontrol);
+       scontrol = (scontrol & 0x0f0) | 0x301;
+       out_le32(&reg->scontrol, scontrol);
+
+       mdelay(100);
+
+       /* Resume PHY, COMRESET negated, the device initialize hardware
+        * and execute diagnostics, send good status-signature to host,
+        * which is D2H register FIS, and then the device enter idle state.
+        */
+       scontrol = in_le32(&reg->scontrol);
+       scontrol = (scontrol & 0x0f0) | 0x300;
+       out_le32(&reg->scontrol, scontrol);
+
+       mdelay(100);
+       return;
+}
+
+static void fsl_sata_dump_regs(fsl_sata_reg_t *reg)
+{
+       printf("\n\rSATA:           %08x\n\r", (u32)reg);
+       printf("CQR:            %08x\n\r", in_le32(&reg->cqr));
+       printf("CAR:            %08x\n\r", in_le32(&reg->car));
+       printf("CCR:            %08x\n\r", in_le32(&reg->ccr));
+       printf("CER:            %08x\n\r", in_le32(&reg->cer));
+       printf("CQR:            %08x\n\r", in_le32(&reg->cqr));
+       printf("DER:            %08x\n\r", in_le32(&reg->der));
+       printf("CHBA:           %08x\n\r", in_le32(&reg->chba));
+       printf("HStatus:        %08x\n\r", in_le32(&reg->hstatus));
+       printf("HControl:       %08x\n\r", in_le32(&reg->hcontrol));
+       printf("CQPMP:          %08x\n\r", in_le32(&reg->cqpmp));
+       printf("SIG:            %08x\n\r", in_le32(&reg->sig));
+       printf("ICC:            %08x\n\r", in_le32(&reg->icc));
+       printf("SStatus:        %08x\n\r", in_le32(&reg->sstatus));
+       printf("SError:         %08x\n\r", in_le32(&reg->serror));
+       printf("SControl:       %08x\n\r", in_le32(&reg->scontrol));
+       printf("SNotification:  %08x\n\r", in_le32(&reg->snotification));
+       printf("TransCfg:       %08x\n\r", in_le32(&reg->transcfg));
+       printf("TransStatus:    %08x\n\r", in_le32(&reg->transstatus));
+       printf("LinkCfg:        %08x\n\r", in_le32(&reg->linkcfg));
+       printf("LinkCfg1:       %08x\n\r", in_le32(&reg->linkcfg1));
+       printf("LinkCfg2:       %08x\n\r", in_le32(&reg->linkcfg2));
+       printf("LinkStatus:     %08x\n\r", in_le32(&reg->linkstatus));
+       printf("LinkStatus1:    %08x\n\r", in_le32(&reg->linkstatus1));
+       printf("PhyCtrlCfg:     %08x\n\r", in_le32(&reg->phyctrlcfg));
+       printf("SYSPR:          %08x\n\r", in_be32(&reg->syspr));
+}
+
+static int fsl_ata_exec_ata_cmd(struct fsl_sata *sata, struct cfis *cfis,
+                               int is_ncq, int tag, u8 *buffer, u32 len)
+{
+       cmd_hdr_entry_t *cmd_hdr;
+       cmd_desc_t *cmd_desc;
+       sata_fis_h2d_t *h2d;
+       prd_entry_t *prde;
+       u32 ext_c_ddc;
+       u32 prde_count;
+       u32 val32;
+       u32 ttl;
+       fsl_sata_reg_t *reg = sata->reg_base;
+       int i;
+
+       /* Check xfer length */
+       if (len > SATA_HC_MAX_XFER_LEN) {
+               printf("max transfer length is 64MB\n\r");
+               return 0;
+       }
+
+       /* Setup the command descriptor */
+       cmd_desc = sata->cmd_desc + tag;
+
+       /* Get the pointer cfis of command descriptor */
+       h2d = (sata_fis_h2d_t *)cmd_desc->cfis;
+
+       /* Zero the cfis of command descriptor */
+       memset((void *)h2d, 0, SATA_HC_CMD_DESC_CFIS_SIZE);
+
+       /* Copy the cfis from user to command descriptor */
+       h2d->fis_type = cfis->fis_type;
+       h2d->pm_port_c = cfis->pm_port_c;
+       h2d->command = cfis->command;
+
+       h2d->features = cfis->features;
+       h2d->features_exp = cfis->features_exp;
+
+       h2d->lba_low = cfis->lba_low;
+       h2d->lba_mid = cfis->lba_mid;
+       h2d->lba_high = cfis->lba_high;
+       h2d->lba_low_exp = cfis->lba_low_exp;
+       h2d->lba_mid_exp = cfis->lba_mid_exp;
+       h2d->lba_high_exp = cfis->lba_high_exp;
+
+       if (!is_ncq) {
+               h2d->sector_count = cfis->sector_count;
+               h2d->sector_count_exp = cfis->sector_count_exp;
+       } else { /* NCQ */
+               h2d->sector_count = (u8)(tag << 3);
+       }
+
+       h2d->device = cfis->device;
+       h2d->control = cfis->control;
+
+       /* Setup the PRD table */
+       prde = (prd_entry_t *)cmd_desc->prdt;
+       memset((void *)prde, 0, sizeof(struct prdt));
+
+       prde_count = 0;
+       ttl = len;
+       for (i = 0; i < SATA_HC_MAX_PRD_DIRECT; i++) {
+               if (!len)
+                       break;
+               prde->dba = cpu_to_le32((u32)buffer & ~0x3);
+               debug("dba = %08x\n\r", (u32)buffer);
+
+               if (len < PRD_ENTRY_MAX_XFER_SZ) {
+                       ext_c_ddc = PRD_ENTRY_DATA_SNOOP | len;
+                       debug("ext_c_ddc1 = %08x, len = %08x\n\r", ext_c_ddc, len);
+                       prde->ext_c_ddc = cpu_to_le32(ext_c_ddc);
+                       prde_count++;
+                       prde++;
+                       break;
+               } else {
+                       ext_c_ddc = PRD_ENTRY_DATA_SNOOP; /* 4M bytes */
+                       debug("ext_c_ddc2 = %08x, len = %08x\n\r", ext_c_ddc, len);
+                       prde->ext_c_ddc = cpu_to_le32(ext_c_ddc);
+                       buffer += PRD_ENTRY_MAX_XFER_SZ;
+                       len -= PRD_ENTRY_MAX_XFER_SZ;
+                       prde_count++;
+                       prde++;
+               }
+       }
+
+       /* Setup the command slot of cmd hdr */
+       cmd_hdr = (cmd_hdr_entry_t *)&sata->cmd_hdr->cmd_slot[tag];
+
+       cmd_hdr->cda = cpu_to_le32((u32)cmd_desc & ~0x3);
+
+       val32 = prde_count << CMD_HDR_PRD_ENTRY_SHIFT;
+       val32 |= sizeof(sata_fis_h2d_t);
+       cmd_hdr->prde_fis_len = cpu_to_le32(val32);
+
+       cmd_hdr->ttl = cpu_to_le32(ttl);
+
+       if (!is_ncq) {
+               val32 = CMD_HDR_ATTR_RES | CMD_HDR_ATTR_SNOOP;
+       } else {
+               val32 = CMD_HDR_ATTR_RES | CMD_HDR_ATTR_SNOOP | CMD_HDR_ATTR_FPDMA;
+       }
+
+       tag &= CMD_HDR_ATTR_TAG;
+       val32 |= tag;
+
+       debug("attribute = %08x\n\r", val32);
+       cmd_hdr->attribute = cpu_to_le32(val32);
+
+       /* Make sure cmd desc and cmd slot valid before commmand issue */
+       sync();
+
+       /* PMP*/
+       val32 = (u32)(h2d->pm_port_c & 0x0f);
+       out_le32(&reg->cqpmp, val32);
+
+       /* Wait no active */
+       if (ata_wait_register(&reg->car, (1 << tag), 0, 10000))
+               printf("Wait no active time out\n\r");
+
+       /* Issue command */
+       if (!(in_le32(&reg->cqr) & (1 << tag))) {
+               val32 = 1 << tag;
+               out_le32(&reg->cqr, val32);
+       }
+
+       /* Wait command completed for 10s */
+       if (ata_wait_register(&reg->ccr, (1 << tag), (1 << tag), 10000)) {
+               if (!is_ncq)
+                       printf("Non-NCQ command time out\n\r");
+               else
+                       printf("NCQ command time out\n\r");
+       }
+
+       val32 = in_le32(&reg->cer);
+
+       if (val32) {
+               u32 der;
+               fsl_sata_dump_sfis((struct sfis *)cmd_desc->sfis);
+               printf("CE at device\n\r");
+               fsl_sata_dump_regs(reg);
+               der = in_le32(&reg->der);
+               out_le32(&reg->cer, val32);
+               out_le32(&reg->der, der);
+       }
+
+       /* Clear complete flags */
+       val32 = in_le32(&reg->ccr);
+       out_le32(&reg->ccr, val32);
+
+       return len;
+}
+
+static int fsl_ata_exec_reset_cmd(struct fsl_sata *sata, struct cfis *cfis,
+                                int tag, u8 *buffer, u32 len)
+{
+       return 0;
+}
+
+static int fsl_sata_exec_cmd(struct fsl_sata *sata, struct cfis *cfis,
+                enum cmd_type command_type, int tag, u8 *buffer, u32 len)
+{
+       int rc;
+
+       if (tag > SATA_HC_MAX_CMD || tag < 0) {
+               printf("tag is out of range, tag=\n\r", tag);
+               return -1;
+       }
+
+       switch (command_type) {
+       case CMD_ATA:
+               rc = fsl_ata_exec_ata_cmd(sata, cfis, 0, tag, buffer, len);
+               return rc;
+       case CMD_RESET:
+               rc = fsl_ata_exec_reset_cmd(sata, cfis, tag, buffer, len);
+               return rc;
+       case CMD_NCQ:
+               rc = fsl_ata_exec_ata_cmd(sata, cfis, 1, tag, buffer, len);
+               return rc;
+       case CMD_ATAPI:
+       case CMD_VENDOR_BIST:
+       case CMD_BIST:
+               printf("not support now\n\r");
+               return -1;
+       default:
+               break;
+       }
+
+       return -1;
+}
+
+static void fsl_sata_identify(int dev, u16 *id)
+{
+       fsl_sata_t *sata = (fsl_sata_t *)sata_dev_desc[dev].priv;
+       struct sata_fis_h2d h2d;
+       struct cfis *cfis;
+
+       cfis = (struct cfis *)&h2d;
+       memset((void *)cfis, 0, sizeof(struct cfis));
+
+       cfis->fis_type = SATA_FIS_TYPE_REGISTER_H2D;
+       cfis->pm_port_c = 0x80; /* is command */
+       cfis->command = ATA_CMD_ID_ATA;
+
+       fsl_sata_exec_cmd(sata, cfis, CMD_ATA, 0, (u8 *)id, ATA_ID_WORDS * 2);
+       ata_swap_buf_le16(id, ATA_ID_WORDS);
+}
+
+static void fsl_sata_xfer_mode(int dev, u16 *id)
+{
+       fsl_sata_t *sata = (fsl_sata_t *)sata_dev_desc[dev].priv;
+
+       sata->pio = id[ATA_ID_PIO_MODES];
+       sata->mwdma = id[ATA_ID_MWDMA_MODES];
+       sata->udma = id[ATA_ID_UDMA_MODES];
+       debug("pio %04x, mwdma %04x, udma %04x\n\r", sata->pio, sata->mwdma, sata->udma);
+}
+
+static void fsl_sata_set_features(int dev)
+{
+       fsl_sata_t *sata = (fsl_sata_t *)sata_dev_desc[dev].priv;
+       struct sata_fis_h2d h2d;
+       struct cfis *cfis;
+       u8 udma_cap;
+
+       cfis = (struct cfis *)&h2d;
+       memset((void *)cfis, 0, sizeof(struct cfis));
+
+       cfis->fis_type = SATA_FIS_TYPE_REGISTER_H2D;
+       cfis->pm_port_c = 0x80; /* is command */
+       cfis->command = ATA_CMD_SET_FEATURES;
+       cfis->features = SETFEATURES_XFER;
+
+       /* First check the device capablity */
+       udma_cap = (u8)(sata->udma & 0xff);
+       debug("udma_cap %02x\n\r", udma_cap);
+
+       if (udma_cap == ATA_UDMA6)
+               cfis->sector_count = XFER_UDMA_6;
+       if (udma_cap == ATA_UDMA5)
+               cfis->sector_count = XFER_UDMA_5;
+       if (udma_cap == ATA_UDMA4)
+               cfis->sector_count = XFER_UDMA_4;
+       if (udma_cap == ATA_UDMA3)
+               cfis->sector_count = XFER_UDMA_3;
+
+       fsl_sata_exec_cmd(sata, cfis, CMD_ATA, 0, NULL, 0);
+}
+
+static u32 fsl_sata_rw_cmd(int dev, u32 start, u32 blkcnt, u8 *buffer, int is_write)
+{
+       fsl_sata_t *sata = (fsl_sata_t *)sata_dev_desc[dev].priv;
+       struct sata_fis_h2d h2d;
+       struct cfis *cfis;
+       u32 block;
+
+       block = start;
+       cfis = (struct cfis *)&h2d;
+
+       memset((void *)cfis, 0, sizeof(struct cfis));
+
+       cfis->fis_type = SATA_FIS_TYPE_REGISTER_H2D;
+       cfis->pm_port_c = 0x80; /* is command */
+       cfis->command = (is_write) ? ATA_CMD_WRITE : ATA_CMD_READ;
+       cfis->device = ATA_LBA;
+
+       cfis->device |= (block >> 24) & 0xf;
+       cfis->lba_high = (block >> 16) & 0xff;
+       cfis->lba_mid = (block >> 8) & 0xff;
+       cfis->lba_low = block & 0xff;
+       cfis->sector_count = (u8)(blkcnt & 0xff);
+
+       fsl_sata_exec_cmd(sata, cfis, CMD_ATA, 0, buffer, ATA_SECT_SIZE * blkcnt);
+       return blkcnt;
+}
+
+void fsl_sata_flush_cache(int dev)
+{
+       fsl_sata_t *sata = (fsl_sata_t *)sata_dev_desc[dev].priv;
+       struct sata_fis_h2d h2d;
+       struct cfis *cfis;
+
+       cfis = (struct cfis *)&h2d;
+
+       memset((void *)cfis, 0, sizeof(struct cfis));
+
+       cfis->fis_type = SATA_FIS_TYPE_REGISTER_H2D;
+       cfis->pm_port_c = 0x80; /* is command */
+       cfis->command = ATA_CMD_FLUSH;
+
+       fsl_sata_exec_cmd(sata, cfis, CMD_ATA, 0, NULL, 0);
+}
+
+static u32 fsl_sata_rw_cmd_ext(int dev, u32 start, u32 blkcnt, u8 *buffer, int is_write)
+{
+       fsl_sata_t *sata = (fsl_sata_t *)sata_dev_desc[dev].priv;
+       struct sata_fis_h2d h2d;
+       struct cfis *cfis;
+       u64 block;
+
+       block = (u64)start;
+       cfis = (struct cfis *)&h2d;
+
+       memset((void *)cfis, 0, sizeof(struct cfis));
+
+       cfis->fis_type = SATA_FIS_TYPE_REGISTER_H2D;
+       cfis->pm_port_c = 0x80; /* is command */
+
+       cfis->command = (is_write) ? ATA_CMD_WRITE_EXT
+                                : ATA_CMD_READ_EXT;
+
+       cfis->lba_high_exp = (block >> 40) & 0xff;
+       cfis->lba_mid_exp = (block >> 32) & 0xff;
+       cfis->lba_low_exp = (block >> 24) & 0xff;
+       cfis->lba_high = (block >> 16) & 0xff;
+       cfis->lba_mid = (block >> 8) & 0xff;
+       cfis->lba_low = block & 0xff;
+       cfis->device = ATA_LBA;
+       cfis->sector_count_exp = (blkcnt >> 8) & 0xff;
+       cfis->sector_count = blkcnt & 0xff;
+
+       fsl_sata_exec_cmd(sata, cfis, CMD_ATA, 0, buffer, ATA_SECT_SIZE * blkcnt);
+       return blkcnt;
+}
+
+u32 fsl_sata_rw_ncq_cmd(int dev, u32 start, u32 blkcnt, u8 *buffer, int is_write)
+{
+       fsl_sata_t *sata = (fsl_sata_t *)sata_dev_desc[dev].priv;
+       struct sata_fis_h2d h2d;
+       struct cfis *cfis;
+       int ncq_channel;
+       u64 block;
+
+       if (sata_dev_desc[dev].lba48 != 1) {
+               printf("execute FPDMA command on non-LBA48 hard disk\n\r");
+               return -1;
+       }
+
+       block = (u64)start;
+       cfis = (struct cfis *)&h2d;
+
+       memset((void *)cfis, 0, sizeof(struct cfis));
+
+       cfis->fis_type = SATA_FIS_TYPE_REGISTER_H2D;
+       cfis->pm_port_c = 0x80; /* is command */
+
+       cfis->command = (is_write) ? ATA_CMD_FPDMA_WRITE
+                                : ATA_CMD_FPDMA_READ;
+
+       cfis->lba_high_exp = (block >> 40) & 0xff;
+       cfis->lba_mid_exp = (block >> 32) & 0xff;
+       cfis->lba_low_exp = (block >> 24) & 0xff;
+       cfis->lba_high = (block >> 16) & 0xff;
+       cfis->lba_mid = (block >> 8) & 0xff;
+       cfis->lba_low = block & 0xff;
+
+       cfis->device = ATA_LBA;
+       cfis->features_exp = (blkcnt >> 8) & 0xff;
+       cfis->features = blkcnt & 0xff;
+
+       if (sata->queue_depth >= SATA_HC_MAX_CMD)
+               ncq_channel = SATA_HC_MAX_CMD - 1;
+       else
+               ncq_channel = sata->queue_depth - 1;
+
+       /* Use the latest queue */
+       fsl_sata_exec_cmd(sata, cfis, CMD_NCQ, ncq_channel, buffer, ATA_SECT_SIZE * blkcnt);
+       return blkcnt;
+}
+
+void fsl_sata_flush_cache_ext(int dev)
+{
+       fsl_sata_t *sata = (fsl_sata_t *)sata_dev_desc[dev].priv;
+       struct sata_fis_h2d h2d;
+       struct cfis *cfis;
+
+       cfis = (struct cfis *)&h2d;
+
+       memset((void *)cfis, 0, sizeof(struct cfis));
+
+       cfis->fis_type = SATA_FIS_TYPE_REGISTER_H2D;
+       cfis->pm_port_c = 0x80; /* is command */
+       cfis->command = ATA_CMD_FLUSH_EXT;
+
+       fsl_sata_exec_cmd(sata, cfis, CMD_ATA, 0, NULL, 0);
+}
+
+/* Software reset, set SRST of the Device Control register */
+void fsl_sata_software_reset(int dev)
+{
+       return;
+}
+
+static void fsl_sata_init_wcache(int dev, u16 *id)
+{
+       fsl_sata_t *sata = (fsl_sata_t *)sata_dev_desc[dev].priv;
+
+       if (ata_id_has_wcache(id) && ata_id_wcache_enabled(id))
+               sata->wcache = 1;
+       if (ata_id_has_flush(id))
+               sata->flush = 1;
+       if (ata_id_has_flush_ext(id))
+               sata->flush_ext = 1;
+}
+
+static int fsl_sata_get_wcache(int dev)
+{
+       fsl_sata_t *sata = (fsl_sata_t *)sata_dev_desc[dev].priv;
+       return sata->wcache;
+}
+
+static int fsl_sata_get_flush(int dev)
+{
+       fsl_sata_t *sata = (fsl_sata_t *)sata_dev_desc[dev].priv;
+       return sata->flush;
+}
+
+static int fsl_sata_get_flush_ext(int dev)
+{
+       fsl_sata_t *sata = (fsl_sata_t *)sata_dev_desc[dev].priv;
+       return sata->flush_ext;
+}
+
+u32 ata_low_level_rw_lba48(int dev, u32 blknr, u32 blkcnt, void *buffer, int is_write)
+{
+       u32 start, blks;
+       u8 *addr;
+       int max_blks;
+
+       start = blknr;
+       blks = blkcnt;
+       addr = (u8 *)buffer;
+
+       max_blks = ATA_MAX_SECTORS_LBA48;
+       do {
+               if (blks > max_blks) {
+                       if (fsl_sata_info[dev].flags != FLAGS_FPDMA)
+                               fsl_sata_rw_cmd_ext(dev, start, max_blks, addr, is_write);
+                       else
+                               fsl_sata_rw_ncq_cmd(dev, start, max_blks, addr, is_write);
+                       start += max_blks;
+                       blks -= max_blks;
+                       addr += ATA_SECT_SIZE * max_blks;
+               } else {
+                       if (fsl_sata_info[dev].flags != FLAGS_FPDMA)
+                               fsl_sata_rw_cmd_ext(dev, start, blks, addr, is_write);
+                       else
+                               fsl_sata_rw_ncq_cmd(dev, start, blks, addr, is_write);
+                       start += blks;
+                       blks = 0;
+                       addr += ATA_SECT_SIZE * blks;
+               }
+       } while (blks != 0);
+
+       return blkcnt;
+}
+
+u32 ata_low_level_rw_lba28(int dev, u32 blknr, u32 blkcnt, void *buffer, int is_write)
+{
+       u32 start, blks;
+       u8 *addr;
+       int max_blks;
+
+       start = blknr;
+       blks = blkcnt;
+       addr = (u8 *)buffer;
+
+       max_blks = ATA_MAX_SECTORS;
+       do {
+               if (blks > max_blks) {
+                       fsl_sata_rw_cmd(dev, start, max_blks, addr, is_write);
+                       start += max_blks;
+                       blks -= max_blks;
+                       addr += ATA_SECT_SIZE * max_blks;
+               } else {
+                       fsl_sata_rw_cmd(dev, start, blks, addr, is_write);
+                       start += blks;
+                       blks = 0;
+                       addr += ATA_SECT_SIZE * blks;
+               }
+       } while (blks != 0);
+
+       return blkcnt;
+}
+
+/*
+ * SATA interface between low level driver and command layer
+ */
+ulong sata_read(int dev, u32 blknr, u32 blkcnt, void *buffer)
+{
+       u32 rc;
+
+       if (sata_dev_desc[dev].lba48)
+               rc = ata_low_level_rw_lba48(dev, blknr, blkcnt, buffer, READ_CMD);
+       else
+               rc = ata_low_level_rw_lba28(dev, blknr, blkcnt, buffer, READ_CMD);
+       return rc;
+}
+
+ulong sata_write(int dev, u32 blknr, u32 blkcnt, void *buffer)
+{
+       u32 rc;
+
+       if (sata_dev_desc[dev].lba48) {
+               rc = ata_low_level_rw_lba48(dev, blknr, blkcnt, buffer, WRITE_CMD);
+               if (fsl_sata_get_wcache(dev) && fsl_sata_get_flush_ext(dev))
+                       fsl_sata_flush_cache_ext(dev);
+       } else {
+               rc = ata_low_level_rw_lba28(dev, blknr, blkcnt, buffer, WRITE_CMD);
+               if (fsl_sata_get_wcache(dev) && fsl_sata_get_flush(dev))
+                       fsl_sata_flush_cache(dev);
+       }
+       return rc;
+}
+
+int scan_sata(int dev)
+{
+       fsl_sata_t *sata = (fsl_sata_t *)sata_dev_desc[dev].priv;
+       unsigned char serial[ATA_ID_SERNO_LEN + 1];
+       unsigned char firmware[ATA_ID_FW_REV_LEN + 1];
+       unsigned char product[ATA_ID_PROD_LEN + 1];
+       u16 *id;
+       u64 n_sectors;
+
+       /* if no detected link */
+       if (!sata->link)
+               return -1;
+
+       id = (u16 *)malloc(ATA_ID_WORDS * 2);
+       if (!id) {
+               printf("id malloc failed\n\r");
+               return -1;
+       }
+
+       /* Identify device to get information */
+       fsl_sata_identify(dev, id);
+
+       /* Serial number */
+       ata_id_c_string(id, serial, ATA_ID_SERNO, sizeof(serial));
+       memcpy(sata_dev_desc[dev].product, serial, sizeof(serial));
+
+       /* Firmware version */
+       ata_id_c_string(id, firmware, ATA_ID_FW_REV, sizeof(firmware));
+       memcpy(sata_dev_desc[dev].revision, firmware, sizeof(firmware));
+
+       /* Product model */
+       ata_id_c_string(id, product, ATA_ID_PROD, sizeof(product));
+       memcpy(sata_dev_desc[dev].vendor, product, sizeof(product));
+
+       /* Totoal sectors */
+       n_sectors = ata_id_n_sectors(id);
+       sata_dev_desc[dev].lba = (u32)n_sectors;
+
+       /* Check if support LBA48 */
+       if (ata_id_has_lba48(id)) {
+               sata_dev_desc[dev].lba48 = 1;
+               debug("Device support LBA48\n\r");
+       }
+
+       /* Get the NCQ queue depth from device */
+       sata->queue_depth = ata_id_queue_depth(id);
+
+       /* Get the xfer mode from device */
+       fsl_sata_xfer_mode(dev, id);
+
+       /* Get the write cache status from device */
+       fsl_sata_init_wcache(dev, id);
+
+       /* Set the xfer mode to highest speed */
+       fsl_sata_set_features(dev);
+#ifdef DEBUG
+       fsl_sata_identify(dev, id);
+       ata_dump_id(id);
+#endif
+       free((void *)id);
+       return 0;
+}
diff --git a/drivers/block/fsl_sata.h b/drivers/block/fsl_sata.h
new file mode 100644 (file)
index 0000000..874c0dc
--- /dev/null
@@ -0,0 +1,374 @@
+/*
+ * Copyright (C) 2007-2008 Freescale Semiconductor, Inc.
+ *             Dave Liu <daveliu@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_SATA_H__
+#define __FSL_SATA_H__
+
+#define SATA_HC_MAX_NUM                4 /* Max host controller numbers */
+#define SATA_HC_MAX_CMD                16 /* Max command queue depth per host controller */
+#define SATA_HC_MAX_PORT       16 /* Max port number per host controller */
+
+/*
+* SATA Host Controller Registers
+*/
+typedef struct fsl_sata_reg {
+       /* SATA command registers */
+       u32 cqr;                /* Command queue register */
+       u8 res1[0x4];
+       u32 car;                /* Command active register */
+       u8 res2[0x4];
+       u32 ccr;                /* Command completed register */
+       u8 res3[0x4];
+       u32 cer;                /* Command error register */
+       u8 res4[0x4];
+       u32 der;                /* Device error register */
+       u32 chba;               /* Command header base address */
+       u32 hstatus;            /* Host status register */
+       u32 hcontrol;           /* Host control register */
+       u32 cqpmp;              /* Port number queue register */
+       u32 sig;                /* Signature register */
+       u32 icc;                /* Interrupt coalescing control register */
+       u8 res5[0xc4];
+
+       /* SATA supperset registers */
+       u32 sstatus;            /* SATA interface status register */
+       u32 serror;             /* SATA interface error register */
+       u32 scontrol;           /* SATA interface control register */
+       u32 snotification;      /* SATA interface notification register */
+       u8 res6[0x30];
+
+       /* SATA control status registers */
+       u32 transcfg;           /* Transport layer configuration */
+       u32 transstatus;        /* Transport layer status */
+       u32 linkcfg;            /* Link layer configuration */
+       u32 linkcfg1;           /* Link layer configuration1 */
+       u32 linkcfg2;           /* Link layer configuration2 */
+       u32 linkstatus;         /* Link layer status */
+       u32 linkstatus1;        /* Link layer status1 */
+       u32 phyctrlcfg;         /* PHY control configuration */
+       u8 res7[0x2b0];
+
+       /* SATA system control registers */
+       u32 syspr;              /* System priority register - big endian */
+       u8 res8[0xbec];
+} __attribute__ ((packed)) fsl_sata_reg_t;
+
+/* HStatus register
+*/
+#define HSTATUS_ONOFF                  0x80000000 /* Online/offline status */
+#define HSTATUS_FORCE_OFFLINE          0x40000000 /* In process going offline */
+#define HSTATUS_BIST_ERR               0x20000000
+
+/* Fatal error */
+#define HSTATUS_MASTER_ERR             0x00004000
+#define HSTATUS_DATA_UNDERRUN          0x00002000
+#define HSTATUS_DATA_OVERRUN           0x00001000
+#define HSTATUS_CRC_ERR_TX             0x00000800
+#define HSTATUS_CRC_ERR_RX             0x00000400
+#define HSTATUS_FIFO_OVERFLOW_TX       0x00000200
+#define HSTATUS_FIFO_OVERFLOW_RX       0x00000100
+#define HSTATUS_FATAL_ERR_ALL          (HSTATUS_MASTER_ERR | \
+                                       HSTATUS_DATA_UNDERRUN | \
+                                       HSTATUS_DATA_OVERRUN | \
+                                       HSTATUS_CRC_ERR_TX | \
+                                       HSTATUS_CRC_ERR_RX | \
+                                       HSTATUS_FIFO_OVERFLOW_TX | \
+                                       HSTATUS_FIFO_OVERFLOW_RX)
+/* Interrupt status */
+#define HSTATUS_FATAL_ERR              0x00000020
+#define HSTATUS_PHY_RDY                        0x00000010
+#define HSTATUS_SIGNATURE              0x00000008
+#define HSTATUS_SNOTIFY                        0x00000004
+#define HSTATUS_DEVICE_ERR             0x00000002
+#define HSTATUS_CMD_COMPLETE           0x00000001
+
+/* HControl register
+*/
+#define HCONTROL_ONOFF                 0x80000000 /* Online or offline request */
+#define HCONTROL_FORCE_OFFLINE         0x40000000 /* Force offline request */
+#define HCONTROL_HDR_SNOOP             0x00000400 /* Command header snoop */
+#define HCONTROL_PMP_ATTACHED          0x00000200 /* Port multiplier attached */
+
+/* Interrupt enable */
+#define HCONTROL_FATAL_ERR             0x00000020
+#define HCONTROL_PHY_RDY               0x00000010
+#define HCONTROL_SIGNATURE             0x00000008
+#define HCONTROL_SNOTIFY               0x00000004
+#define HCONTROL_DEVICE_ERR            0x00000002
+#define HCONTROL_CMD_COMPLETE          0x00000001
+
+#define HCONTROL_INT_EN_ALL            (HCONTROL_FATAL_ERR | \
+                                       HCONTROL_PHY_RDY | \
+                                       HCONTROL_SIGNATURE | \
+                                       HCONTROL_SNOTIFY | \
+                                       HCONTROL_DEVICE_ERR | \
+                                       HCONTROL_CMD_COMPLETE)
+
+/* SStatus register
+*/
+#define SSTATUS_IPM_MASK               0x00000780
+#define SSTATUS_IPM_NOPRESENT          0x00000000
+#define SSTATUS_IPM_ACTIVE             0x00000080
+#define SSTATUS_IPM_PATIAL             0x00000100
+#define SSTATUS_IPM_SLUMBER            0x00000300
+
+#define SSTATUS_SPD_MASK               0x000000f0
+#define SSTATUS_SPD_GEN1               0x00000010
+#define SSTATUS_SPD_GEN2               0x00000020
+
+#define SSTATUS_DET_MASK               0x0000000f
+#define SSTATUS_DET_NODEVICE           0x00000000
+#define SSTATUS_DET_DISCONNECT         0x00000001
+#define SSTATUS_DET_CONNECT            0x00000003
+#define SSTATUS_DET_PHY_OFFLINE                0x00000004
+
+/* SControl register
+*/
+#define SCONTROL_SPM_MASK              0x0000f000
+#define SCONTROL_SPM_GO_PARTIAL                0x00001000
+#define SCONTROL_SPM_GO_SLUMBER                0x00002000
+#define SCONTROL_SPM_GO_ACTIVE         0x00004000
+
+#define SCONTROL_IPM_MASK              0x00000f00
+#define SCONTROL_IPM_NO_RESTRICT       0x00000000
+#define SCONTROL_IPM_PARTIAL           0x00000100
+#define SCONTROL_IPM_SLUMBER           0x00000200
+#define SCONTROL_IPM_PART_SLUM         0x00000300
+
+#define SCONTROL_SPD_MASK              0x000000f0
+#define SCONTROL_SPD_NO_RESTRICT       0x00000000
+#define SCONTROL_SPD_GEN1              0x00000010
+#define SCONTROL_SPD_GEN2              0x00000020
+
+#define SCONTROL_DET_MASK              0x0000000f
+#define SCONTROL_DET_HRESET            0x00000001
+#define SCONTROL_DET_DISABLE           0x00000004
+
+/* TransCfg register
+*/
+#define TRANSCFG_DFIS_SIZE_SHIFT       16
+#define TRANSCFG_RX_WATER_MARK_MASK    0x0000001f
+
+/* PhyCtrlCfg register
+*/
+#define PHYCTRLCFG_FPRFTI_MASK         0x00000018
+#define PHYCTRLCFG_LOOPBACK_MASK       0x0000000e
+
+/*
+* Command Header Entry
+*/
+typedef struct cmd_hdr_entry {
+       u32 cda;                /* Command Descriptor Address, 4 bytes aligned */
+       u32 prde_fis_len;       /* Number of PRD entries and FIS length */
+       u32 ttl;                /* Total transfer length */
+       u32 attribute;          /* the attribute of command */
+} __attribute__ ((packed)) cmd_hdr_entry_t;
+
+#define SATA_HC_CMD_HDR_ENTRY_SIZE     sizeof(struct cmd_hdr_entry)
+
+/* cda
+*/
+#define CMD_HDR_CDA_ALIGN      4
+
+/* prde_fis_len
+*/
+#define CMD_HDR_PRD_ENTRY_SHIFT        16
+#define CMD_HDR_PRD_ENTRY_MASK 0x003f0000
+#define CMD_HDR_FIS_LEN_SHIFT  2
+
+/* attribute
+*/
+#define CMD_HDR_ATTR_RES       0x00000800 /* Reserved bit, should be 1 */
+#define CMD_HDR_ATTR_VBIST     0x00000400 /* Vendor BIST */
+#define CMD_HDR_ATTR_SNOOP     0x00000200 /* Snoop enable for all descriptor */
+#define CMD_HDR_ATTR_FPDMA     0x00000100 /* FPDMA queued command */
+#define CMD_HDR_ATTR_RESET     0x00000080 /* Reset - a SRST or device reset */
+#define CMD_HDR_ATTR_BIST      0x00000040 /* BIST - require the host to enter BIST mode */
+#define CMD_HDR_ATTR_ATAPI     0x00000020 /* ATAPI command */
+#define CMD_HDR_ATTR_TAG       0x0000001f /* TAG mask */
+
+/* command type
+*/
+enum cmd_type {
+       CMD_VENDOR_BIST,
+       CMD_BIST,
+       CMD_RESET,      /* SRST or device reset */
+       CMD_ATAPI,
+       CMD_NCQ,
+       CMD_ATA,        /* None of all above */
+};
+
+/*
+* Command Header Table
+*/
+typedef struct cmd_hdr_tbl {
+       cmd_hdr_entry_t cmd_slot[SATA_HC_MAX_CMD];
+} __attribute__ ((packed)) cmd_hdr_tbl_t;
+
+#define SATA_HC_CMD_HDR_TBL_SIZE       sizeof(struct cmd_hdr_tbl)
+#define SATA_HC_CMD_HDR_TBL_ALIGN      4
+
+/*
+* PRD entry - Physical Region Descriptor entry
+*/
+typedef struct prd_entry {
+       u32 dba;        /* Data base address, 4 bytes aligned */
+       u32 res1;
+       u32 res2;
+       u32 ext_c_ddc;  /* Indirect PRD flags, snoop and data word count */
+} __attribute__ ((packed)) prd_entry_t;
+
+#define SATA_HC_CMD_DESC_PRD_SIZE      sizeof(struct prd_entry)
+
+/* dba
+*/
+#define PRD_ENTRY_DBA_ALIGN    4
+
+/* ext_c_ddc
+*/
+#define PRD_ENTRY_EXT          0x80000000 /* extension flag or called indirect descriptor flag */
+#define PRD_ENTRY_DATA_SNOOP   0x00400000 /* Snoop enable for all data associated with the PRD entry */
+#define PRD_ENTRY_LEN_MASK     0x003fffff /* Data word count */
+
+#define PRD_ENTRY_MAX_XFER_SZ  (PRD_ENTRY_LEN_MASK + 1)
+
+/*
+ * This SATA host controller supports a max of 16 direct PRD entries, but if use
+ * chained indirect PRD entries, then the contollers supports upto a max of 63
+ * entries including direct and indirect PRD entries.
+ * The PRDT is an array of 63 PRD entries contigiously, but the PRD entries#15
+ * will be setup as an indirect descriptor, pointing to it's next (contigious)
+ * PRD entries#16.
+ */
+#define SATA_HC_MAX_PRD                63 /* Max PRD entry numbers per command */
+#define SATA_HC_MAX_PRD_DIRECT 16 /* Direct PRDT entries */
+#define SATA_HC_MAX_PRD_USABLE (SATA_HC_MAX_PRD - 1)
+#define SATA_HC_MAX_XFER_LEN   0x4000000
+
+/*
+* PRDT - Physical Region Descriptor Table
+*/
+typedef struct prdt {
+       prd_entry_t prdt[SATA_HC_MAX_PRD];
+} __attribute__ ((packed)) prdt_t;
+
+/*
+* Command Descriptor
+*/
+#define SATA_HC_CMD_DESC_CFIS_SIZE     32 /* bytes */
+#define SATA_HC_CMD_DESC_SFIS_SIZE     32 /* bytes */
+#define SATA_HC_CMD_DESC_ACMD_SIZE     16 /* bytes */
+#define SATA_HC_CMD_DESC_RES           16 /* bytes */
+
+typedef struct cmd_desc {
+       u8 cfis[SATA_HC_CMD_DESC_CFIS_SIZE];
+       u8 sfis[SATA_HC_CMD_DESC_SFIS_SIZE];
+       u8 acmd[SATA_HC_CMD_DESC_ACMD_SIZE];
+       u8 res[SATA_HC_CMD_DESC_RES];
+       prd_entry_t prdt[SATA_HC_MAX_PRD];
+} __attribute__ ((packed)) cmd_desc_t;
+
+#define SATA_HC_CMD_DESC_SIZE          sizeof(struct cmd_desc)
+#define SATA_HC_CMD_DESC_ALIGN         4
+
+/*
+* CFIS - Command FIS, which is H2D register FIS, the struct defination
+* of Non-Queued command is different than NCQ command. see them is sata2.h
+*/
+typedef struct cfis {
+       u8 fis_type;
+       u8 pm_port_c;
+       u8 command;
+       u8 features;
+       u8 lba_low;
+       u8 lba_mid;
+       u8 lba_high;
+       u8 device;
+       u8 lba_low_exp;
+       u8 lba_mid_exp;
+       u8 lba_high_exp;
+       u8 features_exp;
+       u8 sector_count;
+       u8 sector_count_exp;
+       u8 res1;
+       u8 control;
+       u8 res2[4];
+} __attribute__ ((packed)) cfis_t;
+
+/*
+* SFIS - Status FIS, which is D2H register FIS.
+*/
+typedef struct sfis {
+       u8 fis_type;
+       u8 pm_port_i;
+       u8 status;
+       u8 error;
+       u8 lba_low;
+       u8 lba_mid;
+       u8 lba_high;
+       u8 device;
+       u8 lba_low_exp;
+       u8 lba_mid_exp;
+       u8 lba_high_exp;
+       u8 res1;
+       u8 sector_count;
+       u8 sector_count_exp;
+       u8 res2[2];
+       u8 res3[4];
+} __attribute__ ((packed)) sfis_t;
+
+/*
+ * SATA device driver info
+ */
+typedef struct fsl_sata_info {
+       u32     sata_reg_base;
+       u32     flags;
+} fsl_sata_info_t;
+
+#define FLAGS_DMA      0x00000000
+#define FLAGS_FPDMA    0x00000001
+
+/*
+ * SATA device driver struct
+ */
+typedef struct fsl_sata {
+       char            name[12];
+       fsl_sata_reg_t  *reg_base;              /* the base address of controller register */
+       void            *cmd_hdr_tbl_offset;    /* alloc address of command header table */
+       cmd_hdr_tbl_t   *cmd_hdr;               /* aligned address of command header table */
+       void            *cmd_desc_offset;       /* alloc address of command descriptor */
+       cmd_desc_t      *cmd_desc;              /* aligned address of command descriptor */
+       int             link;                   /* PHY link status */
+       /* device attribute */
+       int             ata_device_type;        /* device type */
+       int             lba48;
+       int             queue_depth;            /* Max NCQ queue depth */
+       u16             pio;
+       u16             mwdma;
+       u16             udma;
+       int             wcache;
+       int             flush;
+       int             flush_ext;
+} fsl_sata_t;
+
+#define READ_CMD       0
+#define WRITE_CMD      1
+
+#endif /* __FSL_SATA_H__ */
diff --git a/drivers/block/libata.c b/drivers/block/libata.c
new file mode 100644 (file)
index 0000000..90e9a43
--- /dev/null
@@ -0,0 +1,158 @@
+/*
+ * Copyright (C) 2008 Freescale Semiconductor, Inc.
+ *             Dave Liu <daveliu@freescale.com>
+ *             port from the libata of linux kernel
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the 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 <libata.h>
+
+u64 ata_id_n_sectors(u16 *id)
+{
+       if (ata_id_has_lba(id)) {
+               if (ata_id_has_lba48(id))
+                       return ata_id_u64(id, ATA_ID_LBA48_SECTORS);
+               else
+                       return ata_id_u32(id, ATA_ID_LBA_SECTORS);
+       } else {
+               return 0;
+       }
+}
+
+u32 ata_dev_classify(u32 sig)
+{
+       u8 lbam, lbah;
+
+       lbam = (sig >> 16) & 0xff;
+       lbah = (sig >> 24) & 0xff;
+
+       if (((lbam == 0) && (lbah == 0)) ||
+               ((lbam == 0x3c) && (lbah == 0xc3)))
+               return ATA_DEV_ATA;
+
+       if ((lbam == 0x14) && (lbah == 0xeb))
+               return ATA_DEV_ATAPI;
+
+       if ((lbam == 0x69) && (lbah == 0x96))
+               return ATA_DEV_PMP;
+
+       return ATA_DEV_UNKNOWN;
+}
+
+static void ata_id_string(const u16 *id, unsigned char *s,
+                        unsigned int ofs, unsigned int len)
+{
+       unsigned int c;
+
+       while (len > 0) {
+               c = id[ofs] >> 8;
+               *s = c;
+               s++;
+
+               c = id[ofs] & 0xff;
+               *s = c;
+               s++;
+
+               ofs++;
+               len -= 2;
+       }
+}
+
+void ata_id_c_string(const u16 *id, unsigned char *s,
+                        unsigned int ofs, unsigned int len)
+{
+       unsigned char *p;
+
+       ata_id_string(id, s, ofs, len - 1);
+
+       p = s + strnlen((char *)s, len - 1);
+       while (p > s && p[-1] == ' ')
+               p--;
+       *p = '\0';
+}
+
+void ata_dump_id(u16 *id)
+{
+       unsigned char serial[ATA_ID_SERNO_LEN + 1];
+       unsigned char firmware[ATA_ID_FW_REV_LEN + 1];
+       unsigned char product[ATA_ID_PROD_LEN + 1];
+       u64 n_sectors;
+
+       /* Serial number */
+       ata_id_c_string(id, serial, ATA_ID_SERNO, sizeof(serial));
+       printf("S/N: %s\n\r", serial);
+
+       /* Firmware version */
+       ata_id_c_string(id, firmware, ATA_ID_FW_REV, sizeof(firmware));
+       printf("Firmware version: %s\n\r", firmware);
+
+       /* Product model */
+       ata_id_c_string(id, product, ATA_ID_PROD, sizeof(product));
+       printf("Product model number: %s\n\r", product);
+
+       /* Total sectors of device  */
+       n_sectors = ata_id_n_sectors(id);
+       printf("Capablity: %d sectors\n\r", n_sectors);
+
+       printf ("id[49]: capabilities = 0x%04x\n"
+               "id[53]: field valid = 0x%04x\n"
+               "id[63]: mwdma = 0x%04x\n"
+               "id[64]: pio = 0x%04x\n"
+               "id[75]: queue depth = 0x%04x\n",
+               id[49],
+               id[53],
+               id[63],
+               id[64],
+               id[75]);
+
+       printf ("id[76]: sata capablity = 0x%04x\n"
+               "id[78]: sata features supported = 0x%04x\n"
+               "id[79]: sata features enable = 0x%04x\n",
+               id[76],
+               id[78],
+               id[79]);
+
+       printf ("id[80]: major version = 0x%04x\n"
+               "id[81]: minor version = 0x%04x\n"
+               "id[82]: command set supported 1 = 0x%04x\n"
+               "id[83]: command set supported 2 = 0x%04x\n"
+               "id[84]: command set extension = 0x%04x\n",
+               id[80],
+               id[81],
+               id[82],
+               id[83],
+               id[84]);
+       printf ("id[85]: command set enable 1 = 0x%04x\n"
+               "id[86]: command set enable 2 = 0x%04x\n"
+               "id[87]: command set default = 0x%04x\n"
+               "id[88]: udma = 0x%04x\n"
+               "id[93]: hardware reset result = 0x%04x\n",
+               id[85],
+               id[86],
+               id[87],
+               id[88],
+               id[93]);
+}
+
+void ata_swap_buf_le16(u16 *buf, unsigned int buf_words)
+{
+       unsigned int i;
+
+       for (i = 0; i < buf_words; i++)
+               buf[i] = le16_to_cpu(buf[i]);
+}
index db8ef66..98e8bd2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2007
+ * (C) Copyright 2007-2008
  * Larry Johnson, lrj@acm.org
  *
  * based on dtt/lm75.c which is ...
  */
 #define DTT_I2C_DEV_CODE 0x48  /* National Semi's LM73 device */
 
-int dtt_read(int sensor, int reg)
+int dtt_read(int const sensor, int const reg)
 {
        int dlen;
-       uchar data[2];
+       uint8_t data[2];
 
        /*
         * Validate 'reg' param and get register size.
@@ -62,27 +62,24 @@ int dtt_read(int sensor, int reg)
                return -1;
        }
        /*
-        * Calculate sensor address and register.
+        * Try to read the register at the calculated sensor address.
         */
-       sensor = DTT_I2C_DEV_CODE + (sensor & 0x07);    /* calculate LM73 addr */
-       /*
-        * Now try to read the register.
-        */
-       if (i2c_read(sensor, reg, 1, data, dlen) != 0)
+       if (0 !=
+           i2c_read(DTT_I2C_DEV_CODE + (sensor & 0x07), reg, 1, data, dlen))
                return -1;
        /*
         * Handle 2 byte result.
         */
        if (2 == dlen)
-               return ((int)((short)data[1] + (((short)data[0]) << 8)));
+               return (int)((unsigned)data[0] << 8 | (unsigned)data[1]);
 
        return (int)data[0];
 } /* dtt_read() */
 
-int dtt_write(int sensor, int reg, int val)
+int dtt_write(int const sensor, int const reg, int const val)
 {
        int dlen;
-       uchar data[2];
+       uint8_t data[2];
 
        /*
         * Validate 'reg' param and handle register size
@@ -91,28 +88,25 @@ int dtt_write(int sensor, int reg, int val)
        case DTT_CONFIG:
        case DTT_CONTROL:
                dlen = 1;
-               data[0] = (char)(val & 0xff);
+               data[0] = (uint8_t) val;
                break;
        case DTT_TEMP_HIGH:
        case DTT_TEMP_LOW:
                dlen = 2;
-               data[0] = (char)((val >> 8) & 0xff);    /* MSB first */
-               data[1] = (char)(val & 0xff);
+               data[0] = (uint8_t) (val >> 8); /* MSB first */
+               data[1] = (uint8_t) val;
                break;
        default:
                return -1;
        }
        /*
-        * Calculate sensor address and register.
-        */
-       sensor = DTT_I2C_DEV_CODE + (sensor & 0x07);    /* calculate LM73 addr */
-       /*
-        * Write value to register.
+        * Write value to register at the calculated sensor address.
         */
-       return i2c_write(sensor, reg, 1, data, dlen) != 0;
+       return 0 != i2c_write(DTT_I2C_DEV_CODE + (sensor & 0x07), reg, 1, data,
+                             dlen);
 } /* dtt_write() */
 
-static int _dtt_init(int sensor)
+static int _dtt_init(int const sensor)
 {
        int val;
 
@@ -120,31 +114,31 @@ static int _dtt_init(int sensor)
         * Validate the Identification register
         */
        if (0x0190 != dtt_read(sensor, DTT_ID))
-               return 1;
+               return -1;
        /*
         * Setup THIGH (upper-limit) and TLOW (lower-limit) registers
         */
        val = CFG_DTT_MAX_TEMP << 7;
        if (dtt_write(sensor, DTT_TEMP_HIGH, val))
-               return 1;
+               return -1;
 
        val = CFG_DTT_MIN_TEMP << 7;
        if (dtt_write(sensor, DTT_TEMP_LOW, val))
-               return 1;
+               return -1;
        /*
         * Setup configuraton register
         */
        /* config = alert active low, disabled, and reset */
        val = 0x64;
        if (dtt_write(sensor, DTT_CONFIG, val))
-               return 1;
+               return -1;
        /*
         * Setup control/status register
         */
        /* control = temp resolution 0.25C */
        val = 0x00;
        if (dtt_write(sensor, DTT_CONTROL, val))
-               return 1;
+               return -1;
 
        dtt_read(sensor, DTT_CONTROL);  /* clear temperature flags */
        return 0;
@@ -157,7 +151,7 @@ int dtt_init(void)
        const char *const header = "DTT:   ";
 
        for (i = 0; i < sizeof(sensors); i++) {
-               if (_dtt_init(sensors[i]) != 0)
+               if (0 != _dtt_init(sensors[i]))
                        printf("%s%d FAILED INIT\n", header, i + 1);
                else
                        printf("%s%d is %i C\n", header, i + 1,
@@ -166,7 +160,13 @@ int dtt_init(void)
        return 0;
 } /* dtt_init() */
 
-int dtt_get_temp(int sensor)
+int dtt_get_temp(int const sensor)
 {
-       return (dtt_read(sensor, DTT_READ_TEMP) + 0x0040) >> 7;
+       int const ret = dtt_read(sensor, DTT_READ_TEMP);
+
+       if (ret < 0) {
+               printf("DTT temperature read failed.\n");
+               return 0;
+       }
+       return (int)((int16_t) ret + 0x0040) >> 7;
 } /* dtt_get_temp() */
index 29d6c03..071ef00 100644 (file)
@@ -29,6 +29,7 @@ COBJS-y += fsl_i2c.o
 COBJS-y += omap1510_i2c.o
 COBJS-y += omap24xx_i2c.o
 COBJS-y += tsi108_i2c.o
+COBJS-y += mxc_i2c.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
index 22485ea..9f2c1ec 100644 (file)
@@ -32,6 +32,8 @@
 #define I2C_READ_BIT  1
 #define I2C_WRITE_BIT 0
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /* Initialize the bus pointer to whatever one the SPD EEPROM is on.
  * Default is bus 0.  This is necessary because the DDR initialization
  * runs from ROM, and we can't switch buses because we can't modify
@@ -43,24 +45,110 @@ static unsigned int i2c_bus_num __attribute__ ((section ("data"))) = CFG_SPD_BUS
 static unsigned int i2c_bus_num __attribute__ ((section ("data"))) = 0;
 #endif
 
-static volatile struct fsl_i2c *i2c_dev[2] = {
+static unsigned int i2c_bus_speed[2] = {CFG_I2C_SPEED, CFG_I2C_SPEED};
+
+static const struct fsl_i2c *i2c_dev[2] = {
        (struct fsl_i2c *) (CFG_IMMR + CFG_I2C_OFFSET),
 #ifdef CFG_I2C2_OFFSET
        (struct fsl_i2c *) (CFG_IMMR + CFG_I2C2_OFFSET)
 #endif
 };
 
+/* I2C speed map for a DFSR value of 1 */
+
+/*
+ * Map I2C frequency dividers to FDR and DFSR values
+ *
+ * This structure is used to define the elements of a table that maps I2C
+ * frequency divider (I2C clock rate divided by I2C bus speed) to a value to be
+ * programmed into the Frequency Divider Ratio (FDR) and Digital Filter
+ * Sampling Rate (DFSR) registers.
+ *
+ * The actual table should be defined in the board file, and it must be called
+ * fsl_i2c_speed_map[].
+ *
+ * The last entry of the table must have a value of {-1, X}, where X is same
+ * FDR/DFSR values as the second-to-last entry.  This guarantees that any
+ * search through the array will always find a match.
+ *
+ * The values of the divider must be in increasing numerical order, i.e.
+ * fsl_i2c_speed_map[x+1].divider > fsl_i2c_speed_map[x].divider.
+ *
+ * For this table, the values are based on a value of 1 for the DFSR
+ * register.  See the application note AN2919 "Determining the I2C Frequency
+ * Divider Ratio for SCL"
+ */
+static const struct {
+       unsigned short divider;
+       u8 dfsr;
+       u8 fdr;
+} fsl_i2c_speed_map[] = {
+       {160, 1, 32}, {192, 1, 33}, {224, 1, 34}, {256, 1, 35},
+       {288, 1, 0}, {320, 1, 1}, {352, 6, 1}, {384, 1, 2}, {416, 6, 2},
+       {448, 1, 38}, {480, 1, 3}, {512, 1, 39}, {544, 11, 3}, {576, 1, 4},
+       {608, 22, 3}, {640, 1, 5}, {672, 32, 3}, {704, 11, 5}, {736, 43, 3},
+       {768, 1, 6}, {800, 54, 3}, {832, 11, 6}, {896, 1, 42}, {960, 1, 7},
+       {1024, 1, 43}, {1088, 22, 7}, {1152, 1, 8}, {1216, 43, 7}, {1280, 1, 9},
+       {1408, 22, 9}, {1536, 1, 10}, {1664, 22, 10}, {1792, 1, 46},
+       {1920, 1, 11}, {2048, 1, 47}, {2176, 43, 11}, {2304, 1, 12},
+       {2560, 1, 13}, {2816, 43, 13}, {3072, 1, 14}, {3328, 43, 14},
+       {3584, 1, 50}, {3840, 1, 15}, {4096, 1, 51}, {4608, 1, 16},
+       {5120, 1, 17}, {6144, 1, 18}, {7168, 1, 54}, {7680, 1, 19},
+       {8192, 1, 55}, {9216, 1, 20}, {10240, 1, 21}, {12288, 1, 22},
+       {14336, 1, 58}, {15360, 1, 23}, {16384, 1, 59}, {18432, 1, 24},
+       {20480, 1, 25}, {24576, 1, 26}, {28672, 1, 62}, {30720, 1, 27},
+       {32768, 1, 63}, {36864, 1, 28}, {40960, 1, 29}, {49152, 1, 30},
+       {61440, 1, 31}, {-1, 1, 31}
+};
+
+/**
+ * Set the I2C bus speed for a given I2C device
+ *
+ * @param dev: the I2C device
+ * @i2c_clk: I2C bus clock frequency
+ * @speed: the desired speed of the bus
+ *
+ * The I2C device must be stopped before calling this function.
+ *
+ * The return value is the actual bus speed that is set.
+ */
+static unsigned int set_i2c_bus_speed(const struct fsl_i2c *dev,
+       unsigned int i2c_clk, unsigned int speed)
+{
+       unsigned short divider = min(i2c_clk / speed, (unsigned short) -1);
+       unsigned int i;
+
+       /*
+        * We want to choose an FDR/DFSR that generates an I2C bus speed that
+        * is equal to or lower than the requested speed.  That means that we
+        * want the first divider that is equal to or greater than the
+        * calculated divider.
+        */
+
+       for (i = 0; i < ARRAY_SIZE(fsl_i2c_speed_map); i++)
+               if (fsl_i2c_speed_map[i].divider >= divider) {
+                       u8 fdr, dfsr;
+                       dfsr = fsl_i2c_speed_map[i].dfsr;
+                       fdr = fsl_i2c_speed_map[i].fdr;
+                       speed = i2c_clk / fsl_i2c_speed_map[i].divider;
+                       writeb(fdr, &dev->fdr);         /* set bus speed */
+                       writeb(dfsr, &dev->dfsrr);      /* set default filter */
+                       break;
+               }
+
+       return speed;
+}
+
 void
 i2c_init(int speed, int slaveadd)
 {
-       volatile struct fsl_i2c *dev;
+       struct fsl_i2c *dev;
 
        dev = (struct fsl_i2c *) (CFG_IMMR + CFG_I2C_OFFSET);
 
        writeb(0, &dev->cr);                    /* stop I2C controller */
        udelay(5);                              /* let it shutdown in peace */
-       writeb(0x3F, &dev->fdr);                /* set bus speed */
-       writeb(0x3F, &dev->dfsrr);              /* set default filter */
+       i2c_bus_speed[0] = set_i2c_bus_speed(dev, gd->i2c1_clk, speed);
        writeb(slaveadd << 1, &dev->adr);       /* write slave address */
        writeb(0x0, &dev->sr);                  /* clear status register */
        writeb(I2C_CR_MEN, &dev->cr);           /* start I2C controller */
@@ -70,12 +158,11 @@ i2c_init(int speed, int slaveadd)
 
        writeb(0, &dev->cr);                    /* stop I2C controller */
        udelay(5);                              /* let it shutdown in peace */
-       writeb(0x3F, &dev->fdr);                /* set bus speed */
-       writeb(0x3F, &dev->dfsrr);              /* set default filter */
+       i2c_bus_speed[1] = set_i2c_bus_speed(dev, gd->i2c2_clk, speed);
        writeb(slaveadd << 1, &dev->adr);       /* write slave address */
        writeb(0x0, &dev->sr);                  /* clear status register */
        writeb(I2C_CR_MEN, &dev->cr);           /* start I2C controller */
-#endif /* CFG_I2C2_OFFSET */
+#endif
 }
 
 static __inline__ int
@@ -279,7 +366,14 @@ int i2c_set_bus_num(unsigned int bus)
 
 int i2c_set_bus_speed(unsigned int speed)
 {
-       return -1;
+       unsigned int i2c_clk = (i2c_bus_num == 1) ? gd->i2c2_clk : gd->i2c1_clk;
+
+       writeb(0, &i2c_dev[i2c_bus_num]->cr);           /* stop controller */
+       i2c_bus_speed[i2c_bus_num] =
+               set_i2c_bus_speed(i2c_dev[i2c_bus_num], i2c_clk, speed);
+       writeb(I2C_CR_MEN, &i2c_dev[i2c_bus_num]->cr);  /* start controller */
+
+       return 0;
 }
 
 unsigned int i2c_get_bus_num(void)
@@ -289,7 +383,8 @@ unsigned int i2c_get_bus_num(void)
 
 unsigned int i2c_get_bus_speed(void)
 {
-       return 0;
+       return i2c_bus_speed[i2c_bus_num];
 }
+
 #endif /* CONFIG_HARD_I2C */
 #endif /* CONFIG_FSL_I2C */
diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
new file mode 100644 (file)
index 0000000..a218329
--- /dev/null
@@ -0,0 +1,202 @@
+/*
+ * i2c driver for Freescale mx31
+ *
+ * (c) 2007 Pengutronix, Sascha Hauer <s.hauer@pengutronix.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>
+
+#if defined(CONFIG_HARD_I2C) && defined (CONFIG_I2C_MXC)
+
+#include <asm/arch/mx31.h>
+#include <asm/arch/mx31-regs.h>
+
+#define IADR   0x00
+#define IFDR   0x04
+#define I2CR   0x08
+#define I2SR   0x0c
+#define I2DR   0x10
+
+#define I2CR_IEN       (1 << 7)
+#define I2CR_IIEN      (1 << 6)
+#define I2CR_MSTA      (1 << 5)
+#define I2CR_MTX       (1 << 4)
+#define I2CR_TX_NO_AK  (1 << 3)
+#define I2CR_RSTA      (1 << 2)
+
+#define I2SR_ICF       (1 << 7)
+#define I2SR_IBB       (1 << 5)
+#define I2SR_IIF       (1 << 1)
+#define I2SR_RX_NO_AK  (1 << 0)
+
+#ifdef CFG_I2C_MX31_PORT1
+#define I2C_BASE       0x43f80000
+#elif defined (CFG_I2C_MX31_PORT2)
+#define I2C_BASE       0x43f98000
+#elif defined (CFG_I2C_MX31_PORT3)
+#define I2C_BASE       0x43f84000
+#else
+#error "define CFG_I2C_MX31_PORTx to use the mx31 I2C driver"
+#endif
+
+#ifdef DEBUG
+#define DPRINTF(args...)  printf(args)
+#else
+#define DPRINTF(args...)
+#endif
+
+static u16 div[] = { 30, 32, 36, 42, 48, 52, 60, 72, 80, 88, 104, 128, 144,
+                    160, 192, 240, 288, 320, 384, 480, 576, 640, 768, 960,
+                    1152, 1280, 1536, 1920, 2304, 2560, 3072, 3840};
+
+void i2c_init(int speed, int unused)
+{
+       int freq = mx31_get_ipg_clk();
+       int i;
+
+       for (i = 0; i < 0x1f; i++)
+               if (freq / div[i] <= speed)
+                       break;
+
+       DPRINTF("%s: speed: %d\n",__FUNCTION__, speed);
+
+       __REG16(I2C_BASE + I2CR) = 0; /* Reset module */
+       __REG16(I2C_BASE + IFDR) = i;
+       __REG16(I2C_BASE + I2CR) = I2CR_IEN;
+       __REG16(I2C_BASE + I2SR) = 0;
+}
+
+static int wait_busy(void)
+{
+       int timeout = 10000;
+
+       while (!(__REG16(I2C_BASE + I2SR) & I2SR_IIF) && --timeout)
+               udelay(1);
+       __REG16(I2C_BASE + I2SR) = 0; /* clear interrupt */
+
+       return timeout;
+}
+
+static int tx_byte(u8 byte)
+{
+       __REG16(I2C_BASE + I2DR) = byte;
+
+       if (!wait_busy() || __REG16(I2C_BASE + I2SR) & I2SR_RX_NO_AK)
+               return -1;
+       return 0;
+}
+
+static int rx_byte(void)
+{
+       if (!wait_busy())
+               return -1;
+
+       return __REG16(I2C_BASE + I2DR);
+}
+
+int i2c_probe(uchar chip)
+{
+       int ret;
+
+       __REG16(I2C_BASE + I2CR) = 0; /* Reset module */
+       __REG16(I2C_BASE + I2CR) = I2CR_IEN;
+
+       __REG16(I2C_BASE + I2CR) = I2CR_IEN |  I2CR_MSTA | I2CR_MTX;
+       ret = tx_byte(chip << 1);
+       __REG16(I2C_BASE + I2CR) = I2CR_IEN | I2CR_MTX;
+
+       return ret;
+}
+
+static int i2c_addr(uchar chip, uint addr, int alen)
+{
+       __REG16(I2C_BASE + I2SR) = 0; /* clear interrupt */
+       __REG16(I2C_BASE + I2CR) = I2CR_IEN |  I2CR_MSTA | I2CR_MTX;
+
+       if (tx_byte(chip << 1))
+               return -1;
+
+       while (alen--)
+               if (tx_byte((addr >> (alen * 8)) & 0xff))
+                       return -1;
+       return 0;
+}
+
+int i2c_read(uchar chip, uint addr, int alen, uchar *buf, int len)
+{
+       int timeout = 10000;
+       int ret;
+
+       DPRINTF("%s chip: 0x%02x addr: 0x%04x alen: %d len: %d\n",__FUNCTION__, chip, addr, alen, len);
+
+       if (i2c_addr(chip, addr, alen)) {
+               printf("i2c_addr failed\n");
+               return -1;
+       }
+
+       __REG16(I2C_BASE + I2CR) = I2CR_IEN |  I2CR_MSTA | I2CR_MTX | I2CR_RSTA;
+
+       if (tx_byte(chip << 1 | 1))
+               return -1;
+
+       __REG16(I2C_BASE + I2CR) = I2CR_IEN |  I2CR_MSTA | ((len == 1) ? I2CR_TX_NO_AK : 0);
+
+       ret = __REG16(I2C_BASE + I2DR);
+
+       while (len--) {
+               if ((ret = rx_byte()) < 0)
+                       return -1;
+               *buf++ = ret;
+               if (len <= 1)
+                       __REG16(I2C_BASE + I2CR) = I2CR_IEN |  I2CR_MSTA | I2CR_TX_NO_AK;
+       }
+
+       wait_busy();
+
+       __REG16(I2C_BASE + I2CR) = I2CR_IEN;
+
+       while (__REG16(I2C_BASE + I2SR) & I2SR_IBB && --timeout)
+               udelay(1);
+
+       return 0;
+}
+
+int i2c_write(uchar chip, uint addr, int alen, uchar *buf, int len)
+{
+       int timeout = 10000;
+       DPRINTF("%s chip: 0x%02x addr: 0x%04x alen: %d len: %d\n",__FUNCTION__, chip, addr, alen, len);
+
+       if (i2c_addr(chip, addr, alen))
+               return -1;
+
+       while (len--)
+               if (tx_byte(*buf++))
+                       return -1;
+
+       __REG16(I2C_BASE + I2CR) = I2CR_IEN;
+
+       while (__REG16(I2C_BASE + I2SR) & I2SR_IBB && --timeout)
+               udelay(1);
+
+       return 0;
+}
+
+#endif /* CONFIG_HARD_I2C */
index 952e919..ff932a1 100644 (file)
 
 include $(TOPDIR)/config.mk
 
-LIB    := $(obj)libmtd.a
+LIB    := $(obj)libmtd.a
 
 COBJS-y += at45.o
 COBJS-y += cfi_flash.o
-COBJS-y += dataflash.o
+COBJS-$(CONFIG_HAS_DATAFLASH) += dataflash.o
 COBJS-y += mw_eeprom.o
 COBJS-$(CONFIG_FLASH_CFI_LEGACY) += jedec_flash.o
 
 COBJS  := $(COBJS-y)
-SRCS   := $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(COBJS))
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
 
 all:   $(LIB)
 
index 439c950..e3cfb8a 100644 (file)
@@ -239,12 +239,14 @@ static u32 flash_read32(void *addr)
        return __raw_readl(addr);
 }
 
-static u64 flash_read64(void *addr)
+static u64 __flash_read64(void *addr)
 {
        /* No architectures currently implement __raw_readq() */
        return *(volatile u64 *)addr;
 }
 
+u64 flash_read64(void *addr)__attribute__((weak, alias("__flash_read64")));
+
 /*-----------------------------------------------------------------------
  */
 #if defined(CFG_ENV_IS_IN_FLASH) || defined(CFG_ENV_ADDR_REDUND) || (CFG_MONITOR_BASE >= CFG_FLASH_BASE)
@@ -365,6 +367,20 @@ static inline uchar flash_read_uchar (flash_info_t * info, uint offset)
 }
 
 /*-----------------------------------------------------------------------
+ * read a word at a port width address, assume 16bit bus
+ */
+static inline ushort flash_read_word (flash_info_t * info, uint offset)
+{
+       ushort *addr, retval;
+
+       addr = flash_map (info, 0, offset);
+       retval = flash_read16 (addr);
+       flash_unmap (info, 0, offset, addr);
+       return retval;
+}
+
+
+/*-----------------------------------------------------------------------
  * read a long word by picking the least significant byte of each maximum
  * port size word. Swap for ppc format.
  */
@@ -828,25 +844,29 @@ static int flash_write_cfibuffer (flash_info_t * info, ulong dest, uchar * cp,
        void *dst = map_physmem(dest, len, MAP_NOCACHE);
        void *dst2 = dst;
        int flag = 0;
+       uint offset = 0;
+       unsigned int shift;
 
        switch (info->portwidth) {
        case FLASH_CFI_8BIT:
-               cnt = len;
+               shift = 0;
                break;
        case FLASH_CFI_16BIT:
-               cnt = len >> 1;
+               shift = 1;
                break;
        case FLASH_CFI_32BIT:
-               cnt = len >> 2;
+               shift = 2;
                break;
        case FLASH_CFI_64BIT:
-               cnt = len >> 3;
+               shift = 3;
                break;
        default:
                retcode = ERR_INVAL;
                goto out_unmap;
        }
 
+       cnt = len >> shift;
+
        while ((cnt-- > 0) && (flag == 0)) {
                switch (info->portwidth) {
                case FLASH_CFI_8BIT:
@@ -890,23 +910,7 @@ static int flash_write_cfibuffer (flash_info_t * info, ulong dest, uchar * cp,
                if (retcode == ERR_OK) {
                        /* reduce the number of loops by the width of
                         * the port */
-                       switch (info->portwidth) {
-                       case FLASH_CFI_8BIT:
-                               cnt = len;
-                               break;
-                       case FLASH_CFI_16BIT:
-                               cnt = len >> 1;
-                               break;
-                       case FLASH_CFI_32BIT:
-                               cnt = len >> 2;
-                               break;
-                       case FLASH_CFI_64BIT:
-                               cnt = len >> 3;
-                               break;
-                       default:
-                               retcode = ERR_INVAL;
-                               goto out_unmap;
-                       }
+                       cnt = len >> shift;
                        flash_write_cmd (info, sector, 0, (uchar) cnt - 1);
                        while (cnt-- > 0) {
                                switch (info->portwidth) {
@@ -943,36 +947,34 @@ static int flash_write_cfibuffer (flash_info_t * info, ulong dest, uchar * cp,
        case CFI_CMDSET_AMD_STANDARD:
        case CFI_CMDSET_AMD_EXTENDED:
                flash_unlock_seq(info,0);
-               flash_write_cmd (info, sector, 0, AMD_CMD_WRITE_TO_BUFFER);
+
+#ifdef CONFIG_FLASH_SPANSION_S29WS_N
+               offset = ((unsigned long)dst - info->start[sector]) >> shift;
+#endif
+               flash_write_cmd(info, sector, offset, AMD_CMD_WRITE_TO_BUFFER);
+               cnt = len >> shift;
+               flash_write_cmd(info, sector, offset, (uchar)cnt - 1);
 
                switch (info->portwidth) {
                case FLASH_CFI_8BIT:
-                       cnt = len;
-                       flash_write_cmd (info, sector, 0,  (uchar) cnt - 1);
                        while (cnt-- > 0) {
                                flash_write8(flash_read8(src), dst);
                                src += 1, dst += 1;
                        }
                        break;
                case FLASH_CFI_16BIT:
-                       cnt = len >> 1;
-                       flash_write_cmd (info, sector, 0,  (uchar) cnt - 1);
                        while (cnt-- > 0) {
                                flash_write16(flash_read16(src), dst);
                                src += 2, dst += 2;
                        }
                        break;
                case FLASH_CFI_32BIT:
-                       cnt = len >> 2;
-                       flash_write_cmd (info, sector, 0,  (uchar) cnt - 1);
                        while (cnt-- > 0) {
                                flash_write32(flash_read32(src), dst);
                                src += 4, dst += 4;
                        }
                        break;
                case FLASH_CFI_64BIT:
-                       cnt = len >> 3;
-                       flash_write_cmd (info, sector, 0,  (uchar) cnt - 1);
                        while (cnt-- > 0) {
                                flash_write64(flash_read64(src), dst);
                                src += 8, dst += 8;
@@ -1180,6 +1182,27 @@ void flash_print_info (flash_info_t * info)
 }
 
 /*-----------------------------------------------------------------------
+ * This is used in a few places in write_buf() to show programming
+ * progress.  Making it a function is nasty because it needs to do side
+ * effect updates to digit and dots.  Repeated code is nasty too, so
+ * we define it once here.
+ */
+#ifdef CONFIG_FLASH_SHOW_PROGRESS
+#define FLASH_SHOW_PROGRESS(scale, dots, digit, dots_sub) \
+       dots -= dots_sub; \
+       if ((scale > 0) && (dots <= 0)) { \
+               if ((digit % 5) == 0) \
+                       printf ("%d", digit / 5); \
+               else \
+                       putc ('.'); \
+               digit--; \
+               dots += scale; \
+       }
+#else
+#define FLASH_SHOW_PROGRESS(scale, dots, digit, dots_sub)
+#endif
+
+/*-----------------------------------------------------------------------
  * Copy memory to flash, returns:
  * 0 - OK
  * 1 - write timeout
@@ -1192,10 +1215,23 @@ int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
        int aln;
        cfiword_t cword;
        int i, rc;
-
 #ifdef CFG_FLASH_USE_BUFFER_WRITE
        int buffered_size;
 #endif
+#ifdef CONFIG_FLASH_SHOW_PROGRESS
+       int digit = CONFIG_FLASH_SHOW_PROGRESS;
+       int scale = 0;
+       int dots  = 0;
+
+       /*
+        * Suppress if there are fewer than CONFIG_FLASH_SHOW_PROGRESS writes.
+        */
+       if (cnt >= CONFIG_FLASH_SHOW_PROGRESS) {
+               scale = (int)((cnt + CONFIG_FLASH_SHOW_PROGRESS - 1) /
+                       CONFIG_FLASH_SHOW_PROGRESS);
+       }
+#endif
+
        /* get lower aligned address */
        wp = (addr & ~(info->portwidth - 1));
 
@@ -1219,6 +1255,7 @@ int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
                        return rc;
 
                wp += i;
+               FLASH_SHOW_PROGRESS(scale, dots, digit, i);
        }
 
        /* handle the aligned part */
@@ -1248,6 +1285,7 @@ int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
                wp += i;
                src += i;
                cnt -= i;
+               FLASH_SHOW_PROGRESS(scale, dots, digit, i);
        }
 #else
        while (cnt >= info->portwidth) {
@@ -1259,8 +1297,10 @@ int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
                        return rc;
                wp += info->portwidth;
                cnt -= info->portwidth;
+               FLASH_SHOW_PROGRESS(scale, dots, digit, info->portwidth);
        }
 #endif /* CFG_FLASH_USE_BUFFER_WRITE */
+
        if (cnt == 0) {
                return (0);
        }
@@ -1411,17 +1451,29 @@ static void cmdset_amd_read_jedec_ids(flash_info_t *info)
        flash_unlock_seq(info, 0);
        flash_write_cmd(info, 0, info->addr_unlock1, FLASH_CMD_READ_ID);
        udelay(1000); /* some flash are slow to respond */
+
        info->manufacturer_id = flash_read_uchar (info,
                                        FLASH_OFFSET_MANUFACTURER_ID);
-       info->device_id = flash_read_uchar (info,
-                                       FLASH_OFFSET_DEVICE_ID);
-       if (info->device_id == 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);
+
+       switch (info->chipwidth){
+       case FLASH_CFI_8BIT:
+               info->device_id = flash_read_uchar (info,
+                                               FLASH_OFFSET_DEVICE_ID);
+               if (info->device_id == 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;
+       case FLASH_CFI_16BIT:
+               info->device_id = flash_read_word (info,
+                                               FLASH_OFFSET_DEVICE_ID);
+               break;
+       default:
+               break;
        }
        flash_write_cmd(info, 0, 0, AMD_CMD_RESET);
 }
index 36c99a0..8247aa0 100644 (file)
  */
 #include <common.h>
 #include <config.h>
-#ifdef CONFIG_HAS_DATAFLASH
 #include <asm/hardware.h>
 #include <dataflash.h>
 
-AT91S_DATAFLASH_INFO dataflash_info[CFG_MAX_DATAFLASH_BANKS];
 static AT91S_DataFlash DataFlashInst;
 
-struct dataflash_addr {
-       unsigned long addr;
-       int cs;
-};
-
-#ifdef CONFIG_AT91SAM9260EK
-struct dataflash_addr cs[CFG_MAX_DATAFLASH_BANKS] = {
-       {CFG_DATAFLASH_LOGIC_ADDR_CS0, 0},      /* Logical adress, CS */
-       {CFG_DATAFLASH_LOGIC_ADDR_CS1, 1}
-};
-#elif defined(CONFIG_AT91SAM9263EK) || defined(CONFIG_AT91CAP9ADK)
-struct dataflash_addr cs[CFG_MAX_DATAFLASH_BANKS] = {
-       {CFG_DATAFLASH_LOGIC_ADDR_CS0, 0},      /* Logical adress, CS */
-};
-#else
-struct dataflash_addr cs[CFG_MAX_DATAFLASH_BANKS] = {
-       {CFG_DATAFLASH_LOGIC_ADDR_CS0, 0},      /* Logical adress, CS */
-       {CFG_DATAFLASH_LOGIC_ADDR_CS3, 3}
-};
-#endif
-
-/*define the area offsets*/
-#if defined(CONFIG_AT91SAM9261EK) || defined(CONFIG_AT91SAM9260EK) || \
-       defined(CONFIG_AT91SAM9263EK) || defined(CONFIG_AT91CAP9ADK)
-#if    defined(CONFIG_NEW_PARTITION)
-dataflash_protect_t area_list[NB_DATAFLASH_AREA] = {
-       {0x00000000,    0x00003FFF,     FLAG_PROTECT_SET,       0,              "Bootstrap"},   /* ROM code */
-       {0x00004200,    0x000083FF,     FLAG_PROTECT_CLEAR,     0,              "Environment"}, /* u-boot environment */
-       {0x00008400,    0x0003DDFF,     FLAG_PROTECT_SET,       0,              "U-Boot"},      /* u-boot code */
-       {0x0003DE00,    0x00041FFF,     FLAG_PROTECT_CLEAR,     FLAG_SETENV,    "MON"},         /* Room for alternative boot monitor */
-       {0x00042000,    0x0018BFFF,     FLAG_PROTECT_CLEAR,     FLAG_SETENV,    "OS"},          /* data area size to tune */
-       {0x0018C000,    0xFFFFFFFF,     FLAG_PROTECT_CLEAR,     FLAG_SETENV,    "FS"},          /* data area size to tune */
-};
-#else
-dataflash_protect_t area_list[NB_DATAFLASH_AREA] = {
-       {0, 0x3fff, FLAG_PROTECT_SET},                  /* ROM code */
-       {0x4000, 0x7fff, FLAG_PROTECT_CLEAR},           /* u-boot environment */
-       {0x8000, 0x37fff, FLAG_PROTECT_SET},            /* u-boot code */
-       {0x38000, 0x1fffff, FLAG_PROTECT_CLEAR},        /* data area size to tune */
-};
-#endif
-#elif defined(CONFIG_NEW_PARTITION)
-/*define the area offsets*/
-/* Invalid partitions should be defined with start > end */
-dataflash_protect_t area_list[NB_DATAFLASH_AREA*CFG_MAX_DATAFLASH_BANKS] = {
-       {0x00000000, 0x000083ff, FLAG_PROTECT_SET,      0,              "Bootstrap"},   /* ROM code */
-       {0x00008400, 0x00020fff, FLAG_PROTECT_SET,      0,              "U-Boot"},      /* u-boot code */
-       {0x00021000, 0x000293ff, FLAG_PROTECT_CLEAR,    0,              "Environment"}, /* u-boot environment 8Kb */
-       {0x00029400, 0x00041fff, FLAG_PROTECT_INVALID,  0,              "<Unused>"},    /* Rest of Sector 1 */
-       {0x00042000, 0x0018Bfff, FLAG_PROTECT_CLEAR,    FLAG_SETENV,    "OS"},  /* data area size to tune */
-       {0x0018C000, 0xffffffff, FLAG_PROTECT_CLEAR,    FLAG_SETENV,    "FS"},  /* data area size to tune */
-
-       {0x00000000, 0xffffffff, FLAG_PROTECT_CLEAR,    FLAG_SETENV,    "Data"},        /* data area */
-       {0xffffffff, 0x00000000, FLAG_PROTECT_INVALID,  0,              "<Invalid>"},   /* Invalid */
-       {0xffffffff, 0x00000000, FLAG_PROTECT_INVALID,  0,              "<Invalid>"},   /* Invalid */
-       {0xffffffff, 0x00000000, FLAG_PROTECT_INVALID,  0,              "<Invalid>"},   /* Invalid */
-       {0xffffffff, 0x00000000, FLAG_PROTECT_INVALID,  0,              "<Invalid>"},   /* Invalid */
-       {0xffffffff, 0x00000000, FLAG_PROTECT_INVALID,  0,              "<Invalid>"},   /* Invalid */
-};
-#else
-dataflash_protect_t area_list[NB_DATAFLASH_AREA] = {
-       {0, 0x7fff, FLAG_PROTECT_SET},                  /* ROM code */
-       {0x8000, 0x1ffff, FLAG_PROTECT_SET},            /* u-boot code */
-       {0x20000, 0x27fff, FLAG_PROTECT_CLEAR},         /* u-boot environment */
-       {0x28000, 0x1fffff, FLAG_PROTECT_CLEAR},        /* data area size to tune */
-};
-#endif
-
 extern void AT91F_SpiInit (void);
 extern int AT91F_DataflashProbe (int i, AT91PS_DataflashDesc pDesc);
 extern int AT91F_DataFlashRead (AT91PS_DataFlash pDataFlash,
@@ -108,7 +38,7 @@ int AT91F_DataflashInit (void)
 {
        int i, j;
        int dfcode;
-       int part = 0;
+       int part;
        int last_part;
        int found[CFG_MAX_DATAFLASH_BANKS];
        unsigned char protected;
@@ -181,7 +111,8 @@ int AT91F_DataflashInit (void)
                                (dataflash_info[i].Device.pages_number *
                                dataflash_info[i].Device.pages_size)-1;
 
-               last_part=0;
+               part = 0;
+               last_part = 0;
                /* set the area addresses */
                for(j = 0; j<NB_DATAFLASH_AREA; j++) {
                        if(found[i]!=0) {
@@ -216,14 +147,14 @@ int AT91F_DataflashInit (void)
        return found[0];
 }
 
-#ifdef CONFIG_NEW_DF_PARTITION
-int AT91F_DataflashSetEnv (void)
+void AT91F_DataflashSetEnv (void)
 {
        int i, j;
        int part;
        unsigned char env;
        unsigned char s[32];    /* Will fit a long int in hex */
        unsigned long start;
+
        for (i = 0, part= 0; i < CFG_MAX_DATAFLASH_BANKS; i++) {
                for(j = 0; j<NB_DATAFLASH_AREA; j++) {
                        env = area_list[part].setenv;
@@ -231,14 +162,13 @@ int AT91F_DataflashSetEnv (void)
                        if((env & FLAG_SETENV) == FLAG_SETENV) {
                                start =
                                dataflash_info[i].Device.area_list[j].start;
-                               sprintf(s,"%X",start);
-                               setenv(area_list[part].label,s);
+                               sprintf((char*) s,"%X",start);
+                               setenv((char*) area_list[part].label,(char*) s);
                        }
                        part++;
                }
        }
 }
-#endif
 
 void dataflash_print_info (void)
 {
@@ -281,25 +211,18 @@ void dataflash_print_info (void)
                                                dataflash_info[i].Device.area_list[j].start,
                                                dataflash_info[i].Device.area_list[j].end,
                                                (dataflash_info[i].Device.area_list[j].protected==FLAG_PROTECT_SET) ? "(RO)" : "    ");
-#ifdef CONFIG_NEW_DF_PARTITION
                                                printf(" %s\n", dataflash_info[i].Device.area_list[j].label);
-#else
-                                               printf("\n");
-#endif
                                        break;
-#ifdef CONFIG_NEW_DF_PARTITION
                                case    FLAG_PROTECT_INVALID:
                                        break;
-#endif
                                }
                        }
                }
        }
 }
 
-
 /*---------------------------------------------------------------------------*/
-/* Function Name       : AT91F_DataflashSelect                                      */
+/* Function Name       : AT91F_DataflashSelect                              */
 /* Object              : Select the correct device                          */
 /*---------------------------------------------------------------------------*/
 AT91PS_DataFlash AT91F_DataflashSelect (AT91PS_DataFlash pFlash,
@@ -326,7 +249,7 @@ AT91PS_DataFlash AT91F_DataflashSelect (AT91PS_DataFlash pFlash,
 }
 
 /*---------------------------------------------------------------------------*/
-/* Function Name       : addr_dataflash                                     */
+/* Function Name       : addr_dataflash                                             */
 /* Object              : Test if address is valid                           */
 /*---------------------------------------------------------------------------*/
 int addr_dataflash (unsigned long addr)
@@ -344,8 +267,9 @@ int addr_dataflash (unsigned long addr)
 
        return addr_valid;
 }
+
 /*---------------------------------------------------------------------------*/
-/* Function Name       : size_dataflash                                     */
+/* Function Name       : size_dataflash                                             */
 /* Object              : Test if address is valid regarding the size        */
 /*---------------------------------------------------------------------------*/
 int size_dataflash (AT91PS_DataFlash pdataFlash, unsigned long addr,
@@ -361,13 +285,15 @@ int size_dataflash (AT91PS_DataFlash pdataFlash, unsigned long addr,
 
        return 1;
 }
+
 /*---------------------------------------------------------------------------*/
-/* Function Name       : prot_dataflash                                     */
+/* Function Name       : prot_dataflash                                             */
 /* Object              : Test if destination area is protected              */
 /*---------------------------------------------------------------------------*/
 int prot_dataflash (AT91PS_DataFlash pdataFlash, unsigned long addr)
 {
-int area;
+       int area;
+
        /* find area */
        for (area=0; area < NB_DATAFLASH_AREA; area++) {
                if ((addr >= pdataFlash->pDevice->area_list[area].start) &&
@@ -385,6 +311,7 @@ int area;
 
        return 1;
 }
+
 /*--------------------------------------------------------------------------*/
 /* Function Name       : dataflash_real_protect                                    */
 /* Object              : protect/unprotect area                                    */
@@ -392,7 +319,8 @@ int area;
 int dataflash_real_protect (int flag, unsigned long start_addr,
                                unsigned long end_addr)
 {
-int i,j, area1, area2, addr_valid = 0;
+       int i,j, area1, area2, addr_valid = 0;
+
        /* find dataflash */
        for (i = 0; i < CFG_MAX_DATAFLASH_BANKS; i++) {
                if ((((int) start_addr) & 0xF0000000) ==
@@ -435,7 +363,7 @@ int i,j, area1, area2, addr_valid = 0;
 }
 
 /*---------------------------------------------------------------------------*/
-/* Function Name       : read_dataflash                                     */
+/* Function Name       : read_dataflash                                             */
 /* Object              : dataflash memory read                              */
 /*---------------------------------------------------------------------------*/
 int read_dataflash (unsigned long addr, unsigned long size, char *result)
@@ -454,9 +382,8 @@ int read_dataflash (unsigned long addr, unsigned long size, char *result)
        return (AT91F_DataFlashRead (pFlash, AddrToRead, size, result));
 }
 
-
 /*---------------------------------------------------------------------------*/
-/* Function Name       : write_dataflash                                    */
+/* Function Name       : write_dataflash                                    */
 /* Object              : write a block in dataflash                         */
 /*---------------------------------------------------------------------------*/
 int write_dataflash (unsigned long addr_dest, unsigned long addr_src,
@@ -483,7 +410,6 @@ int write_dataflash (unsigned long addr_dest, unsigned long addr_src,
                                                AddrToWrite, size);
 }
 
-
 void dataflash_perror (int err)
 {
        switch (err) {
@@ -509,5 +435,3 @@ void dataflash_perror (int err)
                break;
        }
 }
-
-#endif
index 41aad3b..b958d17 100644 (file)
@@ -216,6 +216,25 @@ static const struct amd_flash_info jedec_table[] = {
                }
        },
 #endif
+#ifdef CFG_FLASH_LEGACY_512Kx16
+       {
+               .mfr_id         = MANUFACTURER_AMD,
+               .dev_id         = AM29LV400BB,
+               .name           = "AMD AM29LV400BB",
+               .uaddr          = {
+                       [1] = MTD_UADDR_0x0555_0x02AA /* x16 */
+               },
+               .DevSize        = SIZE_512KiB,
+               .CmdSet         = CFI_CMDSET_AMD_LEGACY,
+               .NumEraseRegions= 4,
+               .regions        = {
+                       ERASEINFO(0x04000,1),
+                       ERASEINFO(0x02000,2),
+                       ERASEINFO(0x08000,1),
+                       ERASEINFO(0x10000,7),
+               }
+       },
+#endif
 };
 
 static inline void fill_info(flash_info_t *info, const struct amd_flash_info *jedec_entry, ulong base)
index 151f535..2da1d46 100644 (file)
@@ -931,7 +931,7 @@ static int nand_write_page (struct mtd_info *mtd, struct nand_chip *this, int pa
                        for (i = 0; i < eccbytes; i++, eccidx++)
                                oob_buf[oob_config[eccidx]] = ecc_code[i];
                        /* If the hardware ecc provides syndromes then
-                        * the ecc code must be written immidiately after
+                        * the ecc code must be written immediately after
                         * the data bytes (words) */
                        if (this->options & NAND_HWECC_SYNDROME)
                                this->write_buf(mtd, ecc_code, eccbytes);
@@ -1299,7 +1299,7 @@ static int nand_read_ecc (struct mtd_info *mtd, loff_t from, size_t len,
                                for (i = 0, j = 0; j < mtd->oobavail; i++) {
                                        int from = oobsel->oobfree[i][0];
                                        int num = oobsel->oobfree[i][1];
-                                       memcpy(&oob_buf[oob], &oob_data[from], num);
+                                       memcpy(&oob_buf[oob+j], &oob_data[from], num);
                                        j+= num;
                                }
                                oob += mtd->oobavail;
@@ -1644,8 +1644,10 @@ static int nand_write_ecc (struct mtd_info *mtd, loff_t to, size_t len,
        this->select_chip(mtd, chipnr);
 
        /* Check, if it is write protected */
-       if (nand_check_wp(mtd))
+       if (nand_check_wp(mtd)) {
+               printk (KERN_NOTICE "nand_write_ecc: Device is write protected\n");
                goto out;
+       }
 
        /* if oobsel is NULL, use chip defaults */
        if (oobsel == NULL)
@@ -2486,12 +2488,9 @@ int nand_scan (struct mtd_info *mtd, int maxchips)
 
        /* The number of bytes available for the filesystem to place fs dependend
         * oob data */
-       if (this->options & NAND_BUSWIDTH_16) {
-               mtd->oobavail = mtd->oobsize - (this->autooob->eccbytes + 2);
-               if (this->autooob->eccbytes & 0x01)
-                       mtd->oobavail--;
-       } else
-               mtd->oobavail = mtd->oobsize - (this->autooob->eccbytes + 1);
+       mtd->oobavail = 0;
+       for (i=0; this->autooob->oobfree[i][1]; i++)
+               mtd->oobavail += this->autooob->oobfree[i][1];
 
        /*
         * check ECC mode, default to software
index 6d7e347..524b6b1 100644 (file)
@@ -67,8 +67,6 @@ struct nand_flash_dev nand_flash_ids[] = {
 
        {"NAND 256MiB 3,3V 8-bit",      0x71, 512, 256, 0x4000, 0},
 
-       {"NAND 512MiB 3,3V 8-bit",      0xDC, 512, 512, 0x4000, 0},
-
        /* These are the new chips with large page size. The pagesize
        * and the erasesize is determined from the extended id bytes
        */
index d4003a2..174384e 100644 (file)
 #include <asm/io.h>
 #include <asm/errno.h>
 
+/* It should access 16-bit instead of 8-bit */
+static inline void *memcpy(void *dst, const void *src, unsigned int len)
+{
+       void *ret = dst;
+       short *d = dst;
+       const short *s = src;
+
+       len >>= 1;
+       while (len-- > 0)
+               *d++ = *s++;
+       return ret;
+}
+
 static const unsigned char ffchars[] = {
        0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
        0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 16 */
@@ -1180,6 +1193,12 @@ static int onenand_probe(struct mtd_info *mtd)
        if (maf_id != bram_maf_id || dev_id != bram_dev_id)
                return -ENXIO;
 
+       /* FIXME : Current OneNAND MTD doesn't support Flex-OneNAND */
+       if (dev_id & (1 << 9)) {
+               printk("Not yet support Flex-OneNAND\n");
+               return -ENXIO;
+       }
+
        /* Flash device information */
        onenand_print_device_info(dev_id, 0);
        this->device_id = dev_id;
index b9723fa..d5e413b 100644 (file)
@@ -27,6 +27,7 @@ LIB   := $(obj)libnet.a
 
 COBJS-y += 3c589.o
 COBJS-y += bcm570x.o bcm570x_autoneg.o 5701rls.o
+COBJS-$(CONFIG_BFIN_MAC) += bfin_mac.o
 COBJS-y += cs8900.o
 COBJS-y += dc2114x.o
 COBJS-y += dm9000x.o
@@ -34,13 +35,14 @@ COBJS-y += e1000.o
 COBJS-y += eepro100.o
 COBJS-y += enc28j60.o
 COBJS-y += fsl_mcdmafec.o
+COBJS-$(CONFIG_GRETH) += greth.o
 COBJS-y += inca-ip_sw.o
 COBJS-y += ks8695eth.o
 COBJS-y += lan91c96.o
 COBJS-y += macb.o
 COBJS-y += mcffec.o
 COBJS-y += natsemi.o
-COBJS-y += ne2000.o
+COBJS-$(CONFIG_DRIVER_NE2000) += ne2000.o
 COBJS-y += netarm_eth.o
 COBJS-y += netconsole.o
 COBJS-y += ns7520_eth.o
@@ -53,10 +55,14 @@ COBJS-y += rtl8139.o
 COBJS-y += rtl8169.o
 COBJS-y += s3c4510b_eth.o
 COBJS-y += smc91111.o
+COBJS-y += smc911x.o
 COBJS-y += tigon3.o
 COBJS-y += tsec.o
 COBJS-y += tsi108_eth.o
 COBJS-y += uli526x.o
+COBJS-y += vsc7385.o
+COBJS-$(CONFIG_XILINX_EMAC) += xilinx_emac.o
+COBJS-$(CONFIG_XILINX_EMACLITE) += xilinx_emaclite.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
diff --git a/drivers/net/ax88796.h b/drivers/net/ax88796.h
new file mode 100644 (file)
index 0000000..0e6f8a2
--- /dev/null
@@ -0,0 +1,217 @@
+/*
+ * AX88796L(NE2000) support
+ *
+ * (c) 2007 Nobuhiro Iwamatsu <iwamatsu@nigauri.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 __DRIVERS_AX88796L_H__
+#define __DRIVERS_AX88796L_H__
+
+#define DP_DATA                (0x10 << 1)
+#define START_PG       0x40    /* First page of TX buffer */
+#define START_PG2      0x48
+#define STOP_PG                0x80    /* Last page +1 of RX ring */
+#define TX_PAGES       12
+#define RX_START       (START_PG+TX_PAGES)
+#define RX_END         STOP_PG
+
+#define AX88796L_BASE_ADDRESS  CONFIG_DRIVER_NE2000_BASE
+#define AX88796L_BYTE_ACCESS   0x00001000
+#define AX88796L_OFFSET                0x00000400
+#define AX88796L_ADDRESS_BYTE  AX88796L_BASE_ADDRESS + \
+               AX88796L_BYTE_ACCESS + AX88796L_OFFSET
+#define AX88796L_REG_MEMR      AX88796L_ADDRESS_BYTE + (0x14<<1)
+#define AX88796L_REG_CR                AX88796L_ADDRESS_BYTE + (0x00<<1)
+
+#define AX88796L_CR            (*(vu_short *)(AX88796L_REG_CR))
+#define AX88796L_MEMR          (*(vu_short *)(AX88796L_REG_MEMR))
+
+#define EECS_HIGH              (AX88796L_MEMR |= 0x10)
+#define EECS_LOW               (AX88796L_MEMR &= 0xef)
+#define EECLK_HIGH             (AX88796L_MEMR |= 0x80)
+#define EECLK_LOW              (AX88796L_MEMR &= 0x7f)
+#define EEDI_HIGH              (AX88796L_MEMR |= 0x20)
+#define EEDI_LOW               (AX88796L_MEMR &= 0xdf)
+#define EEDO                   ((AX88796L_MEMR & 0x40)>>6)
+
+#define PAGE0_SET              (AX88796L_CR &= 0x3f)
+#define PAGE1_SET              (AX88796L_CR = (AX88796L_CR & 0x3f) | 0x40)
+
+#define BIT_DUMMY      0
+#define MAC_EEP_READ   1
+#define MAC_EEP_WRITE  2
+#define MAC_EEP_ERACE  3
+#define MAC_EEP_EWEN   4
+#define MAC_EEP_EWDS   5
+
+/* R7780MP Specific code */
+#if defined(CONFIG_R7780MP)
+#define ISA_OFFSET     0x1400
+#define DP_IN(_b_, _o_, _d_)   (_d_) = \
+       *( (vu_short *) ((_b_) + ((_o_) * 2) + ISA_OFFSET))
+#define DP_OUT(_b_, _o_, _d_) \
+       *((vu_short *)((_b_) + ((_o_) * 2) + ISA_OFFSET)) = (_d_)
+#define DP_IN_DATA(_b_, _d_)   (_d_) = *( (vu_short *) ((_b_) + ISA_OFFSET))
+#define DP_OUT_DATA(_b_, _d_)  *( (vu_short *) ((_b_)+ISA_OFFSET)) = (_d_)
+#else
+/* Please change for your target boards */
+#define ISA_OFFSET     0x0000
+#define DP_IN(_b_, _o_, _d_)   (_d_) = *( (vu_short *)((_b_)+(_o_ )+ISA_OFFSET))
+#define DP_OUT(_b_, _o_, _d_)  *((vu_short *)((_b_)+(_o_)+ISA_OFFSET)) = (_d_)
+#define DP_IN_DATA(_b_, _d_)   (_d_) = *( (vu_short *) ((_b_)+ISA_OFFSET))
+#define DP_OUT_DATA(_b_, _d_)  *( (vu_short *) ((_b_)+ISA_OFFSET)) = (_d_)
+#endif
+
+
+/*
+ * Set 1 bit data
+ */
+static void ax88796_bitset(u32 bit)
+{
+       /* DATA1 */
+       if( bit )
+               EEDI_HIGH;
+       else
+               EEDI_LOW;
+
+       EECLK_LOW;
+       udelay(1000);
+       EECLK_HIGH;
+       udelay(1000);
+       EEDI_LOW;
+}
+
+/*
+ * Get 1 bit data
+ */
+static u8 ax88796_bitget(void)
+{
+       u8 bit;
+
+       EECLK_LOW;
+       udelay(1000);
+       /* DATA */
+       bit = EEDO;
+       EECLK_HIGH;
+       udelay(1000);
+
+       return bit;
+}
+
+/*
+ * Send COMMAND to EEPROM
+ */
+static void ax88796_eep_cmd(u8 cmd)
+{
+       ax88796_bitset(BIT_DUMMY);
+       switch(cmd){
+               case MAC_EEP_READ:
+                       ax88796_bitset(1);
+                       ax88796_bitset(1);
+                       ax88796_bitset(0);
+                       break;
+
+               case MAC_EEP_WRITE:
+                       ax88796_bitset(1);
+                       ax88796_bitset(0);
+                       ax88796_bitset(1);
+                       break;
+
+               case MAC_EEP_ERACE:
+                       ax88796_bitset(1);
+                       ax88796_bitset(1);
+                       ax88796_bitset(1);
+                       break;
+
+               case MAC_EEP_EWEN:
+                       ax88796_bitset(1);
+                       ax88796_bitset(0);
+                       ax88796_bitset(0);
+                       break;
+
+               case MAC_EEP_EWDS:
+                       ax88796_bitset(1);
+                       ax88796_bitset(0);
+                       ax88796_bitset(0);
+                       break;
+               default:
+                       break;
+       }
+}
+
+static void ax88796_eep_setaddr(u16 addr)
+{
+       int i ;
+       for( i = 7 ; i >= 0 ; i-- )
+               ax88796_bitset(addr & (1 << i));
+}
+
+/*
+ * Get data from EEPROM
+ */
+static u16 ax88796_eep_getdata(void)
+{
+       ushort data = 0;
+       int i;
+
+       ax88796_bitget();       /* DUMMY */
+       for( i = 0 ; i < 16 ; i++ ){
+               data <<= 1;
+               data |= ax88796_bitget();
+       }
+       return data;
+}
+
+static void ax88796_mac_read(u8 *buff)
+{
+       int i ;
+       u16 data, addr = 0;
+
+       for( i = 0 ; i < 3; i++ )
+       {
+               EECS_HIGH;
+               EEDI_LOW;
+               udelay(1000);
+               /* READ COMMAND */
+               ax88796_eep_cmd(MAC_EEP_READ);
+               /* ADDRESS */
+               ax88796_eep_setaddr(addr++);
+               /* GET DATA */
+               data = ax88796_eep_getdata();
+               *buff++ = (uchar)(data & 0xff);
+               *buff++ = (uchar)((data >> 8) & 0xff);
+               EECLK_LOW;
+               EEDI_LOW;
+               EECS_LOW;
+       }
+}
+
+int get_prom(u8* mac_addr)
+{
+       u8 prom[32];
+       int i;
+
+       ax88796_mac_read(prom);
+       for (i = 0; i < 6; i++){
+               mac_addr[i] = prom[i];
+       }
+       return 1;
+}
+
+#endif /* __DRIVERS_AX88796L_H__ */
similarity index 77%
rename from board/bf537-stamp/ether_bf537.c
rename to drivers/net/bfin_mac.c
index 6c514c6..afe122a 100644 (file)
@@ -1,39 +1,24 @@
 /*
- * ADI Blackfin 537 MAC Ethernet
+ * Driver for Blackfin On-Chip MAC device
  *
- * Copyright (c) 2005 Analog Device, Inc.
+ * Copyright (c) 2005-2008 Analog Device, 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
+ * Licensed under the GPL-2 or later.
  */
 
 #include <common.h>
 #include <config.h>
-#include <asm/blackfin.h>
 #include <net.h>
 #include <command.h>
 #include <malloc.h>
-#include "ether_bf537.h"
 
+#include <asm/blackfin.h>
 #include <asm/mach-common/bits/dma.h>
 #include <asm/mach-common/bits/emac.h>
 #include <asm/mach-common/bits/pll.h>
 
+#include "bfin_mac.h"
+
 #ifdef CONFIG_POST
 #include <post.h>
 #endif
 #undef DEBUG_ETHERNET
 
 #ifdef DEBUG_ETHERNET
-#define DEBUGF(fmt,args...) printf(fmt,##args)
+#define DEBUGF(fmt, args...) printf(fmt, ##args)
 #else
-#define DEBUGF(fmt,args...)
+#define DEBUGF(fmt, args...)
 #endif
 
-#if defined(CONFIG_CMD_NET)
-
 #define RXBUF_BASE_ADDR                0xFF900000
 #define TXBUF_BASE_ADDR                0xFF800000
 #define TX_BUF_CNT             1
 
-#define TOUT_LOOP              1000000
+#define TOUT_LOOP              1000000
 
 ADI_ETHER_BUFFER *txbuf[TX_BUF_CNT];
 ADI_ETHER_BUFFER *rxbuf[PKTBUFSRX];
 static u16 txIdx;              /* index of the current RX buffer */
 static u16 rxIdx;              /* index of the current TX buffer */
 
-u8 SrcAddr[6];
 u16 PHYregs[NO_PHY_REGS];      /* u16 PHYADDR; */
 
 /* DMAx_CONFIG values at DMA Restart */
-const ADI_DMA_CONFIG_REG rxdmacfg = { 1, 1, 2, 0, 0, 0, 0, 5, 7 };
-
-#if 0
-       rxdmacfg.b_DMA_EN = 1;  /* enabled */
-       rxdmacfg.b_WNR    = 1;  /* write to memory */
-       rxdmacfg.b_WDSIZE = 2;  /* wordsize is 32 bits */
-       rxdmacfg.b_DMA2D  = 0;  /* N/A */
-       rxdmacfg.b_RESTART= 0;  /* N/A */
-       rxdmacfg.b_DI_SEL = 0;  /* N/A */
-       rxdmacfg.b_DI_EN  = 0;  /* no interrupt */
-       rxdmacfg.b_NDSIZE = 5;  /* 5 half words is desc size. */
-       rxdmacfg.b_FLOW   = 7;  /* large desc flow  */
-#endif
-
-const ADI_DMA_CONFIG_REG txdmacfg = { 1, 0, 2, 0, 0, 0, 0, 5, 7 };
-
-#if 0
-       txdmacfg.b_DMA_EN = 1;  /* enabled */
-       txdmacfg.b_WNR    = 0;  /* read from memory */
-       txdmacfg.b_WDSIZE = 2;  /* wordsize is 32 bits */
-       txdmacfg.b_DMA2D  = 0;  /* N/A */
-       txdmacfg.b_RESTART= 0;  /* N/A */
-       txdmacfg.b_DI_SEL = 0;  /* N/A */
-       txdmacfg.b_DI_EN  = 0;  /* no interrupt */
-       txdmacfg.b_NDSIZE = 5;  /* 5 half words is desc size. */
-       txdmacfg.b_FLOW   = 7;  /* large desc flow */
-#endif
-
-ADI_ETHER_BUFFER *SetupRxBuffer(int no);
-ADI_ETHER_BUFFER *SetupTxBuffer(int no);
-
-static int bfin_EMAC_init(struct eth_device *dev, bd_t * bd);
-static void bfin_EMAC_halt(struct eth_device *dev);
-static int bfin_EMAC_send(struct eth_device *dev, volatile void *packet,
-                         int length);
-static int bfin_EMAC_recv(struct eth_device *dev);
-
-int bfin_EMAC_initialize(bd_t * bis)
+const ADI_DMA_CONFIG_REG rxdmacfg = {
+       .b_DMA_EN  = 1, /* enabled */
+       .b_WNR     = 1, /* write to memory */
+       .b_WDSIZE  = 2, /* wordsize is 32 bits */
+       .b_DMA2D   = 0,
+       .b_RESTART = 0,
+       .b_DI_SEL  = 0,
+       .b_DI_EN   = 0, /* no interrupt */
+       .b_NDSIZE  = 5, /* 5 half words is desc size */
+       .b_FLOW    = 7  /* large desc flow */
+};
+
+const ADI_DMA_CONFIG_REG txdmacfg = {
+       .b_DMA_EN  = 1, /* enabled */
+       .b_WNR     = 0, /* read from memory */
+       .b_WDSIZE  = 2, /* wordsize is 32 bits */
+       .b_DMA2D   = 0,
+       .b_RESTART = 0,
+       .b_DI_SEL  = 0,
+       .b_DI_EN   = 0, /* no interrupt */
+       .b_NDSIZE  = 5, /* 5 half words is desc size */
+       .b_FLOW    = 7  /* large desc flow */
+};
+
+int bfin_EMAC_initialize(bd_t *bis)
 {
        struct eth_device *dev;
        dev = (struct eth_device *)malloc(sizeof(*dev));
@@ -108,7 +77,7 @@ int bfin_EMAC_initialize(bd_t * bis)
                hang();
 
        memset(dev, 0, sizeof(*dev));
-       sprintf(dev->name, "BF537 ETHERNET");
+       sprintf(dev->name, "Blackfin EMAC");
 
        dev->iobase = 0;
        dev->priv = 0;
@@ -165,7 +134,7 @@ static int bfin_EMAC_send(struct eth_device *dev, volatile void *packet,
                txIdx = 0;
        else
                txIdx++;
     out:
+ out:
        DEBUGF("BFIN EMAC send: length = %d\n", length);
        return result;
 }
@@ -212,7 +181,7 @@ static int bfin_EMAC_recv(struct eth_device *dev)
  *
  *************************************************************/
 
-static int bfin_EMAC_init(struct eth_device *dev, bd_t * bd)
+static int bfin_EMAC_init(struct eth_device *dev, bd_t *bd)
 {
        u32 opmode;
        int dat;
@@ -227,7 +196,7 @@ static int bfin_EMAC_init(struct eth_device *dev, bd_t * bd)
                return -1;
 
 /* Initialize EMAC address */
-       SetupMacAddr(SrcAddr);
+       bfin_EMAC_setup_addr(bd);
 
 /* Initialize TX and RX buffer */
        for (i = 0; i < PKTBUFSRX; i++) {
@@ -289,37 +258,25 @@ static void bfin_EMAC_halt(struct eth_device *dev)
 
 }
 
-void SetupMacAddr(u8 * MACaddr)
+void bfin_EMAC_setup_addr(bd_t *bd)
 {
-       char *tmp, *end;
-       int i;
-       /* this depends on a little-endian machine */
-       tmp = getenv("ethaddr");
-       if (tmp) {
-               for (i = 0; i < 6; i++) {
-                       MACaddr[i] = tmp ? simple_strtoul(tmp, &end, 16) : 0;
-                       if (tmp)
-                               tmp = (*end) ? end + 1 : end;
-               }
-
-#ifndef CONFIG_NETCONSOLE
-               printf("Using MAC Address %02X:%02X:%02X:%02X:%02X:%02X\n",
-                      MACaddr[0], MACaddr[1],
-                      MACaddr[2], MACaddr[3], MACaddr[4], MACaddr[5]);
-#endif
-               *pEMAC_ADDRLO = MACaddr[0] | MACaddr[1] << 8 |
-                   MACaddr[2] << 16 | MACaddr[3] << 24;
-               *pEMAC_ADDRHI = MACaddr[4] | MACaddr[5] << 8;
-       }
+       *pEMAC_ADDRLO =
+               bd->bi_enetaddr[0] |
+               bd->bi_enetaddr[1] << 8 |
+               bd->bi_enetaddr[2] << 16 |
+               bd->bi_enetaddr[3] << 24;
+       *pEMAC_ADDRHI =
+               bd->bi_enetaddr[4] |
+               bd->bi_enetaddr[5] << 8;
 }
 
-void PollMdcDone(void)
+static void PollMdcDone(void)
 {
        /* poll the STABUSY bit */
        while (*pEMAC_STAADD & STABUSY) ;
 }
 
-void WrPHYReg(u16 PHYAddr, u16 RegAddr, u16 Data)
+static void WrPHYReg(u16 PHYAddr, u16 RegAddr, u16 Data)
 {
        PollMdcDone();
 
@@ -332,7 +289,7 @@ void WrPHYReg(u16 PHYAddr, u16 RegAddr, u16 Data)
 /*********************************************************************************
  *             Read an off-chip register in a PHY through the MDC/MDIO port     *
  *********************************************************************************/
-u16 RdPHYReg(u16 PHYAddr, u16 RegAddr)
+static u16 RdPHYReg(u16 PHYAddr, u16 RegAddr)
 {
        u16 Data;
 
@@ -350,7 +307,8 @@ u16 RdPHYReg(u16 PHYAddr, u16 RegAddr)
        return Data;
 }
 
-void SoftResetPHY(void)
+#if 0 /* dead code ? */
+static void SoftResetPHY(void)
 {
        u16 phydat;
        /* set the reset bit */
@@ -362,13 +320,30 @@ void SoftResetPHY(void)
                phydat = RdPHYReg(PHYADDR, PHY_MODECTL);
        } while ((phydat & PHY_RESET) != 0);
 }
+#endif
 
-int SetupSystemRegs(int *opmode)
+static int SetupSystemRegs(int *opmode)
 {
        u16 sysctl, phydat;
        int count = 0;
        /* Enable PHY output */
        *pVR_CTL |= CLKBUFOE;
+       /* Set all the pins to peripheral mode */
+
+#ifndef CONFIG_BFIN_MAC_RMII
+       *pPORTH_FER = 0xFFFF;
+#ifdef __ADSPBF52x__
+       *pPORTH_MUX = PORT_x_MUX_0_FUNC_2 | PORT_x_MUX_1_FUNC_2 | PORT_x_MUX_2_FUNC_2;
+#endif
+#else
+#if defined(__ADSPBF536__) || defined(__ADSPBF537__)
+       *pPORTH_FER = 0xC373;
+#endif
+#ifdef __ADSPBF52x__
+       *pPORTH_FER = 0x01FF;
+       *pPORTH_MUX = PORT_x_MUX_0_FUNC_2 | PORT_x_MUX_1_FUNC_2;
+#endif
+#endif
        /* MDC  = 2.5 MHz */
        sysctl = SET_MDCDIV(24);
        /* Odd word alignment for Receive Frame DMA word */
@@ -546,4 +521,3 @@ int ether_post_test(int flags)
        return 0;
 }
 #endif
-#endif
similarity index 70%
rename from board/bf537-stamp/ether_bf537.h
rename to drivers/net/bfin_mac.h
index 22fc392..c8a94d0 100644 (file)
@@ -1,3 +1,14 @@
+/*
+ * bfin_mac.h - some defines/structures for the Blackfin on-chip MAC.
+ *
+ * Copyright (c) 2005-2008 Analog Device, Inc.
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#ifndef __BFIN_MAC_H__
+#define __BFIN_MAC_H__
+
 #define PHYADDR                        0x01
 #define NO_PHY_REGS            0x20
 
@@ -60,12 +71,19 @@ typedef struct adi_ether_buffer {
 } ADI_ETHER_BUFFER;
 /* 40 bytes/struct in 44 bytes */
 
-void SetupMacAddr(u8 * MACaddr);
+static ADI_ETHER_BUFFER *SetupRxBuffer(int no);
+static ADI_ETHER_BUFFER *SetupTxBuffer(int no);
+
+static int bfin_EMAC_init(struct eth_device *dev, bd_t *bd);
+static void bfin_EMAC_halt(struct eth_device *dev);
+static int bfin_EMAC_send(struct eth_device *dev, volatile void *packet, int length);
+static int bfin_EMAC_recv(struct eth_device *dev);
+
+static void PollMdcDone(void);
+static void WrPHYReg(u16 PHYAddr, u16 RegAddr, u16 Data);
+static u16 RdPHYReg(u16 PHYAddr, u16 RegAddr);
+static int SetupSystemRegs(int *opmode);
 
-void PollMdcDone(void);
-void WrPHYReg(u16 PHYAddr, u16 RegAddr, u16 Data);
-u16 RdPHYReg(u16 PHYAddr, u16 RegAddr);
-void SoftResetPHY(void);
-void DumpPHYRegs(void);
+static void bfin_EMAC_setup_addr(bd_t *bd);
 
-int SetupSystemRegs(int *opmode);
+#endif
index f0741da..c53c226 100644 (file)
@@ -1,5 +1,5 @@
 /**************************************************************************
-Inter Pro 1000 for ppcboot/das-u-boot
+Intel Pro 1000 for ppcboot/das-u-boot
 Drivers are port from Intel's Linux driver e1000-4.3.15
 and from Etherboot pro 1000 driver by mrakes at vivato dot net
 tested on both gig copper and gig fiber boards
@@ -21,7 +21,7 @@ tested on both gig copper and gig fiber boards
 
   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.
+  Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
   The full GNU General Public License is included in this distribution in the
   file called LICENSE.
@@ -52,7 +52,7 @@ tested on both gig copper and gig fiber boards
 #undef virt_to_bus
 #define        virt_to_bus(x)  ((unsigned long)x)
 #define bus_to_phys(devno, a)  pci_mem_to_phys(devno, a)
-#define mdelay(n)       udelay((n)*1000)
+#define mdelay(n)      udelay((n)*1000)
 
 #define E1000_DEFAULT_PBA    0x00000030
 
@@ -82,6 +82,7 @@ static struct pci_device_id supported[] = {
        {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82545EM_FIBER},
        {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82546EB_FIBER},
        {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82540EM_LOM},
+       {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82541ER},
 };
 
 /* Function forward declarations */
@@ -512,6 +513,11 @@ e1000_read_mac_addr(struct eth_device *nic)
                /* Invert the last bit if this is the second device */
                nic->enetaddr[5] += 1;
        }
+#ifdef CONFIG_E1000_FALLBACK_MAC
+       if ( *(u32*)(nic->enetaddr) == 0 || *(u32*)(nic->enetaddr) == ~0 )
+               for ( i=0; i < NODE_ADDRESS_SIZE; i++ )
+                       nic->enetaddr[i] = (CONFIG_E1000_FALLBACK_MAC >> (8*(5-i))) & 0xff;
+#endif
 #else
        /*
         * The AP1000's e1000 has no eeprom; the MAC address is stored in the
@@ -639,6 +645,9 @@ e1000_set_mac_type(struct e1000_hw *hw)
        case E1000_DEV_ID_82546EB_FIBER:
                hw->mac_type = e1000_82546;
                break;
+       case E1000_DEV_ID_82541ER:
+               hw->mac_type = e1000_82541_rev_2;
+               break;
        default:
                /* Should never have loaded on this device */
                return -E1000_ERR_MAC_TYPE;
@@ -1052,12 +1061,12 @@ e1000_setup_fiber_link(struct eth_device *nic)
         * configure the two flow control enable bits in the CTRL register.
         *
         * The possible values of the "fc" parameter are:
-        *      0:  Flow control is completely disabled
-        *      1:  Rx flow control is enabled (we can receive pause frames, but
-        *          not send pause frames).
-        *      2:  Tx flow control is enabled (we can send pause frames but we do
-        *          not support receiving pause frames).
-        *      3:  Both Rx and TX flow control (symmetric) are enabled.
+        *      0:  Flow control is completely disabled
+        *      1:  Rx flow control is enabled (we can receive pause frames, but
+        *          not send pause frames).
+        *      2:  Tx flow control is enabled (we can send pause frames but we do
+        *          not support receiving pause frames).
+        *      3:  Both Rx and TX flow control (symmetric) are enabled.
         */
        switch (hw->fc) {
        case e1000_fc_none:
@@ -1220,7 +1229,7 @@ e1000_setup_copper_link(struct eth_device *nic)
 #if 0
        /* Options:
         *   disable_polarity_correction = 0 (default)
-        *       Automatic Correction for Reversed Cable Polarity
+        *       Automatic Correction for Reversed Cable Polarity
         *   0 - Disabled
         *   1 - Enabled
         */
@@ -1262,14 +1271,14 @@ e1000_setup_copper_link(struct eth_device *nic)
 
        /* Options:
         *   autoneg = 1 (default)
-        *      PHY will advertise value(s) parsed from
-        *      autoneg_advertised and fc
+        *      PHY will advertise value(s) parsed from
+        *      autoneg_advertised and fc
         *   autoneg = 0
-        *      PHY will be set to 10H, 10F, 100H, or 100F
-        *      depending on value parsed from forced_speed_duplex.
+        *      PHY will be set to 10H, 10F, 100H, or 100F
+        *      depending on value parsed from forced_speed_duplex.
         */
 
-       /* Is autoneg enabled?  This is enabled by default or by software override.
+       /* Is autoneg enabled?  This is enabled by default or by software override.
         * If so, call e1000_phy_setup_autoneg routine to parse the
         * autoneg_advertised and fc options. If autoneg is NOT enabled, then the
         * user should have provided a speed/duplex override.  If so, then call
@@ -1344,11 +1353,11 @@ e1000_setup_copper_link(struct eth_device *nic)
                if (phy_data & MII_SR_LINK_STATUS) {
                        /* We have link, so we need to finish the config process:
                         *   1) Set up the MAC to the current PHY speed/duplex
-                        *      if we are on 82543.  If we
-                        *      are on newer silicon, we only need to configure
-                        *      collision distance in the Transmit Control Register.
+                        *      if we are on 82543.  If we
+                        *      are on newer silicon, we only need to configure
+                        *      collision distance in the Transmit Control Register.
                         *   2) Set up flow control on the MAC to that established with
-                        *      the link partner.
+                        *      the link partner.
                         */
                        if (hw->mac_type >= e1000_82544) {
                                e1000_config_collision_dist(hw);
@@ -1409,7 +1418,7 @@ e1000_phy_setup_autoneg(struct e1000_hw *hw)
 
        /* First we clear all the 10/100 mb speed bits in the Auto-Neg
         * Advertisement Register (Address 4) and the 1000 mb speed bits in
-        * the  1000Base-T Control Register (Address 9).
+        * the  1000Base-T Control Register (Address 9).
         */
        mii_autoneg_adv_reg &= ~REG4_SPEED_MASK;
        mii_1000t_ctrl_reg &= ~REG9_SPEED_MASK;
@@ -1459,14 +1468,14 @@ e1000_phy_setup_autoneg(struct e1000_hw *hw)
         * Advertisement Register (PHY_AUTONEG_ADV) and re-start auto-negotiation.
         *
         * The possible values of the "fc" parameter are:
-        *      0:  Flow control is completely disabled
-        *      1:  Rx flow control is enabled (we can receive pause frames
-        *          but not send pause frames).
-        *      2:  Tx flow control is enabled (we can send pause frames
-        *          but we do not support receiving pause frames).
-        *      3:  Both Rx and TX flow control (symmetric) are enabled.
+        *      0:  Flow control is completely disabled
+        *      1:  Rx flow control is enabled (we can receive pause frames
+        *          but not send pause frames).
+        *      2:  Tx flow control is enabled (we can send pause frames
+        *          but we do not support receiving pause frames).
+        *      3:  Both Rx and TX flow control (symmetric) are enabled.
         *  other:  No software override.  The flow control configuration
-        *          in the EEPROM is used.
+        *          in the EEPROM is used.
         */
        switch (hw->fc) {
        case e1000_fc_none:     /* 0 */
@@ -1621,12 +1630,12 @@ e1000_force_mac_fc(struct e1000_hw *hw)
         * according to the "hw->fc" parameter.
         *
         * The possible values of the "fc" parameter are:
-        *      0:  Flow control is completely disabled
-        *      1:  Rx flow control is enabled (we can receive pause
-        *          frames but not send pause frames).
-        *      2:  Tx flow control is enabled (we can send pause frames
-        *          frames but we do not receive pause frames).
-        *      3:  Both Rx and TX flow control (symmetric) is enabled.
+        *      0:  Flow control is completely disabled
+        *      1:  Rx flow control is enabled (we can receive pause
+        *          frames but not send pause frames).
+        *      2:  Tx flow control is enabled (we can send pause frames
+        *          frames but we do not receive pause frames).
+        *      3:  Both Rx and TX flow control (symmetric) is enabled.
         *  other:  No other values should be possible at this point.
         */
 
@@ -1743,14 +1752,14 @@ e1000_config_fc_after_link_up(struct e1000_hw *hw)
                         *   LOCAL DEVICE  |   LINK PARTNER
                         * PAUSE | ASM_DIR | PAUSE | ASM_DIR | NIC Resolution
                         *-------|---------|-------|---------|--------------------
-                        *   0   |    0    |  DC   |   DC    | e1000_fc_none
-                        *   0   |    1    |   0   |   DC    | e1000_fc_none
-                        *   0   |    1    |   1   |    0    | e1000_fc_none
-                        *   0   |    1    |   1   |    1    | e1000_fc_tx_pause
-                        *   1   |    0    |   0   |   DC    | e1000_fc_none
-                        *   1   |   DC    |   1   |   DC    | e1000_fc_full
-                        *   1   |    1    |   0   |    0    | e1000_fc_none
-                        *   1   |    1    |   0   |    1    | e1000_fc_rx_pause
+                        *   0   |    0    |  DC   |   DC    | e1000_fc_none
+                        *   0   |    1    |   0   |   DC    | e1000_fc_none
+                        *   0   |    1    |   1   |    0    | e1000_fc_none
+                        *   0   |    1    |   1   |    1    | e1000_fc_tx_pause
+                        *   1   |    0    |   0   |   DC    | e1000_fc_none
+                        *   1   |   DC    |   1   |   DC    | e1000_fc_full
+                        *   1   |    1    |   0   |    0    | e1000_fc_none
+                        *   1   |    1    |   0   |    1    | e1000_fc_rx_pause
                         *
                         */
                        /* Are both PAUSE bits set to 1?  If so, this implies
@@ -1762,7 +1771,7 @@ e1000_config_fc_after_link_up(struct e1000_hw *hw)
                         *   LOCAL DEVICE  |   LINK PARTNER
                         * PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result
                         *-------|---------|-------|---------|--------------------
-                        *   1   |   DC    |   1   |   DC    | e1000_fc_full
+                        *   1   |   DC    |   1   |   DC    | e1000_fc_full
                         *
                         */
                        if ((mii_nway_adv_reg & NWAY_AR_PAUSE) &&
@@ -1787,7 +1796,7 @@ e1000_config_fc_after_link_up(struct e1000_hw *hw)
                         *   LOCAL DEVICE  |   LINK PARTNER
                         * PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result
                         *-------|---------|-------|---------|--------------------
-                        *   0   |    1    |   1   |    1    | e1000_fc_tx_pause
+                        *   0   |    1    |   1   |    1    | e1000_fc_tx_pause
                         *
                         */
                        else if (!(mii_nway_adv_reg & NWAY_AR_PAUSE) &&
@@ -1804,7 +1813,7 @@ e1000_config_fc_after_link_up(struct e1000_hw *hw)
                         *   LOCAL DEVICE  |   LINK PARTNER
                         * PAUSE | ASM_DIR | PAUSE | ASM_DIR | Result
                         *-------|---------|-------|---------|--------------------
-                        *   1   |    1    |   0   |    1    | e1000_fc_rx_pause
+                        *   1   |    1    |   0   |    1    | e1000_fc_rx_pause
                         *
                         */
                        else if ((mii_nway_adv_reg & NWAY_AR_PAUSE) &&
@@ -1846,7 +1855,7 @@ e1000_config_fc_after_link_up(struct e1000_hw *hw)
                                    ("Flow Control = RX PAUSE frames only.\r\n");
                        }
 
-                       /* Now we need to do one last check...  If we auto-
+                       /* Now we need to do one last check...  If we auto-
                         * negotiated to HALF DUPLEX, flow control should not be
                         * enabled per IEEE 802.3 spec.
                         */
@@ -1910,7 +1919,7 @@ e1000_check_for_link(struct eth_device *nic)
 
        /* If we have a copper PHY then we only want to go out to the PHY
         * registers to see if Auto-Neg has completed and/or if our link
-        * status has changed.  The get_link_status flag will be set if we
+        * status has changed.  The get_link_status flag will be set if we
         * receive a Link Status Change interrupt or we have Rx Sequence
         * Errors.
         */
@@ -1967,7 +1976,7 @@ e1000_check_for_link(struct eth_device *nic)
 
                /* At this point we know that we are on copper and we have
                 * auto-negotiated link.  These are conditions for checking the link
-                * parter capability register.  We use the link partner capability to
+                * parter capability register.  We use the link partner capability to
                 * determine if TBI Compatibility needs to be turned on or off.  If
                 * the link partner advertises any speed in addition to Gigabit, then
                 * we assume that they are GMII-based, and TBI compatibility is not
@@ -2485,6 +2494,35 @@ e1000_phy_reset(struct e1000_hw *hw)
        return 0;
 }
 
+static int e1000_set_phy_type (struct e1000_hw *hw)
+{
+       DEBUGFUNC ();
+
+       if (hw->mac_type == e1000_undefined)
+               return -E1000_ERR_PHY_TYPE;
+
+       switch (hw->phy_id) {
+       case M88E1000_E_PHY_ID:
+       case M88E1000_I_PHY_ID:
+       case M88E1011_I_PHY_ID:
+               hw->phy_type = e1000_phy_m88;
+               break;
+       case IGP01E1000_I_PHY_ID:
+               if (hw->mac_type == e1000_82541 ||
+                   hw->mac_type == e1000_82541_rev_2) {
+                       hw->phy_type = e1000_phy_igp;
+                       break;
+               }
+               /* Fall Through */
+       default:
+               /* Should never have loaded on this device */
+               hw->phy_type = e1000_phy_undefined;
+               return -E1000_ERR_PHY_TYPE;
+       }
+
+       return E1000_SUCCESS;
+}
+
 /******************************************************************************
 * Probes the expected PHY address for known PHY IDs
 *
@@ -2493,6 +2531,7 @@ e1000_phy_reset(struct e1000_hw *hw)
 static int
 e1000_detect_gig_phy(struct e1000_hw *hw)
 {
+       int32_t phy_init_status;
        uint16_t phy_id_high, phy_id_low;
        int match = FALSE;
 
@@ -2526,11 +2565,19 @@ e1000_detect_gig_phy(struct e1000_hw *hw)
                if (hw->phy_id == M88E1011_I_PHY_ID)
                        match = TRUE;
                break;
+       case e1000_82541_rev_2:
+               if(hw->phy_id == IGP01E1000_I_PHY_ID)
+                       match = TRUE;
+
+               break;
        default:
                DEBUGOUT("Invalid MAC type %d\n", hw->mac_type);
                return -E1000_ERR_CONFIG;
        }
-       if (match) {
+
+       phy_init_status = e1000_set_phy_type(hw);
+
+       if ((match) && (phy_init_status == E1000_SUCCESS)) {
                DEBUGOUT("PHY ID 0x%X detected\n", hw->phy_id);
                return 0;
        }
@@ -2777,8 +2824,8 @@ e1000_configure_rx(struct e1000_hw *hw)
 #endif
                /* Set the interrupt throttling rate.  Value is calculated
                 * as DEFAULT_ITR = 1/(MAX_INTS_PER_SEC * 256ns) */
-#define MAX_INTS_PER_SEC        8000
-#define DEFAULT_ITR             1000000000/(MAX_INTS_PER_SEC * 256)
+#define MAX_INTS_PER_SEC       8000
+#define DEFAULT_ITR            1000000000/(MAX_INTS_PER_SEC * 256)
                E1000_WRITE_REG(hw, ITR, DEFAULT_ITR);
        }
 
@@ -2985,7 +3032,7 @@ e1000_initialize(bd_t * bis)
                        free(nic);
                        return 0;
                }
-#ifndef CONFIG_AP1000
+#if !(defined(CONFIG_AP1000) || defined(CONFIG_MVBC_1G))
                if (e1000_validate_eeprom_checksum(nic) < 0) {
                        printf("The EEPROM Checksum Is Not Valid\n");
                        free(hw);
index 0fbdc90..822afc5 100644 (file)
@@ -71,6 +71,8 @@ typedef enum {
        e1000_82540,
        e1000_82545,
        e1000_82546,
+       e1000_82541,
+       e1000_82541_rev_2,
        e1000_num_macs
 } e1000_mac_type;
 
@@ -168,6 +170,13 @@ typedef enum {
        e1000_1000t_rx_status_undefined = 0xFF
 } e1000_1000t_rx_status;
 
+typedef enum {
+    e1000_phy_m88 = 0,
+    e1000_phy_igp,
+    e1000_phy_igp_2,
+    e1000_phy_undefined = 0xFF
+} e1000_phy_type;
+
 struct e1000_phy_info {
        e1000_cable_length cable_length;
        e1000_10bt_ext_dist_enable extended_10bt_distance;
@@ -184,14 +193,19 @@ struct e1000_phy_stats {
 };
 
 /* Error Codes */
-#define E1000_SUCCESS      0
-#define E1000_ERR_EEPROM   1
-#define E1000_ERR_PHY      2
-#define E1000_ERR_CONFIG   3
-#define E1000_ERR_PARAM    4
-#define E1000_ERR_MAC_TYPE 5
-#define E1000_ERR_NOLINK   6
-#define E1000_ERR_TIMEOUT  7
+#define E1000_SUCCESS                          0
+#define E1000_ERR_EEPROM                       1
+#define E1000_ERR_PHY                          2
+#define E1000_ERR_CONFIG                       3
+#define E1000_ERR_PARAM                        4
+#define E1000_ERR_MAC_TYPE                     5
+#define E1000_ERR_PHY_TYPE                     6
+#define E1000_ERR_NOLINK                       7
+#define E1000_ERR_TIMEOUT                      8
+#define E1000_ERR_RESET                        9
+#define E1000_ERR_MASTER_REQUESTS_PENDING      10
+#define E1000_ERR_HOST_INTERFACE_COMMAND       11
+#define E1000_BLK_PHY_RESET                    12
 
 /* PCI Device IDs */
 #define E1000_DEV_ID_82542          0x1000
@@ -207,7 +221,8 @@ struct e1000_phy_stats {
 #define E1000_DEV_ID_82545EM_FIBER  0x1011
 #define E1000_DEV_ID_82546EB_COPPER 0x1010
 #define E1000_DEV_ID_82546EB_FIBER  0x1012
-#define NUM_DEV_IDS 13
+#define E1000_DEV_ID_82541ER        0x1078
+#define NUM_DEV_IDS 14
 
 #define NODE_ADDRESS_SIZE 6
 #define ETH_LENGTH_OF_ADDRESS 6
@@ -799,6 +814,8 @@ struct e1000_hw {
        pci_dev_t pdev;
        uint8_t *hw_addr;
        e1000_mac_type mac_type;
+       e1000_phy_type phy_type;
+       uint32_t phy_init_script;
        e1000_media_type media_type;
        e1000_lan_loc lan_loc;
        e1000_fc_type fc;
@@ -1517,7 +1534,22 @@ struct e1000_hw {
 #define M88E1000_EXT_PHY_SPEC_CTRL 0x14        /* Extended PHY Specific Control */
 #define M88E1000_RX_ERR_CNTR       0x15        /* Receive Error Counter */
 
-#define MAX_PHY_REG_ADDRESS 0x1F       /* 5 bit address bus (0-0x1F) */
+#define MAX_PHY_REG_ADDRESS    0x1F    /* 5 bit address bus (0-0x1F) */
+
+/* IGP01E1000 specifics */
+#define IGP01E1000_IEEE_REGS_PAGE      0x0000
+#define IGP01E1000_IEEE_RESTART_AUTONEG 0x3300
+#define IGP01E1000_IEEE_FORCE_GIGA      0x0140
+
+/* IGP01E1000 Specific Registers */
+#define IGP01E1000_PHY_PORT_CONFIG     0x10 /* PHY Specific Port Config Register */
+#define IGP01E1000_PHY_PORT_STATUS     0x11 /* PHY Specific Status Register */
+#define IGP01E1000_PHY_PORT_CTRL       0x12 /* PHY Specific Control Register */
+#define IGP01E1000_PHY_LINK_HEALTH     0x13 /* PHY Link Health Register */
+#define IGP01E1000_GMII_FIFO           0x14 /* GMII FIFO Register */
+#define IGP01E1000_PHY_CHANNEL_QUALITY         0x15 /* PHY Channel Quality Register */
+#define IGP02E1000_PHY_POWER_MGMT              0x19
+#define IGP01E1000_PHY_PAGE_SELECT             0x1F /* PHY Page Select Core Register */
 
 /* PHY Control Register */
 #define MII_CR_SPEED_SELECT_MSB 0x0040 /* bits 6,13: 10=1000, 01=100, 00=10 */
@@ -1729,6 +1761,7 @@ struct e1000_hw {
 #define M88E1011_I_PHY_ID  0x01410C20
 #define M88E1000_12_PHY_ID M88E1000_E_PHY_ID
 #define M88E1000_14_PHY_ID M88E1000_E_PHY_ID
+#define IGP01E1000_I_PHY_ID  0x02A80380
 
 /* Miscellaneous PHY bit definitions. */
 #define PHY_PREAMBLE        0xFFFFFFFF
diff --git a/drivers/net/greth.c b/drivers/net/greth.c
new file mode 100644 (file)
index 0000000..76ece59
--- /dev/null
@@ -0,0 +1,661 @@
+/* Gaisler.com GRETH 10/100/1000 Ethernet MAC driver
+ *
+ * Driver use polling mode (no Interrupt)
+ *
+ * (C) Copyright 2007
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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 <command.h>
+#include <net.h>
+#include <malloc.h>
+#include <asm/processor.h>
+#include <ambapp.h>
+#include <asm/leon.h>
+
+/* #define DEBUG */
+
+#include "greth.h"
+
+/* Default to 3s timeout on autonegotiation */
+#ifndef GRETH_PHY_TIMEOUT_MS
+#define GRETH_PHY_TIMEOUT_MS 3000
+#endif
+
+/* ByPass Cache when reading regs */
+#define GRETH_REGLOAD(addr)            SPARC_NOCACHE_READ(addr)
+/* Write-through cache ==> no bypassing needed on writes */
+#define GRETH_REGSAVE(addr,data)       (*(unsigned int *)(addr) = (data))
+#define GRETH_REGORIN(addr,data) GRETH_REGSAVE(addr,GRETH_REGLOAD(addr)|data)
+#define GRETH_REGANDIN(addr,data) GRETH_REGSAVE(addr,GRETH_REGLOAD(addr)&data)
+
+#define GRETH_RXBD_CNT 4
+#define GRETH_TXBD_CNT 1
+
+#define GRETH_RXBUF_SIZE 1540
+#define GRETH_BUF_ALIGN 4
+#define GRETH_RXBUF_EFF_SIZE \
+       ( (GRETH_RXBUF_SIZE&~(GRETH_BUF_ALIGN-1))+GRETH_BUF_ALIGN )
+
+typedef struct {
+       greth_regs *regs;
+       int irq;
+       struct eth_device *dev;
+
+       /* Hardware info */
+       unsigned char phyaddr;
+       int gbit_mac;
+
+       /* Current operating Mode */
+       int gb;                 /* GigaBit */
+       int fd;                 /* Full Duplex */
+       int sp;                 /* 10/100Mbps speed (1=100,0=10) */
+       int auto_neg;           /* Auto negotiate done */
+
+       unsigned char hwaddr[6];        /* MAC Address */
+
+       /* Descriptors */
+       greth_bd *rxbd_base, *rxbd_max;
+       greth_bd *txbd_base, *txbd_max;
+
+       greth_bd *rxbd_curr;
+
+       /* rx buffers in rx descriptors */
+       void *rxbuf_base;       /* (GRETH_RXBUF_SIZE+ALIGNBYTES) * GRETH_RXBD_CNT */
+
+       /* unused for gbit_mac, temp buffer for sending packets with unligned
+        * start.
+        * Pointer to packet allocated with malloc.
+        */
+       void *txbuf;
+
+       struct {
+               /* rx status */
+               unsigned int rx_packets,
+                   rx_crc_errors, rx_frame_errors, rx_length_errors, rx_errors;
+
+               /* tx stats */
+               unsigned int tx_packets,
+                   tx_latecol_errors,
+                   tx_underrun_errors, tx_limit_errors, tx_errors;
+       } stats;
+} greth_priv;
+
+/* Read MII register 'addr' from core 'regs' */
+static int read_mii(int addr, volatile greth_regs * regs)
+{
+       while (GRETH_REGLOAD(&regs->mdio) & GRETH_MII_BUSY) {
+       }
+
+       GRETH_REGSAVE(&regs->mdio, (0 << 11) | ((addr & 0x1F) << 6) | 2);
+
+       while (GRETH_REGLOAD(&regs->mdio) & GRETH_MII_BUSY) {
+       }
+
+       if (!(GRETH_REGLOAD(&regs->mdio) & GRETH_MII_NVALID)) {
+               return (GRETH_REGLOAD(&regs->mdio) >> 16) & 0xFFFF;
+       } else {
+               return -1;
+       }
+}
+
+static void write_mii(int addr, int data, volatile greth_regs * regs)
+{
+       while (GRETH_REGLOAD(&regs->mdio) & GRETH_MII_BUSY) {
+       }
+
+       GRETH_REGSAVE(&regs->mdio,
+                     ((data & 0xFFFF) << 16) | (0 << 11) | ((addr & 0x1F) << 6)
+                     | 1);
+
+       while (GRETH_REGLOAD(&regs->mdio) & GRETH_MII_BUSY) {
+       }
+
+}
+
+/* init/start hardware and allocate descriptor buffers for rx side
+ *
+ */
+int greth_init(struct eth_device *dev, bd_t * bis)
+{
+       int i;
+
+       greth_priv *greth = dev->priv;
+       greth_regs *regs = greth->regs;
+#ifdef DEBUG
+       printf("greth_init\n");
+#endif
+
+       GRETH_REGSAVE(&regs->control, 0);
+
+       if (!greth->rxbd_base) {
+
+               /* allocate descriptors */
+               greth->rxbd_base = (greth_bd *)
+                   memalign(0x1000, GRETH_RXBD_CNT * sizeof(greth_bd));
+               greth->txbd_base = (greth_bd *)
+                   memalign(0x1000, GRETH_RXBD_CNT * sizeof(greth_bd));
+
+               /* allocate buffers to all descriptors  */
+               greth->rxbuf_base =
+                   malloc(GRETH_RXBUF_EFF_SIZE * GRETH_RXBD_CNT);
+       }
+
+       /* initate rx decriptors */
+       for (i = 0; i < GRETH_RXBD_CNT; i++) {
+               greth->rxbd_base[i].addr = (unsigned int)
+                   greth->rxbuf_base + (GRETH_RXBUF_EFF_SIZE * i);
+               /* enable desciptor & set wrap bit if last descriptor */
+               if (i >= (GRETH_RXBD_CNT - 1)) {
+                       greth->rxbd_base[i].stat = GRETH_BD_EN | GRETH_BD_WR;
+               } else {
+                       greth->rxbd_base[i].stat = GRETH_BD_EN;
+               }
+       }
+
+       /* initiate indexes */
+       greth->rxbd_curr = greth->rxbd_base;
+       greth->rxbd_max = greth->rxbd_base + (GRETH_RXBD_CNT - 1);
+       greth->txbd_max = greth->txbd_base + (GRETH_TXBD_CNT - 1);
+       /*
+        * greth->txbd_base->addr = 0;
+        * greth->txbd_base->stat = GRETH_BD_WR;
+        */
+
+       /* initate tx decriptors */
+       for (i = 0; i < GRETH_TXBD_CNT; i++) {
+               greth->txbd_base[i].addr = 0;
+               /* enable desciptor & set wrap bit if last descriptor */
+               if (i >= (GRETH_RXBD_CNT - 1)) {
+                       greth->txbd_base[i].stat = GRETH_BD_WR;
+               } else {
+                       greth->txbd_base[i].stat = 0;
+               }
+       }
+
+       /**** SET HARDWARE REGS ****/
+
+       /* Set pointer to tx/rx descriptor areas */
+       GRETH_REGSAVE(&regs->rx_desc_p, (unsigned int)&greth->rxbd_base[0]);
+       GRETH_REGSAVE(&regs->tx_desc_p, (unsigned int)&greth->txbd_base[0]);
+
+       /* Enable Transmitter, GRETH will now scan descriptors for packets
+        * to transmitt */
+#ifdef DEBUG
+       printf("greth_init: enabling receiver\n");
+#endif
+       GRETH_REGORIN(&regs->control, GRETH_RXEN);
+
+       return 0;
+}
+
+/* Initiate PHY to a relevant speed
+ * return:
+ *  - 0 = success
+ *  - 1 = timeout/fail
+ */
+int greth_init_phy(greth_priv * dev, bd_t * bis)
+{
+       greth_regs *regs = dev->regs;
+       int tmp, tmp1, tmp2, i;
+       unsigned int start, timeout;
+
+       /* X msecs to ticks */
+       timeout = usec2ticks(GRETH_PHY_TIMEOUT_MS * 1000);
+
+       /* Get system timer0 current value
+        * Total timeout is 5s
+        */
+       start = get_timer(0);
+
+       /* get phy control register default values */
+
+       while ((tmp = read_mii(0, regs)) & 0x8000) {
+               if (get_timer(start) > timeout)
+                       return 1;       /* Fail */
+       }
+
+       /* reset PHY and wait for completion */
+       write_mii(0, 0x8000 | tmp, regs);
+
+       while (((tmp = read_mii(0, regs))) & 0x8000) {
+               if (get_timer(start) > timeout)
+                       return 1;       /* Fail */
+       }
+
+       /* Check if PHY is autoneg capable and then determine operating
+        * mode, otherwise force it to 10 Mbit halfduplex
+        */
+       dev->gb = 0;
+       dev->fd = 0;
+       dev->sp = 0;
+       dev->auto_neg = 0;
+       if (!((tmp >> 12) & 1)) {
+               write_mii(0, 0, regs);
+       } else {
+               /* wait for auto negotiation to complete and then check operating mode */
+               dev->auto_neg = 1;
+               i = 0;
+               while (!(((tmp = read_mii(1, regs)) >> 5) & 1)) {
+                       if (get_timer(start) > timeout) {
+                               printf("Auto negotiation timed out. "
+                                      "Selecting default config\n");
+                               tmp = read_mii(0, regs);
+                               dev->gb = ((tmp >> 6) & 1)
+                                   && !((tmp >> 13) & 1);
+                               dev->sp = !((tmp >> 6) & 1)
+                                   && ((tmp >> 13) & 1);
+                               dev->fd = (tmp >> 8) & 1;
+                               goto auto_neg_done;
+                       }
+               }
+               if ((tmp >> 8) & 1) {
+                       tmp1 = read_mii(9, regs);
+                       tmp2 = read_mii(10, regs);
+                       if ((tmp1 & GRETH_MII_EXTADV_1000FD) &&
+                           (tmp2 & GRETH_MII_EXTPRT_1000FD)) {
+                               dev->gb = 1;
+                               dev->fd = 1;
+                       }
+                       if ((tmp1 & GRETH_MII_EXTADV_1000HD) &&
+                           (tmp2 & GRETH_MII_EXTPRT_1000HD)) {
+                               dev->gb = 1;
+                               dev->fd = 0;
+                       }
+               }
+               if ((dev->gb == 0) || ((dev->gb == 1) && (dev->gbit_mac == 0))) {
+                       tmp1 = read_mii(4, regs);
+                       tmp2 = read_mii(5, regs);
+                       if ((tmp1 & GRETH_MII_100TXFD) &&
+                           (tmp2 & GRETH_MII_100TXFD)) {
+                               dev->sp = 1;
+                               dev->fd = 1;
+                       }
+                       if ((tmp1 & GRETH_MII_100TXHD) &&
+                           (tmp2 & GRETH_MII_100TXHD)) {
+                               dev->sp = 1;
+                               dev->fd = 0;
+                       }
+                       if ((tmp1 & GRETH_MII_10FD) && (tmp2 & GRETH_MII_10FD)) {
+                               dev->fd = 1;
+                       }
+                       if ((dev->gb == 1) && (dev->gbit_mac == 0)) {
+                               dev->gb = 0;
+                               dev->fd = 0;
+                               write_mii(0, dev->sp << 13, regs);
+                       }
+               }
+
+       }
+      auto_neg_done:
+#ifdef DEBUG
+       printf("%s GRETH Ethermac at [0x%x] irq %d. Running \
+               %d Mbps %s duplex\n", dev->gbit_mac ? "10/100/1000" : "10/100", (unsigned int)(regs), (unsigned int)(dev->irq), dev->gb ? 1000 : (dev->sp ? 100 : 10), dev->fd ? "full" : "half");
+#endif
+       /* Read out PHY info if extended registers are available */
+       if (tmp & 1) {
+               tmp1 = read_mii(2, regs);
+               tmp2 = read_mii(3, regs);
+               tmp1 = (tmp1 << 6) | ((tmp2 >> 10) & 0x3F);
+               tmp = tmp2 & 0xF;
+
+               tmp2 = (tmp2 >> 4) & 0x3F;
+#ifdef DEBUG
+               printf("PHY: Vendor %x   Device %x    Revision %d\n", tmp1,
+                      tmp2, tmp);
+#endif
+       } else {
+               printf("PHY info not available\n");
+       }
+
+       /* set speed and duplex bits in control register */
+       GRETH_REGORIN(&regs->control,
+                     (dev->gb << 8) | (dev->sp << 7) | (dev->fd << 4));
+
+       return 0;
+}
+
+void greth_halt(struct eth_device *dev)
+{
+       greth_priv *greth;
+       greth_regs *regs;
+       int i;
+#ifdef DEBUG
+       printf("greth_halt\n");
+#endif
+       if (!dev || !dev->priv)
+               return;
+
+       greth = dev->priv;
+       regs = greth->regs;
+
+       if (!regs)
+               return;
+
+       /* disable receiver/transmitter by clearing the enable bits */
+       GRETH_REGANDIN(&regs->control, ~(GRETH_RXEN | GRETH_TXEN));
+
+       /* reset rx/tx descriptors */
+       if (greth->rxbd_base) {
+               for (i = 0; i < GRETH_RXBD_CNT; i++) {
+                       greth->rxbd_base[i].stat =
+                           (i >= (GRETH_RXBD_CNT - 1)) ? GRETH_BD_WR : 0;
+               }
+       }
+
+       if (greth->txbd_base) {
+               for (i = 0; i < GRETH_TXBD_CNT; i++) {
+                       greth->txbd_base[i].stat =
+                           (i >= (GRETH_TXBD_CNT - 1)) ? GRETH_BD_WR : 0;
+               }
+       }
+}
+
+int greth_send(struct eth_device *dev, volatile void *eth_data, int data_length)
+{
+       greth_priv *greth = dev->priv;
+       greth_regs *regs = greth->regs;
+       greth_bd *txbd;
+       void *txbuf;
+       unsigned int status;
+#ifdef DEBUG
+       printf("greth_send\n");
+#endif
+       /* send data, wait for data to be sent, then return */
+       if (((unsigned int)eth_data & (GRETH_BUF_ALIGN - 1))
+           && !greth->gbit_mac) {
+               /* data not aligned as needed by GRETH 10/100, solve this by allocating 4 byte aligned buffer
+                * and copy data to before giving it to GRETH.
+                */
+               if (!greth->txbuf) {
+                       greth->txbuf = malloc(GRETH_RXBUF_SIZE);
+#ifdef DEBUG
+                       printf("GRETH: allocated aligned tx-buf\n");
+#endif
+               }
+
+               txbuf = greth->txbuf;
+
+               /* copy data info buffer */
+               memcpy((char *)txbuf, (char *)eth_data, data_length);
+
+               /* keep buffer to next time */
+       } else {
+               txbuf = (void *)eth_data;
+       }
+       /* get descriptor to use, only 1 supported... hehe easy */
+       txbd = greth->txbd_base;
+
+       /* setup descriptor to wrap around to it self */
+       txbd->addr = (unsigned int)txbuf;
+       txbd->stat = GRETH_BD_EN | GRETH_BD_WR | data_length;
+
+       /* Remind Core which descriptor to use when sending */
+       GRETH_REGSAVE(&regs->tx_desc_p, (unsigned int)txbd);
+
+       /* initate send by enabling transmitter */
+       GRETH_REGORIN(&regs->control, GRETH_TXEN);
+
+       /* Wait for data to be sent */
+       while ((status = GRETH_REGLOAD(&txbd->stat)) & GRETH_BD_EN) {
+               ;
+       }
+
+       /* was the packet transmitted succesfully? */
+       if (status & GRETH_TXBD_ERR_AL) {
+               greth->stats.tx_limit_errors++;
+       }
+
+       if (status & GRETH_TXBD_ERR_UE) {
+               greth->stats.tx_underrun_errors++;
+       }
+
+       if (status & GRETH_TXBD_ERR_LC) {
+               greth->stats.tx_latecol_errors++;
+       }
+
+       if (status &
+           (GRETH_TXBD_ERR_LC | GRETH_TXBD_ERR_UE | GRETH_TXBD_ERR_AL)) {
+               /* any error */
+               greth->stats.tx_errors++;
+               return -1;
+       }
+
+       /* bump tx packet counter */
+       greth->stats.tx_packets++;
+
+       /* return succefully */
+       return 0;
+}
+
+int greth_recv(struct eth_device *dev)
+{
+       greth_priv *greth = dev->priv;
+       greth_regs *regs = greth->regs;
+       greth_bd *rxbd;
+       unsigned int status, len = 0, bad;
+       unsigned char *d;
+       int enable = 0;
+       int i;
+#ifdef DEBUG
+/*     printf("greth_recv\n"); */
+#endif
+       /* Receive One packet only, but clear as many error packets as there are
+        * available.
+        */
+       {
+               /* current receive descriptor */
+               rxbd = greth->rxbd_curr;
+
+               /* get status of next received packet */
+               status = GRETH_REGLOAD(&rxbd->stat);
+
+               bad = 0;
+
+               /* stop if no more packets received */
+               if (status & GRETH_BD_EN) {
+                       goto done;
+               }
+#ifdef DEBUG
+               printf("greth_recv: packet 0x%lx, 0x%lx, len: %d\n",
+                      (unsigned int)rxbd, status, status & GRETH_BD_LEN);
+#endif
+
+               /* Check status for errors.
+                */
+               if (status & GRETH_RXBD_ERR_FT) {
+                       greth->stats.rx_length_errors++;
+                       bad = 1;
+               }
+               if (status & (GRETH_RXBD_ERR_AE | GRETH_RXBD_ERR_OE)) {
+                       greth->stats.rx_frame_errors++;
+                       bad = 1;
+               }
+               if (status & GRETH_RXBD_ERR_CRC) {
+                       greth->stats.rx_crc_errors++;
+                       bad = 1;
+               }
+               if (bad) {
+                       greth->stats.rx_errors++;
+                       printf
+                           ("greth_recv: Bad packet (%d, %d, %d, 0x%08x, %d)\n",
+                            greth->stats.rx_length_errors,
+                            greth->stats.rx_frame_errors,
+                            greth->stats.rx_crc_errors, status,
+                            greth->stats.rx_packets);
+                       /* print all rx descriptors */
+                       for (i = 0; i < GRETH_RXBD_CNT; i++) {
+                               printf("[%d]: Stat=0x%lx, Addr=0x%lx\n", i,
+                                      GRETH_REGLOAD(&greth->rxbd_base[i].stat),
+                                      GRETH_REGLOAD(&greth->rxbd_base[i].
+                                                    addr));
+                       }
+               } else {
+                       /* Process the incoming packet. */
+                       len = status & GRETH_BD_LEN;
+                       d = (char *)rxbd->addr;
+#ifdef DEBUG
+                       printf
+                           ("greth_recv: new packet, length: %d. data: %x %x %x %x %x %x %x %x\n",
+                            len, d[0], d[1], d[2], d[3], d[4], d[5], d[6],
+                            d[7]);
+#endif
+                       /* flush all data cache to make sure we're not reading old packet data */
+                       sparc_dcache_flush_all();
+
+                       /* pass packet on to network subsystem */
+                       NetReceive((void *)d, len);
+
+                       /* bump stats counters */
+                       greth->stats.rx_packets++;
+
+                       /* bad is now 0 ==> will stop loop */
+               }
+
+               /* reenable descriptor to receive more packet with this descriptor, wrap around if needed */
+               rxbd->stat =
+                   GRETH_BD_EN |
+                   (((unsigned int)greth->rxbd_curr >=
+                     (unsigned int)greth->rxbd_max) ? GRETH_BD_WR : 0);
+               enable = 1;
+
+               /* increase index */
+               greth->rxbd_curr =
+                   ((unsigned int)greth->rxbd_curr >=
+                    (unsigned int)greth->rxbd_max) ? greth->
+                   rxbd_base : (greth->rxbd_curr + 1);
+
+       };
+
+       if (enable) {
+               GRETH_REGORIN(&regs->control, GRETH_RXEN);
+       }
+      done:
+       /* return positive length of packet or 0 if non recieved */
+       return len;
+}
+
+void greth_set_hwaddr(greth_priv * greth, unsigned char *mac)
+{
+       /* save new MAC address */
+       greth->dev->enetaddr[0] = greth->hwaddr[0] = mac[0];
+       greth->dev->enetaddr[1] = greth->hwaddr[1] = mac[1];
+       greth->dev->enetaddr[2] = greth->hwaddr[2] = mac[2];
+       greth->dev->enetaddr[3] = greth->hwaddr[3] = mac[3];
+       greth->dev->enetaddr[4] = greth->hwaddr[4] = mac[4];
+       greth->dev->enetaddr[5] = greth->hwaddr[5] = mac[5];
+       greth->regs->esa_msb = (mac[0] << 8) | mac[1];
+       greth->regs->esa_lsb =
+           (mac[2] << 24) | (mac[3] << 16) | (mac[4] << 8) | mac[5];
+#ifdef DEBUG
+       printf("GRETH: New MAC address: %02x:%02x:%02x:%02x:%02x:%02x\n",
+              mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
+#endif
+}
+
+int greth_initialize(bd_t * bis)
+{
+       greth_priv *greth;
+       ambapp_apbdev apbdev;
+       struct eth_device *dev;
+       int i;
+       char *addr_str, *end;
+       unsigned char addr[6];
+#ifdef DEBUG
+       printf("Scanning for GRETH\n");
+#endif
+       /* Find Device & IRQ via AMBA Plug&Play information */
+       if (ambapp_apb_first(VENDOR_GAISLER, GAISLER_ETHMAC, &apbdev) != 1) {
+               return -1;      /* GRETH not found */
+       }
+
+       greth = (greth_priv *) malloc(sizeof(greth_priv));
+       dev = (struct eth_device *)malloc(sizeof(struct eth_device));
+       memset(dev, 0, sizeof(struct eth_device));
+       memset(greth, 0, sizeof(greth_priv));
+
+       greth->regs = (greth_regs *) apbdev.address;
+       greth->irq = apbdev.irq;
+#ifdef DEBUG
+       printf("Found GRETH at 0x%lx, irq %d\n", greth->regs, greth->irq);
+#endif
+       dev->priv = (void *)greth;
+       dev->iobase = (unsigned int)greth->regs;
+       dev->init = greth_init;
+       dev->halt = greth_halt;
+       dev->send = greth_send;
+       dev->recv = greth_recv;
+       greth->dev = dev;
+
+       /* Reset Core */
+       GRETH_REGSAVE(&greth->regs->control, GRETH_RESET);
+
+       /* Wait for core to finish reset cycle */
+       while (GRETH_REGLOAD(&greth->regs->control) & GRETH_RESET) ;
+
+       /* Get the phy address which assumed to have been set
+          correctly with the reset value in hardware */
+       greth->phyaddr = (GRETH_REGLOAD(&greth->regs->mdio) >> 11) & 0x1F;
+
+       /* Check if mac is gigabit capable */
+       greth->gbit_mac = (GRETH_REGLOAD(&greth->regs->control) >> 27) & 1;
+
+       /* Make descriptor string */
+       if (greth->gbit_mac) {
+               sprintf(dev->name, "GRETH 10/100/GB");
+       } else {
+               sprintf(dev->name, "GRETH 10/100");
+       }
+
+       /* initiate PHY, select speed/duplex depending on connected PHY */
+       if (greth_init_phy(greth, bis)) {
+               /* Failed to init PHY (timedout) */
+               return -1;
+       }
+
+       /* Register Device to EtherNet subsystem  */
+       eth_register(dev);
+
+       /* Get MAC address */
+       if ((addr_str = getenv("ethaddr")) != NULL) {
+               for (i = 0; i < 6; i++) {
+                       addr[i] =
+                           addr_str ? simple_strtoul(addr_str, &end, 16) : 0;
+                       if (addr_str) {
+                               addr_str = (*end) ? end + 1 : end;
+                       }
+               }
+       } else {
+               /* HW Address not found in environment, Set default HW address */
+               addr[0] = GRETH_HWADDR_0;       /* MSB */
+               addr[1] = GRETH_HWADDR_1;
+               addr[2] = GRETH_HWADDR_2;
+               addr[3] = GRETH_HWADDR_3;
+               addr[4] = GRETH_HWADDR_4;
+               addr[5] = GRETH_HWADDR_5;       /* LSB */
+       }
+
+       /* set and remember MAC address */
+       greth_set_hwaddr(greth, addr);
+
+       return 1;
+}
diff --git a/drivers/net/greth.h b/drivers/net/greth.h
new file mode 100644 (file)
index 0000000..7d5fbd3
--- /dev/null
@@ -0,0 +1,97 @@
+/* Gaisler.com GRETH 10/100/1000 Ethernet MAC driver
+ *
+ * (C) Copyright 2007
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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
+ */
+
+#define GRETH_FD 0x10
+#define GRETH_RESET 0x40
+#define GRETH_MII_BUSY 0x8
+#define GRETH_MII_NVALID 0x10
+
+/* MII registers */
+#define GRETH_MII_EXTADV_1000FD 0x00000200
+#define GRETH_MII_EXTADV_1000HD 0x00000100
+#define GRETH_MII_EXTPRT_1000FD 0x00000800
+#define GRETH_MII_EXTPRT_1000HD 0x00000400
+
+#define GRETH_MII_100T4 0x00000200
+#define GRETH_MII_100TXFD 0x00000100
+#define GRETH_MII_100TXHD 0x00000080
+#define GRETH_MII_10FD 0x00000040
+#define GRETH_MII_10HD 0x00000020
+
+#define GRETH_BD_EN 0x800
+#define GRETH_BD_WR 0x1000
+#define GRETH_BD_IE 0x2000
+#define GRETH_BD_LEN 0x7FF
+
+#define GRETH_TXEN 0x1
+#define GRETH_INT_TX 0x8
+#define GRETH_TXI 0x4
+#define GRETH_TXBD_STATUS 0x0001C000
+#define GRETH_TXBD_MORE 0x20000
+#define GRETH_TXBD_IPCS 0x40000
+#define GRETH_TXBD_TCPCS 0x80000
+#define GRETH_TXBD_UDPCS 0x100000
+#define GRETH_TXBD_ERR_LC 0x10000
+#define GRETH_TXBD_ERR_UE 0x4000
+#define GRETH_TXBD_ERR_AL 0x8000
+#define GRETH_TXBD_NUM 128
+#define GRETH_TXBD_NUM_MASK (GRETH_TXBD_NUM-1)
+#define GRETH_TX_BUF_SIZE 2048
+
+#define GRETH_INT_RX         0x4
+#define GRETH_RXEN           0x2
+#define GRETH_RXI            0x8
+#define GRETH_RXBD_STATUS    0xFFFFC000
+#define GRETH_RXBD_ERR_AE    0x4000
+#define GRETH_RXBD_ERR_FT    0x8000
+#define GRETH_RXBD_ERR_CRC   0x10000
+#define GRETH_RXBD_ERR_OE    0x20000
+#define GRETH_RXBD_ERR_LE    0x40000
+#define GRETH_RXBD_IP_DEC    0x80000
+#define GRETH_RXBD_IP_CSERR  0x100000
+#define GRETH_RXBD_UDP_DEC   0x200000
+#define GRETH_RXBD_UDP_CSERR 0x400000
+#define GRETH_RXBD_TCP_DEC   0x800000
+#define GRETH_RXBD_TCP_CSERR 0x1000000
+
+#define GRETH_RXBD_NUM 128
+#define GRETH_RXBD_NUM_MASK (GRETH_RXBD_NUM-1)
+#define GRETH_RX_BUF_SIZE 2048
+
+/* Ethernet configuration registers */
+typedef struct _greth_regs {
+       volatile unsigned int control;
+       volatile unsigned int status;
+       volatile unsigned int esa_msb;
+       volatile unsigned int esa_lsb;
+       volatile unsigned int mdio;
+       volatile unsigned int tx_desc_p;
+       volatile unsigned int rx_desc_p;
+} greth_regs;
+
+/* Ethernet buffer descriptor */
+typedef struct _greth_bd {
+       volatile unsigned int stat;
+       unsigned int addr;      /* Buffer address not changed by HW */
+} greth_bd;
index 9c98338..703784e 100644 (file)
@@ -417,13 +417,13 @@ static int macb_init(struct eth_device *netdev, bd_t *bd)
 
        /* choose RMII or MII mode. This depends on the board */
 #ifdef CONFIG_RMII
-#ifdef CONFIG_AT91CAP9ADK
+#if defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260)
        macb_writel(macb, USRIO, MACB_BIT(RMII) | MACB_BIT(CLKEN));
 #else
        macb_writel(macb, USRIO, 0);
 #endif
 #else
-#ifdef CONFIG_AT91CAP9ADK
+#if defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260)
        macb_writel(macb, USRIO, MACB_BIT(CLKEN));
 #else
        macb_writel(macb, USRIO, MACB_BIT(MII));
index 3b81258..71d1960 100644 (file)
@@ -166,6 +166,13 @@ int fec_send(struct eth_device *dev, volatile void *packet, int length)
        /* Activate transmit Buffer Descriptor polling */
        fecp->tdar = 0x01000000;        /* Descriptor polling active    */
 
+       /* FEC fix for MCF5275, FEC unable to initial transmit data packet.
+        * A nop will ensure the descriptor polling active completed.
+        */
+#ifdef CONFIG_M5275
+       __asm__ ("nop");
+#endif
+
 #ifdef CFG_UNIFY_CACHE
        icache_invalid();
 #endif
index b100657..d09da78 100644 (file)
@@ -1,11 +1,10 @@
 /*
-Ported to U-Boot  by Christian Pellegrin <chri@ascensit.com>
+Ported to U-Boot by Christian Pellegrin <chri@ascensit.com>
 
 Based on sources from the Linux kernel (pcnet_cs.c, 8390.h) and
 eCOS(if_dp83902a.c, if_dp83902a.h). Both of these 2 wonderful world
 are GPL, so this is, of course, GPL.
 
-
 ==========================================================================
 
 dev/if_dp83902a.c
@@ -58,21 +57,19 @@ and are covered by the appropriate copyright disclaimers included herein.
 ==========================================================================
 #####DESCRIPTIONBEGIN####
 
-Author(s):    gthomas
-Contributors: gthomas, jskov, rsandifo
-Date:        2001-06-13
+Author(s):     gthomas
+Contributors:  gthomas, jskov, rsandifo
+Date:          2001-06-13
 Purpose:
 Description:
 
-FIXME:       Will fail if pinged with large packets (1520 bytes)
+FIXME:         Will fail if pinged with large packets (1520 bytes)
 Add promisc config
 Add SNMP
 
 ####DESCRIPTIONEND####
 
-
 ==========================================================================
-
 */
 
 #include <common.h>
@@ -80,55 +77,46 @@ Add SNMP
 #include <net.h>
 #include <malloc.h>
 
-#ifdef CONFIG_DRIVER_NE2000
-
-/* wor around udelay resetting OCR */
-static void my_udelay(long us) {
-       long tmo;
-
-       tmo = get_timer (0) + us * CFG_HZ / 1000000; /* will this be much greater than 0 ? */
-       while (get_timer (0) < tmo);
-}
-
-#define mdelay(n)       my_udelay((n)*1000)
-
+#define mdelay(n)      udelay((n)*1000)
 /* forward definition of function used for the uboot interface */
 void uboot_push_packet_len(int len);
 void uboot_push_tx_done(int key, int val);
 
-/* timeout for tx/rx in s */
-#define TOUT 5
-
-#define ETHER_ADDR_LEN 6
-
 /*
-  ------------------------------------------------------------------------
-  Debugging details
-
-  Set to perms of:
-  0 disables all debug output
-  1 for process debug output
-  2 for added data IO output: get_reg, put_reg
-  4 for packet allocation/free output
-  8 for only startup status, so we can tell we're installed OK
-*/
-/*#define DEBUG 0xf*/
+ * Debugging details
+ *
+ * Set to perms of:
+ * 0 disables all debug output
+ * 1 for process debug output
+ * 2 for added data IO output: get_reg, put_reg
+ * 4 for packet allocation/free output
+ * 8 for only startup status, so we can tell we're installed OK
+ */
+#if 0
+#define DEBUG 0xf
+#else
 #define DEBUG 0
+#endif
 
 #if DEBUG & 1
 #define DEBUG_FUNCTION() do { printf("%s\n", __FUNCTION__); } while (0)
 #define DEBUG_LINE() do { printf("%d\n", __LINE__); } while (0)
+#define PRINTK(args...) printf(args)
 #else
 #define DEBUG_FUNCTION() do {} while(0)
 #define DEBUG_LINE() do {} while(0)
+#define PRINTK(args...)
 #endif
 
-#include "ne2000.h"
+/* NE2000 base header file */
+#include "ne2000_base.h"
 
-#if DEBUG & 1
-#define PRINTK(args...) printf(args)
+#if defined(CONFIG_DRIVER_AX88796L)
+/* AX88796L support */
+#include "ax88796.h"
 #else
-#define PRINTK(args...)
+/* Basic NE2000 chip support */
+#include "ne2000.h"
 #endif
 
 static dp83902a_priv_data_t nic; /* just one instance of the card supported */
@@ -137,32 +125,35 @@ static bool
 dp83902a_init(void)
 {
        dp83902a_priv_data_t *dp = &nic;
-       cyg_uint8* base;
-       int i;
+       u8* base;
 
        DEBUG_FUNCTION();
 
        base = dp->base;
-       if (!base) return false;  /* No device found */
+       if (!base)
+               return false;   /* No device found */
 
        DEBUG_LINE();
 
+#if defined(NE2000_BASIC_INIT)
+       /* AX88796L doesn't need */
        /* Prepare ESA */
-       DP_OUT(base, DP_CR, DP_CR_NODMA | DP_CR_PAGE1);  /* Select page 1 */
+       DP_OUT(base, DP_CR, DP_CR_NODMA | DP_CR_PAGE1); /* Select page 1 */
        /* Use the address from the serial EEPROM */
        for (i = 0; i < 6; i++)
                DP_IN(base, DP_P1_PAR0+i, dp->esa[i]);
-       DP_OUT(base, DP_CR, DP_CR_NODMA | DP_CR_PAGE0);  /* Select page 0 */
+       DP_OUT(base, DP_CR, DP_CR_NODMA | DP_CR_PAGE0); /* Select page 0 */
 
        printf("NE2000 - %s ESA: %02x:%02x:%02x:%02x:%02x:%02x\n",
-              "eeprom",
-              dp->esa[0],
-              dp->esa[1],
-              dp->esa[2],
-              dp->esa[3],
-              dp->esa[4],
-              dp->esa[5] );
-
+               "eeprom",
+               dp->esa[0],
+               dp->esa[1],
+               dp->esa[2],
+               dp->esa[3],
+               dp->esa[4],
+               dp->esa[5] );
+
+#endif /* NE2000_BASIC_INIT */
        return true;
 }
 
@@ -170,11 +161,11 @@ static void
 dp83902a_stop(void)
 {
        dp83902a_priv_data_t *dp = &nic;
-       cyg_uint8 *base = dp->base;
+       u8 *base = dp->base;
 
        DEBUG_FUNCTION();
 
-       DP_OUT(base, DP_CR, DP_CR_PAGE0 | DP_CR_NODMA | DP_CR_STOP);  /* Brutal */
+       DP_OUT(base, DP_CR, DP_CR_PAGE0 | DP_CR_NODMA | DP_CR_STOP);    /* Brutal */
        DP_OUT(base, DP_ISR, 0xFF);             /* Clear any pending interrupts */
        DP_OUT(base, DP_IMR, 0x00);             /* Disable all interrupts */
 
@@ -182,16 +173,16 @@ dp83902a_stop(void)
 }
 
 /*
 This function is called to "start up" the interface.  It may be called
 multiple times, even when the hardware is already running.  It will be
-  called whenever something "hardware oriented" changes and should leave
-  the hardware ready to send/receive packets.
-*/
* This function is called to "start up" the interface. It may be called
* multiple times, even when the hardware is already running. It will be
* called whenever something "hardware oriented" changes and should leave
* the hardware ready to send/receive packets.
+ */
 static void
-dp83902a_start(unsigned char * enaddr)
+dp83902a_start(u8 * enaddr)
 {
        dp83902a_priv_data_t *dp = &nic;
-       cyg_uint8 *base = dp->base;
+       u8 *base = dp->base;
        int i;
 
        DEBUG_FUNCTION();
@@ -206,35 +197,41 @@ dp83902a_start(unsigned char * enaddr)
        dp->tx1 = dp->tx2 = 0;
        dp->tx_next = dp->tx_buf1;
        dp->tx_started = false;
+       dp->running = true;
        DP_OUT(base, DP_PSTART, dp->rx_buf_start); /* Receive ring start page */
-       DP_OUT(base, DP_BNDRY, dp->rx_buf_end-1); /* Receive ring boundary */
+       DP_OUT(base, DP_BNDRY, dp->rx_buf_end - 1); /* Receive ring boundary */
        DP_OUT(base, DP_PSTOP, dp->rx_buf_end); /* Receive ring end page */
-       dp->rx_next = dp->rx_buf_start-1;
+       dp->rx_next = dp->rx_buf_start - 1;
+       dp->running = true;
        DP_OUT(base, DP_ISR, 0xFF);             /* Clear any pending interrupts */
        DP_OUT(base, DP_IMR, DP_IMR_All);       /* Enable all interrupts */
-       DP_OUT(base, DP_CR, DP_CR_NODMA | DP_CR_PAGE1 | DP_CR_STOP);  /* Select page 1 */
-       DP_OUT(base, DP_P1_CURP, dp->rx_buf_start);   /* Current page - next free page for Rx */
-       for (i = 0;  i < ETHER_ADDR_LEN;  i++) {
+       DP_OUT(base, DP_CR, DP_CR_NODMA | DP_CR_PAGE1 | DP_CR_STOP);    /* Select page 1 */
+       DP_OUT(base, DP_P1_CURP, dp->rx_buf_start);     /* Current page - next free page for Rx */
+       dp->running = true;
+       for (i = 0; i < ETHER_ADDR_LEN; i++) {
+               /* FIXME */
+               /*((vu_short*)( base + ((DP_P1_PAR0 + i) * 2) +
+                * 0x1400)) = enaddr[i];*/
                DP_OUT(base, DP_P1_PAR0+i, enaddr[i]);
        }
        /* Enable and start device */
        DP_OUT(base, DP_CR, DP_CR_PAGE0 | DP_CR_NODMA | DP_CR_START);
        DP_OUT(base, DP_TCR, DP_TCR_NORMAL); /* Normal transmit operations */
-       DP_OUT(base, DP_RCR, DP_RCR_AB);  /* Accept broadcast, no errors, no multicast */
+       DP_OUT(base, DP_RCR, DP_RCR_AB); /* Accept broadcast, no errors, no multicast */
        dp->running = true;
 }
 
 /*
 This routine is called to start the transmitter.  It is split out from the
-  data handling routine so it may be called either when data becomes first
-  available or when an Tx interrupt occurs
-*/
* This routine is called to start the transmitter. It is split out from the
* data handling routine so it may be called either when data becomes first
* available or when an Tx interrupt occurs
+ */
 
 static void
 dp83902a_start_xmit(int start_page, int len)
 {
        dp83902a_priv_data_t *dp = (dp83902a_priv_data_t *) &nic;
-       cyg_uint8 *base = dp->base;
+       u8 *base = dp->base;
 
        DEBUG_FUNCTION();
 
@@ -255,14 +252,14 @@ dp83902a_start_xmit(int start_page, int len)
 }
 
 /*
 This routine is called to send data to the hardware.  It is known a-priori
-  that there is free buffer space (dp->tx_next).
-*/
* This routine is called to send data to the hardware. It is known a-priori
* that there is free buffer space (dp->tx_next).
+ */
 static void
-dp83902a_send(unsigned char *data, int total_len, unsigned long key)
+dp83902a_send(u8 *data, int total_len, u32 key)
 {
        struct dp83902a_priv_data *dp = (struct dp83902a_priv_data *) &nic;
-       cyg_uint8 *base = dp->base;
+       u8 *base = dp->base;
        int len, start_page, pkt_len, i, isr;
 #if DEBUG & 4
        int dx;
@@ -271,7 +268,8 @@ dp83902a_send(unsigned char *data, int total_len, unsigned long key)
        DEBUG_FUNCTION();
 
        len = pkt_len = total_len;
-       if (pkt_len < IEEE_8023_MIN_FRAME) pkt_len = IEEE_8023_MIN_FRAME;
+       if (pkt_len < IEEE_8023_MIN_FRAME)
+               pkt_len = IEEE_8023_MIN_FRAME;
 
        start_page = dp->tx_next;
        if (dp->tx_next == dp->tx_buf1) {
@@ -290,17 +288,19 @@ dp83902a_send(unsigned char *data, int total_len, unsigned long key)
        printf("TX prep page %d len %d\n", start_page, pkt_len);
 #endif
 
-       DP_OUT(base, DP_ISR, DP_ISR_RDC);  /* Clear end of DMA */
+       DP_OUT(base, DP_ISR, DP_ISR_RDC);       /* Clear end of DMA */
        {
-               /* Dummy read. The manual sez something slightly different, */
-               /* but the code is extended a bit to do what Hitachi's monitor */
-               /* does (i.e., also read data). */
+               /*
+                * Dummy read. The manual sez something slightly different,
+                * but the code is extended a bit to do what Hitachi's monitor
+                * does (i.e., also read data).
+                */
 
-               cyg_uint16 tmp;
+               u16 tmp;
                int len = 1;
 
-               DP_OUT(base, DP_RSAL, 0x100-len);
-               DP_OUT(base, DP_RSAH, (start_page-1) & 0xff);
+               DP_OUT(base, DP_RSAL, 0x100 - len);
+               DP_OUT(base, DP_RSAH, (start_page - 1) & 0xff);
                DP_OUT(base, DP_RBCL, len);
                DP_OUT(base, DP_RBCH, 0);
                DP_OUT(base, DP_CR, DP_CR_PAGE0 | DP_CR_RDMA | DP_CR_START);
@@ -308,8 +308,10 @@ dp83902a_send(unsigned char *data, int total_len, unsigned long key)
        }
 
 #ifdef CYGHWR_NS_DP83902A_PLF_BROKEN_TX_DMA
-       /* Stall for a bit before continuing to work around random data */
-       /* corruption problems on some platforms. */
+       /*
+        * Stall for a bit before continuing to work around random data
+        * corruption problems on some platforms.
+        */
        CYGACC_CALL_IF_DELAY_US(1);
 #endif
 
@@ -322,7 +324,7 @@ dp83902a_send(unsigned char *data, int total_len, unsigned long key)
 
        /* Put data into buffer */
 #if DEBUG & 4
-       printf(" sg buf %08lx len %08x\n ", (unsigned long) data, len);
+       printf(" sg buf %08lx len %08x\n ", (u32)data, len);
        dx = 0;
 #endif
        while (len > 0) {
@@ -330,6 +332,7 @@ dp83902a_send(unsigned char *data, int total_len, unsigned long key)
                printf(" %02x", *data);
                if (0 == (++dx % 16)) printf("\n ");
 #endif
+
                DP_OUT_DATA(dp->data, *data++);
                len--;
        }
@@ -341,16 +344,18 @@ dp83902a_send(unsigned char *data, int total_len, unsigned long key)
                printf("  + %d bytes of padding\n", pkt_len - total_len);
 #endif
                /* Padding to 802.3 length was required */
-               for (i = total_len;  i < pkt_len;) {
+               for (i = total_len; i < pkt_len;) {
                        i++;
                        DP_OUT_DATA(dp->data, 0);
                }
        }
 
 #ifdef CYGHWR_NS_DP83902A_PLF_BROKEN_TX_DMA
-       /* After last data write, delay for a bit before accessing the */
-       /* device again, or we may get random data corruption in the last */
-       /* datum (on some platforms). */
+       /*
+        * After last data write, delay for a bit before accessing the
+        * device again, or we may get random data corruption in the last
+        * datum (on some platforms).
+        */
        CYGACC_CALL_IF_DELAY_US(1);
 #endif
 
@@ -358,34 +363,35 @@ dp83902a_send(unsigned char *data, int total_len, unsigned long key)
        do {
                DP_IN(base, DP_ISR, isr);
        } while ((isr & DP_ISR_RDC) == 0);
+
        /* Then disable DMA */
        DP_OUT(base, DP_CR, DP_CR_PAGE0 | DP_CR_NODMA | DP_CR_START);
 
        /* Start transmit if not already going */
        if (!dp->tx_started) {
                if (start_page == dp->tx1) {
-                       dp->tx_int = 1;  /* Expecting interrupt from BUF1 */
+                       dp->tx_int = 1; /* Expecting interrupt from BUF1 */
                } else {
-                       dp->tx_int = 2;  /* Expecting interrupt from BUF2 */
+                       dp->tx_int = 2; /* Expecting interrupt from BUF2 */
                }
                dp83902a_start_xmit(start_page, pkt_len);
        }
 }
 
 /*
 This function is called when a packet has been received.  It's job is
 to prepare to unload the packet from the hardware.  Once the length of
 the packet is known, the upper layer of the driver can be told.  When
-  the upper layer is ready to unload the packet, the internal function
-  'dp83902a_recv' will be called to actually fetch it from the hardware.
-*/
* This function is called when a packet has been received. It's job is
* to prepare to unload the packet from the hardware. Once the length of
* the packet is known, the upper layer of the driver can be told. When
* the upper layer is ready to unload the packet, the internal function
* 'dp83902a_recv' will be called to actually fetch it from the hardware.
+ */
 static void
 dp83902a_RxEvent(void)
 {
        struct dp83902a_priv_data *dp = (struct dp83902a_priv_data *) &nic;
-       cyg_uint8 *base = dp->base;
-       unsigned char rsr;
-       unsigned char rcv_hdr[4];
+       u8 *base = dp->base;
+       u8 rsr;
+       u8 rcv_hdr[4];
        int i, len, pkt, cur;
 
        DEBUG_FUNCTION();
@@ -411,9 +417,9 @@ dp83902a_RxEvent(void)
                DP_OUT(base, DP_RSAH, pkt);
                if (dp->rx_next == pkt) {
                        if (cur == dp->rx_buf_start)
-                               DP_OUT(base, DP_BNDRY, dp->rx_buf_end-1);
+                               DP_OUT(base, DP_BNDRY, dp->rx_buf_end - 1);
                        else
-                               DP_OUT(base, DP_BNDRY, cur-1); /* Update pointer */
+                               DP_OUT(base, DP_BNDRY, cur - 1); /* Update pointer */
                        return;
                }
                dp->rx_next = pkt;
@@ -423,37 +429,41 @@ dp83902a_RxEvent(void)
                CYGACC_CALL_IF_DELAY_US(10);
 #endif
 
-               for (i = 0;  i < sizeof(rcv_hdr);) {
+               /* read header (get data size)*/
+               for (i = 0; i < sizeof(rcv_hdr);) {
                        DP_IN_DATA(dp->data, rcv_hdr[i++]);
                }
 
 #if DEBUG & 5
                printf("rx hdr %02x %02x %02x %02x\n",
-                      rcv_hdr[0], rcv_hdr[1], rcv_hdr[2], rcv_hdr[3]);
+                       rcv_hdr[0], rcv_hdr[1], rcv_hdr[2], rcv_hdr[3]);
 #endif
                len = ((rcv_hdr[3] << 8) | rcv_hdr[2]) - sizeof(rcv_hdr);
+
+               /* data read */
                uboot_push_packet_len(len);
+
                if (rcv_hdr[1] == dp->rx_buf_start)
-                       DP_OUT(base, DP_BNDRY, dp->rx_buf_end-1);
+                       DP_OUT(base, DP_BNDRY, dp->rx_buf_end - 1);
                else
-                       DP_OUT(base, DP_BNDRY, rcv_hdr[1]-1); /* Update pointer */
+                       DP_OUT(base, DP_BNDRY, rcv_hdr[1] - 1); /* Update pointer */
        }
 }
 
 /*
-  This function is called as a result of the "eth_drv_recv()" call above.
-  It's job is to actually fetch data for a packet from the hardware once
 memory buffers have been allocated for the packet.  Note that the buffers
 may come in pieces, using a scatter-gather list.  This allows for more
-  efficient processing in the upper layers of the stack.
-*/
* This function is called as a result of the "eth_drv_recv()" call above.
* It's job is to actually fetch data for a packet from the hardware once
* memory buffers have been allocated for the packet. Note that the buffers
* may come in pieces, using a scatter-gather list. This allows for more
* efficient processing in the upper layers of the stack.
+ */
 static void
-dp83902a_recv(unsigned char *data, int len)
+dp83902a_recv(u8 *data, int len)
 {
        struct dp83902a_priv_data *dp = (struct dp83902a_priv_data *) &nic;
-       cyg_uint8 *base = dp->base;
+       u8 *base = dp->base;
        int i, mlen;
-       cyg_uint8 saved_char = 0;
+       u8 saved_char = 0;
        bool saved;
 #if DEBUG & 4
        int dx;
@@ -478,11 +488,11 @@ dp83902a_recv(unsigned char *data, int len)
 #endif
 
        saved = false;
-       for (i = 0;  i < 1;  i++) {
+       for (i = 0; i < 1; i++) {
                if (data) {
                        mlen = len;
 #if DEBUG & 4
-                       printf(" sg buf %08lx len %08x \n", (unsigned long) data, mlen);
+                       printf(" sg buf %08lx len %08x \n", (u32) data, mlen);
                        dx = 0;
 #endif
                        while (0 < mlen) {
@@ -495,7 +505,7 @@ dp83902a_recv(unsigned char *data, int len)
                                }
 
                                {
-                                       cyg_uint8 tmp;
+                                       u8 tmp;
                                        DP_IN_DATA(dp->data, tmp);
 #if DEBUG & 4
                                        printf(" %02x", tmp);
@@ -516,9 +526,9 @@ static void
 dp83902a_TxEvent(void)
 {
        struct dp83902a_priv_data *dp = (struct dp83902a_priv_data *) &nic;
-       cyg_uint8 *base = dp->base;
-       unsigned char tsr;
-       unsigned long key;
+       u8 *base = dp->base;
+       u8 tsr;
+       u32 key;
 
        DEBUG_FUNCTION();
 
@@ -545,14 +555,16 @@ dp83902a_TxEvent(void)
        uboot_push_tx_done(key, 0);
 }
 
-/* Read the tally counters to clear them.  Called in response to a CNT */
-/* interrupt. */
+/*
+ * Read the tally counters to clear them. Called in response to a CNT
+ * interrupt.
+ */
 static void
 dp83902a_ClearCounters(void)
 {
        struct dp83902a_priv_data *dp = (struct dp83902a_priv_data *) &nic;
-       cyg_uint8 *base = dp->base;
-       cyg_uint8 cnt1, cnt2, cnt3;
+       u8 *base = dp->base;
+       u8 cnt1, cnt2, cnt3;
 
        DP_IN(base, DP_FER, cnt1);
        DP_IN(base, DP_CER, cnt2);
@@ -560,14 +572,16 @@ dp83902a_ClearCounters(void)
        DP_OUT(base, DP_ISR, DP_ISR_CNT);
 }
 
-/* Deal with an overflow condition.  This code follows the procedure set */
-/* out in section 7.0 of the datasheet. */
+/*
+ * Deal with an overflow condition. This code follows the procedure set
+ * out in section 7.0 of the datasheet.
+ */
 static void
 dp83902a_Overflow(void)
 {
        struct dp83902a_priv_data *dp = (struct dp83902a_priv_data *)&nic;
-       cyg_uint8 *base = dp->base;
-       cyg_uint8 isr;
+       u8 *base = dp->base;
+       u8 isr;
 
        /* Issue a stop command and wait 1.6ms for it to complete. */
        DP_OUT(base, DP_CR, DP_CR_STOP | DP_CR_NODMA);
@@ -581,9 +595,11 @@ dp83902a_Overflow(void)
        DP_OUT(base, DP_TCR, DP_TCR_LOCAL);
        DP_OUT(base, DP_CR, DP_CR_START | DP_CR_NODMA);
 
-       /* Read in as many packets as we can and acknowledge any and receive */
-       /* interrupts.  Since the buffer has overflowed, a receive event of */
-       /* some kind will have occured. */
+       /*
+        * Read in as many packets as we can and acknowledge any and receive
+        * interrupts. Since the buffer has overflowed, a receive event of
+        * some kind will have occured.
+        */
        dp83902a_RxEvent();
        DP_OUT(base, DP_ISR, DP_ISR_RxP|DP_ISR_RxE);
 
@@ -591,8 +607,10 @@ dp83902a_Overflow(void)
        DP_OUT(base, DP_ISR, DP_ISR_OFLW);
        DP_OUT(base, DP_TCR, DP_TCR_NORMAL);
 
-       /* If a transmit command was issued, but no transmit event has occured, */
-       /* restart it here. */
+       /*
+        * If a transmit command was issued, but no transmit event has occured,
+        * restart it here.
+        */
        DP_IN(base, DP_ISR, isr);
        if (dp->tx_started && !(isr & (DP_ISR_TxP|DP_ISR_TxE))) {
                DP_OUT(base, DP_CR, DP_CR_NODMA | DP_CR_TXPKT | DP_CR_START);
@@ -603,31 +621,39 @@ static void
 dp83902a_poll(void)
 {
        struct dp83902a_priv_data *dp = (struct dp83902a_priv_data *) &nic;
-       cyg_uint8 *base = dp->base;
-       unsigned char isr;
+       u8 *base = dp->base;
+       u8 isr;
 
        DP_OUT(base, DP_CR, DP_CR_NODMA | DP_CR_PAGE0 | DP_CR_START);
        DP_IN(base, DP_ISR, isr);
        while (0 != isr) {
-               /* The CNT interrupt triggers when the MSB of one of the error */
-               /* counters is set.  We don't much care about these counters, but */
-               /* we should read their values to reset them. */
+               /*
+                * The CNT interrupt triggers when the MSB of one of the error
+                * counters is set. We don't much care about these counters, but
+                * we should read their values to reset them.
+                */
                if (isr & DP_ISR_CNT) {
                        dp83902a_ClearCounters();
                }
-               /* Check for overflow.  It's a special case, since there's a */
-               /* particular procedure that must be followed to get back into */
-               /* a running state.a */
+               /*
+                * Check for overflow. It's a special case, since there's a
+                * particular procedure that must be followed to get back into
+                * a running state.a
+                */
                if (isr & DP_ISR_OFLW) {
                        dp83902a_Overflow();
                } else {
-                       /* Other kinds of interrupts can be acknowledged simply by */
-                       /* clearing the relevant bits of the ISR.  Do that now, then */
-                       /* handle the interrupts we care about. */
-                       DP_OUT(base, DP_ISR, isr);      /* Clear set bits */
+                       /*
+                        * Other kinds of interrupts can be acknowledged simply by
+                        * clearing the relevant bits of the ISR. Do that now, then
+                        * handle the interrupts we care about.
+                        */
+                       DP_OUT(base, DP_ISR, isr);      /* Clear set bits */
                        if (!dp->running) break;        /* Is this necessary? */
-                       /* Check for tx_started on TX event since these may happen */
-                       /* spuriously it seems. */
+                       /*
+                        * Check for tx_started on TX event since these may happen
+                        * spuriously it seems.
+                        */
                        if (isr & (DP_ISR_TxP|DP_ISR_TxE) && dp->tx_started) {
                                dp83902a_TxEvent();
                        }
@@ -642,13 +668,13 @@ dp83902a_poll(void)
 /* find prom (taken from pc_net_cs.c from Linux) */
 
 #include "8390.h"
-
+/*
 typedef struct hw_info_t {
        u_int   offset;
        u_char  a0, a1, a2;
        u_int   flags;
 } hw_info_t;
-
+*/
 #define DELAY_OUTPUT   0x01
 #define HAS_MISC_REG   0x02
 #define USE_BIG_BUF    0x04
@@ -658,8 +684,8 @@ typedef struct hw_info_t {
 #define HAS_MII                0x40
 #define USE_SHMEM      0x80    /* autodetected */
 
-#define AM79C9XX_HOME_PHY      0x00006B90  /* HomePNA PHY */
-#define AM79C9XX_ETH_PHY       0x00006B70  /* 10baseT PHY */
+#define AM79C9XX_HOME_PHY      0x00006B90      /* HomePNA PHY */
+#define AM79C9XX_ETH_PHY       0x00006B70      /* 10baseT PHY */
 #define MII_PHYID_REV_MASK     0xfffffff0
 #define MII_PHYID_REG1         0x02
 #define MII_PHYID_REG2         0x03
@@ -669,7 +695,7 @@ static hw_info_t hw_info[] = {
        { /* Allied Telesis LA-PCM */ 0x0ff0, 0x00, 0x00, 0xf4, 0 },
        { /* APEX MultiCard */ 0x03f4, 0x00, 0x20, 0xe5, 0 },
        { /* ASANTE FriendlyNet */ 0x4910, 0x00, 0x00, 0x94,
-         DELAY_OUTPUT | HAS_IBM_MISC },
+                       DELAY_OUTPUT | HAS_IBM_MISC },
        { /* Danpex EN-6200P2 */ 0x0110, 0x00, 0x40, 0xc7, 0 },
        { /* DataTrek NetCard */ 0x0ff0, 0x00, 0x20, 0xe8, 0 },
        { /* Dayna CommuniCard E */ 0x0110, 0x00, 0x80, 0x19, 0 },
@@ -677,48 +703,48 @@ static hw_info_t hw_info[] = {
        { /* EP-210 Ethernet */ 0x0110, 0x00, 0x40, 0x33, 0 },
        { /* EP4000 Ethernet */ 0x01c0, 0x00, 0x00, 0xb4, 0 },
        { /* Epson EEN10B */ 0x0ff0, 0x00, 0x00, 0x48,
-         HAS_MISC_REG | HAS_IBM_MISC },
+                       HAS_MISC_REG | HAS_IBM_MISC },
        { /* ELECOM Laneed LD-CDWA */ 0xb8, 0x08, 0x00, 0x42, 0 },
        { /* Hypertec Ethernet */ 0x01c0, 0x00, 0x40, 0x4c, 0 },
        { /* IBM CCAE */ 0x0ff0, 0x08, 0x00, 0x5a,
-         HAS_MISC_REG | HAS_IBM_MISC },
+                       HAS_MISC_REG | HAS_IBM_MISC },
        { /* IBM CCAE */ 0x0ff0, 0x00, 0x04, 0xac,
-         HAS_MISC_REG | HAS_IBM_MISC },
+                       HAS_MISC_REG | HAS_IBM_MISC },
        { /* IBM CCAE */ 0x0ff0, 0x00, 0x06, 0x29,
-         HAS_MISC_REG | HAS_IBM_MISC },
+                       HAS_MISC_REG | HAS_IBM_MISC },
        { /* IBM FME */ 0x0374, 0x08, 0x00, 0x5a,
-         HAS_MISC_REG | HAS_IBM_MISC },
+                       HAS_MISC_REG | HAS_IBM_MISC },
        { /* IBM FME */ 0x0374, 0x00, 0x04, 0xac,
-         HAS_MISC_REG | HAS_IBM_MISC },
+                       HAS_MISC_REG | HAS_IBM_MISC },
        { /* Kansai KLA-PCM/T */ 0x0ff0, 0x00, 0x60, 0x87,
-         HAS_MISC_REG | HAS_IBM_MISC },
+                       HAS_MISC_REG | HAS_IBM_MISC },
        { /* NSC DP83903 */ 0x0374, 0x08, 0x00, 0x17,
-         HAS_MISC_REG | HAS_IBM_MISC },
+                       HAS_MISC_REG | HAS_IBM_MISC },
        { /* NSC DP83903 */ 0x0374, 0x00, 0xc0, 0xa8,
-         HAS_MISC_REG | HAS_IBM_MISC },
+                       HAS_MISC_REG | HAS_IBM_MISC },
        { /* NSC DP83903 */ 0x0374, 0x00, 0xa0, 0xb0,
-         HAS_MISC_REG | HAS_IBM_MISC },
+                       HAS_MISC_REG | HAS_IBM_MISC },
        { /* NSC DP83903 */ 0x0198, 0x00, 0x20, 0xe0,
-         HAS_MISC_REG | HAS_IBM_MISC },
+                       HAS_MISC_REG | HAS_IBM_MISC },
        { /* I-O DATA PCLA/T */ 0x0ff0, 0x00, 0xa0, 0xb0, 0 },
        { /* Katron PE-520 */ 0x0110, 0x00, 0x40, 0xf6, 0 },
        { /* Kingston KNE-PCM/x */ 0x0ff0, 0x00, 0xc0, 0xf0,
-         HAS_MISC_REG | HAS_IBM_MISC },
+                       HAS_MISC_REG | HAS_IBM_MISC },
        { /* Kingston KNE-PCM/x */ 0x0ff0, 0xe2, 0x0c, 0x0f,
-         HAS_MISC_REG | HAS_IBM_MISC },
+                       HAS_MISC_REG | HAS_IBM_MISC },
        { /* Kingston KNE-PC2 */ 0x0180, 0x00, 0xc0, 0xf0, 0 },
        { /* Maxtech PCN2000 */ 0x5000, 0x00, 0x00, 0xe8, 0 },
        { /* NDC Instant-Link */ 0x003a, 0x00, 0x80, 0xc6, 0 },
        { /* NE2000 Compatible */ 0x0ff0, 0x00, 0xa0, 0x0c, 0 },
        { /* Network General Sniffer */ 0x0ff0, 0x00, 0x00, 0x65,
-         HAS_MISC_REG | HAS_IBM_MISC },
+                       HAS_MISC_REG | HAS_IBM_MISC },
        { /* Panasonic VEL211 */ 0x0ff0, 0x00, 0x80, 0x45,
-         HAS_MISC_REG | HAS_IBM_MISC },
+                       HAS_MISC_REG | HAS_IBM_MISC },
        { /* PreMax PE-200 */ 0x07f0, 0x00, 0x20, 0xe0, 0 },
        { /* RPTI EP400 */ 0x0110, 0x00, 0x40, 0x95, 0 },
        { /* SCM Ethernet */ 0x0ff0, 0x00, 0x20, 0xcb, 0 },
        { /* Socket EA */ 0x4000, 0x00, 0xc0, 0x1b,
-         DELAY_OUTPUT | HAS_MISC_REG | USE_BIG_BUF },
+                       DELAY_OUTPUT | HAS_MISC_REG | USE_BIG_BUF },
        { /* Socket LP-E CF+ */ 0x01c0, 0x00, 0xc0, 0x1b, 0 },
        { /* SuperSocket RE450T */ 0x0110, 0x00, 0xe0, 0x98, 0 },
        { /* Volktek NPL-402CT */ 0x0060, 0x00, 0x40, 0x05, 0 },
@@ -731,115 +757,30 @@ static hw_info_t hw_info[] = {
 
 static hw_info_t default_info = { 0, 0, 0, 0, 0 };
 
-unsigned char dev_addr[6];
+u8 dev_addr[6];
 
 #define PCNET_CMD      0x00
 #define PCNET_DATAPORT 0x10    /* NatSemi-defined port window offset. */
 #define PCNET_RESET    0x1f    /* Issue a read to reset, a write to clear. */
 #define PCNET_MISC     0x18    /* For IBM CCAE and Socket EA cards */
 
-unsigned long nic_base;
-
-static void pcnet_reset_8390(void)
-{
-       int i, r;
-
-       PRINTK("nic base is %lx\n", nic_base);
-
-       n2k_outb(E8390_NODMA+E8390_PAGE0+E8390_STOP, E8390_CMD);
-       PRINTK("cmd (at %lx) is %x\n", nic_base+ E8390_CMD, n2k_inb(E8390_CMD));
-       n2k_outb(E8390_NODMA+E8390_PAGE1+E8390_STOP, E8390_CMD);
-       PRINTK("cmd (at %lx) is %x\n", nic_base+ E8390_CMD, n2k_inb(E8390_CMD));
-       n2k_outb(E8390_NODMA+E8390_PAGE0+E8390_STOP, E8390_CMD);
-       PRINTK("cmd (at %lx) is %x\n", nic_base+ E8390_CMD, n2k_inb(E8390_CMD));
-       n2k_outb(E8390_NODMA+E8390_PAGE0+E8390_STOP, E8390_CMD);
-
-       n2k_outb(n2k_inb(PCNET_RESET), PCNET_RESET);
-
-       for (i = 0; i < 100; i++) {
-               if ((r = (n2k_inb(EN0_ISR) & ENISR_RESET)) != 0)
-                       break;
-               PRINTK("got %x in reset\n", r);
-               my_udelay(100);
-       }
-       n2k_outb(ENISR_RESET, EN0_ISR); /* Ack intr. */
-
-       if (i == 100)
-               printf("pcnet_reset_8390() did not complete.\n");
-} /* pcnet_reset_8390 */
-
-static hw_info_t * get_prom(void ) {
-       unsigned char prom[32];
-       int i, j;
-       struct {
-               u_char value, offset;
-       } program_seq[] = {
-               {E8390_NODMA+E8390_PAGE0+E8390_STOP, E8390_CMD}, /* Select page 0*/
-               {0x48,  EN0_DCFG},      /* Set byte-wide (0x48) access. */
-               {0x00,  EN0_RCNTLO},    /* Clear the count regs. */
-               {0x00,  EN0_RCNTHI},
-               {0x00,  EN0_IMR},       /* Mask completion irq. */
-               {0xFF,  EN0_ISR},
-               {E8390_RXOFF, EN0_RXCR},        /* 0x20  Set to monitor */
-               {E8390_TXOFF, EN0_TXCR},        /* 0x02  and loopback mode. */
-               {32,    EN0_RCNTLO},
-               {0x00,  EN0_RCNTHI},
-               {0x00,  EN0_RSARLO},    /* DMA starting at 0x0000. */
-               {0x00,  EN0_RSARHI},
-               {E8390_RREAD+E8390_START, E8390_CMD},
-       };
-
-       PRINTK("trying to get MAC via prom reading\n");
-
-       pcnet_reset_8390();
-
-       mdelay(10);
-
-       for (i = 0; i < sizeof(program_seq)/sizeof(program_seq[0]); i++)
-               n2k_outb(program_seq[i].value, program_seq[i].offset);
-
-       PRINTK("PROM:");
-       for (i = 0; i < 32; i++) {
-               prom[i] = n2k_inb(PCNET_DATAPORT);
-               PRINTK(" %02x", prom[i]);
-       }
-       PRINTK("\n");
-       for (i = 0; i < NR_INFO; i++) {
-               if ((prom[0] == hw_info[i].a0) &&
-                   (prom[2] == hw_info[i].a1) &&
-                   (prom[4] == hw_info[i].a2)) {
-                       PRINTK("matched board %d\n", i);
-                       break;
-               }
-       }
-       if ((i < NR_INFO) || ((prom[28] == 0x57) && (prom[30] == 0x57))) {
-               for (j = 0; j < 6; j++)
-                       dev_addr[j] = prom[j<<1];
-               PRINTK("on exit i is %d/%ld\n", i, NR_INFO);
-               PRINTK("MAC address is %02x:%02x:%02x:%02x:%02x:%02x\n",
-                      dev_addr[0],dev_addr[1],dev_addr[2],dev_addr[3],dev_addr[4],dev_addr[5]);
-               return (i < NR_INFO) ? hw_info+i : &default_info;
-       }
-       return NULL;
-}
+u32 nic_base;
 
 /* U-boot specific routines */
-
-
-static unsigned char *pbuf = NULL;
+static u8 *pbuf = NULL;
 
 static int pkey = -1;
-static int initialized=0;
+static int initialized = 0;
 
 void uboot_push_packet_len(int len) {
        PRINTK("pushed len = %d\n", len);
-       if (len>=2000) {
+       if (len >= 2000) {
                printf("NE2000: packet too big\n");
                return;
        }
        dp83902a_recv(&pbuf[0], len);
 
-       /* Just pass it to the upper layer */
+       /*Just pass it to the upper layer*/
        NetReceive(&pbuf[0], len);
 }
 
@@ -864,7 +805,7 @@ int eth_init(bd_t *bd) {
 
 #ifdef CONFIG_DRIVER_NE2000_CCR
        {
-               volatile unsigned char *p =  (volatile unsigned char *) CONFIG_DRIVER_NE2000_CCR;
+               vu_char *p = (vu_char *) CONFIG_DRIVER_NE2000_CCR;
 
                PRINTK("CCR before is %x\n", *p);
                *p = CONFIG_DRIVER_NE2000_VAL;
@@ -873,9 +814,9 @@ int eth_init(bd_t *bd) {
 #endif
 
        nic_base = CONFIG_DRIVER_NE2000_BASE;
-       nic.base = (cyg_uint8 *) CONFIG_DRIVER_NE2000_BASE;
+       nic.base = (u8 *) CONFIG_DRIVER_NE2000_BASE;
 
-       r = get_prom();
+       r = get_prom(dev_addr);
        if (!r)
                return -1;
 
@@ -886,26 +827,27 @@ int eth_init(bd_t *bd) {
        PRINTK("Set environment from HW MAC addr = \"%s\"\n", ethaddr);
        setenv ("ethaddr", ethaddr);
 
-
-#define DP_DATA                0x10
        nic.data = nic.base + DP_DATA;
-       nic.tx_buf1 = 0x40;
-       nic.tx_buf2 = 0x48;
-       nic.rx_buf_start = 0x50;
-       nic.rx_buf_end = 0x80;
+       nic.tx_buf1 = START_PG;
+       nic.tx_buf2 = START_PG2;
+       nic.rx_buf_start = RX_START;
+       nic.rx_buf_end = RX_END;
 
        if (dp83902a_init() == false)
                return -1;
+
        dp83902a_start(dev_addr);
-       initialized=1;
+       initialized = 1;
+
        return 0;
 }
 
 void eth_halt() {
+
        PRINTK("### eth_halt\n");
        if(initialized)
                dp83902a_stop();
-       initialized=0;
+       initialized = 0;
 }
 
 int eth_rx() {
@@ -920,7 +862,7 @@ int eth_send(volatile void *packet, int length) {
 
        pkey = -1;
 
-       dp83902a_send((unsigned char *) packet, length, 666);
+       dp83902a_send((u8 *) packet, length, 666);
        tmo = get_timer (0) + TOUT * CFG_HZ;
        while(1) {
                dp83902a_poll();
@@ -936,4 +878,3 @@ int eth_send(volatile void *packet, int length) {
        }
        return 0;
 }
-#endif
index c13d9f0..6049482 100644 (file)
@@ -1,16 +1,15 @@
 /*
-Ported to U-Boot  by Christian Pellegrin <chri@ascensit.com>
+Ported to U-Boot by Christian Pellegrin <chri@ascensit.com>
 
 Based on sources from the Linux kernel (pcnet_cs.c, 8390.h) and
 eCOS(if_dp83902a.c, if_dp83902a.h). Both of these 2 wonderful world
 are GPL, so this is, of course, GPL.
 
-
 ==========================================================================
 
-      dev/dp83902a.h
+       dev/dp83902a.h
 
-      National Semiconductor DP83902a ethernet chip
+       National Semiconductor DP83902a ethernet chip
 
 ==========================================================================
 ####ECOSGPLCOPYRIGHTBEGIN####
@@ -58,222 +57,123 @@ are GPL, so this is, of course, GPL.
 ==========================================================================
 #####DESCRIPTIONBEGIN####
 
- Author(s):    gthomas
- Contributors: gthomas, jskov
- Date:         2001-06-13
+ Author(s):    gthomas
+ Contributors: gthomas, jskov
+ Date:         2001-06-13
  Purpose:
  Description:
 
 ####DESCRIPTIONEND####
 
 ==========================================================================
-
 */
 
 /*
- ------------------------------------------------------------------------
- Macros for accessing DP registers
- These can be overridden by the platform header
-*/
-
-#define DP_IN(_b_, _o_, _d_)  (_d_) = *( (volatile unsigned char *) ((_b_)+(_o_)))
-#define DP_OUT(_b_, _o_, _d_) *( (volatile unsigned char *) ((_b_)+(_o_))) = (_d_)
-
-#define DP_IN_DATA(_b_, _d_)  (_d_) = *( (volatile unsigned char *) ((_b_)))
-#define DP_OUT_DATA(_b_, _d_) *( (volatile unsigned char *) ((_b_))) = (_d_)
-
-
-/* here is all the data */
-
-#define cyg_uint8 unsigned char
-#define cyg_uint16 unsigned short
-#define bool int
-
-#define false 0
-#define true 1
-
-#define CYGHWR_NS_DP83902A_PLF_BROKEN_TX_DMA 1
-#define CYGACC_CALL_IF_DELAY_US(X) my_udelay(X)
-
-typedef struct dp83902a_priv_data {
-    cyg_uint8* base;
-    cyg_uint8* data;
-    cyg_uint8* reset;
-    int tx_next;           /* First free Tx page */
-    int tx_int;            /* Expecting interrupt from this buffer */
-    int rx_next;           /* First free Rx page */
-    int tx1, tx2;          /* Page numbers for Tx buffers */
-    unsigned long tx1_key, tx2_key;   /* Used to ack when packet sent */
-    int tx1_len, tx2_len;
-    bool tx_started, running, hardwired_esa;
-    cyg_uint8 esa[6];
-    void* plf_priv;
-
-    /* Buffer allocation */
-    int tx_buf1, tx_buf2;
-    int rx_buf_start, rx_buf_end;
-} dp83902a_priv_data_t;
-
-/*
- ------------------------------------------------------------------------
- Some forward declarations
-*/
-static void dp83902a_poll(void);
-
-/* ------------------------------------------------------------------------ */
-/* Register offsets */
-
-#define DP_CR          0x00
-#define DP_CLDA0       0x01
-#define DP_PSTART      0x01             /* write */
-#define DP_CLDA1       0x02
-#define DP_PSTOP       0x02             /* write */
-#define DP_BNDRY       0x03
-#define DP_TSR         0x04
-#define DP_TPSR        0x04             /* write */
-#define DP_NCR         0x05
-#define DP_TBCL        0x05             /* write */
-#define DP_FIFO        0x06
-#define DP_TBCH        0x06             /* write */
-#define DP_ISR         0x07
-#define DP_CRDA0       0x08
-#define DP_RSAL        0x08             /* write */
-#define DP_CRDA1       0x09
-#define DP_RSAH        0x09             /* write */
-#define DP_RBCL        0x0a             /* write */
-#define DP_RBCH        0x0b             /* write */
-#define DP_RSR         0x0c
-#define DP_RCR         0x0c             /* write */
-#define DP_FER         0x0d
-#define DP_TCR         0x0d             /* write */
-#define DP_CER         0x0e
-#define DP_DCR         0x0e             /* write */
-#define DP_MISSED      0x0f
-#define DP_IMR         0x0f             /* write */
-#define DP_DATAPORT    0x10             /* "eprom" data port */
-
-#define DP_P1_CR       0x00
-#define DP_P1_PAR0     0x01
-#define DP_P1_PAR1     0x02
-#define DP_P1_PAR2     0x03
-#define DP_P1_PAR3     0x04
-#define DP_P1_PAR4     0x05
-#define DP_P1_PAR5     0x06
-#define DP_P1_CURP     0x07
-#define DP_P1_MAR0     0x08
-#define DP_P1_MAR1     0x09
-#define DP_P1_MAR2     0x0a
-#define DP_P1_MAR3     0x0b
-#define DP_P1_MAR4     0x0c
-#define DP_P1_MAR5     0x0d
-#define DP_P1_MAR6     0x0e
-#define DP_P1_MAR7     0x0f
-
-#define DP_P2_CR       0x00
-#define DP_P2_PSTART   0x01
-#define DP_P2_CLDA0    0x01             /* write */
-#define DP_P2_PSTOP    0x02
-#define DP_P2_CLDA1    0x02             /* write */
-#define DP_P2_RNPP     0x03
-#define DP_P2_TPSR     0x04
-#define DP_P2_LNPP     0x05
-#define DP_P2_ACH      0x06
-#define DP_P2_ACL      0x07
-#define DP_P2_RCR      0x0c
-#define DP_P2_TCR      0x0d
-#define DP_P2_DCR      0x0e
-#define DP_P2_IMR      0x0f
-
-/* Command register - common to all pages */
-
-#define DP_CR_STOP    0x01   /* Stop: software reset */
-#define DP_CR_START   0x02   /* Start: initialize device */
-#define DP_CR_TXPKT   0x04   /* Transmit packet */
-#define DP_CR_RDMA    0x08   /* Read DMA  (recv data from device) */
-#define DP_CR_WDMA    0x10   /* Write DMA (send data to device) */
-#define DP_CR_SEND    0x18   /* Send packet */
-#define DP_CR_NODMA   0x20   /* Remote (or no) DMA */
-#define DP_CR_PAGE0   0x00   /* Page select */
-#define DP_CR_PAGE1   0x40
-#define DP_CR_PAGE2   0x80
-#define DP_CR_PAGEMSK 0x3F   /* Used to mask out page bits */
-
-/* Data configuration register */
-
-#define DP_DCR_WTS    0x01   /* 1=16 bit word transfers */
-#define DP_DCR_BOS    0x02   /* 1=Little Endian */
-#define DP_DCR_LAS    0x04   /* 1=Single 32 bit DMA mode */
-#define DP_DCR_LS     0x08   /* 1=normal mode, 0=loopback */
-#define DP_DCR_ARM    0x10   /* 0=no send command (program I/O) */
-#define DP_DCR_FIFO_1 0x00   /* FIFO threshold */
-#define DP_DCR_FIFO_2 0x20
-#define DP_DCR_FIFO_4 0x40
-#define DP_DCR_FIFO_6 0x60
-
-#define DP_DCR_INIT   (DP_DCR_LS|DP_DCR_FIFO_4)
-
-/* Interrupt status register */
-
-#define DP_ISR_RxP    0x01   /* Packet received */
-#define DP_ISR_TxP    0x02   /* Packet transmitted */
-#define DP_ISR_RxE    0x04   /* Receive error */
-#define DP_ISR_TxE    0x08   /* Transmit error */
-#define DP_ISR_OFLW   0x10   /* Receive overflow */
-#define DP_ISR_CNT    0x20   /* Tally counters need emptying */
-#define DP_ISR_RDC    0x40   /* Remote DMA complete */
-#define DP_ISR_RESET  0x80   /* Device has reset (shutdown, error) */
-
-/* Interrupt mask register */
-
-#define DP_IMR_RxP    0x01   /* Packet received */
-#define DP_IMR_TxP    0x02   /* Packet transmitted */
-#define DP_IMR_RxE    0x04   /* Receive error */
-#define DP_IMR_TxE    0x08   /* Transmit error */
-#define DP_IMR_OFLW   0x10   /* Receive overflow */
-#define DP_IMR_CNT    0x20   /* Tall counters need emptying */
-#define DP_IMR_RDC    0x40   /* Remote DMA complete */
-
-#define DP_IMR_All    0x3F   /* Everything but remote DMA */
-
-/* Receiver control register */
-
-#define DP_RCR_SEP    0x01   /* Save bad(error) packets */
-#define DP_RCR_AR     0x02   /* Accept runt packets */
-#define DP_RCR_AB     0x04   /* Accept broadcast packets */
-#define DP_RCR_AM     0x08   /* Accept multicast packets */
-#define DP_RCR_PROM   0x10   /* Promiscuous mode */
-#define DP_RCR_MON    0x20   /* Monitor mode - 1=accept no packets */
-
-/* Receiver status register */
-
-#define DP_RSR_RxP    0x01   /* Packet received */
-#define DP_RSR_CRC    0x02   /* CRC error */
-#define DP_RSR_FRAME  0x04   /* Framing error */
-#define DP_RSR_FO     0x08   /* FIFO overrun */
-#define DP_RSR_MISS   0x10   /* Missed packet */
-#define DP_RSR_PHY    0x20   /* 0=pad match, 1=mad match */
-#define DP_RSR_DIS    0x40   /* Receiver disabled */
-#define DP_RSR_DFR    0x80   /* Receiver processing deferred */
-
-/* Transmitter control register */
-
-#define DP_TCR_NOCRC  0x01   /* 1=inhibit CRC */
-#define DP_TCR_NORMAL 0x00   /* Normal transmitter operation */
-#define DP_TCR_LOCAL  0x02   /* Internal NIC loopback */
-#define DP_TCR_INLOOP 0x04   /* Full internal loopback */
-#define DP_TCR_OUTLOOP 0x08  /* External loopback */
-#define DP_TCR_ATD    0x10   /* Auto transmit disable */
-#define DP_TCR_OFFSET 0x20   /* Collision offset adjust */
-
-/* Transmit status register */
-
-#define DP_TSR_TxP    0x01   /* Packet transmitted */
-#define DP_TSR_COL    0x04   /* Collision (at least one) */
-#define DP_TSR_ABT    0x08   /* Aborted because of too many collisions */
-#define DP_TSR_CRS    0x10   /* Lost carrier */
-#define DP_TSR_FU     0x20   /* FIFO underrun */
-#define DP_TSR_CDH    0x40   /* Collision Detect Heartbeat */
-#define DP_TSR_OWC    0x80   /* Collision outside normal window */
-
-#define IEEE_8023_MAX_FRAME         1518    /* Largest possible ethernet frame */
-#define IEEE_8023_MIN_FRAME           64    /* Smallest possible ethernet frame */
+ * NE2000 support header file.
+ *             Created by Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+ */
+
+#ifndef __DRIVERS_NE2000_H__
+#define __DRIVERS_NE2000_H__
+
+/* Enable NE2000 basic init function */
+#define NE2000_BASIC_INIT
+
+#define DP_DATA                0x10
+#define START_PG       0x50    /* First page of TX buffer */
+#define STOP_PG                0x80    /* Last page +1 of RX ring */
+
+#define RX_START       0x50
+#define RX_END         0x80
+
+#define DP_IN(_b_, _o_, _d_)   (_d_) = *( (vu_char *) ((_b_)+(_o_)))
+#define DP_OUT(_b_, _o_, _d_)  *( (vu_char *) ((_b_)+(_o_))) = (_d_)
+#define DP_IN_DATA(_b_, _d_)   (_d_) = *( (vu_char *) ((_b_)))
+#define DP_OUT_DATA(_b_, _d_)  *( (vu_char *) ((_b_))) = (_d_)
+
+static void pcnet_reset_8390(void)
+{
+       int i, r;
+
+       PRINTK("nic base is %lx\n", nic_base);
+
+       n2k_outb(E8390_NODMA+E8390_PAGE0+E8390_STOP, E8390_CMD);
+       PRINTK("cmd (at %lx) is %x\n", nic_base+ E8390_CMD, n2k_inb(E8390_CMD));
+       n2k_outb(E8390_NODMA+E8390_PAGE1+E8390_STOP, E8390_CMD);
+       PRINTK("cmd (at %lx) is %x\n", nic_base+ E8390_CMD, n2k_inb(E8390_CMD));
+       n2k_outb(E8390_NODMA+E8390_PAGE0+E8390_STOP, E8390_CMD);
+       PRINTK("cmd (at %lx) is %x\n", nic_base+ E8390_CMD, n2k_inb(E8390_CMD));
+       n2k_outb(E8390_NODMA+E8390_PAGE0+E8390_STOP, E8390_CMD);
+
+       n2k_outb(n2k_inb(PCNET_RESET), PCNET_RESET);
+
+       for (i = 0; i < 100; i++) {
+               if ((r = (n2k_inb(EN0_ISR) & ENISR_RESET)) != 0)
+                       break;
+               PRINTK("got %x in reset\n", r);
+               udelay(100);
+       }
+       n2k_outb(ENISR_RESET, EN0_ISR); /* Ack intr. */
+
+       if (i == 100)
+               printf("pcnet_reset_8390() did not complete.\n");
+} /* pcnet_reset_8390 */
+
+int get_prom(u8* mac_addr)
+{
+       u8 prom[32];
+       int i, j;
+       struct {
+               u_char value, offset;
+       } program_seq[] = {
+               {E8390_NODMA+E8390_PAGE0+E8390_STOP, E8390_CMD}, /* Select page 0*/
+               {0x48,  EN0_DCFG},              /* Set byte-wide (0x48) access. */
+               {0x00,  EN0_RCNTLO},            /* Clear the count regs. */
+               {0x00,  EN0_RCNTHI},
+               {0x00,  EN0_IMR},               /* Mask completion irq. */
+               {0xFF,  EN0_ISR},
+               {E8390_RXOFF, EN0_RXCR},        /* 0x20  Set to monitor */
+               {E8390_TXOFF, EN0_TXCR},        /* 0x02  and loopback mode. */
+               {32,    EN0_RCNTLO},
+               {0x00,  EN0_RCNTHI},
+               {0x00,  EN0_RSARLO},            /* DMA starting at 0x0000. */
+               {0x00,  EN0_RSARHI},
+               {E8390_RREAD+E8390_START, E8390_CMD},
+       };
+
+       PRINTK ("trying to get MAC via prom reading\n");
+
+       pcnet_reset_8390 ();
+
+       mdelay (10);
+
+       for (i = 0; i < sizeof (program_seq) / sizeof (program_seq[0]); i++)
+               n2k_outb (program_seq[i].value, program_seq[i].offset);
+
+       PRINTK ("PROM:");
+       for (i = 0; i < 32; i++) {
+               prom[i] = n2k_inb (PCNET_DATAPORT);
+               PRINTK (" %02x", prom[i]);
+       }
+       PRINTK ("\n");
+       for (i = 0; i < NR_INFO; i++) {
+               if ((prom[0] == hw_info[i].a0) &&
+                   (prom[2] == hw_info[i].a1) &&
+                   (prom[4] == hw_info[i].a2)) {
+                       PRINTK ("matched board %d\n", i);
+                       break;
+               }
+       }
+       if ((i < NR_INFO) || ((prom[28] == 0x57) && (prom[30] == 0x57))) {
+               PRINTK ("on exit i is %d/%ld\n", i, NR_INFO);
+               PRINTK ("MAC address is ");
+               for (j = 0; j < 6; j++) {
+                       mac_addr[j] = prom[j << 1];
+                       PRINTK ("%02x:", mac_addr[i]);
+               }
+               PRINTK ("\n");
+               return (i < NR_INFO) ? i : 0;
+       }
+       return NULL;
+}
+#endif /* __DRIVERS_NE2000_H__ */
diff --git a/drivers/net/ne2000_base.h b/drivers/net/ne2000_base.h
new file mode 100644 (file)
index 0000000..990d748
--- /dev/null
@@ -0,0 +1,285 @@
+/*
+Ported to U-Boot by Christian Pellegrin <chri@ascensit.com>
+
+Based on sources from the Linux kernel (pcnet_cs.c, 8390.h) and
+eCOS(if_dp83902a.c, if_dp83902a.h). Both of these 2 wonderful world
+are GPL, so this is, of course, GPL.
+
+
+==========================================================================
+
+       dev/dp83902a.h
+
+       National Semiconductor DP83902a ethernet chip
+
+==========================================================================
+####ECOSGPLCOPYRIGHTBEGIN####
+ -------------------------------------------
+ This file is part of eCos, the Embedded Configurable Operating System.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+
+ eCos is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 or (at your option) any later version.
+
+ eCos 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 eCos; if not, write to the Free Software Foundation, Inc.,
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+
+ As a special exception, if other files instantiate templates or use macros
+ or inline functions from this file, or you compile this file and link it
+ with other works to produce a work based on this file, this file does not
+ by itself cause the resulting work to be covered by the GNU General Public
+ License. However the source code for this file must still be made available
+ in accordance with section (3) of the GNU General Public License.
+
+ This exception does not invalidate any other reasons why a work based on
+ this file might be covered by the GNU General Public License.
+
+ Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
+ at http://sources.redhat.com/ecos/ecos-license/
+ -------------------------------------------
+####ECOSGPLCOPYRIGHTEND####
+####BSDCOPYRIGHTBEGIN####
+
+ -------------------------------------------
+
+ Portions of this software may have been derived from OpenBSD or other sources,
+ and are covered by the appropriate copyright disclaimers included herein.
+
+ -------------------------------------------
+
+####BSDCOPYRIGHTEND####
+==========================================================================
+#####DESCRIPTIONBEGIN####
+
+ Author(s):    gthomas
+ Contributors: gthomas, jskov
+ Date:         2001-06-13
+ Purpose:
+ Description:
+
+####DESCRIPTIONEND####
+
+==========================================================================
+
+*/
+
+/*
+ ------------------------------------------------------------------------
+ Macros for accessing DP registers
+ These can be overridden by the platform header
+*/
+
+#ifndef __NE2000_BASE_H__
+#define __NE2000_BASE_H__
+
+#define bool int
+
+#define false 0
+#define true 1
+
+/* timeout for tx/rx in s */
+#define TOUT 5
+/* Ether MAC address size */
+#define ETHER_ADDR_LEN 6
+
+
+#define CYGHWR_NS_DP83902A_PLF_BROKEN_TX_DMA 1
+#define CYGACC_CALL_IF_DELAY_US(X) udelay(X)
+
+/* H/W infomation struct */
+typedef struct hw_info_t {
+       u32 offset;
+       u8 a0, a1, a2;
+       u32 flags;
+} hw_info_t;
+
+typedef struct dp83902a_priv_data {
+       u8* base;
+       u8* data;
+       u8* reset;
+       int tx_next;            /* First free Tx page */
+       int tx_int;             /* Expecting interrupt from this buffer */
+       int rx_next;            /* First free Rx page */
+       int tx1, tx2;           /* Page numbers for Tx buffers */
+       u32 tx1_key, tx2_key;   /* Used to ack when packet sent */
+       int tx1_len, tx2_len;
+       bool tx_started, running, hardwired_esa;
+       u8 esa[6];
+       void* plf_priv;
+
+       /* Buffer allocation */
+       int tx_buf1, tx_buf2;
+       int rx_buf_start, rx_buf_end;
+} dp83902a_priv_data_t;
+
+/*
+ * Some forward declarations
+ */
+int get_prom( u8* mac_addr);
+static void dp83902a_poll(void);
+
+/* ------------------------------------------------------------------------ */
+/* Register offsets */
+
+#define DP_CR          0x00
+#define DP_CLDA0       0x01
+#define DP_PSTART      0x01    /* write */
+#define DP_CLDA1       0x02
+#define DP_PSTOP       0x02    /* write */
+#define DP_BNDRY       0x03
+#define DP_TSR         0x04
+#define DP_TPSR                0x04    /* write */
+#define DP_NCR         0x05
+#define DP_TBCL                0x05    /* write */
+#define DP_FIFO                0x06
+#define DP_TBCH                0x06    /* write */
+#define DP_ISR         0x07
+#define DP_CRDA0       0x08
+#define DP_RSAL                0x08    /* write */
+#define DP_CRDA1       0x09
+#define DP_RSAH                0x09    /* write */
+#define DP_RBCL                0x0a    /* write */
+#define DP_RBCH                0x0b    /* write */
+#define DP_RSR         0x0c
+#define DP_RCR         0x0c    /* write */
+#define DP_FER         0x0d
+#define DP_TCR         0x0d    /* write */
+#define DP_CER         0x0e
+#define DP_DCR         0x0e    /* write */
+#define DP_MISSED      0x0f
+#define DP_IMR         0x0f    /* write */
+#define DP_DATAPORT    0x10    /* "eprom" data port */
+
+#define DP_P1_CR       0x00
+#define DP_P1_PAR0     0x01
+#define DP_P1_PAR1     0x02
+#define DP_P1_PAR2     0x03
+#define DP_P1_PAR3     0x04
+#define DP_P1_PAR4     0x05
+#define DP_P1_PAR5     0x06
+#define DP_P1_CURP     0x07
+#define DP_P1_MAR0     0x08
+#define DP_P1_MAR1     0x09
+#define DP_P1_MAR2     0x0a
+#define DP_P1_MAR3     0x0b
+#define DP_P1_MAR4     0x0c
+#define DP_P1_MAR5     0x0d
+#define DP_P1_MAR6     0x0e
+#define DP_P1_MAR7     0x0f
+
+#define DP_P2_CR       0x00
+#define DP_P2_PSTART   0x01
+#define DP_P2_CLDA0    0x01    /* write */
+#define DP_P2_PSTOP    0x02
+#define DP_P2_CLDA1    0x02    /* write */
+#define DP_P2_RNPP     0x03
+#define DP_P2_TPSR     0x04
+#define DP_P2_LNPP     0x05
+#define DP_P2_ACH      0x06
+#define DP_P2_ACL      0x07
+#define DP_P2_RCR      0x0c
+#define DP_P2_TCR      0x0d
+#define DP_P2_DCR      0x0e
+#define DP_P2_IMR      0x0f
+
+/* Command register - common to all pages */
+
+#define DP_CR_STOP     0x01    /* Stop: software reset */
+#define DP_CR_START    0x02    /* Start: initialize device */
+#define DP_CR_TXPKT    0x04    /* Transmit packet */
+#define DP_CR_RDMA     0x08    /* Read DMA (recv data from device) */
+#define DP_CR_WDMA     0x10    /* Write DMA (send data to device) */
+#define DP_CR_SEND     0x18    /* Send packet */
+#define DP_CR_NODMA    0x20    /* Remote (or no) DMA */
+#define DP_CR_PAGE0    0x00    /* Page select */
+#define DP_CR_PAGE1    0x40
+#define DP_CR_PAGE2    0x80
+#define DP_CR_PAGEMSK  0x3F    /* Used to mask out page bits */
+
+/* Data configuration register */
+
+#define DP_DCR_WTS     0x01    /* 1=16 bit word transfers */
+#define DP_DCR_BOS     0x02    /* 1=Little Endian */
+#define DP_DCR_LAS     0x04    /* 1=Single 32 bit DMA mode */
+#define DP_DCR_LS      0x08    /* 1=normal mode, 0=loopback */
+#define DP_DCR_ARM     0x10    /* 0=no send command (program I/O) */
+#define DP_DCR_FIFO_1  0x00    /* FIFO threshold */
+#define DP_DCR_FIFO_2  0x20
+#define DP_DCR_FIFO_4  0x40
+#define DP_DCR_FIFO_6  0x60
+
+#define DP_DCR_INIT    (DP_DCR_LS|DP_DCR_FIFO_4)
+
+/* Interrupt status register */
+
+#define DP_ISR_RxP     0x01    /* Packet received */
+#define DP_ISR_TxP     0x02    /* Packet transmitted */
+#define DP_ISR_RxE     0x04    /* Receive error */
+#define DP_ISR_TxE     0x08    /* Transmit error */
+#define DP_ISR_OFLW    0x10    /* Receive overflow */
+#define DP_ISR_CNT     0x20    /* Tally counters need emptying */
+#define DP_ISR_RDC     0x40    /* Remote DMA complete */
+#define DP_ISR_RESET   0x80    /* Device has reset (shutdown, error) */
+
+/* Interrupt mask register */
+
+#define DP_IMR_RxP     0x01    /* Packet received */
+#define DP_IMR_TxP     0x02    /* Packet transmitted */
+#define DP_IMR_RxE     0x04    /* Receive error */
+#define DP_IMR_TxE     0x08    /* Transmit error */
+#define DP_IMR_OFLW    0x10    /* Receive overflow */
+#define DP_IMR_CNT     0x20    /* Tall counters need emptying */
+#define DP_IMR_RDC     0x40    /* Remote DMA complete */
+
+#define DP_IMR_All     0x3F    /* Everything but remote DMA */
+
+/* Receiver control register */
+
+#define DP_RCR_SEP     0x01    /* Save bad(error) packets */
+#define DP_RCR_AR      0x02    /* Accept runt packets */
+#define DP_RCR_AB      0x04    /* Accept broadcast packets */
+#define DP_RCR_AM      0x08    /* Accept multicast packets */
+#define DP_RCR_PROM    0x10    /* Promiscuous mode */
+#define DP_RCR_MON     0x20    /* Monitor mode - 1=accept no packets */
+
+/* Receiver status register */
+
+#define DP_RSR_RxP     0x01    /* Packet received */
+#define DP_RSR_CRC     0x02    /* CRC error */
+#define DP_RSR_FRAME   0x04    /* Framing error */
+#define DP_RSR_FO      0x08    /* FIFO overrun */
+#define DP_RSR_MISS    0x10    /* Missed packet */
+#define DP_RSR_PHY     0x20    /* 0=pad match, 1=mad match */
+#define DP_RSR_DIS     0x40    /* Receiver disabled */
+#define DP_RSR_DFR     0x80    /* Receiver processing deferred */
+
+/* Transmitter control register */
+
+#define DP_TCR_NOCRC   0x01    /* 1=inhibit CRC */
+#define DP_TCR_NORMAL  0x00    /* Normal transmitter operation */
+#define DP_TCR_LOCAL   0x02    /* Internal NIC loopback */
+#define DP_TCR_INLOOP  0x04    /* Full internal loopback */
+#define DP_TCR_OUTLOOP 0x08    /* External loopback */
+#define DP_TCR_ATD     0x10    /* Auto transmit disable */
+#define DP_TCR_OFFSET  0x20    /* Collision offset adjust */
+
+/* Transmit status register */
+
+#define DP_TSR_TxP     0x01    /* Packet transmitted */
+#define DP_TSR_COL     0x04    /* Collision (at least one) */
+#define DP_TSR_ABT     0x08    /* Aborted because of too many collisions */
+#define DP_TSR_CRS     0x10    /* Lost carrier */
+#define DP_TSR_FU      0x20    /* FIFO underrun */
+#define DP_TSR_CDH     0x40    /* Collision Detect Heartbeat */
+#define DP_TSR_OWC     0x80    /* Collision outside normal window */
+
+#define IEEE_8023_MAX_FRAME    1518    /* Largest possible ethernet frame */
+#define IEEE_8023_MIN_FRAME    64      /* Smallest possible ethernet frame */
+#endif /* __NE2000_BASE_H__ */
index 4e270c9..386fa50 100644 (file)
@@ -30,7 +30,7 @@
 #include <pci.h>
 
 #if 0
-#define        PCNET_DEBUG_LEVEL       0 /* 0=off, 1=init, 2=rx/tx */
+#define        PCNET_DEBUG_LEVEL       0       /* 0=off, 1=init, 2=rx/tx */
 #endif
 
 #if PCNET_DEBUG_LEVEL > 0
 
 /* The PCNET Rx and Tx ring descriptors. */
 struct pcnet_rx_head {
-    u32 base;
-    s16 buf_length;
-    s16 status;
-    u32 msg_length;
-    u32 reserved;
+       u32 base;
+       s16 buf_length;
+       s16 status;
+       u32 msg_length;
+       u32 reserved;
 };
 
 struct pcnet_tx_head {
-    u32 base;
-    s16 length;
-    s16 status;
-    u32 misc;
-    u32 reserved;
+       u32 base;
+       s16 length;
+       s16 status;
+       u32 misc;
+       u32 reserved;
 };
 
 /* The PCNET 32-Bit initialization block, described in databook. */
 struct pcnet_init_block {
-    u16 mode;
-    u16 tlen_rlen;
-    u8 phys_addr[6];
-    u16 reserved;
-    u32 filter[2];
-    /* Receive and transmit ring base, along with extra bits. */
-    u32 rx_ring;
-    u32 tx_ring;
-    u32 reserved2;
+       u16 mode;
+       u16 tlen_rlen;
+       u8 phys_addr[6];
+       u16 reserved;
+       u32 filter[2];
+       /* Receive and transmit ring base, along with extra bits. */
+       u32 rx_ring;
+       u32 tx_ring;
+       u32 reserved2;
 };
 
 typedef struct pcnet_priv {
-    struct pcnet_rx_head    rx_ring[RX_RING_SIZE];
-    struct pcnet_tx_head    tx_ring[TX_RING_SIZE];
-    struct pcnet_init_block init_block;
-    /* Receive Buffer space */
-    unsigned char rx_buf[RX_RING_SIZE][PKT_BUF_SZ + 4];
-    int cur_rx;
-    int cur_tx;
+       struct pcnet_rx_head rx_ring[RX_RING_SIZE];
+       struct pcnet_tx_head tx_ring[TX_RING_SIZE];
+       struct pcnet_init_block init_block;
+       /* Receive Buffer space */
+       unsigned char rx_buf[RX_RING_SIZE][PKT_BUF_SZ + 4];
+       int cur_rx;
+       int cur_tx;
 } pcnet_priv_t;
 
 static pcnet_priv_t *lp;
@@ -118,57 +118,121 @@ static pcnet_priv_t *lp;
 
 static u16 pcnet_read_csr (struct eth_device *dev, int index)
 {
-    outw (index, dev->iobase+PCNET_RAP);
-    return inw (dev->iobase+PCNET_RDP);
+       outw (index, dev->iobase + PCNET_RAP);
+       return inw (dev->iobase + PCNET_RDP);
 }
 
 static void pcnet_write_csr (struct eth_device *dev, int index, u16 val)
 {
-    outw (index, dev->iobase+PCNET_RAP);
-    outw (val, dev->iobase+PCNET_RDP);
+       outw (index, dev->iobase + PCNET_RAP);
+       outw (val, dev->iobase + PCNET_RDP);
 }
 
 static u16 pcnet_read_bcr (struct eth_device *dev, int index)
 {
-    outw (index, dev->iobase+PCNET_RAP);
-    return inw (dev->iobase+PCNET_BDP);
+       outw (index, dev->iobase + PCNET_RAP);
+       return inw (dev->iobase + PCNET_BDP);
 }
 
 static void pcnet_write_bcr (struct eth_device *dev, int index, u16 val)
 {
-    outw (index, dev->iobase+PCNET_RAP);
-    outw (val, dev->iobase+PCNET_BDP);
+       outw (index, dev->iobase + PCNET_RAP);
+       outw (val, dev->iobase + PCNET_BDP);
 }
 
 static void pcnet_reset (struct eth_device *dev)
 {
-    inw (dev->iobase+PCNET_RESET);
+       inw (dev->iobase + PCNET_RESET);
 }
 
 static int pcnet_check (struct eth_device *dev)
 {
-    outw (88, dev->iobase+PCNET_RAP);
-    return (inw (dev->iobase+PCNET_RAP) == 88);
+       outw (88, dev->iobase + PCNET_RAP);
+       return (inw (dev->iobase + PCNET_RAP) == 88);
 }
 
-static int  pcnet_init( struct eth_device* dev, bd_t *bis);
-static int  pcnet_send (struct eth_device* dev, volatile void *packet,
-                       int length);
-static int  pcnet_recv (struct eth_device* dev);
-static void pcnet_halt (struct eth_devicedev);
-static int  pcnet_probe(struct eth_device* dev, bd_t *bis, int dev_num);
+static int pcnet_init (struct eth_device *dev, bd_t * bis);
+static int pcnet_send (struct eth_device *dev, volatile void *packet,
+                      int length);
+static int pcnet_recv (struct eth_device *dev);
+static void pcnet_halt (struct eth_device *dev);
+static int pcnet_probe (struct eth_device *dev, bd_t * bis, int dev_num);
 
 #define PCI_TO_MEM(d,a) pci_phys_to_mem((pci_dev_t)d->priv, (u_long)(a))
 #define PCI_TO_MEM_LE(d,a) (u32)(cpu_to_le32(PCI_TO_MEM(d,a)))
 
 static struct pci_device_id supported[] = {
-       { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_LANCE },
-       { }
+       {PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_LANCE},
+       {}
 };
 
 
-int pcnet_initialize(bd_t *bis)
+int pcnet_initialize (bd_t * bis)
 {
+<<<<<<< HEAD:drivers/net/pcnet.c
+       pci_dev_t devbusfn;
+       struct eth_device *dev;
+       u16 command, status;
+       int dev_nr = 0;
+
+       PCNET_DEBUG1 ("\npcnet_initialize...\n");
+
+       for (dev_nr = 0;; dev_nr++) {
+
+               /*
+                * Find the PCnet PCI device(s).
+                */
+               if ((devbusfn = pci_find_devices (supported, dev_nr)) < 0) {
+                       break;
+               }
+
+               /*
+                * Allocate and pre-fill the device structure.
+                */
+               dev = (struct eth_device *) malloc (sizeof *dev);
+               dev->priv = (void *) devbusfn;
+               sprintf (dev->name, "pcnet#%d", dev_nr);
+
+               /*
+                * Setup the PCI device.
+                */
+               pci_read_config_dword (devbusfn, PCI_BASE_ADDRESS_0,
+                                      (unsigned int *) &dev->iobase);
+               dev->iobase=pci_io_to_phys (devbusfn, dev->iobase);
+               dev->iobase &= ~0xf;
+
+               PCNET_DEBUG1 ("%s: devbusfn=0x%x iobase=0x%x: ",
+                             dev->name, devbusfn, dev->iobase);
+
+               command = PCI_COMMAND_IO | PCI_COMMAND_MASTER;
+               pci_write_config_word (devbusfn, PCI_COMMAND, command);
+               pci_read_config_word (devbusfn, PCI_COMMAND, &status);
+               if ((status & command) != command) {
+                       printf ("%s: Couldn't enable IO access or Bus Mastering\n", dev->name);
+                       free (dev);
+                       continue;
+               }
+
+               pci_write_config_byte (devbusfn, PCI_LATENCY_TIMER, 0x40);
+
+               /*
+                * Probe the PCnet chip.
+                */
+               if (pcnet_probe (dev, bis, dev_nr) < 0) {
+                       free (dev);
+                       continue;
+               }
+
+               /*
+                * Setup device structure and register the driver.
+                */
+               dev->init = pcnet_init;
+               dev->halt = pcnet_halt;
+               dev->send = pcnet_send;
+               dev->recv = pcnet_recv;
+
+               eth_register (dev);
+=======
     pci_dev_t devbusfn;
     struct eth_device* dev;
     u16 command, status;
@@ -196,6 +260,7 @@ int pcnet_initialize(bd_t *bis)
         * Setup the PCI device.
         */
        pci_read_config_dword(devbusfn, PCI_BASE_ADDRESS_0, (unsigned int *)&dev->iobase);
+       dev->iobase=pci_io_to_phys(devbusfn,dev->iobase);
        dev->iobase &= ~0xf;
 
        PCNET_DEBUG1("%s: devbusfn=0x%x iobase=0x%x: ",
@@ -219,308 +284,311 @@ int pcnet_initialize(bd_t *bis)
        if (pcnet_probe(dev, bis, dev_nr) < 0) {
            free(dev);
            continue;
+>>>>>>> Fixed pcnet io_base:drivers/net/pcnet.c
        }
 
-       /*
-        * Setup device structure and register the driver.
-        */
-       dev->init   = pcnet_init;
-       dev->halt   = pcnet_halt;
-       dev->send   = pcnet_send;
-       dev->recv   = pcnet_recv;
-
-       eth_register(dev);
-    }
-
-    udelay(10 * 1000);
+       udelay (10 * 1000);
 
-    return dev_nr;
+       return dev_nr;
 }
 
-static int pcnet_probe(struct eth_device* dev, bd_t *bis, int dev_nr)
+static int pcnet_probe (struct eth_device *dev, bd_t * bis, int dev_nr)
 {
-    int chip_version;
-    char *chipname;
+       int chip_version;
+       char *chipname;
+
 #ifdef PCNET_HAS_PROM
-    int i;
+       int i;
 #endif
 
-    /* Reset the PCnet controller */
-    pcnet_reset(dev);
-
-    /* Check if register access is working */
-    if (pcnet_read_csr(dev, 0) != 4 || !pcnet_check(dev)) {
-       printf("%s: CSR register access check failed\n", dev->name);
-       return -1;
-    }
-
-    /* Identify the chip */
-    chip_version = pcnet_read_csr(dev, 88) | (pcnet_read_csr(dev,89) << 16);
-    if ((chip_version & 0xfff) != 0x003)
-       return -1;
-    chip_version = (chip_version >> 12) & 0xffff;
-    switch (chip_version) {
+       /* Reset the PCnet controller */
+       pcnet_reset (dev);
+
+       /* Check if register access is working */
+       if (pcnet_read_csr (dev, 0) != 4 || !pcnet_check (dev)) {
+               printf ("%s: CSR register access check failed\n", dev->name);
+               return -1;
+       }
+
+       /* Identify the chip */
+       chip_version =
+               pcnet_read_csr (dev, 88) | (pcnet_read_csr (dev, 89) << 16);
+       if ((chip_version & 0xfff) != 0x003)
+               return -1;
+       chip_version = (chip_version >> 12) & 0xffff;
+       switch (chip_version) {
+       case 0x2621:
+               chipname = "PCnet/PCI II 79C970A";      /* PCI */
+               break;
 #ifdef CONFIG_PCNET_79C973
-    case 0x2625:
-       chipname = "PCnet/FAST III 79C973"; /* PCI */
-       break;
+       case 0x2625:
+               chipname = "PCnet/FAST III 79C973";     /* PCI */
+               break;
 #endif
 #ifdef CONFIG_PCNET_79C975
-    case 0x2627:
-       chipname = "PCnet/FAST III 79C975"; /* PCI */
-       break;
+       case 0x2627:
+               chipname = "PCnet/FAST III 79C975";     /* PCI */
+               break;
 #endif
-    default:
-       printf("%s: PCnet version %#x not supported\n",
-              dev->name, chip_version);
-       return -1;
-    }
+       default:
+               printf ("%s: PCnet version %#x not supported\n",
+                       dev->name, chip_version);
+               return -1;
+       }
 
-    PCNET_DEBUG1("AMD %s\n", chipname);
+       PCNET_DEBUG1 ("AMD %s\n", chipname);
 
 #ifdef PCNET_HAS_PROM
-    /*
-     * In most chips, after a chip reset, the ethernet address is read from
-     * the station address PROM at the base address and programmed into the
-     * "Physical Address Registers" CSR12-14.
-     */
-    for (i = 0; i < 3; i++) {
-       unsigned int val;
-       val = pcnet_read_csr(dev, i+12) & 0x0ffff;
-       /* There may be endianness issues here. */
-       dev->enetaddr[2*i  ] =  val       & 0x0ff;
-       dev->enetaddr[2*i+1] = (val >> 8) & 0x0ff;
-    }
+       /*
+        * In most chips, after a chip reset, the ethernet address is read from
+        * the station address PROM at the base address and programmed into the
+        * "Physical Address Registers" CSR12-14.
+        */
+       for (i = 0; i < 3; i++) {
+               unsigned int val;
+
+               val = pcnet_read_csr (dev, i + 12) & 0x0ffff;
+               /* There may be endianness issues here. */
+               dev->enetaddr[2 * i] = val & 0x0ff;
+               dev->enetaddr[2 * i + 1] = (val >> 8) & 0x0ff;
+       }
 #endif /* PCNET_HAS_PROM */
 
-    return 0;
+       return 0;
 }
 
-static int pcnet_init(struct eth_device* dev, bd_t *bis)
+static int pcnet_init (struct eth_device *dev, bd_t * bis)
 {
-    int i, val;
-    u32 addr;
+       int i, val;
+       u32 addr;
 
-    PCNET_DEBUG1("%s: pcnet_init...\n", dev->name);
+       PCNET_DEBUG1 ("%s: pcnet_init...\n", dev->name);
 
-    /* Switch pcnet to 32bit mode */
-    pcnet_write_bcr (dev, 20, 2);
+       /* Switch pcnet to 32bit mode */
+       pcnet_write_bcr (dev, 20, 2);
 
 #ifdef CONFIG_PN62
-    /* Setup LED registers */
-    val = pcnet_read_bcr (dev, 2) | 0x1000;
-    pcnet_write_bcr (dev, 2, val);    /* enable LEDPE */
-    pcnet_write_bcr (dev, 4, 0x5080); /* 100MBit */
-    pcnet_write_bcr (dev, 5, 0x40c0); /* LNKSE */
-    pcnet_write_bcr (dev, 6, 0x4090); /* TX Activity */
-    pcnet_write_bcr (dev, 7, 0x4084); /* RX Activity */
+       /* Setup LED registers */
+       val = pcnet_read_bcr (dev, 2) | 0x1000;
+       pcnet_write_bcr (dev, 2, val);  /* enable LEDPE */
+       pcnet_write_bcr (dev, 4, 0x5080);       /* 100MBit */
+       pcnet_write_bcr (dev, 5, 0x40c0);       /* LNKSE */
+       pcnet_write_bcr (dev, 6, 0x4090);       /* TX Activity */
+       pcnet_write_bcr (dev, 7, 0x4084);       /* RX Activity */
 #endif
 
-    /* Set/reset autoselect bit */
-    val = pcnet_read_bcr (dev, 2) & ~2;
-    val |= 2;
-    pcnet_write_bcr (dev, 2, val);
-
-    /* Enable auto negotiate, setup, disable fd */
-    val = pcnet_read_bcr(dev, 32) & ~0x98;
-    val |= 0x20;
-    pcnet_write_bcr(dev, 32, val);
-
-    /*
-     * We only maintain one structure because the drivers will never
-     * be used concurrently. In 32bit mode the RX and TX ring entries
-     * must be aligned on 16-byte boundaries.
-     */
-    if (lp == NULL) {
-       addr = (u32)malloc(sizeof(pcnet_priv_t) + 0x10);
-       addr = (addr + 0xf) & ~0xf;
-       lp = (pcnet_priv_t *)addr;
-    }
-
-    lp->init_block.mode = cpu_to_le16(0x0000);
-    lp->init_block.filter[0] = 0x00000000;
-    lp->init_block.filter[1] = 0x00000000;
-
-    /*
-     * Initialize the Rx ring.
-     */
-    lp->cur_rx = 0;
-    for (i = 0; i < RX_RING_SIZE; i++) {
-       lp->rx_ring[i].base = PCI_TO_MEM_LE(dev, lp->rx_buf[i]);
-       lp->rx_ring[i].buf_length = cpu_to_le16(-PKT_BUF_SZ);
-       lp->rx_ring[i].status = cpu_to_le16(0x8000);
-       PCNET_DEBUG1("Rx%d: base=0x%x buf_length=0x%hx status=0x%hx\n",
-              i, lp->rx_ring[i].base, lp->rx_ring[i].buf_length,
-              lp->rx_ring[i].status);
-    }
-
-    /*
-     * Initialize the Tx ring. The Tx buffer address is filled in as
-     * needed, but we do need to clear the upper ownership bit.
-     */
-    lp->cur_tx = 0;
-    for (i = 0; i < TX_RING_SIZE; i++) {
-       lp->tx_ring[i].base = 0;
-       lp->tx_ring[i].status = 0;
-    }
-
-    /*
-     * Setup Init Block.
-     */
-    PCNET_DEBUG1("Init block at 0x%p: MAC", &lp->init_block);
-
-    for (i = 0; i < 6; i++) {
-       lp->init_block.phys_addr[i] = dev->enetaddr[i];
-       PCNET_DEBUG1(" %02x", lp->init_block.phys_addr[i]);
-    }
-
-    lp->init_block.tlen_rlen = cpu_to_le16(TX_RING_LEN_BITS |
-                                          RX_RING_LEN_BITS);
-    lp->init_block.rx_ring = PCI_TO_MEM_LE(dev, lp->rx_ring);
-    lp->init_block.tx_ring = PCI_TO_MEM_LE(dev, lp->tx_ring);
-
-    PCNET_DEBUG1("\ntlen_rlen=0x%x rx_ring=0x%x tx_ring=0x%x\n",
-          lp->init_block.tlen_rlen,
-          lp->init_block.rx_ring, lp->init_block.tx_ring);
-
-    /*
-     * Tell the controller where the Init Block is located.
-     */
-    addr = PCI_TO_MEM(dev, &lp->init_block);
-    pcnet_write_csr(dev, 1, addr & 0xffff);
-    pcnet_write_csr(dev, 2, (addr >> 16) & 0xffff);
-
-    pcnet_write_csr (dev, 4, 0x0915);
-    pcnet_write_csr (dev, 0, 0x0001); /* start */
-
-    /* Wait for Init Done bit */
-    for (i = 10000; i > 0; i--) {
-       if (pcnet_read_csr (dev, 0) & 0x0100)
-           break;
-       udelay(10);
-    }
-    if (i <= 0) {
-       printf("%s: TIMEOUT: controller init failed\n", dev->name);
-       pcnet_reset (dev);
-       return -1;
-    }
+       /* Set/reset autoselect bit */
+       val = pcnet_read_bcr (dev, 2) & ~2;
+       val |= 2;
+       pcnet_write_bcr (dev, 2, val);
 
-    /*
-     * Finally start network controller operation.
-     */
-    pcnet_write_csr (dev, 0, 0x0002);
+       /* Enable auto negotiate, setup, disable fd */
+       val = pcnet_read_bcr (dev, 32) & ~0x98;
+       val |= 0x20;
+       pcnet_write_bcr (dev, 32, val);
 
-    return 0;
-}
+       /*
+        * We only maintain one structure because the drivers will never
+        * be used concurrently. In 32bit mode the RX and TX ring entries
+        * must be aligned on 16-byte boundaries.
+        */
+       if (lp == NULL) {
+               addr = (u32) malloc (sizeof (pcnet_priv_t) + 0x10);
+               addr = (addr + 0xf) & ~0xf;
+               lp = (pcnet_priv_t *) addr;
+       }
 
-static int pcnet_send(struct eth_device* dev, volatile void *packet, int pkt_len)
-{
-    int i, status;
-    struct pcnet_tx_head *entry = &lp->tx_ring[lp->cur_tx];
+       lp->init_block.mode = cpu_to_le16 (0x0000);
+       lp->init_block.filter[0] = 0x00000000;
+       lp->init_block.filter[1] = 0x00000000;
 
-    PCNET_DEBUG2("Tx%d: %d bytes from 0x%p ", lp->cur_tx, pkt_len, packet);
+       /*
+        * Initialize the Rx ring.
+        */
+       lp->cur_rx = 0;
+       for (i = 0; i < RX_RING_SIZE; i++) {
+               lp->rx_ring[i].base = PCI_TO_MEM_LE (dev, lp->rx_buf[i]);
+               lp->rx_ring[i].buf_length = cpu_to_le16 (-PKT_BUF_SZ);
+               lp->rx_ring[i].status = cpu_to_le16 (0x8000);
+               PCNET_DEBUG1
+                       ("Rx%d: base=0x%x buf_length=0x%hx status=0x%hx\n", i,
+                        lp->rx_ring[i].base, lp->rx_ring[i].buf_length,
+                        lp->rx_ring[i].status);
+       }
 
-    /* Wait for completion by testing the OWN bit */
-    for (i = 1000; i > 0; i--) {
-       status = le16_to_cpu(entry->status);
-       if ((status & 0x8000) == 0)
-           break;
-       udelay(100);
-       PCNET_DEBUG2(".");
-    }
-    if (i <= 0) {
-       printf("%s: TIMEOUT: Tx%d failed (status = 0x%x)\n",
-              dev->name, lp->cur_tx, status);
-       pkt_len = 0;
-       goto failure;
-    }
-
-    /*
-     * Setup Tx ring. Caution: the write order is important here,
-     * set the status with the "ownership" bits last.
-     */
-    status = 0x8300;
-    entry->length = le16_to_cpu(-pkt_len);
-    entry->misc   = 0x00000000;
-    entry->base   = PCI_TO_MEM_LE(dev, packet);
-    entry->status = le16_to_cpu(status);
-
-    /* Trigger an immediate send poll. */
-    pcnet_write_csr (dev, 0, 0x0008);
-
- failure:
-    if (++lp->cur_tx >= TX_RING_SIZE)
+       /*
+        * Initialize the Tx ring. The Tx buffer address is filled in as
+        * needed, but we do need to clear the upper ownership bit.
+        */
        lp->cur_tx = 0;
+       for (i = 0; i < TX_RING_SIZE; i++) {
+               lp->tx_ring[i].base = 0;
+               lp->tx_ring[i].status = 0;
+       }
 
-    PCNET_DEBUG2("done\n");
-    return pkt_len;
-}
+       /*
+        * Setup Init Block.
+        */
+       PCNET_DEBUG1 ("Init block at 0x%p: MAC", &lp->init_block);
 
-static int pcnet_recv(struct eth_device* dev)
-{
-    struct pcnet_rx_head *entry;
-    int pkt_len = 0;
-    u16 status;
+       for (i = 0; i < 6; i++) {
+               lp->init_block.phys_addr[i] = dev->enetaddr[i];
+               PCNET_DEBUG1 (" %02x", lp->init_block.phys_addr[i]);
+       }
+
+       lp->init_block.tlen_rlen = cpu_to_le16 (TX_RING_LEN_BITS |
+                                               RX_RING_LEN_BITS);
+       lp->init_block.rx_ring = PCI_TO_MEM_LE (dev, lp->rx_ring);
+       lp->init_block.tx_ring = PCI_TO_MEM_LE (dev, lp->tx_ring);
+
+       PCNET_DEBUG1 ("\ntlen_rlen=0x%x rx_ring=0x%x tx_ring=0x%x\n",
+                     lp->init_block.tlen_rlen,
+                     lp->init_block.rx_ring, lp->init_block.tx_ring);
 
-    while (1) {
-       entry = &lp->rx_ring[lp->cur_rx];
        /*
-        * If we own the next entry, it's a new packet. Send it up.
+        * Tell the controller where the Init Block is located.
         */
-       if (((status = le16_to_cpu(entry->status)) & 0x8000) != 0) {
-           break;
+       addr = PCI_TO_MEM (dev, &lp->init_block);
+       pcnet_write_csr (dev, 1, addr & 0xffff);
+       pcnet_write_csr (dev, 2, (addr >> 16) & 0xffff);
+
+       pcnet_write_csr (dev, 4, 0x0915);
+       pcnet_write_csr (dev, 0, 0x0001);       /* start */
+
+       /* Wait for Init Done bit */
+       for (i = 10000; i > 0; i--) {
+               if (pcnet_read_csr (dev, 0) & 0x0100)
+                       break;
+               udelay (10);
        }
-       status >>= 8;
-
-       if (status != 0x03) {   /* There was an error. */
-
-           printf("%s: Rx%d", dev->name, lp->cur_rx);
-           PCNET_DEBUG1(" (status=0x%x)", status);
-           if (status & 0x20) printf(" Frame");
-           if (status & 0x10) printf(" Overflow");
-           if (status & 0x08) printf(" CRC");
-           if (status & 0x04) printf(" Fifo");
-           printf(" Error\n");
-           entry->status &= le16_to_cpu(0x03ff);
-
-       } else {
-
-           pkt_len = (le32_to_cpu(entry->msg_length) & 0xfff) - 4;
-           if (pkt_len < 60) {
-               printf("%s: Rx%d: invalid packet length %d\n",
-                      dev->name, lp->cur_rx, pkt_len);
-           } else {
-               NetReceive(lp->rx_buf[lp->cur_rx], pkt_len);
-               PCNET_DEBUG2("Rx%d: %d bytes from 0x%p\n",
-                      lp->cur_rx, pkt_len, lp->rx_buf[lp->cur_rx]);
-           }
+       if (i <= 0) {
+               printf ("%s: TIMEOUT: controller init failed\n", dev->name);
+               pcnet_reset (dev);
+               return -1;
        }
-       entry->status |= cpu_to_le16(0x8000);
 
-       if (++lp->cur_rx >= RX_RING_SIZE)
-           lp->cur_rx = 0;
-    }
-    return pkt_len;
+       /*
+        * Finally start network controller operation.
+        */
+       pcnet_write_csr (dev, 0, 0x0002);
+
+       return 0;
 }
 
-static void pcnet_halt(struct eth_device* dev)
+static int pcnet_send (struct eth_device *dev, volatile void *packet,
+                      int pkt_len)
 {
-    int i;
+       int i, status;
+       struct pcnet_tx_head *entry = &lp->tx_ring[lp->cur_tx];
+
+       PCNET_DEBUG2 ("Tx%d: %d bytes from 0x%p ", lp->cur_tx, pkt_len,
+                     packet);
+
+       /* Wait for completion by testing the OWN bit */
+       for (i = 1000; i > 0; i--) {
+               status = le16_to_cpu (entry->status);
+               if ((status & 0x8000) == 0)
+                       break;
+               udelay (100);
+               PCNET_DEBUG2 (".");
+       }
+       if (i <= 0) {
+               printf ("%s: TIMEOUT: Tx%d failed (status = 0x%x)\n",
+                       dev->name, lp->cur_tx, status);
+               pkt_len = 0;
+               goto failure;
+       }
+
+       /*
+        * Setup Tx ring. Caution: the write order is important here,
+        * set the status with the "ownership" bits last.
+        */
+       status = 0x8300;
+       entry->length = le16_to_cpu (-pkt_len);
+       entry->misc = 0x00000000;
+       entry->base = PCI_TO_MEM_LE (dev, packet);
+       entry->status = le16_to_cpu (status);
 
-    PCNET_DEBUG1("%s: pcnet_halt...\n", dev->name);
+       /* Trigger an immediate send poll. */
+       pcnet_write_csr (dev, 0, 0x0008);
 
-    /* Reset the PCnet controller */
-    pcnet_reset (dev);
+      failure:
+       if (++lp->cur_tx >= TX_RING_SIZE)
+               lp->cur_tx = 0;
 
-    /* Wait for Stop bit */
-    for (i = 1000; i > 0; i--) {
-       if (pcnet_read_csr (dev, 0) & 0x4)
-           break;
-       udelay(10);
-    }
-    if (i <= 0) {
-       printf("%s: TIMEOUT: controller reset failed\n", dev->name);
-    }
+       PCNET_DEBUG2 ("done\n");
+       return pkt_len;
 }
 
+static int pcnet_recv (struct eth_device *dev)
+{
+       struct pcnet_rx_head *entry;
+       int pkt_len = 0;
+       u16 status;
+
+       while (1) {
+               entry = &lp->rx_ring[lp->cur_rx];
+               /*
+                * If we own the next entry, it's a new packet. Send it up.
+                */
+               if (((status = le16_to_cpu (entry->status)) & 0x8000) != 0) {
+                       break;
+               }
+               status >>= 8;
+
+               if (status != 0x03) {   /* There was an error. */
+
+                       printf ("%s: Rx%d", dev->name, lp->cur_rx);
+                       PCNET_DEBUG1 (" (status=0x%x)", status);
+                       if (status & 0x20)
+                               printf (" Frame");
+                       if (status & 0x10)
+                               printf (" Overflow");
+                       if (status & 0x08)
+                               printf (" CRC");
+                       if (status & 0x04)
+                               printf (" Fifo");
+                       printf (" Error\n");
+                       entry->status &= le16_to_cpu (0x03ff);
+
+               } else {
+
+                       pkt_len =
+                               (le32_to_cpu (entry->msg_length) & 0xfff) - 4;
+                       if (pkt_len < 60) {
+                               printf ("%s: Rx%d: invalid packet length %d\n", dev->name, lp->cur_rx, pkt_len);
+                       } else {
+                               NetReceive (lp->rx_buf[lp->cur_rx], pkt_len);
+                               PCNET_DEBUG2 ("Rx%d: %d bytes from 0x%p\n",
+                                             lp->cur_rx, pkt_len,
+                                             lp->rx_buf[lp->cur_rx]);
+                       }
+               }
+               entry->status |= cpu_to_le16 (0x8000);
+
+               if (++lp->cur_rx >= RX_RING_SIZE)
+                       lp->cur_rx = 0;
+       }
+       return pkt_len;
+}
+
+static void pcnet_halt (struct eth_device *dev)
+{
+       int i;
+
+       PCNET_DEBUG1 ("%s: pcnet_halt...\n", dev->name);
+
+       /* Reset the PCnet controller */
+       pcnet_reset (dev);
+
+       /* Wait for Stop bit */
+       for (i = 1000; i > 0; i--) {
+               if (pcnet_read_csr (dev, 0) & 0x4)
+                       break;
+               udelay (10);
+       }
+       if (i <= 0) {
+               printf ("%s: TIMEOUT: controller reset failed\n", dev->name);
+       }
+}
 #endif
index cbddba7..048307f 100644 (file)
@@ -30,8 +30,6 @@
  *
  */
 
-#define __packed    __attribute__ ((packed))
-
 #define ETH_MAC_ADDR_SIZE           (6)    /*  dst,src addr is 6bytes each */
 #define ETH_MaxTxFrames             (16)   /*  Max number of Tx Frames */
 
@@ -283,12 +281,14 @@ typedef struct __RX_FrameDescriptor {
 } RX_FrameDescriptor;
 
 /*  MAC Frame Structure */
-typedef struct __MACFrame {
-       u8     m_dstAddr[6] __packed;
-       u8     m_srcAddr[6] __packed;
-       u16  m_lengthOrType __packed;
-       u8  m_payload[1506] __packed;
-} MACFrame;
+struct __MACFrame {
+       u8     m_dstAddr[6];
+       u8     m_srcAddr[6];
+       u16  m_lengthOrType;
+       u8  m_payload[1506];
+} __attribute__ ((packed));
+
+typedef struct __MACFrame MACFrame;
 
 /* Ethernet Control block */
 typedef struct __ETH {
index d03cbc3..96ff04d 100644 (file)
@@ -79,7 +79,7 @@ typedef unsigned long int             dword;
 #ifdef CONFIG_XSENGINE
 #define        SMC_inl(r)      (*((volatile dword *)(SMC_BASE_ADDRESS+(r<<1))))
 #define        SMC_inw(r)      (*((volatile word *)(SMC_BASE_ADDRESS+(r<<1))))
-#define SMC_inb(p)     ({ \
+#define SMC_inb(p)  ({ \
        unsigned int __p = (unsigned int)(SMC_BASE_ADDRESS + (p<<1)); \
        unsigned int __v = *(volatile unsigned short *)((__p) & ~2); \
        if (__p & 2) __v >>= 8; \
@@ -176,7 +176,76 @@ typedef unsigned long int          dword;
                                        };  \
                                })
 
-#else /* if not CONFIG_PXA250 */
+#elif defined(CONFIG_LEON)     /* if not CONFIG_PXA250 */
+
+#define SMC_LEON_SWAP16(_x_) ({ word _x = (_x_); ((_x << 8) | (_x >> 8)); })
+
+#define SMC_LEON_SWAP32(_x_)                   \
+    ({ dword _x = (_x_);                       \
+       ((_x << 24) |                           \
+       ((0x0000FF00UL & _x) <<  8) |           \
+       ((0x00FF0000UL & _x) >>  8) |           \
+       (_x  >> 24)); })
+
+#define        SMC_inl(r)      (SMC_LEON_SWAP32((*(volatile dword *)(SMC_BASE_ADDRESS+((r)<<0)))))
+#define        SMC_inl_nosw(r)         ((*(volatile dword *)(SMC_BASE_ADDRESS+((r)<<0))))
+#define        SMC_inw(r)      (SMC_LEON_SWAP16((*(volatile word *)(SMC_BASE_ADDRESS+((r)<<0)))))
+#define        SMC_inw_nosw(r)         ((*(volatile word *)(SMC_BASE_ADDRESS+((r)<<0))))
+#define SMC_inb(p)     ({ \
+       word ___v = SMC_inw((p) & ~1); \
+       if ((p) & 1) ___v >>= 8; \
+       else ___v &= 0xff; \
+       ___v; })
+
+#define        SMC_outl(d,r)   (*(volatile dword *)(SMC_BASE_ADDRESS+((r)<<0))=SMC_LEON_SWAP32(d))
+#define        SMC_outl_nosw(d,r)      (*(volatile dword *)(SMC_BASE_ADDRESS+((r)<<0))=(d))
+#define        SMC_outw(d,r)   (*(volatile word *)(SMC_BASE_ADDRESS+((r)<<0))=SMC_LEON_SWAP16(d))
+#define        SMC_outw_nosw(d,r)      (*(volatile word *)(SMC_BASE_ADDRESS+((r)<<0))=(d))
+#define        SMC_outb(d,r)   do{     word __d = (byte)(d);  \
+                               word __w = SMC_inw((r)&~1);  \
+                               __w &= ((r)&1) ? 0x00FF : 0xFF00;  \
+                               __w |= ((r)&1) ? __d<<8 : __d;  \
+                               SMC_outw(__w,(r)&~1);  \
+                       }while(0)
+#define SMC_outsl(r,b,l)       do{     int __i; \
+                                       dword *__b2; \
+                                       __b2 = (dword *) b; \
+                                       for (__i = 0; __i < l; __i++) { \
+                                           SMC_outl_nosw( *(__b2 + __i), r); \
+                                       } \
+                               }while(0)
+#define SMC_outsw(r,b,l)       do{     int __i; \
+                                       word *__b2; \
+                                       __b2 = (word *) b; \
+                                       for (__i = 0; __i < l; __i++) { \
+                                           SMC_outw_nosw( *(__b2 + __i), r); \
+                                       } \
+                               }while(0)
+#define SMC_insl(r,b,l)        do{     int __i ;  \
+                                       dword *__b2;  \
+                                       __b2 = (dword *) b;  \
+                                       for (__i = 0; __i < l; __i++) {  \
+                                         *(__b2 + __i) = SMC_inl_nosw(r);  \
+                                       };  \
+                               }while(0)
+
+#define SMC_insw(r,b,l)        do{     int __i ;  \
+                                       word *__b2;  \
+                                       __b2 = (word *) b;  \
+                                       for (__i = 0; __i < l; __i++) {  \
+                                         *(__b2 + __i) = SMC_inw_nosw(r);  \
+                                       };  \
+                               }while(0)
+
+#define SMC_insb(r,b,l)        do{     int __i ;  \
+                                       byte *__b2;  \
+                                       __b2 = (byte *) b;  \
+                                       for (__i = 0; __i < l; __i++) {  \
+                                         *(__b2 + __i) = SMC_inb(r);  \
+                                       };  \
+                               }while(0)
+
+#else                          /* if not CONFIG_PXA250 and not CONFIG_LEON */
 
 #ifndef CONFIG_SMC_USE_IOFUNCS /* these macros don't work on some boards */
 /*
@@ -186,7 +255,7 @@ typedef unsigned long int           dword;
 #ifdef CONFIG_ADNPESC1
 #define        SMC_inw(r)      (*((volatile word *)(SMC_BASE_ADDRESS+((r)<<1))))
 #elif CONFIG_BLACKFIN
-#define        SMC_inw(r)      ({ word __v = (*((volatile word *)(SMC_BASE_ADDRESS+(r)))); asm("ssync;"); __v;})
+#define        SMC_inw(r)      ({ word __v = (*((volatile word *)(SMC_BASE_ADDRESS+(r)))); SSYNC(); __v;})
 #else
 #define        SMC_inw(r)      (*((volatile word *)(SMC_BASE_ADDRESS+(r))))
 #endif
@@ -195,7 +264,7 @@ typedef unsigned long int           dword;
 #ifdef CONFIG_ADNPESC1
 #define        SMC_outw(d,r)   (*((volatile word *)(SMC_BASE_ADDRESS+((r)<<1))) = d)
 #elif CONFIG_BLACKFIN
-#define        SMC_outw(d,r)   {(*((volatile word *)(SMC_BASE_ADDRESS+(r))) = d);asm("ssync;");}
+#define        SMC_outw(d,r)   {(*((volatile word *)(SMC_BASE_ADDRESS+(r))) = d); SSYNC();}
 #else
 #define        SMC_outw(d,r)   (*((volatile word *)(SMC_BASE_ADDRESS+(r))) = d)
 #endif
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
new file mode 100644 (file)
index 0000000..d22c889
--- /dev/null
@@ -0,0 +1,686 @@
+/*
+ * SMSC LAN9[12]1[567] Network driver
+ *
+ * (c) 2007 Pengutronix, Sascha Hauer <s.hauer <at> pengutronix.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>
+
+#ifdef CONFIG_DRIVER_SMC911X
+
+#include <command.h>
+#include <net.h>
+#include <miiphy.h>
+
+#ifdef CONFIG_DRIVER_SMC911X_32_BIT
+static inline u32 reg_read(u32 addr)
+{
+       return *(volatile u32*)addr;
+}
+static inline void reg_write(u32 addr, u32 val)
+{
+       *(volatile u32*)addr = val;
+}
+#else
+#error "SMC911X: Only 32-bit bus is supported"
+#endif
+
+#define mdelay(n)       udelay((n)*1000)
+
+/* Below are the register offsets and bit definitions
+ * of the Lan911x memory space
+ */
+#define RX_DATA_FIFO            (CONFIG_DRIVER_SMC911X_BASE + 0x00)
+
+#define TX_DATA_FIFO            (CONFIG_DRIVER_SMC911X_BASE + 0x20)
+#define        TX_CMD_A_INT_ON_COMP                    0x80000000
+#define        TX_CMD_A_INT_BUF_END_ALGN               0x03000000
+#define        TX_CMD_A_INT_4_BYTE_ALGN                0x00000000
+#define        TX_CMD_A_INT_16_BYTE_ALGN               0x01000000
+#define        TX_CMD_A_INT_32_BYTE_ALGN               0x02000000
+#define        TX_CMD_A_INT_DATA_OFFSET                0x001F0000
+#define        TX_CMD_A_INT_FIRST_SEG                  0x00002000
+#define        TX_CMD_A_INT_LAST_SEG                   0x00001000
+#define        TX_CMD_A_BUF_SIZE                       0x000007FF
+#define        TX_CMD_B_PKT_TAG                        0xFFFF0000
+#define        TX_CMD_B_ADD_CRC_DISABLE                0x00002000
+#define        TX_CMD_B_DISABLE_PADDING                0x00001000
+#define        TX_CMD_B_PKT_BYTE_LENGTH                0x000007FF
+
+#define RX_STATUS_FIFO         (CONFIG_DRIVER_SMC911X_BASE + 0x40)
+#define        RX_STS_PKT_LEN                          0x3FFF0000
+#define        RX_STS_ES                               0x00008000
+#define        RX_STS_BCST                             0x00002000
+#define        RX_STS_LEN_ERR                          0x00001000
+#define        RX_STS_RUNT_ERR                         0x00000800
+#define        RX_STS_MCAST                            0x00000400
+#define        RX_STS_TOO_LONG                         0x00000080
+#define        RX_STS_COLL                             0x00000040
+#define        RX_STS_ETH_TYPE                         0x00000020
+#define        RX_STS_WDOG_TMT                         0x00000010
+#define        RX_STS_MII_ERR                          0x00000008
+#define        RX_STS_DRIBBLING                        0x00000004
+#define        RX_STS_CRC_ERR                          0x00000002
+#define RX_STATUS_FIFO_PEEK    (CONFIG_DRIVER_SMC911X_BASE + 0x44)
+#define TX_STATUS_FIFO         (CONFIG_DRIVER_SMC911X_BASE + 0x48)
+#define        TX_STS_TAG                              0xFFFF0000
+#define        TX_STS_ES                               0x00008000
+#define        TX_STS_LOC                              0x00000800
+#define        TX_STS_NO_CARR                          0x00000400
+#define        TX_STS_LATE_COLL                        0x00000200
+#define        TX_STS_MANY_COLL                        0x00000100
+#define        TX_STS_COLL_CNT                         0x00000078
+#define        TX_STS_MANY_DEFER                       0x00000004
+#define        TX_STS_UNDERRUN                         0x00000002
+#define        TX_STS_DEFERRED                         0x00000001
+#define TX_STATUS_FIFO_PEEK    (CONFIG_DRIVER_SMC911X_BASE + 0x4C)
+#define ID_REV                 (CONFIG_DRIVER_SMC911X_BASE + 0x50)
+#define        ID_REV_CHIP_ID                          0xFFFF0000  /* RO */
+#define        ID_REV_REV_ID                           0x0000FFFF  /* RO */
+
+#define INT_CFG                        (CONFIG_DRIVER_SMC911X_BASE + 0x54)
+#define        INT_CFG_INT_DEAS                        0xFF000000  /* R/W */
+#define        INT_CFG_INT_DEAS_CLR                    0x00004000
+#define        INT_CFG_INT_DEAS_STS                    0x00002000
+#define        INT_CFG_IRQ_INT                         0x00001000  /* RO */
+#define        INT_CFG_IRQ_EN                          0x00000100  /* R/W */
+#define        INT_CFG_IRQ_POL                         0x00000010  /* R/W Not Affected by SW Reset */
+#define        INT_CFG_IRQ_TYPE                        0x00000001  /* R/W Not Affected by SW Reset */
+
+#define INT_STS                        (CONFIG_DRIVER_SMC911X_BASE + 0x58)
+#define        INT_STS_SW_INT                          0x80000000  /* R/WC */
+#define        INT_STS_TXSTOP_INT                      0x02000000  /* R/WC */
+#define        INT_STS_RXSTOP_INT                      0x01000000  /* R/WC */
+#define        INT_STS_RXDFH_INT                       0x00800000  /* R/WC */
+#define        INT_STS_RXDF_INT                        0x00400000  /* R/WC */
+#define        INT_STS_TX_IOC                          0x00200000  /* R/WC */
+#define        INT_STS_RXD_INT                         0x00100000  /* R/WC */
+#define        INT_STS_GPT_INT                         0x00080000  /* R/WC */
+#define        INT_STS_PHY_INT                         0x00040000  /* RO */
+#define        INT_STS_PME_INT                         0x00020000  /* R/WC */
+#define        INT_STS_TXSO                            0x00010000  /* R/WC */
+#define        INT_STS_RWT                             0x00008000  /* R/WC */
+#define        INT_STS_RXE                             0x00004000  /* R/WC */
+#define        INT_STS_TXE                             0x00002000  /* R/WC */
+/*#define      INT_STS_ERX             0x00001000*/  /* R/WC */
+#define        INT_STS_TDFU                            0x00000800  /* R/WC */
+#define        INT_STS_TDFO                            0x00000400  /* R/WC */
+#define        INT_STS_TDFA                            0x00000200  /* R/WC */
+#define        INT_STS_TSFF                            0x00000100  /* R/WC */
+#define        INT_STS_TSFL                            0x00000080  /* R/WC */
+/*#define      INT_STS_RXDF            0x00000040*/  /* R/WC */
+#define        INT_STS_RDFO                            0x00000040  /* R/WC */
+#define        INT_STS_RDFL                            0x00000020  /* R/WC */
+#define        INT_STS_RSFF                            0x00000010  /* R/WC */
+#define        INT_STS_RSFL                            0x00000008  /* R/WC */
+#define        INT_STS_GPIO2_INT                       0x00000004  /* R/WC */
+#define        INT_STS_GPIO1_INT                       0x00000002  /* R/WC */
+#define        INT_STS_GPIO0_INT                       0x00000001  /* R/WC */
+#define INT_EN                 (CONFIG_DRIVER_SMC911X_BASE + 0x5C)
+#define        INT_EN_SW_INT_EN                        0x80000000  /* R/W */
+#define        INT_EN_TXSTOP_INT_EN                    0x02000000  /* R/W */
+#define        INT_EN_RXSTOP_INT_EN                    0x01000000  /* R/W */
+#define        INT_EN_RXDFH_INT_EN                     0x00800000  /* R/W */
+/*#define      INT_EN_RXDF_INT_EN              0x00400000*/  /* R/W */
+#define        INT_EN_TIOC_INT_EN                      0x00200000  /* R/W */
+#define        INT_EN_RXD_INT_EN                       0x00100000  /* R/W */
+#define        INT_EN_GPT_INT_EN                       0x00080000  /* R/W */
+#define        INT_EN_PHY_INT_EN                       0x00040000  /* R/W */
+#define        INT_EN_PME_INT_EN                       0x00020000  /* R/W */
+#define        INT_EN_TXSO_EN                          0x00010000  /* R/W */
+#define        INT_EN_RWT_EN                           0x00008000  /* R/W */
+#define        INT_EN_RXE_EN                           0x00004000  /* R/W */
+#define        INT_EN_TXE_EN                           0x00002000  /* R/W */
+/*#define      INT_EN_ERX_EN                   0x00001000*/  /* R/W */
+#define        INT_EN_TDFU_EN                          0x00000800  /* R/W */
+#define        INT_EN_TDFO_EN                          0x00000400  /* R/W */
+#define        INT_EN_TDFA_EN                          0x00000200  /* R/W */
+#define        INT_EN_TSFF_EN                          0x00000100  /* R/W */
+#define        INT_EN_TSFL_EN                          0x00000080  /* R/W */
+/*#define      INT_EN_RXDF_EN                  0x00000040*/  /* R/W */
+#define        INT_EN_RDFO_EN                          0x00000040  /* R/W */
+#define        INT_EN_RDFL_EN                          0x00000020  /* R/W */
+#define        INT_EN_RSFF_EN                          0x00000010  /* R/W */
+#define        INT_EN_RSFL_EN                          0x00000008  /* R/W */
+#define        INT_EN_GPIO2_INT                        0x00000004  /* R/W */
+#define        INT_EN_GPIO1_INT                        0x00000002  /* R/W */
+#define        INT_EN_GPIO0_INT                        0x00000001  /* R/W */
+
+#define BYTE_TEST              (CONFIG_DRIVER_SMC911X_BASE + 0x64)
+#define FIFO_INT               (CONFIG_DRIVER_SMC911X_BASE + 0x68)
+#define        FIFO_INT_TX_AVAIL_LEVEL                 0xFF000000  /* R/W */
+#define        FIFO_INT_TX_STS_LEVEL                   0x00FF0000  /* R/W */
+#define        FIFO_INT_RX_AVAIL_LEVEL                 0x0000FF00  /* R/W */
+#define        FIFO_INT_RX_STS_LEVEL                   0x000000FF  /* R/W */
+
+#define RX_CFG                 (CONFIG_DRIVER_SMC911X_BASE + 0x6C)
+#define        RX_CFG_RX_END_ALGN                      0xC0000000  /* R/W */
+#define                RX_CFG_RX_END_ALGN4             0x00000000  /* R/W */
+#define                RX_CFG_RX_END_ALGN16            0x40000000  /* R/W */
+#define                RX_CFG_RX_END_ALGN32            0x80000000  /* R/W */
+#define        RX_CFG_RX_DMA_CNT                       0x0FFF0000  /* R/W */
+#define        RX_CFG_RX_DUMP                          0x00008000  /* R/W */
+#define        RX_CFG_RXDOFF                           0x00001F00  /* R/W */
+/*#define      RX_CFG_RXBAD                    0x00000001*/  /* R/W */
+
+#define TX_CFG                 (CONFIG_DRIVER_SMC911X_BASE + 0x70)
+/*#define      TX_CFG_TX_DMA_LVL               0xE0000000*/     /* R/W */
+/*#define      TX_CFG_TX_DMA_CNT               0x0FFF0000*/     /* R/W Self Clearing */
+#define        TX_CFG_TXS_DUMP                         0x00008000  /* Self Clearing */
+#define        TX_CFG_TXD_DUMP                         0x00004000  /* Self Clearing */
+#define        TX_CFG_TXSAO                            0x00000004  /* R/W */
+#define        TX_CFG_TX_ON                            0x00000002  /* R/W */
+#define        TX_CFG_STOP_TX                          0x00000001  /* Self Clearing */
+
+#define HW_CFG                 (CONFIG_DRIVER_SMC911X_BASE + 0x74)
+#define        HW_CFG_TTM                              0x00200000  /* R/W */
+#define        HW_CFG_SF                               0x00100000  /* R/W */
+#define        HW_CFG_TX_FIF_SZ                        0x000F0000  /* R/W */
+#define        HW_CFG_TR                               0x00003000  /* R/W */
+#define        HW_CFG_PHY_CLK_SEL                      0x00000060  /* R/W */
+#define        HW_CFG_PHY_CLK_SEL_INT_PHY              0x00000000 /* R/W */
+#define        HW_CFG_PHY_CLK_SEL_EXT_PHY              0x00000020 /* R/W */
+#define        HW_CFG_PHY_CLK_SEL_CLK_DIS              0x00000040 /* R/W */
+#define        HW_CFG_SMI_SEL                          0x00000010  /* R/W */
+#define        HW_CFG_EXT_PHY_DET                      0x00000008  /* RO */
+#define        HW_CFG_EXT_PHY_EN                       0x00000004  /* R/W */
+#define        HW_CFG_32_16_BIT_MODE                   0x00000004  /* RO */
+#define        HW_CFG_SRST_TO                          0x00000002  /* RO */
+#define        HW_CFG_SRST                             0x00000001  /* Self Clearing */
+
+#define RX_DP_CTRL             (CONFIG_DRIVER_SMC911X_BASE + 0x78)
+#define        RX_DP_CTRL_RX_FFWD                      0x80000000  /* R/W */
+#define        RX_DP_CTRL_FFWD_BUSY                    0x80000000  /* RO */
+
+#define RX_FIFO_INF            (CONFIG_DRIVER_SMC911X_BASE + 0x7C)
+#define         RX_FIFO_INF_RXSUSED                    0x00FF0000  /* RO */
+#define         RX_FIFO_INF_RXDUSED                    0x0000FFFF  /* RO */
+
+#define TX_FIFO_INF            (CONFIG_DRIVER_SMC911X_BASE + 0x80)
+#define        TX_FIFO_INF_TSUSED                      0x00FF0000  /* RO */
+#define        TX_FIFO_INF_TDFREE                      0x0000FFFF  /* RO */
+
+#define PMT_CTRL               (CONFIG_DRIVER_SMC911X_BASE + 0x84)
+#define        PMT_CTRL_PM_MODE                        0x00003000  /* Self Clearing */
+#define        PMT_CTRL_PHY_RST                        0x00000400  /* Self Clearing */
+#define        PMT_CTRL_WOL_EN                         0x00000200  /* R/W */
+#define        PMT_CTRL_ED_EN                          0x00000100  /* R/W */
+#define        PMT_CTRL_PME_TYPE                       0x00000040  /* R/W Not Affected by SW Reset */
+#define        PMT_CTRL_WUPS                           0x00000030  /* R/WC */
+#define        PMT_CTRL_WUPS_NOWAKE                    0x00000000  /* R/WC */
+#define        PMT_CTRL_WUPS_ED                        0x00000010  /* R/WC */
+#define        PMT_CTRL_WUPS_WOL                       0x00000020  /* R/WC */
+#define        PMT_CTRL_WUPS_MULTI                     0x00000030  /* R/WC */
+#define        PMT_CTRL_PME_IND                        0x00000008  /* R/W */
+#define        PMT_CTRL_PME_POL                        0x00000004  /* R/W */
+#define        PMT_CTRL_PME_EN                         0x00000002  /* R/W Not Affected by SW Reset */
+#define        PMT_CTRL_READY                          0x00000001  /* RO */
+
+#define GPIO_CFG               (CONFIG_DRIVER_SMC911X_BASE + 0x88)
+#define        GPIO_CFG_LED3_EN                        0x40000000  /* R/W */
+#define        GPIO_CFG_LED2_EN                        0x20000000  /* R/W */
+#define        GPIO_CFG_LED1_EN                        0x10000000  /* R/W */
+#define        GPIO_CFG_GPIO2_INT_POL                  0x04000000  /* R/W */
+#define        GPIO_CFG_GPIO1_INT_POL                  0x02000000  /* R/W */
+#define        GPIO_CFG_GPIO0_INT_POL                  0x01000000  /* R/W */
+#define        GPIO_CFG_EEPR_EN                        0x00700000  /* R/W */
+#define        GPIO_CFG_GPIOBUF2                       0x00040000  /* R/W */
+#define        GPIO_CFG_GPIOBUF1                       0x00020000  /* R/W */
+#define        GPIO_CFG_GPIOBUF0                       0x00010000  /* R/W */
+#define        GPIO_CFG_GPIODIR2                       0x00000400  /* R/W */
+#define        GPIO_CFG_GPIODIR1                       0x00000200  /* R/W */
+#define        GPIO_CFG_GPIODIR0                       0x00000100  /* R/W */
+#define        GPIO_CFG_GPIOD4                         0x00000010  /* R/W */
+#define        GPIO_CFG_GPIOD3                         0x00000008  /* R/W */
+#define        GPIO_CFG_GPIOD2                         0x00000004  /* R/W */
+#define        GPIO_CFG_GPIOD1                         0x00000002  /* R/W */
+#define        GPIO_CFG_GPIOD0                         0x00000001  /* R/W */
+
+#define GPT_CFG                        (CONFIG_DRIVER_SMC911X_BASE + 0x8C)
+#define        GPT_CFG_TIMER_EN                        0x20000000  /* R/W */
+#define        GPT_CFG_GPT_LOAD                        0x0000FFFF  /* R/W */
+
+#define GPT_CNT                        (CONFIG_DRIVER_SMC911X_BASE + 0x90)
+#define        GPT_CNT_GPT_CNT                         0x0000FFFF  /* RO */
+
+#define ENDIAN                 (CONFIG_DRIVER_SMC911X_BASE + 0x98)
+#define FREE_RUN               (CONFIG_DRIVER_SMC911X_BASE + 0x9C)
+#define RX_DROP                        (CONFIG_DRIVER_SMC911X_BASE + 0xA0)
+#define MAC_CSR_CMD            (CONFIG_DRIVER_SMC911X_BASE + 0xA4)
+#define         MAC_CSR_CMD_CSR_BUSY                   0x80000000  /* Self Clearing */
+#define         MAC_CSR_CMD_R_NOT_W                    0x40000000  /* R/W */
+#define         MAC_CSR_CMD_CSR_ADDR                   0x000000FF  /* R/W */
+
+#define MAC_CSR_DATA           (CONFIG_DRIVER_SMC911X_BASE + 0xA8)
+#define AFC_CFG                        (CONFIG_DRIVER_SMC911X_BASE + 0xAC)
+#define                AFC_CFG_AFC_HI                  0x00FF0000  /* R/W */
+#define                AFC_CFG_AFC_LO                  0x0000FF00  /* R/W */
+#define                AFC_CFG_BACK_DUR                0x000000F0  /* R/W */
+#define                AFC_CFG_FCMULT                  0x00000008  /* R/W */
+#define                AFC_CFG_FCBRD                   0x00000004  /* R/W */
+#define                AFC_CFG_FCADD                   0x00000002  /* R/W */
+#define                AFC_CFG_FCANY                   0x00000001  /* R/W */
+
+#define E2P_CMD                        (CONFIG_DRIVER_SMC911X_BASE + 0xB0)
+#define                E2P_CMD_EPC_BUSY                0x80000000  /* Self Clearing */
+#define                E2P_CMD_EPC_CMD                 0x70000000  /* R/W */
+#define                E2P_CMD_EPC_CMD_READ            0x00000000  /* R/W */
+#define                E2P_CMD_EPC_CMD_EWDS            0x10000000  /* R/W */
+#define                E2P_CMD_EPC_CMD_EWEN            0x20000000  /* R/W */
+#define                E2P_CMD_EPC_CMD_WRITE           0x30000000  /* R/W */
+#define                E2P_CMD_EPC_CMD_WRAL            0x40000000  /* R/W */
+#define                E2P_CMD_EPC_CMD_ERASE           0x50000000  /* R/W */
+#define                E2P_CMD_EPC_CMD_ERAL            0x60000000  /* R/W */
+#define                E2P_CMD_EPC_CMD_RELOAD          0x70000000  /* R/W */
+#define                E2P_CMD_EPC_TIMEOUT             0x00000200  /* RO */
+#define                E2P_CMD_MAC_ADDR_LOADED         0x00000100  /* RO */
+#define                E2P_CMD_EPC_ADDR                0x000000FF  /* R/W */
+
+#define E2P_DATA               (CONFIG_DRIVER_SMC911X_BASE + 0xB4)
+#define        E2P_DATA_EEPROM_DATA                    0x000000FF  /* R/W */
+/* end of LAN register offsets and bit definitions */
+
+/* MAC Control and Status registers */
+#define MAC_CR                 0x01  /* R/W */
+
+/* MAC_CR - MAC Control Register */
+#define MAC_CR_RXALL                   0x80000000
+/* TODO: delete this bit? It is not described in the data sheet. */
+#define MAC_CR_HBDIS                   0x10000000
+#define MAC_CR_RCVOWN                  0x00800000
+#define MAC_CR_LOOPBK                  0x00200000
+#define MAC_CR_FDPX                    0x00100000
+#define MAC_CR_MCPAS                   0x00080000
+#define MAC_CR_PRMS                    0x00040000
+#define MAC_CR_INVFILT                 0x00020000
+#define MAC_CR_PASSBAD                 0x00010000
+#define MAC_CR_HFILT                   0x00008000
+#define MAC_CR_HPFILT                  0x00002000
+#define MAC_CR_LCOLL                   0x00001000
+#define MAC_CR_BCAST                   0x00000800
+#define MAC_CR_DISRTY                  0x00000400
+#define MAC_CR_PADSTR                  0x00000100
+#define MAC_CR_BOLMT_MASK              0x000000C0
+#define MAC_CR_DFCHK                   0x00000020
+#define MAC_CR_TXEN                    0x00000008
+#define MAC_CR_RXEN                    0x00000004
+
+#define ADDRH                  0x02      /* R/W mask 0x0000FFFFUL */
+#define ADDRL                  0x03      /* R/W mask 0xFFFFFFFFUL */
+#define HASHH                  0x04      /* R/W */
+#define HASHL                  0x05      /* R/W */
+
+#define MII_ACC                        0x06      /* R/W */
+#define MII_ACC_PHY_ADDR               0x0000F800
+#define MII_ACC_MIIRINDA               0x000007C0
+#define MII_ACC_MII_WRITE              0x00000002
+#define MII_ACC_MII_BUSY               0x00000001
+
+#define MII_DATA               0x07      /* R/W mask 0x0000FFFFUL */
+
+#define FLOW                   0x08      /* R/W */
+#define FLOW_FCPT                      0xFFFF0000
+#define FLOW_FCPASS                    0x00000004
+#define FLOW_FCEN                      0x00000002
+#define FLOW_FCBSY                     0x00000001
+
+#define VLAN1                  0x09      /* R/W mask 0x0000FFFFUL */
+#define VLAN1_VTI1                     0x0000ffff
+
+#define VLAN2                  0x0A      /* R/W mask 0x0000FFFFUL */
+#define VLAN2_VTI2                     0x0000ffff
+
+#define WUFF                   0x0B      /* WO */
+
+#define WUCSR                  0x0C      /* R/W */
+#define WUCSR_GUE                      0x00000200
+#define WUCSR_WUFR                     0x00000040
+#define WUCSR_MPR                      0x00000020
+#define WUCSR_WAKE_EN                  0x00000004
+#define WUCSR_MPEN                     0x00000002
+
+/* Chip ID values */
+#define CHIP_9115      0x115
+#define CHIP_9116      0x116
+#define CHIP_9117      0x117
+#define CHIP_9118      0x118
+#define CHIP_9215      0x115a
+#define CHIP_9216      0x116a
+#define CHIP_9217      0x117a
+#define CHIP_9218      0x118a
+
+struct chip_id {
+       u16 id;
+       char *name;
+};
+
+static const struct chip_id chip_ids[] =  {
+       { CHIP_9115, "LAN9115" },
+       { CHIP_9116, "LAN9116" },
+       { CHIP_9117, "LAN9117" },
+       { CHIP_9118, "LAN9118" },
+       { CHIP_9215, "LAN9215" },
+       { CHIP_9216, "LAN9216" },
+       { CHIP_9217, "LAN9217" },
+       { CHIP_9218, "LAN9218" },
+       { 0, NULL },
+};
+
+#define DRIVERNAME "smc911x"
+
+u32 smc911x_get_mac_csr(u8 reg)
+{
+       while (reg_read(MAC_CSR_CMD) & MAC_CSR_CMD_CSR_BUSY)
+               ;
+       reg_write(MAC_CSR_CMD, MAC_CSR_CMD_CSR_BUSY | MAC_CSR_CMD_R_NOT_W | reg);
+       while (reg_read(MAC_CSR_CMD) & MAC_CSR_CMD_CSR_BUSY)
+               ;
+
+       return reg_read(MAC_CSR_DATA);
+}
+
+void smc911x_set_mac_csr(u8 reg, u32 data)
+{
+       while (reg_read(MAC_CSR_CMD) & MAC_CSR_CMD_CSR_BUSY)
+               ;
+       reg_write(MAC_CSR_DATA, data);
+       reg_write(MAC_CSR_CMD, MAC_CSR_CMD_CSR_BUSY | reg);
+       while (reg_read(MAC_CSR_CMD) & MAC_CSR_CMD_CSR_BUSY)
+               ;
+}
+
+static int smx911x_handle_mac_address(bd_t *bd)
+{
+       unsigned long addrh, addrl;
+       unsigned char *m = bd->bi_enetaddr;
+
+       /* if the environment has a valid mac address then use it */
+       if ((m[0] | m[1] | m[2] | m[3] | m[4] | m[5])) {
+               addrl = m[0] | m[1] << 8 | m[2] << 16 | m[3] << 24;
+               addrh = m[4] | m[5] << 8;
+               smc911x_set_mac_csr(ADDRH, addrh);
+               smc911x_set_mac_csr(ADDRL, addrl);
+       } else {
+               /* if not, try to get one from the eeprom */
+               addrh = smc911x_get_mac_csr(ADDRH);
+               addrl = smc911x_get_mac_csr(ADDRL);
+
+               m[0] = (addrl       ) & 0xff;
+               m[1] = (addrl >>  8 ) & 0xff;
+               m[2] = (addrl >> 16 ) & 0xff;
+               m[3] = (addrl >> 24 ) & 0xff;
+               m[4] = (addrh       ) & 0xff;
+               m[5] = (addrh >>  8 ) & 0xff;
+
+               /* we get 0xff when there is no eeprom connected */
+               if ((m[0] & m[1] & m[2] & m[3] & m[4] & m[5]) == 0xff) {
+                       printf(DRIVERNAME ": no valid mac address in environment "
+                               "and no eeprom found\n");
+                       return -1;
+               }
+       }
+
+       printf(DRIVERNAME ": MAC %02x:%02x:%02x:%02x:%02x:%02x\n",
+               m[0], m[1], m[2], m[3], m[4], m[5]);
+
+       return 0;
+}
+
+static int smc911x_miiphy_read(u8 phy, u8 reg, u16 *val)
+{
+       while (smc911x_get_mac_csr(MII_ACC) & MII_ACC_MII_BUSY)
+               ;
+
+       smc911x_set_mac_csr(MII_ACC, phy << 11 | reg << 6 | MII_ACC_MII_BUSY);
+
+       while (smc911x_get_mac_csr(MII_ACC) & MII_ACC_MII_BUSY)
+               ;
+
+       *val = smc911x_get_mac_csr(MII_DATA);
+
+       return 0;
+}
+
+static int smc911x_miiphy_write(u8 phy, u8 reg, u16  val)
+{
+       while (smc911x_get_mac_csr(MII_ACC) & MII_ACC_MII_BUSY)
+               ;
+
+       smc911x_set_mac_csr(MII_DATA, val);
+       smc911x_set_mac_csr(MII_ACC,
+               phy << 11 | reg << 6 | MII_ACC_MII_BUSY | MII_ACC_MII_WRITE);
+
+       while (smc911x_get_mac_csr(MII_ACC) & MII_ACC_MII_BUSY)
+               ;
+       return 0;
+}
+
+static int smc911x_phy_reset(void)
+{
+       u32 reg;
+
+       reg = reg_read(PMT_CTRL);
+       reg &= ~0xfffff030;
+       reg |= PMT_CTRL_PHY_RST;
+       reg_write(PMT_CTRL, reg);
+
+       mdelay(100);
+
+       return 0;
+}
+
+static void smc911x_phy_configure(void)
+{
+       int timeout;
+       u16 status;
+
+       smc911x_phy_reset();
+
+       smc911x_miiphy_write(1, PHY_BMCR, PHY_BMCR_RESET);
+       mdelay(1);
+       smc911x_miiphy_write(1, PHY_ANAR, 0x01e1);
+       smc911x_miiphy_write(1, PHY_BMCR, PHY_BMCR_AUTON | PHY_BMCR_RST_NEG);
+
+       timeout = 5000;
+       do {
+               mdelay(1);
+               if ((timeout--) == 0)
+                       goto err_out;
+
+               if (smc911x_miiphy_read(1, PHY_BMSR, &status) != 0)
+                       goto err_out;
+       } while (!(status & PHY_BMSR_LS));
+
+       printf(DRIVERNAME ": phy initialized\n");
+
+       return;
+
+err_out:
+       printf(DRIVERNAME ": autonegotiation timed out\n");
+}
+
+static void smc911x_reset(void)
+{
+       int timeout;
+
+       /* Take out of PM setting first */
+       if (reg_read(PMT_CTRL) & PMT_CTRL_READY) {
+               /* Write to the bytetest will take out of powerdown */
+               reg_write(BYTE_TEST, 0x0);
+
+               timeout = 10;
+
+               while (timeout-- && !(reg_read(PMT_CTRL) & PMT_CTRL_READY))
+                       udelay(10);
+               if (!timeout) {
+                       printf(DRIVERNAME
+                               ": timeout waiting for PM restore\n");
+                       return;
+               }
+       }
+
+       /* Disable interrupts */
+       reg_write(INT_EN, 0);
+
+       reg_write(HW_CFG, HW_CFG_SRST);
+
+       timeout = 1000;
+       while (timeout-- && reg_read(E2P_CMD) & E2P_CMD_EPC_BUSY)
+               udelay(10);
+
+       if (!timeout) {
+               printf(DRIVERNAME ": reset timeout\n");
+               return;
+       }
+
+       /* Reset the FIFO level and flow control settings */
+       smc911x_set_mac_csr(FLOW, FLOW_FCPT | FLOW_FCEN);
+       reg_write(AFC_CFG, 0x0050287F);
+
+       /* Set to LED outputs */
+       reg_write(GPIO_CFG, 0x70070000);
+}
+
+static void smc911x_enable(void)
+{
+       /* Enable TX */
+       reg_write(HW_CFG, 8 << 16 | HW_CFG_SF);
+
+       reg_write(GPT_CFG, GPT_CFG_TIMER_EN | 10000);
+
+       reg_write(TX_CFG, TX_CFG_TX_ON);
+
+       /* no padding to start of packets */
+       reg_write(RX_CFG, 0);
+
+       smc911x_set_mac_csr(MAC_CR, MAC_CR_TXEN | MAC_CR_RXEN | MAC_CR_HBDIS);
+
+}
+
+int eth_init(bd_t *bd)
+{
+       unsigned long val, i;
+
+       printf(DRIVERNAME ": initializing\n");
+
+       val = reg_read(BYTE_TEST);
+       if (val != 0x87654321) {
+               printf(DRIVERNAME ": Invalid chip endian 0x08%x\n", val);
+               goto err_out;
+       }
+
+       val = reg_read(ID_REV) >> 16;
+       for (i = 0; chip_ids[i].id != 0; i++) {
+               if (chip_ids[i].id == val) break;
+       }
+       if (!chip_ids[i].id) {
+               printf(DRIVERNAME ": Unknown chip ID %04x\n", val);
+               goto err_out;
+       }
+
+       printf(DRIVERNAME ": detected %s controller\n", chip_ids[i].name);
+
+       smc911x_reset();
+
+       /* Configure the PHY, initialize the link state */
+       smc911x_phy_configure();
+
+       if (smx911x_handle_mac_address(bd))
+               goto err_out;
+
+       /* Turn on Tx + Rx */
+       smc911x_enable();
+
+       return 0;
+
+err_out:
+       return -1;
+}
+
+int eth_send(volatile void *packet, int length)
+{
+       u32 *data = (u32*)packet;
+       u32 tmplen;
+       u32 status;
+
+       reg_write(TX_DATA_FIFO, TX_CMD_A_INT_FIRST_SEG | TX_CMD_A_INT_LAST_SEG | length);
+       reg_write(TX_DATA_FIFO, length);
+
+       tmplen = (length + 3) / 4;
+
+       while (tmplen--)
+               reg_write(TX_DATA_FIFO, *data++);
+
+       /* wait for transmission */
+       while (!((reg_read(TX_FIFO_INF) & TX_FIFO_INF_TSUSED) >> 16));
+
+       /* get status. Ignore 'no carrier' error, it has no meaning for
+        * full duplex operation
+        */
+       status = reg_read(TX_STATUS_FIFO) & (TX_STS_LOC | TX_STS_LATE_COLL |
+               TX_STS_MANY_COLL | TX_STS_MANY_DEFER | TX_STS_UNDERRUN);
+
+       if (!status)
+               return 0;
+
+       printf(DRIVERNAME ": failed to send packet: %s%s%s%s%s\n",
+               status & TX_STS_LOC ? "TX_STS_LOC " : "",
+               status & TX_STS_LATE_COLL ? "TX_STS_LATE_COLL " : "",
+               status & TX_STS_MANY_COLL ? "TX_STS_MANY_COLL " : "",
+               status & TX_STS_MANY_DEFER ? "TX_STS_MANY_DEFER " : "",
+               status & TX_STS_UNDERRUN ? "TX_STS_UNDERRUN" : "");
+
+       return -1;
+}
+
+void eth_halt(void)
+{
+       smc911x_reset();
+}
+
+int eth_rx(void)
+{
+       u32 *data = (u32 *)NetRxPackets[0];
+       u32 pktlen, tmplen;
+       u32 status;
+
+       if ((reg_read(RX_FIFO_INF) & RX_FIFO_INF_RXSUSED) >> 16) {
+               status = reg_read(RX_STATUS_FIFO);
+               pktlen = (status & RX_STS_PKT_LEN) >> 16;
+
+               reg_write(RX_CFG, 0);
+
+               tmplen = (pktlen + 2+ 3) / 4;
+               while (tmplen--)
+                       *data++ = reg_read(RX_DATA_FIFO);
+
+               if (status & RX_STS_ES)
+                       printf(DRIVERNAME
+                               ": dropped bad packet. Status: 0x%08x\n",
+                               status);
+               else
+                       NetReceive(NetRxPackets[0], pktlen);
+       }
+
+       return 0;
+}
+
+#endif                         /* CONFIG_DRIVER_SMC911X */
index e91d9ea..9d22aa3 100644 (file)
@@ -583,10 +583,11 @@ 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_LINK) &&
-               !(mii_reg & MIIM_RTL8211B_PHYSTAT_SPDDONE)) {
+       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 ? */
@@ -1266,6 +1267,35 @@ struct phy_info phy_info_VSC8244 = {
                           },
 };
 
+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 CFG_VSC8601_SKEWFIX
+                               {MIIM_VSC8601_EPHY_CON,MIIM_VSC8601_EPHY_CON_INIT_SKEW,NULL},
+#endif
+                               {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,}
+                               },
+};
+
+
 struct phy_info phy_info_dm9161 = {
        0x0181b88,
        "Davicom DM9161E",
@@ -1461,6 +1491,7 @@ struct phy_info *phy_info[] = {
        &phy_info_dm9161,
        &phy_info_lxt971,
        &phy_info_VSC8244,
+       &phy_info_VSC8601,
        &phy_info_dp83865,
        &phy_info_rtl8211b,
        &phy_info_generic,
index d4dc15a..cfa7d1a 100644 (file)
 #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
+
 /* 88E1011 PHY Status Register */
 #define MIIM_88E1011_PHY_STATUS         0x11
 #define MIIM_88E1011_PHYSTAT_SPEED      0xc000
diff --git a/drivers/net/vsc7385.c b/drivers/net/vsc7385.c
new file mode 100644 (file)
index 0000000..4095bce
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+ * Vitesse 7385 Switch Firmware Upload
+ *
+ * Author: Timur Tabi <timur@freescale.com>
+ *
+ * Copyright 2008 Freescale Semiconductor, Inc.  This file is licensed
+ * under the terms of the GNU General Public License version 2.  This
+ * program is licensed "as is" without any warranty of any kind, whether
+ * express or implied.
+ *
+ * This module uploads proprietary firmware for the Vitesse VSC7385 5-port
+ * switch.
+ */
+
+#include <config.h>
+
+#ifdef CONFIG_VSC7385_ENET
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/errno.h>
+
+/*
+ * Upload a Vitesse VSC7385 firmware image to the hardware
+ *
+ * This function takes a pointer to a VSC7385 firmware image and a size, and
+ * uploads that firmware to the VSC7385.
+ *
+ * This firmware is typically located at a board-specific flash address,
+ * and the size is typically 8KB.
+ *
+ * The firmware is Vitesse proprietary.
+ *
+ * Further details on the register information can be obtained from Vitesse.
+ */
+int vsc7385_upload_firmware(void *firmware, unsigned int size)
+{
+       u8 *fw = firmware;
+       unsigned int i;
+
+       u32 *gloreset = (u32 *) (CFG_VSC7385_BASE + 0x1c050);
+       u32 *icpu_ctrl = (u32 *) (CFG_VSC7385_BASE + 0x1c040);
+       u32 *icpu_addr = (u32 *) (CFG_VSC7385_BASE + 0x1c044);
+       u32 *icpu_data = (u32 *) (CFG_VSC7385_BASE + 0x1c048);
+       u32 *icpu_rom_map = (u32 *) (CFG_VSC7385_BASE + 0x1c070);
+#ifdef DEBUG
+       u32 *chipid = (u32 *) (CFG_VSC7385_BASE + 0x1c060);
+#endif
+
+       out_be32(gloreset, 3);
+       udelay(200);
+
+       out_be32(icpu_ctrl, 0x8E);
+       udelay(20);
+
+       out_be32(icpu_rom_map, 1);
+       udelay(20);
+
+       /* Write the firmware to I-RAM */
+       out_be32(icpu_addr, 0);
+       udelay(20);
+
+       for (i = 0; i < size; i++) {
+               out_be32(icpu_data, fw[i]);
+               udelay(20);
+               if (ctrlc())
+                       return -EINTR;
+       }
+
+       /* Read back and compare */
+       out_be32(icpu_addr, 0);
+       udelay(20);
+
+       for (i = 0; i < size; i++) {
+               u8 value;
+
+               value = (u8) in_be32(icpu_data);
+               udelay(20);
+               if (value != fw[i]) {
+                       debug("VSC7385: Upload mismatch: address 0x%x, "
+                             "read value 0x%x, image value 0x%x\n",
+                             i, value, fw[i]);
+
+                       return -EIO;
+               }
+               if (ctrlc())
+                       break;
+       }
+
+       out_be32(icpu_ctrl, 0x0B);
+       udelay(20);
+
+#ifdef DEBUG
+       printf("VSC7385: Chip ID is %08x\n", in_be32(chipid));
+       udelay(20);
+#endif
+
+       return 0;
+}
+
+#endif
diff --git a/drivers/net/xilinx_emac.c b/drivers/net/xilinx_emac.c
new file mode 100644 (file)
index 0000000..c7f1a2a
--- /dev/null
@@ -0,0 +1,462 @@
+/******************************************************************************
+ *
+ * XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS"
+ * AS A COURTESY TO YOU, SOLELY FOR USE IN DEVELOPING PROGRAMS AND
+ * SOLUTIONS FOR XILINX DEVICES. BY PROVIDING THIS DESIGN, CODE,
+ * OR INFORMATION AS ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE,
+ * APPLICATION OR STANDARD, XILINX IS MAKING NO REPRESENTATION
+ * THAT THIS IMPLEMENTATION IS FREE FROM ANY CLAIMS OF INFRINGEMENT,
+ * AND YOU ARE RESPONSIBLE FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE
+ * FOR YOUR IMPLEMENTATION. XILINX EXPRESSLY DISCLAIMS ANY
+ * WARRANTY WHATSOEVER WITH RESPECT TO THE ADEQUACY OF THE
+ * IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OR
+ * REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE FROM CLAIMS OF
+ * INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE.
+ *
+ * (C) Copyright 2007-2008 Michal Simek
+ * Michal SIMEK <monstr@monstr.eu>
+ *
+ * (c) Copyright 2003 Xilinx Inc.
+ * All rights reserved.
+ *
+ ******************************************************************************/
+
+#include <config.h>
+#include <common.h>
+#include <net.h>
+#include <asm/io.h>
+
+#include <asm/asm.h>
+
+#undef DEBUG
+
+typedef struct {
+       u32 regbaseaddress;     /* Base address of registers */
+       u32 databaseaddress;    /* Base address of data for FIFOs */
+} xpacketfifov100b;
+
+typedef struct {
+       u32 baseaddress;        /* Base address (of IPIF) */
+       u32 isstarted;          /* Device is currently started 0-no, 1-yes */
+       xpacketfifov100b recvfifo;      /* FIFO used to receive frames */
+       xpacketfifov100b sendfifo;      /* FIFO used to send frames */
+} xemac;
+
+#define XIIF_V123B_IISR_OFFSET 32UL /* IP interrupt status register */
+#define XIIF_V123B_RESET_MASK          0xAUL
+#define XIIF_V123B_RESETR_OFFSET       64UL /* reset register */
+
+/* This constant is used with the Reset Register */
+#define XPF_RESET_FIFO_MASK            0x0000000A
+#define XPF_COUNT_STATUS_REG_OFFSET    4UL
+
+/* These constants are used with the Occupancy/Vacancy Count Register. This
+ * register also contains FIFO status */
+#define XPF_COUNT_MASK                 0x0000FFFF
+#define XPF_DEADLOCK_MASK              0x20000000
+
+/* Offset of the MAC registers from the IPIF base address */
+#define XEM_REG_OFFSET         0x1100UL
+
+/*
+ * Register offsets for the Ethernet MAC. Each register is 32 bits.
+ */
+#define XEM_ECR_OFFSET (XEM_REG_OFFSET + 0x4)  /* MAC Control */
+#define XEM_SAH_OFFSET (XEM_REG_OFFSET + 0xC)  /* Station addr, high */
+#define XEM_SAL_OFFSET (XEM_REG_OFFSET + 0x10) /* Station addr, low */
+#define XEM_RPLR_OFFSET        (XEM_REG_OFFSET + 0x1C) /* Rx packet length */
+#define XEM_TPLR_OFFSET        (XEM_REG_OFFSET + 0x20) /* Tx packet length */
+#define XEM_TSR_OFFSET (XEM_REG_OFFSET + 0x24) /* Tx status */
+
+#define XEM_PFIFO_OFFSET       0x2000UL
+/* Tx registers */
+#define XEM_PFIFO_TXREG_OFFSET (XEM_PFIFO_OFFSET + 0x0)
+/* Rx registers */
+#define XEM_PFIFO_RXREG_OFFSET (XEM_PFIFO_OFFSET + 0x10)
+/* Tx keyhole */
+#define XEM_PFIFO_TXDATA_OFFSET        (XEM_PFIFO_OFFSET + 0x100)
+/* Rx keyhole */
+#define XEM_PFIFO_RXDATA_OFFSET        (XEM_PFIFO_OFFSET + 0x200)
+
+/*
+ * EMAC Interrupt Registers (Status and Enable) masks. These registers are
+ * part of the IPIF IP Interrupt registers
+ */
+/* A mask for all transmit interrupts, used in polled mode */
+#define XEM_EIR_XMIT_ALL_MASK  (XEM_EIR_XMIT_DONE_MASK |\
+                               XEM_EIR_XMIT_ERROR_MASK | \
+                               XEM_EIR_XMIT_SFIFO_EMPTY_MASK |\
+                               XEM_EIR_XMIT_LFIFO_FULL_MASK)
+
+/* Xmit complete */
+#define XEM_EIR_XMIT_DONE_MASK         0x00000001UL
+/* Recv complete */
+#define XEM_EIR_RECV_DONE_MASK         0x00000002UL
+/* Xmit error */
+#define XEM_EIR_XMIT_ERROR_MASK                0x00000004UL
+/* Recv error */
+#define XEM_EIR_RECV_ERROR_MASK                0x00000008UL
+/* Xmit status fifo empty */
+#define XEM_EIR_XMIT_SFIFO_EMPTY_MASK  0x00000010UL
+/* Recv length fifo empty */
+#define XEM_EIR_RECV_LFIFO_EMPTY_MASK  0x00000020UL
+/* Xmit length fifo full */
+#define XEM_EIR_XMIT_LFIFO_FULL_MASK   0x00000040UL
+/* Recv length fifo overrun */
+#define XEM_EIR_RECV_LFIFO_OVER_MASK   0x00000080UL
+/* Recv length fifo underrun */
+#define XEM_EIR_RECV_LFIFO_UNDER_MASK  0x00000100UL
+/* Xmit status fifo overrun */
+#define XEM_EIR_XMIT_SFIFO_OVER_MASK   0x00000200UL
+/* Transmit status fifo underrun */
+#define XEM_EIR_XMIT_SFIFO_UNDER_MASK  0x00000400UL
+/* Transmit length fifo overrun */
+#define XEM_EIR_XMIT_LFIFO_OVER_MASK   0x00000800UL
+/* Transmit length fifo underrun */
+#define XEM_EIR_XMIT_LFIFO_UNDER_MASK  0x00001000UL
+/* Transmit pause pkt received */
+#define XEM_EIR_XMIT_PAUSE_MASK                0x00002000UL
+
+/*
+ * EMAC Control Register (ECR)
+ */
+/* Full duplex mode */
+#define XEM_ECR_FULL_DUPLEX_MASK       0x80000000UL
+/* Reset transmitter */
+#define XEM_ECR_XMIT_RESET_MASK                0x40000000UL
+/* Enable transmitter */
+#define XEM_ECR_XMIT_ENABLE_MASK       0x20000000UL
+/* Reset receiver */
+#define XEM_ECR_RECV_RESET_MASK                0x10000000UL
+/* Enable receiver */
+#define XEM_ECR_RECV_ENABLE_MASK       0x08000000UL
+/* Enable PHY */
+#define XEM_ECR_PHY_ENABLE_MASK                0x04000000UL
+/* Enable xmit pad insert */
+#define XEM_ECR_XMIT_PAD_ENABLE_MASK   0x02000000UL
+/* Enable xmit FCS insert */
+#define XEM_ECR_XMIT_FCS_ENABLE_MASK   0x01000000UL
+/* Enable unicast addr */
+#define XEM_ECR_UNICAST_ENABLE_MASK    0x00020000UL
+/* Enable broadcast addr */
+#define XEM_ECR_BROAD_ENABLE_MASK      0x00008000UL
+
+/*
+ * Transmit Status Register (TSR)
+ */
+/* Transmit excess deferral */
+#define XEM_TSR_EXCESS_DEFERRAL_MASK   0x80000000UL
+/* Transmit late collision */
+#define XEM_TSR_LATE_COLLISION_MASK    0x01000000UL
+
+#define ENET_MAX_MTU           PKTSIZE
+#define ENET_ADDR_LENGTH       6
+
+static unsigned int etherrxbuff[PKTSIZE_ALIGN/4]; /* Receive buffer */
+
+static u8 emacaddr[ENET_ADDR_LENGTH] = { 0x00, 0x0a, 0x35, 0x00, 0x22, 0x01 };
+
+static xemac emac;
+
+void eth_halt(void)
+{
+       debug ("eth_halt\n");
+}
+
+int eth_init(bd_t * bis)
+{
+       u32 helpreg;
+       debug ("EMAC Initialization Started\n\r");
+
+       if (emac.isstarted) {
+               puts("Emac is started\n");
+               return 0;
+       }
+
+       memset (&emac, 0, sizeof (xemac));
+
+       emac.baseaddress = XILINX_EMAC_BASEADDR;
+
+       /* Setting up FIFOs */
+       emac.recvfifo.regbaseaddress = emac.baseaddress +
+                                       XEM_PFIFO_RXREG_OFFSET;
+       emac.recvfifo.databaseaddress = emac.baseaddress +
+                                       XEM_PFIFO_RXDATA_OFFSET;
+       out_be32 (emac.recvfifo.regbaseaddress, XPF_RESET_FIFO_MASK);
+
+       emac.sendfifo.regbaseaddress = emac.baseaddress +
+                                       XEM_PFIFO_TXREG_OFFSET;
+       emac.sendfifo.databaseaddress = emac.baseaddress +
+                                       XEM_PFIFO_TXDATA_OFFSET;
+       out_be32 (emac.sendfifo.regbaseaddress, XPF_RESET_FIFO_MASK);
+
+       /* Reset the entire IPIF */
+       out_be32 (emac.baseaddress + XIIF_V123B_RESETR_OFFSET,
+                                       XIIF_V123B_RESET_MASK);
+
+       /* Stopping EMAC for setting up MAC */
+       helpreg = in_be32 (emac.baseaddress + XEM_ECR_OFFSET);
+       helpreg &= ~(XEM_ECR_XMIT_ENABLE_MASK | XEM_ECR_RECV_ENABLE_MASK);
+       out_be32 (emac.baseaddress + XEM_ECR_OFFSET, helpreg);
+
+       if (!getenv("ethaddr")) {
+               memcpy(bis->bi_enetaddr, emacaddr, ENET_ADDR_LENGTH);
+       }
+
+       /* Set the device station address high and low registers */
+       helpreg = (bis->bi_enetaddr[0] << 8) | bis->bi_enetaddr[1];
+       out_be32 (emac.baseaddress + XEM_SAH_OFFSET, helpreg);
+       helpreg = (bis->bi_enetaddr[2] << 24) | (bis->bi_enetaddr[3] << 16) |
+                       (bis->bi_enetaddr[4] << 8) | bis->bi_enetaddr[5];
+       out_be32 (emac.baseaddress + XEM_SAL_OFFSET, helpreg);
+
+       helpreg = XEM_ECR_UNICAST_ENABLE_MASK | XEM_ECR_BROAD_ENABLE_MASK |
+               XEM_ECR_FULL_DUPLEX_MASK | XEM_ECR_XMIT_FCS_ENABLE_MASK |
+               XEM_ECR_XMIT_PAD_ENABLE_MASK | XEM_ECR_PHY_ENABLE_MASK;
+       out_be32 (emac.baseaddress + XEM_ECR_OFFSET, helpreg);
+
+       emac.isstarted = 1;
+
+       /* Enable the transmitter, and receiver */
+       helpreg = in_be32 (emac.baseaddress + XEM_ECR_OFFSET);
+       helpreg &= ~(XEM_ECR_XMIT_RESET_MASK | XEM_ECR_RECV_RESET_MASK);
+       helpreg |= (XEM_ECR_XMIT_ENABLE_MASK | XEM_ECR_RECV_ENABLE_MASK);
+       out_be32 (emac.baseaddress + XEM_ECR_OFFSET, helpreg);
+
+       printf("EMAC Initialization complete\n\r");
+       return 0;
+}
+
+int eth_send(volatile void *ptr, int len)
+{
+       u32 intrstatus;
+       u32 xmitstatus;
+       u32 fifocount;
+       u32 wordcount;
+       u32 extrabytecount;
+       u32 *wordbuffer = (u32 *) ptr;
+
+       if (len > ENET_MAX_MTU)
+               len = ENET_MAX_MTU;
+
+       /*
+        * Check for overruns and underruns for the transmit status and length
+        * FIFOs and make sure the send packet FIFO is not deadlocked.
+        * Any of these conditions is bad enough that we do not want to
+        * continue. The upper layer software should reset the device to resolve
+        * the error.
+        */
+       intrstatus = in_be32 ((emac.baseaddress) + XIIF_V123B_IISR_OFFSET);
+       if (intrstatus & (XEM_EIR_XMIT_SFIFO_OVER_MASK |
+                       XEM_EIR_XMIT_LFIFO_OVER_MASK)) {
+               debug ("Transmitting overrun error\n");
+               return 0;
+       } else if (intrstatus & (XEM_EIR_XMIT_SFIFO_UNDER_MASK |
+                       XEM_EIR_XMIT_LFIFO_UNDER_MASK)) {
+               debug ("Transmitting underrun error\n");
+               return 0;
+       } else if (in_be32 (emac.sendfifo.regbaseaddress +
+                       XPF_COUNT_STATUS_REG_OFFSET) & XPF_DEADLOCK_MASK) {
+               debug ("Transmitting fifo error\n");
+               return 0;
+       }
+
+       /*
+        * Before writing to the data FIFO, make sure the length FIFO is not
+        * full. The data FIFO might not be full yet even though the length FIFO
+        * is. This avoids an overrun condition on the length FIFO and keeps the
+        * FIFOs in sync.
+        *
+        * Clear the latched LFIFO_FULL bit so next time around the most
+        * current status is represented
+        */
+       if (intrstatus & XEM_EIR_XMIT_LFIFO_FULL_MASK) {
+               out_be32 ((emac.baseaddress) + XIIF_V123B_IISR_OFFSET,
+                       intrstatus & XEM_EIR_XMIT_LFIFO_FULL_MASK);
+               debug ("Fifo is full\n");
+               return 0;
+       }
+
+       /* get the count of how many words may be inserted into the FIFO */
+       fifocount = in_be32 (emac.sendfifo.regbaseaddress +
+                               XPF_COUNT_STATUS_REG_OFFSET) & XPF_COUNT_MASK;
+       wordcount = len >> 2;
+       extrabytecount = len & 0x3;
+
+       if (fifocount < wordcount) {
+               debug ("Sending packet is larger then size of FIFO\n");
+               return 0;
+       }
+
+       for (fifocount = 0; fifocount < wordcount; fifocount++) {
+               out_be32 (emac.sendfifo.databaseaddress, wordbuffer[fifocount]);
+       }
+       if (extrabytecount > 0) {
+               u32 lastword = 0;
+               u8 *extrabytesbuffer = (u8 *) (wordbuffer + wordcount);
+
+               if (extrabytecount == 1) {
+                       lastword = extrabytesbuffer[0] << 24;
+               } else if (extrabytecount == 2) {
+                       lastword = extrabytesbuffer[0] << 24 |
+                               extrabytesbuffer[1] << 16;
+               } else if (extrabytecount == 3) {
+                       lastword = extrabytesbuffer[0] << 24 |
+                               extrabytesbuffer[1] << 16 |
+                               extrabytesbuffer[2] << 8;
+               }
+               out_be32 (emac.sendfifo.databaseaddress, lastword);
+       }
+
+       /* Loop on the MAC's status to wait for any pause to complete */
+       intrstatus = in_be32 ((emac.baseaddress) + XIIF_V123B_IISR_OFFSET);
+       while ((intrstatus & XEM_EIR_XMIT_PAUSE_MASK) != 0) {
+               intrstatus = in_be32 ((emac.baseaddress) +
+                                       XIIF_V123B_IISR_OFFSET);
+               /* Clear the pause status from the transmit status register */
+               out_be32 ((emac.baseaddress) + XIIF_V123B_IISR_OFFSET,
+                               intrstatus & XEM_EIR_XMIT_PAUSE_MASK);
+       }
+
+       /*
+        * Set the MAC's transmit packet length register to tell it to transmit
+        */
+       out_be32 (emac.baseaddress + XEM_TPLR_OFFSET, len);
+
+       /*
+        * Loop on the MAC's status to wait for the transmit to complete.
+        * The transmit status is in the FIFO when the XMIT_DONE bit is set.
+        */
+       do {
+               intrstatus = in_be32 ((emac.baseaddress) +
+                                               XIIF_V123B_IISR_OFFSET);
+       }
+       while ((intrstatus & XEM_EIR_XMIT_DONE_MASK) == 0);
+
+       xmitstatus = in_be32 (emac.baseaddress + XEM_TSR_OFFSET);
+
+       if (intrstatus & (XEM_EIR_XMIT_SFIFO_OVER_MASK |
+                                       XEM_EIR_XMIT_LFIFO_OVER_MASK)) {
+               debug ("Transmitting overrun error\n");
+               return 0;
+       } else if (intrstatus & (XEM_EIR_XMIT_SFIFO_UNDER_MASK |
+                                       XEM_EIR_XMIT_LFIFO_UNDER_MASK)) {
+               debug ("Transmitting underrun error\n");
+               return 0;
+       }
+
+       /* Clear the interrupt status register of transmit statuses */
+       out_be32 ((emac.baseaddress) + XIIF_V123B_IISR_OFFSET,
+                               intrstatus & XEM_EIR_XMIT_ALL_MASK);
+
+       /*
+        * Collision errors are stored in the transmit status register
+        * instead of the interrupt status register
+        */
+       if ((xmitstatus & XEM_TSR_EXCESS_DEFERRAL_MASK) ||
+                               (xmitstatus & XEM_TSR_LATE_COLLISION_MASK)) {
+               debug ("Transmitting collision error\n");
+               return 0;
+       }
+       return 1;
+}
+
+int eth_rx(void)
+{
+       u32 pktlength;
+       u32 intrstatus;
+       u32 fifocount;
+       u32 wordcount;
+       u32 extrabytecount;
+       u32 lastword;
+       u8 *extrabytesbuffer;
+
+       if (in_be32 (emac.recvfifo.regbaseaddress + XPF_COUNT_STATUS_REG_OFFSET)
+                       & XPF_DEADLOCK_MASK) {
+               out_be32 (emac.recvfifo.regbaseaddress, XPF_RESET_FIFO_MASK);
+               debug ("Receiving FIFO deadlock\n");
+               return 0;
+       }
+
+       /*
+        * Get the interrupt status to know what happened (whether an error
+        * occurred and/or whether frames have been received successfully).
+        * When clearing the intr status register, clear only statuses that
+        * pertain to receive.
+        */
+       intrstatus = in_be32 ((emac.baseaddress) + XIIF_V123B_IISR_OFFSET);
+       /*
+        * Before reading from the length FIFO, make sure the length FIFO is not
+        * empty. We could cause an underrun error if we try to read from an
+        * empty FIFO.
+        */
+       if (!(intrstatus & XEM_EIR_RECV_DONE_MASK)) {
+               /* debug ("Receiving FIFO is empty\n"); */
+               return 0;
+       }
+
+       /*
+        * Determine, from the MAC, the length of the next packet available
+        * in the data FIFO (there should be a non-zero length here)
+        */
+       pktlength = in_be32 (emac.baseaddress + XEM_RPLR_OFFSET);
+       if (!pktlength) {
+               return 0;
+       }
+
+       /*
+        * Write the RECV_DONE bit in the status register to clear it. This bit
+        * indicates the RPLR is non-empty, and we know it's set at this point.
+        * We clear it so that subsequent entry into this routine will reflect
+        * the current status. This is done because the non-empty bit is latched
+        * in the IPIF, which means it may indicate a non-empty condition even
+        * though there is something in the FIFO.
+        */
+       out_be32 ((emac.baseaddress) + XIIF_V123B_IISR_OFFSET,
+                                               XEM_EIR_RECV_DONE_MASK);
+
+       fifocount = in_be32 (emac.recvfifo.regbaseaddress +
+                               XPF_COUNT_STATUS_REG_OFFSET) & XPF_COUNT_MASK;
+
+       if ((fifocount * 4) < pktlength) {
+               debug ("Receiving FIFO is smaller than packet size.\n");
+               return 0;
+       }
+
+       wordcount = pktlength >> 2;
+       extrabytecount = pktlength & 0x3;
+
+       for (fifocount = 0; fifocount < wordcount; fifocount++) {
+               etherrxbuff[fifocount] =
+                               in_be32 (emac.recvfifo.databaseaddress);
+       }
+
+       /*
+        * if there are extra bytes to handle, read the last word from the FIFO
+        * and insert the extra bytes into the buffer
+        */
+       if (extrabytecount > 0) {
+               extrabytesbuffer = (u8 *) (etherrxbuff + wordcount);
+
+               lastword = in_be32 (emac.recvfifo.databaseaddress);
+
+               /*
+                * one extra byte in the last word, put the byte into the next
+                * location of the buffer, bytes in a word of the FIFO are
+                * ordered from most significant byte to least
+                */
+               if (extrabytecount == 1) {
+                       extrabytesbuffer[0] = (u8) (lastword >> 24);
+               } else if (extrabytecount == 2) {
+                       extrabytesbuffer[0] = (u8) (lastword >> 24);
+                       extrabytesbuffer[1] = (u8) (lastword >> 16);
+               } else if (extrabytecount == 3) {
+                       extrabytesbuffer[0] = (u8) (lastword >> 24);
+                       extrabytesbuffer[1] = (u8) (lastword >> 16);
+                       extrabytesbuffer[2] = (u8) (lastword >> 8);
+               }
+       }
+       NetReceive((uchar *)etherrxbuff, pktlength);
+       return 1;
+}
diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c
new file mode 100644 (file)
index 0000000..9ba4096
--- /dev/null
@@ -0,0 +1,351 @@
+/******************************************************************************
+ *
+ * XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS"
+ * AS A COURTESY TO YOU, SOLELY FOR USE IN DEVELOPING PROGRAMS AND
+ * SOLUTIONS FOR XILINX DEVICES. BY PROVIDING THIS DESIGN, CODE,
+ * OR INFORMATION AS ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE,
+ * APPLICATION OR STANDARD, XILINX IS MAKING NO REPRESENTATION
+ * THAT THIS IMPLEMENTATION IS FREE FROM ANY CLAIMS OF INFRINGEMENT,
+ * AND YOU ARE RESPONSIBLE FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE
+ * FOR YOUR IMPLEMENTATION. XILINX EXPRESSLY DISCLAIMS ANY
+ * WARRANTY WHATSOEVER WITH RESPECT TO THE ADEQUACY OF THE
+ * IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OR
+ * REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE FROM CLAIMS OF
+ * INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE.
+ *
+ * (C) Copyright 2007-2008 Michal Simek
+ * Michal SIMEK <monstr@monstr.eu>
+ *
+ * (c) Copyright 2003 Xilinx Inc.
+ * All rights reserved.
+ *
+ ******************************************************************************/
+
+#include <common.h>
+#include <net.h>
+#include <config.h>
+#include <asm/io.h>
+
+#undef DEBUG
+
+#define ENET_MAX_MTU           PKTSIZE
+#define ENET_MAX_MTU_ALIGNED   PKTSIZE_ALIGN
+#define ENET_ADDR_LENGTH       6
+
+/* EmacLite constants */
+#define XEL_BUFFER_OFFSET      0x0800  /* Next buffer's offset */
+#define XEL_TPLR_OFFSET                0x07F4  /* Tx packet length */
+#define XEL_TSR_OFFSET         0x07FC  /* Tx status */
+#define XEL_RSR_OFFSET         0x17FC  /* Rx status */
+#define XEL_RXBUFF_OFFSET      0x1000  /* Receive Buffer */
+
+/* Xmit complete */
+#define XEL_TSR_XMIT_BUSY_MASK         0x00000001UL
+/* Xmit interrupt enable bit */
+#define XEL_TSR_XMIT_IE_MASK           0x00000008UL
+/* Buffer is active, SW bit only */
+#define XEL_TSR_XMIT_ACTIVE_MASK       0x80000000UL
+/* Program the MAC address */
+#define XEL_TSR_PROGRAM_MASK           0x00000002UL
+/* define for programming the MAC address into the EMAC Lite */
+#define XEL_TSR_PROG_MAC_ADDR  (XEL_TSR_XMIT_BUSY_MASK | XEL_TSR_PROGRAM_MASK)
+
+/* Transmit packet length upper byte */
+#define XEL_TPLR_LENGTH_MASK_HI                0x0000FF00UL
+/* Transmit packet length lower byte */
+#define XEL_TPLR_LENGTH_MASK_LO                0x000000FFUL
+
+/* Recv complete */
+#define XEL_RSR_RECV_DONE_MASK         0x00000001UL
+/* Recv interrupt enable bit */
+#define XEL_RSR_RECV_IE_MASK           0x00000008UL
+
+typedef struct {
+       unsigned int baseaddress;       /* Base address for device (IPIF) */
+       unsigned int nexttxbuffertouse; /* Next TX buffer to write to */
+       unsigned int nextrxbuffertouse; /* Next RX buffer to read from */
+       unsigned char deviceid;         /* Unique ID of device - for future */
+} xemaclite;
+
+static xemaclite emaclite;
+
+static char etherrxbuff[PKTSIZE_ALIGN/4]; /* Receive buffer */
+
+/* hardcoded MAC address for the Xilinx EMAC Core when env is nowhere*/
+#ifdef CFG_ENV_IS_NOWHERE
+static u8 emacaddr[ENET_ADDR_LENGTH] = { 0x00, 0x0a, 0x35, 0x00, 0x22, 0x01 };
+#else
+static u8 emacaddr[ENET_ADDR_LENGTH];
+#endif
+
+void xemaclite_alignedread (u32 * srcptr, void *destptr, unsigned bytecount)
+{
+       unsigned int i;
+       u32 alignbuffer;
+       u32 *to32ptr;
+       u32 *from32ptr;
+       u8 *to8ptr;
+       u8 *from8ptr;
+
+       from32ptr = (u32 *) srcptr;
+
+       /* Word aligned buffer, no correction needed. */
+       to32ptr = (u32 *) destptr;
+       while (bytecount > 3) {
+               *to32ptr++ = *from32ptr++;
+               bytecount -= 4;
+       }
+       to8ptr = (u8 *) to32ptr;
+
+       alignbuffer = *from32ptr++;
+       from8ptr = (u8 *) & alignbuffer;
+
+       for (i = 0; i < bytecount; i++) {
+               *to8ptr++ = *from8ptr++;
+       }
+}
+
+void xemaclite_alignedwrite (void *srcptr, u32 destptr, unsigned bytecount)
+{
+       unsigned i;
+       u32 alignbuffer;
+       u32 *to32ptr = (u32 *) destptr;
+       u32 *from32ptr;
+       u8 *to8ptr;
+       u8 *from8ptr;
+
+       from32ptr = (u32 *) srcptr;
+       while (bytecount > 3) {
+
+               *to32ptr++ = *from32ptr++;
+               bytecount -= 4;
+       }
+
+       alignbuffer = 0;
+       to8ptr = (u8 *) & alignbuffer;
+       from8ptr = (u8 *) from32ptr;
+
+       for (i = 0; i < bytecount; i++) {
+               *to8ptr++ = *from8ptr++;
+       }
+
+       *to32ptr++ = alignbuffer;
+}
+
+void eth_halt (void)
+{
+       debug ("eth_halt\n");
+}
+
+int eth_init (bd_t * bis)
+{
+       debug ("EmacLite Initialization Started\n");
+       memset (&emaclite, 0, sizeof (xemaclite));
+       emaclite.baseaddress = XILINX_EMACLITE_BASEADDR;
+
+       if (!getenv("ethaddr")) {
+               memcpy(bis->bi_enetaddr, emacaddr, ENET_ADDR_LENGTH);
+       }
+
+/*
+ * TX - TX_PING & TX_PONG initialization
+ */
+       /* Restart PING TX */
+       out_be32 (emaclite.baseaddress + XEL_TSR_OFFSET, 0);
+       /* Copy MAC address */
+       xemaclite_alignedwrite (bis->bi_enetaddr,
+               emaclite.baseaddress, ENET_ADDR_LENGTH);
+       /* Set the length */
+       out_be32 (emaclite.baseaddress + XEL_TPLR_OFFSET, ENET_ADDR_LENGTH);
+       /* Update the MAC address in the EMAC Lite */
+       out_be32 (emaclite.baseaddress + XEL_TSR_OFFSET, XEL_TSR_PROG_MAC_ADDR);
+       /* Wait for EMAC Lite to finish with the MAC address update */
+       while ((in_be32 (emaclite.baseaddress + XEL_TSR_OFFSET) &
+               XEL_TSR_PROG_MAC_ADDR) != 0) ;
+
+#ifdef CONFIG_XILINX_EMACLITE_TX_PING_PONG
+       /* The same operation with PONG TX */
+       out_be32 (emaclite.baseaddress + XEL_TSR_OFFSET + XEL_BUFFER_OFFSET, 0);
+       xemaclite_alignedwrite (bis->bi_enetaddr, emaclite.baseaddress +
+               XEL_BUFFER_OFFSET, ENET_ADDR_LENGTH);
+       out_be32 (emaclite.baseaddress + XEL_TPLR_OFFSET, ENET_ADDR_LENGTH);
+       out_be32 (emaclite.baseaddress + XEL_TSR_OFFSET + XEL_BUFFER_OFFSET,
+               XEL_TSR_PROG_MAC_ADDR);
+       while ((in_be32 (emaclite.baseaddress + XEL_TSR_OFFSET +
+               XEL_BUFFER_OFFSET) & XEL_TSR_PROG_MAC_ADDR) != 0) ;
+#endif
+
+/*
+ * RX - RX_PING & RX_PONG initialization
+ */
+       /* Write out the value to flush the RX buffer */
+       out_be32 (emaclite.baseaddress + XEL_RSR_OFFSET, XEL_RSR_RECV_IE_MASK);
+#ifdef CONFIG_XILINX_EMACLITE_RX_PING_PONG
+       out_be32 (emaclite.baseaddress + XEL_RSR_OFFSET + XEL_BUFFER_OFFSET,
+               XEL_RSR_RECV_IE_MASK);
+#endif
+
+       debug ("EmacLite Initialization complete\n");
+       return 0;
+}
+
+int xemaclite_txbufferavailable (xemaclite * instanceptr)
+{
+       u32 reg;
+       u32 txpingbusy;
+       u32 txpongbusy;
+       /*
+        * Read the other buffer register
+        * and determine if the other buffer is available
+        */
+       reg = in_be32 (instanceptr->baseaddress +
+                       instanceptr->nexttxbuffertouse + 0);
+       txpingbusy = ((reg & XEL_TSR_XMIT_BUSY_MASK) ==
+                       XEL_TSR_XMIT_BUSY_MASK);
+
+       reg = in_be32 (instanceptr->baseaddress +
+                       (instanceptr->nexttxbuffertouse ^ XEL_TSR_OFFSET) + 0);
+       txpongbusy = ((reg & XEL_TSR_XMIT_BUSY_MASK) ==
+                       XEL_TSR_XMIT_BUSY_MASK);
+
+       return (!(txpingbusy && txpongbusy));
+}
+
+int eth_send (volatile void *ptr, int len) {
+
+       unsigned int reg;
+       unsigned int baseaddress;
+
+       unsigned maxtry = 1000;
+
+       if (len > ENET_MAX_MTU)
+               len = ENET_MAX_MTU;
+
+       while (!xemaclite_txbufferavailable (&emaclite) && maxtry) {
+               udelay (10);
+               maxtry--;
+       }
+
+       if (!maxtry) {
+               printf ("Error: Timeout waiting for ethernet TX buffer\n");
+               /* Restart PING TX */
+               out_be32 (emaclite.baseaddress + XEL_TSR_OFFSET, 0);
+#ifdef CONFIG_XILINX_EMACLITE_TX_PING_PONG
+               out_be32 (emaclite.baseaddress + XEL_TSR_OFFSET +
+               XEL_BUFFER_OFFSET, 0);
+#endif
+               return 0;
+       }
+
+       /* Determine the expected TX buffer address */
+       baseaddress = (emaclite.baseaddress + emaclite.nexttxbuffertouse);
+
+       /* Determine if the expected buffer address is empty */
+       reg = in_be32 (baseaddress + XEL_TSR_OFFSET);
+       if (((reg & XEL_TSR_XMIT_BUSY_MASK) == 0)
+               && ((in_be32 ((baseaddress) + XEL_TSR_OFFSET)
+                       & XEL_TSR_XMIT_ACTIVE_MASK) == 0)) {
+
+#ifdef CONFIG_XILINX_EMACLITE_TX_PING_PONG
+               emaclite.nexttxbuffertouse ^= XEL_BUFFER_OFFSET;
+#endif
+               debug ("Send packet from 0x%x\n", baseaddress);
+               /* Write the frame to the buffer */
+               xemaclite_alignedwrite ((void *) ptr, baseaddress, len);
+               out_be32 (baseaddress + XEL_TPLR_OFFSET,(len &
+                       (XEL_TPLR_LENGTH_MASK_HI | XEL_TPLR_LENGTH_MASK_LO)));
+               reg = in_be32 (baseaddress + XEL_TSR_OFFSET);
+               reg |= XEL_TSR_XMIT_BUSY_MASK;
+               if ((reg & XEL_TSR_XMIT_IE_MASK) != 0) {
+                       reg |= XEL_TSR_XMIT_ACTIVE_MASK;
+               }
+               out_be32 (baseaddress + XEL_TSR_OFFSET, reg);
+               return 1;
+       }
+#ifdef CONFIG_XILINX_EMACLITE_TX_PING_PONG
+       /* Switch to second buffer */
+       baseaddress ^= XEL_BUFFER_OFFSET;
+       /* Determine if the expected buffer address is empty */
+       reg = in_be32 (baseaddress + XEL_TSR_OFFSET);
+       if (((reg & XEL_TSR_XMIT_BUSY_MASK) == 0)
+               && ((in_be32 ((baseaddress) + XEL_TSR_OFFSET)
+                       & XEL_TSR_XMIT_ACTIVE_MASK) == 0)) {
+               debug ("Send packet from 0x%x\n", baseaddress);
+               /* Write the frame to the buffer */
+               xemaclite_alignedwrite ((void *) ptr, baseaddress, len);
+               out_be32 (baseaddress + XEL_TPLR_OFFSET,(len &
+                       (XEL_TPLR_LENGTH_MASK_HI | XEL_TPLR_LENGTH_MASK_LO)));
+               reg = in_be32 (baseaddress + XEL_TSR_OFFSET);
+               reg |= XEL_TSR_XMIT_BUSY_MASK;
+               if ((reg & XEL_TSR_XMIT_IE_MASK) != 0) {
+                       reg |= XEL_TSR_XMIT_ACTIVE_MASK;
+               }
+               out_be32 (baseaddress + XEL_TSR_OFFSET, reg);
+               return 1;
+       }
+#endif
+       puts ("Error while sending frame\n");
+       return 0;
+}
+
+int eth_rx (void)
+{
+       unsigned int length;
+       unsigned int reg;
+       unsigned int baseaddress;
+
+       baseaddress = emaclite.baseaddress + emaclite.nextrxbuffertouse;
+       reg = in_be32 (baseaddress + XEL_RSR_OFFSET);
+       debug ("Testing data at address 0x%x\n", baseaddress);
+       if ((reg & XEL_RSR_RECV_DONE_MASK) == XEL_RSR_RECV_DONE_MASK) {
+#ifdef CONFIG_XILINX_EMACLITE_RX_PING_PONG
+               emaclite.nextrxbuffertouse ^= XEL_BUFFER_OFFSET;
+#endif
+       } else {
+#ifndef CONFIG_XILINX_EMACLITE_RX_PING_PONG
+               debug ("No data was available - address 0x%x\n", baseaddress);
+               return 0;
+#else
+               baseaddress ^= XEL_BUFFER_OFFSET;
+               reg = in_be32 (baseaddress + XEL_RSR_OFFSET);
+               if ((reg & XEL_RSR_RECV_DONE_MASK) !=
+                                       XEL_RSR_RECV_DONE_MASK) {
+                       debug ("No data was available - address 0x%x\n",
+                                       baseaddress);
+                       return 0;
+               }
+#endif
+       }
+       /* Get the length of the frame that arrived */
+       switch(((in_be32 (baseaddress + XEL_RXBUFF_OFFSET + 0xC)) &
+                       0xFFFF0000 ) >> 16) {
+               case 0x806:
+                       length = 42 + 20; /* FIXME size of ARP */
+                       debug ("ARP Packet\n");
+                       break;
+               case 0x800:
+                       length = 14 + 14 +
+                       (((in_be32 (baseaddress + XEL_RXBUFF_OFFSET + 0x10)) &
+                       0xFFFF0000) >> 16); /* FIXME size of IP packet */
+                       debug ("IP Packet\n");
+                       break;
+               default:
+                       debug ("Other Packet\n");
+                       length = ENET_MAX_MTU;
+                       break;
+       }
+
+       xemaclite_alignedread ((u32 *) (baseaddress + XEL_RXBUFF_OFFSET),
+                       etherrxbuff, length);
+
+       /* Acknowledge the frame */
+       reg = in_be32 (baseaddress + XEL_RSR_OFFSET);
+       reg &= ~XEL_RSR_RECV_DONE_MASK;
+       out_be32 (baseaddress + XEL_RSR_OFFSET, reg);
+
+       debug ("Packet receive from 0x%x, length %dB\n", baseaddress, length);
+       NetReceive ((uchar *) etherrxbuff, length);
+       return 1;
+
+}
index fe45839..ad1b7dd 100644 (file)
@@ -31,6 +31,9 @@ COBJS-y += pci_auto.o
 COBJS-y += pci_indirect.o
 COBJS-y += tsi108_pci.o
 COBJS-y += w83c553f.o
+COBJS-$(CONFIG_SH4_PCI) += pci_sh4.o
+COBJS-$(CONFIG_SH7751_PCI) +=pci_sh7751.o
+COBJS-$(CONFIG_SH7780_PCI) +=pci_sh7780.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
index 68e45e1..7dc33be 100644 (file)
@@ -182,7 +182,8 @@ fsl_pci_init(struct pci_controller *hose)
 
        /* Clear all error indications */
 
-       pci->pme_msg_det = 0xffffffff;
+       if (bridge)
+               pci->pme_msg_det = 0xffffffff;
        pci->pedr = 0xffffffff;
 
        pci_hose_read_config_word (hose, dev, PCI_DSR, &temp16);
index 50ca6b0..7944b66 100644 (file)
@@ -425,6 +425,9 @@ int pci_hose_scan_bus(struct pci_controller *hose, int bus)
             dev <  PCI_BDF(bus,PCI_MAX_PCI_DEVICES-1,PCI_MAX_PCI_FUNCTIONS-1);
             dev += PCI_BDF(0,0,1))
        {
+
+       /* Bus 0 is not necessarily PCI bridge. */
+#if defined(CONFIG_PCI_SKIP_HOST_BRIDGE)
                /* Skip our host bridge */
                if ( dev == PCI_BDF(hose->first_busno,0,0) ) {
 #if defined(CONFIG_PCI_CONFIG_HOST_BRIDGE)              /* don't skip host bridge */
@@ -434,10 +437,11 @@ int pci_hose_scan_bus(struct pci_controller *hose, int bus)
                        if (getenv("pciconfighost") == NULL) {
                                continue; /* Skip our host bridge */
                        }
-#else
+#else /* CONFIG_PCI_CONFIG_HOST_BRIDGE */
                        continue; /* Skip our host bridge */
-#endif
+#endif /* CONFIG_PCI_CONFIG_HOST_BRIDGE */
                }
+#endif /* CONFIG_PCI_SKIP_HOST_BRIDGE */
 
                if (PCI_FUNC(dev) && !found_multi)
                        continue;
@@ -473,8 +477,11 @@ int pci_hose_scan_bus(struct pci_controller *hose, int bus)
                                hose->fixup_irq(hose, dev);
 
 #ifdef CONFIG_PCI_SCAN_SHOW
+#if defined(CONFIG_PCI_SKIP_HOST_BRIDGE)
                        /* Skip our host bridge */
-                       if ( dev != PCI_BDF(hose->first_busno,0,0) ) {
+                       if ( dev != PCI_BDF(hose->first_busno,0,0) )
+#endif
+                       {
                            unsigned char int_line;
 
                            pci_hose_read_config_byte(hose, dev, PCI_INTERRUPT_LINE,
index acfda83..eb69593 100644 (file)
@@ -383,7 +383,7 @@ int pciauto_config_device(struct pci_controller *hose, pci_dev_t dev)
                hose->current_busno++;
                break;
 
-#ifdef CONFIG_MPC5200
+#if defined(CONFIG_PCIAUTO_SKIP_HOST_BRIDGE)
        case PCI_CLASS_BRIDGE_OTHER:
                DEBUGF("PCI Autoconfig: Skipping bridge device %d\n",
                       PCI_DEV(dev));
diff --git a/drivers/pci/pci_sh4.c b/drivers/pci/pci_sh4.c
new file mode 100644 (file)
index 0000000..1290c0a
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * SH4 PCI Controller (PCIC) for U-Boot.
+ * (C) Dustin McIntire (dustin@sensoria.com)
+ * (C) 2007,2008 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+ * (C) 2008 Yusuke Goda <goda.yusuke@renesas.com>
+ *
+ * u-boot/cpu/sh4/pci-sh4.c
+ *
+ * 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/processor.h>
+#include <asm/io.h>
+#include <asm/pci.h>
+#include <pci.h>
+
+int pci_sh4_init(struct pci_controller *hose)
+{
+       hose->first_busno = 0;
+       hose->region_count = 0;
+       hose->last_busno = 0xff;
+
+       /* PCI memory space */
+       pci_set_region(hose->regions + 0,
+               CONFIG_PCI_MEM_BUS,
+               CONFIG_PCI_MEM_PHYS,
+               CONFIG_PCI_MEM_SIZE,
+               PCI_REGION_MEM);
+       hose->region_count++;
+
+       /* PCI IO space */
+       pci_set_region(hose->regions + 1,
+               CONFIG_PCI_IO_BUS,
+               CONFIG_PCI_IO_PHYS,
+               CONFIG_PCI_IO_SIZE,
+               PCI_REGION_IO);
+       hose->region_count++;
+
+       udelay(1000);
+
+       pci_set_ops(hose,
+                   pci_hose_read_config_byte_via_dword,
+                   pci_hose_read_config_word_via_dword,
+                   pci_sh4_read_config_dword,
+                   pci_hose_write_config_byte_via_dword,
+                   pci_hose_write_config_word_via_dword,
+                   pci_sh4_write_config_dword);
+
+       pci_register_hose(hose);
+
+       udelay(1000);
+
+#ifdef CONFIG_PCI_SCAN_SHOW
+       printf("PCI:   Bus Dev VenId DevId Class Int\n");
+#endif
+       hose->last_busno = pci_hose_scan(hose);
+       return 0;
+}
diff --git a/drivers/pci/pci_sh7751.c b/drivers/pci/pci_sh7751.c
new file mode 100644 (file)
index 0000000..a058e1d
--- /dev/null
@@ -0,0 +1,199 @@
+/*
+ * SH7751 PCI Controller (PCIC) for U-Boot.
+ * (C) Dustin McIntire (dustin@sensoria.com)
+ * (C) 2007,2008 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+ *
+ * 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/processor.h>
+#include <asm/io.h>
+#include <pci.h>
+
+/* Register addresses and such */
+#define SH7751_BCR1    (vu_long *)0xFF800000
+#define SH7751_BCR2    (vu_short*)0xFF800004
+#define SH7751_WCR1    (vu_long *)0xFF800008
+#define SH7751_WCR2    (vu_long *)0xFF80000C
+#define SH7751_WCR3    (vu_long *)0xFF800010
+#define SH7751_MCR     (vu_long *)0xFF800014
+#define SH7751_BCR3    (vu_short*)0xFF800050
+#define SH7751_PCICONF0 (vu_long *)0xFE200000
+#define SH7751_PCICONF1 (vu_long *)0xFE200004
+#define SH7751_PCICONF2 (vu_long *)0xFE200008
+#define SH7751_PCICONF3 (vu_long *)0xFE20000C
+#define SH7751_PCICONF4 (vu_long *)0xFE200010
+#define SH7751_PCICONF5 (vu_long *)0xFE200014
+#define SH7751_PCICONF6 (vu_long *)0xFE200018
+#define SH7751_PCICR    (vu_long *)0xFE200100
+#define SH7751_PCILSR0  (vu_long *)0xFE200104
+#define SH7751_PCILSR1  (vu_long *)0xFE200108
+#define SH7751_PCILAR0  (vu_long *)0xFE20010C
+#define SH7751_PCILAR1  (vu_long *)0xFE200110
+#define SH7751_PCIMBR   (vu_long *)0xFE2001C4
+#define SH7751_PCIIOBR  (vu_long *)0xFE2001C8
+#define SH7751_PCIPINT  (vu_long *)0xFE2001CC
+#define SH7751_PCIPINTM (vu_long *)0xFE2001D0
+#define SH7751_PCICLKR  (vu_long *)0xFE2001D4
+#define SH7751_PCIBCR1  (vu_long *)0xFE2001E0
+#define SH7751_PCIBCR2  (vu_long *)0xFE2001E4
+#define SH7751_PCIWCR1  (vu_long *)0xFE2001E8
+#define SH7751_PCIWCR2  (vu_long *)0xFE2001EC
+#define SH7751_PCIWCR3  (vu_long *)0xFE2001F0
+#define SH7751_PCIMCR   (vu_long *)0xFE2001F4
+#define SH7751_PCIBCR3  (vu_long *)0xFE2001F8
+
+#define BCR1_BREQEN                            0x00080000
+#define PCI_SH7751_ID                  0x35051054
+#define PCI_SH7751R_ID                 0x350E1054
+#define SH7751_PCICONF1_WCC            0x00000080
+#define SH7751_PCICONF1_PER            0x00000040
+#define SH7751_PCICONF1_BUM            0x00000004
+#define SH7751_PCICONF1_MES            0x00000002
+#define SH7751_PCICONF1_CMDS   0x000000C6
+#define SH7751_PCI_HOST_BRIDGE 0x6
+#define SH7751_PCICR_PREFIX            0xa5000000
+#define SH7751_PCICR_PRST              0x00000002
+#define SH7751_PCICR_CFIN              0x00000001
+#define SH7751_PCIPINT_D3              0x00000002
+#define SH7751_PCIPINT_D0              0x00000001
+#define SH7751_PCICLKR_PREFIX   0xa5000000
+
+#define SH7751_PCI_MEM_BASE            0xFD000000
+#define SH7751_PCI_MEM_SIZE            0x01000000
+#define SH7751_PCI_IO_BASE             0xFE240000
+#define SH7751_PCI_IO_SIZE             0x00040000
+
+#define SH7751_CS3_BASE_ADDR    0x0C000000
+#define SH7751_P2CS3_BASE_ADDR  0xAC000000
+
+#define SH7751_PCIPAR   (vu_long *)0xFE2001C0
+#define SH7751_PCIPDR   (vu_long *)0xFE200220
+
+#define p4_in(addr)     *(addr)
+#define p4_out(data,addr) *(addr) = (data)
+
+/* Double word */
+int pci_sh4_read_config_dword(struct pci_controller *hose,
+                             pci_dev_t dev, int offset, u32 * value)
+{
+       u32 par_data = 0x80000000 | dev;
+
+       p4_out(par_data | (offset & 0xfc), SH7751_PCIPAR);
+       *value = p4_in(SH7751_PCIPDR);
+
+       return 0;
+}
+
+int pci_sh4_write_config_dword(struct pci_controller *hose,
+                              pci_dev_t dev, int offset, u32 * value)
+{
+       u32 par_data = 0x80000000 | dev;
+
+       p4_out(par_data | (offset & 0xfc), SH7751_PCIPAR);
+       p4_out(value, SH7751_PCIPDR);
+
+       return 0;
+}
+
+int pci_sh7751_init(struct pci_controller *hose)
+{
+       /* Double-check that we're a 7751 or 7751R chip */
+       if (p4_in(SH7751_PCICONF0) != PCI_SH7751_ID
+           && p4_in(SH7751_PCICONF0) != PCI_SH7751R_ID) {
+               printf("PCI: Unknown PCI host bridge.\n");
+               return 1;
+       }
+       printf("PCI: SH7751 PCI host bridge found.\n");
+
+       /* Double-check some BSC config settings */
+       /* (Area 3 non-MPX 32-bit, PCI bus pins) */
+       if ((p4_in(SH7751_BCR1) & 0x20008) == 0x20000) {
+               printf("SH7751_BCR1 0x%08X\n", p4_in(SH7751_BCR1));
+               return 2;
+       }
+       if ((p4_in(SH7751_BCR2) & 0xC0) != 0xC0) {
+               printf("SH7751_BCR2 0x%08X\n", p4_in(SH7751_BCR2));
+               return 3;
+       }
+       if (p4_in(SH7751_BCR2) & 0x01) {
+               printf("SH7751_BCR2 0x%08X\n", p4_in(SH7751_BCR2));
+               return 4;
+       }
+
+       /* Force BREQEN in BCR1 to allow PCIC access */
+       p4_out((p4_in(SH7751_BCR1) | BCR1_BREQEN), SH7751_BCR1);
+
+       /* Toggle PCI reset pin */
+       p4_out((SH7751_PCICR_PREFIX | SH7751_PCICR_PRST), SH7751_PCICR);
+       udelay(32);
+       p4_out(SH7751_PCICR_PREFIX, SH7751_PCICR);
+
+       /* Set cmd bits: WCC, PER, BUM, MES */
+       /* (Addr/Data stepping, Parity enabled, Bus Master, Memory enabled) */
+       p4_out(0xfb900047, SH7751_PCICONF1);    /* K.Kino */
+
+       /* Define this host as the host bridge */
+       p4_out((SH7751_PCI_HOST_BRIDGE << 24), SH7751_PCICONF2);
+
+       /* Force PCI clock(s) on */
+       p4_out(0, SH7751_PCICLKR);
+       p4_out(0x03, SH7751_PCICLKR);
+
+       /* Clear powerdown IRQs, also mask them (unused) */
+       p4_out((SH7751_PCIPINT_D0 | SH7751_PCIPINT_D3), SH7751_PCIPINT);
+       p4_out(0, SH7751_PCIPINTM);
+
+       p4_out(0xab000001, SH7751_PCICONF4);
+
+       /* Set up target memory mappings (for external DMA access) */
+       /* Map both P0 and P2 range to Area 3 RAM for ease of use */
+       p4_out((64 - 1) << 20, SH7751_PCILSR0);
+       p4_out(SH7751_CS3_BASE_ADDR, SH7751_PCILAR0);
+       p4_out(0, SH7751_PCILSR1);
+       p4_out(0, SH7751_PCILAR1);
+       p4_out(SH7751_CS3_BASE_ADDR, SH7751_PCICONF5);
+       p4_out(0xd0000000, SH7751_PCICONF6);
+
+       /* Map memory window to same address on PCI bus */
+       p4_out(SH7751_PCI_MEM_BASE, SH7751_PCIMBR);
+
+       /* Map IO window to same address on PCI bus */
+       p4_out(0x2000 & 0xfffc0000, SH7751_PCIIOBR);
+
+       /* set BREQEN */
+       p4_out(inl(SH7751_BCR1) | 0x00080000, SH7751_BCR1);
+
+       /* Copy BSC registers into PCI BSC */
+       p4_out(inl(SH7751_BCR1), SH7751_PCIBCR1);
+       p4_out(inl(SH7751_BCR2), SH7751_PCIBCR2);
+       p4_out(inl(SH7751_BCR3), SH7751_PCIBCR3);
+       p4_out(inl(SH7751_WCR1), SH7751_PCIWCR1);
+       p4_out(inl(SH7751_WCR2), SH7751_PCIWCR2);
+       p4_out(inl(SH7751_WCR3), SH7751_PCIWCR3);
+       p4_out(inl(SH7751_MCR), SH7751_PCIMCR);
+
+       /* Finally, set central function init complete */
+       p4_out((SH7751_PCICR_PREFIX | SH7751_PCICR_CFIN), SH7751_PCICR);
+
+       pci_sh4_init(hose);
+
+       return 0;
+}
diff --git a/drivers/pci/pci_sh7780.c b/drivers/pci/pci_sh7780.c
new file mode 100644 (file)
index 0000000..d63d67d
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ * SH7780 PCI Controller (PCIC) for U-Boot.
+ * (C) Dustin McIntire (dustin@sensoria.com)
+ * (C) 2007,2008 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+ * (C) 2008 Yusuke Goda <goda.yusuke@renesas.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/processor.h>
+#include <asm/io.h>
+#include <pci.h>
+
+#define SH7780_VENDOR_ID       0x1912
+#define SH7780_DEVICE_ID       0x0002
+#define SH7780_PCICR_PREFIX    0xA5000000
+#define SH7780_PCICR_PFCS      0x00000800
+#define SH7780_PCICR_FTO       0x00000400
+#define SH7780_PCICR_PFE       0x00000200
+#define SH7780_PCICR_TBS       0x00000100
+#define SH7780_PCICR_ARBM      0x00000040
+#define SH7780_PCICR_IOCS      0x00000004
+#define SH7780_PCICR_PRST      0x00000002
+#define SH7780_PCICR_CFIN      0x00000001
+
+#define p4_in(addr)                    *((vu_long *)addr)
+#define p4_out(data,addr)      *(vu_long *)(addr) = (data)
+#define p4_inw(addr)           *((vu_short *)addr)
+#define p4_outw(data,addr)     *(vu_short *)(addr) = (data)
+
+int pci_sh4_read_config_dword(struct pci_controller *hose,
+                                   pci_dev_t dev, int offset, u32 *value)
+{
+       u32 par_data = 0x80000000 | dev;
+
+       p4_out(par_data | (offset & 0xfc), SH7780_PCIPAR);
+       *value = p4_in(SH7780_PCIPDR);
+
+       return 0;
+}
+
+int pci_sh4_write_config_dword(struct pci_controller *hose,
+                                    pci_dev_t dev, int offset, u32 value)
+{
+       u32 par_data = 0x80000000 | dev;
+
+       p4_out(par_data | (offset & 0xfc), SH7780_PCIPAR);
+       p4_out(value, SH7780_PCIPDR);
+       return 0;
+}
+
+int pci_sh7780_init(struct pci_controller *hose)
+{
+       p4_out(0x01, SH7780_PCIECR);
+
+       if (p4_inw(SH7780_PCIVID) != SH7780_VENDOR_ID
+           && p4_inw(SH7780_PCIDID) != SH7780_DEVICE_ID){
+               printf("PCI: Unknown PCI host bridge.\n");
+               return;
+       }
+       printf("PCI: SH7780 PCI host bridge found.\n");
+
+       /* Toggle PCI reset pin */
+       p4_out((SH7780_PCICR_PREFIX | SH7780_PCICR_PRST), SH7780_PCICR);
+       udelay(100000);
+       p4_out(SH7780_PCICR_PREFIX, SH7780_PCICR);
+       p4_outw(0x0047, SH7780_PCICMD);
+
+       p4_out(0x07F00001, SH7780_PCILSR0);
+       p4_out(0x08000000, SH7780_PCILAR0);
+       p4_out(0x00000000, SH7780_PCILSR1);
+       p4_out(0, SH7780_PCILAR1);
+       p4_out(0x08000000, SH7780_PCIMBAR0);
+       p4_out(0x00000000, SH7780_PCIMBAR1);
+
+       p4_out(0xFD000000, SH7780_PCIMBR0);
+       p4_out(0x00FC0000, SH7780_PCIMBMR0);
+
+       /* if use Operand Cache then enable PCICSCR Soonp bits. */
+       p4_out(0x08000000, SH7780_PCICSAR0);
+       p4_out(0x0000001B, SH7780_PCICSCR0);    /* Snoop bit :On */
+
+       p4_out((SH7780_PCICR_PREFIX | SH7780_PCICR_CFIN | SH7780_PCICR_ARBM
+             | SH7780_PCICR_FTO | SH7780_PCICR_PFCS | SH7780_PCICR_PFE),
+            SH7780_PCICR);
+
+       pci_sh4_init(hose);
+       return 0;
+}
index 55f37cb..d34430c 100644 (file)
@@ -417,6 +417,7 @@ static int uec_set_mac_if_mode(uec_private_t *uec, enet_interface_e if_mode)
                        maccfg2 |= MACCFG2_INTERFACE_MODE_BYTE;
                        upsmr |= (UPSMR_RPM | UPSMR_TBIM);
                        break;
+               case ENET_1000_RGMII_RXID:
                case ENET_1000_RGMII:
                        maccfg2 |= MACCFG2_INTERFACE_MODE_BYTE;
                        upsmr |= UPSMR_RPM;
index c384055..7762de6 100644 (file)
@@ -642,6 +642,7 @@ typedef enum enet_interface {
        ENET_100_RGMII,
        ENET_1000_GMII,
        ENET_1000_RGMII,
+       ENET_1000_RGMII_RXID,
        ENET_1000_TBI,
        ENET_1000_RTBI
 } enet_interface_e;
index a42701c..423ba78 100644 (file)
@@ -318,16 +318,26 @@ static int genmii_read_status (struct uec_mii_info *mii_info)
                return err;
 
        if (mii_info->autoneg) {
-               status = phy_read (mii_info, PHY_ANLPAR);
+               status = phy_read(mii_info, MII_1000BASETSTATUS);
 
-               if (status & (PHY_ANLPAR_10FD | PHY_ANLPAR_TXFD))
-                       mii_info->duplex = DUPLEX_FULL;
-               else
-                       mii_info->duplex = DUPLEX_HALF;
-               if (status & (PHY_ANLPAR_TXFD | PHY_ANLPAR_TX))
-                       mii_info->speed = SPEED_100;
-               else
-                       mii_info->speed = SPEED_10;
+               if (status & (LPA_1000FULL | LPA_1000HALF)) {
+                       mii_info->speed = SPEED_1000;
+                       if (status & LPA_1000FULL)
+                               mii_info->duplex = DUPLEX_FULL;
+                       else
+                               mii_info->duplex = DUPLEX_HALF;
+               } else {
+                       status = phy_read(mii_info, PHY_ANLPAR);
+
+                       if (status & (PHY_ANLPAR_10FD | PHY_ANLPAR_TXFD))
+                               mii_info->duplex = DUPLEX_FULL;
+                       else
+                               mii_info->duplex = DUPLEX_HALF;
+                       if (status & (PHY_ANLPAR_TXFD | PHY_ANLPAR_TX))
+                               mii_info->speed = SPEED_100;
+                       else
+                               mii_info->speed = SPEED_10;
+               }
                mii_info->pause = 0;
        }
        /* On non-aneg, we assume what we put in BMCR is the speed,
@@ -337,6 +347,37 @@ static int genmii_read_status (struct uec_mii_info *mii_info)
        return 0;
 }
 
+static int bcm_init(struct uec_mii_info *mii_info)
+{
+       struct eth_device *edev = mii_info->dev;
+       uec_private_t *uec = edev->priv;
+
+       gbit_config_aneg(mii_info);
+
+       if (uec->uec_info->enet_interface == ENET_1000_RGMII_RXID) {
+               u16 val;
+               int cnt = 50;
+
+               /* Wait for aneg to complete. */
+               do
+                       val = phy_read(mii_info, PHY_BMSR);
+               while (--cnt && !(val & PHY_BMSR_AUTN_COMP));
+
+               /* Set RDX clk delay. */
+               phy_write(mii_info, 0x18, 0x7 | (7 << 12));
+
+               val = 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);
+       }
+
+        return 0;
+}
+
 static int marvell_read_status (struct uec_mii_info *mii_info)
 {
        u16 status;
@@ -505,6 +546,15 @@ static struct phy_info phy_info_marvell = {
        .config_intr = &marvell_config_intr,
 };
 
+static struct phy_info phy_info_bcm5481 = {
+       .phy_id = 0x0143bca0,
+       .phy_id_mask = 0xffffff0,
+       .name = "Broadcom 5481",
+       .features = MII_GBIT_FEATURES,
+       .read_status = genmii_read_status,
+       .init = bcm_init,
+};
+
 static struct phy_info phy_info_genmii = {
        .phy_id = 0x00000000,
        .phy_id_mask = 0x00000000,
@@ -518,6 +568,7 @@ static struct phy_info *phy_info[] = {
        &phy_info_dm9161,
        &phy_info_dm9161a,
        &phy_info_marvell,
+       &phy_info_bcm5481,
        &phy_info_genmii,
        NULL
 };
index e59a940..6f769fb 100644 (file)
 #define MII_1000BASETCONTROL_FULLDUPLEXCAP    0x0200
 #define MII_1000BASETCONTROL_HALFDUPLEXCAP    0x0100
 
+/* 1000BT status */
+#define MII_1000BASETSTATUS    0x0a
+#define LPA_1000FULL           0x0400
+#define LPA_1000HALF           0x0200
+
 /* Cicada Extended Control Register 1 */
 #define MII_CIS8201_EXT_CON1       0x17
 #define MII_CIS8201_EXTCON1_INIT    0x0000
index 9be2130..2e0c118 100644 (file)
@@ -43,9 +43,9 @@ COBJS-$(CONFIG_RTC_ISL1208) += isl1208.o
 COBJS-y += m41t11.o
 COBJS-y += m41t60.o
 COBJS-$(CONFIG_RTC_M41T62) += m41t62.o
-COBJS-y += max6900.o
 COBJS-y += m48t35ax.o
 COBJS-y += max6900.o
+COBJS-$(CONFIG_RTC_MC13783) += mc13783-rtc.o
 COBJS-y += mc146818.o
 COBJS-y += mcfrtc.o
 COBJS-y += mk48t59.o
index 5755a20..ce4f171 100644 (file)
@@ -85,7 +85,7 @@ void rtc_set(struct rtc_time *tmp)
 }
 
 /* Read the time from the RTC_STAT. time_in_seconds is seconds since Jan 1970 */
-void rtc_get(struct rtc_time *tmp)
+int rtc_get(struct rtc_time *tmp)
 {
        uint32_t cur_rtc_stat;
        int time_in_sec;
@@ -95,7 +95,7 @@ void rtc_get(struct rtc_time *tmp)
 
        if (tmp == NULL) {
                puts("Error getting the date/time\n");
-               return;
+               return -1;
        }
 
        wait_for_complete();
@@ -112,6 +112,8 @@ void rtc_get(struct rtc_time *tmp)
        /* Calculate the total number of seconds since epoch */
        time_in_sec = (tm_sec) + MIN_TO_SECS(tm_min) + HRS_TO_SECS(tm_hr) + DAYS_TO_SECS(tm_day);
        to_tm(time_in_sec, tmp);
+
+       return 0;
 }
 
 #endif
index 84fecf0..57a446d 100644 (file)
@@ -88,7 +88,7 @@ static unsigned char bin2bcd (unsigned int n)
 
 /* ------------------------------------------------------------------------- */
 
-void rtc_get (struct rtc_time *tmp)
+int rtc_get (struct rtc_time *tmp)
 {
        uchar sec, min, hour, mday, wday, mon, year;
 
@@ -150,6 +150,8 @@ else
                tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
                tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
 #endif
+
+       return 0;
 }
 
 void rtc_set (struct rtc_time *tmp)
index 55af130..3a856c8 100644 (file)
@@ -253,9 +253,10 @@ rtc_reset(void)
        /* TODO */
 }
 
-void
+int
 rtc_get(struct rtc_time *tmp)
 {
+       int rel = 0;
        struct ds1302_st bbclk;
 
        if(!ds1302_initted) rtc_init();
@@ -265,6 +266,7 @@ rtc_get(struct rtc_time *tmp)
        if (bbclk.CH) {
                printf("ds1302: rtc_get: Clock was halted, clock probably "
                        "corrupt\n");
+               rel = -1;
        }
 
        tmp->tm_sec=10*bbclk.sec10+bbclk.sec;
@@ -281,6 +283,8 @@ rtc_get(struct rtc_time *tmp)
        DPRINTF("Get DATE: %4d-%02d-%02d (wday=%d)  TIME: %2d:%02d:%02d\n",
                tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
                tmp->tm_hour, tmp->tm_min, tmp->tm_sec );
+
+       return rel;
 }
 
 void
index 89e433d..1c8ac7f 100644 (file)
@@ -91,7 +91,7 @@ static void init_spi (void);
 /* ------------------------------------------------------------------------- */
 
 /* read clock time from DS1306 and return it in *tmp */
-void rtc_get (struct rtc_time *tmp)
+int rtc_get (struct rtc_time *tmp)
 {
        volatile immap_t *immap = (immap_t *) CFG_IMMR;
        unsigned char spi_byte; /* Data Byte */
@@ -141,6 +141,8 @@ void rtc_get (struct rtc_time *tmp)
        debug ("Get DATE: %4d-%02d-%02d (wday=%d)  TIME: %2d:%02d:%02d\n",
               tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
               tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
+
+       return 0;
 }
 
 /* ------------------------------------------------------------------------- */
@@ -304,7 +306,7 @@ static unsigned char rtc_read (unsigned char reg);
 static void rtc_write (unsigned char reg, unsigned char val);
 
 /* read clock time from DS1306 and return it in *tmp */
-void rtc_get (struct rtc_time *tmp)
+int rtc_get (struct rtc_time *tmp)
 {
        unsigned char sec, min, hour, mday, wday, mon, year;
 
@@ -349,6 +351,8 @@ void rtc_get (struct rtc_time *tmp)
        debug ("Get DATE: %4d-%02d-%02d (wday=%d)  TIME: %2d:%02d:%02d\n",
               tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
               tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
+
+       return 0;
 }
 
 /* ------------------------------------------------------------------------- */
index c882d79..b20f193 100644 (file)
@@ -83,8 +83,9 @@ static unsigned bcd2bin (uchar c);
 /*
  * Get the current time from the RTC
  */
-void rtc_get (struct rtc_time *tmp)
+int rtc_get (struct rtc_time *tmp)
 {
+       int rel = 0;
        uchar sec, min, hour, mday, wday, mon, year;
 
        sec = rtc_read (RTC_SEC_REG_ADDR);
@@ -104,6 +105,7 @@ void rtc_get (struct rtc_time *tmp)
                /* clear the CH flag */
                rtc_write (RTC_SEC_REG_ADDR,
                           rtc_read (RTC_SEC_REG_ADDR) & ~RTC_SEC_BIT_CH);
+               rel = -1;
        }
 
        tmp->tm_sec  = bcd2bin (sec & 0x7F);
@@ -119,6 +121,8 @@ void rtc_get (struct rtc_time *tmp)
        DEBUGR ("Get DATE: %4d-%02d-%02d (wday=%d)  TIME: %2d:%02d:%02d\n",
                tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
                tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
+
+       return rel;
 }
 
 
index c636ac5..e908749 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2001, 2002
+ * (C) Copyright 2001-2008
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  * Keith Outwater, keith_outwater@mvis.com`
  *
 /*
  * RTC control register bits
  */
-#define RTC_CTL_BIT_A1IE       0x1     /* Alarm 1 interrupt enable     */
-#define RTC_CTL_BIT_A2IE       0x2     /* Alarm 2 interrupt enable     */
-#define RTC_CTL_BIT_INTCN      0x4     /* Interrupt control            */
-#define RTC_CTL_BIT_RS1                0x8     /* Rate select 1                */
-#define RTC_CTL_BIT_RS2                0x10    /* Rate select 2                */
-#define RTC_CTL_BIT_DOSC       0x80    /* Disable Oscillator           */
+#define RTC_CTL_BIT_A1IE       0x1     /* Alarm 1 interrupt enable     */
+#define RTC_CTL_BIT_A2IE       0x2     /* Alarm 2 interrupt enable     */
+#define RTC_CTL_BIT_INTCN      0x4     /* Interrupt control            */
+#define RTC_CTL_BIT_RS1                0x8     /* Rate select 1                */
+#define RTC_CTL_BIT_RS2                0x10    /* Rate select 2                */
+#define RTC_CTL_BIT_DOSC       0x80    /* Disable Oscillator           */
 
 /*
  * RTC status register bits
  */
-#define RTC_STAT_BIT_A1F       0x1     /* Alarm 1 flag                 */
-#define RTC_STAT_BIT_A2F       0x2     /* Alarm 2 flag                 */
-#define RTC_STAT_BIT_OSF       0x80    /* Oscillator stop flag         */
+#define RTC_STAT_BIT_A1F       0x1     /* Alarm 1 flag                 */
+#define RTC_STAT_BIT_A2F       0x2     /* Alarm 2 flag                 */
+#define RTC_STAT_BIT_OSF       0x80    /* Oscillator stop flag         */
 
 
 static uchar rtc_read (uchar reg);
@@ -84,8 +84,9 @@ static unsigned bcd2bin (uchar c);
 /*
  * Get the current time from the RTC
  */
-void rtc_get (struct rtc_time *tmp)
+int rtc_get (struct rtc_time *tmp)
 {
+       int rel = 0;
        uchar sec, min, hour, mday, wday, mon_cent, year, control, status;
 
        control = rtc_read (RTC_CTL_REG_ADDR);
@@ -107,6 +108,7 @@ void rtc_get (struct rtc_time *tmp)
                /* clear the OSF flag */
                rtc_write (RTC_STAT_REG_ADDR,
                           rtc_read (RTC_STAT_REG_ADDR) & ~RTC_STAT_BIT_OSF);
+               rel = -1;
        }
 
        tmp->tm_sec  = bcd2bin (sec & 0x7F);
@@ -122,6 +124,8 @@ void rtc_get (struct rtc_time *tmp)
        DEBUGR ("Get DATE: %4d-%02d-%02d (wday=%d)  TIME: %2d:%02d:%02d\n",
                tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
                tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
+
+       return rel;
 }
 
 
@@ -154,11 +158,18 @@ void rtc_set (struct rtc_time *tmp)
  * SQW/INTB* pin and program it for 32,768 Hz output. Note that
  * according to the datasheet, turning on the square wave output
  * increases the current drain on the backup battery from about
- * 600 nA to 2uA.
+ * 600 nA to 2uA. Define CFG_RTC_DS1337_NOOSC if you wish to turn
+ * off the OSC output.
  */
+#ifdef CFG_RTC_DS1337_NOOSC
+ #define RTC_DS1337_RESET_VAL \
+       (RTC_CTL_BIT_INTCN | RTC_CTL_BIT_RS1 | RTC_CTL_BIT_RS2)
+#else
+ #define RTC_DS1337_RESET_VAL (RTC_CTL_BIT_RS1 | RTC_CTL_BIT_RS2)
+#endif
 void rtc_reset (void)
 {
-       rtc_write (RTC_CTL_REG_ADDR, RTC_CTL_BIT_RS1 | RTC_CTL_BIT_RS2);
+       rtc_write (RTC_CTL_REG_ADDR, RTC_DS1337_RESET_VAL);
 }
 
 
index e773dd9..f6bb296 100644 (file)
@@ -107,8 +107,8 @@ static void rtc_write_raw (uchar reg, uchar val);
 /*
  * Get the current time from the RTC
  */
-void rtc_get (struct rtc_time *tm){
-
+int rtc_get (struct rtc_time *tm){
+       int rel = 0;
        unsigned long time1, time2;
        unsigned int limit;
        unsigned char tmp;
@@ -138,18 +138,23 @@ void rtc_get (struct rtc_time *tm){
 
        if (time1 != time2) {
                printf("can't get consistent time from rtc chip\n");
+               rel = -1;
        }
 
        DEBUGR ("Get RTC s since 1.1.1970: %d\n", time1);
 
        to_tm(time1, tm); /* To Gregorian Date */
 
-       if (rtc_read(RTC_SR_ADDR) & RTC_SR_BIT_OSF)
+       if (rtc_read(RTC_SR_ADDR) & RTC_SR_BIT_OSF) {
                printf ("### Warning: RTC oscillator has stopped\n");
+               rel = -1;
+       }
 
        DEBUGR ("Get DATE: %4d-%02d-%02d (wday=%d)  TIME: %2d:%02d:%02d\n",
                tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_wday,
                tm->tm_hour, tm->tm_min, tm->tm_sec);
+
+       return rel;
 }
 
 /*
index 4365cfb..2c496f5 100644 (file)
@@ -69,7 +69,7 @@ static unsigned bcd2bin(uchar c);
 
 /* ------------------------------------------------------------------------- */
 
-void rtc_get( struct rtc_time *tmp )
+int rtc_get( struct rtc_time *tmp )
 {
        uchar sec, min, hour;
        uchar mday, wday, mon, year;
@@ -118,6 +118,7 @@ void rtc_get( struct rtc_time *tmp )
                tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
                tmp->tm_hour, tmp->tm_min, tmp->tm_sec );
 #endif
+       return 0;
 }
 
 void rtc_set( struct rtc_time *tmp )
index bff22b9..5943f87 100644 (file)
@@ -70,7 +70,7 @@ static unsigned bcd2bin(uchar c);
 
 /* ------------------------------------------------------------------------- */
 
-void rtc_get( struct rtc_time *tmp )
+int rtc_get( struct rtc_time *tmp )
 {
        uchar sec, min, hour;
        uchar mday, wday, mon, year;
@@ -115,6 +115,8 @@ void rtc_get( struct rtc_time *tmp )
                tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
                tmp->tm_hour, tmp->tm_min, tmp->tm_sec );
 #endif
+
+       return 0;
 }
 
 void rtc_set( struct rtc_time *tmp )
index 5f85a68..eb3ca88 100644 (file)
@@ -65,7 +65,7 @@ static unsigned bcd2bin(uchar c);
 
 /* ------------------------------------------------------------------------- */
 
-void rtc_get( struct rtc_time *tmp )
+int rtc_get( struct rtc_time *tmp )
 {
        uchar sec, min, hour;
        uchar mday, wday, mon, year;
@@ -114,6 +114,7 @@ void rtc_get( struct rtc_time *tmp )
                tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
                tmp->tm_hour, tmp->tm_min, tmp->tm_sec );
 #endif
+       return 0;
 }
 
 void rtc_set( struct rtc_time *tmp )
index fe11b86..95cb186 100644 (file)
@@ -86,8 +86,9 @@ static unsigned bcd2bin (uchar c);
 /*
  * Get the current time from the RTC
  */
-void rtc_get (struct rtc_time *tmp)
+int rtc_get (struct rtc_time *tmp)
 {
+       int rel = 0;
        uchar sec, min, hour, mday, wday, mon_cent, year, control, status;
 
        control = rtc_read (RTC_CTL_REG_ADDR);
@@ -109,6 +110,7 @@ void rtc_get (struct rtc_time *tmp)
                /* clear the OSF flag */
                rtc_write (RTC_STAT_REG_ADDR,
                           rtc_read (RTC_STAT_REG_ADDR) & ~RTC_STAT_BIT_OSF);
+               rel = -1;
        }
 
        tmp->tm_sec  = bcd2bin (sec & 0x7F);
@@ -124,6 +126,8 @@ void rtc_get (struct rtc_time *tmp)
        DEBUGR ("Get DATE: %4d-%02d-%02d (wday=%d)  TIME: %2d:%02d:%02d\n",
                tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
                tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
+
+       return rel;
 }
 
 
index d872802..3d46fd0 100644 (file)
@@ -73,8 +73,9 @@ static unsigned bcd2bin (uchar c);
  * Get the current time from the RTC
  */
 
-void rtc_get (struct rtc_time *tmp)
+int rtc_get (struct rtc_time *tmp)
 {
+       int rel = 0;
        uchar sec, min, hour, mday, wday, mon, year, status;
 
        status = rtc_read (RTC_STAT_REG_ADDR);
@@ -94,6 +95,7 @@ void rtc_get (struct rtc_time *tmp)
                printf ("### Warning: RTC oscillator has stopped\n");
                rtc_write(RTC_STAT_REG_ADDR,
                        rtc_read(RTC_STAT_REG_ADDR) &~ (RTC_STAT_BIT_BAT|RTC_STAT_BIT_RTCF));
+               rel = -1;
        }
 
        tmp->tm_sec  = bcd2bin (sec & 0x7F);
@@ -109,6 +111,8 @@ void rtc_get (struct rtc_time *tmp)
        DEBUGR ("Get DATE: %4d-%02d-%02d (wday=%d)  TIME: %2d:%02d:%02d\n",
                tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
                tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
+
+       return rel;
 }
 
 /*
index 81da33a..fce00d9 100644 (file)
@@ -96,14 +96,16 @@ static unsigned char bin2bcd (unsigned int n)
 
 #define M41T11_STORAGE_SZ  (64-REG_CNT)
 
-void rtc_get (struct rtc_time *tmp)
+int rtc_get (struct rtc_time *tmp)
 {
+       int rel = 0;
        uchar data[RTC_REG_CNT];
 
        i2c_read(CFG_I2C_RTC_ADDR, RTC_SEC_ADDR, 1, data, RTC_REG_CNT);
 
        if( data[RTC_SEC_ADDR] & 0x80 ){
                printf( "m41t11 RTC Clock stopped!!!\n" );
+               rel = -1;
        }
        tmp->tm_sec  = bcd2bin (data[RTC_SEC_ADDR]  & 0x7F);
        tmp->tm_min  = bcd2bin (data[RTC_MIN_ADDR]  & 0x7F);
@@ -120,6 +122,7 @@ void rtc_get (struct rtc_time *tmp)
                i2c_read(CFG_I2C_RTC_ADDR, M41T11_YEAR_DATA, 1, &cent, M41T11_YEAR_SIZE);
                if( !(data[RTC_HOUR_ADDR] & 0x80) ){
                        printf( "m41t11 RTC: cann't keep track of years without CEB set\n" );
+                       rel = -1;
                }
                if( (cent & 0x1) != ((data[RTC_HOUR_ADDR]&0x40)>>7) ){
                        /*century flip store off new year*/
@@ -136,6 +139,8 @@ void rtc_get (struct rtc_time *tmp)
        debug ( "Get DATE: %4d-%02d-%02d (wday=%d)  TIME: %2d:%02d:%02d\n",
                tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
                tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
+
+       return rel;
 }
 
 void rtc_set (struct rtc_time *tmp)
index 7c80143..8a32ea0 100644 (file)
@@ -170,12 +170,12 @@ static uchar *rtc_validate(void)
        return data;
 }
 
-void rtc_get(struct rtc_time *tmp)
+int rtc_get(struct rtc_time *tmp)
 {
        uchar const *const data = rtc_validate();
 
        if (!data)
-               return;
+               return -1;
 
        tmp->tm_sec = bcd2bin(data[RTC_SEC] & 0x7F);
        tmp->tm_min = bcd2bin(data[RTC_MIN] & 0x7F);
@@ -190,6 +190,8 @@ void rtc_get(struct rtc_time *tmp)
        debug("Get DATE: %4d-%02d-%02d (wday=%d)  TIME: %2d:%02d:%02d\n",
              tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
              tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
+
+       return 0;
 }
 
 void rtc_set(struct rtc_time *tmp)
index 2bdca3b..cf2a957 100644 (file)
@@ -64,7 +64,7 @@
 #define M41T62_FEATURE_HT      (1 << 0)
 #define M41T62_FEATURE_BL      (1 << 1)
 
-void rtc_get(struct rtc_time *tm)
+int rtc_get(struct rtc_time *tm)
 {
        u8 buf[M41T62_DATETIME_REG_SIZE];
 
@@ -92,6 +92,8 @@ void rtc_get(struct rtc_time *tm)
              __FUNCTION__,
              tm->tm_sec, tm->tm_min, tm->tm_hour,
              tm->tm_mday, tm->tm_mon, tm->tm_year, tm->tm_wday);
+
+       return 0;
 }
 
 void rtc_set(struct rtc_time *tm)
index 0a0ffa8..be29279 100644 (file)
@@ -42,7 +42,7 @@ static unsigned bcd2bin(uchar c);
 
 /* ------------------------------------------------------------------------- */
 
-void rtc_get (struct rtc_time *tmp)
+int rtc_get (struct rtc_time *tmp)
 {
        uchar sec, min, hour, cent_day, date, month, year;
        uchar ccr;                      /* Clock control register */
@@ -83,6 +83,8 @@ void rtc_get (struct rtc_time *tmp)
        debug ( "Get DATE: %4d-%02d-%02d (wday=%d)  TIME: %2d:%02d:%02d\n",
                tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
                tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
+
+       return 0;
 }
 
 void rtc_set (struct rtc_time *tmp)
index c75a8e0..e9979f2 100644 (file)
@@ -63,7 +63,7 @@ static unsigned char bin2bcd (unsigned int n)
 
 /* ------------------------------------------------------------------------- */
 
-void rtc_get (struct rtc_time *tmp)
+int rtc_get (struct rtc_time *tmp)
 {
        uchar sec, min, hour, mday, wday, mon, cent, year;
        int retry = 1;
@@ -103,6 +103,8 @@ void rtc_get (struct rtc_time *tmp)
        debug ( "Get DATE: %4d-%02d-%02d (wday=%d)  TIME: %2d:%02d:%02d\n",
                tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
                tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
+
+       return 0;
 }
 
 void rtc_set (struct rtc_time *tmp)
diff --git a/drivers/rtc/mc13783-rtc.c b/drivers/rtc/mc13783-rtc.c
new file mode 100644 (file)
index 0000000..35b1b8b
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2008, Guennadi Liakhovetski <lg@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 <rtc.h>
+#include <spi.h>
+
+int rtc_get(struct rtc_time *rtc)
+{
+       u32 day1, day2, time;
+       u32 reg;
+       int err, tim, i = 0;
+
+       spi_select(1, 0, SPI_MODE_2 | SPI_CS_HIGH);
+
+       do {
+               reg = 0x2c000000;
+               err = spi_xfer(0, 32, (uchar *)&reg, (uchar *)&day1);
+
+               if (err)
+                       return err;
+
+               reg = 0x28000000;
+               err = spi_xfer(0, 32, (uchar *)&reg, (uchar *)&time);
+
+               if (err)
+                       return err;
+
+               reg = 0x2c000000;
+               err = spi_xfer(0, 32, (uchar *)&reg, (uchar *)&day2);
+
+               if (err)
+                       return err;
+       } while (day1 != day2 && i++ < 3);
+
+       tim = day1 * 86400 + time;
+       to_tm(tim, rtc);
+
+       rtc->tm_yday = 0;
+       rtc->tm_isdst = 0;
+
+       return 0;
+}
+
+void rtc_set(struct rtc_time *rtc)
+{
+       u32 time, day, reg;
+
+       time = mktime(rtc->tm_year, rtc->tm_mon, rtc->tm_mday,
+                     rtc->tm_hour, rtc->tm_min, rtc->tm_sec);
+       day = time / 86400;
+       time %= 86400;
+
+       reg = 0x2c000000 | day | 0x80000000;
+       spi_xfer(0, 32, (uchar *)&reg, (uchar *)&day);
+
+       reg = 0x28000000 | time | 0x80000000;
+       spi_xfer(0, 32, (uchar *)&reg, (uchar *)&time);
+}
+
+void rtc_reset(void)
+{
+}
index ab377ed..70f7017 100644 (file)
@@ -57,7 +57,7 @@ static unsigned bcd2bin(uchar c);
 
 /* ------------------------------------------------------------------------- */
 
-void rtc_get (struct rtc_time *tmp)
+int rtc_get (struct rtc_time *tmp)
 {
        uchar sec, min, hour, mday, wday, mon, year;
   /* here check if rtc can be accessed */
@@ -101,6 +101,8 @@ void rtc_get (struct rtc_time *tmp)
                tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
                tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
 #endif
+
+       return 0;
 }
 
 void rtc_set (struct rtc_time *tmp)
index 27386e5..d235d10 100644 (file)
@@ -39,7 +39,7 @@
 #define isleap(y) ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0)
 #define        STARTOFTIME             1970
 
-void rtc_get(struct rtc_time *tmp)
+int rtc_get(struct rtc_time *tmp)
 {
        volatile rtc_t *rtc = (rtc_t *) (CFG_MCFRTC_BASE);
 
@@ -64,6 +64,8 @@ void rtc_get(struct rtc_time *tmp)
               tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
               tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
 #endif
+
+       return 0;
 }
 
 void rtc_set(struct rtc_time *tmp)
index bacdb5b..5981399 100644 (file)
@@ -135,7 +135,7 @@ void nvram_write(short dest, const void *src, size_t count)
 
 /* ------------------------------------------------------------------------- */
 
-void rtc_get (struct rtc_time *tmp)
+int rtc_get (struct rtc_time *tmp)
 {
        uchar save_ctrl_a;
        uchar sec, min, hour, mday, wday, mon, year;
@@ -183,6 +183,8 @@ void rtc_get (struct rtc_time *tmp)
                tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
                tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
 #endif
+
+       return 0;
 }
 
 void rtc_set (struct rtc_time *tmp)
index 216386a..a6555f5 100644 (file)
@@ -55,7 +55,7 @@ typedef struct rtc5200 {
 /*****************************************************************************
  * get time
  *****************************************************************************/
-void rtc_get (struct rtc_time *tmp)
+int rtc_get (struct rtc_time *tmp)
 {
        RTC5200 *rtc = (RTC5200 *) (CFG_MBAR+0x800);
        ulong time, date, time2;
@@ -81,6 +81,8 @@ void rtc_get (struct rtc_time *tmp)
        debug ( "Get DATE: %4d-%02d-%02d (wday=%d)  TIME: %2d:%02d:%02d\n",
                tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
                tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
+
+       return 0;
 }
 
 /*****************************************************************************
index 8d10c0e..057547b 100644 (file)
@@ -35,7 +35,7 @@
 
 /* ------------------------------------------------------------------------- */
 
-void rtc_get (struct rtc_time *tmp)
+int rtc_get (struct rtc_time *tmp)
 {
        volatile immap_t *immr = (immap_t *)CFG_IMMR;
        ulong tim;
@@ -47,6 +47,8 @@ void rtc_get (struct rtc_time *tmp)
        debug ( "Get DATE: %4d-%02d-%02d (wday=%d)  TIME: %2d:%02d:%02d\n",
                tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
                tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
+
+       return 0;
 }
 
 void rtc_set (struct rtc_time *tmp)
index 2d73d5d..c384975 100644 (file)
@@ -41,8 +41,9 @@ static unsigned bcd2bin(uchar c);
 
 /* ------------------------------------------------------------------------- */
 
-void rtc_get (struct rtc_time *tmp)
+int rtc_get (struct rtc_time *tmp)
 {
+       int rel = 0;
        uchar sec, min, hour, mday, wday, mon_cent, year;
 
        sec     = rtc_read (0x02);
@@ -65,6 +66,7 @@ void rtc_get (struct rtc_time *tmp)
 
        if (sec & 0x80) {
                puts ("### Warning: RTC Low Voltage - date/time not reliable\n");
+               rel = -1;
        }
 
        tmp->tm_sec  = bcd2bin (sec  & 0x7F);
@@ -80,6 +82,8 @@ void rtc_get (struct rtc_time *tmp)
        debug ( "Get DATE: %4d-%02d-%02d (wday=%d)  TIME: %2d:%02d:%02d\n",
                tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
                tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
+
+       return rel;
 }
 
 void rtc_set (struct rtc_time *tmp)
index 3d1346e..1c9b752 100644 (file)
@@ -166,7 +166,7 @@ rs5c372_convert_to_time(struct rtc_time *dt, unsigned char *buf)
 /*
  * Get the current time from the RTC
  */
-void
+int
 rtc_get (struct rtc_time *tmp)
 {
        unsigned char buf[RS5C372_RAM_SIZE];
@@ -176,7 +176,7 @@ rtc_get (struct rtc_time *tmp)
                rs5c372_enable();
 
        if (!setup_done)
-               return;
+               return -1;
 
        memset(buf, 0, sizeof(buf));
 
@@ -184,12 +184,12 @@ rtc_get (struct rtc_time *tmp)
        ret = rs5c372_readram(buf, RS5C372_RAM_SIZE);
        if (ret != 0) {
                printf("%s: failed\n", __FUNCTION__);
-               return;
+               return -1;
        }
 
        rs5c372_convert_to_time(tmp, buf);
 
-       return;
+       return 0;
 }
 
 /*
index 9122f12..64eafe5 100644 (file)
@@ -96,8 +96,9 @@ static unsigned bcd2bin (uchar c);
 /*
  * Get the current time from the RTC
  */
-void rtc_get (struct rtc_time *tmp)
+int rtc_get (struct rtc_time *tmp)
 {
+       int rel = 0;
        uchar sec, min, hour, mday, wday, mon, year, ctl2;
        uchar buf[16];
 
@@ -118,14 +119,20 @@ void rtc_get (struct rtc_time *tmp)
 
        /* dump status */
        ctl2 = rtc_read(RTC_CTL2_REG_ADDR);
-       if (ctl2 & RTC_CTL2_BIT_PON)
+       if (ctl2 & RTC_CTL2_BIT_PON) {
                printf("RTC: power-on detected\n");
+               rel = -1;
+       }
 
-       if (ctl2 & RTC_CTL2_BIT_VDET)
+       if (ctl2 & RTC_CTL2_BIT_VDET) {
                printf("RTC: voltage drop detected\n");
+               rel = -1;
+       }
 
-       if (!(ctl2 & RTC_CTL2_BIT_XST))
+       if (!(ctl2 & RTC_CTL2_BIT_XST)) {
                printf("RTC: oscillator stop detected\n");
+               rel = -1;
+       }
 
        tmp->tm_sec  = bcd2bin (sec & 0x7F);
        tmp->tm_min  = bcd2bin (min & 0x7F);
@@ -140,6 +147,8 @@ void rtc_get (struct rtc_time *tmp)
        DEBUGR ("Get DATE: %4d-%02d-%02d (wday=%d)  TIME: %2d:%02d:%02d\n",
                tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
                tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
+
+       return rel;
 }
 
 /*
index 7f8b4fa..358aef7 100644 (file)
@@ -70,7 +70,7 @@ static unsigned char bin2bcd (unsigned int n)
 
 /* ------------------------------------------------------------------------- */
 
-void rtc_get (struct rtc_time *tmp)
+int rtc_get (struct rtc_time *tmp)
 {
        S3C24X0_RTC * const rtc = S3C24X0_GetBase_RTC();
        uchar sec, min, hour, mday, wday, mon, year;
@@ -131,6 +131,8 @@ void rtc_get (struct rtc_time *tmp)
                tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
                tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
 #endif
+
+       return 0;
 }
 
 void rtc_set (struct rtc_time *tmp)
index 319f051..0e18139 100644 (file)
@@ -104,7 +104,7 @@ static void rtc_write(int reg, u8 val)
  * rtc_time -- month 0-11, hour 0-23, yr = calendar year-epoch
  * Epoch is initialized as 2000. Time is set to UTC.
  */
-void rtc_get(struct rtc_time *tm)
+int rtc_get(struct rtc_time *tm)
 {
        u8 buf[8];
 
@@ -130,6 +130,8 @@ void rtc_get(struct rtc_time *tm)
              __FUNCTION__,
              tm->tm_sec, tm->tm_min, tm->tm_hour,
              tm->tm_mday, tm->tm_mon, tm->tm_year, tm->tm_wday);
+
+       return 0;
 }
 
 void rtc_set(struct rtc_time *tm)
index 70fd23f..522f96d 100644 (file)
 #define SCFCR  (vu_short *)(SCIF_BASE + 0x18)
 #define SCFDR  (vu_short *)(SCIF_BASE + 0x1C)
 #ifdef CONFIG_CPU_SH7720 /* SH7720 specific */
-#define SCFSR  (vu_short *)(SCIF_BASE + 0x14)   /* SCSSR */
-#define SCFTDR (vu_char  *)(SCIF_BASE + 0x20)
-#define SCFRDR (vu_char  *)(SCIF_BASE + 0x24)
+# define SCFSR (vu_short *)(SCIF_BASE + 0x14) /* SCSSR */
+# define SCFTDR        (vu_char  *)(SCIF_BASE + 0x20)
+# define SCFRDR        (vu_char  *)(SCIF_BASE + 0x24)
 #else
-#define SCFTDR         (vu_char  *)(SCIF_BASE + 0xC)
-#define SCFSR  (vu_short *)(SCIF_BASE + 0x10)
-#define SCFRDR         (vu_char  *)(SCIF_BASE + 0x14)
+# define SCFTDR (vu_char  *)(SCIF_BASE + 0xC)
+# define SCFSR         (vu_short *)(SCIF_BASE + 0x10)
+# define SCFRDR (vu_char  *)(SCIF_BASE + 0x14)
 #endif
 
-#if defined(CONFIG_SH4A)
-#define SCRFDR (vu_short *)(SCIF_BASE + 0x20)
-#define SCSPTR (vu_short *)(SCIF_BASE + 0x24)
-#define SCLSR   (vu_short *)(SCIF_BASE + 0x28)
-#define SCRER  (vu_short *)(SCIF_BASE + 0x2C)
-#define LSR_ORER       1
-#elif defined (CONFIG_SH4)
-#define SCSPTR         (vu_short *)(SCIF_BASE + 0x20)
-#define SCLSR  (vu_short *)(SCIF_BASE + 0x24)
-#define LSR_ORER       1
-#elif defined (CONFIG_SH3)
-#ifdef CONFIG_CPU_SH7720 /* SH7720 specific */
-#define SCLSR   (vu_short *)(SCIF_BASE + 0x24)
-#define LSR_ORER       0x0200
-#else
-#define SCLSR  SCFSR   /* SCSSR */
-#define LSR_ORER       1
-#endif
+#if defined(CONFIG_CPU_SH7780) || \
+       defined(CONFIG_CPU_SH7785)
+# define SCRFDR        (vu_short *)(SCIF_BASE + 0x20)
+# define SCSPTR        (vu_short *)(SCIF_BASE + 0x24)
+# define SCLSR   (vu_short *)(SCIF_BASE + 0x28)
+# define SCRER (vu_short *)(SCIF_BASE + 0x2C)
+# define LSR_ORER      1
+# define FIFOLEVEL_MASK        0xFF
+#elif defined(CONFIG_CPU_SH7750) || \
+       defined(CONFIG_CPU_SH7751) || \
+       defined(CONFIG_CPU_SH7722)
+# define SCSPTR        (vu_short *)(SCIF_BASE + 0x20)
+# define SCLSR         (vu_short *)(SCIF_BASE + 0x24)
+# define LSR_ORER      1
+# define FIFOLEVEL_MASK        0x1F
+#elif defined(CONFIG_CPU_SH7720)
+# define SCLSR   (vu_short *)(SCIF_BASE + 0x24)
+# define LSR_ORER      0x0200
+# define FIFOLEVEL_MASK        0x1F
+#elif defined(CONFIG_CPU_SH7710)
+       defined(CONFIG_CPU_SH7712)
+# define SCLSR SCFSR   /* SCSSR */
+# define LSR_ORER      1
+# define FIFOLEVEL_MASK        0x1F
 #endif
 
+/* SCBRR register value setting */
 #if defined(CONFIG_CPU_SH7720)
-#define SCBRR_VALUE(bps, clk) (((clk*2)+16*bps)/(32*bps)-1)
+# define SCBRR_VALUE(bps, clk) (((clk*2)+16*bps)/(32*bps)-1)
 #else  /* Generic SuperH */
-#define SCBRR_VALUE(bps, clk) ((clk+16*bps)/(32*bps)-1)
+# define SCBRR_VALUE(bps, clk) ((clk+16*bps)/(32*bps)-1)
 #endif
 
 #define SCR_RE                 (1 << 4)
@@ -105,14 +112,13 @@ int serial_init (void)
        return 0;
 }
 
-static int serial_tx_fifo_level (void)
-{
-       return (*SCFDR >> 8) & 0x1F;
-}
-
 static int serial_rx_fifo_level (void)
 {
-       return (*SCFDR >> 0) & 0x1F;
+#if defined(CONFIG_SH4A)
+       return (*SCRFDR >> 0) & FIFOLEVEL_MASK;
+#else
+       return (*SCFDR >> 0) & FIFOLEVEL_MASK;
+#endif
 }
 
 void serial_raw_putc (const char c)
index 0b7a2df..bc8a104 100644 (file)
@@ -26,6 +26,7 @@ include $(TOPDIR)/config.mk
 LIB    := $(obj)libspi.a
 
 COBJS-y += mpc8xxx_spi.o
+COBJS-$(CONFIG_MXC_SPI) += mxc_spi.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
diff --git a/drivers/spi/mxc_spi.c b/drivers/spi/mxc_spi.c
new file mode 100644 (file)
index 0000000..b2e3ab9
--- /dev/null
@@ -0,0 +1,166 @@
+/*
+ * Copyright (C) 2008, Guennadi Liakhovetski <lg@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.
+ *
+ * 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 <spi.h>
+#include <asm/io.h>
+
+#ifdef CONFIG_MX27
+/* i.MX27 has a completely wrong register layout and register definitions in the
+ * datasheet, the correct one is in the Freescale's Linux driver */
+
+#error "i.MX27 CSPI not supported due to drastic differences in register definisions" \
+"See linux mxc_spi driver from Freescale for details."
+
+#else
+
+#define MXC_CSPIRXDATA         0x00
+#define MXC_CSPITXDATA         0x04
+#define MXC_CSPICTRL           0x08
+#define MXC_CSPIINT            0x0C
+#define MXC_CSPIDMA            0x10
+#define MXC_CSPISTAT           0x14
+#define MXC_CSPIPERIOD         0x18
+#define MXC_CSPITEST           0x1C
+#define MXC_CSPIRESET          0x00
+
+#define MXC_CSPICTRL_EN                (1 << 0)
+#define MXC_CSPICTRL_MODE      (1 << 1)
+#define MXC_CSPICTRL_XCH       (1 << 2)
+#define MXC_CSPICTRL_SMC       (1 << 3)
+#define MXC_CSPICTRL_POL       (1 << 4)
+#define MXC_CSPICTRL_PHA       (1 << 5)
+#define MXC_CSPICTRL_SSCTL     (1 << 6)
+#define MXC_CSPICTRL_SSPOL     (1 << 7)
+#define MXC_CSPICTRL_CHIPSELECT(x)     (((x) & 0x3) << 24)
+#define MXC_CSPICTRL_BITCOUNT(x)       (((x) & 0x1f) << 8)
+#define MXC_CSPICTRL_DATARATE(x)       (((x) & 0x7) << 16)
+
+#define MXC_CSPIPERIOD_32KHZ   (1 << 15)
+
+static unsigned long spi_bases[] = {
+       0x43fa4000,
+       0x50010000,
+       0x53f84000,
+};
+
+static unsigned long spi_base;
+
+#endif
+
+spi_chipsel_type spi_chipsel[] = {
+       (spi_chipsel_type)0,
+       (spi_chipsel_type)1,
+       (spi_chipsel_type)2,
+       (spi_chipsel_type)3,
+};
+int spi_chipsel_cnt = sizeof(spi_chipsel) / sizeof(spi_chipsel[0]);
+
+static inline u32 reg_read(unsigned long addr)
+{
+       return *(volatile unsigned long*)addr;
+}
+
+static inline void reg_write(unsigned long addr, u32 val)
+{
+       *(volatile unsigned long*)addr = val;
+}
+
+static u32 spi_xchg_single(u32 data, int bitlen)
+{
+
+       unsigned int cfg_reg = reg_read(spi_base + MXC_CSPICTRL);
+
+       if (MXC_CSPICTRL_BITCOUNT(bitlen - 1) != (cfg_reg & MXC_CSPICTRL_BITCOUNT(31))) {
+               cfg_reg = (cfg_reg & ~MXC_CSPICTRL_BITCOUNT(31)) |
+                       MXC_CSPICTRL_BITCOUNT(bitlen - 1);
+               reg_write(spi_base + MXC_CSPICTRL, cfg_reg);
+       }
+
+       reg_write(spi_base + MXC_CSPITXDATA, data);
+
+       cfg_reg |= MXC_CSPICTRL_XCH;
+
+       reg_write(spi_base + MXC_CSPICTRL, cfg_reg);
+
+       while (reg_read(spi_base + MXC_CSPICTRL) & MXC_CSPICTRL_XCH)
+               ;
+
+       return reg_read(spi_base + MXC_CSPIRXDATA);
+}
+
+int spi_xfer(spi_chipsel_type chipsel, int bitlen, uchar *dout, uchar *din)
+{
+       int n_blks = (bitlen + 31) / 32;
+       u32 *out_l, *in_l;
+       int i;
+
+       if ((int)dout & 3 || (int)din & 3) {
+               printf("Error: unaligned buffers in: %p, out: %p\n", din, dout);
+               return 1;
+       }
+
+       if (!spi_base)
+               spi_select(CONFIG_MXC_SPI_IFACE, (int)chipsel, SPI_MODE_2 | SPI_CS_HIGH);
+
+       for (i = 0, in_l = (u32 *)din, out_l = (u32 *)dout;
+            i < n_blks;
+            i++, in_l++, out_l++, bitlen -= 32)
+               *in_l = spi_xchg_single(*out_l, bitlen);
+
+       return 0;
+}
+
+void spi_init(void)
+{
+}
+
+int spi_select(unsigned int bus, unsigned int dev, unsigned long mode)
+{
+       unsigned int ctrl_reg;
+
+       if (bus >= sizeof(spi_bases) / sizeof(spi_bases[0]) ||
+           dev > 3)
+               return 1;
+
+       spi_base = spi_bases[bus];
+
+       ctrl_reg = MXC_CSPICTRL_CHIPSELECT(dev) |
+               MXC_CSPICTRL_BITCOUNT(31) |
+               MXC_CSPICTRL_DATARATE(7) | /* FIXME: calculate data rate */
+               MXC_CSPICTRL_EN |
+               MXC_CSPICTRL_MODE;
+
+       if (mode & SPI_CPHA)
+               ctrl_reg |= MXC_CSPICTRL_PHA;
+       if (!(mode & SPI_CPOL))
+               ctrl_reg |= MXC_CSPICTRL_POL;
+       if (mode & SPI_CS_HIGH)
+               ctrl_reg |= MXC_CSPICTRL_SSPOL;
+
+       reg_write(spi_base + MXC_CSPIRESET, 1);
+       udelay(1);
+       reg_write(spi_base + MXC_CSPICTRL, ctrl_reg);
+       reg_write(spi_base + MXC_CSPIPERIOD,
+                 MXC_CSPIPERIOD_32KHZ);
+       reg_write(spi_base + MXC_CSPIINT, 0);
+
+       return 0;
+}
index 829bbca..ee0f2e4 100644 (file)
  * e.g. PCI controllers need this
  */
 #ifdef CFG_OHCI_SWAP_REG_ACCESS
-# define readl(a) __swap_32(*((vu_long *)(a)))
-# define writel(a, b) (*((vu_long *)(b)) = __swap_32((vu_long)a))
+# define readl(a) __swap_32(*((volatile u32 *)(a)))
+# define writel(a, b) (*((volatile u32 *)(b)) = __swap_32((volatile u32)a))
 #else
-# define readl(a) (*((vu_long *)(a)))
-# define writel(a, b) (*((vu_long *)(b)) = ((vu_long)a))
+# define readl(a) (*((volatile u32 *)(a)))
+# define writel(a, b) (*((volatile u32 *)(b)) = ((volatile u32)a))
 #endif /* CFG_OHCI_SWAP_REG_ACCESS */
 
 #define min_t(type,x,y) ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
@@ -111,7 +111,6 @@ static struct pci_device_id ohci_pci_ids[] = {
 #define dbg(format, arg...) do {} while(0)
 #endif /* DEBUG */
 #define err(format, arg...) printf("ERROR: " format "\n", ## arg)
-#undef SHOW_INFO
 #ifdef SHOW_INFO
 #define info(format, arg...) printf("INFO: " format "\n", ## arg)
 #else
@@ -139,28 +138,14 @@ int got_rhsc;
 /* device which was disconnected */
 struct usb_device *devgone;
 
-/*-------------------------------------------------------------------------*/
-
-/* AMD-756 (D2 rev) reports corrupt register contents in some cases.
- * The erratum (#4) description is incorrect.  AMD's workaround waits
- * till some bits (mostly reserved) are clear; ok for all revs.
- */
-#define OHCI_QUIRK_AMD756 0xabcd
-#define read_roothub(hc, register, mask) ({ \
-       u32 temp = readl (&hc->regs->roothub.register); \
-       if (hc->flags & OHCI_QUIRK_AMD756) \
-               while (temp & mask) \
-                       temp = readl (&hc->regs->roothub.register); \
-       temp; })
-
-static u32 roothub_a (struct ohci *hc)
-       { return read_roothub (hc, a, 0xfc0fe000); }
+static inline u32 roothub_a (struct ohci *hc)
+       { return readl (&hc->regs->roothub.a); }
 static inline u32 roothub_b (struct ohci *hc)
        { return readl (&hc->regs->roothub.b); }
 static inline u32 roothub_status (struct ohci *hc)
        { return readl (&hc->regs->roothub.status); }
-static u32 roothub_portstatus (struct ohci *hc, int i)
-       { return read_roothub (hc, portstatus [i], 0xffe0fce0); }
+static inline u32 roothub_portstatus (struct ohci *hc, int i)
+       { return readl (&hc->regs->roothub.portstatus[i]); }
 
 /* forward declaration */
 static int hc_interrupt (void);
index 4f73067..68b9861 100644 (file)
@@ -849,6 +849,7 @@ int video_display_bitmap (ulong bmp_image, int x, int y)
                if (!((bmp->header.signature[0] == 'B') &&
                      (bmp->header.signature[1] == 'M'))) {
                        printf ("Error: no valid bmp.gz image at %lx\n", bmp_image);
+                       free(dst);
                        return 1;
                }
 #else
@@ -869,6 +870,10 @@ int video_display_bitmap (ulong bmp_image, int x, int y)
        if (compression != BMP_BI_RGB) {
                printf ("Error: compression type %ld not supported\n",
                        compression);
+#ifdef CONFIG_VIDEO_BMP_GZIP
+               if (dst)
+                       free(dst);
+#endif
                return 1;
        }
 
index bfb057f..9684cf3 100644 (file)
@@ -36,6 +36,9 @@
 #include "videomodes.h"
 #include <mb862xx.h>
 
+#if defined(CONFIG_POST)
+#include <post.h>
+#endif
 /*
  * Graphic Device
  */
@@ -354,7 +357,7 @@ void *video_hw_init (void)
        board_disp_init();
 #endif
 
-#if defined(CONFIG_LWMON5)
+#if defined(CONFIG_LWMON5) && !(CONFIG_POST & CFG_POST_SYSMON)
        /* Lamp on */
        board_backlight_switch (1);
 #endif
index c5d629b..66b354d 100644 (file)
@@ -69,6 +69,9 @@ ifeq ($(ARCH),sh)
 LOAD_ADDR = 0x8C000000
 endif
 
+ifeq ($(ARCH),sparc)
+LOAD_ADDR = 0x00000000 -L $(gcclibdir) -T sparc.lds
+endif
 
 include $(TOPDIR)/config.mk
 
index a52e68d..2b15d05 100644 (file)
@@ -17,8 +17,9 @@
  * and release the resulting code under the GPL.
  */
 
-#define _PPC_STRING_H_         /* avoid unnecessary str/mem functions */
-#define _LINUX_STRING_H_       /* avoid unnecessary str/mem functions */
+/* avoid unnecessary memcpy function */
+#define __HAVE_ARCH_MEMCPY
+#define _PPC_STRING_H_
 
 #include <common.h>
 #include <exports.h>
similarity index 67%
rename from lib_nios2/nios_linux.c
rename to examples/sparc.lds
index 9eb3426..7592544 100644 (file)
  * MA 02111-1307 USA
  */
 
-#include <common.h>
-#include <command.h>
-#include <asm/byteorder.h>
 
-extern image_header_t header;  /* common/cmd_bootm.c */
+OUTPUT_FORMAT("elf32-sparc", "elf32-sparc", "elf32-sparc")
+OUTPUT_ARCH(sparc)
+ENTRY(_start)
 
-void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
-               ulong addr, ulong *len_ptr, int   verify)
+SECTIONS
 {
-       image_header_t *hdr = &header;
-       void (*kernel)(void) = (void (*)(void))ntohl (hdr->ih_ep);
+       .text :
+       {
+         *(.text)
+       }
+       __text_end = .;
 
-       /* For now we assume the Microtronix linux ... which only
-        * needs to be called ;-)
-        */
-       kernel ();
+       . = ALIGN(4);
+       .rodata :
+       {
+               *(.rodata)
+       }
+       __rodata_end = .;
+
+       . = ALIGN(4);
+       .data :
+       {
+               *(.data)
+       }
+       . = ALIGN(4);
+       __data_end = .;
+
+       __bss_start = .;
+       . = ALIGN(4);
+       .bss :
+       {
+               *(.bss)
+       }
+       . = ALIGN(4);
+       __bss_end = .;
+       _end = .;
 }
index b9dbcf9..ec53532 100644 (file)
@@ -167,6 +167,22 @@ gd_t *global_data;
                "       nop\n"                          \
                "       nop\n"                          \
                : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "r1");
+#elif defined(CONFIG_SPARC)
+/*
+ * g7 holds the pointer to the global_data. g1 is call clobbered.
+ */
+#define EXPORT_FUNC(x)                                 \
+       asm volatile(                                   \
+"      .globl\t" #x "\n"                               \
+#x ":\n"                                               \
+"      set %0, %%g1\n"                                 \
+"      or %%g1, %%g7, %%g1\n"                          \
+"      ld [%%g1], %%g1\n"                              \
+"      ld [%%g1 + %1], %%g1\n"                         \
+"      call %%g1\n"                                    \
+"      nop\n"                                          \
+       : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x) : "g1" );
+
 #else
 #error stubs definition missing for this architecture
 #endif
index a9c0b7d..cf67967 100644 (file)
 
 static z_stream stream;
 
-#define ZALLOC_ALIGNMENT       16
-
-static void *zalloc (void *x, unsigned items, unsigned size)
-{
-       void *p;
-
-       size *= items;
-       size = (size + ZALLOC_ALIGNMENT - 1) & ~(ZALLOC_ALIGNMENT - 1);
-
-       p = malloc (size);
-
-       return (p);
-}
-
-static void zfree (void *x, void *addr, unsigned nb)
-{
-       free (addr);
-}
+void *zalloc(void *, unsigned, unsigned);
+void zfree(void *, void *, unsigned);
 
 /* Returns length of decompressed data. */
 int cramfs_uncompress_block (void *dst, void *src, int srclen)
index 7b8cb4a..c03fe87 100644 (file)
 #ifndef _ALTERA_H_
 #define _ALTERA_H_
 
-/*
- * See include/xilinx.h for another working example.
- */
-
 /* Altera Model definitions
  *********************************************************************/
 #define CFG_ACEX1K             CFG_FPGA_DEV( 0x1 )
 #define CFG_CYCLON2            CFG_FPGA_DEV( 0x2 )
+#define CFG_STRATIX_II         CFG_FPGA_DEV( 0x4 )
 
 #define CFG_ALTERA_ACEX1K      (CFG_FPGA_ALTERA | CFG_ACEX1K)
 #define CFG_ALTERA_CYCLON2     (CFG_FPGA_ALTERA | CFG_CYCLON2)
+#define CFG_ALTERA_STRATIX_II  (CFG_FPGA_ALTERA | CFG_STRATIX_II)
 /* Add new models here */
 
 /* Altera Interface definitions
  *********************************************************************/
 #define CFG_ALTERA_IF_PS       CFG_FPGA_IF( 0x1 )      /* passive serial */
+#define CFG_ALTERA_IF_FPP      CFG_FPGA_IF( 0x2 )      /* fast passive parallel */
 /* Add new interfaces here */
 
 typedef enum {                         /* typedef Altera_iface */
@@ -52,6 +51,8 @@ typedef enum {                                /* typedef Altera_iface */
        passive_parallel_asynchronous,  /* parallel data */
        passive_serial_asynchronous,    /* serial data w/ internal clock (not used)     */
        altera_jtag_mode,               /* jtag/tap serial (not used ) */
+       fast_passive_parallel,  /* fast passive parallel (FPP) */
+       fast_passive_parallel_security, /* fast passive parallel with security (FPPS) */
        max_altera_iface_type           /* insert all new types before this */
 } Altera_iface;                                /* end, typedef Altera_iface */
 
@@ -59,6 +60,7 @@ typedef enum {                        /* typedef Altera_Family */
     min_altera_type,           /* insert all new types after this */
     Altera_ACEX1K,             /* ACEX1K Family */
     Altera_CYC2,               /* CYCLONII Family */
+       Altera_StratixII,       /* StratixII Familiy */
 /* Add new models here */
     max_altera_type            /* insert all new types before this */
 } Altera_Family;               /* end, typedef Altera_Family */
@@ -91,4 +93,15 @@ typedef int (*Altera_write_fn)(void *buf, size_t len, int flush, int cookie);
 typedef int (*Altera_abort_fn)( int cookie );
 typedef int (*Altera_post_fn)( int cookie );
 
+typedef struct {
+       Altera_pre_fn pre;
+       Altera_config_fn config;
+       Altera_status_fn status;
+       Altera_done_fn done;
+       Altera_clk_fn clk;
+       Altera_data_fn data;
+       Altera_abort_fn abort;
+       Altera_post_fn post;
+} altera_board_specific_func;
+
 #endif /* _ALTERA_H_ */
diff --git a/include/ambapp.h b/include/ambapp.h
new file mode 100644 (file)
index 0000000..42c990c
--- /dev/null
@@ -0,0 +1,394 @@
+/* Interface for accessing Gaisler AMBA Plug&Play Bus.
+ * The AHB bus can be interfaced with a simpler bus -
+ * the APB bus, also freely available in GRLIB at
+ * www.gaisler.com.
+ *
+ * (C) Copyright 2007
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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 __AMBAPP_H__
+#define __AMBAPP_H__
+
+/* Default location of Plug&Play info
+ * normally 0xfffff000 for AHB masters
+ * and 0xfffff800 for AHB slaves.
+ * Normally no need to change this.
+ */
+#define LEON3_IO_AREA 0xfff00000
+#define LEON3_CONF_AREA  0xff000
+#define LEON3_AHB_SLAVE_CONF_AREA (1 << 11)
+
+/* Max devices this software will support */
+#define LEON3_AHB_MASTERS 16
+#define LEON3_AHB_SLAVES 16
+/*#define LEON3_APB_MASTERS 1*/ /* Number of APB buses that has Plug&Play */
+#define LEON3_APB_SLAVES 16    /* Total number of APB slaves per APB bus */
+
+/* Vendor codes */
+#define VENDOR_GAISLER       1
+#define VENDOR_PENDER        2
+#define VENDOR_ESA           4
+#define VENDOR_ASTRIUM       6
+#define VENDOR_OPENCHIP      7
+#define VENDOR_OPENCORES     8
+#define VENDOR_CONTRIB       9
+#define VENDOR_EONIC         11
+#define VENDOR_RADIONOR      15
+#define VENDOR_GLEICHMANN    16
+#define VENDOR_MENTA         17
+#define VENDOR_SUN           19
+#define VENDOR_EMBEDDIT      234
+#define VENDOR_CAL           202
+
+/* Gaisler Research device id's */
+#define GAISLER_LEON3    0x003
+#define GAISLER_LEON3DSU 0x004
+#define GAISLER_ETHAHB   0x005
+#define GAISLER_APBMST   0x006
+#define GAISLER_AHBUART  0x007
+#define GAISLER_SRCTRL   0x008
+#define GAISLER_SDCTRL   0x009
+#define GAISLER_APBUART  0x00C
+#define GAISLER_IRQMP    0x00D
+#define GAISLER_AHBRAM   0x00E
+#define GAISLER_GPTIMER  0x011
+#define GAISLER_PCITRG   0x012
+#define GAISLER_PCISBRG  0x013
+#define GAISLER_PCIFBRG  0x014
+#define GAISLER_PCITRACE 0x015
+#define GAISLER_PCIDMA   0x016
+#define GAISLER_AHBTRACE 0x017
+#define GAISLER_ETHDSU   0x018
+#define GAISLER_PIOPORT  0x01A
+#define GAISLER_AHBJTAG  0x01c
+#define GAISLER_SPW      0x01f
+#define GAISLER_ATACTRL  0x024
+#define GAISLER_VGA      0x061
+#define GAISLER_KBD      0X060
+#define GAISLER_ETHMAC   0x01D
+#define GAISLER_DDRSPA   0x025
+#define GAISLER_EHCI     0x026
+#define GAISLER_UHCI     0x027
+#define GAISLER_SPW2     0x029
+#define GAISLER_DDR2SPA  0x02E
+#define GAISLER_AHBSTAT  0x052
+#define GAISLER_FTMCTRL  0x054
+
+#define GAISLER_L2TIME   0xffd /* internal device: leon2 timer */
+#define GAISLER_L2C      0xffe /* internal device: leon2compat */
+#define GAISLER_PLUGPLAY 0xfff /* internal device: plug & play configarea */
+
+/* European Space Agency device id's */
+#define ESA_LEON2        0x2
+#define ESA_MCTRL        0xF
+
+/* Opencores device id's */
+#define OPENCORES_PCIBR  0x4
+#define OPENCORES_ETHMAC 0x5
+
+/* Vendor codes */
+
+/*
+ *
+ * Macros for manipulating Configuration registers
+ *
+ */
+
+#define amba_vendor(x) (((x) >> 24) & 0xff)
+
+#define amba_device(x) (((x) >> 12) & 0xfff)
+
+#define amba_membar_start(mbar) \
+ (((mbar) & 0xfff00000) & (((mbar) & 0xfff0) << 16))
+
+#define amba_iobar_start(base, iobar) \
+ ((base) | ((((iobar) & 0xfff00000)>>12) & (((iobar) & 0xfff0)<<4)) )
+
+#define amba_irq(conf) ((conf) & 0xf)
+
+#define amba_ver(conf) (((conf)>>5) & 0x1f)
+
+#define amba_membar_type(mbar) ((mbar) & 0xf)
+
+#define amba_membar_mask(mbar) (((mbar)>>4) & 0xfff)
+
+#define AMBA_TYPE_APBIO 0x1
+#define AMBA_TYPE_MEM   0x2
+#define AMBA_TYPE_AHBIO 0x3
+
+#define AMBA_TYPE_AHBIO_ADDR(addr) (LEON3_IO_AREA | ((addr) >> 12))
+
+#ifndef __ASSEMBLER__
+
+#ifdef CONFIG_CMD_AMBAPP
+
+/* AMBA Plug&Play relocation & initialization */
+int ambapp_init_reloc(void);
+
+/* AMBA Plug&Play Name of Vendors and devices */
+
+/* Return name of device */
+char *ambapp_device_id2str(int vendor, int id);
+
+/* Return name of vendor */
+char *ambapp_vendor_id2str(int vendor);
+#endif
+
+/*
+ *  Types and structure used for AMBA Plug & Play bus scanning
+ */
+
+/* AMBA Plug&Play AHB information layout */
+typedef struct {
+       unsigned int conf;
+       unsigned int userdef[3];
+       unsigned int bars[4];
+} ahbctrl_pp_dev;
+
+/* Prototypes for scanning AMBA Plug&Play bus for AMBA
+ *  i)   AHB Masters
+ *  ii)  AHB Slaves
+ *  iii) APB Slaves (APB MST is a AHB Slave)
+ */
+
+typedef struct {
+       unsigned char irq;
+       unsigned char ver;
+       unsigned int address;
+} ambapp_apbdev;
+
+typedef struct {
+       unsigned char irq;
+       unsigned char ver;
+       unsigned int userdef[3];
+       unsigned int address[4];
+} ambapp_ahbdev;
+
+/* AMBA Plug&Play AHB Masters & Slaves information locations
+ * Max devices is 64 supported by HW, however often only 8
+ * are used.
+ */
+typedef struct {
+       ahbctrl_pp_dev masters[64];
+       ahbctrl_pp_dev slaves[64];
+} ahbctrl_info;
+
+/* AMBA Plug&Play AHB information layout */
+typedef struct {
+       unsigned int conf;
+       unsigned int bar;
+} apbctrl_pp_dev;
+
+/* All functions return the number of found devices
+ * 0 = no devices found
+ */
+
+/****************************** APB SLAVES ******************************/
+int ambapp_apb_count(unsigned int vendor, unsigned int driver);
+
+int ambapp_apb_first(unsigned int vendor,
+                    unsigned int driver, ambapp_apbdev * dev);
+
+int ambapp_apb_next(unsigned int vendor,
+                   unsigned int driver, ambapp_apbdev * dev, int index);
+
+int ambapp_apbs_first(unsigned int vendor,
+                     unsigned int driver, ambapp_apbdev * dev, int max_cnt);
+
+/****************************** AHB MASTERS ******************************/
+int ambapp_ahbmst_count(unsigned int vendor, unsigned int driver);
+
+int ambapp_ahbmst_first(unsigned int vendor,
+                       unsigned int driver, ambapp_ahbdev * dev);
+
+int ambapp_ahbmst_next(unsigned int vendor,
+                      unsigned int driver, ambapp_ahbdev * dev, int index);
+
+int ambapp_ahbmsts_first(unsigned int vendor,
+                        unsigned int driver, ambapp_ahbdev * dev, int max_cnt);
+
+/****************************** AHB SLAVES ******************************/
+int ambapp_ahbslv_count(unsigned int vendor, unsigned int driver);
+
+int ambapp_ahbslv_first(unsigned int vendor,
+                       unsigned int driver, ambapp_ahbdev * dev);
+
+int ambapp_ahbslv_next(unsigned int vendor,
+                      unsigned int driver, ambapp_ahbdev * dev, int index);
+
+int ambapp_ahbslvs_first(unsigned int vendor,
+                        unsigned int driver, ambapp_ahbdev * dev, int max_cnt);
+
+/*************************** AHB/APB only regs functions *************************
+ * During start up, no memory is available we can use the simplified functions
+ * to get to the memory controller.
+ *
+ * Functions uses no stack/memory, only registers.
+ */
+unsigned int ambapp_apb_next_nomem(register unsigned int vendor,       /* Plug&Play Vendor ID */
+                                  register unsigned int driver,        /* Plug&Play Device ID */
+                                  register int index);
+
+ahbctrl_pp_dev *ambapp_ahb_next_nomem(register unsigned int vendor,    /* Plug&Play Vendor ID */
+                                     register unsigned int driver,     /* Plug&Play Device ID */
+                                     register unsigned int opts,       /* scan for AHB 1=slave, 0=masters */
+                                     register int index);
+
+unsigned int ambapp_ahb_get_info(ahbctrl_pp_dev * ahb, int info);
+
+/*************************** AMBA Plug&Play device register MAPS *****************/
+
+/*
+ *  The following defines the bits in the LEON UART Status Registers.
+ */
+
+#define LEON_REG_UART_STATUS_DR   0x00000001   /* Data Ready */
+#define LEON_REG_UART_STATUS_TSE  0x00000002   /* TX Send Register Empty */
+#define LEON_REG_UART_STATUS_THE  0x00000004   /* TX Hold Register Empty */
+#define LEON_REG_UART_STATUS_BR   0x00000008   /* Break Error */
+#define LEON_REG_UART_STATUS_OE   0x00000010   /* RX Overrun Error */
+#define LEON_REG_UART_STATUS_PE   0x00000020   /* RX Parity Error */
+#define LEON_REG_UART_STATUS_FE   0x00000040   /* RX Framing Error */
+#define LEON_REG_UART_STATUS_ERR  0x00000078   /* Error Mask */
+
+/*
+ *  The following defines the bits in the LEON UART Ctrl Registers.
+ */
+
+#define LEON_REG_UART_CTRL_RE     0x00000001   /* Receiver enable */
+#define LEON_REG_UART_CTRL_TE     0x00000002   /* Transmitter enable */
+#define LEON_REG_UART_CTRL_RI     0x00000004   /* Receiver interrupt enable */
+#define LEON_REG_UART_CTRL_TI     0x00000008   /* Transmitter interrupt enable */
+#define LEON_REG_UART_CTRL_PS     0x00000010   /* Parity select */
+#define LEON_REG_UART_CTRL_PE     0x00000020   /* Parity enable */
+#define LEON_REG_UART_CTRL_FL     0x00000040   /* Flow control enable */
+#define LEON_REG_UART_CTRL_LB     0x00000080   /* Loop Back enable */
+#define LEON_REG_UART_CTRL_DBG    (1<<11)      /* Debug Bit used by GRMON */
+
+#define LEON3_GPTIMER_EN 1
+#define LEON3_GPTIMER_RL 2
+#define LEON3_GPTIMER_LD 4
+#define LEON3_GPTIMER_IRQEN 8
+
+/*
+ *  The following defines the bits in the LEON PS/2 Status Registers.
+ */
+
+#define LEON_REG_PS2_STATUS_DR   0x00000001    /* Data Ready */
+#define LEON_REG_PS2_STATUS_PE   0x00000002    /* Parity error */
+#define LEON_REG_PS2_STATUS_FE   0x00000004    /* Framing error */
+#define LEON_REG_PS2_STATUS_KI   0x00000008    /* Keyboard inhibit */
+
+/*
+ *  The following defines the bits in the LEON PS/2 Ctrl Registers.
+ */
+
+#define LEON_REG_PS2_CTRL_RE     0x00000001    /* Receiver enable */
+#define LEON_REG_PS2_CTRL_TE     0x00000002    /* Transmitter enable */
+#define LEON_REG_PS2_CTRL_RI     0x00000004    /* Keyboard receive interrupt  */
+#define LEON_REG_PS2_CTRL_TI     0x00000008    /* Keyboard transmit interrupt */
+
+typedef struct {
+       volatile unsigned int ilevel;
+       volatile unsigned int ipend;
+       volatile unsigned int iforce;
+       volatile unsigned int iclear;
+       volatile unsigned int mstatus;
+       volatile unsigned int notused[11];
+       volatile unsigned int cpu_mask[16];
+       volatile unsigned int cpu_force[16];
+} ambapp_dev_irqmp;
+
+typedef struct {
+       volatile unsigned int data;
+       volatile unsigned int status;
+       volatile unsigned int ctrl;
+       volatile unsigned int scaler;
+} ambapp_dev_apbuart;
+
+typedef struct {
+       volatile unsigned int val;
+       volatile unsigned int rld;
+       volatile unsigned int ctrl;
+       volatile unsigned int unused;
+} ambapp_dev_gptimer_element;
+
+#define LEON3_GPTIMER_CTRL_EN  0x1     /* Timer enable */
+#define LEON3_GPTIMER_CTRL_RS  0x2     /* Timer reStart  */
+#define LEON3_GPTIMER_CTRL_LD  0x4     /* Timer reLoad */
+#define LEON3_GPTIMER_CTRL_IE  0x8     /* interrupt enable */
+#define LEON3_GPTIMER_CTRL_IP  0x10    /* interrupt flag/pending */
+#define LEON3_GPTIMER_CTRL_CH  0x20    /* Chain with previous timer */
+
+typedef struct {
+       volatile unsigned int scalar;
+       volatile unsigned int scalar_reload;
+       volatile unsigned int config;
+       volatile unsigned int unused;
+       volatile ambapp_dev_gptimer_element e[8];
+} ambapp_dev_gptimer;
+
+typedef struct {
+       volatile unsigned int iodata;
+       volatile unsigned int ioout;
+       volatile unsigned int iodir;
+       volatile unsigned int irqmask;
+       volatile unsigned int irqpol;
+       volatile unsigned int irqedge;
+} ambapp_dev_ioport;
+
+typedef struct {
+       volatile unsigned int write;
+       volatile unsigned int dummy;
+       volatile unsigned int txcolor;
+       volatile unsigned int bgcolor;
+} ambapp_dev_textvga;
+
+typedef struct {
+       volatile unsigned int data;
+       volatile unsigned int status;
+       volatile unsigned int ctrl;
+} ambapp_dev_apbps2;
+
+typedef struct {
+       unsigned int mcfg1, mcfg2, mcfg3;
+} ambapp_dev_mctrl;
+
+typedef struct {
+       unsigned int sdcfg;
+} ambapp_dev_sdctrl;
+
+typedef struct {
+       unsigned int cfg1;
+       unsigned int cfg2;
+       unsigned int cfg3;
+} ambapp_dev_ddr2spa;
+
+typedef struct {
+       unsigned int ctrl;
+       unsigned int cfg;
+} ambapp_dev_ddrspa;
+
+#endif
+
+#endif
diff --git a/include/asm-arm/arch-at91cap9/AT91CAP9.h b/include/asm-arm/arch-at91cap9/AT91CAP9.h
deleted file mode 100644 (file)
index 02ef9a8..0000000
+++ /dev/null
@@ -1,518 +0,0 @@
-/*
- * (C) Copyright 2008
- * AT91CAP9 definitions
- * Author : ATMEL AT91 application group
- *
- * 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 AT91CAP9_H
-#define AT91CAP9_H
-
-typedef volatile unsigned int AT91_REG;
-
-/* Static Memory Controller */
-typedef struct _AT91S_SMC {
-       AT91_REG        SMC_SETUP0;     /* Setup Register for CS 0 */
-       AT91_REG        SMC_PULSE0;     /* Pulse Register for CS 0 */
-       AT91_REG        SMC_CYCLE0;     /* Cycle Register for CS 0 */
-       AT91_REG        SMC_CTRL0;      /* Control Register for CS 0 */
-       AT91_REG        SMC_SETUP1;     /* Setup Register for CS 1 */
-       AT91_REG        SMC_PULSE1;     /* Pulse Register for CS 1 */
-       AT91_REG        SMC_CYCLE1;     /* Cycle Register for CS 1 */
-       AT91_REG        SMC_CTRL1;      /* Control Register for CS 1 */
-       AT91_REG        SMC_SETUP2;     /* Setup Register for CS 2 */
-       AT91_REG        SMC_PULSE2;     /* Pulse Register for CS 2 */
-       AT91_REG        SMC_CYCLE2;     /* Cycle Register for CS 2 */
-       AT91_REG        SMC_CTRL2;      /* Control Register for CS 2 */
-       AT91_REG        SMC_SETUP3;     /* Setup Register for CS 3 */
-       AT91_REG        SMC_PULSE3;     /* Pulse Register for CS 3 */
-       AT91_REG        SMC_CYCLE3;     /* Cycle Register for CS 3 */
-       AT91_REG        SMC_CTRL3;      /* Control Register for CS 3 */
-       AT91_REG        SMC_SETUP4;     /* Setup Register for CS 4 */
-       AT91_REG        SMC_PULSE4;     /* Pulse Register for CS 4 */
-       AT91_REG        SMC_CYCLE4;     /* Cycle Register for CS 4 */
-       AT91_REG        SMC_CTRL4;      /* Control Register for CS 4 */
-       AT91_REG        SMC_SETUP5;     /* Setup Register for CS 5 */
-       AT91_REG        SMC_PULSE5;     /* Pulse Register for CS 5 */
-       AT91_REG        SMC_CYCLE5;     /* Cycle Register for CS 5 */
-       AT91_REG        SMC_CTRL5;      /* Control Register for CS 5 */
-       AT91_REG        SMC_SETUP6;     /* Setup Register for CS 6 */
-       AT91_REG        SMC_PULSE6;     /* Pulse Register for CS 6 */
-       AT91_REG        SMC_CYCLE6;     /* Cycle Register for CS 6 */
-       AT91_REG        SMC_CTRL6;      /* Control Register for CS 6 */
-       AT91_REG        SMC_SETUP7;     /* Setup Register for CS 7 */
-       AT91_REG        SMC_PULSE7;     /* Pulse Register for CS 7 */
-       AT91_REG        SMC_CYCLE7;     /* Cycle Register for CS 7 */
-       AT91_REG        SMC_CTRL7;      /* Control Register for CS 7 */
-} AT91S_SMC, *AT91PS_SMC;
-
-/* SMC_SETUP : (SMC Offset: 0x0) Setup Register for CS x */
-#define AT91C_SMC_NWESETUP     (0x3F <<  0)    /* NWE Setup Length */
-#define AT91C_SMC_NCSSETUPWR   (0x3F <<  8)    /* NCS Setup Length for WRite */
-#define AT91C_SMC_NRDSETUP     (0x3F << 16)    /* NRD Setup Length */
-#define AT91C_SMC_NCSSETUPRD   (0x3F << 24)    /* NCS Setup Length for ReaD */
-/* SMC_PULSE : (SMC Offset: 0x4) Pulse Register for CS x */
-#define AT91C_SMC_NWEPULSE     (0x7F <<  0)    /* NWE Pulse Length */
-#define AT91C_SMC_NCSPULSEWR   (0x7F <<  8)    /* NCS Pulse Length for WRite */
-#define AT91C_SMC_NRDPULSE     (0x7F << 16)    /* NRD Pulse Length */
-#define AT91C_SMC_NCSPULSERD   (0x7F << 24)    /* NCS Pulse Length for ReaD */
-/* SMC_CYC : (SMC Offset: 0x8) Cycle Register for CS x */
-#define AT91C_SMC_NWECYCLE     (0x1FF <<  0)   /* Total Write Cycle Length */
-#define AT91C_SMC_NRDCYCLE     (0x1FF << 16)   /* Total Read Cycle Length */
-/* SMC_CTRL : (SMC Offset: 0xc) Control Register for CS x */
-#define AT91C_SMC_READMODE     (0x1 <<  0)     /* Read Mode */
-#define AT91C_SMC_WRITEMODE    (0x1 <<  1)     /* Write Mode */
-#define AT91C_SMC_NWAITM       (0x3 <<  5)     /* NWAIT Mode */
-               /* External NWAIT disabled */
-#define                AT91C_SMC_NWAITM_NWAIT_DISABLE          (0x0 <<  5)
-               /* External NWAIT enabled in frozen mode */
-#define                AT91C_SMC_NWAITM_NWAIT_ENABLE_FROZEN    (0x2 <<  5)
-               /* External NWAIT enabled in ready mode */
-#define                AT91C_SMC_NWAITM_NWAIT_ENABLE_READY     (0x3 <<  5)
-#define AT91C_SMC_BAT          (0x1 <<  8)     /* Byte Access Type */
-               /*
-                * Write controled by ncs, nbs0, nbs1, nbs2, nbs3.
-                * Read controled by ncs, nrd, nbs0, nbs1, nbs2, nbs3.
-                */
-#define                AT91C_SMC_BAT_BYTE_SELECT               (0x0 <<  8)
-               /*
-                * Write controled by ncs, nwe0, nwe1, nwe2, nwe3.
-                * Read controled by ncs and nrd.
-                */
-#define                AT91C_SMC_BAT_BYTE_WRITE                (0x1 <<  8)
-#define AT91C_SMC_DBW          (0x3 << 12)     /* Data Bus Width */
-#define                AT91C_SMC_DBW_WIDTH_EIGTH_BITS          (0x0 << 12)
-#define                AT91C_SMC_DBW_WIDTH_SIXTEEN_BITS        (0x1 << 12)
-#define                AT91C_SMC_DBW_WIDTH_THIRTY_TWO_BITS     (0x2 << 12)
-#define AT91C_SMC_TDF          (0xF << 16)     /* Data Float Time */
-#define AT91C_SMC_TDFEN                (0x1 << 20)     /* TDF Enabled */
-#define AT91C_SMC_PMEN         (0x1 << 24)     /* Page Mode Enabled */
-#define AT91C_SMC_PS           (0x3 << 28)     /* Page Size */
-#define                AT91C_SMC_PS_SIZE_FOUR_BYTES            (0x0 << 28)
-#define                AT91C_SMC_PS_SIZE_EIGHT_BYTES           (0x1 << 28)
-#define                AT91C_SMC_PS_SIZE_SIXTEEN_BYTES         (0x2 << 28)
-#define                AT91C_SMC_PS_SIZE_THIRTY_TWO_BYTES      (0x3 << 28)
-/* SMC_SETUP : (SMC Offset: 0x10) Setup Register for CS x */
-/* SMC_PULSE : (SMC Offset: 0x14) Pulse Register for CS x */
-/* SMC_CYC : (SMC Offset: 0x18) Cycle Register for CS x */
-/* SMC_CTRL : (SMC Offset: 0x1c) Control Register for CS x */
-/* SMC_SETUP : (SMC Offset: 0x20) Setup Register for CS x */
-/* SMC_PULSE : (SMC Offset: 0x24) Pulse Register for CS x */
-/* SMC_CYC : (SMC Offset: 0x28) Cycle Register for CS x */
-/* SMC_CTRL : (SMC Offset: 0x2c) Control Register for CS x */
-/* SMC_SETUP : (SMC Offset: 0x30) Setup Register for CS x */
-/* SMC_PULSE : (SMC Offset: 0x34) Pulse Register for CS x */
-/* SMC_CYC : (SMC Offset: 0x38) Cycle Register for CS x */
-/* SMC_CTRL : (SMC Offset: 0x3c) Control Register for CS x */
-/* SMC_SETUP : (SMC Offset: 0x40) Setup Register for CS x */
-/* SMC_PULSE : (SMC Offset: 0x44) Pulse Register for CS x */
-/* SMC_CYC : (SMC Offset: 0x48) Cycle Register for CS x */
-/* SMC_CTRL : (SMC Offset: 0x4c) Control Register for CS x */
-/* SMC_SETUP : (SMC Offset: 0x50) Setup Register for CS x */
-/* SMC_PULSE : (SMC Offset: 0x54) Pulse Register for CS x */
-/* SMC_CYC : (SMC Offset: 0x58) Cycle Register for CS x */
-/* SMC_CTRL : (SMC Offset: 0x5c) Control Register for CS x */
-/* SMC_SETUP : (SMC Offset: 0x60) Setup Register for CS x */
-/* SMC_PULSE : (SMC Offset: 0x64) Pulse Register for CS x */
-/* SMC_CYC : (SMC Offset: 0x68) Cycle Register for CS x */
-/* SMC_CTRL : (SMC Offset: 0x6c) Control Register for CS x */
-/* SMC_SETUP : (SMC Offset: 0x70) Setup Register for CS x */
-/* SMC_PULSE : (SMC Offset: 0x74) Pulse Register for CS x */
-/* SMC_CYC : (SMC Offset: 0x78) Cycle Register for CS x */
-/* SMC_CTRL : (SMC Offset: 0x7c) Control Register for CS x */
-
-/* AHB CCFG */
-typedef struct _AT91S_CCFG {
-       AT91_REG        Reserved0[1];
-       AT91_REG        CCFG_MPBS0;     /* MPB Slave 0 */
-       AT91_REG        CCFG_UDPHS;     /* AHB Periphs */
-       AT91_REG        CCFG_MPBS1;     /* MPB Slave 1 */
-       AT91_REG        CCFG_EBICSA;    /* EBI Chip Select Assignement */
-       AT91_REG        Reserved1[2];
-       AT91_REG        CCFG_MPBS2;     /* MPB Slave 2 */
-       AT91_REG        CCFG_MPBS3;     /* MPB Slave 3 */
-       AT91_REG        CCFG_BRIDGE;    /* APB Bridge */
-       AT91_REG        Reserved2[49];
-       AT91_REG        CCFG_MATRIXVERSION;/* Version */
-} AT91S_CCFG, *AT91PS_CCFG;
-
-/* CCFG_UDPHS : (CCFG Offset: 0x8) UDPHS Configuration */
-#define AT91C_CCFG_UDPHS_UDP_SELECT    (0x1 << 31)     /* UDPHS or UDP */
-#define                AT91C_CCFG_UDPHS_UDP_SELECT_UDPHS       (0x0 << 31)
-#define                AT91C_CCFG_UDPHS_UDP_SELECT_UDP         (0x1 << 31)
-/* CCFG_EBICSA : (CCFG Offset: 0x10) EBI Chip Select Assignement Register */
-#define AT91C_EBI_CS1A                 (0x1 <<  1)     /* CS1 Assignment */
-#define                AT91C_EBI_CS1A_SMC                      (0x0 <<  1)
-#define                AT91C_EBI_CS1A_BCRAMC                   (0x1 <<  1)
-#define AT91C_EBI_CS3A                 (0x1 <<  3)     /* CS 3 Assignment */
-#define                AT91C_EBI_CS3A_SMC                      (0x0 <<  3)
-#define                AT91C_EBI_CS3A_SM                       (0x1 <<  3)
-#define AT91C_EBI_CS4A                 (0x1 <<  4)     /* CS4 Assignment */
-#define                AT91C_EBI_CS4A_SMC                      (0x0 <<  4)
-#define                AT91C_EBI_CS4A_CF                       (0x1 <<  4)
-#define AT91C_EBI_CS5A                 (0x1 <<  5)     /* CS 5 Assignment */
-#define                AT91C_EBI_CS5A_SMC                      (0x0 <<  5)
-#define                AT91C_EBI_CS5A_CF                       (0x1 <<  5)
-#define AT91C_EBI_DBPUC                        (0x1 <<  8)     /* Data Bus Pull-up */
-#define AT91C_EBI_DDRPUC               (0x1 <<  9)     /* DDDR DQS Pull-up */
-#define AT91C_EBI_SUP                  (0x1 << 16)     /* EBI Supply */
-#define                AT91C_EBI_SUP_1V8                       (0x0 << 16)
-#define                AT91C_EBI_SUP_3V3                       (0x1 << 16)
-#define AT91C_EBI_LP                   (0x1 << 17)     /* EBI Low Power */
-#define                AT91C_EBI_LP_LOW_DRIVE                  (0x0 << 17)
-#define                AT91C_EBI_LP_STD_DRIVE                  (0x1 << 17)
-#define AT91C_CCFG_DDR_SDR_SELECT      (0x1 << 31)     /* DDR or SDR */
-#define                AT91C_CCFG_DDR_SDR_SELECT_DDR           (0x0 << 31)
-#define                AT91C_CCFG_DDR_SDR_SELECT_SDR           (0x1 << 31)
-/* CCFG_BRIDGE : (CCFG Offset: 0x24) BRIDGE Configuration */
-#define AT91C_CCFG_AES_TDES_SELECT     (0x1 << 31)     /* AES or TDES */
-#define                AT91C_CCFG_AES_TDES_SELECT_AES          (0x0 << 31)
-#define                AT91C_CCFG_AES_TDES_SELECT_TDES         (0x1 << 31)
-
-/* PIO controller */
-typedef struct _AT91S_PIO {
-       AT91_REG        PIO_PER;        /* PIO Enable Register */
-       AT91_REG        PIO_PDR;        /* PIO Disable Register */
-       AT91_REG        PIO_PSR;        /* PIO Status Register */
-       AT91_REG        Reserved0[1];
-       AT91_REG        PIO_OER;        /* Output Enable Register */
-       AT91_REG        PIO_ODR;        /* Output Disable Register */
-       AT91_REG        PIO_OSR;        /* Output Status Register */
-       AT91_REG        Reserved1[1];
-       AT91_REG        PIO_IFER;       /* Input Filter Enable Register */
-       AT91_REG        PIO_IFDR;       /* Input Filter Disable Register */
-       AT91_REG        PIO_IFSR;       /* Input Filter Status Register */
-       AT91_REG        Reserved2[1];
-       AT91_REG        PIO_SODR;       /* Set Output Data Register */
-       AT91_REG        PIO_CODR;       /* Clear Output Data Register */
-       AT91_REG        PIO_ODSR;       /* Output Data Status Register */
-       AT91_REG        PIO_PDSR;       /* Pin Data Status Register */
-       AT91_REG        PIO_IER;        /* Interrupt Enable Register */
-       AT91_REG        PIO_IDR;        /* Interrupt Disable Register */
-       AT91_REG        PIO_IMR;        /* Interrupt Mask Register */
-       AT91_REG        PIO_ISR;        /* Interrupt Status Register */
-       AT91_REG        PIO_MDER;       /* Multi-driver Enable Register */
-       AT91_REG        PIO_MDDR;       /* Multi-driver Disable Register */
-       AT91_REG        PIO_MDSR;       /* Multi-driver Status Register */
-       AT91_REG        Reserved3[1];
-       AT91_REG        PIO_PPUDR;      /* Pull-up Disable Register */
-       AT91_REG        PIO_PPUER;      /* Pull-up Enable Register */
-       AT91_REG        PIO_PPUSR;      /* Pull-up Status Register */
-       AT91_REG        Reserved4[1];
-       AT91_REG        PIO_ASR;        /* Select A Register */
-       AT91_REG        PIO_BSR;        /* Select B Register */
-       AT91_REG        PIO_ABSR;       /* AB Select Status Register */
-       AT91_REG        Reserved5[9];
-       AT91_REG        PIO_OWER;       /* Output Write Enable Register */
-       AT91_REG        PIO_OWDR;       /* Output Write Disable Register */
-       AT91_REG        PIO_OWSR;       /* Output Write Status Register */
-} AT91S_PIO, *AT91PS_PIO;
-
-/* Power Management Controller */
-typedef struct _AT91S_PMC {
-       AT91_REG        PMC_SCER;       /* System Clock Enable Register */
-       AT91_REG        PMC_SCDR;       /* System Clock Disable Register */
-       AT91_REG        PMC_SCSR;       /* System Clock Status Register */
-       AT91_REG        Reserved0[1];
-       AT91_REG        PMC_PCER;       /* Peripheral Clock Enable Register */
-       AT91_REG        PMC_PCDR;       /* Peripheral Clock Disable Register */
-       AT91_REG        PMC_PCSR;       /* Peripheral Clock Status Register */
-       AT91_REG        PMC_UCKR;       /* UTMI Clock Configuration Register */
-       AT91_REG        PMC_MOR;        /* Main Oscillator Register */
-       AT91_REG        PMC_MCFR;       /* Main Clock  Frequency Register */
-       AT91_REG        PMC_PLLAR;      /* PLL A Register */
-       AT91_REG        PMC_PLLBR;      /* PLL B Register */
-       AT91_REG        PMC_MCKR;       /* Master Clock Register */
-       AT91_REG        Reserved1[3];
-       AT91_REG        PMC_PCKR[8];    /* Programmable Clock Register */
-       AT91_REG        PMC_IER;        /* Interrupt Enable Register */
-       AT91_REG        PMC_IDR;        /* Interrupt Disable Register */
-       AT91_REG        PMC_SR;         /* Status Register */
-       AT91_REG        PMC_IMR;        /* Interrupt Mask Register */
-} AT91S_PMC, *AT91PS_PMC;
-
-/* PMC_SCER : (PMC Offset: 0x0) System Clock Enable Register */
-#define AT91C_PMC_PCK          (0x1 <<  0)     /* Processor Clock */
-#define AT91C_PMC_OTG          (0x1 <<  5)     /* USB OTG Clock */
-#define AT91C_PMC_UHP          (0x1 <<  6)     /* USB Host Port Clock */
-#define AT91C_PMC_UDP          (0x1 <<  7)     /* USB Device Port Clock */
-#define AT91C_PMC_PCK0         (0x1 <<  8)     /* Programmable Clock Output */
-#define AT91C_PMC_PCK1         (0x1 <<  9)     /* Programmable Clock Output */
-#define AT91C_PMC_PCK2         (0x1 << 10)     /* Programmable Clock Output */
-#define AT91C_PMC_PCK3         (0x1 << 11)     /* Programmable Clock Output */
-/* PMC_SCDR : (PMC Offset: 0x4) System Clock Disable Register */
-/* PMC_SCSR : (PMC Offset: 0x8) System Clock Status Register */
-/* CKGR_UCKR : (PMC Offset: 0x1c) UTMI Clock Configuration Register */
-/* CKGR_MOR : (PMC Offset: 0x20) Main Oscillator Register */
-/* CKGR_MCFR : (PMC Offset: 0x24) Main Clock Frequency Register */
-/* CKGR_PLLAR : (PMC Offset: 0x28) PLL A Register */
-/* CKGR_PLLBR : (PMC Offset: 0x2c) PLL B Register */
-/* PMC_MCKR : (PMC Offset: 0x30) Master Clock Register */
-#define AT91C_PMC_CSS          (0x3 <<  0)     /* Clock Selection */
-#define                AT91C_PMC_CSS_SLOW_CLK          (0x0 <<  0)     /* Slow Clk */
-#define                AT91C_PMC_CSS_MAIN_CLK          (0x1 <<  0)     /* Main Clk */
-#define                AT91C_PMC_CSS_PLLA_CLK          (0x2 <<  0)     /* PLL A Clk */
-#define                AT91C_PMC_CSS_PLLB_CLK          (0x3 <<  0)     /* PLL B Clk */
-#define AT91C_PMC_PRES         (0x7 <<  2)     /* Clock Prescaler */
-#define                AT91C_PMC_PRES_CLK              (0x0 <<  2)
-#define                AT91C_PMC_PRES_CLK_2            (0x1 <<  2)
-#define                AT91C_PMC_PRES_CLK_4            (0x2 <<  2)
-#define                AT91C_PMC_PRES_CLK_8            (0x3 <<  2)
-#define                AT91C_PMC_PRES_CLK_16           (0x4 <<  2)
-#define                AT91C_PMC_PRES_CLK_32           (0x5 <<  2)
-#define                AT91C_PMC_PRES_CLK_64           (0x6 <<  2)
-#define AT91C_PMC_MDIV         (0x3 <<  8)     /* Master Clock Division */
-#define                AT91C_PMC_MDIV_1                (0x0 <<  8)
-#define                AT91C_PMC_MDIV_2                (0x1 <<  8)
-#define                AT91C_PMC_MDIV_4                (0x2 <<  8)
-/* PMC_PCKR : (PMC Offset: 0x40) Programmable Clock Register */
-/* PMC_IER : (PMC Offset: 0x60) PMC Interrupt Enable Register */
-#define AT91C_PMC_MOSCS                (0x1 <<  0)     /* MOSC mask */
-#define AT91C_PMC_LOCKA                (0x1 <<  1)     /* PLL A mask */
-#define AT91C_PMC_LOCKB                (0x1 <<  2)     /* PLL B mask */
-#define AT91C_PMC_MCKRDY       (0x1 <<  3)     /* Master mask */
-#define AT91C_PMC_LOCKU                (0x1 <<  6)     /* PLL UTMI mask */
-#define AT91C_PMC_PCK0RDY      (0x1 <<  8)     /* PCK0_RDY mask */
-#define AT91C_PMC_PCK1RDY      (0x1 <<  9)     /* PCK1_RDY mask */
-#define AT91C_PMC_PCK2RDY      (0x1 << 10)     /* PCK2_RDY mask */
-#define AT91C_PMC_PCK3RDY      (0x1 << 11)     /* PCK3_RDY mask */
-/* PMC_IDR : (PMC Offset: 0x64) PMC Interrupt Disable Register */
-/* PMC_SR : (PMC Offset: 0x68) PMC Status Register */
-/* PMC_IMR : (PMC Offset: 0x6c) PMC Interrupt Mask Register */
-
-/* Reset controller */
-typedef struct _AT91S_RSTC {
-       AT91_REG        RSTC_RCR;       /* Reset Control Register */
-       AT91_REG        RSTC_RSR;       /* Reset Status Register */
-       AT91_REG        RSTC_RMR;       /* Reset Mode Register */
-} AT91S_RSTC, *AT91PS_RSTC;
-
-/* RSTC_RCR : (RSTC Offset: 0x0) Reset Control Register */
-#define AT91C_RSTC_PROCRST     (0x1 <<  0)     /* Processor Reset */
-#define AT91C_RSTC_ICERST      (0x1 <<  1)     /* ICE Interface Reset */
-#define AT91C_RSTC_PERRST      (0x1 <<  2)     /* Peripheral Reset */
-#define AT91C_RSTC_EXTRST      (0x1 <<  3)     /* External Reset */
-#define AT91C_RSTC_KEY         (0xFF << 24)    /* Password */
-/* RSTC_RSR : (RSTC Offset: 0x4) Reset Status Register */
-#define AT91C_RSTC_URSTS       (0x1 <<  0)     /* User Reset Status */
-#define AT91C_RSTC_RSTTYP      (0x7 <<  8)     /* Reset Type */
-#define                AT91C_RSTC_RSTTYP_GENERAL       (0x0 <<  8)
-#define                AT91C_RSTC_RSTTYP_WAKEUP        (0x1 <<  8)
-#define                AT91C_RSTC_RSTTYP_WATCHDOG      (0x2 <<  8)
-#define                AT91C_RSTC_RSTTYP_SOFTWARE      (0x3 <<  8)
-#define                AT91C_RSTC_RSTTYP_USER          (0x4 <<  8)
-#define AT91C_RSTC_NRSTL       (0x1 << 16)     /* NRST pin level */
-#define AT91C_RSTC_SRCMP       (0x1 << 17)     /* Software Rst in Progress. */
-/* RSTC_RMR : (RSTC Offset: 0x8) Reset Mode Register */
-#define AT91C_RSTC_URSTEN      (0x1 <<  0)     /* User Reset Enable */
-#define AT91C_RSTC_URSTIEN     (0x1 <<  4)     /* User Reset Int. Enable */
-#define AT91C_RSTC_ERSTL       (0xF <<  8)     /* User Reset Enable */
-
-/* Periodic Timer Controller */
-typedef struct _AT91S_PITC {
-       AT91_REG        PITC_PIMR;      /* Period Interval Mode Register */
-       AT91_REG        PITC_PISR;      /* Period Interval Status Register */
-       AT91_REG        PITC_PIVR;      /* Period Interval Value Register */
-       AT91_REG        PITC_PIIR;      /* Period Interval Image Register */
-} AT91S_PITC, *AT91PS_PITC;
-
-/* PITC_PIMR : (PITC Offset: 0x0) Periodic Interval Mode Register */
-#define AT91C_PITC_PIV         (0xFFFFF <<  0) /* Periodic Interval Value */
-#define AT91C_PITC_PITEN       (0x1 << 24)     /* PIT Enable */
-#define AT91C_PITC_PITIEN      (0x1 << 25)     /* PIT Interrupt Enable */
-/* PITC_PISR : (PITC Offset: 0x4) Periodic Interval Status Register */
-#define AT91C_PITC_PITS                (0x1 <<  0)     /* PIT Status */
-/* PITC_PIVR : (PITC Offset: 0x8) Periodic Interval Value Register */
-#define AT91C_PITC_CPIV                (0xFFFFF <<  0) /* Current Value */
-#define AT91C_PITC_PICNT       (0xFFF << 20)   /* Periodic Interval Counter */
-/* PITC_PIIR : (PITC Offset: 0xc) Periodic Interval Image Register */
-
-/* Serial Paraller Interface */
-typedef struct _AT91S_SPI {
-       AT91_REG        SPI_CR;         /* Control Register */
-       AT91_REG        SPI_MR;         /* Mode Register */
-       AT91_REG        SPI_RDR;        /* Receive Data Register */
-       AT91_REG        SPI_TDR;        /* Transmit Data Register */
-       AT91_REG        SPI_SR;         /* Status Register */
-       AT91_REG        SPI_IER;        /* Interrupt Enable Register */
-       AT91_REG        SPI_IDR;        /* Interrupt Disable Register */
-       AT91_REG        SPI_IMR;        /* Interrupt Mask Register */
-       AT91_REG        Reserved0[4];
-       AT91_REG        SPI_CSR[4];     /* Chip Select Register */
-       AT91_REG        Reserved1[48];
-       AT91_REG        SPI_RPR;        /* Receive Pointer Register */
-       AT91_REG        SPI_RCR;        /* Receive Counter Register */
-       AT91_REG        SPI_TPR;        /* Transmit Pointer Register */
-       AT91_REG        SPI_TCR;        /* Transmit Counter Register */
-       AT91_REG        SPI_RNPR;       /* Receive Next Pointer Register */
-       AT91_REG        SPI_RNCR;       /* Receive Next Counter Register */
-       AT91_REG        SPI_TNPR;       /* Transmit Next Pointer Register */
-       AT91_REG        SPI_TNCR;       /* Transmit Next Counter Register */
-       AT91_REG        SPI_PTCR;       /* PDC Transfer Control Register */
-       AT91_REG        SPI_PTSR;       /* PDC Transfer Status Register */
-} AT91S_SPI, *AT91PS_SPI;
-
-/* SPI_CR : (SPI Offset: 0x0) SPI Control Register */
-#define AT91C_SPI_SPIEN                (0x1 <<  0)     /* SPI Enable */
-#define AT91C_SPI_SPIDIS       (0x1 <<  1)     /* SPI Disable */
-#define AT91C_SPI_SWRST                (0x1 <<  7)     /* SPI Software reset */
-#define AT91C_SPI_LASTXFER     (0x1 << 24)     /* SPI Last Transfer */
-/* SPI_MR : (SPI Offset: 0x4) SPI Mode Register */
-#define AT91C_SPI_MSTR         (0x1 <<  0)     /* Master/Slave Mode */
-#define AT91C_SPI_PS           (0x1 <<  1)     /* Peripheral Select */
-#define                AT91C_SPI_PS_FIXED              (0x0 <<  1)
-#define                AT91C_SPI_PS_VARIABLE           (0x1 <<  1)
-#define AT91C_SPI_PCSDEC       (0x1 <<  2)     /* Chip Select Decode */
-#define AT91C_SPI_FDIV         (0x1 <<  3)     /* Clock Selection */
-#define AT91C_SPI_MODFDIS      (0x1 <<  4)     /* Mode Fault Detection */
-#define AT91C_SPI_LLB          (0x1 <<  7)     /* Clock Selection */
-#define AT91C_SPI_PCS          (0xF << 16)     /* Peripheral Chip Select */
-#define AT91C_SPI_DLYBCS       (0xFF << 24)    /* Delay Between Chip Selects */
-/* SPI_RDR : (SPI Offset: 0x8) Receive Data Register */
-#define AT91C_SPI_RD           (0xFFFF <<  0)  /* Receive Data */
-#define AT91C_SPI_RPCS         (0xF << 16)     /* Peripheral CS Status */
-/* SPI_TDR : (SPI Offset: 0xc) Transmit Data Register */
-#define AT91C_SPI_TD           (0xFFFF <<  0)  /* Transmit Data */
-#define AT91C_SPI_TPCS         (0xF << 16)     /* Peripheral CS Status */
-/* SPI_SR : (SPI Offset: 0x10) Status Register */
-#define AT91C_SPI_RDRF         (0x1 <<  0)     /* Receive Data Register Full */
-#define AT91C_SPI_TDRE         (0x1 <<  1)     /* Trans. Data Register Empty */
-#define AT91C_SPI_MODF         (0x1 <<  2)     /* Mode Fault Error */
-#define AT91C_SPI_OVRES                (0x1 <<  3)     /* Overrun Error Status */
-#define AT91C_SPI_ENDRX                (0x1 <<  4)     /* End of Receiver Transfer */
-#define AT91C_SPI_ENDTX                (0x1 <<  5)     /* End of Receiver Transfer */
-#define AT91C_SPI_RXBUFF       (0x1 <<  6)     /* RXBUFF Interrupt */
-#define AT91C_SPI_TXBUFE       (0x1 <<  7)     /* TXBUFE Interrupt */
-#define AT91C_SPI_NSSR         (0x1 <<  8)     /* NSSR Interrupt */
-#define AT91C_SPI_TXEMPTY      (0x1 <<  9)     /* TXEMPTY Interrupt */
-#define AT91C_SPI_SPIENS       (0x1 << 16)     /* Enable Status */
-/* SPI_IER : (SPI Offset: 0x14) Interrupt Enable Register */
-/* SPI_IDR : (SPI Offset: 0x18) Interrupt Disable Register */
-/* SPI_IMR : (SPI Offset: 0x1c) Interrupt Mask Register */
-/* SPI_CSR : (SPI Offset: 0x30) Chip Select Register */
-#define AT91C_SPI_CPOL         (0x1 <<  0)     /* Clock Polarity */
-#define AT91C_SPI_NCPHA                (0x1 <<  1)     /* Clock Phase */
-#define AT91C_SPI_CSAAT                (0x1 <<  3)     /* CS Active After Transfer */
-#define AT91C_SPI_BITS         (0xF <<  4)     /* Bits Per Transfer */
-#define                AT91C_SPI_BITS_8                (0x0 <<  4)     /* 8 Bits */
-#define                AT91C_SPI_BITS_9                (0x1 <<  4)     /* 9 Bits */
-#define                AT91C_SPI_BITS_10               (0x2 <<  4)     /* 10 Bits */
-#define                AT91C_SPI_BITS_11               (0x3 <<  4)     /* 11 Bits */
-#define                AT91C_SPI_BITS_12               (0x4 <<  4)     /* 12 Bits */
-#define                AT91C_SPI_BITS_13               (0x5 <<  4)     /* 13 Bits */
-#define                AT91C_SPI_BITS_14               (0x6 <<  4)     /* 14 Bits */
-#define                AT91C_SPI_BITS_15               (0x7 <<  4)     /* 15 Bits */
-#define                AT91C_SPI_BITS_16               (0x8 <<  4)     /* 16 Bits */
-#define AT91C_SPI_SCBR         (0xFF <<  8)    /* Serial Clock Baud Rate */
-#define AT91C_SPI_DLYBS                (0xFF << 16)    /* Delay Before SPCK */
-#define AT91C_SPI_DLYBCT       (0xFF << 24)    /* Delay Between Transfers */
-/* SPI_PTCR : PDC Transfer Control Register */
-#define AT91C_PDC_RXTEN                (0x1 <<  0)     /* Receiver Transfer Enable */
-#define AT91C_PDC_RXTDIS       (0x1 <<  1)     /* Receiver Transfer Disable */
-#define AT91C_PDC_TXTEN                (0x1 <<  8)     /* Transm. Transfer Enable */
-#define AT91C_PDC_TXTDIS       (0x1 <<  9)     /* Transm. Transfer Disable */
-
-/* PIO definitions */
-#define AT91C_PIO_PA0          (1 <<  0)       /* Pin Controlled by PA0 */
-#define AT91C_PA0_SPI0_MISO    AT91C_PIO_PA0
-#define AT91C_PIO_PA1          (1 <<  1)       /* Pin Controlled by PA1 */
-#define AT91C_PA1_SPI0_MOSI    AT91C_PIO_PA1
-#define AT91C_PIO_PA2          (1 <<  2)       /* Pin Controlled by PA2 */
-#define AT91C_PA2_SPI0_SPCK    AT91C_PIO_PA2
-#define AT91C_PIO_PA3          (1 <<  3)       /* Pin Controlled by PA3 */
-#define AT91C_PA3_SPI0_NPCS1   AT91C_PIO_PA3
-#define AT91C_PIO_PA4          (1 <<  4)       /* Pin Controlled by PA4 */
-#define AT91C_PA4_SPI0_NPCS2A  AT91C_PIO_PA4
-#define AT91C_PIO_PA5          (1 <<  5)       /* Pin Controlled by PA5 */
-#define AT91C_PA5_SPI0_NPCS0   AT91C_PIO_PA5
-#define AT91C_PIO_PA10         (1 << 10)       /* Pin Controlled by PA10 */
-#define AT91C_PIO_PA11         (1 << 11)       /* Pin Controlled by PA11 */
-#define AT91C_PIO_PA22         (1 << 22)       /* Pin Controlled by PA22 */
-#define AT91C_PA22_TXD0                AT91C_PIO_PA22
-#define AT91C_PIO_PA23         (1 << 23)       /* Pin Controlled by PA23 */
-#define AT91C_PA23_RXD0                AT91C_PIO_PA23
-#define AT91C_PIO_PA28         (1 << 28)       /* Pin Controlled by PA28 */
-#define AT91C_PA28_SPI0_NPCS3A AT91C_PIO_PA28
-#define AT91C_PIO_PB21         (1 << 21)       /* Pin Controlled by PB21 */
-#define AT91C_PB21_E_TXCK      AT91C_PIO_PB21
-#define AT91C_PIO_PB22         (1 << 22)       /* Pin Controlled by PB22 */
-#define AT91C_PB22_E_RXDV      AT91C_PIO_PB22
-#define AT91C_PIO_PB23         (1 << 23)       /* Pin Controlled by PB23 */
-#define AT91C_PB23_E_TX0       AT91C_PIO_PB23
-#define AT91C_PIO_PB24         (1 << 24)       /* Pin Controlled by PB24 */
-#define AT91C_PB24_E_TX1       AT91C_PIO_PB24
-#define AT91C_PIO_PB25         (1 << 25)       /* Pin Controlled by PB25 */
-#define AT91C_PB25_E_RX0       AT91C_PIO_PB25
-#define AT91C_PIO_PB26         (1 << 26)       /* Pin Controlled by PB26 */
-#define AT91C_PB26_E_RX1       AT91C_PIO_PB26
-#define AT91C_PIO_PB27         (1 << 27)       /* Pin Controlled by PB27 */
-#define AT91C_PB27_E_RXER      AT91C_PIO_PB27
-#define AT91C_PIO_PB28         (1 << 28)       /* Pin Controlled by PB28 */
-#define AT91C_PB28_E_TXEN      AT91C_PIO_PB28
-#define AT91C_PIO_PB29         (1 << 29)       /* Pin Controlled by PB29 */
-#define AT91C_PB29_E_MDC       AT91C_PIO_PB29
-#define AT91C_PIO_PB30         (1 << 30)       /* Pin Controlled by PB30 */
-#define AT91C_PB30_E_MDIO      AT91C_PIO_PB30
-#define AT91C_PIO_PB31         (1 << 31)       /* Pin Controlled by PB31 */
-#define AT91C_PIO_PC29         (1 << 29)       /* Pin Controlled by PC29 */
-#define AT91C_PIO_PC30         (1 << 30)       /* Pin Controlled by PC30 */
-#define AT91C_PC30_DRXD                AT91C_PIO_PC30
-#define AT91C_PIO_PC31         (1 << 31)       /* Pin Controlled by PC31 */
-#define AT91C_PC31_DTXD                AT91C_PIO_PC31
-#define AT91C_PIO_PD0          (1 <<  0)       /* Pin Controlled by PD0 */
-#define AT91C_PD0_TXD1         AT91C_PIO_PD0
-#define AT91C_PD0_SPI0_NPCS2D  AT91C_PIO_PD0
-#define AT91C_PIO_PD1          (1 <<  1)       /* Pin Controlled by PD1 */
-#define AT91C_PD1_RXD1         AT91C_PIO_PD1
-#define AT91C_PD1_SPI0_NPCS3D  AT91C_PIO_PD1
-#define AT91C_PIO_PD2          (1 <<  2)       /* Pin Controlled by PD2 */
-#define AT91C_PD2_TXD2         AT91C_PIO_PD2
-#define AT91C_PIO_PD3          (1 <<  3)       /* Pin Controlled by PD3 */
-#define AT91C_PD3_RXD2         AT91C_PIO_PD3
-#define AT91C_PIO_PD15         (1 << 15)       /* Pin Controlled by PD15 */
-
-/* Peripheral ID */
-#define AT91C_ID_SYS            1      /* System Controller */
-#define AT91C_ID_PIOABCD        2      /* Parallel IO Controller A, B, C, D */
-#define AT91C_ID_US0            8      /* USART 0 */
-#define AT91C_ID_US1            9      /* USART 1 */
-#define AT91C_ID_US2           10      /* USART 2 */
-#define AT91C_ID_SPI0          15      /* Serial Peripheral Interface 0 */
-#define AT91C_ID_EMAC          22      /* Ethernet Mac */
-#define AT91C_ID_UHP           29      /* USB Host Port */
-
-/* Base addresses */
-#define AT91C_BASE_SMC         ((AT91PS_SMC)   0xFFFFE800)     /* SMC */
-#define AT91C_BASE_CCFG                ((AT91PS_CCFG)  0xFFFFEB10)     /* CCFG */
-#define AT91C_BASE_DBGU                ((unsigned long)0xFFFFEE00)     /* DBGU */
-#define AT91C_BASE_PIOA                ((AT91PS_PIO)   0xFFFFF200)     /* PIOA */
-#define AT91C_BASE_PIOB                ((AT91PS_PIO)   0xFFFFF400)     /* PIOB */
-#define AT91C_BASE_PIOC                ((AT91PS_PIO)   0xFFFFF600)     /* PIOC */
-#define AT91C_BASE_PIOD                ((AT91PS_PIO)   0xFFFFF800)     /* PIOD */
-#define AT91C_BASE_PMC         ((AT91PS_PMC)   0xFFFFFC00)     /* PMC */
-#define AT91C_BASE_RSTC                ((AT91PS_RSTC)  0xFFFFFD00)     /* RSTC */
-#define AT91C_BASE_PITC                ((AT91PS_PITC)  0xFFFFFD30)     /* PITC */
-#define AT91C_BASE_US0         ((unsigned long)0xFFF8C000)     /* US0 */
-#define AT91C_BASE_US1         ((unsigned long)0xFFF90000)     /* US1 */
-#define AT91C_BASE_US2         ((unsigned long)0xFFF94000)     /* US2 */
-#define AT91C_BASE_SPI0                ((AT91PS_SPI)   0xFFFA4000)     /* SPI0 */
-#define AT91C_BASE_MACB                ((unsigned long)0xFFFBC000)     /* MACB */
-
-#endif
diff --git a/include/asm-arm/arch-at91cap9/hardware.h b/include/asm-arm/arch-at91cap9/hardware.h
deleted file mode 100644 (file)
index ec0a671..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * (C) Copyright 2007
- * Stelian Pop <stelian.pop <at> leadtechdesign.com>
- * Lead Tech Design <www.leadtechdesign.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-#ifndef __ASM_ARCH_HARDWARE_H
-#define __ASM_ARCH_HARDWARE_H
-
-#include <asm/sizes.h>
-
-#include <asm/arch/AT91CAP9.h>
-
-/*
- * container_of - cast a member of a structure out to the containing structure
- *
- * @ptr:       the pointer to the member.
- * @type:      the type of the container struct this is embedded in.
- * @member:    the name of the member within the struct.
- */
-#define container_of(ptr, type, member) ({                     \
-       const typeof(((type *)0)->member) *__mptr = (ptr);      \
-       (type *)((char *)__mptr - offsetof(type, member)); })
-
-#endif
diff --git a/include/asm-arm/arch-at91sam9/at91_pio.h b/include/asm-arm/arch-at91sam9/at91_pio.h
new file mode 100644 (file)
index 0000000..84c3866
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * include/asm-arm/arch-at91/at91_pio.h
+ *
+ * Copyright (C) 2005 Ivan Kokshaysky
+ * Copyright (C) SAN People
+ *
+ * Parallel I/O Controller (PIO) - System peripherals registers.
+ * Based on AT91RM9200 datasheet revision E.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef AT91_PIO_H
+#define AT91_PIO_H
+
+#define PIO_PER                0x00    /* Enable Register */
+#define PIO_PDR                0x04    /* Disable Register */
+#define PIO_PSR                0x08    /* Status Register */
+#define PIO_OER                0x10    /* Output Enable Register */
+#define PIO_ODR                0x14    /* Output Disable Register */
+#define PIO_OSR                0x18    /* Output Status Register */
+#define PIO_IFER       0x20    /* Glitch Input Filter Enable */
+#define PIO_IFDR       0x24    /* Glitch Input Filter Disable */
+#define PIO_IFSR       0x28    /* Glitch Input Filter Status */
+#define PIO_SODR       0x30    /* Set Output Data Register */
+#define PIO_CODR       0x34    /* Clear Output Data Register */
+#define PIO_ODSR       0x38    /* Output Data Status Register */
+#define PIO_PDSR       0x3c    /* Pin Data Status Register */
+#define PIO_IER                0x40    /* Interrupt Enable Register */
+#define PIO_IDR                0x44    /* Interrupt Disable Register */
+#define PIO_IMR                0x48    /* Interrupt Mask Register */
+#define PIO_ISR                0x4c    /* Interrupt Status Register */
+#define PIO_MDER       0x50    /* Multi-driver Enable Register */
+#define PIO_MDDR       0x54    /* Multi-driver Disable Register */
+#define PIO_MDSR       0x58    /* Multi-driver Status Register */
+#define PIO_PUDR       0x60    /* Pull-up Disable Register */
+#define PIO_PUER       0x64    /* Pull-up Enable Register */
+#define PIO_PUSR       0x68    /* Pull-up Status Register */
+#define PIO_ASR                0x70    /* Peripheral A Select Register */
+#define PIO_BSR                0x74    /* Peripheral B Select Register */
+#define PIO_ABSR       0x78    /* AB Status Register */
+#define PIO_OWER       0xa0    /* Output Write Enable Register */
+#define PIO_OWDR       0xa4    /* Output Write Disable Register */
+#define PIO_OWSR       0xa8    /* Output Write Status Register */
+
+#endif
diff --git a/include/asm-arm/arch-at91sam9/at91_pit.h b/include/asm-arm/arch-at91sam9/at91_pit.h
new file mode 100644 (file)
index 0000000..5026325
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * include/asm-arm/arch-at91/at91_pit.h
+ *
+ * Periodic Interval Timer (PIT) - System peripherals regsters.
+ * Based on AT91SAM9261 datasheet revision D.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef AT91_PIT_H
+#define AT91_PIT_H
+
+#define AT91_PIT_MR            (AT91_PIT + 0x00)       /* Mode Register */
+#define                AT91_PIT_PITIEN         (1 << 25)               /* Timer Interrupt Enable */
+#define                AT91_PIT_PITEN          (1 << 24)               /* Timer Enabled */
+#define                AT91_PIT_PIV            (0xfffff)               /* Periodic Interval Value */
+
+#define AT91_PIT_SR            (AT91_PIT + 0x04)       /* Status Register */
+#define                AT91_PIT_PITS           (1 << 0)                /* Timer Status */
+
+#define AT91_PIT_PIVR          (AT91_PIT + 0x08)       /* Periodic Interval Value Register */
+#define AT91_PIT_PIIR          (AT91_PIT + 0x0c)       /* Periodic Interval Image Register */
+#define                AT91_PIT_PICNT          (0xfff << 20)           /* Interval Counter */
+#define                AT91_PIT_CPIV           (0xfffff)               /* Inverval Value */
+
+#endif
diff --git a/include/asm-arm/arch-at91sam9/at91_pmc.h b/include/asm-arm/arch-at91sam9/at91_pmc.h
new file mode 100644 (file)
index 0000000..52cd8e5
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * include/asm-arm/arch-at91/at91_pmc.h
+ *
+ * Copyright (C) 2005 Ivan Kokshaysky
+ * Copyright (C) SAN People
+ *
+ * Power Management Controller (PMC) - System peripherals registers.
+ * Based on AT91RM9200 datasheet revision E.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef AT91_PMC_H
+#define AT91_PMC_H
+
+#define        AT91_PMC_SCER           (AT91_PMC + 0x00)       /* System Clock Enable Register */
+#define        AT91_PMC_SCDR           (AT91_PMC + 0x04)       /* System Clock Disable Register */
+
+#define        AT91_PMC_SCSR           (AT91_PMC + 0x08)       /* System Clock Status Register */
+#define                AT91_PMC_PCK            (1 <<  0)               /* Processor Clock */
+#define                AT91RM9200_PMC_UDP      (1 <<  1)               /* USB Devcice Port Clock [AT91RM9200 only] */
+#define                AT91RM9200_PMC_MCKUDP   (1 <<  2)               /* USB Device Port Master Clock Automatic Disable on Suspend [AT91RM9200 only] */
+#define                AT91RM9200_PMC_UHP      (1 <<  4)               /* USB Host Port Clock [AT91RM9200 only] */
+#define                AT91SAM926x_PMC_UHP     (1 <<  6)               /* USB Host Port Clock [AT91SAM926x only] */
+#define                AT91CAP9_PMC_UHP        (1 <<  6)               /* USB Host Port Clock [AT91CAP9 only] */
+#define                AT91SAM926x_PMC_UDP     (1 <<  7)               /* USB Devcice Port Clock [AT91SAM926x only] */
+#define                AT91_PMC_PCK0           (1 <<  8)               /* Programmable Clock 0 */
+#define                AT91_PMC_PCK1           (1 <<  9)               /* Programmable Clock 1 */
+#define                AT91_PMC_PCK2           (1 << 10)               /* Programmable Clock 2 */
+#define                AT91_PMC_PCK3           (1 << 11)               /* Programmable Clock 3 */
+#define                AT91_PMC_HCK0           (1 << 16)               /* AHB Clock (USB host) [AT91SAM9261 only] */
+#define                AT91_PMC_HCK1           (1 << 17)               /* AHB Clock (LCD) [AT91SAM9261 only] */
+
+#define        AT91_PMC_PCER           (AT91_PMC + 0x10)       /* Peripheral Clock Enable Register */
+#define        AT91_PMC_PCDR           (AT91_PMC + 0x14)       /* Peripheral Clock Disable Register */
+#define        AT91_PMC_PCSR           (AT91_PMC + 0x18)       /* Peripheral Clock Status Register */
+
+#define        AT91_CKGR_UCKR          (AT91_PMC + 0x1C)       /* UTMI Clock Register [SAM9RL, CAP9] */
+
+#define        AT91_CKGR_MOR           (AT91_PMC + 0x20)       /* Main Oscillator Register [not on SAM9RL] */
+#define                AT91_PMC_MOSCEN         (1    << 0)             /* Main Oscillator Enable */
+#define                AT91_PMC_OSCBYPASS      (1    << 1)             /* Oscillator Bypass [AT91SAM926x only] */
+#define                AT91_PMC_OSCOUNT        (0xff << 8)             /* Main Oscillator Start-up Time */
+
+#define        AT91_CKGR_MCFR          (AT91_PMC + 0x24)       /* Main Clock Frequency Register */
+#define                AT91_PMC_MAINF          (0xffff <<  0)          /* Main Clock Frequency */
+#define                AT91_PMC_MAINRDY        (1      << 16)          /* Main Clock Ready */
+
+#define        AT91_CKGR_PLLAR         (AT91_PMC + 0x28)       /* PLL A Register */
+#define        AT91_CKGR_PLLBR         (AT91_PMC + 0x2c)       /* PLL B Register */
+#define                AT91_PMC_DIV            (0xff  <<  0)           /* Divider */
+#define                AT91_PMC_PLLCOUNT       (0x3f  <<  8)           /* PLL Counter */
+#define                AT91_PMC_OUT            (3     << 14)           /* PLL Clock Frequency Range */
+#define                AT91_PMC_MUL            (0x7ff << 16)           /* PLL Multiplier */
+#define                AT91_PMC_USBDIV         (3     << 28)           /* USB Divisor (PLLB only) */
+#define                        AT91_PMC_USBDIV_1               (0 << 28)
+#define                        AT91_PMC_USBDIV_2               (1 << 28)
+#define                        AT91_PMC_USBDIV_4               (2 << 28)
+#define                AT91_PMC_USB96M         (1     << 28)           /* Divider by 2 Enable (PLLB only) */
+
+#define        AT91_PMC_MCKR           (AT91_PMC + 0x30)       /* Master Clock Register */
+#define                AT91_PMC_CSS            (3 <<  0)               /* Master Clock Selection */
+#define                        AT91_PMC_CSS_SLOW               (0 << 0)
+#define                        AT91_PMC_CSS_MAIN               (1 << 0)
+#define                        AT91_PMC_CSS_PLLA               (2 << 0)
+#define                        AT91_PMC_CSS_PLLB               (3 << 0)
+#define                AT91_PMC_PRES           (7 <<  2)               /* Master Clock Prescaler */
+#define                        AT91_PMC_PRES_1                 (0 << 2)
+#define                        AT91_PMC_PRES_2                 (1 << 2)
+#define                        AT91_PMC_PRES_4                 (2 << 2)
+#define                        AT91_PMC_PRES_8                 (3 << 2)
+#define                        AT91_PMC_PRES_16                (4 << 2)
+#define                        AT91_PMC_PRES_32                (5 << 2)
+#define                        AT91_PMC_PRES_64                (6 << 2)
+#define                AT91_PMC_MDIV           (3 <<  8)               /* Master Clock Division */
+#define                        AT91_PMC_MDIV_1                 (0 << 8)
+#define                        AT91_PMC_MDIV_2                 (1 << 8)
+#define                        AT91_PMC_MDIV_3                 (2 << 8)
+#define                        AT91_PMC_MDIV_4                 (3 << 8)
+
+#define        AT91_PMC_PCKR(n)        (AT91_PMC + 0x40 + ((n) * 4))   /* Programmable Clock 0-3 Registers */
+
+#define        AT91_PMC_IER            (AT91_PMC + 0x60)       /* Interrupt Enable Register */
+#define        AT91_PMC_IDR            (AT91_PMC + 0x64)       /* Interrupt Disable Register */
+#define        AT91_PMC_SR             (AT91_PMC + 0x68)       /* Status Register */
+#define                AT91_PMC_MOSCS          (1 <<  0)               /* MOSCS Flag */
+#define                AT91_PMC_LOCKA          (1 <<  1)               /* PLLA Lock */
+#define                AT91_PMC_LOCKB          (1 <<  2)               /* PLLB Lock */
+#define                AT91_PMC_MCKRDY         (1 <<  3)               /* Master Clock */
+#define                AT91_PMC_PCK0RDY        (1 <<  8)               /* Programmable Clock 0 */
+#define                AT91_PMC_PCK1RDY        (1 <<  9)               /* Programmable Clock 1 */
+#define                AT91_PMC_PCK2RDY        (1 << 10)               /* Programmable Clock 2 */
+#define                AT91_PMC_PCK3RDY        (1 << 11)               /* Programmable Clock 3 */
+#define        AT91_PMC_IMR            (AT91_PMC + 0x6c)       /* Interrupt Mask Register */
+
+#endif
diff --git a/include/asm-arm/arch-at91sam9/at91_rstc.h b/include/asm-arm/arch-at91sam9/at91_rstc.h
new file mode 100644 (file)
index 0000000..fb8d161
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * include/asm-arm/arch-at91/at91_rstc.h
+ *
+ * Reset Controller (RSTC) - System peripherals regsters.
+ * Based on AT91SAM9261 datasheet revision D.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef AT91_RSTC_H
+#define AT91_RSTC_H
+
+#define AT91_RSTC_CR           (AT91_RSTC + 0x00)      /* Reset Controller Control Register */
+#define                AT91_RSTC_PROCRST       (1 << 0)                /* Processor Reset */
+#define                AT91_RSTC_PERRST        (1 << 2)                /* Peripheral Reset */
+#define                AT91_RSTC_EXTRST        (1 << 3)                /* External Reset */
+#define                AT91_RSTC_KEY           (0xa5 << 24)            /* KEY Password */
+
+#define AT91_RSTC_SR           (AT91_RSTC + 0x04)      /* Reset Controller Status Register */
+#define                AT91_RSTC_URSTS         (1 << 0)                /* User Reset Status */
+#define                AT91_RSTC_RSTTYP        (7 << 8)                /* Reset Type */
+#define                        AT91_RSTC_RSTTYP_GENERAL        (0 << 8)
+#define                        AT91_RSTC_RSTTYP_WAKEUP         (1 << 8)
+#define                        AT91_RSTC_RSTTYP_WATCHDOG       (2 << 8)
+#define                        AT91_RSTC_RSTTYP_SOFTWARE       (3 << 8)
+#define                        AT91_RSTC_RSTTYP_USER   (4 << 8)
+#define                AT91_RSTC_NRSTL         (1 << 16)               /* NRST Pin Level */
+#define                AT91_RSTC_SRCMP         (1 << 17)               /* Software Reset Command in Progress */
+
+#define AT91_RSTC_MR           (AT91_RSTC + 0x08)      /* Reset Controller Mode Register */
+#define                AT91_RSTC_URSTEN        (1 << 0)                /* User Reset Enable */
+#define                AT91_RSTC_URSTIEN       (1 << 4)                /* User Reset Interrupt Enable */
+#define                AT91_RSTC_ERSTL         (0xf << 8)              /* External Reset Length */
+
+#endif
diff --git a/include/asm-arm/arch-at91sam9/at91_spi.h b/include/asm-arm/arch-at91sam9/at91_spi.h
new file mode 100644 (file)
index 0000000..aaad926
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * include/asm-arm/arch-at91/at91_spi.h
+ *
+ * Copyright (C) 2005 Ivan Kokshaysky
+ * Copyright (C) SAN People
+ *
+ * Serial Peripheral Interface (SPI) registers.
+ * Based on AT91RM9200 datasheet revision E.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef AT91_SPI_H
+#define AT91_SPI_H
+
+#define AT91_SPI_CR                    0x00            /* Control Register */
+#define                AT91_SPI_SPIEN          (1 <<  0)               /* SPI Enable */
+#define                AT91_SPI_SPIDIS         (1 <<  1)               /* SPI Disable */
+#define                AT91_SPI_SWRST          (1 <<  7)               /* SPI Software Reset */
+#define                AT91_SPI_LASTXFER       (1 << 24)               /* Last Transfer [SAM9261 only] */
+
+#define AT91_SPI_MR                    0x04            /* Mode Register */
+#define                AT91_SPI_MSTR           (1    <<  0)            /* Master/Slave Mode */
+#define                AT91_SPI_PS             (1    <<  1)            /* Peripheral Select */
+#define                        AT91_SPI_PS_FIXED       (0 << 1)
+#define                        AT91_SPI_PS_VARIABLE    (1 << 1)
+#define                AT91_SPI_PCSDEC         (1    <<  2)            /* Chip Select Decode */
+#define                AT91_SPI_DIV32          (1    <<  3)            /* Clock Selection [AT91RM9200 only] */
+#define                AT91_SPI_MODFDIS        (1    <<  4)            /* Mode Fault Detection */
+#define                AT91_SPI_LLB            (1    <<  7)            /* Local Loopback Enable */
+#define                AT91_SPI_PCS            (0xf  << 16)            /* Peripheral Chip Select */
+#define                AT91_SPI_DLYBCS         (0xff << 24)            /* Delay Between Chip Selects */
+
+#define AT91_SPI_RDR           0x08                    /* Receive Data Register */
+#define                AT91_SPI_RD             (0xffff <<  0)          /* Receive Data */
+#define                AT91_SPI_PCS            (0xf    << 16)          /* Peripheral Chip Select */
+
+#define AT91_SPI_TDR           0x0c                    /* Transmit Data Register */
+#define                AT91_SPI_TD             (0xffff <<  0)          /* Transmit Data */
+#define                AT91_SPI_PCS            (0xf    << 16)          /* Peripheral Chip Select */
+#define                AT91_SPI_LASTXFER       (1      << 24)          /* Last Transfer [SAM9261 only] */
+
+#define AT91_SPI_SR            0x10                    /* Status Register */
+#define                AT91_SPI_RDRF           (1 <<  0)               /* Receive Data Register Full */
+#define                AT91_SPI_TDRE           (1 <<  1)               /* Transmit Data Register Full */
+#define                AT91_SPI_MODF           (1 <<  2)               /* Mode Fault Error */
+#define                AT91_SPI_OVRES          (1 <<  3)               /* Overrun Error Status */
+#define                AT91_SPI_ENDRX          (1 <<  4)               /* End of RX buffer */
+#define                AT91_SPI_ENDTX          (1 <<  5)               /* End of TX buffer */
+#define                AT91_SPI_RXBUFF         (1 <<  6)               /* RX Buffer Full */
+#define                AT91_SPI_TXBUFE         (1 <<  7)               /* TX Buffer Empty */
+#define                AT91_SPI_NSSR           (1 <<  8)               /* NSS Rising [SAM9261 only] */
+#define                AT91_SPI_TXEMPTY        (1 <<  9)               /* Transmission Register Empty [SAM9261 only] */
+#define                AT91_SPI_SPIENS         (1 << 16)               /* SPI Enable Status */
+
+#define AT91_SPI_IER           0x14                    /* Interrupt Enable Register */
+#define AT91_SPI_IDR           0x18                    /* Interrupt Disable Register */
+#define AT91_SPI_IMR           0x1c                    /* Interrupt Mask Register */
+
+#define AT91_SPI_CSR(n)                (0x30 + ((n) * 4))      /* Chip Select Registers 0-3 */
+#define                AT91_SPI_CPOL           (1    <<  0)            /* Clock Polarity */
+#define                AT91_SPI_NCPHA          (1    <<  1)            /* Clock Phase */
+#define                AT91_SPI_CSAAT          (1    <<  3)            /* Chip Select Active After Transfer [SAM9261 only] */
+#define                AT91_SPI_BITS           (0xf  <<  4)            /* Bits Per Transfer */
+#define                        AT91_SPI_BITS_8         (0 << 4)
+#define                        AT91_SPI_BITS_9         (1 << 4)
+#define                        AT91_SPI_BITS_10        (2 << 4)
+#define                        AT91_SPI_BITS_11        (3 << 4)
+#define                        AT91_SPI_BITS_12        (4 << 4)
+#define                        AT91_SPI_BITS_13        (5 << 4)
+#define                        AT91_SPI_BITS_14        (6 << 4)
+#define                        AT91_SPI_BITS_15        (7 << 4)
+#define                        AT91_SPI_BITS_16        (8 << 4)
+#define                AT91_SPI_SCBR           (0xff <<  8)            /* Serial Clock Baud Rate */
+#define                AT91_SPI_DLYBS          (0xff << 16)            /* Delay before SPCK */
+#define                AT91_SPI_DLYBCT         (0xff << 24)            /* Delay between Consecutive Transfers */
+
+#define AT91_SPI_RPR           0x0100                  /* Receive Pointer Register */
+
+#define AT91_SPI_RCR           0x0104                  /* Receive Counter Register */
+
+#define AT91_SPI_TPR           0x0108                  /* Transmit Pointer Register */
+
+#define AT91_SPI_TCR           0x010c                  /* Transmit Counter Register */
+
+#define AT91_SPI_RNPR          0x0110                  /* Receive Next Pointer Register */
+
+#define AT91_SPI_RNCR          0x0114                  /* Receive Next Counter Register */
+
+#define AT91_SPI_TNPR          0x0118                  /* Transmit Next Pointer Register */
+
+#define AT91_SPI_TNCR          0x011c                  /* Transmit Next Counter Register */
+
+#define AT91_SPI_PTCR          0x0120                  /* PDC Transfer Control Register */
+#define                AT91_SPI_RXTEN          (0x1 << 0)              /* Receiver Transfer Enable */
+#define                AT91_SPI_RXTDIS         (0x1 << 1)              /* Receiver Transfer Disable */
+#define                AT91_SPI_TXTEN          (0x1 << 8)              /* Transmitter Transfer Enable */
+#define                AT91_SPI_TXTDIS         (0x1 << 9)              /* Transmitter Transfer Disable */
+
+#define AT91_SPI_PTSR          0x0124                  /* PDC Transfer Status Register */
+
+#endif
diff --git a/include/asm-arm/arch-at91sam9/at91cap9.h b/include/asm-arm/arch-at91sam9/at91cap9.h
new file mode 100644 (file)
index 0000000..e16909c
--- /dev/null
@@ -0,0 +1,125 @@
+/*
+ * include/asm-arm/arch-at91/at91cap9.h
+ *
+ *  Copyright (C) 2007 Stelian Pop <stelian.pop@leadtechdesign.com>
+ *  Copyright (C) 2007 Lead Tech Design <www.leadtechdesign.com>
+ *  Copyright (C) 2007 Atmel Corporation.
+ *
+ * Common definitions.
+ * Based on AT91CAP9 datasheet revision B (Preliminary).
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef AT91CAP9_H
+#define AT91CAP9_H
+
+/*
+ * Peripheral identifiers/interrupts.
+ */
+#define AT91_ID_FIQ            0       /* Advanced Interrupt Controller (FIQ) */
+#define AT91_ID_SYS            1       /* System Peripherals */
+#define AT91CAP9_ID_PIOABCD    2       /* Parallel IO Controller A, B, C and D */
+#define AT91CAP9_ID_MPB0       3       /* MP Block Peripheral 0 */
+#define AT91CAP9_ID_MPB1       4       /* MP Block Peripheral 1 */
+#define AT91CAP9_ID_MPB2       5       /* MP Block Peripheral 2 */
+#define AT91CAP9_ID_MPB3       6       /* MP Block Peripheral 3 */
+#define AT91CAP9_ID_MPB4       7       /* MP Block Peripheral 4 */
+#define AT91CAP9_ID_US0                8       /* USART 0 */
+#define AT91CAP9_ID_US1                9       /* USART 1 */
+#define AT91CAP9_ID_US2                10      /* USART 2 */
+#define AT91CAP9_ID_MCI0       11      /* Multimedia Card Interface 0 */
+#define AT91CAP9_ID_MCI1       12      /* Multimedia Card Interface 1 */
+#define AT91CAP9_ID_CAN                13      /* CAN */
+#define AT91CAP9_ID_TWI                14      /* Two-Wire Interface */
+#define AT91CAP9_ID_SPI0       15      /* Serial Peripheral Interface 0 */
+#define AT91CAP9_ID_SPI1       16      /* Serial Peripheral Interface 0 */
+#define AT91CAP9_ID_SSC0       17      /* Serial Synchronous Controller 0 */
+#define AT91CAP9_ID_SSC1       18      /* Serial Synchronous Controller 1 */
+#define AT91CAP9_ID_AC97C      19      /* AC97 Controller */
+#define AT91CAP9_ID_TCB                20      /* Timer Counter 0, 1 and 2 */
+#define AT91CAP9_ID_PWMC       21      /* Pulse Width Modulation Controller */
+#define AT91CAP9_ID_EMAC       22      /* Ethernet */
+#define AT91CAP9_ID_AESTDES    23      /* Advanced Encryption Standard, Triple DES */
+#define AT91CAP9_ID_ADC                24      /* Analog-to-Digital Converter */
+#define AT91CAP9_ID_ISI                25      /* Image Sensor Interface */
+#define AT91CAP9_ID_LCDC       26      /* LCD Controller */
+#define AT91CAP9_ID_DMA                27      /* DMA Controller */
+#define AT91CAP9_ID_UDPHS      28      /* USB High Speed Device Port */
+#define AT91CAP9_ID_UHP                29      /* USB Host Port */
+#define AT91CAP9_ID_IRQ0       30      /* Advanced Interrupt Controller (IRQ0) */
+#define AT91CAP9_ID_IRQ1       31      /* Advanced Interrupt Controller (IRQ1) */
+
+/*
+ * User Peripheral physical base addresses.
+ */
+#define AT91CAP9_BASE_UDPHS            0xfff78000
+#define AT91CAP9_BASE_TCB0             0xfff7c000
+#define AT91CAP9_BASE_TC0              0xfff7c000
+#define AT91CAP9_BASE_TC1              0xfff7c040
+#define AT91CAP9_BASE_TC2              0xfff7c080
+#define AT91CAP9_BASE_MCI0             0xfff80000
+#define AT91CAP9_BASE_MCI1             0xfff84000
+#define AT91CAP9_BASE_TWI              0xfff88000
+#define AT91CAP9_BASE_US0              0xfff8c000
+#define AT91CAP9_BASE_US1              0xfff90000
+#define AT91CAP9_BASE_US2              0xfff94000
+#define AT91CAP9_BASE_SSC0             0xfff98000
+#define AT91CAP9_BASE_SSC1             0xfff9c000
+#define AT91CAP9_BASE_AC97C            0xfffa0000
+#define AT91CAP9_BASE_SPI0             0xfffa4000
+#define AT91CAP9_BASE_SPI1             0xfffa8000
+#define AT91CAP9_BASE_CAN              0xfffac000
+#define AT91CAP9_BASE_PWMC             0xfffb8000
+#define AT91CAP9_BASE_EMAC             0xfffbc000
+#define AT91CAP9_BASE_ADC              0xfffc0000
+#define AT91CAP9_BASE_ISI              0xfffc4000
+#define AT91_BASE_SYS                  0xffffe200
+
+/*
+ * System Peripherals (offset from AT91_BASE_SYS)
+ */
+#define AT91_ECC       (0xffffe200 - AT91_BASE_SYS)
+#define AT91_BCRAMC    (0xffffe400 - AT91_BASE_SYS)
+#define AT91_DDRSDRC   (0xffffe600 - AT91_BASE_SYS)
+#define AT91_SMC       (0xffffe800 - AT91_BASE_SYS)
+#define AT91_MATRIX    (0xffffea00 - AT91_BASE_SYS)
+#define AT91_CCFG      (0xffffeb10 - AT91_BASE_SYS)
+#define AT91_DMA       (0xffffec00 - AT91_BASE_SYS)
+#define AT91_DBGU      (0xffffee00 - AT91_BASE_SYS)
+#define AT91_AIC       (0xfffff000 - AT91_BASE_SYS)
+#define AT91_PIOA      (0xfffff200 - AT91_BASE_SYS)
+#define AT91_PIOB      (0xfffff400 - AT91_BASE_SYS)
+#define AT91_PIOC      (0xfffff600 - AT91_BASE_SYS)
+#define AT91_PIOD      (0xfffff800 - AT91_BASE_SYS)
+#define AT91_PMC       (0xfffffc00 - AT91_BASE_SYS)
+#define AT91_RSTC      (0xfffffd00 - AT91_BASE_SYS)
+#define AT91_SHDWC     (0xfffffd10 - AT91_BASE_SYS)
+#define AT91_RTT       (0xfffffd20 - AT91_BASE_SYS)
+#define AT91_PIT       (0xfffffd30 - AT91_BASE_SYS)
+#define AT91_WDT       (0xfffffd40 - AT91_BASE_SYS)
+#define AT91_GPBR      (0xfffffd50 - AT91_BASE_SYS)
+
+#define AT91_USART0    AT91CAP9_BASE_US0
+#define AT91_USART1    AT91CAP9_BASE_US1
+#define AT91_USART2    AT91CAP9_BASE_US2
+
+/*
+ * Internal Memory.
+ */
+#define AT91CAP9_SRAM_BASE     0x00100000      /* Internal SRAM base address */
+#define AT91CAP9_SRAM_SIZE     (32 * SZ_1K)    /* Internal SRAM size (32Kb) */
+
+#define AT91CAP9_ROM_BASE      0x00400000      /* Internal ROM base address */
+#define AT91CAP9_ROM_SIZE      (32 * SZ_1K)    /* Internal ROM size (32Kb) */
+
+#define AT91CAP9_LCDC_BASE     0x00500000      /* LCD Controller */
+#define AT91CAP9_UDPHS_BASE    0x00600000      /* USB High Speed Device Port */
+#define AT91CAP9_UHP_BASE      0x00700000      /* USB Host controller */
+
+#define CONFIG_DRAM_BASE       AT91_CHIPSELECT_6
+
+#endif
diff --git a/include/asm-arm/arch-at91sam9/at91cap9_matrix.h b/include/asm-arm/arch-at91sam9/at91cap9_matrix.h
new file mode 100644 (file)
index 0000000..a641686
--- /dev/null
@@ -0,0 +1,132 @@
+/*
+ * include/asm-arm/arch-at91/at91cap9_matrix.h
+ *
+ *  Copyright (C) 2007 Stelian Pop <stelian.pop@leadtechdesign.com>
+ *  Copyright (C) 2007 Lead Tech Design <www.leadtechdesign.com>
+ *  Copyright (C) 2006 Atmel Corporation.
+ *
+ * Memory Controllers (MATRIX, EBI) - System peripherals registers.
+ * Based on AT91CAP9 datasheet revision B (Preliminary).
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef AT91CAP9_MATRIX_H
+#define AT91CAP9_MATRIX_H
+
+#define AT91_MATRIX_MCFG0      (AT91_MATRIX + 0x00)    /* Master Configuration Register 0 */
+#define AT91_MATRIX_MCFG1      (AT91_MATRIX + 0x04)    /* Master Configuration Register 1 */
+#define AT91_MATRIX_MCFG2      (AT91_MATRIX + 0x08)    /* Master Configuration Register 2 */
+#define AT91_MATRIX_MCFG3      (AT91_MATRIX + 0x0C)    /* Master Configuration Register 3 */
+#define AT91_MATRIX_MCFG4      (AT91_MATRIX + 0x10)    /* Master Configuration Register 4 */
+#define AT91_MATRIX_MCFG5      (AT91_MATRIX + 0x14)    /* Master Configuration Register 5 */
+#define AT91_MATRIX_MCFG6      (AT91_MATRIX + 0x18)    /* Master Configuration Register 6 */
+#define AT91_MATRIX_MCFG7      (AT91_MATRIX + 0x1C)    /* Master Configuration Register 7 */
+#define AT91_MATRIX_MCFG8      (AT91_MATRIX + 0x20)    /* Master Configuration Register 8 */
+#define AT91_MATRIX_MCFG9      (AT91_MATRIX + 0x24)    /* Master Configuration Register 9 */
+#define AT91_MATRIX_MCFG10     (AT91_MATRIX + 0x28)    /* Master Configuration Register 10 */
+#define AT91_MATRIX_MCFG11     (AT91_MATRIX + 0x2C)    /* Master Configuration Register 11 */
+#define                AT91_MATRIX_ULBT        (7 << 0)        /* Undefined Length Burst Type */
+#define                        AT91_MATRIX_ULBT_INFINITE       (0 << 0)
+#define                        AT91_MATRIX_ULBT_SINGLE         (1 << 0)
+#define                        AT91_MATRIX_ULBT_FOUR           (2 << 0)
+#define                        AT91_MATRIX_ULBT_EIGHT          (3 << 0)
+#define                        AT91_MATRIX_ULBT_SIXTEEN        (4 << 0)
+
+#define AT91_MATRIX_SCFG0      (AT91_MATRIX + 0x40)    /* Slave Configuration Register 0 */
+#define AT91_MATRIX_SCFG1      (AT91_MATRIX + 0x44)    /* Slave Configuration Register 1 */
+#define AT91_MATRIX_SCFG2      (AT91_MATRIX + 0x48)    /* Slave Configuration Register 2 */
+#define AT91_MATRIX_SCFG3      (AT91_MATRIX + 0x4C)    /* Slave Configuration Register 3 */
+#define AT91_MATRIX_SCFG4      (AT91_MATRIX + 0x50)    /* Slave Configuration Register 4 */
+#define AT91_MATRIX_SCFG5      (AT91_MATRIX + 0x54)    /* Slave Configuration Register 5 */
+#define AT91_MATRIX_SCFG6      (AT91_MATRIX + 0x58)    /* Slave Configuration Register 6 */
+#define AT91_MATRIX_SCFG7      (AT91_MATRIX + 0x5C)    /* Slave Configuration Register 7 */
+#define AT91_MATRIX_SCFG8      (AT91_MATRIX + 0x60)    /* Slave Configuration Register 8 */
+#define AT91_MATRIX_SCFG9      (AT91_MATRIX + 0x64)    /* Slave Configuration Register 9 */
+#define                AT91_MATRIX_SLOT_CYCLE          (0xff << 0)     /* Maximum Number of Allowed Cycles for a Burst */
+#define                AT91_MATRIX_DEFMSTR_TYPE        (3    << 16)    /* Default Master Type */
+#define                        AT91_MATRIX_DEFMSTR_TYPE_NONE   (0 << 16)
+#define                        AT91_MATRIX_DEFMSTR_TYPE_LAST   (1 << 16)
+#define                        AT91_MATRIX_DEFMSTR_TYPE_FIXED  (2 << 16)
+#define                AT91_MATRIX_FIXED_DEFMSTR       (0xf  << 18)    /* Fixed Index of Default Master */
+#define                AT91_MATRIX_ARBT                (3    << 24)    /* Arbitration Type */
+#define                        AT91_MATRIX_ARBT_ROUND_ROBIN    (0 << 24)
+#define                        AT91_MATRIX_ARBT_FIXED_PRIORITY (1 << 24)
+
+#define AT91_MATRIX_PRAS0      (AT91_MATRIX + 0x80)    /* Priority Register A for Slave 0 */
+#define AT91_MATRIX_PRBS0      (AT91_MATRIX + 0x84)    /* Priority Register B for Slave 0 */
+#define AT91_MATRIX_PRAS1      (AT91_MATRIX + 0x88)    /* Priority Register A for Slave 1 */
+#define AT91_MATRIX_PRBS1      (AT91_MATRIX + 0x8C)    /* Priority Register B for Slave 1 */
+#define AT91_MATRIX_PRAS2      (AT91_MATRIX + 0x90)    /* Priority Register A for Slave 2 */
+#define AT91_MATRIX_PRBS2      (AT91_MATRIX + 0x94)    /* Priority Register B for Slave 2 */
+#define AT91_MATRIX_PRAS3      (AT91_MATRIX + 0x98)    /* Priority Register A for Slave 3 */
+#define AT91_MATRIX_PRBS3      (AT91_MATRIX + 0x9C)    /* Priority Register B for Slave 3 */
+#define AT91_MATRIX_PRAS4      (AT91_MATRIX + 0xA0)    /* Priority Register A for Slave 4 */
+#define AT91_MATRIX_PRBS4      (AT91_MATRIX + 0xA4)    /* Priority Register B for Slave 4 */
+#define AT91_MATRIX_PRAS5      (AT91_MATRIX + 0xA8)    /* Priority Register A for Slave 5 */
+#define AT91_MATRIX_PRBS5      (AT91_MATRIX + 0xAC)    /* Priority Register B for Slave 5 */
+#define AT91_MATRIX_PRAS6      (AT91_MATRIX + 0xB0)    /* Priority Register A for Slave 6 */
+#define AT91_MATRIX_PRBS6      (AT91_MATRIX + 0xB4)    /* Priority Register B for Slave 6 */
+#define AT91_MATRIX_PRAS7      (AT91_MATRIX + 0xB8)    /* Priority Register A for Slave 7 */
+#define AT91_MATRIX_PRBS7      (AT91_MATRIX + 0xBC)    /* Priority Register B for Slave 7 */
+#define AT91_MATRIX_PRAS8      (AT91_MATRIX + 0xC0)    /* Priority Register A for Slave 8 */
+#define AT91_MATRIX_PRBS8      (AT91_MATRIX + 0xC4)    /* Priority Register B for Slave 8 */
+#define AT91_MATRIX_PRAS9      (AT91_MATRIX + 0xC8)    /* Priority Register A for Slave 9 */
+#define AT91_MATRIX_PRBS9      (AT91_MATRIX + 0xCC)    /* Priority Register B for Slave 9 */
+#define                AT91_MATRIX_M0PR                (3 << 0)        /* Master 0 Priority */
+#define                AT91_MATRIX_M1PR                (3 << 4)        /* Master 1 Priority */
+#define                AT91_MATRIX_M2PR                (3 << 8)        /* Master 2 Priority */
+#define                AT91_MATRIX_M3PR                (3 << 12)       /* Master 3 Priority */
+#define                AT91_MATRIX_M4PR                (3 << 16)       /* Master 4 Priority */
+#define                AT91_MATRIX_M5PR                (3 << 20)       /* Master 5 Priority */
+#define                AT91_MATRIX_M6PR                (3 << 24)       /* Master 6 Priority */
+#define                AT91_MATRIX_M7PR                (3 << 28)       /* Master 7 Priority */
+#define                AT91_MATRIX_M8PR                (3 << 0)        /* Master 8 Priority (in Register B) */
+#define                AT91_MATRIX_M9PR                (3 << 4)        /* Master 9 Priority (in Register B) */
+#define                AT91_MATRIX_M10PR               (3 << 8)        /* Master 10 Priority (in Register B) */
+#define                AT91_MATRIX_M11PR               (3 << 12)       /* Master 11 Priority (in Register B) */
+
+#define AT91_MATRIX_MRCR       (AT91_MATRIX + 0x100)   /* Master Remap Control Register */
+#define                AT91_MATRIX_RCB0                (1 << 0)        /* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */
+#define                AT91_MATRIX_RCB1                (1 << 1)        /* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */
+#define                AT91_MATRIX_RCB2                (1 << 2)
+#define                AT91_MATRIX_RCB3                (1 << 3)
+#define                AT91_MATRIX_RCB4                (1 << 4)
+#define                AT91_MATRIX_RCB5                (1 << 5)
+#define                AT91_MATRIX_RCB6                (1 << 6)
+#define                AT91_MATRIX_RCB7                (1 << 7)
+#define                AT91_MATRIX_RCB8                (1 << 8)
+#define                AT91_MATRIX_RCB9                (1 << 9)
+#define                AT91_MATRIX_RCB10               (1 << 10)
+#define                AT91_MATRIX_RCB11               (1 << 11)
+
+#define AT91_MPBS0_SFR         (AT91_MATRIX + 0x114)   /* MPBlock Slave 0 Special Function Register */
+#define AT91_MPBS1_SFR         (AT91_MATRIX + 0x11C)   /* MPBlock Slave 1 Special Function Register */
+
+#define AT91_MATRIX_EBICSA     (AT91_MATRIX + 0x120)   /* EBI Chip Select Assignment Register */
+#define                AT91_MATRIX_EBI_CS1A            (1 << 1)        /* Chip Select 1 Assignment */
+#define                        AT91_MATRIX_EBI_CS1A_SMC                (0 << 1)
+#define                        AT91_MATRIX_EBI_CS1A_BCRAMC             (1 << 1)
+#define                AT91_MATRIX_EBI_CS3A            (1 << 3)        /* Chip Select 3 Assignment */
+#define                        AT91_MATRIX_EBI_CS3A_SMC                (0 << 3)
+#define                        AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA     (1 << 3)
+#define                AT91_MATRIX_EBI_CS4A            (1 << 4)        /* Chip Select 4 Assignment */
+#define                        AT91_MATRIX_EBI_CS4A_SMC                (0 << 4)
+#define                        AT91_MATRIX_EBI_CS4A_SMC_CF1            (1 << 4)
+#define                AT91_MATRIX_EBI_CS5A            (1 << 5)        /* Chip Select 5 Assignment */
+#define                        AT91_MATRIX_EBI_CS5A_SMC                (0 << 5)
+#define                        AT91_MATRIX_EBI_CS5A_SMC_CF2            (1 << 5)
+#define                AT91_MATRIX_EBI_DBPUC           (1 << 8)        /* Data Bus Pull-up Configuration */
+#define                AT91_MATRIX_EBI_DQSPDC          (1 << 9)        /* Data Qualifier Strobe Pull-Down Configuration */
+#define                AT91_MATRIX_EBI_VDDIOMSEL       (1 << 16)       /* Memory voltage selection */
+#define                        AT91_MATRIX_EBI_VDDIOMSEL_1_8V          (0 << 16)
+#define                        AT91_MATRIX_EBI_VDDIOMSEL_3_3V          (1 << 16)
+
+#define AT91_MPBS2_SFR         (AT91_MATRIX + 0x12C)   /* MPBlock Slave 2 Special Function Register */
+#define AT91_MPBS3_SFR         (AT91_MATRIX + 0x130)   /* MPBlock Slave 3 Special Function Register */
+#define AT91_APB_SFR           (AT91_MATRIX + 0x134)   /* APB Bridge Special Function Register */
+
+#endif
diff --git a/include/asm-arm/arch-at91sam9/at91sam9260.h b/include/asm-arm/arch-at91sam9/at91sam9260.h
new file mode 100644 (file)
index 0000000..1bf4598
--- /dev/null
@@ -0,0 +1,124 @@
+/*
+ * include/asm-arm/arch-at91/at91sam9260.h
+ *
+ * (C) 2006 Andrew Victor
+ *
+ * Common definitions.
+ * Based on AT91SAM9260 datasheet revision A (Preliminary).
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef AT91SAM9260_H
+#define AT91SAM9260_H
+
+/*
+ * Peripheral identifiers/interrupts.
+ */
+#define AT91_ID_FIQ            0       /* Advanced Interrupt Controller (FIQ) */
+#define AT91_ID_SYS            1       /* System Peripherals */
+#define AT91SAM9260_ID_PIOA    2       /* Parallel IO Controller A */
+#define AT91SAM9260_ID_PIOB    3       /* Parallel IO Controller B */
+#define AT91SAM9260_ID_PIOC    4       /* Parallel IO Controller C */
+#define AT91SAM9260_ID_ADC     5       /* Analog-to-Digital Converter */
+#define AT91SAM9260_ID_US0     6       /* USART 0 */
+#define AT91SAM9260_ID_US1     7       /* USART 1 */
+#define AT91SAM9260_ID_US2     8       /* USART 2 */
+#define AT91SAM9260_ID_MCI     9       /* Multimedia Card Interface */
+#define AT91SAM9260_ID_UDP     10      /* USB Device Port */
+#define AT91SAM9260_ID_TWI     11      /* Two-Wire Interface */
+#define AT91SAM9260_ID_SPI0    12      /* Serial Peripheral Interface 0 */
+#define AT91SAM9260_ID_SPI1    13      /* Serial Peripheral Interface 1 */
+#define AT91SAM9260_ID_SSC     14      /* Serial Synchronous Controller */
+#define AT91SAM9260_ID_TC0     17      /* Timer Counter 0 */
+#define AT91SAM9260_ID_TC1     18      /* Timer Counter 1 */
+#define AT91SAM9260_ID_TC2     19      /* Timer Counter 2 */
+#define AT91SAM9260_ID_UHP     20      /* USB Host port */
+#define AT91SAM9260_ID_EMAC    21      /* Ethernet */
+#define AT91SAM9260_ID_ISI     22      /* Image Sensor Interface */
+#define AT91SAM9260_ID_US3     23      /* USART 3 */
+#define AT91SAM9260_ID_US4     24      /* USART 4 */
+#define AT91SAM9260_ID_US5     25      /* USART 5 */
+#define AT91SAM9260_ID_TC3     26      /* Timer Counter 3 */
+#define AT91SAM9260_ID_TC4     27      /* Timer Counter 4 */
+#define AT91SAM9260_ID_TC5     28      /* Timer Counter 5 */
+#define AT91SAM9260_ID_IRQ0    29      /* Advanced Interrupt Controller (IRQ0) */
+#define AT91SAM9260_ID_IRQ1    30      /* Advanced Interrupt Controller (IRQ1) */
+#define AT91SAM9260_ID_IRQ2    31      /* Advanced Interrupt Controller (IRQ2) */
+
+/*
+ * User Peripheral physical base addresses.
+ */
+#define AT91SAM9260_BASE_TCB0          0xfffa0000
+#define AT91SAM9260_BASE_TC0           0xfffa0000
+#define AT91SAM9260_BASE_TC1           0xfffa0040
+#define AT91SAM9260_BASE_TC2           0xfffa0080
+#define AT91SAM9260_BASE_UDP           0xfffa4000
+#define AT91SAM9260_BASE_MCI           0xfffa8000
+#define AT91SAM9260_BASE_TWI           0xfffac000
+#define AT91SAM9260_BASE_US0           0xfffb0000
+#define AT91SAM9260_BASE_US1           0xfffb4000
+#define AT91SAM9260_BASE_US2           0xfffb8000
+#define AT91SAM9260_BASE_SSC           0xfffbc000
+#define AT91SAM9260_BASE_ISI           0xfffc0000
+#define AT91SAM9260_BASE_EMAC          0xfffc4000
+#define AT91SAM9260_BASE_SPI0          0xfffc8000
+#define AT91SAM9260_BASE_SPI1          0xfffcc000
+#define AT91SAM9260_BASE_US3           0xfffd0000
+#define AT91SAM9260_BASE_US4           0xfffd4000
+#define AT91SAM9260_BASE_US5           0xfffd8000
+#define AT91SAM9260_BASE_TCB1          0xfffdc000
+#define AT91SAM9260_BASE_TC3           0xfffdc000
+#define AT91SAM9260_BASE_TC4           0xfffdc040
+#define AT91SAM9260_BASE_TC5           0xfffdc080
+#define AT91SAM9260_BASE_ADC           0xfffe0000
+#define AT91_BASE_SYS                  0xffffe800
+
+/*
+ * System Peripherals (offset from AT91_BASE_SYS)
+ */
+#define AT91_ECC       (0xffffe800 - AT91_BASE_SYS)
+#define AT91_SDRAMC    (0xffffea00 - AT91_BASE_SYS)
+#define AT91_SMC       (0xffffec00 - AT91_BASE_SYS)
+#define AT91_MATRIX    (0xffffee00 - AT91_BASE_SYS)
+#define AT91_CCFG      (0xffffef10 - AT91_BASE_SYS)
+#define AT91_AIC       (0xfffff000 - AT91_BASE_SYS)
+#define AT91_DBGU      (0xfffff200 - AT91_BASE_SYS)
+#define AT91_PIOA      (0xfffff400 - AT91_BASE_SYS)
+#define AT91_PIOB      (0xfffff600 - AT91_BASE_SYS)
+#define AT91_PIOC      (0xfffff800 - AT91_BASE_SYS)
+#define AT91_PMC       (0xfffffc00 - AT91_BASE_SYS)
+#define AT91_RSTC      (0xfffffd00 - AT91_BASE_SYS)
+#define AT91_SHDWC     (0xfffffd10 - AT91_BASE_SYS)
+#define AT91_RTT       (0xfffffd20 - AT91_BASE_SYS)
+#define AT91_PIT       (0xfffffd30 - AT91_BASE_SYS)
+#define AT91_WDT       (0xfffffd40 - AT91_BASE_SYS)
+#define AT91_GPBR      (0xfffffd50 - AT91_BASE_SYS)
+
+#define AT91_USART0    AT91SAM9260_BASE_US0
+#define AT91_USART1    AT91SAM9260_BASE_US1
+#define AT91_USART2    AT91SAM9260_BASE_US2
+#define AT91_USART3    AT91SAM9260_BASE_US3
+#define AT91_USART4    AT91SAM9260_BASE_US4
+#define AT91_USART5    AT91SAM9260_BASE_US5
+
+/*
+ * Internal Memory.
+ */
+#define AT91SAM9260_ROM_BASE   0x00100000      /* Internal ROM base address */
+#define AT91SAM9260_ROM_SIZE   SZ_32K          /* Internal ROM size (32Kb) */
+
+#define AT91SAM9260_SRAM0_BASE 0x00200000      /* Internal SRAM 0 base address */
+#define AT91SAM9260_SRAM0_SIZE SZ_4K           /* Internal SRAM 0 size (4Kb) */
+#define AT91SAM9260_SRAM1_BASE 0x00300000      /* Internal SRAM 1 base address */
+#define AT91SAM9260_SRAM1_SIZE SZ_4K           /* Internal SRAM 1 size (4Kb) */
+
+#define AT91SAM9260_UHP_BASE   0x00500000      /* USB Host controller */
+
+#define AT91SAM9XE_FLASH_BASE  0x00200000      /* Internal FLASH base address */
+#define AT91SAM9XE_SRAM_BASE   0x00300000      /* Internal SRAM base address */
+
+#endif
diff --git a/include/asm-arm/arch-at91sam9/at91sam9260_matrix.h b/include/asm-arm/arch-at91sam9/at91sam9260_matrix.h
new file mode 100644 (file)
index 0000000..a8e9fec
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * include/asm-arm/arch-at91/at91sam9260_matrix.h
+ *
+ * Memory Controllers (MATRIX, EBI) - System peripherals registers.
+ * Based on AT91SAM9260 datasheet revision B.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef AT91SAM9260_MATRIX_H
+#define AT91SAM9260_MATRIX_H
+
+#define AT91_MATRIX_MCFG0      (AT91_MATRIX + 0x00)    /* Master Configuration Register 0 */
+#define AT91_MATRIX_MCFG1      (AT91_MATRIX + 0x04)    /* Master Configuration Register 1 */
+#define AT91_MATRIX_MCFG2      (AT91_MATRIX + 0x08)    /* Master Configuration Register 2 */
+#define AT91_MATRIX_MCFG3      (AT91_MATRIX + 0x0C)    /* Master Configuration Register 3 */
+#define AT91_MATRIX_MCFG4      (AT91_MATRIX + 0x10)    /* Master Configuration Register 4 */
+#define AT91_MATRIX_MCFG5      (AT91_MATRIX + 0x14)    /* Master Configuration Register 5 */
+#define                AT91_MATRIX_ULBT                (7 << 0)        /* Undefined Length Burst Type */
+#define                        AT91_MATRIX_ULBT_INFINITE       (0 << 0)
+#define                        AT91_MATRIX_ULBT_SINGLE         (1 << 0)
+#define                        AT91_MATRIX_ULBT_FOUR           (2 << 0)
+#define                        AT91_MATRIX_ULBT_EIGHT          (3 << 0)
+#define                        AT91_MATRIX_ULBT_SIXTEEN        (4 << 0)
+
+#define AT91_MATRIX_SCFG0      (AT91_MATRIX + 0x40)    /* Slave Configuration Register 0 */
+#define AT91_MATRIX_SCFG1      (AT91_MATRIX + 0x44)    /* Slave Configuration Register 1 */
+#define AT91_MATRIX_SCFG2      (AT91_MATRIX + 0x48)    /* Slave Configuration Register 2 */
+#define AT91_MATRIX_SCFG3      (AT91_MATRIX + 0x4C)    /* Slave Configuration Register 3 */
+#define AT91_MATRIX_SCFG4      (AT91_MATRIX + 0x50)    /* Slave Configuration Register 4 */
+#define                AT91_MATRIX_SLOT_CYCLE          (0xff <<  0)    /* Maximum Number of Allowed Cycles for a Burst */
+#define                AT91_MATRIX_DEFMSTR_TYPE        (3    << 16)    /* Default Master Type */
+#define                        AT91_MATRIX_DEFMSTR_TYPE_NONE   (0 << 16)
+#define                        AT91_MATRIX_DEFMSTR_TYPE_LAST   (1 << 16)
+#define                        AT91_MATRIX_DEFMSTR_TYPE_FIXED  (2 << 16)
+#define                AT91_MATRIX_FIXED_DEFMSTR       (7    << 18)    /* Fixed Index of Default Master */
+#define                AT91_MATRIX_ARBT                (3    << 24)    /* Arbitration Type */
+#define                        AT91_MATRIX_ARBT_ROUND_ROBIN    (0 << 24)
+#define                        AT91_MATRIX_ARBT_FIXED_PRIORITY (1 << 24)
+
+#define AT91_MATRIX_PRAS0      (AT91_MATRIX + 0x80)    /* Priority Register A for Slave 0 */
+#define AT91_MATRIX_PRAS1      (AT91_MATRIX + 0x88)    /* Priority Register A for Slave 1 */
+#define AT91_MATRIX_PRAS2      (AT91_MATRIX + 0x90)    /* Priority Register A for Slave 2 */
+#define AT91_MATRIX_PRAS3      (AT91_MATRIX + 0x98)    /* Priority Register A for Slave 3 */
+#define AT91_MATRIX_PRAS4      (AT91_MATRIX + 0xA0)    /* Priority Register A for Slave 4 */
+#define                AT91_MATRIX_M0PR                (3 << 0)        /* Master 0 Priority */
+#define                AT91_MATRIX_M1PR                (3 << 4)        /* Master 1 Priority */
+#define                AT91_MATRIX_M2PR                (3 << 8)        /* Master 2 Priority */
+#define                AT91_MATRIX_M3PR                (3 << 12)       /* Master 3 Priority */
+#define                AT91_MATRIX_M4PR                (3 << 16)       /* Master 4 Priority */
+#define                AT91_MATRIX_M5PR                (3 << 20)       /* Master 5 Priority */
+
+#define AT91_MATRIX_MRCR       (AT91_MATRIX + 0x100)   /* Master Remap Control Register */
+#define                AT91_MATRIX_RCB0                (1 << 0)        /* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */
+#define                AT91_MATRIX_RCB1                (1 << 1)        /* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */
+
+#define AT91_MATRIX_EBICSA     (AT91_MATRIX + 0x11C)   /* EBI Chip Select Assignment Register */
+#define                AT91_MATRIX_CS1A                (1 << 1)        /* Chip Select 1 Assignment */
+#define                        AT91_MATRIX_CS1A_SMC            (0 << 1)
+#define                        AT91_MATRIX_CS1A_SDRAMC         (1 << 1)
+#define                AT91_MATRIX_CS3A                (1 << 3)        /* Chip Select 3 Assignment */
+#define                        AT91_MATRIX_CS3A_SMC            (0 << 3)
+#define                        AT91_MATRIX_CS3A_SMC_SMARTMEDIA (1 << 3)
+#define                AT91_MATRIX_CS4A                (1 << 4)        /* Chip Select 4 Assignment */
+#define                        AT91_MATRIX_CS4A_SMC            (0 << 4)
+#define                        AT91_MATRIX_CS4A_SMC_CF1        (1 << 4)
+#define                AT91_MATRIX_CS5A                (1 << 5)        /* Chip Select 5 Assignment */
+#define                        AT91_MATRIX_CS5A_SMC            (0 << 5)
+#define                        AT91_MATRIX_CS5A_SMC_CF2        (1 << 5)
+#define                AT91_MATRIX_DBPUC               (1 << 8)        /* Data Bus Pull-up Configuration */
+#define                AT91_MATRIX_VDDIOMSEL           (1 << 16)       /* Memory voltage selection */
+#define                        AT91_MATRIX_VDDIOMSEL_1_8V      (0 << 16)
+#define                        AT91_MATRIX_VDDIOMSEL_3_3V      (1 << 16)
+
+#endif
diff --git a/include/asm-arm/arch-at91sam9/at91sam926x_mc.h b/include/asm-arm/arch-at91sam9/at91sam926x_mc.h
new file mode 100644 (file)
index 0000000..041138f
--- /dev/null
@@ -0,0 +1,140 @@
+/*
+ * include/asm-arm/arch-at91/at91sam926x_mc.h
+ *
+ * Memory Controllers (SMC, SDRAMC) - System peripherals registers.
+ * Based on AT91SAM9261 datasheet revision D.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef AT91SAM926x_MC_H
+#define AT91SAM926x_MC_H
+
+/* SDRAM Controller (SDRAMC) registers */
+#define AT91_SDRAMC_MR         (AT91_SDRAMC + 0x00)    /* SDRAM Controller Mode Register */
+#define                AT91_SDRAMC_MODE        (0xf << 0)              /* Command Mode */
+#define                        AT91_SDRAMC_MODE_NORMAL         0
+#define                        AT91_SDRAMC_MODE_NOP            1
+#define                        AT91_SDRAMC_MODE_PRECHARGE      2
+#define                        AT91_SDRAMC_MODE_LMR            3
+#define                        AT91_SDRAMC_MODE_REFRESH        4
+#define                        AT91_SDRAMC_MODE_EXT_LMR        5
+#define                        AT91_SDRAMC_MODE_DEEP           6
+
+#define AT91_SDRAMC_TR         (AT91_SDRAMC + 0x04)    /* SDRAM Controller Refresh Timer Register */
+#define                AT91_SDRAMC_COUNT       (0xfff << 0)            /* Refresh Timer Counter */
+
+#define AT91_SDRAMC_CR         (AT91_SDRAMC + 0x08)    /* SDRAM Controller Configuration Register */
+#define                AT91_SDRAMC_NC          (3 << 0)                /* Number of Column Bits */
+#define                        AT91_SDRAMC_NC_8        (0 << 0)
+#define                        AT91_SDRAMC_NC_9        (1 << 0)
+#define                        AT91_SDRAMC_NC_10       (2 << 0)
+#define                        AT91_SDRAMC_NC_11       (3 << 0)
+#define                AT91_SDRAMC_NR          (3 << 2)                /* Number of Row Bits */
+#define                        AT91_SDRAMC_NR_11       (0 << 2)
+#define                        AT91_SDRAMC_NR_12       (1 << 2)
+#define                        AT91_SDRAMC_NR_13       (2 << 2)
+#define                AT91_SDRAMC_NB          (1 << 4)                /* Number of Banks */
+#define                        AT91_SDRAMC_NB_2        (0 << 4)
+#define                        AT91_SDRAMC_NB_4        (1 << 4)
+#define                AT91_SDRAMC_CAS         (3 << 5)                /* CAS Latency */
+#define                        AT91_SDRAMC_CAS_1       (1 << 5)
+#define                        AT91_SDRAMC_CAS_2       (2 << 5)
+#define                        AT91_SDRAMC_CAS_3       (3 << 5)
+#define                AT91_SDRAMC_DBW         (1 << 7)                /* Data Bus Width */
+#define                        AT91_SDRAMC_DBW_32      (0 << 7)
+#define                        AT91_SDRAMC_DBW_16      (1 << 7)
+#define                AT91_SDRAMC_TWR         (0xf <<  8)             /* Write Recovery Delay */
+#define                AT91_SDRAMC_TRC         (0xf << 12)             /* Row Cycle Delay */
+#define                AT91_SDRAMC_TRP         (0xf << 16)             /* Row Precharge Delay */
+#define                AT91_SDRAMC_TRCD        (0xf << 20)             /* Row to Column Delay */
+#define                AT91_SDRAMC_TRAS        (0xf << 24)             /* Active to Precharge Delay */
+#define                AT91_SDRAMC_TXSR        (0xf << 28)             /* Exit Self Refresh to Active Delay */
+
+#define AT91_SDRAMC_LPR                (AT91_SDRAMC + 0x10)    /* SDRAM Controller Low Power Register */
+#define                AT91_SDRAMC_LPCB                (3 << 0)        /* Low-power Configurations */
+#define                        AT91_SDRAMC_LPCB_DISABLE                0
+#define                        AT91_SDRAMC_LPCB_SELF_REFRESH           1
+#define                        AT91_SDRAMC_LPCB_POWER_DOWN             2
+#define                        AT91_SDRAMC_LPCB_DEEP_POWER_DOWN        3
+#define                AT91_SDRAMC_PASR                (7 << 4)        /* Partial Array Self Refresh */
+#define                AT91_SDRAMC_TCSR                (3 << 8)        /* Temperature Compensated Self Refresh */
+#define                AT91_SDRAMC_DS                  (3 << 10)       /* Drive Strenght */
+#define                AT91_SDRAMC_TIMEOUT             (3 << 12)       /* Time to define when Low Power Mode is enabled */
+#define                        AT91_SDRAMC_TIMEOUT_0_CLK_CYCLES        (0 << 12)
+#define                        AT91_SDRAMC_TIMEOUT_64_CLK_CYCLES       (1 << 12)
+#define                        AT91_SDRAMC_TIMEOUT_128_CLK_CYCLES      (2 << 12)
+
+#define AT91_SDRAMC_IER                (AT91_SDRAMC + 0x14)    /* SDRAM Controller Interrupt Enable Register */
+#define AT91_SDRAMC_IDR                (AT91_SDRAMC + 0x18)    /* SDRAM Controller Interrupt Disable Register */
+#define AT91_SDRAMC_IMR                (AT91_SDRAMC + 0x1C)    /* SDRAM Controller Interrupt Mask Register */
+#define AT91_SDRAMC_ISR                (AT91_SDRAMC + 0x20)    /* SDRAM Controller Interrupt Status Register */
+#define                AT91_SDRAMC_RES         (1 << 0)                /* Refresh Error Status */
+
+#define AT91_SDRAMC_MDR                (AT91_SDRAMC + 0x24)    /* SDRAM Memory Device Register */
+#define                AT91_SDRAMC_MD          (3 << 0)                /* Memory Device Type */
+#define                        AT91_SDRAMC_MD_SDRAM            0
+#define                        AT91_SDRAMC_MD_LOW_POWER_SDRAM  1
+
+/* Static Memory Controller (SMC) registers */
+#define AT91_SMC_SETUP(n)      (AT91_SMC + 0x00 + ((n)*0x10))  /* Setup Register for CS n */
+#define                AT91_SMC_NWESETUP       (0x3f << 0)                     /* NWE Setup Length */
+#define                        AT91_SMC_NWESETUP_(x)   ((x) << 0)
+#define                AT91_SMC_NCS_WRSETUP    (0x3f << 8)                     /* NCS Setup Length in Write Access */
+#define                        AT91_SMC_NCS_WRSETUP_(x)        ((x) << 8)
+#define                AT91_SMC_NRDSETUP       (0x3f << 16)                    /* NRD Setup Length */
+#define                        AT91_SMC_NRDSETUP_(x)   ((x) << 16)
+#define                AT91_SMC_NCS_RDSETUP    (0x3f << 24)                    /* NCS Setup Length in Read Access */
+#define                        AT91_SMC_NCS_RDSETUP_(x)        ((x) << 24)
+
+#define AT91_SMC_PULSE(n)      (AT91_SMC + 0x04 + ((n)*0x10))  /* Pulse Register for CS n */
+#define                AT91_SMC_NWEPULSE       (0x7f <<  0)                    /* NWE Pulse Length */
+#define                        AT91_SMC_NWEPULSE_(x)   ((x) << 0)
+#define                AT91_SMC_NCS_WRPULSE    (0x7f <<  8)                    /* NCS Pulse Length in Write Access */
+#define                        AT91_SMC_NCS_WRPULSE_(x)((x) << 8)
+#define                AT91_SMC_NRDPULSE       (0x7f << 16)                    /* NRD Pulse Length */
+#define                        AT91_SMC_NRDPULSE_(x)   ((x) << 16)
+#define                AT91_SMC_NCS_RDPULSE    (0x7f << 24)                    /* NCS Pulse Length in Read Access */
+#define                        AT91_SMC_NCS_RDPULSE_(x)((x) << 24)
+
+#define AT91_SMC_CYCLE(n)      (AT91_SMC + 0x08 + ((n)*0x10))  /* Cycle Register for CS n */
+#define                AT91_SMC_NWECYCLE       (0x1ff << 0 )                   /* Total Write Cycle Length */
+#define                        AT91_SMC_NWECYCLE_(x)   ((x) << 0)
+#define                AT91_SMC_NRDCYCLE       (0x1ff << 16)                   /* Total Read Cycle Length */
+#define                        AT91_SMC_NRDCYCLE_(x)   ((x) << 16)
+
+#define AT91_SMC_MODE(n)       (AT91_SMC + 0x0c + ((n)*0x10))  /* Mode Register for CS n */
+#define                AT91_SMC_READMODE       (1 <<  0)                       /* Read Mode */
+#define                AT91_SMC_WRITEMODE      (1 <<  1)                       /* Write Mode */
+#define                AT91_SMC_EXNWMODE       (3 <<  4)                       /* NWAIT Mode */
+#define                        AT91_SMC_EXNWMODE_DISABLE       (0 << 4)
+#define                        AT91_SMC_EXNWMODE_FROZEN        (2 << 4)
+#define                        AT91_SMC_EXNWMODE_READY         (3 << 4)
+#define                AT91_SMC_BAT            (1 <<  8)                       /* Byte Access Type */
+#define                        AT91_SMC_BAT_SELECT             (0 << 8)
+#define                        AT91_SMC_BAT_WRITE              (1 << 8)
+#define                AT91_SMC_DBW            (3 << 12)                       /* Data Bus Width */
+#define                        AT91_SMC_DBW_8                  (0 << 12)
+#define                        AT91_SMC_DBW_16                 (1 << 12)
+#define                        AT91_SMC_DBW_32                 (2 << 12)
+#define                AT91_SMC_TDF            (0xf << 16)                     /* Data Float Time. */
+#define                        AT91_SMC_TDF_(x)                ((x) << 16)
+#define                AT91_SMC_TDFMODE        (1 << 20)                       /* TDF Optimization - Enabled */
+#define                AT91_SMC_PMEN           (1 << 24)                       /* Page Mode Enabled */
+#define                AT91_SMC_PS             (3 << 28)                       /* Page Size */
+#define                        AT91_SMC_PS_4                   (0 << 28)
+#define                        AT91_SMC_PS_8                   (1 << 28)
+#define                        AT91_SMC_PS_16                  (2 << 28)
+#define                        AT91_SMC_PS_32                  (3 << 28)
+
+#if defined(AT91_SMC1)         /* The AT91SAM9263 has 2 Static Memory contollers */
+#define AT91_SMC1_SETUP(n)     (AT91_SMC1 + 0x00 + ((n)*0x10)) /* Setup Register for CS n */
+#define AT91_SMC1_PULSE(n)     (AT91_SMC1 + 0x04 + ((n)*0x10)) /* Pulse Register for CS n */
+#define AT91_SMC1_CYCLE(n)     (AT91_SMC1 + 0x08 + ((n)*0x10)) /* Cycle Register for CS n */
+#define AT91_SMC1_MODE(n)      (AT91_SMC1 + 0x0c + ((n)*0x10)) /* Mode Register for CS n */
+#endif
+
+#endif
similarity index 95%
rename from include/asm-arm/arch-at91cap9/clk.h
rename to include/asm-arm/arch-at91sam9/clk.h
index ca65a2a..86da9a6 100644 (file)
 
 static inline unsigned long get_macb_pclk_rate(unsigned int dev_id)
 {
-       return AT91C_MASTER_CLOCK;
+       return AT91_MASTER_CLOCK;
 }
 
 static inline unsigned long get_usart_clk_rate(unsigned int dev_id)
 {
-       return AT91C_MASTER_CLOCK;
+       return AT91_MASTER_CLOCK;
 }
 
 #endif /* __ASM_ARM_ARCH_CLK_H__ */
diff --git a/include/asm-arm/arch-at91sam9/gpio.h b/include/asm-arm/arch-at91sam9/gpio.h
new file mode 100644 (file)
index 0000000..2500eae
--- /dev/null
@@ -0,0 +1,366 @@
+/*
+ * include/asm-arm/arch-at91/gpio.h
+ *
+ *  Copyright (C) 2005 HP Labs
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ */
+
+#ifndef __ASM_ARCH_AT91_GPIO_H
+#define __ASM_ARCH_AT91_GPIO_H
+
+#include <asm/io.h>
+#include <asm/errno.h>
+#include <asm/arch/at91_pio.h>
+
+#define PIN_BASE               32
+
+#define MAX_GPIO_BANKS         5
+
+/* these pin numbers double as IRQ numbers, like AT91xxx_ID_* values */
+
+#define        AT91_PIN_PA0    (PIN_BASE + 0x00 + 0)
+#define        AT91_PIN_PA1    (PIN_BASE + 0x00 + 1)
+#define        AT91_PIN_PA2    (PIN_BASE + 0x00 + 2)
+#define        AT91_PIN_PA3    (PIN_BASE + 0x00 + 3)
+#define        AT91_PIN_PA4    (PIN_BASE + 0x00 + 4)
+#define        AT91_PIN_PA5    (PIN_BASE + 0x00 + 5)
+#define        AT91_PIN_PA6    (PIN_BASE + 0x00 + 6)
+#define        AT91_PIN_PA7    (PIN_BASE + 0x00 + 7)
+#define        AT91_PIN_PA8    (PIN_BASE + 0x00 + 8)
+#define        AT91_PIN_PA9    (PIN_BASE + 0x00 + 9)
+#define        AT91_PIN_PA10   (PIN_BASE + 0x00 + 10)
+#define        AT91_PIN_PA11   (PIN_BASE + 0x00 + 11)
+#define        AT91_PIN_PA12   (PIN_BASE + 0x00 + 12)
+#define        AT91_PIN_PA13   (PIN_BASE + 0x00 + 13)
+#define        AT91_PIN_PA14   (PIN_BASE + 0x00 + 14)
+#define        AT91_PIN_PA15   (PIN_BASE + 0x00 + 15)
+#define        AT91_PIN_PA16   (PIN_BASE + 0x00 + 16)
+#define        AT91_PIN_PA17   (PIN_BASE + 0x00 + 17)
+#define        AT91_PIN_PA18   (PIN_BASE + 0x00 + 18)
+#define        AT91_PIN_PA19   (PIN_BASE + 0x00 + 19)
+#define        AT91_PIN_PA20   (PIN_BASE + 0x00 + 20)
+#define        AT91_PIN_PA21   (PIN_BASE + 0x00 + 21)
+#define        AT91_PIN_PA22   (PIN_BASE + 0x00 + 22)
+#define        AT91_PIN_PA23   (PIN_BASE + 0x00 + 23)
+#define        AT91_PIN_PA24   (PIN_BASE + 0x00 + 24)
+#define        AT91_PIN_PA25   (PIN_BASE + 0x00 + 25)
+#define        AT91_PIN_PA26   (PIN_BASE + 0x00 + 26)
+#define        AT91_PIN_PA27   (PIN_BASE + 0x00 + 27)
+#define        AT91_PIN_PA28   (PIN_BASE + 0x00 + 28)
+#define        AT91_PIN_PA29   (PIN_BASE + 0x00 + 29)
+#define        AT91_PIN_PA30   (PIN_BASE + 0x00 + 30)
+#define        AT91_PIN_PA31   (PIN_BASE + 0x00 + 31)
+
+#define        AT91_PIN_PB0    (PIN_BASE + 0x20 + 0)
+#define        AT91_PIN_PB1    (PIN_BASE + 0x20 + 1)
+#define        AT91_PIN_PB2    (PIN_BASE + 0x20 + 2)
+#define        AT91_PIN_PB3    (PIN_BASE + 0x20 + 3)
+#define        AT91_PIN_PB4    (PIN_BASE + 0x20 + 4)
+#define        AT91_PIN_PB5    (PIN_BASE + 0x20 + 5)
+#define        AT91_PIN_PB6    (PIN_BASE + 0x20 + 6)
+#define        AT91_PIN_PB7    (PIN_BASE + 0x20 + 7)
+#define        AT91_PIN_PB8    (PIN_BASE + 0x20 + 8)
+#define        AT91_PIN_PB9    (PIN_BASE + 0x20 + 9)
+#define        AT91_PIN_PB10   (PIN_BASE + 0x20 + 10)
+#define        AT91_PIN_PB11   (PIN_BASE + 0x20 + 11)
+#define        AT91_PIN_PB12   (PIN_BASE + 0x20 + 12)
+#define        AT91_PIN_PB13   (PIN_BASE + 0x20 + 13)
+#define        AT91_PIN_PB14   (PIN_BASE + 0x20 + 14)
+#define        AT91_PIN_PB15   (PIN_BASE + 0x20 + 15)
+#define        AT91_PIN_PB16   (PIN_BASE + 0x20 + 16)
+#define        AT91_PIN_PB17   (PIN_BASE + 0x20 + 17)
+#define        AT91_PIN_PB18   (PIN_BASE + 0x20 + 18)
+#define        AT91_PIN_PB19   (PIN_BASE + 0x20 + 19)
+#define        AT91_PIN_PB20   (PIN_BASE + 0x20 + 20)
+#define        AT91_PIN_PB21   (PIN_BASE + 0x20 + 21)
+#define        AT91_PIN_PB22   (PIN_BASE + 0x20 + 22)
+#define        AT91_PIN_PB23   (PIN_BASE + 0x20 + 23)
+#define        AT91_PIN_PB24   (PIN_BASE + 0x20 + 24)
+#define        AT91_PIN_PB25   (PIN_BASE + 0x20 + 25)
+#define        AT91_PIN_PB26   (PIN_BASE + 0x20 + 26)
+#define        AT91_PIN_PB27   (PIN_BASE + 0x20 + 27)
+#define        AT91_PIN_PB28   (PIN_BASE + 0x20 + 28)
+#define        AT91_PIN_PB29   (PIN_BASE + 0x20 + 29)
+#define        AT91_PIN_PB30   (PIN_BASE + 0x20 + 30)
+#define        AT91_PIN_PB31   (PIN_BASE + 0x20 + 31)
+
+#define        AT91_PIN_PC0    (PIN_BASE + 0x40 + 0)
+#define        AT91_PIN_PC1    (PIN_BASE + 0x40 + 1)
+#define        AT91_PIN_PC2    (PIN_BASE + 0x40 + 2)
+#define        AT91_PIN_PC3    (PIN_BASE + 0x40 + 3)
+#define        AT91_PIN_PC4    (PIN_BASE + 0x40 + 4)
+#define        AT91_PIN_PC5    (PIN_BASE + 0x40 + 5)
+#define        AT91_PIN_PC6    (PIN_BASE + 0x40 + 6)
+#define        AT91_PIN_PC7    (PIN_BASE + 0x40 + 7)
+#define        AT91_PIN_PC8    (PIN_BASE + 0x40 + 8)
+#define        AT91_PIN_PC9    (PIN_BASE + 0x40 + 9)
+#define        AT91_PIN_PC10   (PIN_BASE + 0x40 + 10)
+#define        AT91_PIN_PC11   (PIN_BASE + 0x40 + 11)
+#define        AT91_PIN_PC12   (PIN_BASE + 0x40 + 12)
+#define        AT91_PIN_PC13   (PIN_BASE + 0x40 + 13)
+#define        AT91_PIN_PC14   (PIN_BASE + 0x40 + 14)
+#define        AT91_PIN_PC15   (PIN_BASE + 0x40 + 15)
+#define        AT91_PIN_PC16   (PIN_BASE + 0x40 + 16)
+#define        AT91_PIN_PC17   (PIN_BASE + 0x40 + 17)
+#define        AT91_PIN_PC18   (PIN_BASE + 0x40 + 18)
+#define        AT91_PIN_PC19   (PIN_BASE + 0x40 + 19)
+#define        AT91_PIN_PC20   (PIN_BASE + 0x40 + 20)
+#define        AT91_PIN_PC21   (PIN_BASE + 0x40 + 21)
+#define        AT91_PIN_PC22   (PIN_BASE + 0x40 + 22)
+#define        AT91_PIN_PC23   (PIN_BASE + 0x40 + 23)
+#define        AT91_PIN_PC24   (PIN_BASE + 0x40 + 24)
+#define        AT91_PIN_PC25   (PIN_BASE + 0x40 + 25)
+#define        AT91_PIN_PC26   (PIN_BASE + 0x40 + 26)
+#define        AT91_PIN_PC27   (PIN_BASE + 0x40 + 27)
+#define        AT91_PIN_PC28   (PIN_BASE + 0x40 + 28)
+#define        AT91_PIN_PC29   (PIN_BASE + 0x40 + 29)
+#define        AT91_PIN_PC30   (PIN_BASE + 0x40 + 30)
+#define        AT91_PIN_PC31   (PIN_BASE + 0x40 + 31)
+
+#define        AT91_PIN_PD0    (PIN_BASE + 0x60 + 0)
+#define        AT91_PIN_PD1    (PIN_BASE + 0x60 + 1)
+#define        AT91_PIN_PD2    (PIN_BASE + 0x60 + 2)
+#define        AT91_PIN_PD3    (PIN_BASE + 0x60 + 3)
+#define        AT91_PIN_PD4    (PIN_BASE + 0x60 + 4)
+#define        AT91_PIN_PD5    (PIN_BASE + 0x60 + 5)
+#define        AT91_PIN_PD6    (PIN_BASE + 0x60 + 6)
+#define        AT91_PIN_PD7    (PIN_BASE + 0x60 + 7)
+#define        AT91_PIN_PD8    (PIN_BASE + 0x60 + 8)
+#define        AT91_PIN_PD9    (PIN_BASE + 0x60 + 9)
+#define        AT91_PIN_PD10   (PIN_BASE + 0x60 + 10)
+#define        AT91_PIN_PD11   (PIN_BASE + 0x60 + 11)
+#define        AT91_PIN_PD12   (PIN_BASE + 0x60 + 12)
+#define        AT91_PIN_PD13   (PIN_BASE + 0x60 + 13)
+#define        AT91_PIN_PD14   (PIN_BASE + 0x60 + 14)
+#define        AT91_PIN_PD15   (PIN_BASE + 0x60 + 15)
+#define        AT91_PIN_PD16   (PIN_BASE + 0x60 + 16)
+#define        AT91_PIN_PD17   (PIN_BASE + 0x60 + 17)
+#define        AT91_PIN_PD18   (PIN_BASE + 0x60 + 18)
+#define        AT91_PIN_PD19   (PIN_BASE + 0x60 + 19)
+#define        AT91_PIN_PD20   (PIN_BASE + 0x60 + 20)
+#define        AT91_PIN_PD21   (PIN_BASE + 0x60 + 21)
+#define        AT91_PIN_PD22   (PIN_BASE + 0x60 + 22)
+#define        AT91_PIN_PD23   (PIN_BASE + 0x60 + 23)
+#define        AT91_PIN_PD24   (PIN_BASE + 0x60 + 24)
+#define        AT91_PIN_PD25   (PIN_BASE + 0x60 + 25)
+#define        AT91_PIN_PD26   (PIN_BASE + 0x60 + 26)
+#define        AT91_PIN_PD27   (PIN_BASE + 0x60 + 27)
+#define        AT91_PIN_PD28   (PIN_BASE + 0x60 + 28)
+#define        AT91_PIN_PD29   (PIN_BASE + 0x60 + 29)
+#define        AT91_PIN_PD30   (PIN_BASE + 0x60 + 30)
+#define        AT91_PIN_PD31   (PIN_BASE + 0x60 + 31)
+
+#define        AT91_PIN_PE0    (PIN_BASE + 0x80 + 0)
+#define        AT91_PIN_PE1    (PIN_BASE + 0x80 + 1)
+#define        AT91_PIN_PE2    (PIN_BASE + 0x80 + 2)
+#define        AT91_PIN_PE3    (PIN_BASE + 0x80 + 3)
+#define        AT91_PIN_PE4    (PIN_BASE + 0x80 + 4)
+#define        AT91_PIN_PE5    (PIN_BASE + 0x80 + 5)
+#define        AT91_PIN_PE6    (PIN_BASE + 0x80 + 6)
+#define        AT91_PIN_PE7    (PIN_BASE + 0x80 + 7)
+#define        AT91_PIN_PE8    (PIN_BASE + 0x80 + 8)
+#define        AT91_PIN_PE9    (PIN_BASE + 0x80 + 9)
+#define        AT91_PIN_PE10   (PIN_BASE + 0x80 + 10)
+#define        AT91_PIN_PE11   (PIN_BASE + 0x80 + 11)
+#define        AT91_PIN_PE12   (PIN_BASE + 0x80 + 12)
+#define        AT91_PIN_PE13   (PIN_BASE + 0x80 + 13)
+#define        AT91_PIN_PE14   (PIN_BASE + 0x80 + 14)
+#define        AT91_PIN_PE15   (PIN_BASE + 0x80 + 15)
+#define        AT91_PIN_PE16   (PIN_BASE + 0x80 + 16)
+#define        AT91_PIN_PE17   (PIN_BASE + 0x80 + 17)
+#define        AT91_PIN_PE18   (PIN_BASE + 0x80 + 18)
+#define        AT91_PIN_PE19   (PIN_BASE + 0x80 + 19)
+#define        AT91_PIN_PE20   (PIN_BASE + 0x80 + 20)
+#define        AT91_PIN_PE21   (PIN_BASE + 0x80 + 21)
+#define        AT91_PIN_PE22   (PIN_BASE + 0x80 + 22)
+#define        AT91_PIN_PE23   (PIN_BASE + 0x80 + 23)
+#define        AT91_PIN_PE24   (PIN_BASE + 0x80 + 24)
+#define        AT91_PIN_PE25   (PIN_BASE + 0x80 + 25)
+#define        AT91_PIN_PE26   (PIN_BASE + 0x80 + 26)
+#define        AT91_PIN_PE27   (PIN_BASE + 0x80 + 27)
+#define        AT91_PIN_PE28   (PIN_BASE + 0x80 + 28)
+#define        AT91_PIN_PE29   (PIN_BASE + 0x80 + 29)
+#define        AT91_PIN_PE30   (PIN_BASE + 0x80 + 30)
+#define        AT91_PIN_PE31   (PIN_BASE + 0x80 + 31)
+
+static unsigned long at91_pios[] = {
+       AT91_PIOA,
+       AT91_PIOB,
+       AT91_PIOC,
+#ifdef AT91_PIOD
+       AT91_PIOD,
+#ifdef AT91_PIOE
+       AT91_PIOE
+#endif
+#endif
+};
+
+static inline void *pin_to_controller(unsigned pin)
+{
+       pin -= PIN_BASE;
+       pin /= 32;
+       return (void *)(AT91_BASE_SYS + at91_pios[pin]);
+}
+
+static inline unsigned pin_to_mask(unsigned pin)
+{
+       pin -= PIN_BASE;
+       return 1 << (pin % 32);
+}
+
+/*
+ * mux the pin to the "GPIO" peripheral role.
+ */
+static inline int at91_set_GPIO_periph(unsigned pin, int use_pullup)
+{
+       void            *pio = pin_to_controller(pin);
+       unsigned        mask = pin_to_mask(pin);
+
+       __raw_writel(mask, pio + PIO_IDR);
+       __raw_writel(mask, pio + (use_pullup ? PIO_PUER : PIO_PUDR));
+       __raw_writel(mask, pio + PIO_PER);
+       return 0;
+}
+
+/*
+ * mux the pin to the "A" internal peripheral role.
+ */
+static inline int at91_set_A_periph(unsigned pin, int use_pullup)
+{
+       void            *pio = pin_to_controller(pin);
+       unsigned        mask = pin_to_mask(pin);
+
+       __raw_writel(mask, pio + PIO_IDR);
+       __raw_writel(mask, pio + (use_pullup ? PIO_PUER : PIO_PUDR));
+       __raw_writel(mask, pio + PIO_ASR);
+       __raw_writel(mask, pio + PIO_PDR);
+       return 0;
+}
+
+/*
+ * mux the pin to the "B" internal peripheral role.
+ */
+static inline int at91_set_B_periph(unsigned pin, int use_pullup)
+{
+       void            *pio = pin_to_controller(pin);
+       unsigned        mask = pin_to_mask(pin);
+
+       __raw_writel(mask, pio + PIO_IDR);
+       __raw_writel(mask, pio + (use_pullup ? PIO_PUER : PIO_PUDR));
+       __raw_writel(mask, pio + PIO_BSR);
+       __raw_writel(mask, pio + PIO_PDR);
+       return 0;
+}
+
+/*
+ * mux the pin to the gpio controller (instead of "A" or "B" peripheral), and
+ * configure it for an input.
+ */
+static inline int at91_set_gpio_input(unsigned pin, int use_pullup)
+{
+       void            *pio = pin_to_controller(pin);
+       unsigned        mask = pin_to_mask(pin);
+
+       __raw_writel(mask, pio + PIO_IDR);
+       __raw_writel(mask, pio + (use_pullup ? PIO_PUER : PIO_PUDR));
+       __raw_writel(mask, pio + PIO_ODR);
+       __raw_writel(mask, pio + PIO_PER);
+       return 0;
+}
+
+/*
+ * mux the pin to the gpio controller (instead of "A" or "B" peripheral),
+ * and configure it for an output.
+ */
+static inline int at91_set_gpio_output(unsigned pin, int value)
+{
+       void            *pio = pin_to_controller(pin);
+       unsigned        mask = pin_to_mask(pin);
+
+       __raw_writel(mask, pio + PIO_IDR);
+       __raw_writel(mask, pio + PIO_PUDR);
+       __raw_writel(mask, pio + (value ? PIO_SODR : PIO_CODR));
+       __raw_writel(mask, pio + PIO_OER);
+       __raw_writel(mask, pio + PIO_PER);
+       return 0;
+}
+
+/*
+ * enable/disable the glitch filter; mostly used with IRQ handling.
+ */
+static inline int at91_set_deglitch(unsigned pin, int is_on)
+{
+       void            *pio = pin_to_controller(pin);
+       unsigned        mask = pin_to_mask(pin);
+
+       __raw_writel(mask, pio + (is_on ? PIO_IFER : PIO_IFDR));
+       return 0;
+}
+
+/*
+ * enable/disable the multi-driver; This is only valid for output and
+ * allows the output pin to run as an open collector output.
+ */
+static inline int at91_set_multi_drive(unsigned pin, int is_on)
+{
+       void            *pio = pin_to_controller(pin);
+       unsigned        mask = pin_to_mask(pin);
+
+       __raw_writel(mask, pio + (is_on ? PIO_MDER : PIO_MDDR));
+       return 0;
+}
+
+static inline int gpio_direction_input(unsigned pin)
+{
+       void            *pio = pin_to_controller(pin);
+       unsigned        mask = pin_to_mask(pin);
+
+       if (!(__raw_readl(pio + PIO_PSR) & mask))
+               return -EINVAL;
+       __raw_writel(mask, pio + PIO_ODR);
+       return 0;
+}
+
+static inline int gpio_direction_output(unsigned pin, int value)
+{
+       void            *pio = pin_to_controller(pin);
+       unsigned        mask = pin_to_mask(pin);
+
+       if (!(__raw_readl(pio + PIO_PSR) & mask))
+               return -EINVAL;
+       __raw_writel(mask, pio + (value ? PIO_SODR : PIO_CODR));
+       __raw_writel(mask, pio + PIO_OER);
+       return 0;
+}
+
+/*
+ * assuming the pin is muxed as a gpio output, set its value.
+ */
+static inline int at91_set_gpio_value(unsigned pin, int value)
+{
+       void            *pio = pin_to_controller(pin);
+       unsigned        mask = pin_to_mask(pin);
+
+       __raw_writel(mask, pio + (value ? PIO_SODR : PIO_CODR));
+       return 0;
+}
+
+/*
+ * read the pin's value (works even if it's not muxed as a gpio).
+ */
+static inline int at91_get_gpio_value(unsigned pin)
+{
+       void            *pio = pin_to_controller(pin);
+       unsigned        mask = pin_to_mask(pin);
+       u32             pdsr;
+
+       pdsr = __raw_readl(pio + PIO_PDSR);
+       return (pdsr & mask) != 0;
+}
+
+#endif
diff --git a/include/asm-arm/arch-at91sam9/hardware.h b/include/asm-arm/arch-at91sam9/hardware.h
new file mode 100644 (file)
index 0000000..80b334f
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * include/asm-arm/arch-at91/hardware.h
+ *
+ *  Copyright (C) 2003 SAN People
+ *  Copyright (C) 2003 ATMEL
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ */
+
+#ifndef __ASM_ARCH_HARDWARE_H
+#define __ASM_ARCH_HARDWARE_H
+
+#include <asm/sizes.h>
+
+#if defined(CONFIG_AT91RM9200)
+#include <asm/arch/at91rm9200.h>
+#elif defined(CONFIG_AT91SAM9260)
+#include <asm/arch/at91sam9260.h>
+#define AT91_BASE_EMAC AT91SAM9260_BASE_EMAC
+#define AT91_BASE_SPI  AT91SAM9260_BASE_SPI0
+#define AT91_ID_UHP    AT91SAM9260_ID_UHP
+#define AT91_PMC_UHP   AT91SAM926x_PMC_UHP
+#elif defined(CONFIG_AT91SAM9261)
+#include <asm/arch/at91sam9261.h>
+#elif defined(CONFIG_AT91SAM9263)
+#include <asm/arch/at91sam9263.h>
+#elif defined(CONFIG_AT91SAM9RL)
+#include <asm/arch/at91sam9rl.h>
+#elif defined(CONFIG_AT91CAP9)
+#include <asm/arch/at91cap9.h>
+#define AT91_BASE_EMAC AT91CAP9_BASE_EMAC
+#define AT91_BASE_SPI  AT91CAP9_BASE_SPI0
+#define AT91_ID_UHP    AT91CAP9_ID_UHP
+#define AT91_PMC_UHP   AT91CAP9_PMC_UHP
+#elif defined(CONFIG_AT91X40)
+#include <asm/arch/at91x40.h>
+#else
+#error "Unsupported AT91 processor"
+#endif
+
+/*
+ * container_of - cast a member of a structure out to the containing structure
+ *
+ * @ptr:       the pointer to the member.
+ * @type:      the type of the container struct this is embedded in.
+ * @member:    the name of the member within the struct.
+ */
+#define container_of(ptr, type, member) ({                     \
+       const typeof(((type *)0)->member) *__mptr = (ptr);      \
+       (type *)((char *)__mptr - offsetof(type, member)); })
+
+#endif
diff --git a/include/asm-arm/arch-at91sam9/io.h b/include/asm-arm/arch-at91sam9/io.h
new file mode 100644 (file)
index 0000000..be9e9ab
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * include/asm-arm/arch-at91/io.h
+ *
+ *  Copyright (C) 2003 SAN People
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __ASM_ARCH_IO_H
+#define __ASM_ARCH_IO_H
+
+#include <asm/io.h>
+
+static inline unsigned int at91_sys_read(unsigned int reg_offset)
+{
+       void *addr = (void *)AT91_BASE_SYS;
+
+       return __raw_readl(addr + reg_offset);
+}
+
+static inline void at91_sys_write(unsigned int reg_offset, unsigned long value)
+{
+       void *addr = (void *)AT91_BASE_SYS;
+
+       __raw_writel(value, addr + reg_offset);
+}
+
+#endif
similarity index 85%
rename from include/asm-arm/arch-at91cap9/memory-map.h
rename to include/asm-arm/arch-at91sam9/memory-map.h
index eee7bd6..da98822 100644 (file)
 #ifndef __ASM_ARM_ARCH_MEMORYMAP_H__
 #define __ASM_ARM_ARCH_MEMORYMAP_H__
 
-#include <asm/arch/AT91CAP9.h>
+#include <asm/arch/hardware.h>
 
-#define USART0_BASE AT91C_BASE_US0
-#define USART1_BASE AT91C_BASE_US1
-#define USART2_BASE AT91C_BASE_US2
-#define USART3_BASE AT91C_BASE_DBGU
+#define USART0_BASE AT91_USART0
+#define USART1_BASE AT91_USART1
+#define USART2_BASE AT91_USART2
+#define USART3_BASE (AT91_BASE_SYS + AT91_DBGU)
 
 #endif /* __ASM_ARM_ARCH_MEMORYMAP_H__ */
diff --git a/include/asm-arm/arch-mx31/mx31-regs.h b/include/asm-arm/arch-mx31/mx31-regs.h
new file mode 100644 (file)
index 0000000..02b7dcb
--- /dev/null
@@ -0,0 +1,156 @@
+/*
+ *
+ * (c) 2007 Pengutronix, Sascha Hauer <s.hauer@pengutronix.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 __ASM_ARCH_MX31_REGS_H
+#define __ASM_ARCH_MX31_REGS_H
+
+#define __REG(x)     (*((volatile u32 *)(x)))
+#define __REG16(x)   (*((volatile u16 *)(x)))
+#define __REG8(x)    (*((volatile u8 *)(x)))
+
+#define CCM_BASE       0x53f80000
+#define CCM_CCMR       (CCM_BASE + 0x00)
+#define CCM_PDR0       (CCM_BASE + 0x04)
+#define CCM_PDR1       (CCM_BASE + 0x08)
+#define CCM_RCSR       (CCM_BASE + 0x0c)
+#define CCM_MPCTL      (CCM_BASE + 0x10)
+#define CCM_UPCTL      (CCM_BASE + 0x10)
+#define CCM_SPCTL      (CCM_BASE + 0x18)
+#define CCM_COSR       (CCM_BASE + 0x1C)
+#define CCM_CGR0       (CCM_BASE + 0x20)
+#define CCM_CGR1       (CCM_BASE + 0x24)
+#define CCM_CGR2       (CCM_BASE + 0x28)
+
+#define CCMR_MDS       (1 << 7)
+#define CCMR_SBYCS     (1 << 4)
+#define CCMR_MPE       (1 << 3)
+#define CCMR_PRCS_MASK (3 << 1)
+#define CCMR_FPM       (1 << 1)
+#define CCMR_CKIH      (2 << 1)
+
+#define PDR0_CSI_PODF(x)       (((x) & 0x1ff) << 23)
+#define PDR0_PER_PODF(x)       (((x) & 0x1f) << 16)
+#define PDR0_HSP_PODF(x)       (((x) & 0x7) << 11)
+#define PDR0_NFC_PODF(x)       (((x) & 0x7) << 8)
+#define PDR0_IPG_PODF(x)       (((x) & 0x3) << 6)
+#define PDR0_MAX_PODF(x)       (((x) & 0x7) << 3)
+#define PDR0_MCU_PODF(x)       ((x) & 0x7)
+
+#define PLL_PD(x)              (((x) & 0xf) << 26)
+#define PLL_MFD(x)             (((x) & 0x3ff) << 16)
+#define PLL_MFI(x)             (((x) & 0xf) << 10)
+#define PLL_MFN(x)             (((x) & 0x3ff) << 0)
+
+#define WEIM_BASE      0xb8002000
+#define CSCR_U(x)      (WEIM_BASE + (x) * 0x10)
+#define CSCR_L(x)      (WEIM_BASE + 4 + (x) * 0x10)
+#define CSCR_A(x)      (WEIM_BASE + 8 + (x) * 0x10)
+
+#define IOMUXC_BASE    0x43FAC000
+#define IOMUXC_GPR     (IOMUXC_BASE + 0x8)
+#define IOMUXC_SW_MUX_CTL(x)   (IOMUXC_BASE + 0xc + (x) * 4)
+#define IOMUXC_SW_PAD_CTL(x)   (IOMUXC_BASE + 0x154 + (x) * 4)
+
+#define IPU_BASE               0x53fc0000
+#define IPU_CONF               IPU_BASE
+
+#define IPU_CONF_PXL_ENDIAN    (1<<8)
+#define IPU_CONF_DU_EN         (1<<7)
+#define IPU_CONF_DI_EN         (1<<6)
+#define IPU_CONF_ADC_EN                (1<<5)
+#define IPU_CONF_SDC_EN                (1<<4)
+#define IPU_CONF_PF_EN         (1<<3)
+#define IPU_CONF_ROT_EN                (1<<2)
+#define IPU_CONF_IC_EN         (1<<1)
+#define IPU_CONF_SCI_EN                (1<<0)
+
+#define WDOG_BASE              0x53FDC000
+
+/*
+ * Signal Multiplexing (IOMUX)
+ */
+
+/* bits in the SW_MUX_CTL registers */
+#define MUX_CTL_OUT_GPIO_DR    (0 << 4)
+#define MUX_CTL_OUT_FUNC       (1 << 4)
+#define MUX_CTL_OUT_ALT1       (2 << 4)
+#define MUX_CTL_OUT_ALT2       (3 << 4)
+#define MUX_CTL_OUT_ALT3       (4 << 4)
+#define MUX_CTL_OUT_ALT4       (5 << 4)
+#define MUX_CTL_OUT_ALT5       (6 << 4)
+#define MUX_CTL_OUT_ALT6       (7 << 4)
+#define MUX_CTL_IN_NONE                (0 << 0)
+#define MUX_CTL_IN_GPIO                (1 << 0)
+#define MUX_CTL_IN_FUNC                (2 << 0)
+#define MUX_CTL_IN_ALT1                (4 << 0)
+#define MUX_CTL_IN_ALT2                (8 << 0)
+
+#define MUX_CTL_FUNC           (MUX_CTL_OUT_FUNC | MUX_CTL_IN_FUNC)
+#define MUX_CTL_ALT1           (MUX_CTL_OUT_ALT1 | MUX_CTL_IN_ALT1)
+#define MUX_CTL_ALT2           (MUX_CTL_OUT_ALT2 | MUX_CTL_IN_ALT2)
+#define MUX_CTL_GPIO           (MUX_CTL_OUT_GPIO_DR | MUX_CTL_IN_GPIO)
+
+/* Register offsets based on IOMUXC_BASE */
+/* 0x00 .. 0x7b */
+#define MUX_CTL_RTS1           0x7c
+#define MUX_CTL_CTS1           0x7d
+#define MUX_CTL_DTR_DCE1       0x7e
+#define MUX_CTL_DSR_DCE1       0x7f
+#define MUX_CTL_CSPI2_SCLK     0x80
+#define MUX_CTL_CSPI2_SPI_RDY  0x81
+#define MUX_CTL_RXD1           0x82
+#define MUX_CTL_TXD1           0x83
+#define MUX_CTL_CSPI2_MISO     0x84
+#define MUX_CTL_CSPI2_SS0      0x85
+#define MUX_CTL_CSPI2_SS1      0x86
+#define MUX_CTL_CSPI2_SS2      0x87
+#define MUX_CTL_CSPI2_MOSI     0x8b
+
+/* The modes a specific pin can be in
+ * these macros can be used in mx31_gpio_mux() and have the form
+ * MUX_[contact name]__[pin function]
+ */
+#define MUX_RXD1__UART1_RXD_MUX        ((MUX_CTL_FUNC << 8) | MUX_CTL_RXD1)
+#define MUX_TXD1__UART1_TXD_MUX        ((MUX_CTL_FUNC << 8) | MUX_CTL_TXD1)
+#define MUX_RTS1__UART1_RTS_B  ((MUX_CTL_FUNC << 8) | MUX_CTL_RTS1)
+#define MUX_RTS1__UART1_CTS_B  ((MUX_CTL_FUNC << 8) | MUX_CTL_CTS1)
+
+#define MUX_CSPI2_MOSI__I2C2_SCL ((MUX_CTL_ALT1 << 8) | MUX_CTL_CSPI2_MOSI)
+#define MUX_CSPI2_MISO__I2C2_SCL ((MUX_CTL_ALT1 << 8) | MUX_CTL_CSPI2_MISO)
+
+/*
+ * Memory regions and CS
+ */
+#define IPU_MEM_BASE   0x70000000
+#define CSD0_BASE      0x80000000
+#define CSD1_BASE      0x90000000
+#define CS0_BASE       0xA0000000
+#define CS1_BASE       0xA8000000
+#define CS2_BASE       0xB0000000
+#define CS3_BASE       0xB2000000
+#define CS4_BASE       0xB4000000
+#define CS4_PSRAM_BASE 0xB5000000
+#define CS5_BASE       0xB6000000
+#define PCMCIA_MEM_BASE        0xC0000000
+
+#endif /* __ASM_ARCH_MX31_REGS_H */
similarity index 65%
rename from cpu/bf561/start1.S
rename to include/asm-arm/arch-mx31/mx31.h
index 6d4731b..f89a401 100644 (file)
@@ -1,7 +1,6 @@
 /*
- * U-boot - start1.S Code running out of RAM after relocation
  *
- * Copyright (c) 2005-2007 Analog Devices Inc.
+ * (c) 2007 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
  *
  * 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
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
  */
 
-#define ASSEMBLY
-#include <linux/config.h>
-#include <config.h>
-#include <asm/blackfin.h>
+#ifndef __ASM_ARCH_MX31_H
+#define __ASM_ARCH_MX31_H
 
-.global        start1;
-.global        _start1;
+u32 mx31_get_mpl_dpdgck_clk(void);
+u32 mx31_get_mcu_main_clk(void);
+u32 mx31_get_ipg_clk(void);
+void mx31_gpio_mux(unsigned long mode);
 
-.text
-_start1:
-start1:
-       sp += -12;
-       call    _board_init_f;
-       sp += 12;
+#endif /* __ASM_ARCH_MX31_H */
index 029b7f9..c33b9e8 100644 (file)
@@ -38,8 +38,6 @@ static inline void sync(void)
  * that can be used to access the memory range with the caching
  * properties specified by "flags".
  */
-typedef unsigned long phys_addr_t;
-
 #define MAP_NOCACHE    (0)
 #define MAP_WRCOMBINE  (0)
 #define MAP_WRBACK     (0)
index e56f19d..71dc049 100644 (file)
@@ -45,6 +45,9 @@ typedef unsigned long long u64;
 
 typedef u32 dma_addr_t;
 
+typedef unsigned long phys_addr_t;
+typedef unsigned long phys_size_t;
+
 #endif /* __KERNEL__ */
 
 #endif
index ba14674..d030c26 100644 (file)
@@ -101,8 +101,6 @@ static inline void sync(void)
  * This implementation works for memory below 512MiB (flash, etc.) as
  * well as above 3.5GiB (internal peripherals.)
  */
-typedef unsigned long phys_addr_t;
-
 #define MAP_NOCACHE    (0)
 #define MAP_WRCOMBINE  (1 << 7)
 #define MAP_WRBACK     (MAP_WRCOMBINE | (1 << 9))
index 2dbea4b..c303e3c 100644 (file)
@@ -71,6 +71,9 @@ typedef unsigned long long u64;
 
 typedef u32 dma_addr_t;
 
+typedef unsigned long phys_addr_t;
+typedef unsigned long phys_size_t;
+
 #ifdef CONFIG_LBD
 typedef u64 sector_t;
 #define HAVE_SECTOR_T
index 4422225..6a1ffa1 100644 (file)
@@ -14,9 +14,9 @@
 # error Memory Map does not fit into configuration
 #endif
 
-/* Sanity check BFIN_CPU */
-#ifndef BFIN_CPU
-# error BFIN_CPU: your board config needs to define this
+/* Sanity check CONFIG_BFIN_CPU */
+#ifndef CONFIG_BFIN_CPU
+# error CONFIG_BFIN_CPU: your board config needs to define this
 #endif
 
 /* Make sure the structure is properly aligned */
index 2149685..da58914 100644 (file)
@@ -45,8 +45,6 @@ extern void cf_outb(unsigned char val, volatile unsigned char *addr);
  * that can be used to access the memory range with the caching
  * properties specified by "flags".
  */
-typedef unsigned long phys_addr_t;
-
 #define MAP_NOCACHE    (0)
 #define MAP_WRCOMBINE  (0)
 #define MAP_WRBACK     (0)
index 9fd8e03..2160ba0 100644 (file)
@@ -78,6 +78,9 @@ typedef unsigned long long u64;
 
 typedef u32 dma_addr_t;
 
+typedef unsigned long phys_addr_t;
+typedef unsigned long phys_size_t;
+
 #endif
 
 #endif
index db4f442..2c57140 100644 (file)
@@ -210,8 +210,6 @@ static inline void sync(void)
  * that can be used to access the memory range with the caching
  * properties specified by "flags".
  */
-typedef unsigned long phys_addr_t;
-
 #define MAP_NOCACHE    (0)
 #define MAP_WRCOMBINE  (0)
 #define MAP_WRBACK     (0)
index bdbde41..9a40e38 100644 (file)
@@ -45,6 +45,9 @@ typedef unsigned long long u64;
 
 typedef u32 dma_addr_t;
 
+typedef unsigned long phys_addr_t;
+typedef unsigned long phys_size_t;
+
 #endif /* __KERNEL__ */
 
 #endif
index c7103b1..b6266e4 100644 (file)
@@ -70,6 +70,5 @@ void *load_zimage(char *image, unsigned long kernel_size,
                  int auto_boot);
 
 void boot_zimage(void *setup_base);
-image_header_t *fake_zimage_header(image_header_t *hdr, void *ptr, int size);
 
 #endif
index 3c579d3..8327e1b 100644 (file)
@@ -64,10 +64,15 @@ typedef struct dspi {
 #define DSPI_DMCR_CTXF                 (0x00000800)
 #define DSPI_DMCR_DRXF                 (0x00001000)
 #define DSPI_DMCR_DTXF                 (0x00002000)
+#define DSPI_DMCR_MDIS                 (0x00004000)
 #define DSPI_DMCR_CSIS0                        (0x00010000)
+#define DSPI_DMCR_CSIS1                        (0x00020000)
 #define DSPI_DMCR_CSIS2                        (0x00040000)
 #define DSPI_DMCR_CSIS3                        (0x00080000)
+#define DSPI_DMCR_CSIS4                        (0x00100000)
 #define DSPI_DMCR_CSIS5                        (0x00200000)
+#define DSPI_DMCR_CSIS6                        (0x00400000)
+#define DSPI_DMCR_CSIS7                        (0x00800000)
 #define DSPI_DMCR_ROOE                 (0x01000000)
 #define DSPI_DMCR_PCSSE                        (0x02000000)
 #define DSPI_DMCR_MTFE                 (0x04000000)
@@ -92,6 +97,7 @@ typedef struct dspi {
 #define DSPI_DCTAR_CPHA                        (0x02000000)
 #define DSPI_DCTAR_CPOL                        (0x04000000)
 #define DSPI_DCTAR_TRSZ(x)             (((x)&0x0000000F)<<27)
+#define DSPI_DCTAR_DBR                 (0x80000000)
 #define DSPI_DCTAR_PCSSCK_1CLK         (0x00000000)
 #define DSPI_DCTAR_PCSSCK_3CLK         (0x00400000)
 #define DSPI_DCTAR_PCSSCK_5CLK         (0x00800000)
@@ -153,4 +159,8 @@ typedef struct dspi {
 /* Bit definitions and macros for DRFDR group */
 #define DSPI_DRFDR_RXDATA(x)           (((x)&0x0000FFFF))
 
+void dspi_init(void);
+void dspi_tx(int chipsel, u8 attrib, u16 data);
+u16 dspi_rx(void);
+
 #endif                         /* __DSPI_H__ */
index 916bf96..f1586d5 100644 (file)
 #endif
 #endif                         /* CONFIG_M5272 */
 
+#ifdef CONFIG_M5275
+#include <asm/immap_5275.h>
+#include <asm/m5275.h>
+
+#define CFG_FEC0_IOBASE                (MMAP_FEC0)
+#define CFG_FEC1_IOBASE                (MMAP_FEC1)
+#define CFG_UART_BASE          (MMAP_UART0 + (CFG_UART_PORT * 0x40))
+
+#define CFG_INTR_BASE          (MMAP_INTC0)
+#define CFG_NUM_IRQS           (192)
+
+/* Timer */
+#ifdef CONFIG_MCFTMR
+#define CFG_UDELAY_BASE                (MMAP_DTMR0)
+#define CFG_TMR_BASE           (MMAP_DTMR3)
+#define CFG_TMRPND_REG         (((volatile int0_t *)(CFG_INTR_BASE))->iprl0)
+#define CFG_TMRINTR_NO         (INT0_LO_DTMR3)
+#define CFG_TMRINTR_MASK       (INTC_IPRL_INT22)
+#define CFG_TMRINTR_PEND       (CFG_TMRINTR_MASK)
+#define CFG_TMRINTR_PRI                (0x1E)
+#define CFG_TIMER_PRESCALER    (((gd->bus_clk / 1000000) - 1) << 8)
+#endif
+#endif                         /* CONFIG_M5275 */
+
 #ifdef CONFIG_M5282
 #include <asm/immap_5282.h>
 #include <asm/m5282.h>
diff --git a/include/asm-m68k/immap_5275.h b/include/asm-m68k/immap_5275.h
new file mode 100644 (file)
index 0000000..774866e
--- /dev/null
@@ -0,0 +1,469 @@
+/*
+ * MCF5274/5 Internal Memory Map
+ *
+ * Copyright (c) 2005 Arthur Shipkowski <art@videon-central.com>
+ * Based on work Copyright (c) 2003 Josef Baumgartner
+ *                                  <josef.baumgartner@telex.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 __IMMAP_5275__
+#define __IMMAP_5275__
+
+#define MMAP_SCM       (CFG_MBAR + 0x00000000)
+#define MMAP_SDRAM     (CFG_MBAR + 0x00000040)
+#define MMAP_FBCS      (CFG_MBAR + 0x00000080)
+#define MMAP_DMA0      (CFG_MBAR + 0x00000100)
+#define MMAP_DMA1      (CFG_MBAR + 0x00000110)
+#define MMAP_DMA2      (CFG_MBAR + 0x00000120)
+#define MMAP_DMA3      (CFG_MBAR + 0x00000130)
+#define MMAP_UART0     (CFG_MBAR + 0x00000200)
+#define MMAP_UART1     (CFG_MBAR + 0x00000240)
+#define MMAP_UART2     (CFG_MBAR + 0x00000280)
+#define MMAP_I2C       (CFG_MBAR + 0x00000300)
+#define MMAP_QSPI      (CFG_MBAR + 0x00000340)
+#define MMAP_DTMR0     (CFG_MBAR + 0x00000400)
+#define MMAP_DTMR1     (CFG_MBAR + 0x00000440)
+#define MMAP_DTMR2     (CFG_MBAR + 0x00000480)
+#define MMAP_DTMR3     (CFG_MBAR + 0x000004C0)
+#define MMAP_INTC0     (CFG_MBAR + 0x00000C00)
+#define MMAP_INTC1     (CFG_MBAR + 0x00000D00)
+#define MMAP_INTCACK   (CFG_MBAR + 0x00000F00)
+#define MMAP_FEC0      (CFG_MBAR + 0x00001000)
+#define MMAP_FEC0FIFO  (CFG_MBAR + 0x00001400)
+#define MMAP_FEC1      (CFG_MBAR + 0x00001800)
+#define MMAP_FEC1FIFO  (CFG_MBAR + 0x00001C00)
+#define MMAP_GPIO      (CFG_MBAR + 0x00100000)
+#define MMAP_RCM       (CFG_MBAR + 0x00110000)
+#define MMAP_CCM       (CFG_MBAR + 0x00110004)
+#define MMAP_PLL       (CFG_MBAR + 0x00120000)
+#define MMAP_EPORT     (CFG_MBAR + 0x00130000)
+#define MMAP_WDOG      (CFG_MBAR + 0x00140000)
+#define MMAP_PIT0      (CFG_MBAR + 0x00150000)
+#define MMAP_PIT1      (CFG_MBAR + 0x00160000)
+#define MMAP_PIT2      (CFG_MBAR + 0x00170000)
+#define MMAP_PIT3      (CFG_MBAR + 0x00180000)
+#define MMAP_MDHA      (CFG_MBAR + 0x00190000)
+#define MMAP_RNG       (CFG_MBAR + 0x001A0000)
+#define MMAP_SKHA      (CFG_MBAR + 0x001B0000)
+#define MMAP_USB       (CFG_MBAR + 0x001C0000)
+#define MMAP_PWM0      (CFG_MBAR + 0x001D0000)
+
+/* System configuration registers
+*/
+typedef        struct sys_ctrl {
+       u32 ipsbar;
+       u32 res1;
+       u32 rambar;
+       u32 res2;
+       u8 crsr;
+       u8 cwcr;
+       u8 lpicr;
+       u8 cwsr;
+       u8 res3[8];
+       u32 mpark;
+       u8 mpr;
+       u8 res4[3];
+       u8 pacr0;
+       u8 pacr1;
+       u8 pacr2;
+       u8 pacr3;
+       u8 pacr4;
+       u8 res5;
+       u8 pacr5;
+       u8 pacr6;
+       u8 pacr7;
+       u8 res6;
+       u8 pacr8;
+       u8 res7;
+       u8 gpacr;
+       u8 res8[3];
+} sysctrl_t;
+/* SDRAM controller registers, offset: 0x040
+ */
+typedef struct sdram_ctrl {
+       u32 sdmr;
+       u32 sdcr;
+       u32 sdcfg1;
+       u32 sdcfg2;
+       u32 sdbar0;
+       u32 sdbmr0;
+       u32 sdbar1;
+       u32 sdbmr1;
+} sdramctrl_t;
+
+/* Chip select module registers, offset: 0x080
+*/
+typedef struct cs_ctlr {
+       u16 ar0;
+       u16 res1;
+       u32 mr0;
+       u16 res2;
+       u16 cr0;
+       u16 ar1;
+       u16 res3;
+       u32 mr1;
+       u16 res4;
+       u16 cr1;
+       u16 ar2;
+       u16 res5;
+       u32 mr2;
+       u16 res6;
+       u16 cr2;
+       u16 ar3;
+       u16 res7;
+       u32 mr3;
+       u16 res8;
+       u16 cr3;
+       u16 ar4;
+       u16 res9;
+       u32 mr4;
+       u16 res10;
+       u16 cr4;
+       u16 ar5;
+       u16 res11;
+       u32 mr5;
+       u16 res12;
+       u16 cr5;
+       u16 ar6;
+       u16 res13;
+       u32 mr6;
+       u16 res14;
+       u16 cr6;
+       u16 ar7;
+       u16 res15;
+       u32 mr7;
+       u16 res16;
+       u16 cr7;
+} csctrl_t;
+
+/* DMA module registers, offset 0x100
+ */
+typedef struct dma_ctrl {
+       u32 sar;
+       u32 dar;
+       u32 dsrbcr;
+       u32 dcr;
+} dma_t;
+
+/* QSPI module registers, offset 0x340
+ */
+typedef struct qspi_ctrl {
+       u16 qmr;
+       u8 res1[2];
+       u16 qdlyr;
+       u8 res2[2];
+       u16 qwr;
+       u8 res3[2];
+       u16 qir;
+       u8 res4[2];
+       u16 qar;
+       u8 res5[2];
+       u16 qdr;
+       u8 res6[2];
+} qspi_t;
+
+/* Interrupt module registers, offset 0xc00
+*/
+typedef struct int_ctrl {
+       u32 iprh0;
+       u32 iprl0;
+       u32 imrh0;
+       u32 imrl0;
+       u32 frch0;
+       u32 frcl0;
+       u8 irlr;
+       u8 iacklpr;
+       u8 res1[0x26];
+       u8 icr0[64]; /* No ICR0, done this way for readability */
+       u8 res2[0x60];
+       u8 swiack0;
+       u8 res3[3];
+       u8 Lniack0_1;
+       u8 res4[3];
+       u8 Lniack0_2;
+       u8 res5[3];
+       u8 Lniack0_3;
+       u8 res6[3];
+       u8 Lniack0_4;
+       u8 res7[3];
+       u8 Lniack0_5;
+       u8 res8[3];
+       u8 Lniack0_6;
+       u8 res9[3];
+       u8 Lniack0_7;
+       u8 res10[3];
+} int0_t;
+
+/* GPIO port registers
+*/
+typedef struct gpio_ctrl {
+       /* Port Output Data Registers */
+       u8 podr_res1[4];
+       u8 podr_busctl;
+       u8 podr_addr;
+       u8 podr_res2[2];
+       u8 podr_cs;
+       u8 podr_res3;
+       u8 podr_fec0h;
+       u8 podr_fec0l;
+       u8 podr_feci2c;
+       u8 podr_qspi;
+       u8 podr_sdram;
+       u8 podr_timerh;
+       u8 podr_timerl;
+       u8 podr_uartl;
+       u8 podr_fec1h;
+       u8 podr_fec1l;
+       u8 podr_bs;
+       u8 podr_res4;
+       u8 podr_usbh;
+       u8 podr_usbl;
+       u8 podr_uarth;
+       u8 podr_res5[3];
+       /* Port Data Direction Registers */
+       u8 pddr_res1[4];
+       u8 pddr_busctl;
+       u8 pddr_addr;
+       u8 pddr_res2[2];
+       u8 pddr_cs;
+       u8 pddr_res3;
+       u8 pddr_fec0h;
+       u8 pddr_fec0l;
+       u8 pddr_feci2c;
+       u8 pddr_qspi;
+       u8 pddr_sdram;
+       u8 pddr_timerh;
+       u8 pddr_timerl;
+       u8 pddr_uartl;
+       u8 pddr_fec1h;
+       u8 pddr_fec1l;
+       u8 pddr_bs;
+       u8 pddr_res4;
+       u8 pddr_usbh;
+       u8 pddr_usbl;
+       u8 pddr_uarth;
+       u8 pddr_res5[3];
+       /* Port Pin Data/Set Registers */
+       u8 ppdsdr_res1[4];
+       u8 ppdsdr_busctl;
+       u8 ppdsdr_addr;
+       u8 ppdsdr_res2[2];
+       u8 ppdsdr_cs;
+       u8 ppdsdr_res3;
+       u8 ppdsdr_fec0h;
+       u8 ppdsdr_fec0l;
+       u8 ppdsdr_feci2c;
+       u8 ppdsdr_qspi;
+       u8 ppdsdr_sdram;
+       u8 ppdsdr_timerh;
+       u8 ppdsdr_timerl;
+       u8 ppdsdr_uartl;
+       u8 ppdsdr_fec1h;
+       u8 ppdsdr_fec1l;
+       u8 ppdsdr_bs;
+       u8 ppdsdr_res4;
+       u8 ppdsdr_usbh;
+       u8 ppdsdr_usbl;
+       u8 ppdsdr_uarth;
+       u8 ppdsdr_res5[3];
+       /* Port Clear Output Data Registers */
+       u8 pclrr_res1[4];
+       u8 pclrr_busctl;
+       u8 pclrr_addr;
+       u8 pclrr_res2[2];
+       u8 pclrr_cs;
+       u8 pclrr_res3;
+       u8 pclrr_fec0h;
+       u8 pclrr_fec0l;
+       u8 pclrr_feci2c;
+       u8 pclrr_qspi;
+       u8 pclrr_sdram;
+       u8 pclrr_timerh;
+       u8 pclrr_timerl;
+       u8 pclrr_uartl;
+       u8 pclrr_fec1h;
+       u8 pclrr_fec1l;
+       u8 pclrr_bs;
+       u8 pclrr_res4;
+       u8 pclrr_usbh;
+       u8 pclrr_usbl;
+       u8 pclrr_uarth;
+       u8 pclrr_res5[3];
+       /* Pin Assignment Registers */
+       u8 par_addr;
+       u8 par_cs;
+       u16 par_busctl;
+       u8 par_res1[2];
+       u16 par_usb;
+       u8 par_fec0hl;
+       u8 par_fec1hl;
+       u16 par_timer;
+       u16 par_uart;
+       u16 par_qspi;
+       u16 par_sdram;
+       u16 par_feci2c;
+       u8 par_bs;
+       u8 par_res2[3];
+} gpio_t;
+
+
+/* PWM module registers
+ */
+typedef struct pwm_ctrl {
+       u8 pwcr0;
+       u8 res1[3];
+       u8 pwcr1;
+       u8 res2[3];
+       u8 pwcr2;
+       u8 res3[7];
+       u8 pwwd0;
+       u8 res4[3];
+       u8 pwwd1;
+       u8 res5[3];
+       u8 pwwd2;
+       u8 res6[7];
+} pwm_t;
+
+/* Watchdog registers
+ */
+typedef struct wdog_ctrl {
+       u16 wcr;
+       u16 wmr;
+       u16 wcntr;
+       u16 wsr;
+       u8 res4[114];
+} wdog_t;
+
+/* USB module registers
+*/
+typedef struct usb {
+       u16 res1;
+       u16 fnr;
+       u16 res2;
+       u16 fnmr;
+       u16 res3;
+       u16 rfmr;
+       u16 res4;
+       u16 rfmmr;
+       u8 res5[3];
+       u8 far;
+       u32 asr;
+       u32 drr1;
+       u32 drr2;
+       u16 res6;
+       u16 specr;
+       u16 res7;
+       u16 ep0sr;
+       u32 iep0cfg;
+       u32 oep0cfg;
+       u32 ep1cfg;
+       u32 ep2cfg;
+       u32 ep3cfg;
+       u32 ep4cfg;
+       u32 ep5cfg;
+       u32 ep6cfg;
+       u32 ep7cfg;
+       u32 ep0ctl;
+       u16 res8;
+       u16 ep1ctl;
+       u16 res9;
+       u16 ep2ctl;
+       u16 res10;
+       u16 ep3ctl;
+       u16 res11;
+       u16 ep4ctl;
+       u16 res12;
+       u16 ep5ctl;
+       u16 res13;
+       u16 ep6ctl;
+       u16 res14;
+       u16 ep7ctl;
+       u32 ep0isr;
+       u16 res15;
+       u16 ep1isr;
+       u16 res16;
+       u16 ep2isr;
+       u16 res17;
+       u16 ep3isr;
+       u16 res18;
+       u16 ep4isr;
+       u16 res19;
+       u16 ep5isr;
+       u16 res20;
+       u16 ep6isr;
+       u16 res21;
+       u16 ep7isr;
+       u32 ep0imr;
+       u16 res22;
+       u16 ep1imr;
+       u16 res23;
+       u16 ep2imr;
+       u16 res24;
+       u16 ep3imr;
+       u16 res25;
+       u16 ep4imr;
+       u16 res26;
+       u16 ep5imr;
+       u16 res27;
+       u16 ep6imr;
+       u16 res28;
+       u16 ep7imr;
+       u32 ep0dr;
+       u32 ep1dr;
+       u32 ep2dr;
+       u32 ep3dr;
+       u32 ep4dr;
+       u32 ep5dr;
+       u32 ep6dr;
+       u32 ep7dr;
+       u16 res29;
+       u16 ep0dpr;
+       u16 res30;
+       u16 ep1dpr;
+       u16 res31;
+       u16 ep2dpr;
+       u16 res32;
+       u16 ep3dpr;
+       u16 res33;
+       u16 ep4dpr;
+       u16 res34;
+       u16 ep5dpr;
+       u16 res35;
+       u16 ep6dpr;
+       u16 res36;
+       u16 ep7dpr;
+       u8 res37[788];
+       u8 cfgram[1024];
+} usb_t;
+
+/* PLL module registers
+ */
+typedef struct pll_ctrl {
+       u32 syncr;
+       u32 synsr;
+} pll_t;
+
+typedef struct rcm {
+       u8 rcr;
+       u8 rsr;
+} rcm_t;
+
+#endif /* __IMMAP_5275__ */
index 33c454a..1fccc12 100644 (file)
@@ -232,8 +232,6 @@ static inline void sync(void)
  * that can be used to access the memory range with the caching
  * properties specified by "flags".
  */
-typedef unsigned long phys_addr_t;
-
 #define MAP_NOCACHE    (0)
 #define MAP_WRCOMBINE  (0)
 #define MAP_WRBACK     (0)
diff --git a/include/asm-m68k/m5275.h b/include/asm-m68k/m5275.h
new file mode 100644 (file)
index 0000000..89c6c92
--- /dev/null
@@ -0,0 +1,241 @@
+/*
+ * MCF5275 Internal Memory Map
+ *
+ * Copyright (C) 2003-2004, Greg Ungerer (gerg@snapgear.com)
+ * Copyright (C) 2004-2008 Arthur Shipkowski (art@videon-central.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        __M5275_H__
+#define        __M5275_H__
+
+/*
+ * Define the 5275 SIM register set addresses. These are similar,
+ * but not quite identical to the 5282 registers and offsets.
+ */
+#define        MCFICM_INTC0            0x0c00          /* Base for Interrupt Ctrl 0 */
+#define        MCFICM_INTC1            0x0d00          /* Base for Interrupt Ctrl 1 */
+#define        MCFINTC_IPRH            0x00            /* Interrupt pending 32-63 */
+#define        MCFINTC_IPRL            0x04            /* Interrupt pending 1-31 */
+#define        MCFINTC_IMRH            0x08            /* Interrupt mask 32-63 */
+#define        MCFINTC_IMRL            0x0c            /* Interrupt mask 1-31 */
+#define        MCFINTC_INTFRCH         0x10            /* Interrupt force 32-63 */
+#define        MCFINTC_INTFRCL         0x14            /* Interrupt force 1-31 */
+#define        MCFINTC_IRLR            0x18            /* */
+#define        MCFINTC_IACKL           0x19            /* */
+#define        MCFINTC_ICR0            0x40            /* Base ICR register */
+
+#define MCF_GPIO_PAR_UART      0x10007c
+#define UART0_ENABLE_MASK      0x000f
+#define UART1_ENABLE_MASK      0x00f0
+#define UART2_ENABLE_MASK      0x3f00
+
+#define MCF_GPIO_PAR_FECI2C    0x100082
+#define PAR_SDA_ENABLE_MASK    0x0003
+#define PAR_SCL_ENABLE_MASK    0x000c
+
+#define MCFSIM_WRRR            0x140000
+#define MCFSIM_SDCR            0x40
+
+/*********************************************************************
+ * SDRAM Controller (SDRAMC)
+ *********************************************************************/
+
+/* Register read/write macros */
+#define MCF_SDRAMC_SDMR                (*(vuint32*)(void*)(&__IPSBAR[0x000040]))
+#define MCF_SDRAMC_SDCR                (*(vuint32*)(void*)(&__IPSBAR[0x000044]))
+#define MCF_SDRAMC_SDCFG1      (*(vuint32*)(void*)(&__IPSBAR[0x000048]))
+#define MCF_SDRAMC_SDCFG2      (*(vuint32*)(void*)(&__IPSBAR[0x00004C]))
+#define MCF_SDRAMC_SDBAR0      (*(vuint32*)(void*)(&__IPSBAR[0x000050]))
+#define MCF_SDRAMC_SDBAR1      (*(vuint32*)(void*)(&__IPSBAR[0x000058]))
+#define MCF_SDRAMC_SDMR0       (*(vuint32*)(void*)(&__IPSBAR[0x000054]))
+#define MCF_SDRAMC_SDMR1       (*(vuint32*)(void*)(&__IPSBAR[0x00005C]))
+
+/* Bit definitions and macros for MCF_SDRAMC_SDMR */
+#define MCF_SDRAMC_SDMR_CMD            (0x00010000)
+#define MCF_SDRAMC_SDMR_AD(x)          (((x)&0x00000FFF)<<18)
+#define MCF_SDRAMC_SDMR_BNKAD(x)       (((x)&0x00000003)<<30)
+#define MCF_SDRAMC_SDMR_BNKAD_LMR      (0x00000000)
+#define MCF_SDRAMC_SDMR_BNKAD_LEMR     (0x40000000)
+
+/* Bit definitions and macros for MCF_SDRAMC_SDCR */
+#define MCF_SDRAMC_SDCR_IPALL          (0x00000002)
+#define MCF_SDRAMC_SDCR_IREF           (0x00000004)
+#define MCF_SDRAMC_SDCR_DQS_OE(x)      (((x)&0x00000003)<<10)
+#define MCF_SDRAMC_SDCR_DQP_BP         (0x00008000)
+#define MCF_SDRAMC_SDCR_RCNT(x)                (((x)&0x0000003F)<<16)
+#define MCF_SDRAMC_SDCR_MUX(x)         (((x)&0x00000003)<<24)
+#define MCF_SDRAMC_SDCR_REF            (0x10000000)
+#define MCF_SDRAMC_SDCR_CKE            (0x40000000)
+#define MCF_SDRAMC_SDCR_MODE_EN                (0x80000000)
+
+/* Bit definitions and macros for MCF_SDRAMC_SDCFG1 */
+#define MCF_SDRAMC_SDCFG1_WTLAT(x)     (((x)&0x00000007)<<4)
+#define MCF_SDRAMC_SDCFG1_REF2ACT(x)   (((x)&0x0000000F)<<8)
+#define MCF_SDRAMC_SDCFG1_PRE2ACT(x)   (((x)&0x00000007)<<12)
+#define MCF_SDRAMC_SDCFG1_ACT2RW(x)    (((x)&0x00000007)<<16)
+#define MCF_SDRAMC_SDCFG1_RDLAT(x)     (((x)&0x0000000F)<<20)
+#define MCF_SDRAMC_SDCFG1_SWT2RD(x)    (((x)&0x00000007)<<24)
+#define MCF_SDRAMC_SDCFG1_SRD2RW(x)    (((x)&0x0000000F)<<28)
+
+/* Bit definitions and macros for MCF_SDRAMC_SDCFG2 */
+#define MCF_SDRAMC_SDCFG2_BL(x)                (((x)&0x0000000F)<<16)
+#define MCF_SDRAMC_SDCFG2_BRD2WT(x)    (((x)&0x0000000F)<<20)
+#define MCF_SDRAMC_SDCFG2_BWT2RW(x)    (((x)&0x0000000F)<<24)
+#define MCF_SDRAMC_SDCFG2_BRD2PRE(x)   (((x)&0x0000000F)<<28)
+
+/* Bit definitions and macros for MCF_SDRAMC_SDBARn */
+#define MCF_SDRAMC_SDBARn_BASE(x)      (((x)&0x00003FFF)<<18)
+#define MCF_SDRAMC_SDBARn_BA(x)                ((x)&0xFFFF0000)
+
+/* Bit definitions and macros for MCF_SDRAMC_SDMRn */
+#define MCF_SDRAMC_SDMRn_V             (0x00000001)
+#define MCF_SDRAMC_SDMRn_WP            (0x00000080)
+#define MCF_SDRAMC_SDMRn_MASK(x)       (((x)&0x00003FFF)<<18)
+#define MCF_SDRAMC_SDMRn_BAM_4G                (0xFFFF0000)
+#define MCF_SDRAMC_SDMRn_BAM_2G                (0x7FFF0000)
+#define MCF_SDRAMC_SDMRn_BAM_1G                (0x3FFF0000)
+#define MCF_SDRAMC_SDMRn_BAM_1024M     (0x3FFF0000)
+#define MCF_SDRAMC_SDMRn_BAM_512M      (0x1FFF0000)
+#define MCF_SDRAMC_SDMRn_BAM_256M      (0x0FFF0000)
+#define MCF_SDRAMC_SDMRn_BAM_128M      (0x07FF0000)
+#define MCF_SDRAMC_SDMRn_BAM_64M       (0x03FF0000)
+#define MCF_SDRAMC_SDMRn_BAM_32M       (0x01FF0000)
+#define MCF_SDRAMC_SDMRn_BAM_16M       (0x00FF0000)
+#define MCF_SDRAMC_SDMRn_BAM_8M                (0x007F0000)
+#define MCF_SDRAMC_SDMRn_BAM_4M                (0x003F0000)
+#define MCF_SDRAMC_SDMRn_BAM_2M                (0x001F0000)
+#define MCF_SDRAMC_SDMRn_BAM_1M                (0x000F0000)
+#define MCF_SDRAMC_SDMRn_BAM_1024K     (0x000F0000)
+#define MCF_SDRAMC_SDMRn_BAM_512K      (0x00070000)
+#define MCF_SDRAMC_SDMRn_BAM_256K      (0x00030000)
+#define MCF_SDRAMC_SDMRn_BAM_128K      (0x00010000)
+#define MCF_SDRAMC_SDMRn_BAM_64K       (0x00000000)
+
+/*********************************************************************
+ * Interrupt Controller (INTC)
+ ********************************************************************/
+#define INT0_LO_RSVD0          (0)
+#define INT0_LO_EPORT1         (1)
+#define INT0_LO_EPORT2         (2)
+#define INT0_LO_EPORT3         (3)
+#define INT0_LO_EPORT4         (4)
+#define INT0_LO_EPORT5         (5)
+#define INT0_LO_EPORT6         (6)
+#define INT0_LO_EPORT7         (7)
+#define INT0_LO_SCM            (8)
+#define INT0_LO_DMA0           (9)
+#define INT0_LO_DMA1           (10)
+#define INT0_LO_DMA2           (11)
+#define INT0_LO_DMA3           (12)
+#define INT0_LO_UART0          (13)
+#define INT0_LO_UART1          (14)
+#define INT0_LO_UART2          (15)
+#define INT0_LO_RSVD1          (16)
+#define INT0_LO_I2C            (17)
+#define INT0_LO_QSPI           (18)
+#define INT0_LO_DTMR0          (19)
+#define INT0_LO_DTMR1          (20)
+#define INT0_LO_DTMR2          (21)
+#define INT0_LO_DTMR3          (22)
+#define INT0_LO_FEC0_TXF       (23)
+#define INT0_LO_FEC0_TXB       (24)
+#define INT0_LO_FEC0_UN                (25)
+#define INT0_LO_FEC0_RL                (26)
+#define INT0_LO_FEC0_RXF       (27)
+#define INT0_LO_FEC0_RXB       (28)
+#define INT0_LO_FEC0_MII       (29)
+#define INT0_LO_FEC0_LC                (30)
+#define INT0_LO_FEC0_HBERR     (31)
+#define INT0_HI_FEC0_GRA       (32)
+#define INT0_HI_FEC0_EBERR     (33)
+#define INT0_HI_FEC0_BABT      (34)
+#define INT0_HI_FEC0_BABR      (35)
+#define INT0_HI_PIT0           (36)
+#define INT0_HI_PIT1           (37)
+#define INT0_HI_PIT2           (38)
+#define INT0_HI_PIT3           (39)
+#define INT0_HI_RNG            (40)
+#define INT0_HI_SKHA           (41)
+#define INT0_HI_MDHA           (42)
+#define INT0_HI_USB            (43)
+#define INT0_HI_USB_EP0                (44)
+#define INT0_HI_USB_EP1                (45)
+#define INT0_HI_USB_EP2                (46)
+#define INT0_HI_USB_EP3                (47)
+/* 48-63 Reserved */
+
+/* 0-22 Reserved */
+#define INT1_LO_FEC1_TXF       (23)
+#define INT1_LO_FEC1_TXB       (24)
+#define INT1_LO_FEC1_UN                (25)
+#define INT1_LO_FEC1_RL                (26)
+#define INT1_LO_FEC1_RXF       (27)
+#define INT1_LO_FEC1_RXB       (28)
+#define INT1_LO_FEC1_MII       (29)
+#define INT1_LO_FEC1_LC                (30)
+#define INT1_LO_FEC1_HBERR     (31)
+#define INT1_HI_FEC1_GRA       (32)
+#define INT1_HI_FEC1_EBERR     (33)
+#define INT1_HI_FEC1_BABT      (34)
+#define INT1_HI_FEC1_BABR      (35)
+/* 36-63 Reserved */
+
+/* Bit definitions and macros for INTC_IPRL */
+#define INTC_IPRL_INT31                (0x80000000)
+#define INTC_IPRL_INT30                (0x40000000)
+#define INTC_IPRL_INT29                (0x20000000)
+#define INTC_IPRL_INT28                (0x10000000)
+#define INTC_IPRL_INT27                (0x08000000)
+#define INTC_IPRL_INT26                (0x04000000)
+#define INTC_IPRL_INT25                (0x02000000)
+#define INTC_IPRL_INT24                (0x01000000)
+#define INTC_IPRL_INT23                (0x00800000)
+#define INTC_IPRL_INT22                (0x00400000)
+#define INTC_IPRL_INT21                (0x00200000)
+#define INTC_IPRL_INT20                (0x00100000)
+#define INTC_IPRL_INT19                (0x00080000)
+#define INTC_IPRL_INT18                (0x00040000)
+#define INTC_IPRL_INT17                (0x00020000)
+#define INTC_IPRL_INT16                (0x00010000)
+#define INTC_IPRL_INT15                (0x00008000)
+#define INTC_IPRL_INT14                (0x00004000)
+#define INTC_IPRL_INT13                (0x00002000)
+#define INTC_IPRL_INT12                (0x00001000)
+#define INTC_IPRL_INT11                (0x00000800)
+#define INTC_IPRL_INT10                (0x00000400)
+#define INTC_IPRL_INT9         (0x00000200)
+#define INTC_IPRL_INT8         (0x00000100)
+#define INTC_IPRL_INT7         (0x00000080)
+#define INTC_IPRL_INT6         (0x00000040)
+#define INTC_IPRL_INT5         (0x00000020)
+#define INTC_IPRL_INT4         (0x00000010)
+#define INTC_IPRL_INT3         (0x00000008)
+#define INTC_IPRL_INT2         (0x00000004)
+#define INTC_IPRL_INT1         (0x00000002)
+#define INTC_IPRL_INT0         (0x00000001)
+
+/* Bit definitions and macros for RCR */
+#define RCM_RCR_FRCRSTOUT      (0x40)
+#define RCM_RCR_SOFTRST                (0x80)
+
+#define FMPLL_SYNSR_LOCK       (0x00000008)
+
+#endif /* __M5275_H__ */
index e944d3f..44b4ca5 100644 (file)
@@ -44,6 +44,9 @@ typedef unsigned long long u64;
 /* DMA addresses are 32-bits wide */
 typedef u32 dma_addr_t;
 
+typedef unsigned long phys_addr_t;
+typedef unsigned long phys_size_t;
+
 #endif /* __KERNEL__ */
 #endif /* __ASSEMBLY__ */
 
index 90d1842..aa37a60 100644 (file)
@@ -134,8 +134,6 @@ static inline void sync(void)
  * that can be used to access the memory range with the caching
  * properties specified by "flags".
  */
-typedef unsigned long phys_addr_t;
-
 #define MAP_NOCACHE    (0)
 #define MAP_WRCOMBINE  (0)
 #define MAP_WRBACK     (0)
index 3895dc4..77094f6 100644 (file)
@@ -52,6 +52,9 @@ typedef unsigned long long u64;
 /* Dma addresses are 32-bits wide.  */
 
 typedef u32 dma_addr_t;
+
+typedef unsigned long phys_addr_t;
+typedef unsigned long phys_size_t;
 #endif /* __KERNEL__ */
 
 #endif /* _ASM_TYPES_H */
diff --git a/include/asm-mips/asm.h b/include/asm-mips/asm.h
new file mode 100644 (file)
index 0000000..608cfcf
--- /dev/null
@@ -0,0 +1,409 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1995, 1996, 1997, 1999, 2001 by Ralf Baechle
+ * Copyright (C) 1999 by Silicon Graphics, Inc.
+ * Copyright (C) 2001 MIPS Technologies, Inc.
+ * Copyright (C) 2002  Maciej W. Rozycki
+ *
+ * Some useful macros for MIPS assembler code
+ *
+ * Some of the routines below contain useless nops that will be optimized
+ * away by gas in -O mode. These nops are however required to fill delay
+ * slots in noreorder mode.
+ */
+#ifndef __ASM_ASM_H
+#define __ASM_ASM_H
+
+#include <asm/sgidefs.h>
+
+#ifndef CAT
+#ifdef __STDC__
+#define __CAT(str1, str2) str1##str2
+#else
+#define __CAT(str1, str2) str1/**/str2
+#endif
+#define CAT(str1, str2) __CAT(str1, str2)
+#endif
+
+/*
+ * PIC specific declarations
+ * Not used for the kernel but here seems to be the right place.
+ */
+#ifdef __PIC__
+#define CPRESTORE(register)                             \
+               .cprestore register
+#define CPADD(register)                                 \
+               .cpadd  register
+#define CPLOAD(register)                                \
+               .cpload register
+#else
+#define CPRESTORE(register)
+#define CPADD(register)
+#define CPLOAD(register)
+#endif
+
+/*
+ * LEAF - declare leaf routine
+ */
+#define        LEAF(symbol)                                    \
+               .globl  symbol;                         \
+               .align  2;                              \
+               .type   symbol, @function;              \
+               .ent    symbol, 0;                      \
+symbol:                .frame  sp, 0, ra
+
+/*
+ * NESTED - declare nested routine entry point
+ */
+#define        NESTED(symbol, framesize, rpc)                  \
+               .globl  symbol;                         \
+               .align  2;                              \
+               .type   symbol, @function;              \
+               .ent    symbol, 0;                       \
+symbol:                .frame  sp, framesize, rpc
+
+/*
+ * END - mark end of function
+ */
+#define        END(function)                                   \
+               .end    function;                       \
+               .size   function, .-function
+
+/*
+ * EXPORT - export definition of symbol
+ */
+#define EXPORT(symbol)                                 \
+               .globl  symbol;                         \
+symbol:
+
+/*
+ * FEXPORT - export definition of a function symbol
+ */
+#define FEXPORT(symbol)                                        \
+               .globl  symbol;                         \
+               .type   symbol, @function;              \
+symbol:
+
+/*
+ * ABS - export absolute symbol
+ */
+#define        ABS(symbol,value)                               \
+               .globl  symbol;                         \
+symbol         =       value
+
+#define        PANIC(msg)                                      \
+               .set    push;                           \
+               .set    reorder;                        \
+               PTR_LA  a0, 8f;                          \
+               jal     panic;                          \
+9:             b       9b;                             \
+               .set    pop;                            \
+               TEXT(msg)
+
+/*
+ * Print formatted string
+ */
+#ifdef CONFIG_PRINTK
+#define PRINT(string)                                   \
+               .set    push;                           \
+               .set    reorder;                        \
+               PTR_LA  a0, 8f;                          \
+               jal     printk;                         \
+               .set    pop;                            \
+               TEXT(string)
+#else
+#define PRINT(string)
+#endif
+
+#define        TEXT(msg)                                       \
+               .pushsection .data;                     \
+8:             .asciiz msg;                            \
+               .popsection;
+
+/*
+ * Build text tables
+ */
+#define TTABLE(string)                                  \
+               .pushsection .text;                     \
+               .word   1f;                             \
+               .popsection                             \
+               .pushsection .data;                     \
+1:             .asciiz string;                         \
+               .popsection
+
+/*
+ * MIPS IV pref instruction.
+ * Use with .set noreorder only!
+ *
+ * MIPS IV implementations are free to treat this as a nop.  The R5000
+ * is one of them.  So we should have an option not to use this instruction.
+ */
+#ifdef CONFIG_CPU_HAS_PREFETCH
+
+#define PREF(hint,addr)                                 \
+               .set    push;                           \
+               .set    mips4;                          \
+               pref    hint, addr;                     \
+               .set    pop
+
+#define PREFX(hint,addr)                                \
+               .set    push;                           \
+               .set    mips4;                          \
+               prefx   hint, addr;                     \
+               .set    pop
+
+#else /* !CONFIG_CPU_HAS_PREFETCH */
+
+#define PREF(hint, addr)
+#define PREFX(hint, addr)
+
+#endif /* !CONFIG_CPU_HAS_PREFETCH */
+
+/*
+ * MIPS ISA IV/V movn/movz instructions and equivalents for older CPUs.
+ */
+#if (_MIPS_ISA == _MIPS_ISA_MIPS1)
+#define MOVN(rd, rs, rt)                                \
+               .set    push;                           \
+               .set    reorder;                        \
+               beqz    rt, 9f;                         \
+               move    rd, rs;                         \
+               .set    pop;                            \
+9:
+#define MOVZ(rd, rs, rt)                                \
+               .set    push;                           \
+               .set    reorder;                        \
+               bnez    rt, 9f;                         \
+               move    rd, rs;                         \
+               .set    pop;                            \
+9:
+#endif /* _MIPS_ISA == _MIPS_ISA_MIPS1 */
+#if (_MIPS_ISA == _MIPS_ISA_MIPS2) || (_MIPS_ISA == _MIPS_ISA_MIPS3)
+#define MOVN(rd, rs, rt)                                \
+               .set    push;                           \
+               .set    noreorder;                      \
+               bnezl   rt, 9f;                         \
+                move   rd, rs;                         \
+               .set    pop;                            \
+9:
+#define MOVZ(rd, rs, rt)                                \
+               .set    push;                           \
+               .set    noreorder;                      \
+               beqzl   rt, 9f;                         \
+                move   rd, rs;                         \
+               .set    pop;                            \
+9:
+#endif /* (_MIPS_ISA == _MIPS_ISA_MIPS2) || (_MIPS_ISA == _MIPS_ISA_MIPS3) */
+#if (_MIPS_ISA == _MIPS_ISA_MIPS4 ) || (_MIPS_ISA == _MIPS_ISA_MIPS5) || \
+    (_MIPS_ISA == _MIPS_ISA_MIPS32) || (_MIPS_ISA == _MIPS_ISA_MIPS64)
+#define MOVN(rd, rs, rt)                                \
+               movn    rd, rs, rt
+#define MOVZ(rd, rs, rt)                                \
+               movz    rd, rs, rt
+#endif /* MIPS IV, MIPS V, MIPS32 or MIPS64 */
+
+/*
+ * Stack alignment
+ */
+#if (_MIPS_SIM == _MIPS_SIM_ABI32)
+#define ALSZ   7
+#define ALMASK ~7
+#endif
+#if (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64)
+#define ALSZ   15
+#define ALMASK ~15
+#endif
+
+/*
+ * Macros to handle different pointer/register sizes for 32/64-bit code
+ */
+
+/*
+ * Size of a register
+ */
+#ifdef __mips64
+#define SZREG  8
+#else
+#define SZREG  4
+#endif
+
+/*
+ * Use the following macros in assemblercode to load/store registers,
+ * pointers etc.
+ */
+#if (_MIPS_SIM == _MIPS_SIM_ABI32)
+#define REG_S          sw
+#define REG_L          lw
+#define REG_SUBU       subu
+#define REG_ADDU       addu
+#endif
+#if (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64)
+#define REG_S          sd
+#define REG_L          ld
+#define REG_SUBU       dsubu
+#define REG_ADDU       daddu
+#endif
+
+/*
+ * How to add/sub/load/store/shift C int variables.
+ */
+#if (_MIPS_SZINT == 32)
+#define INT_ADD                add
+#define INT_ADDU       addu
+#define INT_ADDI       addi
+#define INT_ADDIU      addiu
+#define INT_SUB                sub
+#define INT_SUBU       subu
+#define INT_L          lw
+#define INT_S          sw
+#define INT_SLL                sll
+#define INT_SLLV       sllv
+#define INT_SRL                srl
+#define INT_SRLV       srlv
+#define INT_SRA                sra
+#define INT_SRAV       srav
+#endif
+
+#if (_MIPS_SZINT == 64)
+#define INT_ADD                dadd
+#define INT_ADDU       daddu
+#define INT_ADDI       daddi
+#define INT_ADDIU      daddiu
+#define INT_SUB                dsub
+#define INT_SUBU       dsubu
+#define INT_L          ld
+#define INT_S          sd
+#define INT_SLL                dsll
+#define INT_SLLV       dsllv
+#define INT_SRL                dsrl
+#define INT_SRLV       dsrlv
+#define INT_SRA                dsra
+#define INT_SRAV       dsrav
+#endif
+
+/*
+ * How to add/sub/load/store/shift C long variables.
+ */
+#if (_MIPS_SZLONG == 32)
+#define LONG_ADD       add
+#define LONG_ADDU      addu
+#define LONG_ADDI      addi
+#define LONG_ADDIU     addiu
+#define LONG_SUB       sub
+#define LONG_SUBU      subu
+#define LONG_L         lw
+#define LONG_S         sw
+#define LONG_SLL       sll
+#define LONG_SLLV      sllv
+#define LONG_SRL       srl
+#define LONG_SRLV      srlv
+#define LONG_SRA       sra
+#define LONG_SRAV      srav
+
+#define LONG           .word
+#define LONGSIZE       4
+#define LONGMASK       3
+#define LONGLOG                2
+#endif
+
+#if (_MIPS_SZLONG == 64)
+#define LONG_ADD       dadd
+#define LONG_ADDU      daddu
+#define LONG_ADDI      daddi
+#define LONG_ADDIU     daddiu
+#define LONG_SUB       dsub
+#define LONG_SUBU      dsubu
+#define LONG_L         ld
+#define LONG_S         sd
+#define LONG_SLL       dsll
+#define LONG_SLLV      dsllv
+#define LONG_SRL       dsrl
+#define LONG_SRLV      dsrlv
+#define LONG_SRA       dsra
+#define LONG_SRAV      dsrav
+
+#define LONG           .dword
+#define LONGSIZE       8
+#define LONGMASK       7
+#define LONGLOG                3
+#endif
+
+/*
+ * How to add/sub/load/store/shift pointers.
+ */
+#if (_MIPS_SZPTR == 32)
+#define PTR_ADD                add
+#define PTR_ADDU       addu
+#define PTR_ADDI       addi
+#define PTR_ADDIU      addiu
+#define PTR_SUB                sub
+#define PTR_SUBU       subu
+#define PTR_L          lw
+#define PTR_S          sw
+#define PTR_LA         la
+#define PTR_LI         li
+#define PTR_SLL                sll
+#define PTR_SLLV       sllv
+#define PTR_SRL                srl
+#define PTR_SRLV       srlv
+#define PTR_SRA                sra
+#define PTR_SRAV       srav
+
+#define PTR_SCALESHIFT 2
+
+#define PTR            .word
+#define PTRSIZE                4
+#define PTRLOG         2
+#endif
+
+#if (_MIPS_SZPTR == 64)
+#define PTR_ADD                dadd
+#define PTR_ADDU       daddu
+#define PTR_ADDI       daddi
+#define PTR_ADDIU      daddiu
+#define PTR_SUB                dsub
+#define PTR_SUBU       dsubu
+#define PTR_L          ld
+#define PTR_S          sd
+#define PTR_LA         dla
+#define PTR_LI         dli
+#define PTR_SLL                dsll
+#define PTR_SLLV       dsllv
+#define PTR_SRL                dsrl
+#define PTR_SRLV       dsrlv
+#define PTR_SRA                dsra
+#define PTR_SRAV       dsrav
+
+#define PTR_SCALESHIFT 3
+
+#define PTR            .dword
+#define PTRSIZE                8
+#define PTRLOG         3
+#endif
+
+/*
+ * Some cp0 registers were extended to 64bit for MIPS III.
+ */
+#if (_MIPS_SIM == _MIPS_SIM_ABI32)
+#define MFC0           mfc0
+#define MTC0           mtc0
+#endif
+#if (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64)
+#define MFC0           dmfc0
+#define MTC0           dmtc0
+#endif
+
+#define SSNOP          sll zero, zero, 1
+
+#ifdef CONFIG_SGI_IP28
+/* Inhibit speculative stores to volatile (e.g.DMA) or invalid addresses. */
+#include <asm/cacheops.h>
+#define R10KCBARRIER(addr)  cache   Cache_Barrier, addr;
+#else
+#define R10KCBARRIER(addr)
+#endif
+
+#endif /* __ASM_ASM_H */
index b9604cf..b5e685f 100644 (file)
@@ -1,18 +1,62 @@
-/* $Id: byteorder.h,v 1.8 1998/11/02 09:29:32 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (C) by Ralf Baechle
+ * Copyright (C) 1996, 99, 2003 by Ralf Baechle
  */
-#ifndef _MIPS_BYTEORDER_H
-#define _MIPS_BYTEORDER_H
+#ifndef _ASM_BYTEORDER_H
+#define _ASM_BYTEORDER_H
 
 #include <asm/types.h>
 
 #ifdef __GNUC__
 
+#ifdef CONFIG_CPU_MIPSR2
+
+static __inline__ __attribute_const__ __u16 ___arch__swab16(__u16 x)
+{
+       __asm__(
+       "       wsbh    %0, %1                  \n"
+       : "=r" (x)
+       : "r" (x));
+
+       return x;
+}
+#define __arch__swab16(x)      ___arch__swab16(x)
+
+static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x)
+{
+       __asm__(
+       "       wsbh    %0, %1                  \n"
+       "       rotr    %0, %0, 16              \n"
+       : "=r" (x)
+       : "r" (x));
+
+       return x;
+}
+#define __arch__swab32(x)      ___arch__swab32(x)
+
+#ifdef CONFIG_CPU_MIPS64_R2
+
+static __inline__ __attribute_const__ __u64 ___arch__swab64(__u64 x)
+{
+       __asm__(
+       "       dsbh    %0, %1                  \n"
+       "       dshd    %0, %0                  \n"
+       "       drotr   %0, %0, 32              \n"
+       : "=r" (x)
+       : "r" (x));
+
+       return x;
+}
+
+#define __arch__swab64(x)      ___arch__swab64(x)
+
+#endif /* CONFIG_CPU_MIPS64_R2 */
+
+#endif /* CONFIG_CPU_MIPSR2 */
+
 #if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
 #  define __BYTEORDER_HAS_U64__
 #  define __SWAB_64_THRU_32__
 
 #endif /* __GNUC__ */
 
-#if defined (__MIPSEB__)
+#if defined(__MIPSEB__)
 #  include <linux/byteorder/big_endian.h>
-#elif defined (__MIPSEL__)
+#elif defined(__MIPSEL__)
 #  include <linux/byteorder/little_endian.h>
 #else
 #  error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???"
 #endif
 
-#endif /* _MIPS_BYTEORDER_H */
+#endif /* _ASM_BYTEORDER_H */
index 9cc2b87..f3ce721 100644 (file)
@@ -1,10 +1,12 @@
 /*
- * cachectl.h -- defines for MIPS cache control system calls
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
  *
  * Copyright (C) 1994, 1995, 1996 by Ralf Baechle
  */
-#ifndef        __ASM_MIPS_CACHECTL
-#define        __ASM_MIPS_CACHECTL
+#ifndef        _ASM_CACHECTL
+#define        _ASM_CACHECTL
 
 /*
  * Options for cacheflush system call
@@ -21,4 +23,4 @@
 #define CACHEABLE      0       /* make pages cacheable */
 #define UNCACHEABLE    1       /* make pages uncacheable */
 
-#endif /* __ASM_MIPS_CACHECTL */
+#endif /* _ASM_CACHECTL */
index 66b0b36..256ad2c 100644 (file)
@@ -5,43 +5,81 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * (C) Copyright 1996, 1997 by Ralf Baechle
+ * (C) Copyright 1996, 97, 99, 2002, 03 Ralf Baechle
+ * (C) Copyright 1999 Silicon Graphics, Inc.
  */
-#ifndef        __ASM_MIPS_CACHEOPS_H
-#define        __ASM_MIPS_CACHEOPS_H
+#ifndef        __ASM_CACHEOPS_H
+#define        __ASM_CACHEOPS_H
 
 /*
- * Cache Operations
+ * Cache Operations available on all MIPS processors with R4000-style caches
  */
 #define Index_Invalidate_I      0x00
 #define Index_Writeback_Inv_D   0x01
-#define Index_Invalidate_SI     0x02
-#define Index_Writeback_Inv_SD  0x03
 #define Index_Load_Tag_I       0x04
 #define Index_Load_Tag_D       0x05
-#define Index_Load_Tag_SI      0x06
-#define Index_Load_Tag_SD      0x07
 #define Index_Store_Tag_I      0x08
 #define Index_Store_Tag_D      0x09
+#if defined(CONFIG_CPU_LOONGSON2)
+#define Hit_Invalidate_I       0x00
+#else
+#define Hit_Invalidate_I       0x10
+#endif
+#define Hit_Invalidate_D       0x11
+#define Hit_Writeback_Inv_D    0x15
+
+/*
+ * R4000-specific cacheops
+ */
+#define Create_Dirty_Excl_D    0x0d
+#define Fill                   0x14
+#define Hit_Writeback_I                0x18
+#define Hit_Writeback_D                0x19
+
+/*
+ * R4000SC and R4400SC-specific cacheops
+ */
+#define Index_Invalidate_SI     0x02
+#define Index_Writeback_Inv_SD  0x03
+#define Index_Load_Tag_SI      0x06
+#define Index_Load_Tag_SD      0x07
 #define Index_Store_Tag_SI     0x0A
 #define Index_Store_Tag_SD     0x0B
-#define Create_Dirty_Excl_D    0x0d
 #define Create_Dirty_Excl_SD   0x0f
-#define Hit_Invalidate_I       0x10
-#define Hit_Invalidate_D       0x11
 #define Hit_Invalidate_SI      0x12
 #define Hit_Invalidate_SD      0x13
-#define Fill                   0x14
-#define Hit_Writeback_Inv_D    0x15
-                                       /* 0x16 is unused */
 #define Hit_Writeback_Inv_SD   0x17
-#define Hit_Writeback_I                0x18
-#define Hit_Writeback_D                0x19
-                                       /* 0x1a is unused */
 #define Hit_Writeback_SD       0x1b
-                                       /* 0x1c is unused */
-                                       /* 0x1e is unused */
 #define Hit_Set_Virtual_SI     0x1e
 #define Hit_Set_Virtual_SD     0x1f
 
-#endif /* __ASM_MIPS_CACHEOPS_H */
+/*
+ * R5000-specific cacheops
+ */
+#define R5K_Page_Invalidate_S  0x17
+
+/*
+ * RM7000-specific cacheops
+ */
+#define Page_Invalidate_T      0x16
+
+/*
+ * R10000-specific cacheops
+ *
+ * Cacheops 0x02, 0x06, 0x0a, 0x0c-0x0e, 0x16, 0x1a and 0x1e are unused.
+ * Most of the _S cacheops are identical to the R4000SC _SD cacheops.
+ */
+#define Index_Writeback_Inv_S  0x03
+#define Index_Load_Tag_S       0x07
+#define Index_Store_Tag_S      0x0B
+#define Hit_Invalidate_S       0x13
+#define Cache_Barrier          0x14
+#define Hit_Writeback_Inv_S    0x17
+#define Index_Load_Data_I      0x18
+#define Index_Load_Data_D      0x19
+#define Index_Load_Data_S      0x1b
+#define Index_Store_Data_I     0x1c
+#define Index_Store_Data_D     0x1d
+#define Index_Store_Data_S     0x1f
+
+#endif /* __ASM_CACHEOPS_H */
index e27d1f1..7137072 100644 (file)
@@ -470,8 +470,6 @@ static inline void sync(void)
  * that can be used to access the memory range with the caching
  * properties specified by "flags".
  */
-typedef unsigned long phys_addr_t;
-
 #define MAP_NOCACHE    (0)
 #define MAP_WRCOMBINE  (0)
 #define MAP_WRBACK     (0)
index 3cd1eb8..24c6cda 100644 (file)
@@ -1,16 +1,15 @@
 /*
- * Various ISA level dependant constants.
+ * Various ISA level dependent constants.
  * Most of the following constants reflect the different layout
  * of Coprocessor 0 registers.
  *
  * Copyright (c) 1998 Harald Koerfgen
  */
-#include <linux/config.h>
 
 #ifndef __ASM_ISADEP_H
 #define __ASM_ISADEP_H
 
-#if defined(CONFIG_CPU_R3000)
+#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
 /*
  * R2000 or R3000
  */
index 6838aee..24858dd 100644 (file)
@@ -4,9 +4,9 @@
  * for more details.
  *
  * Copyright (C) 1994 Waldorf GMBH
- * Copyright (C) 1995, 1996, 1997, 1998, 1999, 2001 Ralf Baechle
+ * Copyright (C) 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003 Ralf Baechle
  * Copyright (C) 1996 Paul M. Antoine
- * Copyright (C) 1999 Silicon Graphics, Inc.
+ * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
  */
 #ifndef _ASM_PROCESSOR_H
 #define _ASM_PROCESSOR_H
 
 #include <asm/isadep.h>
 
-/*
- * Default implementation of macro that returns current
- * instruction pointer ("program counter").
- */
-#define current_text_addr() ({ __label__ _l; _l: &&_l;})
-
-#if !defined (_LANGUAGE_ASSEMBLY)
-#if 0
-#include <linux/threads.h>
-#endif
 #include <asm/cachectl.h>
 #include <asm/mipsregs.h>
 #include <asm/reg.h>
 #include <asm/system.h>
 
-struct mips_cpuinfo {
-       unsigned long udelay_val;
-       unsigned long *pgd_quick;
-       unsigned long *pte_quick;
-       unsigned long pgtable_cache_sz;
-};
-
-/*
- * System setup and hardware flags..
- * XXX: Should go into mips_cpuinfo.
- */
-extern void (*cpu_wait)(void); /* only available on R4[26]00 and R3081 */
-extern void r3081_wait(void);
-extern void r4k_wait(void);
-extern char cyclecounter_available;    /* only available from R4000 upwards. */
-
-extern struct mips_cpuinfo boot_cpu_data;
-extern unsigned int vced_count, vcei_count;
-
-#ifdef CONFIG_SMP
-extern struct mips_cpuinfo cpu_data[];
-#define current_cpu_data cpu_data[smp_processor_id()]
-#else
-#define cpu_data &boot_cpu_data
-#define current_cpu_data boot_cpu_data
-#endif
-
-/*
- * Bus types (default is ISA, but people can check others with these..)
- * MCA_bus hardcoded to 0 for now.
- *
- * This needs to be extended since MIPS systems are being delivered with
- * numerous different types of bus systems.
- */
-extern int EISA_bus;
-#define MCA_bus 0
-#define MCA_bus__is_a_macro /* for versions in ksyms.c */
-
 /*
- * MIPS has no problems with write protection
+ * Return current * instruction pointer ("program counter").
  */
-#define wp_works_ok 1
-#define wp_works_ok__is_a_macro /* for versions in ksyms.c */
-
-/* Lazy FPU handling on uni-processor */
-extern struct task_struct *last_task_used_math;
+#define current_text_addr() ({ __label__ _l; _l: &&_l;})
 
 /*
- * User space process size: 2GB. This is hardcoded into a few places,
- * so don't change it unless you know what you are doing.  TASK_SIZE
- * for a 64 bit kernel expandable to 8192EB, of which the current MIPS
- * implementations will "only" be able to use 1TB ...
- */
-#define TASK_SIZE      (0x7fff8000UL)
-
-/* This decides where the kernel will search for a free chunk of vm
- * space during mmap's.
+ * System setup and hardware flags..
  */
-#define TASK_UNMAPPED_BASE     (TASK_SIZE / 3)
+extern void (*cpu_wait)(void);
 
-/*
- * Size of io_bitmap in longwords: 32 is ports 0-0x3ff.
- */
-#define IO_BITMAP_SIZE 32
+extern unsigned int vced_count, vcei_count;
 
 #define NUM_FPU_REGS   32
 
-struct mips_fpu_hard_struct {
-       double fp_regs[NUM_FPU_REGS];
-       unsigned int control;
-};
+typedef __u64 fpureg_t;
 
 /*
  * It would be nice to add some more fields for emulator statistics, but there
@@ -108,25 +42,29 @@ struct mips_fpu_hard_struct {
  * be recalculated by hand.  So the additional information will be private to
  * the FPU emulator for now.  See asm-mips/fpu_emulator.h.
  */
-typedef u64 fpureg_t;
-struct mips_fpu_soft_struct {
-       fpureg_t        regs[NUM_FPU_REGS];
-       unsigned int    sr;
-};
 
-union mips_fpu_union {
-       struct mips_fpu_hard_struct hard;
-       struct mips_fpu_soft_struct soft;
+struct mips_fpu_struct {
+       fpureg_t        fpr[NUM_FPU_REGS];
+       unsigned int    fcr31;
 };
 
-#define INIT_FPU { \
-       {{0,},} \
-}
+#define NUM_DSP_REGS   6
+
+typedef __u32 dspreg_t;
+
+struct mips_dsp_state {
+       dspreg_t        dspr[NUM_DSP_REGS];
+       unsigned int    dspcontrol;
+};
 
 typedef struct {
        unsigned long seg;
 } mm_segment_t;
 
+#define ARCH_MIN_TASKALIGN     8
+
+struct mips_abi;
+
 /*
  * If you change thread_struct remember to change the #defines below too!
  */
@@ -140,131 +78,36 @@ struct thread_struct {
        unsigned long cp0_status;
 
        /* Saved fpu/fpu emulator stuff. */
-       union mips_fpu_union fpu;
+       struct mips_fpu_struct fpu;
+#ifdef CONFIG_MIPS_MT_FPAFF
+       /* Emulated instruction count */
+       unsigned long emulated_fp;
+       /* Saved per-thread scheduler affinity mask */
+       cpumask_t user_cpus_allowed;
+#endif /* CONFIG_MIPS_MT_FPAFF */
+
+       /* Saved state of the DSP ASE, if available. */
+       struct mips_dsp_state dsp;
 
        /* Other stuff associated with the thread. */
        unsigned long cp0_badvaddr;     /* Last user fault */
        unsigned long cp0_baduaddr;     /* Last kernel fault accessing USEG */
        unsigned long error_code;
        unsigned long trap_no;
-#define MF_FIXADE 1                    /* Fix address errors in software */
-#define MF_LOGADE 2                    /* Log address errors to syslog */
-       unsigned long mflags;
-       mm_segment_t current_ds;
        unsigned long irix_trampoline;  /* Wheee... */
        unsigned long irix_oldctx;
-
-       /*
-        * These are really only needed if the full FPU emulator is configured.
-        * Would be made conditional on MIPS_FPU_EMULATOR if it weren't for the
-        * fact that having offset.h rebuilt differently for different config
-        * options would be asking for trouble.
-        *
-        * Saved EPC during delay-slot emulation (see math-emu/cp1emu.c)
-        */
-       unsigned long dsemul_epc;
-
-       /*
-        * Pointer to instruction used to induce address error
-        */
-       unsigned long dsemul_aerpc;
+       struct mips_abi *abi;
 };
 
-#endif /* !defined (_LANGUAGE_ASSEMBLY) */
-
-#define INIT_THREAD  { \
-       /* \
-        * saved main processor registers \
-        */ \
-       0, 0, 0, 0, 0, 0, 0, 0, \
-                      0, 0, 0, \
-       /* \
-        * saved cp0 stuff \
-        */ \
-       0, \
-       /* \
-        * saved fpu/fpu emulator stuff \
-        */ \
-       INIT_FPU, \
-       /* \
-        * Other stuff associated with the process \
-        */ \
-       0, 0, 0, 0, \
-       /* \
-        * For now the default is to fix address errors \
-        */ \
-       MF_FIXADE, { 0 }, 0, 0, \
-       /* \
-        * dsemul_epc and dsemul_aerpc should never be used uninitialized, \
-        * but... \
-        */ \
-       0 ,0 \
-}
-
-#ifdef __KERNEL__
-
-#define KERNEL_STACK_SIZE 8192
-
-#if !defined (_LANGUAGE_ASSEMBLY)
+struct task_struct;
 
 /* Free all resources held by a thread. */
 #define release_thread(thread) do { } while(0)
 
-extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
-
-/* Copy and release all segment info associated with a VM */
-#define copy_segments(p, mm) do { } while(0)
-#define release_segments(mm) do { } while(0)
-
-/*
- * Return saved PC of a blocked thread.
- */
-extern inline unsigned long thread_saved_pc(struct thread_struct *t)
-{
-       extern void ret_from_fork(void);
-
-       /* New born processes are a special case */
-       if (t->reg31 == (unsigned long) ret_from_fork)
-               return t->reg31;
-
-       return ((unsigned long *)t->reg29)[10];
-}
-
-/*
- * Do necessary setup to start up a newly executed thread.
- */
-#define start_thread(regs, new_pc, new_sp) do {                                \
-       /* New thread looses kernel privileges. */                      \
-       regs->cp0_status = (regs->cp0_status & ~(ST0_CU0|ST0_KSU)) | KU_USER;\
-       regs->cp0_epc = new_pc;                                         \
-       regs->regs[29] = new_sp;                                        \
-       current->thread.current_ds = USER_DS;                           \
-} while (0)
+/* Prepare to copy thread state - unlazy all lazy status */
+#define prepare_to_copy(tsk)   do { } while (0)
 
-unsigned long get_wchan(struct task_struct *p);
-
-#define __PT_REG(reg) ((long)&((struct pt_regs *)0)->reg - sizeof(struct pt_regs))
-#define __KSTK_TOS(tsk) ((unsigned long)(tsk) + KERNEL_STACK_SIZE - 32)
-#define KSTK_EIP(tsk) (*(unsigned long *)(__KSTK_TOS(tsk) + __PT_REG(cp0_epc)))
-#define KSTK_ESP(tsk) (*(unsigned long *)(__KSTK_TOS(tsk) + __PT_REG(regs[29])))
-
-/* Allocation and freeing of basic task resources. */
-/*
- * NOTE! The task struct and the stack go together
- */
-#define THREAD_SIZE (2*PAGE_SIZE)
-#define alloc_task_struct() \
-       ((struct task_struct *) __get_free_pages(GFP_KERNEL,1))
-#define free_task_struct(p)    free_pages((unsigned long)(p),1)
-#define get_task_struct(tsk)      atomic_inc(&virt_to_page(tsk)->count)
-
-#define init_task      (init_task_union.task)
-#define init_stack     (init_task_union.stack)
-
-#define cpu_relax()    do { } while (0)
-
-#endif /* !defined (_LANGUAGE_ASSEMBLY) */
-#endif /* __KERNEL__ */
+#define cpu_relax()    barrier()
 
 /*
  * Return_address is a replacement for __builtin_return_address(count)
@@ -280,4 +123,20 @@ unsigned long get_wchan(struct task_struct *p);
  */
 #define return_address() ({__asm__ __volatile__("":::"$31");__builtin_return_address(0);})
 
+#ifdef CONFIG_CPU_HAS_PREFETCH
+
+#define ARCH_HAS_PREFETCH
+
+static inline void prefetch(const void *addr)
+{
+       __asm__ __volatile__(
+       "       .set    mips4           \n"
+       "       pref    %0, (%1)        \n"
+       "       .set    mips0           \n"
+       :
+       : "i" (Pref_Load), "r" (addr));
+}
+
+#endif
+
 #endif /* _ASM_PROCESSOR_H */
index 2517adb..5659c0c 100644 (file)
@@ -3,17 +3,12 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000 by Ralf Baechle
- *
- * Machine dependent structs and defines to help the user use
- * the ptrace system call.
+ * Copyright (C) 1994, 95, 96, 97, 98, 99, 2000 by Ralf Baechle
+ * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
  */
 #ifndef _ASM_PTRACE_H
 #define _ASM_PTRACE_H
 
-#include <asm/isadep.h>
-#include <linux/types.h>
-
 /* 0 - 31 are integer registers, 32 - 63 are fp registers.  */
 #define FPR_BASE       32
 #define PC             64
 #define MMLO           68
 #define FPC_CSR                69
 #define FPC_EIR                70
+#define DSP_BASE       71              /* 3 more hi / lo register pairs */
+#define DSP_CONTROL    77
+#define ACX            78
 
-#ifndef _LANGUAGE_ASSEMBLY
 /*
  * This struct defines the way the registers are stored on the stack during a
  * system call/exception. As usual the registers k0/k1 aren't being saved.
  */
 struct pt_regs {
+#ifdef CONFIG_32BIT
        /* Pad bytes for argument save space on the stack. */
        unsigned long pad0[6];
+#endif
 
        /* Saved main processor registers. */
        unsigned long regs[32];
 
-       /* Other saved registers. */
-       unsigned long lo;
+       /* Saved special registers. */
+       unsigned long cp0_status;
        unsigned long hi;
-
-       /*
-        * saved cp0 registers
-        */
-       unsigned long cp0_epc;
+       unsigned long lo;
+#ifdef CONFIG_CPU_HAS_SMARTMIPS
+       unsigned long acx;
+#endif
        unsigned long cp0_badvaddr;
-       unsigned long cp0_status;
        unsigned long cp0_cause;
-};
-
-#endif /* !(_LANGUAGE_ASSEMBLY) */
+       unsigned long cp0_epc;
+#ifdef CONFIG_MIPS_MT_SMTC
+       unsigned long cp0_tcstatus;
+#endif /* CONFIG_MIPS_MT_SMTC */
+} __attribute__ ((aligned (8)));
 
 /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
-/* #define PTRACE_GETREGS              12 */
-/* #define PTRACE_SETREGS              13 */
-/* #define PTRACE_GETFPREGS            14 */
-/* #define PTRACE_SETFPREGS            15 */
+#define PTRACE_GETREGS         12
+#define PTRACE_SETREGS         13
+#define PTRACE_GETFPREGS               14
+#define PTRACE_SETFPREGS               15
 /* #define PTRACE_GETFPXREGS           18 */
 /* #define PTRACE_SETFPXREGS           19 */
 
-#define PTRACE_SETOPTIONS      21
+#define PTRACE_OLDSETOPTIONS   21
 
-/* options set using PTRACE_SETOPTIONS */
-#define PTRACE_O_TRACESYSGOOD  0x00000001
+#define PTRACE_GET_THREAD_AREA 25
+#define PTRACE_SET_THREAD_AREA 26
 
-#if 0 /* def _LANGUAGE_ASSEMBLY */
-#include <asm/offset.h>
-#endif
+/* Calls to trace a 64bit program from a 32bit program.  */
+#define PTRACE_PEEKTEXT_3264   0xc0
+#define PTRACE_PEEKDATA_3264   0xc1
+#define PTRACE_POKETEXT_3264   0xc2
+#define PTRACE_POKEDATA_3264   0xc3
+#define PTRACE_GET_THREAD_AREA_3264    0xc4
 
 #ifdef __KERNEL__
 
-#ifndef _LANGUAGE_ASSEMBLY
+#include <asm/isadep.h>
+
 /*
  * Does the process account for user or for system time?
  */
 #define user_mode(regs) (((regs)->cp0_status & KU_MASK) == KU_USER)
 
 #define instruction_pointer(regs) ((regs)->cp0_epc)
-
-extern void show_regs(struct pt_regs *);
-#endif /* !(_LANGUAGE_ASSEMBLY) */
+#define profile_pc(regs) instruction_pointer(regs)
 
 #endif
 
diff --git a/include/asm-mips/reboot.h b/include/asm-mips/reboot.h
new file mode 100644 (file)
index 0000000..978d206
--- /dev/null
@@ -0,0 +1,14 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1997, 1999, 2001, 06 by Ralf Baechle
+ * Copyright (C) 2001 MIPS Technologies, Inc.
+ */
+#ifndef _ASM_REBOOT_H
+#define _ASM_REBOOT_H
+
+extern void _machine_restart(void);
+
+#endif /* _ASM_REBOOT_H */
index 35505b7..fc6bc0c 100644 (file)
@@ -7,48 +7,50 @@
  * for more details.
  *
  * Copyright (C) 1995, 1999 by Ralf Baechle
+ * Copyright (C) 1995, 1999 Silicon Graphics
  */
 #ifndef __ASM_MIPS_REG_H
 #define __ASM_MIPS_REG_H
 
-/*
- * This defines/structures correspond to the register layout on stack -
- * if the order here is changed, it needs to be updated in
- * include/asm-mips/stackframe.h
- */
-#define EF_REG0                        6
-#define EF_REG1                        7
-#define EF_REG2                        8
-#define EF_REG3                        9
-#define EF_REG4                        10
-#define EF_REG5                        11
-#define EF_REG6                        12
-#define EF_REG7                        13
-#define EF_REG8                        14
-#define EF_REG9                        15
-#define EF_REG10               16
-#define EF_REG11               17
-#define EF_REG12               18
-#define EF_REG13               19
-#define EF_REG14               20
-#define EF_REG15               21
-#define EF_REG16               22
-#define EF_REG17               23
-#define EF_REG18               24
-#define EF_REG19               25
-#define EF_REG20               26
-#define EF_REG21               27
-#define EF_REG22               28
-#define EF_REG23               29
-#define EF_REG24               30
-#define EF_REG25               31
+#if defined(CONFIG_32BIT) || defined(WANT_COMPAT_REG_H)
+
+#define EF_R0                  6
+#define EF_R1                  7
+#define EF_R2                  8
+#define EF_R3                  9
+#define EF_R4                  10
+#define EF_R5                  11
+#define EF_R6                  12
+#define EF_R7                  13
+#define EF_R8                  14
+#define EF_R9                  15
+#define EF_R10                 16
+#define EF_R11                 17
+#define EF_R12                 18
+#define EF_R13                 19
+#define EF_R14                 20
+#define EF_R15                 21
+#define EF_R16                 22
+#define EF_R17                 23
+#define EF_R18                 24
+#define EF_R19                 25
+#define EF_R20                 26
+#define EF_R21                 27
+#define EF_R22                 28
+#define EF_R23                 29
+#define EF_R24                 30
+#define EF_R25                 31
+
 /*
  * k0/k1 unsaved
  */
-#define EF_REG28               34
-#define EF_REG29               35
-#define EF_REG30               36
-#define EF_REG31               37
+#define EF_R26                 32
+#define EF_R27                 33
+
+#define EF_R28                 34
+#define EF_R29                 35
+#define EF_R30                 36
+#define EF_R31                 37
 
 /*
  * Saved special registers
 #define EF_CP0_EPC             40
 #define EF_CP0_BADVADDR                41
 #define EF_CP0_STATUS          42
-#define EF_CP0_CAUSE           44
+#define EF_CP0_CAUSE           43
+#define EF_UNUSED0             44
+
+#define EF_SIZE                        180
+
+#endif
+
+#ifdef CONFIG_64BIT
+
+#define EF_R0                   0
+#define EF_R1                   1
+#define EF_R2                   2
+#define EF_R3                   3
+#define EF_R4                   4
+#define EF_R5                   5
+#define EF_R6                   6
+#define EF_R7                   7
+#define EF_R8                   8
+#define EF_R9                   9
+#define EF_R10                 10
+#define EF_R11                 11
+#define EF_R12                 12
+#define EF_R13                 13
+#define EF_R14                 14
+#define EF_R15                 15
+#define EF_R16                 16
+#define EF_R17                 17
+#define EF_R18                 18
+#define EF_R19                 19
+#define EF_R20                 20
+#define EF_R21                 21
+#define EF_R22                 22
+#define EF_R23                 23
+#define EF_R24                 24
+#define EF_R25                 25
+
+/*
+ * k0/k1 unsaved
+ */
+#define EF_R26                 26
+#define EF_R27                 27
+
+#define EF_R28                 28
+#define EF_R29                 29
+#define EF_R30                 30
+#define EF_R31                 31
+
+/*
+ * Saved special registers
+ */
+#define EF_LO                  32
+#define EF_HI                  33
+
+#define EF_CP0_EPC             34
+#define EF_CP0_BADVADDR                35
+#define EF_CP0_STATUS          36
+#define EF_CP0_CAUSE           37
+
+#define EF_SIZE                        304     /* size in bytes */
 
-#define EF_SIZE                        180     /* size in bytes */
+#endif /* CONFIG_64BIT */
 
 #endif /* __ASM_MIPS_REG_H */
index 691d047..2e65cc3 100644 (file)
 /*
- * include/asm-mips/regdefs.h
- *
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 1994, 1995 by Ralf Baechle
+ * Copyright (C) 1985 MIPS Computer Systems, Inc.
+ * Copyright (C) 1994, 95, 99, 2003 by Ralf Baechle
+ * Copyright (C) 1990 - 1992, 1999 Silicon Graphics, Inc.
  */
+#ifndef _ASM_REGDEF_H
+#define _ASM_REGDEF_H
+
+#include <asm/sgidefs.h>
 
-#ifndef __ASM_MIPS_REGDEF_H
-#define __ASM_MIPS_REGDEF_H
+#if _MIPS_SIM == _MIPS_SIM_ABI32
 
 /*
  * Symbolic register names for 32 bit ABI
  */
-#define zero    $0      /* wired zero */
-#define AT      $1      /* assembler temp  - uppercase because of ".set at" */
-#define v0      $2      /* return value */
-#define v1      $3
-#define a0      $4      /* argument registers */
-#define a1      $5
-#define a2      $6
-#define a3      $7
-#define t0      $8      /* caller saved */
-#define t1      $9
-#define t2      $10
-#define t3      $11
-#define t4      $12
-#define t5      $13
-#define t6      $14
-#define t7      $15
-#define s0      $16     /* callee saved */
-#define s1      $17
-#define s2      $18
-#define s3      $19
-#define s4      $20
-#define s5      $21
-#define s6      $22
-#define s7      $23
-#define t8      $24     /* caller saved */
-#define t9      $25
-#define jp      $25     /* PIC jump register */
-#define k0      $26     /* kernel scratch */
-#define k1      $27
-#define gp      $28     /* global pointer */
-#define sp      $29     /* stack pointer */
-#define fp      $30     /* frame pointer */
+#define zero   $0      /* wired zero */
+#define AT     $1      /* assembler temp  - uppercase because of ".set at" */
+#define v0     $2      /* return value */
+#define v1     $3
+#define a0     $4      /* argument registers */
+#define a1     $5
+#define a2     $6
+#define a3     $7
+#define t0     $8      /* caller saved */
+#define t1     $9
+#define t2     $10
+#define t3     $11
+#define t4     $12
+#define t5     $13
+#define t6     $14
+#define t7     $15
+#define s0     $16     /* callee saved */
+#define s1     $17
+#define s2     $18
+#define s3     $19
+#define s4     $20
+#define s5     $21
+#define s6     $22
+#define s7     $23
+#define t8     $24     /* caller saved */
+#define t9     $25
+#define jp     $25     /* PIC jump register */
+#define k0     $26     /* kernel scratch */
+#define k1     $27
+#define gp     $28     /* global pointer */
+#define sp     $29     /* stack pointer */
+#define fp     $30     /* frame pointer */
 #define s8     $30     /* same like fp! */
-#define ra      $31     /* return address */
+#define ra     $31     /* return address */
+
+#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
+
+#if _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32
+
+#define zero   $0      /* wired zero */
+#define AT     $at     /* assembler temp - uppercase because of ".set at" */
+#define v0     $2      /* return value - caller saved */
+#define v1     $3
+#define a0     $4      /* argument registers */
+#define a1     $5
+#define a2     $6
+#define a3     $7
+#define a4     $8      /* arg reg 64 bit; caller saved in 32 bit */
+#define ta0    $8
+#define a5     $9
+#define ta1    $9
+#define a6     $10
+#define ta2    $10
+#define a7     $11
+#define ta3    $11
+#define t0     $12     /* caller saved */
+#define t1     $13
+#define t2     $14
+#define t3     $15
+#define s0     $16     /* callee saved */
+#define s1     $17
+#define s2     $18
+#define s3     $19
+#define s4     $20
+#define s5     $21
+#define s6     $22
+#define s7     $23
+#define t8     $24     /* caller saved */
+#define t9     $25     /* callee address for PIC/temp */
+#define jp     $25     /* PIC jump register */
+#define k0     $26     /* kernel temporary */
+#define k1     $27
+#define gp     $28     /* global pointer - caller saved for PIC */
+#define sp     $29     /* stack pointer */
+#define fp     $30     /* frame pointer */
+#define s8     $30     /* callee saved */
+#define ra     $31     /* return address */
+
+#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 */
 
-#endif /* __ASM_MIPS_REGDEF_H */
+#endif /* _ASM_REGDEF_H */
index 707cbf4..d4bb859 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id: types.h,v 1.3 1999/08/18 23:37:50 ralf Exp $
- *
+/*
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
@@ -10,6 +9,8 @@
 #ifndef _ASM_TYPES_H
 #define _ASM_TYPES_H
 
+#ifndef __ASSEMBLY__
+
 typedef unsigned short umode_t;
 
 /*
@@ -40,11 +41,17 @@ __extension__ typedef unsigned long long __u64;
 
 #endif
 
+#endif /* __ASSEMBLY__ */
+
 /*
  * These aren't exported outside the kernel to avoid name space clashes
  */
 #ifdef __KERNEL__
 
+#define BITS_PER_LONG _MIPS_SZLONG
+
+#ifndef __ASSEMBLY__
+
 typedef __signed char s8;
 typedef unsigned char u8;
 
@@ -68,9 +75,32 @@ typedef unsigned long long u64;
 
 #endif
 
-#define BITS_PER_LONG _MIPS_SZLONG
+#if (defined(CONFIG_HIGHMEM) && defined(CONFIG_64BIT_PHYS_ADDR)) \
+    || defined(CONFIG_64BIT)
+typedef u64 dma_addr_t;
+
+typedef u64 phys_addr_t;
+typedef u64 phys_size_t;
+
+#else
+typedef u32 dma_addr_t;
+
+typedef u32 phys_addr_t;
+typedef u32 phys_size_t;
+
+#endif
+typedef u64 dma64_addr_t;
+
+/*
+ * Don't use phys_t.  You've been warned.
+ */
+#ifdef CONFIG_64BIT_PHYS_ADDR
+typedef unsigned long long phys_t;
+#else
+typedef unsigned long phys_t;
+#endif
 
-typedef unsigned long dma_addr_t;
+#endif /* __ASSEMBLY__ */
 
 #endif /* __KERNEL__ */
 
index 6fc339f..12a0bd9 100644 (file)
@@ -114,8 +114,6 @@ static inline void sync(void)
  * that can be used to access the memory range with the caching
  * properties specified by "flags".
  */
-typedef unsigned long phys_addr_t;
-
 #define MAP_NOCACHE    (0)
 #define MAP_WRCOMBINE  (0)
 #define MAP_WRBACK     (0)
index 24c98a8..636e12f 100644 (file)
@@ -52,6 +52,9 @@ typedef unsigned long long u64;
 /* Dma addresses are 32-bits wide.  */
 
 typedef u32 dma_addr_t;
+
+typedef unsigned long phys_addr_t;
+typedef unsigned long phys_size_t;
 #endif /* __KERNEL__ */
 
 #endif /* _NIOS_TYPES_H */
index a52b95c..2f1ec26 100644 (file)
@@ -34,8 +34,6 @@ static inline void sync(void)
  * that can be used to access the memory range with the caching
  * properties specified by "flags".
  */
-typedef unsigned long phys_addr_t;
-
 #define MAP_NOCACHE    (0)
 #define MAP_WRCOMBINE  (0)
 #define MAP_WRBACK     (0)
diff --git a/include/asm-ppc/fsl_serdes.h b/include/asm-ppc/fsl_serdes.h
new file mode 100644 (file)
index 0000000..733f919
--- /dev/null
@@ -0,0 +1,21 @@
+#ifndef __FSL_SERDES_H
+#define __FSL_SERDES_H
+
+#include <config.h>
+
+#define FSL_SERDES_CLK_100             0
+#define FSL_SERDES_CLK_125             1
+#define FSL_SERDES_CLK_150             3
+#define FSL_SERDES_PROTO_SATA          0
+#define FSL_SERDES_PROTO_PEX           1
+#define FSL_SERDES_PROTO_PEX_X2                2
+#define FSL_SERDES_PROTO_SGMII         3
+#define FSL_SERDES_VDD_1V              1
+
+#ifdef CONFIG_FSL_SERDES
+extern void fsl_setup_serdes(u32 offset, char proto, char rfcks, char vdd);
+#else
+static void fsl_setup_serdes(u32 offset, char proto, char rfcks, char vdd) {}
+#endif /* CONFIG_FSL_SERDES */
+
+#endif /* __FSL_SERDES_H */
index 4657604..202c844 100644 (file)
@@ -40,8 +40,11 @@ typedef      struct  global_data {
        bd_t            *bd;
        unsigned long   flags;
        unsigned long   baudrate;
-       unsigned long   cpu_clk;        /* CPU clock in Hz!             */
+       unsigned long   cpu_clk;        /* CPU clock in Hz! */
        unsigned long   bus_clk;
+#if defined(CONFIG_8xx)
+       unsigned long   brg_clk;
+#endif
 #if defined(CONFIG_CPM2)
        /* There are many clocks on the MPC8260 - see page 9-5 */
        unsigned long   vco_out;
@@ -49,9 +52,7 @@ typedef       struct  global_data {
        unsigned long   scc_clk;
        unsigned long   brg_clk;
 #endif
-#if defined(CONFIG_MPC7448HPC2)
        unsigned long   mem_clk;
-#endif
 #if defined(CONFIG_MPC83XX)
        /* There are other clocks in the MPC83XX */
        u32 csb_clk;
@@ -73,7 +74,6 @@ typedef       struct  global_data {
        u32 enc_clk;
        u32 lbiu_clk;
        u32 lclk_clk;
-       u32 ddr_clk;
        u32 pci_clk;
 #if defined(CONFIG_MPC837X)
        u32 pciexp1_clk;
@@ -83,7 +83,7 @@ typedef       struct  global_data {
        u32 sata_clk;
 #endif
 #if defined(CONFIG_MPC8360)
-       u32  ddr_sec_clk;
+       u32  mem_sec_clk;
 #endif /* CONFIG_MPC8360 */
 #endif
 #if defined(CONFIG_MPC83XX) || defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
index d769d70..dc6e278 100644 (file)
@@ -57,7 +57,7 @@ typedef struct ccsr_local_ecm {
        uint    lawbar7;        /* 0xce8 - Local Access Window 7 Base Address Register */
        char    res19[4];
        uint    lawar7;         /* 0xcf0 - Local Access Window 7 Attributes Register */
-       char    res20[780];
+       char    res20[780];     /* XXX: LAW 8, LAW9 for 8572 */
        uint    eebacr;         /* 0x1000 - ECM CCB Address Configuration Register */
        char    res21[12];
        uint    eebpcr;         /* 0x1010 - ECM CCB Port Configuration Register */
@@ -86,7 +86,12 @@ typedef struct ccsr_ddr {
        uint    cs1_config;             /* 0x2084 - DDR Chip Select Configuration */
        uint    cs2_config;             /* 0x2088 - DDR Chip Select Configuration */
        uint    cs3_config;             /* 0x208c - DDR Chip Select Configuration */
-       char    res5[112];
+       char    res4a[48];
+       uint    cs0_config_2;           /* 0x20c0 - DDR Chip Select Configuration 2 */
+       uint    cs1_config_2;           /* 0x20c4 - DDR Chip Select Configuration 2 */
+       uint    cs2_config_2;           /* 0x20c8 - DDR Chip Select Configuration 2 */
+       uint    cs3_config_2;           /* 0x20cc - DDR Chip Select Configuration 2 */
+       char    res5[48];
        uint    ext_refrec;             /* 0x2100 - DDR SDRAM Extended Refresh Recovery */
        uint    timing_cfg_0;           /* 0x2104 - DDR SDRAM Timing Configuration Register 0 */
        uint    timing_cfg_1;           /* 0x2108 - DDR SDRAM Timing Configuration Register 1 */
@@ -103,7 +108,17 @@ typedef struct ccsr_ddr {
        char    res7[20];
        uint    init_address;           /* 0x2148 - DDR training initialization address */
        uint    init_ext_address;       /* 0x214C - DDR training initialization extended address */
-       char    res8_1[2728];
+       char    res8_1[16];
+       uint    timing_cfg_4;           /* 0x2160 - DDR SDRAM Timing Configuration Register 4 */
+       uint    timing_cfg_5;           /* 0x2164 - DDR SDRAM Timing Configuration Register 5 */
+       char    reg8_1a[8];
+       uint    ddr_zq_cntl;            /* 0x2170 - DDR ZQ calibration control*/
+       uint    ddr_wrlvl_cntl;         /* 0x2174 - DDR write leveling control*/
+       uint    ddr_pd_cntl;            /* 0x2178 - DDR pre-drive conditioning control*/
+       uint    ddr_sr_cntr;            /* 0x217C - DDR self refresh counter */
+       uint    ddr_sdram_rcw_1;        /* 0x2180 - DDR Register Control Words 1 */
+       uint    ddr_sdram_rcw_2;        /* 0x2184 - DDR Register Control Words 2 */
+       char    res8_1b[2672];
        uint    ip_rev1;                /* 0x2BF8 - DDR IP Block Revision 1 */
        uint    ip_rev2;                /* 0x2BFC - DDR IP Block Revision 2 */
        char    res8_2[512];
@@ -217,7 +232,7 @@ typedef struct ccsr_lbc {
        char    res7[12];
        uint    lbcr;           /* 0x50d0 - LBC Configuration Register */
        uint    lcrr;           /* 0x50d4 - LBC Clock Ratio Register */
-       char    res8[12072];
+       char    res8[3880];
 } ccsr_lbc_t;
 
 /*
@@ -1555,7 +1570,9 @@ typedef struct ccsr_gur {
 #define MPC85xx_PORDEVSR_RIO_CTLS      0x00000008
 #define MPC85xx_PORDEVSR_RIO_DEV_ID    0x00000007
        uint    pordbgmsr;      /* 0xe0010 - POR debug mode status register */
-       char    res1[12];
+       uint    pordevsr2;      /* 0xe0014 - POR I/O device status regsiter 2 */
+#define MPC85xx_PORDEVSR2_SEC_CFG      0x00000020
+       char    res1[8];
        uint    gpporcr;        /* 0xe0020 - General-purpose POR configuration register */
        char    res2[12];
        uint    gpiocr;         /* 0xe0030 - GPIO control register */
@@ -1578,7 +1595,11 @@ typedef struct ccsr_gur {
 #define MPC85xx_DEVDISR_RMSG           0x00040000
 #define MPC85xx_DEVDISR_DDR            0x00010000
 #define MPC85xx_DEVDISR_CPU            0x00008000
+#define MPC85xx_DEVDISR_CPU0           MPC85xx_DEVDISR_CPU
 #define MPC85xx_DEVDISR_TB             0x00004000
+#define MPC85xx_DEVDISR_TB0            MPC85xx_DEVDISR_TB
+#define MPC85xx_DEVDISR_CPU1           0x00002000
+#define MPC85xx_DEVDISR_TB1            0x00001000
 #define MPC85xx_DEVDISR_DMA            0x00000400
 #define MPC85xx_DEVDISR_TSEC1          0x00000080
 #define MPC85xx_DEVDISR_TSEC2          0x00000040
@@ -1624,6 +1645,8 @@ typedef struct ccsr_gur {
 #define CFG_MPC85xx_ECM_ADDR   (CFG_IMMR + CFG_MPC85xx_ECM_OFFSET)
 #define CFG_MPC85xx_DDR_OFFSET (0x2000)
 #define CFG_MPC85xx_DDR_ADDR   (CFG_IMMR + CFG_MPC85xx_DDR_OFFSET)
+#define CFG_MPC85xx_DDR2_OFFSET        (0x6000)
+#define CFG_MPC85xx_DDR2_ADDR  (CFG_IMMR + CFG_MPC85xx_DDR2_OFFSET)
 #define CFG_MPC85xx_LBC_OFFSET (0x5000)
 #define CFG_MPC85xx_LBC_ADDR   (CFG_IMMR + CFG_MPC85xx_LBC_OFFSET)
 #define CFG_MPC85xx_PCIX_OFFSET        (0x8000)
index 91c9c1e..00b7ec5 100644 (file)
@@ -243,8 +243,6 @@ extern inline void out_be32(volatile unsigned __iomem *addr, int val)
  * that can be used to access the memory range with the caching
  * properties specified by "flags".
  */
-typedef unsigned long phys_addr_t;
-
 #define MAP_NOCACHE    (0)
 #define MAP_WRCOMBINE  (0)
 #define MAP_WRBACK     (0)
index b7a5b28..4c049a5 100644 (file)
@@ -18,9 +18,9 @@
 #define MSR_SF         (1<<63)
 #define MSR_ISF                (1<<61)
 #endif /* CONFIG_PPC64BRIDGE */
-#define MSR_UCLE        (1<<26)         /* User-mode cache lock enable (e500) */
+#define MSR_UCLE       (1<<26)         /* User-mode cache lock enable (e500) */
 #define MSR_VEC                (1<<25)         /* Enable AltiVec(74xx) */
-#define MSR_SPE         (1<<25)         /* Enable SPE(e500) */
+#define MSR_SPE                (1<<25)         /* Enable SPE(e500) */
 #define MSR_POW                (1<<18)         /* Enable Power Management */
 #define MSR_WE         (1<<18)         /* Wait State Enable */
 #define MSR_TGPR       (1<<17)         /* TLB Update registers in use */
 #define MSR_ME         (1<<12)         /* Machine Check Enable */
 #define MSR_FE0                (1<<11)         /* Floating Exception mode 0 */
 #define MSR_SE         (1<<10)         /* Single Step */
-#define MSR_DWE         (1<<10)         /* Debug Wait Enable (4xx) */
-#define MSR_UBLE        (1<<10)         /* BTB lock enable (e500) */
+#define MSR_DWE                (1<<10)         /* Debug Wait Enable (4xx) */
+#define MSR_UBLE       (1<<10)         /* BTB lock enable (e500) */
 #define MSR_BE         (1<<9)          /* Branch Trace */
 #define MSR_DE         (1<<9)          /* Debug Exception Enable */
 #define MSR_FE1                (1<<8)          /* Floating Exception mode 1 */
 #define MSR_IP         (1<<6)          /* Exception prefix 0x000/0xFFF */
 #define MSR_IR         (1<<5)          /* Instruction Relocate */
-#define MSR_IS          (1<<5)          /* Book E Instruction space */
+#define MSR_IS         (1<<5)          /* Book E Instruction space */
 #define MSR_DR         (1<<4)          /* Data Relocate */
-#define MSR_DS          (1<<4)          /* Book E Data space */
+#define MSR_DS         (1<<4)          /* Book E Data space */
 #define MSR_PE         (1<<3)          /* Protection Enable */
 #define MSR_PX         (1<<2)          /* Protection Exclusive Mode */
-#define MSR_PMM         (1<<2)          /* Performance monitor mark bit (e500) */
+#define MSR_PMM                (1<<2)          /* Performance monitor mark bit (e500) */
 #define MSR_RI         (1<<1)          /* Recoverable Exception */
 #define MSR_LE         (1<<0)          /* Little Endian */
 
@@ -54,7 +54,7 @@
 #define MSR_           MSR_ME|MSR_RI
 #endif
 #ifndef CONFIG_E500
-#define MSR_KERNEL      MSR_|MSR_IR|MSR_DR
+#define MSR_KERNEL     MSR_|MSR_IR|MSR_DR
 #else
 #define MSR_KERNEL     MSR_ME
 #endif
 #define SPRN_DAC1      0x3F6   /* Data Address Compare 1 */
 #define SPRN_DAC2      0x3F7   /* Data Address Compare 2 */
 #else
-#define SPRN_DAC1       0x13C   /* Book E Data Address Compare 1 */
-#define SPRN_DAC2       0x13D   /* Book E Data Address Compare 2 */
-#endif  /* CONFIG_BOOKE */
+#define SPRN_DAC1      0x13C   /* Book E Data Address Compare 1 */
+#define SPRN_DAC2      0x13D   /* Book E Data Address Compare 2 */
+#endif /* CONFIG_BOOKE */
 #define SPRN_DAR       0x013   /* Data Address Register */
 #define SPRN_DBAT0L    0x219   /* Data BAT 0 Lower Register */
 #define SPRN_DBAT0U    0x218   /* Data BAT 0 Upper Register */
 #define SPRN_DBAT2U    0x21C   /* Data BAT 2 Upper Register */
 #define SPRN_DBAT3L    0x21F   /* Data BAT 3 Lower Register */
 #define SPRN_DBAT3U    0x21E   /* Data BAT 3 Upper Register */
-#define SPRN_DBAT4L    0x239   /* Data BAT 4 Lower Register */
-#define SPRN_DBAT4U    0x238   /* Data BAT 4 Upper Register */
-#define SPRN_DBAT5L    0x23B   /* Data BAT 5 Lower Register */
-#define SPRN_DBAT5U    0x23A   /* Data BAT 5 Upper Register */
-#define SPRN_DBAT6L    0x23D   /* Data BAT 6 Lower Register */
-#define SPRN_DBAT6U    0x23C   /* Data BAT 6 Upper Register */
-#define SPRN_DBAT7L    0x23F   /* Data BAT 7 Lower Register */
-#define SPRN_DBAT7U    0x23E   /* Data BAT 7 Lower Register */
+#define SPRN_DBAT4L    0x239   /* Data BAT 4 Lower Register */
+#define SPRN_DBAT4U    0x238   /* Data BAT 4 Upper Register */
+#define SPRN_DBAT5L    0x23B   /* Data BAT 5 Lower Register */
+#define SPRN_DBAT5U    0x23A   /* Data BAT 5 Upper Register */
+#define SPRN_DBAT6L    0x23D   /* Data BAT 6 Lower Register */
+#define SPRN_DBAT6U    0x23C   /* Data BAT 6 Upper Register */
+#define SPRN_DBAT7L    0x23F   /* Data BAT 7 Lower Register */
+#define SPRN_DBAT7U    0x23E   /* Data BAT 7 Lower Register */
 #define SPRN_DBCR      0x3F2   /* Debug Control Regsiter */
 #define   DBCR_EDM     0x80000000
 #define   DBCR_IDM     0x40000000
 #define   DBCR_JOI     0x00000002      /* JTAG Serial Outbound Int. Enable */
 #define   DBCR_JII     0x00000001      /* JTAG Serial Inbound Int. Enable */
 #ifndef CONFIG_BOOKE
-#define SPRN_DBCR0      0x3F2           /* Debug Control Register 0 */
+#define SPRN_DBCR0     0x3F2           /* Debug Control Register 0 */
 #else
-#define SPRN_DBCR0      0x134           /* Book E Debug Control Register 0 */
+#define SPRN_DBCR0     0x134           /* Book E Debug Control Register 0 */
 #endif /* CONFIG_BOOKE */
 #ifndef CONFIG_BOOKE
 #define SPRN_DBCR1     0x3BD   /* Debug Control Register 1 */
 #define SPRN_DBSR      0x3F0   /* Debug Status Register */
 #else
-#define SPRN_DBCR1      0x135           /* Book E Debug Control Register 1 */
-#define SPRN_DBSR       0x130           /* Book E Debug Status Register */
-#define   DBSR_IC           0x08000000  /* Book E Instruction Completion  */
-#define   DBSR_TIE          0x01000000  /* Book E Trap Instruction Event */
+#define SPRN_DBCR1     0x135           /* Book E Debug Control Register 1 */
+#define SPRN_DBSR      0x130           /* Book E Debug Status Register */
+#define   DBSR_IC          0x08000000  /* Book E Instruction Completion  */
+#define   DBSR_TIE         0x01000000  /* Book E Trap Instruction Event */
 #endif /* CONFIG_BOOKE */
 #define SPRN_DCCR      0x3FA   /* Data Cache Cacheability Register */
 #define   DCCR_NOCACHE         0       /* Noncacheable */
 #ifndef CONFIG_BOOKE
 #define SPRN_DEAR      0x3D5   /* Data Error Address Register */
 #else
-#define SPRN_DEAR       0x03D   /* Book E Data Error Address Register */
+#define SPRN_DEAR      0x03D   /* Book E Data Error Address Register */
 #endif /* CONFIG_BOOKE */
 #define SPRN_DEC       0x016   /* Decrement Register */
 #define SPRN_DMISS     0x3D0   /* Data TLB Miss Register */
 #ifndef CONFIG_BOOKE
 #define SPRN_ESR       0x3D4   /* Exception Syndrome Register */
 #else
-#define SPRN_ESR        0x03E           /* Book E Exception Syndrome Register */
+#define SPRN_ESR       0x03E           /* Book E Exception Syndrome Register */
 #endif /* CONFIG_BOOKE */
 #define   ESR_IMCP     0x80000000      /* Instr. Machine Check - Protection */
 #define   ESR_IMCN     0x40000000      /* Instr. Machine Check - Non-config */
 #define SPRN_IAC1      0x3F4   /* Instruction Address Compare 1 */
 #define SPRN_IAC2      0x3F5   /* Instruction Address Compare 2 */
 #else
-#define SPRN_IAC1       0x138   /* Book E Instruction Address Compare 1 */
-#define SPRN_IAC2       0x139   /* Book E Instruction Address Compare 2 */
+#define SPRN_IAC1      0x138   /* Book E Instruction Address Compare 1 */
+#define SPRN_IAC2      0x139   /* Book E Instruction Address Compare 2 */
 #endif /* CONFIG_BOOKE */
 #define SPRN_IBAT0L    0x211   /* Instruction BAT 0 Lower Register */
 #define SPRN_IBAT0U    0x210   /* Instruction BAT 0 Upper Register */
 #define SPRN_IBAT2U    0x214   /* Instruction BAT 2 Upper Register */
 #define SPRN_IBAT3L    0x217   /* Instruction BAT 3 Lower Register */
 #define SPRN_IBAT3U    0x216   /* Instruction BAT 3 Upper Register */
-#define SPRN_IBAT4L    0x231   /* Instruction BAT 4 Lower Register */
-#define SPRN_IBAT4U    0x230   /* Instruction BAT 4 Upper Register */
-#define SPRN_IBAT5L    0x233   /* Instruction BAT 5 Lower Register */
-#define SPRN_IBAT5U    0x232   /* Instruction BAT 5 Upper Register */
-#define SPRN_IBAT6L    0x235   /* Instruction BAT 6 Lower Register */
-#define SPRN_IBAT6U    0x234   /* Instruction BAT 6 Upper Register */
-#define SPRN_IBAT7L    0x237   /* Instruction BAT 7 Lower Register */
-#define SPRN_IBAT7U    0x236   /* Instruction BAT 7 Upper Register */
+#define SPRN_IBAT4L    0x231   /* Instruction BAT 4 Lower Register */
+#define SPRN_IBAT4U    0x230   /* Instruction BAT 4 Upper Register */
+#define SPRN_IBAT5L    0x233   /* Instruction BAT 5 Lower Register */
+#define SPRN_IBAT5U    0x232   /* Instruction BAT 5 Upper Register */
+#define SPRN_IBAT6L    0x235   /* Instruction BAT 6 Lower Register */
+#define SPRN_IBAT6U    0x234   /* Instruction BAT 6 Upper Register */
+#define SPRN_IBAT7L    0x237   /* Instruction BAT 7 Lower Register */
+#define SPRN_IBAT7U    0x236   /* Instruction BAT 7 Upper Register */
 #define SPRN_ICCR      0x3FB   /* Instruction Cache Cacheability Register */
 #define   ICCR_NOCACHE         0       /* Noncacheable */
 #define   ICCR_CACHE           1       /* Cacheable */
 #define SPRN_ICTC      0x3FB   /* Instruction Cache Throttling Control Reg */
 #define SPRN_IMISS     0x3D4   /* Instruction TLB Miss Register */
 #define SPRN_IMMR      0x27E   /* Internal Memory Map Register */
-#define SPRN_LDSTCR    0x3F8   /* Load/Store Control Register */
+#define SPRN_LDSTCR    0x3F8   /* Load/Store Control Register */
 #define SPRN_L2CR      0x3F9   /* Level 2 Cache Control Regsiter */
 #define SPRN_LR                0x008   /* Link Register */
-#define SPRN_MBAR       0x137   /* System memory base address */
+#define SPRN_MBAR      0x137   /* System memory base address */
 #define SPRN_MMCR0     0x3B8   /* Monitor Mode Control Register 0 */
 #define SPRN_MMCR1     0x3BC   /* Monitor Mode Control Register 1 */
 #define SPRN_PBL1      0x3FC   /* Protection Bound Lower 1 */
 #define SPRN_PID       0x3B1   /* Process ID */
 #define SPRN_PIR       0x3FF   /* Processor Identification Register */
 #else
-#define SPRN_PID        0x030   /* Book E Process ID */
-#define SPRN_PIR        0x11E   /* Book E Processor Identification Register */
+#define SPRN_PID       0x030   /* Book E Process ID */
+#define SPRN_PIR       0x11E   /* Book E Processor Identification Register */
 #endif /* CONFIG_BOOKE */
 #define SPRN_PIT       0x3DB   /* Programmable Interval Timer */
 #define SPRN_PMC1      0x3B9   /* Performance Counter Register 1 */
 #ifndef CONFIG_BOOKE
 #define SPRN_TCR       0x3DA   /* Timer Control Register */
 #else
-#define SPRN_TCR        0x154   /* Book E Timer Control Register */
+#define SPRN_TCR       0x154   /* Book E Timer Control Register */
 #endif /* CONFIG_BOOKE */
 #define   TCR_WP(x)            (((x)&0x3)<<30) /* WDT Period */
 #define     WP_2_17            0               /* 2^17 clocks */
 #define SPRN_THRM2     0x3FD   /* Thermal Management Register 2 */
 #define SPRN_THRM3     0x3FE   /* Thermal Management Register 3 */
 #define   THRM3_E              (1<<31)
-#define SPRN_TLBMISS    0x3D4   /* 980 7450 TLB Miss Register */
+#define SPRN_TLBMISS   0x3D4   /* 980 7450 TLB Miss Register */
 #ifndef CONFIG_BOOKE
 #define SPRN_TSR       0x3D8   /* Timer Status Register */
 #else
-#define SPRN_TSR        0x150   /* Book E Timer Status Register */
+#define SPRN_TSR       0x150   /* Book E Timer Status Register */
 #endif /* CONFIG_BOOKE */
 #define   TSR_ENW              0x80000000      /* Enable Next Watchdog */
 #define   TSR_WIS              0x40000000      /* WDT Interrupt Status */
 #define SPRN_IVOR15    0x19f   /* Interrupt Vector Offset Register 15 */
 
 /* e500 definitions */
-#define SPRN_L1CFG0     0x203   /* L1 Cache Configuration Register 0 */
-#define SPRN_L1CFG1     0x204   /* L1 Cache Configuration Register 1 */
-#define SPRN_L1CSR0     0x3f2   /* L1 Data Cache Control and Status Register 0 */
-#define   L1CSR0_CPE            0x00010000     /* Data Cache Parity Enable */
-#define   L1CSR0_DCFI           0x00000002      /* Data Cache Flash Invalidate */
-#define   L1CSR0_DCE            0x00000001      /* Data Cache Enable */
-#define SPRN_L1CSR1     0x3f3   /* L1 Instruction Cache Control and Status Register 1 */
-#define   L1CSR1_CPE            0x00010000     /* Instruction Cache Parity Enable */
-#define   L1CSR1_ICFI           0x00000002      /* Instruction Cache Flash Invalidate */
-#define   L1CSR1_ICE            0x00000001      /* Instruction Cache Enable */
+#define SPRN_L1CFG0    0x203   /* L1 Cache Configuration Register 0 */
+#define SPRN_L1CFG1    0x204   /* L1 Cache Configuration Register 1 */
+#define SPRN_L1CSR0    0x3f2   /* L1 Data Cache Control and Status Register 0 */
+#define   L1CSR0_CPE           0x00010000      /* Data Cache Parity Enable */
+#define   L1CSR0_DCFI          0x00000002      /* Data Cache Flash Invalidate */
+#define   L1CSR0_DCE           0x00000001      /* Data Cache Enable */
+#define SPRN_L1CSR1    0x3f3   /* L1 Instruction Cache Control and Status Register 1 */
+#define   L1CSR1_CPE           0x00010000      /* Instruction Cache Parity Enable */
+#define   L1CSR1_ICFI          0x00000002      /* Instruction Cache Flash Invalidate */
+#define   L1CSR1_ICE           0x00000001      /* Instruction Cache Enable */
 
 #define SPRN_MMUCSR0   0x3f4   /* MMU control and status register 0 */
-#define SPRN_MAS0       0x270   /* MMU Assist Register 0 */
-#define SPRN_MAS1       0x271   /* MMU Assist Register 1 */
-#define SPRN_MAS2       0x272   /* MMU Assist Register 2 */
-#define SPRN_MAS3       0x273   /* MMU Assist Register 3 */
-#define SPRN_MAS4       0x274   /* MMU Assist Register 4 */
-#define SPRN_MAS5       0x275   /* MMU Assist Register 5 */
-#define SPRN_MAS6       0x276   /* MMU Assist Register 6 */
+#define SPRN_MAS0      0x270   /* MMU Assist Register 0 */
+#define SPRN_MAS1      0x271   /* MMU Assist Register 1 */
+#define SPRN_MAS2      0x272   /* MMU Assist Register 2 */
+#define SPRN_MAS3      0x273   /* MMU Assist Register 3 */
+#define SPRN_MAS4      0x274   /* MMU Assist Register 4 */
+#define SPRN_MAS5      0x275   /* MMU Assist Register 5 */
+#define SPRN_MAS6      0x276   /* MMU Assist Register 6 */
 #define SPRN_MAS7      0x3B0   /* MMU Assist Register 7 */
 
-#define SPRN_IVOR32     0x210   /* Interrupt Vector Offset Register 32 */
-#define SPRN_IVOR33     0x211   /* Interrupt Vector Offset Register 33 */
-#define SPRN_IVOR34     0x212   /* Interrupt Vector Offset Register 34 */
-#define SPRN_IVOR35     0x213   /* Interrupt Vector Offset Register 35 */
-#define SPRN_SPEFSCR    0x200   /* SPE & Embedded FP Status & Control */
+#define SPRN_IVOR32    0x210   /* Interrupt Vector Offset Register 32 */
+#define SPRN_IVOR33    0x211   /* Interrupt Vector Offset Register 33 */
+#define SPRN_IVOR34    0x212   /* Interrupt Vector Offset Register 34 */
+#define SPRN_IVOR35    0x213   /* Interrupt Vector Offset Register 35 */
+#define SPRN_SPEFSCR   0x200   /* SPE & Embedded FP Status & Control */
 
-#define SPRN_MCSRR0     0x23a   /* Machine Check Save and Restore Register 0 */
-#define SPRN_MCSRR1     0x23b   /* Machine Check Save and Restore Register 1 */
+#define SPRN_MCSRR0    0x23a   /* Machine Check Save and Restore Register 0 */
+#define SPRN_MCSRR1    0x23b   /* Machine Check Save and Restore Register 1 */
 #define SPRN_BUCSR     0x3f5   /* Branch Control and Status Register */
-#define SPRN_BBEAR      0x201   /* Branch Buffer Entry Address Register */
-#define SPRN_BBTAR      0x202   /* Branch Buffer Target Address Register */
-#define SPRN_PID1       0x279   /* Process ID Register 1 */
-#define SPRN_PID2       0x27a   /* Process ID Register 2 */
+#define SPRN_BBEAR     0x201   /* Branch Buffer Entry Address Register */
+#define SPRN_BBTAR     0x202   /* Branch Buffer Target Address Register */
+#define SPRN_PID1      0x279   /* Process ID Register 1 */
+#define SPRN_PID2      0x27a   /* Process ID Register 2 */
 #define SPRN_MCSR      0x23c   /* Machine Check Syndrome register */
 #define SPRN_MCAR      0x23d   /* Machine Check Address register */
 #ifdef CONFIG_440
 #define MCSR_DCFP      0x01000000      /* D-Cache Flush Parity Error */
 #define MCSR_IMPE      0x00800000      /* Imprecise Machine Check Exception */
 #endif
-#define ESR_ST          0x00800000      /* Store Operation */
+#define ESR_ST         0x00800000      /* Store Operation */
 
 #if defined(CONFIG_MPC86xx)
 #define SPRN_MSSCR0    0x3f6
 #define SPRN_MSSSR0    0x3f7
 #endif
 
-
 /* Short-hand versions for a number of the above SPRNs */
 
 #define CTR    SPRN_CTR        /* Counter Register */
 #define DBAT2U SPRN_DBAT2U     /* Data BAT 2 Upper Register */
 #define DBAT3L SPRN_DBAT3L     /* Data BAT 3 Lower Register */
 #define DBAT3U SPRN_DBAT3U     /* Data BAT 3 Upper Register */
-#define DBAT4L SPRN_DBAT4L     /* Data BAT 4 Lower Register */
-#define DBAT4U SPRN_DBAT4U     /* Data BAT 4 Upper Register */
-#define DBAT5L SPRN_DBAT5L     /* Data BAT 5 Lower Register */
-#define DBAT5U SPRN_DBAT5U     /* Data BAT 5 Upper Register */
-#define DBAT6L SPRN_DBAT6L     /* Data BAT 6 Lower Register */
-#define DBAT6U SPRN_DBAT6U     /* Data BAT 6 Upper Register */
-#define DBAT7L SPRN_DBAT7L     /* Data BAT 7 Lower Register */
-#define DBAT7U SPRN_DBAT7U     /* Data BAT 7 Upper Register */
+#define DBAT4L SPRN_DBAT4L     /* Data BAT 4 Lower Register */
+#define DBAT4U SPRN_DBAT4U     /* Data BAT 4 Upper Register */
+#define DBAT5L SPRN_DBAT5L     /* Data BAT 5 Lower Register */
+#define DBAT5U SPRN_DBAT5U     /* Data BAT 5 Upper Register */
+#define DBAT6L SPRN_DBAT6L     /* Data BAT 6 Lower Register */
+#define DBAT6U SPRN_DBAT6U     /* Data BAT 6 Upper Register */
+#define DBAT7L SPRN_DBAT7L     /* Data BAT 7 Lower Register */
+#define DBAT7U SPRN_DBAT7U     /* Data BAT 7 Upper Register */
 #define DBCR0  SPRN_DBCR0      /* Debug Control Register 0 */
 #define DBCR1  SPRN_DBCR1      /* Debug Control Register 1 */
 #define DBSR   SPRN_DBSR       /* Debug Status Register */
 #define ICMP   SPRN_ICMP       /* Instruction TLB Compare Register */
 #define IMISS  SPRN_IMISS      /* Instruction TLB Miss Register */
 #define IMMR   SPRN_IMMR       /* PPC 860/821 Internal Memory Map Register */
-#define LDSTCR SPRN_LDSTCR     /* Load/Store Control Register */
+#define LDSTCR SPRN_LDSTCR     /* Load/Store Control Register */
 #define L2CR   SPRN_L2CR       /* PPC 750 L2 control register */
 #define LR     SPRN_LR
-#define MBAR    SPRN_MBAR       /* System memory base address */
+#define MBAR   SPRN_MBAR       /* System memory base address */
 #if defined(CONFIG_MPC86xx)
 #define MSSCR0 SPRN_MSSCR0
 #endif
 #define SPR1   SPRN_SPRG1
 #define SPR2   SPRN_SPRG2
 #define SPR3   SPRN_SPRG3
-#define SPRG0   SPRN_SPRG0
-#define SPRG1   SPRN_SPRG1
-#define SPRG2   SPRN_SPRG2
-#define SPRG3   SPRN_SPRG3
-#define SPRG4   SPRN_SPRG4
-#define SPRG5   SPRN_SPRG5
-#define SPRG6   SPRN_SPRG6
-#define SPRG7   SPRN_SPRG7
+#define SPRG0  SPRN_SPRG0
+#define SPRG1  SPRN_SPRG1
+#define SPRG2  SPRN_SPRG2
+#define SPRG3  SPRN_SPRG3
+#define SPRG4  SPRN_SPRG4
+#define SPRG5  SPRN_SPRG5
+#define SPRG6  SPRN_SPRG6
+#define SPRG7  SPRN_SPRG7
 #define SRR0   SPRN_SRR0       /* Save and Restore Register 0 */
 #define SRR1   SPRN_SRR1       /* Save and Restore Register 1 */
 #define SRR2   SPRN_SRR2       /* Save and Restore Register 2 */
 #define DCRN_DMACC0    0x0C4   /* DMA Chained Count Register 0 */
 #define DCRN_DMACC1    0x0CC   /* DMA Chained Count Register 1 */
 #define DCRN_DMACC2    0x0D4   /* DMA Chained Count Register 2 */
-#define DCRN_DMACC3    0x0DC    /* DMA Chained Count Register 3 */
-#define DCRN_DMACR0    0x0C0    /* DMA Channel Control Register 0 */
-#define DCRN_DMACR1    0x0C8    /* DMA Channel Control Register 1 */
-#define DCRN_DMACR2    0x0D0    /* DMA Channel Control Register 2 */
-#define DCRN_DMACR3    0x0D8    /* DMA Channel Control Register 3 */
-#define DCRN_DMACT0    0x0C1    /* DMA Count Register 0 */
-#define DCRN_DMACT1    0x0C9    /* DMA Count Register 1 */
-#define DCRN_DMACT2    0x0D1    /* DMA Count Register 2 */
-#define DCRN_DMACT3    0x0D9    /* DMA Count Register 3 */
-#define DCRN_DMADA0    0x0C2    /* DMA Destination Address Register 0 */
-#define DCRN_DMADA1    0x0CA    /* DMA Destination Address Register 1 */
-#define DCRN_DMADA2    0x0D2    /* DMA Destination Address Register 2 */
-#define DCRN_DMADA3    0x0DA    /* DMA Destination Address Register 3 */
-#define DCRN_DMASA0    0x0C3    /* DMA Source Address Register 0 */
-#define DCRN_DMASA1    0x0CB    /* DMA Source Address Register 1 */
-#define DCRN_DMASA2    0x0D3    /* DMA Source Address Register 2 */
-#define DCRN_DMASA3    0x0DB    /* DMA Source Address Register 3 */
-#define DCRN_DMASR     0x0E0    /* DMA Status Register */
-#define DCRN_EXIER     0x042    /* External Interrupt Enable Register */
+#define DCRN_DMACC3    0x0DC    /* DMA Chained Count Register 3 */
+#define DCRN_DMACR0    0x0C0    /* DMA Channel Control Register 0 */
+#define DCRN_DMACR1    0x0C8    /* DMA Channel Control Register 1 */
+#define DCRN_DMACR2    0x0D0    /* DMA Channel Control Register 2 */
+#define DCRN_DMACR3    0x0D8    /* DMA Channel Control Register 3 */
+#define DCRN_DMACT0    0x0C1    /* DMA Count Register 0 */
+#define DCRN_DMACT1    0x0C9    /* DMA Count Register 1 */
+#define DCRN_DMACT2    0x0D1    /* DMA Count Register 2 */
+#define DCRN_DMACT3    0x0D9    /* DMA Count Register 3 */
+#define DCRN_DMADA0    0x0C2    /* DMA Destination Address Register 0 */
+#define DCRN_DMADA1    0x0CA    /* DMA Destination Address Register 1 */
+#define DCRN_DMADA2    0x0D2    /* DMA Destination Address Register 2 */
+#define DCRN_DMADA3    0x0DA    /* DMA Destination Address Register 3 */
+#define DCRN_DMASA0    0x0C3    /* DMA Source Address Register 0 */
+#define DCRN_DMASA1    0x0CB    /* DMA Source Address Register 1 */
+#define DCRN_DMASA2    0x0D3    /* DMA Source Address Register 2 */
+#define DCRN_DMASA3    0x0DB    /* DMA Source Address Register 3 */
+#define DCRN_DMASR     0x0E0    /* DMA Status Register */
+#define DCRN_EXIER     0x042    /* External Interrupt Enable Register */
 #define   EXIER_CIE    0x80000000      /* Critical Interrupt Enable */
 #define   EXIER_SRIE   0x08000000      /* Serial Port Rx Int. Enable */
 #define   EXIER_STIE   0x04000000      /* Serial Port Tx Int. Enable */
 #define   EXIER_E2IE   0x00000004      /* External Interrupt 2 Enable */
 #define   EXIER_E3IE   0x00000002      /* External Interrupt 3 Enable */
 #define   EXIER_E4IE   0x00000001      /* External Interrupt 4 Enable */
-#define DCRN_EXISR     0x040    /* External Interrupt Status Register */
-#define DCRN_IOCR      0x0A0    /* Input/Output Configuration Register */
+#define DCRN_EXISR     0x040    /* External Interrupt Status Register */
+#define DCRN_IOCR      0x0A0    /* Input/Output Configuration Register */
 #define   IOCR_E0TE    0x80000000
 #define   IOCR_E0LP    0x40000000
 #define   IOCR_E1TE    0x20000000
 #define SVR_VER(svr)   (((svr) >> 16) & 0xFFFF) /* Version field */
 #define SVR_REV(svr)   (((svr) >>  0) & 0xFFFF) /* Revision field */
 
-#define SVR_CID(svr)   (((svr) >> 28) & 0x0F)   /* Company or manufacturer ID */
-#define SVR_SOCOP(svr) (((svr) >> 22) & 0x3F)   /* SOC integration options */
-#define SVR_SID(svr)   (((svr) >> 16) & 0x3F)   /* SOC ID */
-#define SVR_PROC(svr)  (((svr) >> 12) & 0x0F)   /* Process revision field */
-#define SVR_MFG(svr)   (((svr) >>  8) & 0x0F)   /* Manufacturing revision */
-#define SVR_MJREV(svr) (((svr) >>  4) & 0x0F)   /* Major SOC design revision indicator */
-#define SVR_MNREV(svr) (((svr) >>  0) & 0x0F)   /* Minor SOC design revision indicator */
-
+#define SVR_CID(svr)   (((svr) >> 28) & 0x0F)   /* Company or manufacturer ID */
+#define SVR_SOCOP(svr) (((svr) >> 22) & 0x3F)   /* SOC integration options */
+#define SVR_SID(svr)   (((svr) >> 16) & 0x3F)   /* SOC ID */
+#define SVR_PROC(svr)  (((svr) >> 12) & 0x0F)   /* Process revision field */
+#define SVR_MFG(svr)   (((svr) >>  8) & 0x0F)   /* Manufacturing revision */
+#define SVR_MJREV(svr) (((svr) >>  4) & 0x0F)   /* Major SOC design revision indicator */
+#define SVR_MNREV(svr) (((svr) >>  0) & 0x0F)   /* Minor SOC design revision indicator */
 
 /* Processor Version Register */
 
 #define PVR_440EP_RC   0x422218D4 /* 440EP rev C and 440GR rev B have same PVR */
 #define PVR_440GR_RA   0x422218D3 /* 440EP rev B and 440GR rev A have same PVR */
 #define PVR_440GR_RB   0x422218D4 /* 440EP rev C and 440GR rev B have same PVR */
-#define PVR_440EPX1_RA  0x216218D0 /* 440EPX rev A with Security / Kasumi */
-#define PVR_440EPX2_RA  0x216218D4 /* 440EPX rev A without Security / Kasumi */
-#define PVR_440GRX1_RA  0x216218D0 /* 440GRX rev A with Security / Kasumi */
-#define PVR_440GRX2_RA  0x216218D4 /* 440GRX rev A without Security / Kasumi */
+#define PVR_440EPX1_RA 0x216218D0 /* 440EPX rev A with Security / Kasumi */
+#define PVR_440EPX2_RA 0x216218D4 /* 440EPX rev A without Security / Kasumi */
+#define PVR_440GRX1_RA 0x216218D0 /* 440GRX rev A with Security / Kasumi */
+#define PVR_440GRX2_RA 0x216218D4 /* 440GRX rev A without Security / Kasumi */
 #define PVR_440GX_RA   0x51B21850
 #define PVR_440GX_RB   0x51B21851
 #define PVR_440GX_RC   0x51B21892
 #define PVR_440SPe_RA  0x53521890 /* 440SPe rev A without RAID 6 support       */
 #define PVR_440SPe_6_RB        0x53421891 /* 440SPe rev B with RAID 6 support enabled  */
 #define PVR_440SPe_RB  0x53521891 /* 440SPe rev B without RAID 6 support       */
-#define PVR_460EX_SE_RA        0x130218A2 /* 460EX rev A with Security Engine    */
+#define PVR_460EX_SE_RA        0x130218A2 /* 460EX rev A with Security Engine    */
 #define PVR_460EX_RA   0x130218A3 /* 460EX rev A without Security Engine */
-#define PVR_460GT_SE_RA        0x130218A0 /* 460GT rev A with Security Engine    */
+#define PVR_460GT_SE_RA        0x130218A0 /* 460GT rev A with Security Engine    */
 #define PVR_460GT_RA   0x130218A1 /* 460GT rev A without Security Engine */
 #define PVR_601                0x00010000
 #define PVR_602                0x00050000
 #define PVR_750                PVR_740
 #define PVR_740P       0x10080000
 #define PVR_750P       PVR_740P
-#define PVR_7400        0x000C0000
-#define PVR_7410        0x800C0000
-#define PVR_7450        0x80000000
+#define PVR_7400       0x000C0000
+#define PVR_7410       0x800C0000
+#define PVR_7450       0x80000000
 
 #define PVR_85xx       0x80200000
 #define PVR_85xx_REV1  (PVR_85xx | 0x0010)
  * PowerQUICC II family processors report different PVR values depending
  * on silicon process (HiP3, HiP4, HiP7, etc.)
  */
-#define PVR_8260        PVR_8240
-#define PVR_8260_HIP3   0x00810101
-#define PVR_8260_HIP4   0x80811014
-#define PVR_8260_HIP7   0x80822011
+#define PVR_8260       PVR_8240
+#define PVR_8260_HIP3  0x00810101
+#define PVR_8260_HIP4  0x80811014
+#define PVR_8260_HIP7  0x80822011
 #define PVR_8260_HIP7R1 0x80822013
 #define PVR_8260_HIP7RA        0x80822014
 
 #define PVR_5200       0x80822011
 #define PVR_5200B      0x80822014
 
-
 /*
  * System Version Register
  */
 #define SVR_MAJ(svr)   (((svr) >>  4) & 0xF)   /* Major revision field*/
 #define SVR_MIN(svr)   (((svr) >>  0) & 0xF)   /* Minor revision field*/
 
+/* Some parts define SVR[0:23] as the SOC version */
+#define SVR_SOC_VER(svr) (((svr) >> 8) & 0xFFFFFF)     /* SOC Version fields */
 
 /*
- * SVR_VER() Version Values
+ * SVR_SOC_VER() Version Values
  */
 
-#define SVR_8540       0x8030
-#define SVR_8560       0x8070
-#define SVR_8555       0x8079
-#define SVR_8541       0x807A
-#define SVR_8544       0x8034
-#define SVR_8544_E     0x803C
-#define SVR_8548       0x8031
-#define SVR_8548_E     0x8039
-#define SVR_8610       0x80A0
-#define SVR_8641       0x8090
-#define SVR_8568_E     0x807D
-
-
-/* I am just adding a single entry for 8260 boards.  I think we may be
- * able to combine mbx, fads, rpxlite, bseip, and classic into a single
- * generic 8xx as well.  The boards containing these processors are either
- * identical at the processor level (due to the high integration) or so
- * wildly different that testing _machine at run time is best replaced by
- * conditional compilation by board type (found in their respective .h file).
- *     -- Dan
- */
-#define _MACH_prep     0x00000001
-#define _MACH_Pmac     0x00000002      /* pmac or pmac clone (non-chrp) */
-#define _MACH_chrp     0x00000004      /* chrp machine */
-#define _MACH_mbx      0x00000008      /* Motorola MBX board */
-#define _MACH_apus     0x00000010      /* amiga with phase5 powerup */
-#define _MACH_fads     0x00000020      /* Motorola FADS board */
-#define _MACH_rpxlite  0x00000040      /* RPCG RPX-Lite 8xx board */
-#define _MACH_bseip    0x00000080      /* Bright Star Engineering ip-Engine */
-#define _MACH_yk       0x00000100      /* Motorola Yellowknife */
-#define _MACH_gemini   0x00000200      /* Synergy Microsystems gemini board */
-#define _MACH_classic  0x00000400      /* RPCG RPX-Classic 8xx board */
-#define _MACH_oak      0x00000800      /* IBM "Oak" 403 eval. board */
-#define _MACH_walnut   0x00001000      /* AMCC "Walnut" 405GP eval. board */
-#define _MACH_8260     0x00002000      /* Generic 8260 */
-#define _MACH_sandpoint 0x00004000     /* Motorola SPS Processor eval board */
-#define _MACH_tqm860   0x00008000      /* TQM860/L */
-#define _MACH_tqm8xxL  0x00010000      /* TQM8xxL */
-#define _MACH_hidden_dragon 0x00020000 /* Motorola Hidden Dragon eval board */
-
-
-/* see residual.h for these */
-#define _PREP_Motorola 0x01  /* motorola prep */
-#define _PREP_Firm     0x02  /* firmworks prep */
-#define _PREP_IBM      0x00  /* ibm prep */
-#define _PREP_Bull     0x03  /* bull prep */
-#define _PREP_Radstone 0x04  /* Radstone Technology PLC prep */
-
-/*
- * Radstone board types
- */
-#define RS_SYS_TYPE_PPC1   0
-#define RS_SYS_TYPE_PPC2   1
-#define RS_SYS_TYPE_PPC1a  2
-#define RS_SYS_TYPE_PPC2a  3
-#define RS_SYS_TYPE_PPC4   4
-#define RS_SYS_TYPE_PPC4a  5
-#define RS_SYS_TYPE_PPC2ep 6
-
-/* these are arbitrary */
-#define _CHRP_Motorola 0x04  /* motorola chrp, the cobra */
-#define _CHRP_IBM      0x05  /* IBM chrp, the longtrail and longtrail 2 */
+#define SVR_8533       0x803400
+#define SVR_8533_E     0x803C00
+#define SVR_8540       0x803000
+#define SVR_8541       0x807200
+#define SVR_8541_E     0x807A00
+#define SVR_8543       0x803200
+#define SVR_8543_E     0x803A00
+#define SVR_8544       0x803401
+#define SVR_8544_E     0x803C01
+#define SVR_8545       0x803102
+#define SVR_8545_E     0x803902
+#define SVR_8547_E     0x803901
+#define SVR_8548       0x803100
+#define SVR_8548_E     0x803900
+#define SVR_8555       0x807100
+#define SVR_8555_E     0x807900
+#define SVR_8560       0x807000
+#define SVR_8567       0x807600
+#define SVR_8567_E     0x807E00
+#define SVR_8568       0x807500
+#define SVR_8568_E     0x807D00
+#define SVR_8572       0x80E000
+#define SVR_8572_E     0x80E800
+
+#define SVR_8610       0x80A000
+#define SVR_8641       0x809000
+#define SVR_8641D      0x809001
 
 #define _GLOBAL(n)\
        .globl n;\
@@ -1051,7 +1015,7 @@ struct thread_struct {
        struct pt_regs  *regs;          /* Pointer to saved register state */
        mm_segment_t    fs;             /* for get_fs() validation */
        void            *pgdir;         /* root of page-table tree */
-       signed long     last_syscall;
+       signed long     last_syscall;
        double          fpr[32];        /* Complete floating point set */
        unsigned long   fpscr_pad;      /* fpr ... fpscr must be contiguous */
        unsigned long   fpscr;          /* Floating point status */
@@ -1076,7 +1040,7 @@ struct thread_struct {
 
 /*
  * Note: the vm_start and vm_end fields here should *not*
- * be in kernel space.  (Could vm_end == vm_start perhaps?)
+ * be in kernel space. (Could vm_end == vm_start perhaps?)
  */
 #define INIT_MMAP { &init_mm, 0, 0x1000, NULL, \
                    PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, \
@@ -1106,7 +1070,7 @@ unsigned long get_wchan(struct task_struct *p);
 #define alloc_task_struct() \
        ((struct task_struct *) __get_free_pages(GFP_KERNEL,1))
 #define free_task_struct(p)    free_pages((unsigned long)(p),1)
-#define get_task_struct(tsk)      atomic_inc(&mem_map[MAP_NR(tsk)].count)
+#define get_task_struct(tsk)     atomic_inc(&mem_map[MAP_NR(tsk)].count)
 
 /* in process.c - for early bootup debug -- Cort */
 int ll_printk(const char *, ...);
index 7adf145..864391f 100644 (file)
@@ -44,6 +44,14 @@ typedef unsigned long long u64;
 /* DMA addresses are 32-bits wide */
 typedef u32 dma_addr_t;
 
+#ifdef CONFIG_PHYS_64BIT
+typedef unsigned long long phys_addr_t;
+typedef unsigned long long phys_size_t;
+#else
+typedef unsigned long phys_addr_t;
+typedef unsigned long phys_size_t;
+#endif
+
 #endif /* __KERNEL__ */
 #endif /* __ASSEMBLY__ */
 
diff --git a/include/asm-sh/cache.h b/include/asm-sh/cache.h
new file mode 100644 (file)
index 0000000..25b409b
--- /dev/null
@@ -0,0 +1,33 @@
+#ifndef __ASM_SH_CACHE_H
+#define __ASM_SH_CACHE_H
+
+#if defined(CONFIG_SH4) || defined(CONFIG_SH4A)
+
+#define L1_CACHE_BYTES 32
+struct __large_struct { unsigned long buf[100]; };
+#define __m(x) (*(struct __large_struct *)(x))
+
+void dcache_wback_range (u32 start, u32 end)
+{
+       u32 v;
+
+       start &= ~(L1_CACHE_BYTES - 1);
+       for (v = start; v < end; v += L1_CACHE_BYTES) {
+               asm volatile ("ocbwb     %0":   /* no output */
+                             :"m" (__m (v)));
+       }
+}
+
+void dcache_invalid_range (u32 start, u32 end)
+{
+       u32 v;
+
+       start &= ~(L1_CACHE_BYTES - 1);
+       for (v = start; v < end; v += L1_CACHE_BYTES) {
+               asm volatile ("ocbi     %0":    /* no output */
+                             :"m" (__m (v)));
+       }
+}
+#endif /* CONFIG_SH4 || CONFIG_SH4A */
+
+#endif /* __ASM_SH_CACHE_H */
index 2658039..c200ba5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2007 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+ * (C) Copyright 2007,2008 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
 #define CACHE_OC_NUM_ENTRIES   512
 #define CACHE_OC_ENTRY_SHIFT   5
 
-#if defined (CONFIG_CPU_SH7750)
-#include <asm/cpu_sh7750.h>
+#if defined (CONFIG_CPU_SH7750) || \
+       defined(CONFIG_CPU_SH7751)
+# include <asm/cpu_sh7750.h>
 #elif defined (CONFIG_CPU_SH7722)
-#include <asm/cpu_sh7722.h>
+# include <asm/cpu_sh7722.h>
+#elif defined (CONFIG_CPU_SH7780)
+# include <asm/cpu_sh7780.h>
 #else
-#error "Unknown SH4 variant"
+# error "Unknown SH4 variant"
 #endif
 
 #endif /* _ASM_CPU_SH4_H_ */
index bafb8de..1b393b8 100644 (file)
@@ -1,5 +1,9 @@
 /*
- * (C) Copyright 2007 Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
+ * Copyright 2007 (C)
+ * Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
+ *
+ * Copyright 2008 (C)
+ * Mark Jonas <mark.jonas@de.bosch.com>
  *
  * SH7720 Internal I/O register
  *
 #define PSELD          (PFC_BASE + 0x2A)
 
 /*     I/O Port        */
+#define PORT_BASE      0xA4050100
+#define PADR           (PORT_BASE + 0x40)
+#define PBDR           (PORT_BASE + 0x42)
+#define PCDR           (PORT_BASE + 0x44)
+#define PDDR           (PORT_BASE + 0x46)
+#define PEDR           (PORT_BASE + 0x48)
+#define PFDR           (PORT_BASE + 0x4A)
+#define PGDR           (PORT_BASE + 0x4C)
+#define PHDR           (PORT_BASE + 0x4E)
+#define PJDR           (PORT_BASE + 0x50)
+#define PKDR           (PORT_BASE + 0x52)
+#define PLDR           (PORT_BASE + 0x54)
+#define PMDR           (PORT_BASE + 0x56)
+#define PPDR           (PORT_BASE + 0x58)
+#define PRDR           (PORT_BASE + 0x5A)
+#define PSDR           (PORT_BASE + 0x5C)
+#define PTDR           (PORT_BASE + 0x5E)
+#define PUDR           (PORT_BASE + 0x60)
+#define PVDR           (PORT_BASE + 0x62)
 
 /*     H-UDI   */
 
index bb6461a..3c3c309 100644 (file)
 
 #ifdef CONFIG_CPU_TYPE_R
 #define CACHE_OC_NUM_WAYS     2
-#define CCR_CACHE_INIT   0x8000090d     /* EMODE,ICI,ICE(16k),OCI,P1-wb,OCE(32k) */
+#define CCR_CACHE_INIT   0x8000090D     /* EMODE,ICI,ICE(16k),OCI,P1-wb,OCE(32k) */
 #else
 #define CACHE_OC_NUM_WAYS     1
-#define CCR_CACHE_INIT   0x0000090b
+#define CCR_CACHE_INIT   0x0000090B
 #endif
 
 /*      OCN     */
diff --git a/include/asm-sh/cpu_sh7780.h b/include/asm-sh/cpu_sh7780.h
new file mode 100644 (file)
index 0000000..d4f824e
--- /dev/null
@@ -0,0 +1,503 @@
+#ifndef        _ASM_CPU_SH7780_H_
+#define        _ASM_CPU_SH7780_H_
+
+/*
+ * Copyright (c) 2007,2008 Nobuhiro Iwamatsu
+ * Copyright (c) 2008 Yusuke Goda <goda.yusuke@renesas.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
+ *
+ */
+
+#define        CACHE_OC_NUM_WAYS       1
+#define        CCR_CACHE_INIT          0x0000090b
+
+/*     Exceptions      */
+#define        TRA             0xFF000020
+#define        EXPEVT  0xFF000024
+#define        INTEVT  0xFF000028
+
+/* Memory Management Unit */
+#define        PTEH    0xFF000000
+#define        PTEL    0xFF000004
+#define        TTB             0xFF000008
+#define        TEA             0xFF00000C
+#define        MMUCR   0xFF000010
+#define        PASCR   0xFF000070
+#define        IRMCR   0xFF000078
+
+/* Cache Controller */
+#define        CCR             0xFF00001C
+#define        QACR0   0xFF000038
+#define        QACR1   0xFF00003C
+#define        RAMCR   0xFF000074
+
+/* L Memory    */
+#define        RAMCR   0xFF000074
+#define        LSA0    0xFF000050
+#define        LSA1    0xFF000054
+#define        LDA0    0xFF000058
+#define        LDA1    0xFF00005C
+
+/* Interrupt Controller */
+#define        ICR0            0xFFD00000
+#define        ICR1            0xFFD0001C
+#define        INTPRI          0xFFD00010
+#define        INTREQ          0xFFD00024
+#define        INTMSK0         0xFFD00044
+#define        INTMSK1         0xFFD00048
+#define        INTMSK2         0xFFD40080
+#define        INTMSKCLR0      0xFFD00064
+#define        INTMSKCLR1      0xFFD00068
+#define        INTMSKCLR2      0xFFD40084
+#define        NMIFCR          0xFFD000C0
+#define        USERIMASK       0xFFD30000
+#define        INT2PRI0        0xFFD40000
+#define        INT2PRI1        0xFFD40004
+#define        INT2PRI2        0xFFD40008
+#define        INT2PRI3        0xFFD4000C
+#define        INT2PRI4        0xFFD40010
+#define        INT2PRI5        0xFFD40014
+#define        INT2PRI6        0xFFD40018
+#define        INT2PRI7        0xFFD4001C
+#define        INT2A0          0xFFD40030
+#define        INT2A1          0xFFD40034
+#define        INT2MSKR        0xFFD40038
+#define        INT2MSKCR       0xFFD4003C
+#define        INT2B0          0xFFD40040
+#define        INT2B1          0xFFD40044
+#define        INT2B2          0xFFD40048
+#define        INT2B3          0xFFD4004C
+#define        INT2B4          0xFFD40050
+#define        INT2B5          0xFFD40054
+#define        INT2B6          0xFFD40058
+#define        INT2B7          0xFFD4005C
+#define        INT2GPIC        0xFFD40090
+
+/* local Bus State Controller */
+#define        MMSELR          0xFF400020
+#define        BCR                     0xFF801000
+#define        CS0BCR          0xFF802000
+#define        CS1BCR          0xFF802010
+#define        CS2BCR          0xFF802020
+#define        CS4BCR          0xFF802040
+#define        CS5BCR          0xFF802050
+#define        CS6BCR          0xFF802060
+#define        CS0WCR          0xFF802008
+#define        CS1WCR          0xFF802018
+#define        CS2WCR          0xFF802028
+#define        CS4WCR          0xFF802048
+#define        CS5WCR          0xFF802058
+#define        CS6WCR          0xFF802068
+#define        CS5PCR          0xFF802070
+#define        CS6PCR          0xFF802080
+
+/* DDR-SDRAM I/F */
+#define        MIM_1           0xFE800008
+#define        MIM_2           0xFE80000C
+#define        SCR_1           0xFE800010
+#define        SCR_2           0xFE800014
+#define        STR_1           0xFE800018
+#define        STR_2           0xFE80001C
+#define        SDR_1           0xFE800030
+#define        SDR_2           0xFE800034
+#define        DBK_1           0xFE800400
+#define        DBK_2           0xFE800404
+
+/* PCI Controller */
+#define        SH7780_PCIECR           0xFE000008
+#define        SH7780_PCIVID           0xFE040000
+#define        SH7780_PCIDID           0xFE040002
+#define        SH7780_PCICMD           0xFE040004
+#define        SH7780_PCISTATUS        0xFE040006
+#define        SH7780_PCIRID           0xFE040008
+#define        SH7780_PCIPIF           0xFE040009
+#define        SH7780_PCISUB           0xFE04000A
+#define        SH7780_PCIBCC           0xFE04000B
+#define        SH7780_PCICLS           0xFE04000C
+#define        SH7780_PCILTM           0xFE04000D
+#define        SH7780_PCIHDR           0xFE04000E
+#define        SH7780_PCIBIST          0xFE04000F
+#define        SH7780_PCIIBAR          0xFE040010
+#define        SH7780_PCIMBAR0         0xFE040014
+#define        SH7780_PCIMBAR1         0xFE040018
+#define        SH7780_PCISVID          0xFE04002C
+#define        SH7780_PCISID           0xFE04002E
+#define        SH7780_PCICP            0xFE040034
+#define        SH7780_PCIINTLINE       0xFE04003C
+#define        SH7780_PCIINTPIN        0xFE04003D
+#define        SH7780_PCIMINGNT        0xFE04003E
+#define        SH7780_PCIMAXLAT        0xFE04003F
+#define        SH7780_PCICID           0xFE040040
+#define        SH7780_PCINIP           0xFE040041
+#define        SH7780_PCIPMC           0xFE040042
+#define        SH7780_PCIPMCSR         0xFE040044
+#define        SH7780_PCIPMCSRBSE      0xFE040046
+#define        SH7780_PCI_CDD          0xFE040047
+#define        SH7780_PCICR            0xFE040100
+#define        SH7780_PCILSR0          0xFE040104
+#define        SH7780_PCILSR1          0xFE040108
+#define        SH7780_PCILAR0          0xFE04010C
+#define        SH7780_PCILAR1          0xFE040110
+#define        SH7780_PCIIR            0xFE040114
+#define        SH7780_PCIIMR           0xFE040118
+#define        SH7780_PCIAIR           0xFE04011C
+#define        SH7780_PCICIR           0xFE040120
+#define        SH7780_PCIAINT          0xFE040130
+#define        SH7780_PCIAINTM         0xFE040134
+#define        SH7780_PCIBMIR          0xFE040138
+#define        SH7780_PCIPAR           0xFE0401C0
+#define        SH7780_PCIPINT          0xFE0401CC
+#define        SH7780_PCIPINTM         0xFE0401D0
+#define        SH7780_PCIMBR0          0xFE0401E0
+#define        SH7780_PCIMBMR0         0xFE0401E4
+#define        SH7780_PCIMBR1          0xFE0401E8
+#define        SH7780_PCIMBMR1         0xFE0401EC
+#define        SH7780_PCIMBR2          0xFE0401F0
+#define        SH7780_PCIMBMR2         0xFE0401F4
+#define        SH7780_PCIIOBR          0xFE0401F8
+#define        SH7780_PCIIOBMR         0xFE0401FC
+#define        SH7780_PCICSCR0         0xFE040210
+#define        SH7780_PCICSCR1         0xFE040214
+#define        SH7780_PCICSAR0         0xFE040218
+#define        SH7780_PCICSAR1         0xFE04021C
+#define        SH7780_PCIPDR           0xFE040220
+
+/* DMAC */
+#define        DMAC_SAR0       0xFC808020
+#define        DMAC_DAR0       0xFC808024
+#define        DMAC_TCR0       0xFC808028
+#define        DMAC_CHCR0      0xFC80802C
+#define        DMAC_SAR1       0xFC808030
+#define        DMAC_DAR1       0xFC808034
+#define        DMAC_TCR1       0xFC808038
+#define        DMAC_CHCR1      0xFC80803C
+#define        DMAC_SAR2       0xFC808040
+#define        DMAC_DAR2       0xFC808044
+#define        DMAC_TCR2       0xFC808048
+#define        DMAC_CHCR2      0xFC80804C
+#define        DMAC_SAR3       0xFC808050
+#define        DMAC_DAR3       0xFC808054
+#define        DMAC_TCR3       0xFC808058
+#define        DMAC_CHCR3      0xFC80805C
+#define        DMAC_DMAOR0     0xFC808060
+#define        DMAC_SAR4       0xFC808070
+#define        DMAC_DAR4       0xFC808074
+#define        DMAC_TCR4       0xFC808078
+#define        DMAC_CHCR4      0xFC80807C
+#define        DMAC_SAR5       0xFC808080
+#define        DMAC_DAR5       0xFC808084
+#define        DMAC_TCR5       0xFC808088
+#define        DMAC_CHCR5      0xFC80808C
+#define        DMAC_SARB0      0xFC808120
+#define        DMAC_DARB0      0xFC808124
+#define        DMAC_TCRB0      0xFC808128
+#define        DMAC_SARB1      0xFC808130
+#define        DMAC_DARB1      0xFC808134
+#define        DMAC_TCRB1      0xFC808138
+#define        DMAC_SARB2      0xFC808140
+#define        DMAC_DARB2      0xFC808144
+#define        DMAC_TCRB2      0xFC808148
+#define        DMAC_SARB3      0xFC808150
+#define        DMAC_DARB3      0xFC808154
+#define        DMAC_TCRB3      0xFC808158
+#define        DMAC_DMARS0     0xFC809000
+#define        DMAC_DMARS1     0xFC809004
+#define        DMAC_DMARS2     0xFC809008
+#define        DMAC_SAR6       0xFC818020
+#define        DMAC_DAR6       0xFC818024
+#define        DMAC_TCR6       0xFC818028
+#define        DMAC_CHCR6      0xFC81802C
+#define        DMAC_SAR7       0xFC818030
+#define        DMAC_DAR7       0xFC818034
+#define        DMAC_TCR7       0xFC818038
+#define        DMAC_CHCR7      0xFC81803C
+#define        DMAC_SAR8       0xFC818040
+#define        DMAC_DAR8       0xFC818044
+#define        DMAC_TCR8       0xFC818048
+#define        DMAC_CHCR8      0xFC81804C
+#define        DMAC_SAR9       0xFC818050
+#define        DMAC_DAR9       0xFC818054
+#define        DMAC_TCR9       0xFC818058
+#define        DMAC_CHCR9      0xFC81805C
+#define        DMAC_DMAOR1     0xFC818060
+#define        DMAC_SAR10      0xFC818070
+#define        DMAC_DAR10      0xFC818074
+#define        DMAC_TCR10      0xFC818078
+#define        DMAC_CHCR10     0xFC81807C
+#define        DMAC_SAR11      0xFC818080
+#define        DMAC_DAR11      0xFC818084
+#define        DMAC_TCR11      0xFC818088
+#define        DMAC_CHCR11     0xFC81808C
+#define        DMAC_SARB6      0xFC818120
+#define        DMAC_DARB6      0xFC818124
+#define        DMAC_TCRB6      0xFC818128
+#define        DMAC_SARB7      0xFC818130
+#define        DMAC_DARB7      0xFC818134
+#define        DMAC_TCRB7      0xFC818138
+#define        DMAC_SARB8      0xFC818140
+#define        DMAC_DARB8      0xFC818144
+#define        DMAC_TCRB8      0xFC818148
+#define        DMAC_SARB9      0xFC818150
+#define        DMAC_DARB9      0xFC818154
+#define        DMAC_TCRB9      0xFC818158
+
+/* Clock Pulse Generator */
+#define        FRQCR   0xFFC80000
+#define        PLLCR   0xFFC80024
+#define        MSTPCR  0xFFC80030
+
+/* Watchdog Timer and Reset */
+#define        WTCNT   WDTCNT
+#define        WDTST   0xFFCC0000
+#define        WDTCSR  0xFFCC0004
+#define        WDTBST  0xFFCC0008
+#define        WDTCNT  0xFFCC0010
+#define        WDTBCNT 0xFFCC0018
+
+/* System Control */
+#define        MSTPCR  0xFFC80030
+
+/* Timer Unit */
+#define        TSTR    TSTR0
+#define        TOCR    0xFFD80000
+#define        TSTR0   0xFFD80004
+#define        TCOR0   0xFFD80008
+#define        TCNT0   0xFFD8000C
+#define        TCR0    0xFFD80010
+#define        TCOR1   0xFFD80014
+#define        TCNT1   0xFFD80018
+#define        TCR1    0xFFD8001C
+#define        TCOR2   0xFFD80020
+#define        TCNT2   0xFFD80024
+#define        TCR2    0xFFD80028
+#define        TCPR2   0xFFD8002C
+#define        TSTR1   0xFFDC0004
+#define        TCOR3   0xFFDC0008
+#define        TCNT3   0xFFDC000C
+#define        TCR3    0xFFDC0010
+#define        TCOR4   0xFFDC0014
+#define        TCNT4   0xFFDC0018
+#define        TCR4    0xFFDC001C
+#define        TCOR5   0xFFDC0020
+#define        TCNT5   0xFFDC0024
+#define        TCR5    0xFFDC0028
+
+/* Timer/Counter */
+#define        CMTCFG  0xFFE30000
+#define        CMTFRT  0xFFE30004
+#define        CMTCTL  0xFFE30008
+#define        CMTIRQS 0xFFE3000C
+#define        CMTCH0T 0xFFE30010
+#define        CMTCH0ST        0xFFE30020
+#define        CMTCH0C 0xFFE30030
+#define        CMTCH1T 0xFFE30014
+#define        CMTCH1ST        0xFFE30024
+#define        CMTCH1C 0xFFE30034
+#define        CMTCH2T 0xFFE30018
+#define        CMTCH2C 0xFFE30038
+#define        CMTCH3T 0xFFE3001C
+#define        CMTCH3C 0xFFE3003C
+
+/* Realtime Clock */
+#define        R64CNT  0xFFE80000
+#define        RSECCNT 0xFFE80004
+#define        RMINCNT 0xFFE80008
+#define        RHRCNT  0xFFE8000C
+#define        RWKCNT  0xFFE80010
+#define        RDAYCNT 0xFFE80014
+#define        RMONCNT 0xFFE80018
+#define        RYRCNT  0xFFE8001C
+#define        RSECAR  0xFFE80020
+#define        RMINAR  0xFFE80024
+#define        RHRAR   0xFFE80028
+#define        RWKAR   0xFFE8002C
+#define        RDAYAR  0xFFE80030
+#define        RMONAR  0xFFE80034
+#define        RCR1    0xFFE80038
+#define        RCR2    0xFFE8003C
+#define        RCR3    0xFFE80050
+#define        RYRAR   0xFFE80054
+
+/* Serial Communication        Interface with FIFO */
+#define        SCIF0_BASE SCSMR0
+#define        SCSMR0  0xFFE00000
+#define        SCBRR0  0xFFE00004
+#define        SCSCR0  0xFFE00008
+#define        SCFSR0  0xFFE00010
+#define        SCFCR0  0xFFE00018
+#define        SCTFDR0 0xFFE0001C
+#define        SCRFDR0 0xFFE00020
+#define        SCSPTR0 0xFFE00024
+#define        SCLSR0  0xFFE00028
+#define        SCRER0  0xFFE0002C
+#define        SCSMR1  0xFFE10000
+#define        SCBRR1  0xFFE10004
+#define        SCSCR1  0xFFE10008
+#define        SCFSR1  0xFFE10010
+#define        SCFCR1  0xFFE10018
+#define        SCTFDR1 0xFFE1001C
+#define        SCRFDR1 0xFFE10020
+#define        SCSPTR1 0xFFE10024
+#define        SCLSR1  0xFFE10028
+#define        SCRER1  0xFFE1002C
+
+/* Serial I/O with FIFO */
+#define        SIMDR   0xFFE20000
+#define        SISCR   0xFFE20002
+#define        SITDAR  0xFFE20004
+#define        SIRDAR  0xFFE20006
+#define        SICDAR  0xFFE20008
+#define        SICTR   0xFFE2000C
+#define        SIFCTR  0xFFE20010
+#define        SISTR   0xFFE20014
+#define        SIIER   0xFFE20016
+#define        SITCR   0xFFE20028
+#define        SIRCR   0xFFE2002C
+#define        SPICR   0xFFE20030
+
+/* Serial Protocol Interface */
+#define        SPCR    0xFFE50000
+#define        SPSR    0xFFE50004
+#define        SPSCR   0xFFE50008
+#define        SPTBR   0xFFE5000C
+#define        SPRBR   0xFFE50010
+
+/* Multimedia Card Interface */
+#define        CMDR0   0xFFE60000
+#define        CMDR1   0xFFE60001
+#define        CMDR2   0xFFE60002
+#define        CMDR3   0xFFE60003
+#define        CMDR4   0xFFE60004
+#define        CMDR5   0xFFE60005
+#define        CMDSTRT 0xFFE60006
+#define        OPCR    0xFFE6000A
+#define        CSTR    0xFFE6000B
+#define        INTCR0  0xFFE6000C
+#define        INTCR1  0xFFE6000D
+#define        INTSTR0 0xFFE6000E
+#define        INTSTR1 0xFFE6000F
+#define        CLKON   0xFFE60010
+#define        CTOCR   0xFFE60011
+#define        TBCR    0xFFE60014
+#define        MODER   0xFFE60016
+#define        CMDTYR  0xFFE60018
+#define        RSPTYR  0xFFE60019
+#define        TBNCR   0xFFE6001A
+#define        RSPR0   0xFFE60020
+#define        RSPR1   0xFFE60021
+#define        RSPR2   0xFFE60022
+#define        RSPR3   0xFFE60023
+#define        RSPR4   0xFFE60024
+#define        RSPR5   0xFFE60025
+#define        RSPR6   0xFFE60026
+#define        RSPR7   0xFFE60027
+#define        RSPR8   0xFFE60028
+#define        RSPR9   0xFFE60029
+#define        RSPR10  0xFFE6002A
+#define        RSPR11  0xFFE6002B
+#define        RSPR12  0xFFE6002C
+#define        RSPR13  0xFFE6002D
+#define        RSPR14  0xFFE6002E
+#define        RSPR15  0xFFE6002F
+#define        RSPR16  0xFFE60030
+#define        RSPRD   0xFFE60031
+#define        DTOUTR  0xFFE60032
+#define        DR              0xFFE60040
+#define        DMACR   0xFFE60044
+#define        INTCR2  0xFFE60046
+#define        INTSTR2 0xFFE60048
+
+/* Audio Codec Interface */
+#define        HACCR   0xFFE40008
+#define        HACCSAR 0xFFE40020
+#define        HACCSDR 0xFFE40024
+#define        HACPCML 0xFFE40028
+#define        HACPCMR 0xFFE4002C
+#define        HACTIER 0xFFE40050
+#define        HACTSR  0xFFE40054
+#define        HACRIER 0xFFE40058
+#define        HACRSR  0xFFE4005C
+#define        HACACR  0xFFE40060
+
+/* Serial Sound Interface */
+#define        SSICR   0xFFE70000
+#define        SSISR   0xFFE70004
+#define        SSITDR  0xFFE70008
+#define        SSIRDR  0xFFE7000C
+
+/* Flash memory Controller */
+#define        FLCMNCR 0xFFE90000
+#define        FLCMDCR 0xFFE90004
+#define        FLCMCDR 0xFFE90008
+#define        FLADR   0xFFE9000C
+#define        FLDATAR 0xFFE90010
+#define        FLDTCNTR        0xFFE90014
+#define        FLINTDMACR      0xFFE90018
+#define        FLBSYTMR        0xFFE9001C
+#define        FLBSYCNT        0xFFE90020
+#define        FLTRCR  0xFFE9002C
+
+/* General     Purpose I/O */
+#define        PACR    0xFFEA0000
+#define        PBCR    0xFFEA0002
+#define        PCCR    0xFFEA0004
+#define        PDCR    0xFFEA0006
+#define        PECR    0xFFEA0008
+#define        PFCR    0xFFEA000A
+#define        PGCR    0xFFEA000C
+#define        PHCR    0xFFEA000E
+#define        PJCR    0xFFEA0010
+#define        PKCR    0xFFEA0012
+#define        PLCR    0xFFEA0014
+#define        PMCR    0xFFEA0016
+#define        PADR    0xFFEA0020
+#define        PBDR    0xFFEA0022
+#define        PCDR    0xFFEA0024
+#define        PDDR    0xFFEA0026
+#define        PEDR    0xFFEA0028
+#define        PFDR    0xFFEA002A
+#define        PGDR    0xFFEA002C
+#define        PHDR    0xFFEA002E
+#define        PJDR    0xFFEA0030
+#define        PKDR    0xFFEA0032
+#define        PLDR    0xFFEA0034
+#define        PMDR    0xFFEA0036
+#define        PEPUPR  0xFFEA0048
+#define        PHPUPR  0xFFEA004E
+#define        PJPUPR  0xFFEA0050
+#define        PKPUPR  0xFFEA0052
+#define        PMPUPR  0xFFEA0056
+#define        PPUPR1  0xFFEA0060
+#define        PPUPR2  0xFFEA0062
+#define        PMSELR  0xFFEA0080
+
+/* User        Break Controller */
+#define        CBR0    0xFF200000
+#define        CRR0    0xFF200004
+#define        CAR0    0xFF200008
+#define        CAMR0   0xFF20000C
+#define        CBR1    0xFF200020
+#define        CRR1    0xFF200024
+#define        CAR1    0xFF200028
+#define        CAMR1   0xFF20002C
+#define        CDR1    0xFF200030
+#define        CDMR1   0xFF200034
+#define        CETR1   0xFF200038
+#define        CCMFR   0xFF200600
+#define        CBCR    0xFF200620
+
+#endif /* _ASM_CPU_SH7780_H_ */
index 51fd10b..7400293 100644 (file)
@@ -233,8 +233,6 @@ static inline void sync(void)
  * that can be used to access the memory range with the caching
  * properties specified by "flags".
  */
-typedef unsigned long phys_addr_t;
-
 #define MAP_NOCACHE     (0)
 #define MAP_WRCOMBINE   (0)
 #define MAP_WRBACK      (0)
diff --git a/include/asm-sh/pci.h b/include/asm-sh/pci.h
new file mode 100644 (file)
index 0000000..bc59491
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * SH4 PCI Controller (PCIC) for U-Boot.
+ * (C) Dustin McIntire (dustin@sensoria.com)
+ * (C) 2007,2008 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+ * (C) 2008 Yusuke Goda <goda.yusuke@renesas.com>
+ *
+ * u-boot/include/asm-sh/pci.h
+ *
+ * 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 _ASM_PCI_H_
+#define _ASM_PCI_H_
+
+#include <pci.h>
+#if defined(CONFIG_SH7751_PCI)
+int pci_sh7751_init(struct pci_controller *hose);
+#elif defined(CONFIG_SH7780_PCI)
+int pci_sh7780_init(struct pci_controller *hose);
+#else
+#error "Not support PCI."
+#endif
+
+/* PCI dword read for sh4 */
+int pci_sh4_read_config_dword(struct pci_controller *hose,
+               pci_dev_t dev, int offset, u32 *value);
+
+/* PCI dword write for sh4 */
+int pci_sh4_write_config_dword(struct pci_controller *hose,
+               pci_dev_t dev, int offset, u32 value);
+
+#endif /* _ASM_PCI_H_ */
index bb9a35f..388aa69 100644 (file)
@@ -2,7 +2,8 @@
 #define _ASM_SH_PROCESSOR_H_
 #if defined CONFIG_SH3
 # include <asm/cpu_sh3.h>
-#elif defined (CONFIG_SH4)
+#elif defined (CONFIG_SH4) || \
+       defined (CONFIG_SH4A)
 # include <asm/cpu_sh4.h>
 #endif
 #endif
index 7ba69d9..aed4a6e 100644 (file)
@@ -52,6 +52,9 @@ typedef unsigned long long u64;
 
 typedef u32 dma_addr_t;
 
+typedef unsigned long phys_addr_t;
+typedef unsigned long phys_size_t;
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* __KERNEL__ */
diff --git a/include/asm-sparc/arch-leon2/asi.h b/include/asm-sparc/arch-leon2/asi.h
new file mode 100644 (file)
index 0000000..38fdd5c
--- /dev/null
@@ -0,0 +1,36 @@
+/* asi.h:  Address Space Identifier values for the LEON2 sparc.
+ *
+ * Copyright (C) 2008 Daniel Hellstrom (daniel@gaisler.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 _LEON2_ASI_H
+#define _LEON2_ASI_H
+
+#define ASI_CACHEMISS          0x01    /* Force D-Cache miss on load (lda) */
+#define ASI_M_FLUSH_PROBE      0x03    /* MMU Flush/Probe */
+#define ASI_IFLUSH             0x05    /* Flush I-Cache */
+#define ASI_DFLUSH             0x06    /* Flush D-Cache */
+#define ASI_BYPASS             0x1c    /* Bypass MMU (Physical address) */
+#define ASI_MMUFLUSH           0x18    /* FLUSH TLB */
+#define ASI_M_MMUREGS          0x19    /* READ/Write MMU Registers */
+
+#endif /* _LEON2_ASI_H */
diff --git a/include/asm-sparc/arch-leon3/asi.h b/include/asm-sparc/arch-leon3/asi.h
new file mode 100644 (file)
index 0000000..700b3ca
--- /dev/null
@@ -0,0 +1,36 @@
+/* asi.h:  Address Space Identifier values for the LEON3 sparc.
+ *
+ * Copyright (C) 2008 Daniel Hellstrom (daniel@gaisler.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 _LEON3_ASI_H
+#define _LEON3_ASI_H
+
+#define ASI_CACHEMISS          0x01    /* Force D-Cache miss on load (lda) */
+#define ASI_M_FLUSH_PROBE      0x03    /* MMU Flush/Probe */
+#define ASI_IFLUSH             0x10    /* Flush I-Cache */
+#define ASI_DFLUSH             0x11    /* Flush D-Cache */
+#define ASI_BYPASS             0x1c    /* Bypass MMU (Physical address) */
+#define ASI_MMUFLUSH           0x18    /* FLUSH TLB */
+#define ASI_M_MMUREGS          0x19    /* READ/Write MMU Registers */
+
+#endif /* _LEON3_ASI_H */
diff --git a/include/asm-sparc/asi.h b/include/asm-sparc/asi.h
new file mode 100644 (file)
index 0000000..bf6d70f
--- /dev/null
@@ -0,0 +1,32 @@
+/* Address Space Identifier (ASI) values for sparc processors.
+ *
+ * (C) Copyright 2008
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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 _SPARC_ASI_H
+#define _SPARC_ASI_H
+
+/* ASI numbers are processor implementation specific */
+#include <asm/arch/asi.h>
+
+#endif /* _SPARC_ASI_H */
diff --git a/include/asm-sparc/asmmacro.h b/include/asm-sparc/asmmacro.h
new file mode 100644 (file)
index 0000000..0c4cefd
--- /dev/null
@@ -0,0 +1,45 @@
+/* Assembler macros for SPARC
+ *
+ * (C) Copyright 2007, taken from linux asm-sparc/asmmacro.h
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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 __SPARC_ASMMACRO_H__
+#define __SPARC_ASMMACRO_H__
+
+#include <config.h>
+
+/* All trap entry points _must_ begin with this macro or else you
+ * lose.  It makes sure the kernel has a proper window so that
+ * c-code can be called.
+ */
+#define SAVE_ALL_HEAD \
+       sethi   %hi(trap_setup+(CFG_RELOC_MONITOR_BASE-TEXT_BASE)), %l4; \
+       jmpl    %l4 + %lo(trap_setup+(CFG_RELOC_MONITOR_BASE-TEXT_BASE)), %l6;
+#define SAVE_ALL \
+       SAVE_ALL_HEAD \
+       nop;
+
+/* All traps low-level code here must end with this macro. */
+#define RESTORE_ALL b ret_trap_entry; clr %l6;
+
+#endif
diff --git a/include/asm-sparc/atomic.h b/include/asm-sparc/atomic.h
new file mode 100644 (file)
index 0000000..636498d
--- /dev/null
@@ -0,0 +1,29 @@
+/* SPARC atomic operations
+ *
+ * (C) Copyright 2008
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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 _ASM_SPARC_ATOMIC_H_
+#define _ASM_SPARC_ATOMIC_H_
+
+#endif /* _ASM_SPARC_ATOMIC_H_ */
diff --git a/include/asm-sparc/bitops.h b/include/asm-sparc/bitops.h
new file mode 100644 (file)
index 0000000..ceb39f2
--- /dev/null
@@ -0,0 +1,29 @@
+/* Bit string operations on the SPARC
+ *
+ * (C) Copyright 2007, taken from asm-ppc/bitops.h
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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 _SPARC_BITOPS_H
+#define _SPARC_BITOPS_H
+
+#endif                         /* _SPARC_BITOPS_H */
diff --git a/include/asm-sparc/byteorder.h b/include/asm-sparc/byteorder.h
new file mode 100644 (file)
index 0000000..b9fc656
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * (C) Copyright 2002
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * (C) Copyright 2008
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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 _SPARC_BYTEORDER_H
+#define _SPARC_BYTEORDER_H
+
+#include <asm/types.h>
+
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+#define __BYTEORDER_HAS_U64__
+#endif
+#include <linux/byteorder/big_endian.h>
+#endif                         /* _SPARC_BYTEORDER_H */
similarity index 68%
rename from cpu/bf537/start1.S
rename to include/asm-sparc/cache.h
index 6d4731b..03e8d94 100644 (file)
@@ -1,7 +1,6 @@
 /*
- * U-boot - start1.S Code running out of RAM after relocation
- *
- * Copyright (c) 2005-2007 Analog Devices Inc.
+ * (C) Copyright 2008,
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.com.
  *
  * See file CREDITS for list of people who contributed to this
  * project.
  *
  * 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
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
  */
 
-#define ASSEMBLY
-#include <linux/config.h>
-#include <config.h>
-#include <asm/blackfin.h>
+#ifndef __SPARC_CACHE_H__
+#define __SPARC_CACHE_H__
 
-.global        start1;
-.global        _start1;
+#include <linux/config.h>
+#include <asm/processor.h>
 
-.text
-_start1:
-start1:
-       sp += -12;
-       call    _board_init_f;
-       sp += 12;
+#endif
diff --git a/include/asm-sparc/errno.h b/include/asm-sparc/errno.h
new file mode 100644 (file)
index 0000000..3a74f6f
--- /dev/null
@@ -0,0 +1,162 @@
+/* SPARC errno definitions, taken from asm-ppc/errno.h
+ *
+ * (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
+ */
+
+#ifndef __SPARC_ERRNO_H__
+#define __SPARC_ERRNO_H__
+
+#define        EPERM            1      /* Operation not permitted */
+#define        ENOENT           2      /* No such file or directory */
+#define        ESRCH            3      /* No such process */
+#define        EINTR            4      /* Interrupted system call */
+#define        EIO              5      /* I/O error */
+#define        ENXIO            6      /* No such device or address */
+#define        E2BIG            7      /* Arg list too long */
+#define        ENOEXEC          8      /* Exec format error */
+#define        EBADF            9      /* Bad file number */
+#define        ECHILD          10      /* No child processes */
+#define        EAGAIN          11      /* Try again */
+#define        ENOMEM          12      /* Out of memory */
+#define        EACCES          13      /* Permission denied */
+#define        EFAULT          14      /* Bad address */
+#define        ENOTBLK         15      /* Block device required */
+#define        EBUSY           16      /* Device or resource busy */
+#define        EEXIST          17      /* File exists */
+#define        EXDEV           18      /* Cross-device link */
+#define        ENODEV          19      /* No such device */
+#define        ENOTDIR         20      /* Not a directory */
+#define        EISDIR          21      /* Is a directory */
+#define        EINVAL          22      /* Invalid argument */
+#define        ENFILE          23      /* File table overflow */
+#define        EMFILE          24      /* Too many open files */
+#define        ENOTTY          25      /* Not a typewriter */
+#define        ETXTBSY         26      /* Text file busy */
+#define        EFBIG           27      /* File too large */
+#define        ENOSPC          28      /* No space left on device */
+#define        ESPIPE          29      /* Illegal seek */
+#define        EROFS           30      /* Read-only file system */
+#define        EMLINK          31      /* Too many links */
+#define        EPIPE           32      /* Broken pipe */
+#define        EDOM            33      /* Math argument out of domain of func */
+#define        ERANGE          34      /* Math result not representable */
+#define        EDEADLK         35      /* Resource deadlock would occur */
+#define        ENAMETOOLONG    36      /* File name too long */
+#define        ENOLCK          37      /* No record locks available */
+#define        ENOSYS          38      /* Function not implemented */
+#define        ENOTEMPTY       39      /* Directory not empty */
+#define        ELOOP           40      /* Too many symbolic links encountered */
+#define        EWOULDBLOCK     EAGAIN  /* Operation would block */
+#define        ENOMSG          42      /* No message of desired type */
+#define        EIDRM           43      /* Identifier removed */
+#define        ECHRNG          44      /* Channel number out of range */
+#define        EL2NSYNC        45      /* Level 2 not synchronized */
+#define        EL3HLT          46      /* Level 3 halted */
+#define        EL3RST          47      /* Level 3 reset */
+#define        ELNRNG          48      /* Link number out of range */
+#define        EUNATCH         49      /* Protocol driver not attached */
+#define        ENOCSI          50      /* No CSI structure available */
+#define        EL2HLT          51      /* Level 2 halted */
+#define        EBADE           52      /* Invalid exchange */
+#define        EBADR           53      /* Invalid request descriptor */
+#define        EXFULL          54      /* Exchange full */
+#define        ENOANO          55      /* No anode */
+#define        EBADRQC         56      /* Invalid request code */
+#define        EBADSLT         57      /* Invalid slot */
+#define        EDEADLOCK       58      /* File locking deadlock error */
+#define        EBFONT          59      /* Bad font file format */
+#define        ENOSTR          60      /* Device not a stream */
+#define        ENODATA         61      /* No data available */
+#define        ETIME           62      /* Timer expired */
+#define        ENOSR           63      /* Out of streams resources */
+#define        ENONET          64      /* Machine is not on the network */
+#define        ENOPKG          65      /* Package not installed */
+#define        EREMOTE         66      /* Object is remote */
+#define        ENOLINK         67      /* Link has been severed */
+#define        EADV            68      /* Advertise error */
+#define        ESRMNT          69      /* Srmount error */
+#define        ECOMM           70      /* Communication error on send */
+#define        EPROTO          71      /* Protocol error */
+#define        EMULTIHOP       72      /* Multihop attempted */
+#define        EDOTDOT         73      /* RFS specific error */
+#define        EBADMSG         74      /* Not a data message */
+#define        EOVERFLOW       75      /* Value too large for defined data type */
+#define        ENOTUNIQ        76      /* Name not unique on network */
+#define        EBADFD          77      /* File descriptor in bad state */
+#define        EREMCHG         78      /* Remote address changed */
+#define        ELIBACC         79      /* Can not access a needed shared library */
+#define        ELIBBAD         80      /* Accessing a corrupted shared library */
+#define        ELIBSCN         81      /* .lib section in a.out corrupted */
+#define        ELIBMAX         82      /* Attempting to link in too many shared libraries */
+#define        ELIBEXEC        83      /* Cannot exec a shared library directly */
+#define        EILSEQ          84      /* Illegal byte sequence */
+#define        ERESTART        85      /* Interrupted system call should be restarted */
+#define        ESTRPIPE        86      /* Streams pipe error */
+#define        EUSERS          87      /* Too many users */
+#define        ENOTSOCK        88      /* Socket operation on non-socket */
+#define        EDESTADDRREQ    89      /* Destination address required */
+#define        EMSGSIZE        90      /* Message too long */
+#define        EPROTOTYPE      91      /* Protocol wrong type for socket */
+#define        ENOPROTOOPT     92      /* Protocol not available */
+#define        EPROTONOSUPPORT 93      /* Protocol not supported */
+#define        ESOCKTNOSUPPORT 94      /* Socket type not supported */
+#define        EOPNOTSUPP      95      /* Operation not supported on transport endpoint */
+#define        EPFNOSUPPORT    96      /* Protocol family not supported */
+#define        EAFNOSUPPORT    97      /* Address family not supported by protocol */
+#define        EADDRINUSE      98      /* Address already in use */
+#define        EADDRNOTAVAIL   99      /* Cannot assign requested address */
+#define        ENETDOWN        100     /* Network is down */
+#define        ENETUNREACH     101     /* Network is unreachable */
+#define        ENETRESET       102     /* Network dropped connection because of reset */
+#define        ECONNABORTED    103     /* Software caused connection abort */
+#define        ECONNRESET      104     /* Connection reset by peer */
+#define        ENOBUFS         105     /* No buffer space available */
+#define        EISCONN         106     /* Transport endpoint is already connected */
+#define        ENOTCONN        107     /* Transport endpoint is not connected */
+#define        ESHUTDOWN       108     /* Cannot send after transport endpoint shutdown */
+#define        ETOOMANYREFS    109     /* Too many references: cannot splice */
+#define        ETIMEDOUT       110     /* Connection timed out */
+#define        ECONNREFUSED    111     /* Connection refused */
+#define        EHOSTDOWN       112     /* Host is down */
+#define        EHOSTUNREACH    113     /* No route to host */
+#define        EALREADY        114     /* Operation already in progress */
+#define        EINPROGRESS     115     /* Operation now in progress */
+#define        ESTALE          116     /* Stale NFS file handle */
+#define        EUCLEAN         117     /* Structure needs cleaning */
+#define        ENOTNAM         118     /* Not a XENIX named type file */
+#define        ENAVAIL         119     /* No XENIX semaphores available */
+#define        EISNAM          120     /* Is a named type file */
+#define        EREMOTEIO       121     /* Remote I/O error */
+#define        EDQUOT          122     /* Quota exceeded */
+
+#define        ENOMEDIUM       123     /* No medium found */
+#define        EMEDIUMTYPE     124     /* Wrong medium type */
+
+/* Should never be seen by user programs */
+#define ERESTARTSYS    512
+#define ERESTARTNOINTR 513
+#define ERESTARTNOHAND 514     /* restart if no handler.. */
+#define ENOIOCTLCMD    515     /* No ioctl command */
+
+#define _LAST_ERRNO    515
+
+#endif
diff --git a/include/asm-sparc/global_data.h b/include/asm-sparc/global_data.h
new file mode 100644 (file)
index 0000000..7c29fc6
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ * (C) Copyright 2002
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * (C) Copyright 2007
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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        __ASM_GBL_DATA_H
+#define __ASM_GBL_DATA_H
+
+#include "asm/types.h"
+
+/*
+ * The following data structure is placed in some memory wich is
+ * available very early after boot (like DPRAM on MPC8xx/MPC82xx, or
+ * some locked parts of the data cache) to allow for a minimum set of
+ * global variables during system initialization (until we have set
+ * up the memory controller so that we can use RAM).
+ *
+ * Keep it *SMALL* and remember to set CFG_GBL_DATA_SIZE > sizeof(gd_t)
+ */
+
+typedef struct global_data {
+       bd_t *bd;
+       unsigned long flags;
+       unsigned long baudrate;
+       unsigned long cpu_clk;  /* CPU clock in Hz!             */
+       unsigned long bus_clk;
+
+       unsigned long ram_size; /* RAM size */
+       unsigned long reloc_off;        /* Relocation Offset */
+       unsigned long reset_status;     /* reset status register at boot        */
+       unsigned long env_addr; /* Address  of Environment struct       */
+       unsigned long env_valid;        /* Checksum of Environment valid?       */
+       unsigned long have_console;     /* serial_init() was called */
+
+#if defined(CONFIG_LCD) || defined(CONFIG_VIDEO)
+       unsigned long fb_base;  /* Base address of framebuffer memory   */
+#endif
+#if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
+       unsigned long post_log_word;    /* Record POST activities */
+       unsigned long post_init_f_time; /* When post_init_f started */
+#endif
+#ifdef CONFIG_BOARD_TYPES
+       unsigned long board_type;
+#endif
+#ifdef CONFIG_MODEM_SUPPORT
+       unsigned long do_mdm_init;
+       unsigned long be_quiet;
+#endif
+#ifdef CONFIG_LWMON
+       unsigned long kbd_status;
+#endif
+       void **jt;              /* jump table */
+} gd_t;
+
+/*
+ * Global Data Flags
+ */
+#define        GD_FLG_RELOC    0x00001 /* Code was relocated to RAM            */
+#define        GD_FLG_DEVINIT  0x00002 /* Devices have been initialized        */
+#define        GD_FLG_SILENT   0x00004 /* Silent mode                          */
+
+#define DECLARE_GLOBAL_DATA_PTR     register volatile gd_t *gd asm ("%g7")
+
+#endif                         /* __ASM_GBL_DATA_H */
diff --git a/include/asm-sparc/io.h b/include/asm-sparc/io.h
new file mode 100644 (file)
index 0000000..2a27d06
--- /dev/null
@@ -0,0 +1,94 @@
+/* SPARC I/O definitions
+ *
+ * (C) Copyright 2007
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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 _SPARC_IO_H
+#define _SPARC_IO_H
+
+/* Nothing to sync, total store ordering (TSO)... */
+#define sync()
+
+/* Forces a cache miss on read/load.
+ * On some architectures we need to bypass the cache when reading
+ * I/O registers so that we are not reading the same status word
+ * over and over again resulting in a hang (until an IRQ if lucky)
+ *
+ */
+#ifndef CFG_HAS_NO_CACHE
+#define READ_BYTE(var)  SPARC_NOCACHE_READ_BYTE((unsigned int)(var))
+#define READ_HWORD(var) SPARC_NOCACHE_READ_HWORD((unsigned int)(var))
+#define READ_WORD(var)  SPARC_NOCACHE_READ((unsigned int)(var))
+#define READ_DWORD(var) SPARC_NOCACHE_READ_DWORD((unsigned int)(var))
+#else
+#define READ_BYTE(var)  (var)
+#define READ_HWORD(var) (var)
+#define READ_WORD(var)  (var)
+#define READ_DWORD(var) (var)
+#endif
+
+/*
+ * Generic virtual read/write.
+ */
+#define __arch_getb(a)                 (READ_BYTE(a))
+#define __arch_getw(a)                 (READ_HWORD(a))
+#define __arch_getl(a)                 (READ_WORD(a))
+#define __arch_getq(a)                 (READ_DWORD(a))
+
+#define __arch_putb(v,a)               (*(volatile unsigned char *)(a) = (v))
+#define __arch_putw(v,a)               (*(volatile unsigned short *)(a) = (v))
+#define __arch_putl(v,a)               (*(volatile unsigned int *)(a) = (v))
+
+#define __raw_writeb(v,a)              __arch_putb(v,a)
+#define __raw_writew(v,a)              __arch_putw(v,a)
+#define __raw_writel(v,a)              __arch_putl(v,a)
+
+#define __raw_readb(a)                 __arch_getb(a)
+#define __raw_readw(a)                 __arch_getw(a)
+#define __raw_readl(a)                 __arch_getl(a)
+#define __raw_readq(a)                 __arch_getq(a)
+
+/*
+ * Given a physical address and a length, return a virtual address
+ * that can be used to access the memory range with the caching
+ * properties specified by "flags".
+ */
+typedef unsigned long phys_addr_t;
+
+#define MAP_NOCACHE    (0)
+#define MAP_WRCOMBINE  (0)
+#define MAP_WRBACK     (0)
+#define MAP_WRTHROUGH  (0)
+
+static inline void *map_physmem(phys_addr_t paddr, unsigned long len,
+                               unsigned long flags)
+{
+       return (void *)paddr;
+}
+
+/*
+ * Take down a mapping set up by map_physmem().
+ */
+static inline void unmap_physmem(void *vaddr, unsigned long flags)
+{
+
+}
+
+#endif
diff --git a/include/asm-sparc/irq.h b/include/asm-sparc/irq.h
new file mode 100644 (file)
index 0000000..c5538c0
--- /dev/null
@@ -0,0 +1,49 @@
+/* IRQ functions
+ *
+ * (C) Copyright 2007
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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 __SPARC_IRQ_H__
+#define __SPARC_IRQ_H__
+
+#include <asm/psr.h>
+
+/* Set SPARC Processor Interrupt Level */
+extern inline void set_pil(unsigned int level)
+{
+       unsigned int psr = get_psr();
+
+       put_psr((psr & ~PSR_PIL) | ((level & 0xf) << PSR_PIL_OFS));
+}
+
+/* Get SPARC Processor Interrupt Level */
+extern inline unsigned int get_pil(void)
+{
+       unsigned int psr = get_psr();
+       return (psr & PSR_PIL) >> PSR_PIL_OFS;
+}
+
+/* Disables interrupts and return current PIL value */
+extern int intLock(void);
+
+/* Sets the PIL to oldLevel */
+extern void intUnlock(int oldLevel);
+
+#endif
diff --git a/include/asm-sparc/leon.h b/include/asm-sparc/leon.h
new file mode 100644 (file)
index 0000000..f7175ee
--- /dev/null
@@ -0,0 +1,42 @@
+/* LEON Header File select
+ *
+ * (C) Copyright 2007
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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_LEON_H__
+#define __ASM_LEON_H__
+
+#if defined(CONFIG_LEON3)
+
+#include <asm/leon3.h>
+
+#elif defined(CONFIG_LEON2)
+
+#include <asm/leon2.h>
+
+#else
+
+#error Unknown LEON processor
+
+#endif
+
+/* Common stuff */
+
+#endif
diff --git a/include/asm-sparc/leon2.h b/include/asm-sparc/leon2.h
new file mode 100644 (file)
index 0000000..fa55cad
--- /dev/null
@@ -0,0 +1,236 @@
+/* LEON2 header file. LEON2 is a SOC processor.
+ *
+ * (C) Copyright 2008
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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 __LEON2_H__
+#define __LEON2_H__
+
+#ifdef CONFIG_LEON2
+
+/* LEON 2 I/O register definitions */
+#define LEON2_PREGS    0x80000000
+#define LEON2_MCFG1    0x00
+#define LEON2_MCFG2    0x04
+#define LEON2_ECTRL    0x08
+#define LEON2_FADDR    0x0C
+#define LEON2_MSTAT    0x10
+#define LEON2_CCTRL    0x14
+#define LEON2_PWDOWN   0x18
+#define LEON2_WPROT1   0x1C
+#define LEON2_WPROT2   0x20
+#define LEON2_LCONF    0x24
+#define LEON2_TCNT0    0x40
+#define LEON2_TRLD0    0x44
+#define LEON2_TCTRL0   0x48
+#define LEON2_TCNT1    0x50
+#define LEON2_TRLD1    0x54
+#define LEON2_TCTRL1   0x58
+#define LEON2_SCNT     0x60
+#define LEON2_SRLD     0x64
+#define LEON2_UART0    0x70
+#define LEON2_UDATA0   0x70
+#define LEON2_USTAT0   0x74
+#define LEON2_UCTRL0   0x78
+#define LEON2_USCAL0   0x7C
+#define LEON2_UART1    0x80
+#define LEON2_UDATA1   0x80
+#define LEON2_USTAT1   0x84
+#define LEON2_UCTRL1   0x88
+#define LEON2_USCAL1   0x8C
+#define LEON2_IMASK    0x90
+#define LEON2_IPEND    0x94
+#define LEON2_IFORCE   0x98
+#define LEON2_ICLEAR   0x9C
+#define LEON2_IOREG    0xA0
+#define LEON2_IODIR    0xA4
+#define LEON2_IOICONF  0xA8
+#define LEON2_IPEND2   0xB0
+#define LEON2_IMASK2   0xB4
+#define LEON2_ISTAT2   0xB8
+#define LEON2_ICLEAR2  0xBC
+
+#ifndef __ASSEMBLER__
+/*
+ *  Structure for LEON memory mapped registers.
+ *
+ *  Source: Section 6.1 - On-chip registers
+ *
+ *  NOTE:  There is only one of these structures per CPU, its base address
+ *         is 0x80000000, and the variable LEON_REG is placed there by the
+ *         linkcmds file.
+ */
+typedef struct {
+       volatile unsigned int Memory_Config_1;
+       volatile unsigned int Memory_Config_2;
+       volatile unsigned int Edac_Control;
+       volatile unsigned int Failed_Address;
+       volatile unsigned int Memory_Status;
+       volatile unsigned int Cache_Control;
+       volatile unsigned int Power_Down;
+       volatile unsigned int Write_Protection_1;
+       volatile unsigned int Write_Protection_2;
+       volatile unsigned int Leon_Configuration;
+       volatile unsigned int dummy2;
+       volatile unsigned int dummy3;
+       volatile unsigned int dummy4;
+       volatile unsigned int dummy5;
+       volatile unsigned int dummy6;
+       volatile unsigned int dummy7;
+       volatile unsigned int Timer_Counter_1;
+       volatile unsigned int Timer_Reload_1;
+       volatile unsigned int Timer_Control_1;
+       volatile unsigned int Watchdog;
+       volatile unsigned int Timer_Counter_2;
+       volatile unsigned int Timer_Reload_2;
+       volatile unsigned int Timer_Control_2;
+       volatile unsigned int dummy8;
+       volatile unsigned int Scaler_Counter;
+       volatile unsigned int Scaler_Reload;
+       volatile unsigned int dummy9;
+       volatile unsigned int dummy10;
+       volatile unsigned int UART_Channel_1;
+       volatile unsigned int UART_Status_1;
+       volatile unsigned int UART_Control_1;
+       volatile unsigned int UART_Scaler_1;
+       volatile unsigned int UART_Channel_2;
+       volatile unsigned int UART_Status_2;
+       volatile unsigned int UART_Control_2;
+       volatile unsigned int UART_Scaler_2;
+       volatile unsigned int Interrupt_Mask;
+       volatile unsigned int Interrupt_Pending;
+       volatile unsigned int Interrupt_Force;
+       volatile unsigned int Interrupt_Clear;
+       volatile unsigned int PIO_Data;
+       volatile unsigned int PIO_Direction;
+       volatile unsigned int PIO_Interrupt;
+} LEON2_regs;
+
+typedef struct {
+       volatile unsigned int UART_Channel;
+       volatile unsigned int UART_Status;
+       volatile unsigned int UART_Control;
+       volatile unsigned int UART_Scaler;
+} LEON2_Uart_regs;
+
+#endif
+
+/*
+ *  The following constants are intended to be used ONLY in assembly
+ *  language files.
+ *
+ *  NOTE:  The intended style of usage is to load the address of LEON REGS
+ *         into a register and then use these as displacements from
+ *         that register.
+ */
+#define  LEON_REG_MEMCFG1_OFFSET                                  0x00
+#define  LEON_REG_MEMCFG2_OFFSET                                  0x04
+#define  LEON_REG_EDACCTRL_OFFSET                                 0x08
+#define  LEON_REG_FAILADDR_OFFSET                                 0x0C
+#define  LEON_REG_MEMSTATUS_OFFSET                                0x10
+#define  LEON_REG_CACHECTRL_OFFSET                                0x14
+#define  LEON_REG_POWERDOWN_OFFSET                                0x18
+#define  LEON_REG_WRITEPROT1_OFFSET                               0x1C
+#define  LEON_REG_WRITEPROT2_OFFSET                               0x20
+#define  LEON_REG_LEONCONF_OFFSET                                 0x24
+#define  LEON_REG_UNIMPLEMENTED_2_OFFSET                          0x28
+#define  LEON_REG_UNIMPLEMENTED_3_OFFSET                          0x2C
+#define  LEON_REG_UNIMPLEMENTED_4_OFFSET                          0x30
+#define  LEON_REG_UNIMPLEMENTED_5_OFFSET                          0x34
+#define  LEON_REG_UNIMPLEMENTED_6_OFFSET                          0x38
+#define  LEON_REG_UNIMPLEMENTED_7_OFFSET                          0x3C
+#define  LEON_REG_TIMERCNT1_OFFSET                                0x40
+#define  LEON_REG_TIMERLOAD1_OFFSET                               0x44
+#define  LEON_REG_TIMERCTRL1_OFFSET                               0x48
+#define  LEON_REG_WDOG_OFFSET                                     0x4C
+#define  LEON_REG_TIMERCNT2_OFFSET                                0x50
+#define  LEON_REG_TIMERLOAD2_OFFSET                               0x54
+#define  LEON_REG_TIMERCTRL2_OFFSET                               0x58
+#define  LEON_REG_UNIMPLEMENTED_8_OFFSET                          0x5C
+#define  LEON_REG_SCALERCNT_OFFSET                                0x60
+#define  LEON_REG_SCALER_LOAD_OFFSET                              0x64
+#define  LEON_REG_UNIMPLEMENTED_9_OFFSET                          0x68
+#define  LEON_REG_UNIMPLEMENTED_10_OFFSET                         0x6C
+#define  LEON_REG_UARTDATA1_OFFSET                                0x70
+#define  LEON_REG_UARTSTATUS1_OFFSET                              0x74
+#define  LEON_REG_UARTCTRL1_OFFSET                                0x78
+#define  LEON_REG_UARTSCALER1_OFFSET                              0x7C
+#define  LEON_REG_UARTDATA2_OFFSET                                0x80
+#define  LEON_REG_UARTSTATUS2_OFFSET                              0x84
+#define  LEON_REG_UARTCTRL2_OFFSET                                0x88
+#define  LEON_REG_UARTSCALER2_OFFSET                              0x8C
+#define  LEON_REG_IRQMASK_OFFSET                                  0x90
+#define  LEON_REG_IRQPEND_OFFSET                                  0x94
+#define  LEON_REG_IRQFORCE_OFFSET                                 0x98
+#define  LEON_REG_IRQCLEAR_OFFSET                                 0x9C
+#define  LEON_REG_PIODATA_OFFSET                                  0xA0
+#define  LEON_REG_PIODIR_OFFSET                                   0xA4
+#define  LEON_REG_PIOIRQ_OFFSET                                   0xA8
+#define  LEON_REG_SIM_RAM_SIZE_OFFSET                             0xF4
+#define  LEON_REG_SIM_ROM_SIZE_OFFSET                             0xF8
+
+/*
+ *  Interrupt Sources
+ *
+ *  The interrupt source numbers directly map to the trap type and to
+ *  the bits used in the Interrupt Clear, Interrupt Force, Interrupt Mask,
+ *  and the Interrupt Pending Registers.
+ */
+#define LEON_INTERRUPT_CORRECTABLE_MEMORY_ERROR        1
+#define LEON_INTERRUPT_UART_1_RX_TX            2
+#define LEON_INTERRUPT_UART_0_RX_TX            3
+#define LEON_INTERRUPT_EXTERNAL_0              4
+#define LEON_INTERRUPT_EXTERNAL_1              5
+#define LEON_INTERRUPT_EXTERNAL_2              6
+#define LEON_INTERRUPT_EXTERNAL_3              7
+#define LEON_INTERRUPT_TIMER1                  8
+#define LEON_INTERRUPT_TIMER2                  9
+#define LEON_INTERRUPT_EMPTY1                  10
+#define LEON_INTERRUPT_EMPTY2                  11
+#define LEON_INTERRUPT_OPEN_ETH                        12
+#define LEON_INTERRUPT_EMPTY4                  13
+#define LEON_INTERRUPT_EMPTY5                  14
+#define LEON_INTERRUPT_EMPTY6                  15
+
+/* Timer Bits */
+#define LEON2_TIMER_CTRL_EN    0x1     /* Timer enable */
+#define LEON2_TIMER_CTRL_RS    0x2     /* Timer reStart  */
+#define LEON2_TIMER_CTRL_LD    0x4     /* Timer reLoad */
+#define LEON2_TIMER1_IRQNO     8       /* Timer 1 IRQ number */
+#define LEON2_TIMER2_IRQNO     9       /* Timer 2 IRQ number */
+#define LEON2_TIMER1_IE                (1<<LEON2_TIMER1_IRQNO) /* Timer 1 interrupt enable */
+#define LEON2_TIMER2_IE                (1<<LEON2_TIMER2_IRQNO) /* Timer 2 interrupt enable */
+
+/* UART bits */
+#define LEON2_UART_CTRL_RE     1       /* UART Receiver enable */
+#define LEON2_UART_CTRL_TE     2       /* UART Transmitter enable */
+#define LEON2_UART_CTRL_RI     4       /* UART Receiver Interrupt enable */
+#define LEON2_UART_CTRL_TI     8       /* UART Transmitter Interrupt enable */
+#define LEON2_UART_CTRL_DBG (1<<11)    /* Debug Bit used by GRMON */
+
+#define LEON2_UART_STAT_DR     1       /* UART Data Ready */
+#define LEON2_UART_STAT_TSE    2       /* UART Transmit Shift Reg empty */
+#define LEON2_UART_STAT_THE    4       /* UART Transmit Hold Reg empty */
+
+#else
+#error Include LEON2 header file only if LEON2 processor
+#endif
+
+#endif
diff --git a/include/asm-sparc/leon3.h b/include/asm-sparc/leon3.h
new file mode 100644 (file)
index 0000000..b90d35b
--- /dev/null
@@ -0,0 +1,36 @@
+/* LEON3 header file. LEON3 is a free GPL SOC processor available
+ * at www.gaisler.com.
+ *
+ * (C) Copyright 2007
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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 __LEON3_H__
+#define __LEON3_H__
+
+#ifndef CONFIG_LEON3
+#error Include LEON3 header file only if LEON3 processor
+#endif
+
+/* Not much to define, most is Plug and Play and GRLIB dependent
+ * not LEON3 dependent. See <ambapp.h> for GRLIB timers, interrupt
+ * ctrl, memory controllers etc.
+ */
+
+#endif
diff --git a/include/asm-sparc/machines.h b/include/asm-sparc/machines.h
new file mode 100644 (file)
index 0000000..1e26195
--- /dev/null
@@ -0,0 +1,92 @@
+/* machines.h:  Defines for taking apart the machine type value in the
+ *              idprom and determining the kind of machine we are on.
+ *
+ * Taken from the SPARC port of Linux.
+ *
+ * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
+ * Copyright (C) 2007 Daniel Hellstrom (daniel@gaisler.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 __SPARC_MACHINES_H__
+#define __SPARC_MACHINES_H__
+
+struct Sun_Machine_Models {
+       char *name;
+       unsigned char id_machtype;
+};
+
+/* Current number of machines we know about that has an IDPROM
+ * machtype entry including one entry for the 0x80 OBP machines.
+ */
+#define NUM_SUN_MACHINES   16
+
+extern struct Sun_Machine_Models Sun_Machines[NUM_SUN_MACHINES];
+
+/* The machine type in the idprom area looks like this:
+ *
+ * ---------------
+ * | ARCH | MACH |
+ * ---------------
+ *  7    4 3    0
+ *
+ * The ARCH field determines the architecture line (sun4, sun4c, etc).
+ * The MACH field determines the machine make within that architecture.
+ */
+
+#define SM_ARCH_MASK  0xf0
+#define SM_SUN4       0x20
+#define  M_LEON2      0x30
+#define SM_SUN4C      0x50
+#define SM_SUN4M      0x70
+#define SM_SUN4M_OBP  0x80
+
+#define SM_TYP_MASK   0x0f
+/* Sun4 machines */
+#define SM_4_260      0x01     /* Sun 4/200 series */
+#define SM_4_110      0x02     /* Sun 4/100 series */
+#define SM_4_330      0x03     /* Sun 4/300 series */
+#define SM_4_470      0x04     /* Sun 4/400 series */
+
+/* Leon machines */
+#define M_LEON2_SOC   0x01     /* Leon2 SoC */
+
+/* Sun4c machines                Full Name              - PROM NAME */
+#define SM_4C_SS1     0x01     /* Sun4c SparcStation 1   - Sun 4/60  */
+#define SM_4C_IPC     0x02     /* Sun4c SparcStation IPC - Sun 4/40  */
+#define SM_4C_SS1PLUS 0x03     /* Sun4c SparcStation 1+  - Sun 4/65  */
+#define SM_4C_SLC     0x04     /* Sun4c SparcStation SLC - Sun 4/20  */
+#define SM_4C_SS2     0x05     /* Sun4c SparcStation 2   - Sun 4/75  */
+#define SM_4C_ELC     0x06     /* Sun4c SparcStation ELC - Sun 4/25  */
+#define SM_4C_IPX     0x07     /* Sun4c SparcStation IPX - Sun 4/50  */
+
+/* Sun4m machines, these predate the OpenBoot.  These values only mean
+ * something if the value in the ARCH field is SM_SUN4M, if it is
+ * SM_SUN4M_OBP then you have the following situation:
+ * 1) You either have a sun4d, a sun4e, or a recently made sun4m.
+ * 2) You have to consult OpenBoot to determine which machine this is.
+ */
+#define SM_4M_SS60    0x01     /* Sun4m SparcSystem 600                  */
+#define SM_4M_SS50    0x02     /* Sun4m SparcStation 10                  */
+#define SM_4M_SS40    0x03     /* Sun4m SparcStation 5                   */
+
+/* Sun4d machines -- N/A */
+/* Sun4e machines -- N/A */
+/* Sun4u machines -- N/A */
+
+#endif                         /* !(_SPARC_MACHINES_H) */
diff --git a/include/asm-sparc/page.h b/include/asm-sparc/page.h
new file mode 100644 (file)
index 0000000..484953a
--- /dev/null
@@ -0,0 +1,43 @@
+/* page.h:  Various defines and such for MMU operations on the Sparc for
+ *          the Linux kernel.
+ *
+ * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
+ * Copyright (C) 2007 Daniel Hellstrom (daniel@gaisler.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 _SPARC_PAGE_H
+#define _SPARC_PAGE_H
+
+#include <linux/config.h>
+#ifdef CONFIG_SUN4
+#define PAGE_SHIFT   13
+#else
+#define PAGE_SHIFT   12
+#endif
+
+#ifndef __ASSEMBLY__
+/* I have my suspicions... -DaveM */
+#define PAGE_SIZE    (1UL << PAGE_SHIFT)
+#else
+#define PAGE_SIZE    (1 << PAGE_SHIFT)
+#endif
+
+#define PAGE_MASK    (~(PAGE_SIZE-1))
+
+#endif                         /* _SPARC_PAGE_H */
diff --git a/include/asm-sparc/posix_types.h b/include/asm-sparc/posix_types.h
new file mode 100644 (file)
index 0000000..8d98b2a
--- /dev/null
@@ -0,0 +1,139 @@
+/*
+ * (C) Copyright 2000 - 2002
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * (C) Copyright 2007, taken from asm-ppc/posix_types.h
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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 __SPARC_POSIX_TYPES_H__
+#define __SPARC_POSIX_TYPES_H__
+
+/*
+ * This file is generally used by user-level software, so you need to
+ * be a little careful about namespace pollution etc.  Also, we cannot
+ * assume GCC is being used.
+ */
+
+typedef unsigned int __kernel_dev_t;
+typedef unsigned int __kernel_ino_t;
+typedef unsigned int __kernel_mode_t;
+typedef unsigned short __kernel_nlink_t;
+typedef long __kernel_off_t;
+typedef int __kernel_pid_t;
+typedef unsigned int __kernel_uid_t;
+typedef unsigned int __kernel_gid_t;
+typedef unsigned int __kernel_size_t;
+typedef int __kernel_ssize_t;
+typedef long __kernel_ptrdiff_t;
+typedef long __kernel_time_t;
+typedef long __kernel_suseconds_t;
+typedef long __kernel_clock_t;
+typedef int __kernel_daddr_t;
+typedef char *__kernel_caddr_t;
+typedef short __kernel_ipc_pid_t;
+typedef unsigned short __kernel_uid16_t;
+typedef unsigned short __kernel_gid16_t;
+typedef unsigned int __kernel_uid32_t;
+typedef unsigned int __kernel_gid32_t;
+
+typedef unsigned int __kernel_old_uid_t;
+typedef unsigned int __kernel_old_gid_t;
+
+#ifdef __GNUC__
+typedef long long __kernel_loff_t;
+#endif
+
+typedef struct {
+       int val[2];
+} __kernel_fsid_t;
+
+#ifndef __GNUC__
+
+#define        __FD_SET(d, set)        ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d))
+#define        __FD_CLR(d, set)        ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
+#define        __FD_ISSET(d, set)      ((set)->fds_bits[__FDELT(d)] & __FDMASK(d))
+#define        __FD_ZERO(set)  \
+  ((void) memset ((__ptr_t) (set), 0, sizeof (__kernel_fd_set)))
+
+#else                          /* __GNUC__ */
+
+#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) \
+    || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 0)
+/* With GNU C, use inline functions instead so args are evaluated only once: */
+
+#undef __FD_SET
+static __inline__ void __FD_SET(unsigned long fd, __kernel_fd_set * fdsetp)
+{
+       unsigned long _tmp = fd / __NFDBITS;
+       unsigned long _rem = fd % __NFDBITS;
+       fdsetp->fds_bits[_tmp] |= (1UL << _rem);
+}
+
+#undef __FD_CLR
+static __inline__ void __FD_CLR(unsigned long fd, __kernel_fd_set * fdsetp)
+{
+       unsigned long _tmp = fd / __NFDBITS;
+       unsigned long _rem = fd % __NFDBITS;
+       fdsetp->fds_bits[_tmp] &= ~(1UL << _rem);
+}
+
+#undef __FD_ISSET
+static __inline__ int __FD_ISSET(unsigned long fd, __kernel_fd_set * p)
+{
+       unsigned long _tmp = fd / __NFDBITS;
+       unsigned long _rem = fd % __NFDBITS;
+       return (p->fds_bits[_tmp] & (1UL << _rem)) != 0;
+}
+
+/*
+ * This will unroll the loop for the normal constant case (8 ints,
+ * for a 256-bit fd_set)
+ */
+#undef __FD_ZERO
+static __inline__ void __FD_ZERO(__kernel_fd_set * p)
+{
+       unsigned int *tmp = (unsigned int *)p->fds_bits;
+       int i;
+
+       if (__builtin_constant_p(__FDSET_LONGS)) {
+               switch (__FDSET_LONGS) {
+               case 8:
+                       tmp[0] = 0;
+                       tmp[1] = 0;
+                       tmp[2] = 0;
+                       tmp[3] = 0;
+                       tmp[4] = 0;
+                       tmp[5] = 0;
+                       tmp[6] = 0;
+                       tmp[7] = 0;
+                       return;
+               }
+       }
+       i = __FDSET_LONGS;
+       while (i) {
+               i--;
+               *tmp = 0;
+               tmp++;
+       }
+}
+
+#endif                         /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */
+#endif                         /* __GNUC__ */
+#endif                         /* _SPARC_POSIX_TYPES_H */
diff --git a/include/asm-sparc/processor.h b/include/asm-sparc/processor.h
new file mode 100644 (file)
index 0000000..d518389
--- /dev/null
@@ -0,0 +1,116 @@
+/* SPARC Processor specifics
+ * taken from the SPARC port of Linux (ptrace.h).
+ *
+ * (C) Copyright 2007
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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_SPARC_PROCESSOR_H
+#define __ASM_SPARC_PROCESSOR_H
+
+#include <asm/arch/asi.h>
+
+#ifdef CONFIG_LEON
+
+/* All LEON processors supported */
+#include <asm/leon.h>
+
+#else
+/* other processors */
+#error Unknown SPARC Processor
+#endif
+
+#ifndef __ASSEMBLY__
+
+/* flush data cache */
+static __inline__ void sparc_dcache_flush_all(void)
+{
+      __asm__ __volatile__("sta %%g0, [%%g0] %0\n\t"::"i"(ASI_DFLUSH):"memory");
+}
+
+/* flush instruction cache */
+static __inline__ void sparc_icache_flush_all(void)
+{
+      __asm__ __volatile__("sta %%g0, [%%g0] %0\n\t"::"i"(ASI_IFLUSH):"memory");
+}
+
+/* do a cache miss load */
+static __inline__ unsigned long long sparc_load_reg_cachemiss_qword(unsigned
+                                                                   long paddr)
+{
+       unsigned long long retval;
+       __asm__ __volatile__("ldda [%1] %2, %0\n\t":
+                            "=r"(retval):"r"(paddr), "i"(ASI_CACHEMISS));
+       return retval;
+}
+
+static __inline__ unsigned long sparc_load_reg_cachemiss(unsigned long paddr)
+{
+       unsigned long retval;
+       __asm__ __volatile__("lda [%1] %2, %0\n\t":
+                            "=r"(retval):"r"(paddr), "i"(ASI_CACHEMISS));
+       return retval;
+}
+
+static __inline__ unsigned short sparc_load_reg_cachemiss_word(unsigned long
+                                                              paddr)
+{
+       unsigned short retval;
+       __asm__ __volatile__("lduha [%1] %2, %0\n\t":
+                            "=r"(retval):"r"(paddr), "i"(ASI_CACHEMISS));
+       return retval;
+}
+
+static __inline__ unsigned char sparc_load_reg_cachemiss_byte(unsigned long
+                                                             paddr)
+{
+       unsigned char retval;
+       __asm__ __volatile__("lduba [%1] %2, %0\n\t":
+                            "=r"(retval):"r"(paddr), "i"(ASI_CACHEMISS));
+       return retval;
+}
+
+/* do a physical address bypass write, i.e. for 0x80000000 */
+static __inline__ void sparc_store_reg_bypass(unsigned long paddr,
+                                             unsigned long value)
+{
+       __asm__ __volatile__("sta %0, [%1] %2\n\t"::"r"(value), "r"(paddr),
+                            "i"(ASI_BYPASS):"memory");
+}
+
+static __inline__ unsigned long sparc_load_reg_bypass(unsigned long paddr)
+{
+       unsigned long retval;
+       __asm__ __volatile__("lda [%1] %2, %0\n\t":
+                            "=r"(retval):"r"(paddr), "i"(ASI_BYPASS));
+       return retval;
+}
+
+/* Macros for bypassing cache when reading */
+#define SPARC_NOCACHE_READ_DWORD(address) sparc_load_reg_cachemiss_qword((unsigned int)(address))
+#define SPARC_NOCACHE_READ(address)       sparc_load_reg_cachemiss((unsigned int)(address))
+#define SPARC_NOCACHE_READ_HWORD(address) sparc_load_reg_cachemiss_word((unsigned int)(address))
+#define SPARC_NOCACHE_READ_BYTE(address)  sparc_load_reg_cachemiss_byte((unsigned int)(address))
+
+#define SPARC_BYPASS_READ(address)        sparc_load_reg_bypass((unsigned int)(address))
+#define SPARC_BYPASS_WRITE(address,value) sparc_store_reg_bypass((unsigned int)(address),(unsigned int)(value))
+
+#endif
+
+#endif                         /* __ASM_SPARC_PROCESSOR_H */
diff --git a/include/asm-sparc/prom.h b/include/asm-sparc/prom.h
new file mode 100644 (file)
index 0000000..d55cc86
--- /dev/null
@@ -0,0 +1,297 @@
+/* OpenProm defines mainly taken from linux kernel header files
+ *
+ * openprom.h:  Prom structures and defines for access to the OPENBOOT
+ *              prom routines and data areas.
+ *
+ * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
+ * Copyright (C) 2007 Daniel Hellstrom (daniel@gaisler.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 __SPARC_OPENPROM_H__
+#define __SPARC_OPENPROM_H__
+
+/* Empirical constants... */
+#define        LINUX_OPPROM_MAGIC      0x10010407
+
+#ifndef __ASSEMBLY__
+/* V0 prom device operations. */
+struct linux_dev_v0_funcs {
+       int (*v0_devopen) (char *device_str);
+       int (*v0_devclose) (int dev_desc);
+       int (*v0_rdblkdev) (int dev_desc, int num_blks, int blk_st, char *buf);
+       int (*v0_wrblkdev) (int dev_desc, int num_blks, int blk_st, char *buf);
+       int (*v0_wrnetdev) (int dev_desc, int num_bytes, char *buf);
+       int (*v0_rdnetdev) (int dev_desc, int num_bytes, char *buf);
+       int (*v0_rdchardev) (int dev_desc, int num_bytes, int dummy, char *buf);
+       int (*v0_wrchardev) (int dev_desc, int num_bytes, int dummy, char *buf);
+       int (*v0_seekdev) (int dev_desc, long logical_offst, int from);
+};
+
+/* V2 and later prom device operations. */
+struct linux_dev_v2_funcs {
+       int (*v2_inst2pkg) (int d);     /* Convert ihandle to phandle */
+       char *(*v2_dumb_mem_alloc) (char *va, unsigned sz);
+       void (*v2_dumb_mem_free) (char *va, unsigned sz);
+
+       /* To map devices into virtual I/O space. */
+       char *(*v2_dumb_mmap) (char *virta, int which_io, unsigned paddr,
+                              unsigned sz);
+       void (*v2_dumb_munmap) (char *virta, unsigned size);
+
+       int (*v2_dev_open) (char *devpath);
+       void (*v2_dev_close) (int d);
+       int (*v2_dev_read) (int d, char *buf, int nbytes);
+       int (*v2_dev_write) (int d, char *buf, int nbytes);
+       int (*v2_dev_seek) (int d, int hi, int lo);
+
+       /* Never issued (multistage load support) */
+       void (*v2_wheee2) (void);
+       void (*v2_wheee3) (void);
+};
+
+struct linux_mlist_v0 {
+       struct linux_mlist_v0 *theres_more;
+       char *start_adr;
+       unsigned num_bytes;
+};
+
+struct linux_mem_v0 {
+       struct linux_mlist_v0 **v0_totphys;
+       struct linux_mlist_v0 **v0_prommap;
+       struct linux_mlist_v0 **v0_available;   /* What we can use */
+};
+
+/* Arguments sent to the kernel from the boot prompt. */
+struct linux_arguments_v0 {
+       char *argv[8];
+       char args[100];
+       char boot_dev[2];
+       int boot_dev_ctrl;
+       int boot_dev_unit;
+       int dev_partition;
+       char *kernel_file_name;
+       void *aieee1;           /* XXX */
+};
+
+/* V2 and up boot things. */
+struct linux_bootargs_v2 {
+       char **bootpath;
+       char **bootargs;
+       int *fd_stdin;
+       int *fd_stdout;
+};
+
+/* The top level PROM vector. */
+struct linux_romvec {
+       /* Version numbers. */
+       unsigned int pv_magic_cookie;
+       unsigned int pv_romvers;
+       unsigned int pv_plugin_revision;
+       unsigned int pv_printrev;
+
+       /* Version 0 memory descriptors. */
+       struct linux_mem_v0 pv_v0mem;
+
+       /* Node operations. */
+       struct linux_nodeops *pv_nodeops;
+
+       char **pv_bootstr;
+       struct linux_dev_v0_funcs pv_v0devops;
+
+       char *pv_stdin;
+       char *pv_stdout;
+#define        PROMDEV_KBD     0       /* input from keyboard */
+#define        PROMDEV_SCREEN  0       /* output to screen */
+#define        PROMDEV_TTYA    1       /* in/out to ttya */
+#define        PROMDEV_TTYB    2       /* in/out to ttyb */
+
+       /* Blocking getchar/putchar.  NOT REENTRANT! (grr) */
+       int (*pv_getchar) (void);
+       void (*pv_putchar) (int ch);
+
+       /* Non-blocking variants. */
+       int (*pv_nbgetchar) (void);
+       int (*pv_nbputchar) (int ch);
+
+       void (*pv_putstr) (char *str, int len);
+
+       /* Miscellany. */
+       void (*pv_reboot) (char *bootstr);
+       void (*pv_printf) (__const__ char *fmt, ...);
+       void (*pv_abort) (void);
+       __volatile__ int *pv_ticks;
+       void (*pv_halt) (void);
+       void (**pv_synchook) (void);
+
+       /* Evaluate a forth string, not different proto for V0 and V2->up. */
+       union {
+               void (*v0_eval) (int len, char *str);
+               void (*v2_eval) (char *str);
+       } pv_fortheval;
+
+       struct linux_arguments_v0 **pv_v0bootargs;
+
+       /* Get ether address. */
+       unsigned int (*pv_enaddr) (int d, char *enaddr);
+
+       struct linux_bootargs_v2 pv_v2bootargs;
+       struct linux_dev_v2_funcs pv_v2devops;
+
+       int filler[15];
+
+       /* This one is sun4c/sun4 only. */
+       void (*pv_setctxt) (int ctxt, char *va, int pmeg);
+
+       /* Prom version 3 Multiprocessor routines. This stuff is crazy.
+        * No joke. Calling these when there is only one cpu probably
+        * crashes the machine, have to test this. :-)
+        */
+
+       /* v3_cpustart() will start the cpu 'whichcpu' in mmu-context
+        * 'thiscontext' executing at address 'prog_counter'
+        */
+       int (*v3_cpustart) (unsigned int whichcpu, int ctxtbl_ptr,
+                           int thiscontext, char *prog_counter);
+
+       /* v3_cpustop() will cause cpu 'whichcpu' to stop executing
+        * until a resume cpu call is made.
+        */
+       int (*v3_cpustop) (unsigned int whichcpu);
+
+       /* v3_cpuidle() will idle cpu 'whichcpu' until a stop or
+        * resume cpu call is made.
+        */
+       int (*v3_cpuidle) (unsigned int whichcpu);
+
+       /* v3_cpuresume() will resume processor 'whichcpu' executing
+        * starting with whatever 'pc' and 'npc' were left at the
+        * last 'idle' or 'stop' call.
+        */
+       int (*v3_cpuresume) (unsigned int whichcpu);
+};
+
+/* Routines for traversing the prom device tree. */
+struct linux_nodeops {
+       int (*no_nextnode) (int node);
+       int (*no_child) (int node);
+       int (*no_proplen) (int node, char *name);
+       int (*no_getprop) (int node, char *name, char *val);
+       int (*no_setprop) (int node, char *name, char *val, int len);
+       char *(*no_nextprop) (int node, char *name);
+};
+
+/* More fun PROM structures for device probing. */
+#define PROMREG_MAX     16
+#define PROMVADDR_MAX   16
+#define PROMINTR_MAX    15
+
+struct linux_prom_registers {
+       unsigned int which_io;  /* is this in OBIO space? */
+       unsigned int phys_addr; /* The physical address of this register */
+       unsigned int reg_size;  /* How many bytes does this register take up? */
+};
+
+struct linux_prom_irqs {
+       int pri;                /* IRQ priority */
+       int vector;             /* This is foobar, what does it do? */
+};
+
+/* Element of the "ranges" vector */
+struct linux_prom_ranges {
+       unsigned int ot_child_space;
+       unsigned int ot_child_base;     /* Bus feels this */
+       unsigned int ot_parent_space;
+       unsigned int ot_parent_base;    /* CPU looks from here */
+       unsigned int or_size;
+};
+
+/* Ranges and reg properties are a bit different for PCI. */
+struct linux_prom_pci_registers {
+       /*
+        * We don't know what information this field contain.
+        * We guess, PCI device function is in bits 15:8
+        * So, ...
+        */
+       unsigned int which_io;  /* Let it be which_io */
+
+       unsigned int phys_hi;
+       unsigned int phys_lo;
+
+       unsigned int size_hi;
+       unsigned int size_lo;
+};
+
+struct linux_prom_pci_ranges {
+       unsigned int child_phys_hi;     /* Only certain bits are encoded here. */
+       unsigned int child_phys_mid;
+       unsigned int child_phys_lo;
+
+       unsigned int parent_phys_hi;
+       unsigned int parent_phys_lo;
+
+       unsigned int size_hi;
+       unsigned int size_lo;
+};
+
+struct linux_prom_pci_assigned_addresses {
+       unsigned int which_io;
+
+       unsigned int phys_hi;
+       unsigned int phys_lo;
+
+       unsigned int size_hi;
+       unsigned int size_lo;
+};
+
+struct linux_prom_ebus_ranges {
+       unsigned int child_phys_hi;
+       unsigned int child_phys_lo;
+
+       unsigned int parent_phys_hi;
+       unsigned int parent_phys_mid;
+       unsigned int parent_phys_lo;
+
+       unsigned int size;
+};
+
+/* Offset into the EEPROM where the id PROM is located on the 4c */
+#define IDPROM_OFFSET  0x7d8
+
+/* On sun4m; physical. */
+/* MicroSPARC(-II) does not decode 31rd bit, but it works. */
+#define IDPROM_OFFSET_M  0xfd8
+
+struct idprom {
+       unsigned char id_format;        /* Format identifier (always 0x01) */
+       unsigned char id_machtype;      /* Machine type */
+       unsigned char id_ethaddr[6];    /* Hardware ethernet address */
+       long id_date;           /* Date of manufacture */
+       unsigned int id_sernum:24;      /* Unique serial number */
+       unsigned char id_cksum; /* Checksum - xor of the data bytes */
+       unsigned char reserved[16];
+};
+
+extern struct idprom *idprom;
+extern void idprom_init(void);
+
+#define IDPROM_SIZE  (sizeof(struct idprom))
+
+#endif                         /* !(__ASSEMBLY__) */
+
+#endif
diff --git a/include/asm-sparc/psr.h b/include/asm-sparc/psr.h
new file mode 100644 (file)
index 0000000..fc77947
--- /dev/null
@@ -0,0 +1,97 @@
+/* psr.h: This file holds the macros for masking off various parts of
+ *        the processor status register on the Sparc. This is valid
+ *        for Version 8. On the V9 this is renamed to the PSTATE
+ *        register and its members are accessed as fields like
+ *        PSTATE.PRIV for the current CPU privilege level.
+ *
+ * taken from the SPARC port of Linux,
+ *
+ * Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu)
+ * Copyright (C) 2007 Daniel Hellstrom (daniel@gaisler.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 __SPARC_PSR_H__
+#define __SPARC_PSR_H__
+
+/* The Sparc PSR fields are laid out as the following:
+ *
+ *  ------------------------------------------------------------------------
+ *  | impl  | vers  | icc   | resv  | EC | EF | PIL  | S | PS | ET |  CWP  |
+ *  | 31-28 | 27-24 | 23-20 | 19-14 | 13 | 12 | 11-8 | 7 | 6  | 5  |  4-0  |
+ *  ------------------------------------------------------------------------
+ */
+#define PSR_CWP     0x0000001f /* current window pointer     */
+#define PSR_ET      0x00000020 /* enable traps field         */
+#define PSR_PS      0x00000040 /* previous privilege level   */
+#define PSR_S       0x00000080 /* current privilege level    */
+#define PSR_PIL     0x00000f00 /* processor interrupt level  */
+#define PSR_EF      0x00001000 /* enable floating point      */
+#define PSR_EC      0x00002000 /* enable co-processor        */
+#define PSR_LE      0x00008000 /* SuperSparcII little-endian */
+#define PSR_ICC     0x00f00000 /* integer condition codes    */
+#define PSR_C       0x00100000 /* carry bit                  */
+#define PSR_V       0x00200000 /* overflow bit               */
+#define PSR_Z       0x00400000 /* zero bit                   */
+#define PSR_N       0x00800000 /* negative bit               */
+#define PSR_VERS    0x0f000000 /* cpu-version field          */
+#define PSR_IMPL    0xf0000000 /* cpu-implementation field   */
+
+#define PSR_PIL_OFS  8
+
+#ifndef __ASSEMBLY__
+/* Get the %psr register. */
+extern __inline__ unsigned int get_psr(void)
+{
+       unsigned int psr;
+       __asm__ __volatile__("rd        %%psr, %0\n\t"
+                            "nop\n\t" "nop\n\t" "nop\n\t":"=r"(psr)
+                            :  /* no inputs */
+                            :"memory");
+
+       return psr;
+}
+
+extern __inline__ void put_psr(unsigned int new_psr)
+{
+       __asm__ __volatile__("wr        %0, 0x0, %%psr\n\t" "nop\n\t" "nop\n\t" "nop\n\t":      /* no outputs */
+                            :"r"(new_psr)
+                            :"memory", "cc");
+}
+
+/* Get the %fsr register.  Be careful, make sure the floating point
+ * enable bit is set in the %psr when you execute this or you will
+ * incur a trap.
+ */
+
+extern unsigned int fsr_storage;
+
+extern __inline__ unsigned int get_fsr(void)
+{
+       unsigned int fsr = 0;
+
+       __asm__ __volatile__("st        %%fsr, %1\n\t"
+                            "ld        %1, %0\n\t":"=r"(fsr)
+                            :"m"(fsr_storage));
+
+       return fsr;
+}
+
+#endif                         /* !(__ASSEMBLY__) */
+
+#endif                         /* !(__SPARC_PSR_H__) */
diff --git a/include/asm-sparc/ptrace.h b/include/asm-sparc/ptrace.h
new file mode 100644 (file)
index 0000000..12a9c56
--- /dev/null
@@ -0,0 +1,181 @@
+/* Contain the Stack frame layout on interrupt. pt_regs.
+ * taken from the SPARC port of Linux (ptrace.h).
+ *
+ * (C) Copyright 2007
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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 __SPARC_PTRACE_H__
+#define __SPARC_PTRACE_H__
+
+#include <asm/psr.h>
+
+/* This struct defines the way the registers are stored on the
+ * stack during a system call and basically all traps.
+ */
+
+#ifndef __ASSEMBLY__
+
+struct pt_regs {
+       unsigned long psr;
+       unsigned long pc;
+       unsigned long npc;
+       unsigned long y;
+       unsigned long u_regs[16];       /* globals and ins */
+};
+
+#define UREG_G0        0
+#define UREG_G1        1
+#define UREG_G2        2
+#define UREG_G3        3
+#define UREG_G4        4
+#define UREG_G5        5
+#define UREG_G6        6
+#define UREG_G7        7
+#define UREG_I0        8
+#define UREG_I1        9
+#define UREG_I2        10
+#define UREG_I3        11
+#define UREG_I4        12
+#define UREG_I5        13
+#define UREG_I6        14
+#define UREG_I7        15
+#define UREG_WIM       UREG_G0
+#define UREG_FADDR     UREG_G0
+#define UREG_FP        UREG_I6
+#define UREG_RETPC     UREG_I7
+
+/* A register window */
+struct reg_window {
+       unsigned long locals[8];
+       unsigned long ins[8];
+};
+
+/* A Sparc stack frame */
+struct sparc_stackf {
+       unsigned long locals[8];
+       unsigned long ins[6];
+       struct sparc_stackf *fp;
+       unsigned long callers_pc;
+       char *structptr;
+       unsigned long xargs[6];
+       unsigned long xxargs[1];
+};
+
+#define TRACEREG_SZ   sizeof(struct pt_regs)
+#define STACKFRAME_SZ sizeof(struct sparc_stackf)
+
+#else                          /* __ASSEMBLY__ */
+/* For assembly code. */
+#define TRACEREG_SZ       0x50
+#define STACKFRAME_SZ     0x60
+#endif
+
+/*
+ * The asm_offsets.h is a generated file, so we cannot include it.
+ * It may be OK for glibc headers, but it's utterly pointless for C code.
+ * The assembly code using those offsets has to include it explicitly.
+ */
+/* #include <asm/asm_offsets.h> */
+
+/* These are for pt_regs. */
+#define PT_PSR    0x0
+#define PT_PC     0x4
+#define PT_NPC    0x8
+#define PT_Y      0xc
+#define PT_G0     0x10
+#define PT_WIM    PT_G0
+#define PT_G1     0x14
+#define PT_G2     0x18
+#define PT_G3     0x1c
+#define PT_G4     0x20
+#define PT_G5     0x24
+#define PT_G6     0x28
+#define PT_G7     0x2c
+#define PT_I0     0x30
+#define PT_I1     0x34
+#define PT_I2     0x38
+#define PT_I3     0x3c
+#define PT_I4     0x40
+#define PT_I5     0x44
+#define PT_I6     0x48
+#define PT_FP     PT_I6
+#define PT_I7     0x4c
+
+/* Reg_window offsets */
+#define RW_L0     0x00
+#define RW_L1     0x04
+#define RW_L2     0x08
+#define RW_L3     0x0c
+#define RW_L4     0x10
+#define RW_L5     0x14
+#define RW_L6     0x18
+#define RW_L7     0x1c
+#define RW_I0     0x20
+#define RW_I1     0x24
+#define RW_I2     0x28
+#define RW_I3     0x2c
+#define RW_I4     0x30
+#define RW_I5     0x34
+#define RW_I6     0x38
+#define RW_I7     0x3c
+
+/* Stack_frame offsets */
+#define SF_L0     0x00
+#define SF_L1     0x04
+#define SF_L2     0x08
+#define SF_L3     0x0c
+#define SF_L4     0x10
+#define SF_L5     0x14
+#define SF_L6     0x18
+#define SF_L7     0x1c
+#define SF_I0     0x20
+#define SF_I1     0x24
+#define SF_I2     0x28
+#define SF_I3     0x2c
+#define SF_I4     0x30
+#define SF_I5     0x34
+#define SF_FP     0x38
+#define SF_PC     0x3c
+#define SF_RETP   0x40
+#define SF_XARG0  0x44
+#define SF_XARG1  0x48
+#define SF_XARG2  0x4c
+#define SF_XARG3  0x50
+#define SF_XARG4  0x54
+#define SF_XARG5  0x58
+#define SF_XXARG  0x5c
+
+/* Stuff for the ptrace system call */
+#define PTRACE_SUNATTACH          10
+#define PTRACE_SUNDETACH          11
+#define PTRACE_GETREGS            12
+#define PTRACE_SETREGS            13
+#define PTRACE_GETFPREGS          14
+#define PTRACE_SETFPREGS          15
+#define PTRACE_READDATA           16
+#define PTRACE_WRITEDATA          17
+#define PTRACE_READTEXT           18
+#define PTRACE_WRITETEXT          19
+#define PTRACE_GETFPAREGS         20
+#define PTRACE_SETFPAREGS         21
+
+#define PTRACE_GETUCODE           29   /* stupid bsd-ism */
+
+#endif                         /* !(_SPARC_PTRACE_H) */
diff --git a/include/asm-sparc/srmmu.h b/include/asm-sparc/srmmu.h
new file mode 100644 (file)
index 0000000..5214d96
--- /dev/null
@@ -0,0 +1,301 @@
+/* SRMMU page table defines and code,
+ * taken from the SPARC port of Linux
+ *
+ * Copyright (C) 2007 Daniel Hellstrom (daniel@gaisler.com)
+ * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the 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 __SPARC_SRMMU_H__
+#define __SPARC_SRMMU_H__
+
+#include <asm/asi.h>
+#include <asm/page.h>
+
+/* Number of contexts is implementation-dependent; 64k is the most we support */
+#define SRMMU_MAX_CONTEXTS     65536
+
+/* PMD_SHIFT determines the size of the area a second-level page table entry can map */
+#define SRMMU_REAL_PMD_SHIFT           18
+#define SRMMU_REAL_PMD_SIZE            (1UL << SRMMU_REAL_PMD_SHIFT)
+#define SRMMU_REAL_PMD_MASK            (~(SRMMU_REAL_PMD_SIZE-1))
+#define SRMMU_REAL_PMD_ALIGN(__addr)   (((__addr)+SRMMU_REAL_PMD_SIZE-1)&SRMMU_REAL_PMD_MASK)
+
+/* PGDIR_SHIFT determines what a third-level page table entry can map */
+#define SRMMU_PGDIR_SHIFT       24
+#define SRMMU_PGDIR_SIZE        (1UL << SRMMU_PGDIR_SHIFT)
+#define SRMMU_PGDIR_MASK        (~(SRMMU_PGDIR_SIZE-1))
+#define SRMMU_PGDIR_ALIGN(addr) (((addr)+SRMMU_PGDIR_SIZE-1)&SRMMU_PGDIR_MASK)
+
+#define SRMMU_REAL_PTRS_PER_PTE        64
+#define SRMMU_REAL_PTRS_PER_PMD        64
+#define SRMMU_PTRS_PER_PGD     256
+
+#define SRMMU_REAL_PTE_TABLE_SIZE      (SRMMU_REAL_PTRS_PER_PTE*4)
+#define SRMMU_PMD_TABLE_SIZE           (SRMMU_REAL_PTRS_PER_PMD*4)
+#define SRMMU_PGD_TABLE_SIZE           (SRMMU_PTRS_PER_PGD*4)
+
+/*
+ * To support pagetables in highmem, Linux introduces APIs which
+ * return struct page* and generally manipulate page tables when
+ * they are not mapped into kernel space. Our hardware page tables
+ * are smaller than pages. We lump hardware tabes into big, page sized
+ * software tables.
+ *
+ * PMD_SHIFT determines the size of the area a second-level page table entry
+ * can map, and our pmd_t is 16 times larger than normal.  The values which
+ * were once defined here are now generic for 4c and srmmu, so they're
+ * found in pgtable.h.
+ */
+#define SRMMU_PTRS_PER_PMD     4
+
+/* Definition of the values in the ET field of PTD's and PTE's */
+#define SRMMU_ET_MASK         0x3
+#define SRMMU_ET_INVALID      0x0
+#define SRMMU_ET_PTD          0x1
+#define SRMMU_ET_PTE          0x2
+#define SRMMU_ET_REPTE        0x3      /* AIEEE, SuperSparc II reverse endian page! */
+
+/* Physical page extraction from PTP's and PTE's. */
+#define SRMMU_CTX_PMASK    0xfffffff0
+#define SRMMU_PTD_PMASK    0xfffffff0
+#define SRMMU_PTE_PMASK    0xffffff00
+
+/* The pte non-page bits.  Some notes:
+ * 1) cache, dirty, valid, and ref are frobbable
+ *    for both supervisor and user pages.
+ * 2) exec and write will only give the desired effect
+ *    on user pages
+ * 3) use priv and priv_readonly for changing the
+ *    characteristics of supervisor ptes
+ */
+#define SRMMU_CACHE        0x80
+#define SRMMU_DIRTY        0x40
+#define SRMMU_REF          0x20
+#define SRMMU_NOREAD       0x10
+#define SRMMU_EXEC         0x08
+#define SRMMU_WRITE        0x04
+#define SRMMU_VALID        0x02        /* SRMMU_ET_PTE */
+#define SRMMU_PRIV         0x1c
+#define SRMMU_PRIV_RDONLY  0x18
+
+#define SRMMU_FILE         0x40        /* Implemented in software */
+
+#define SRMMU_PTE_FILE_SHIFT     8     /* == 32-PTE_FILE_MAX_BITS */
+
+#define SRMMU_CHG_MASK    (0xffffff00 | SRMMU_REF | SRMMU_DIRTY)
+
+/* SRMMU swap entry encoding
+ *
+ * We use 5 bits for the type and 19 for the offset.  This gives us
+ * 32 swapfiles of 4GB each.  Encoding looks like:
+ *
+ * oooooooooooooooooootttttRRRRRRRR
+ * fedcba9876543210fedcba9876543210
+ *
+ * The bottom 8 bits are reserved for protection and status bits, especially
+ * FILE and PRESENT.
+ */
+#define SRMMU_SWP_TYPE_MASK    0x1f
+#define SRMMU_SWP_TYPE_SHIFT   SRMMU_PTE_FILE_SHIFT
+#define SRMMU_SWP_OFF_MASK     0x7ffff
+#define SRMMU_SWP_OFF_SHIFT    (SRMMU_PTE_FILE_SHIFT + 5)
+
+/* Some day I will implement true fine grained access bits for
+ * user pages because the SRMMU gives us the capabilities to
+ * enforce all the protection levels that vma's can have.
+ * XXX But for now...
+ */
+#define SRMMU_PAGE_NONE    __pgprot(SRMMU_CACHE | \
+                                   SRMMU_PRIV | SRMMU_REF)
+#define SRMMU_PAGE_SHARED  __pgprot(SRMMU_VALID | SRMMU_CACHE | \
+                                   SRMMU_EXEC | SRMMU_WRITE | SRMMU_REF)
+#define SRMMU_PAGE_COPY    __pgprot(SRMMU_VALID | SRMMU_CACHE | \
+                                   SRMMU_EXEC | SRMMU_REF)
+#define SRMMU_PAGE_RDONLY  __pgprot(SRMMU_VALID | SRMMU_CACHE | \
+                                   SRMMU_EXEC | SRMMU_REF)
+#define SRMMU_PAGE_KERNEL  __pgprot(SRMMU_VALID | SRMMU_CACHE | SRMMU_PRIV | \
+                                   SRMMU_DIRTY | SRMMU_REF)
+
+/* SRMMU Register addresses in ASI 0x4.  These are valid for all
+ * current SRMMU implementations that exist.
+ */
+#define SRMMU_CTRL_REG           0x00000000
+#define SRMMU_CTXTBL_PTR         0x00000100
+#define SRMMU_CTX_REG            0x00000200
+#define SRMMU_FAULT_STATUS       0x00000300
+#define SRMMU_FAULT_ADDR         0x00000400
+
+#define WINDOW_FLUSH(tmp1, tmp2)                                       \
+       mov     0, tmp1;                                                \
+98:    ld      [%g6 + TI_UWINMASK], tmp2;                              \
+       orcc    %g0, tmp2, %g0;                                         \
+       add     tmp1, 1, tmp1;                                          \
+       bne     98b;                                                    \
+        save   %sp, -64, %sp;                                          \
+99:    subcc   tmp1, 1, tmp1;                                          \
+       bne     99b;                                                    \
+        restore %g0, %g0, %g0;
+
+#ifndef __ASSEMBLY__
+
+/* This makes sense. Honest it does - Anton */
+/* XXX Yes but it's ugly as sin.  FIXME. -KMW */
+extern void *srmmu_nocache_pool;
+#define __nocache_pa(VADDR) (((unsigned long)VADDR) - SRMMU_NOCACHE_VADDR + __pa((unsigned long)srmmu_nocache_pool))
+#define __nocache_va(PADDR) (__va((unsigned long)PADDR) - (unsigned long)srmmu_nocache_pool + SRMMU_NOCACHE_VADDR)
+#define __nocache_fix(VADDR) __va(__nocache_pa(VADDR))
+
+/* Accessing the MMU control register. */
+extern __inline__ unsigned int srmmu_get_mmureg(void)
+{
+       unsigned int retval;
+       __asm__ __volatile__("lda [%%g0] %1, %0\n\t":
+                            "=r"(retval):"i"(ASI_M_MMUREGS));
+       return retval;
+}
+
+extern __inline__ void srmmu_set_mmureg(unsigned long regval)
+{
+       __asm__ __volatile__("sta %0, [%%g0] %1\n\t"::"r"(regval),
+                            "i"(ASI_M_MMUREGS):"memory");
+
+}
+
+extern __inline__ void srmmu_set_ctable_ptr(unsigned long paddr)
+{
+       paddr = ((paddr >> 4) & SRMMU_CTX_PMASK);
+       __asm__ __volatile__("sta %0, [%1] %2\n\t"::"r"(paddr),
+                            "r"(SRMMU_CTXTBL_PTR),
+                            "i"(ASI_M_MMUREGS):"memory");
+}
+
+extern __inline__ unsigned long srmmu_get_ctable_ptr(void)
+{
+       unsigned int retval;
+
+       __asm__ __volatile__("lda [%1] %2, %0\n\t":
+                            "=r"(retval):
+                            "r"(SRMMU_CTXTBL_PTR), "i"(ASI_M_MMUREGS));
+       return (retval & SRMMU_CTX_PMASK) << 4;
+}
+
+extern __inline__ void srmmu_set_context(int context)
+{
+       __asm__ __volatile__("sta %0, [%1] %2\n\t"::"r"(context),
+                            "r"(SRMMU_CTX_REG), "i"(ASI_M_MMUREGS):"memory");
+}
+
+extern __inline__ int srmmu_get_context(void)
+{
+       register int retval;
+       __asm__ __volatile__("lda [%1] %2, %0\n\t":
+                            "=r"(retval):
+                            "r"(SRMMU_CTX_REG), "i"(ASI_M_MMUREGS));
+       return retval;
+}
+
+extern __inline__ unsigned int srmmu_get_fstatus(void)
+{
+       unsigned int retval;
+
+       __asm__ __volatile__("lda [%1] %2, %0\n\t":
+                            "=r"(retval):
+                            "r"(SRMMU_FAULT_STATUS), "i"(ASI_M_MMUREGS));
+       return retval;
+}
+
+extern __inline__ unsigned int srmmu_get_faddr(void)
+{
+       unsigned int retval;
+
+       __asm__ __volatile__("lda [%1] %2, %0\n\t":
+                            "=r"(retval):
+                            "r"(SRMMU_FAULT_ADDR), "i"(ASI_M_MMUREGS));
+       return retval;
+}
+
+/* This is guaranteed on all SRMMU's. */
+extern __inline__ void srmmu_flush_whole_tlb(void)
+{
+       __asm__ __volatile__("sta %%g0, [%0] %1\n\t"::"r"(0x400),       /* Flush entire TLB!! */
+                            "i"(ASI_M_FLUSH_PROBE):"memory");
+
+}
+
+/* These flush types are not available on all chips... */
+extern __inline__ void srmmu_flush_tlb_ctx(void)
+{
+       __asm__ __volatile__("sta %%g0, [%0] %1\n\t"::"r"(0x300),       /* Flush TLB ctx.. */
+                            "i"(ASI_M_FLUSH_PROBE):"memory");
+
+}
+
+extern __inline__ void srmmu_flush_tlb_region(unsigned long addr)
+{
+       addr &= SRMMU_PGDIR_MASK;
+       __asm__ __volatile__("sta %%g0, [%0] %1\n\t"::"r"(addr | 0x200),        /* Flush TLB region.. */
+                            "i"(ASI_M_FLUSH_PROBE):"memory");
+
+}
+
+extern __inline__ void srmmu_flush_tlb_segment(unsigned long addr)
+{
+       addr &= SRMMU_REAL_PMD_MASK;
+       __asm__ __volatile__("sta %%g0, [%0] %1\n\t"::"r"(addr | 0x100),        /* Flush TLB segment.. */
+                            "i"(ASI_M_FLUSH_PROBE):"memory");
+
+}
+
+extern __inline__ void srmmu_flush_tlb_page(unsigned long page)
+{
+       page &= PAGE_MASK;
+       __asm__ __volatile__("sta %%g0, [%0] %1\n\t"::"r"(page),        /* Flush TLB page.. */
+                            "i"(ASI_M_FLUSH_PROBE):"memory");
+
+}
+
+extern __inline__ unsigned long srmmu_hwprobe(unsigned long vaddr)
+{
+       unsigned long retval;
+
+       vaddr &= PAGE_MASK;
+       __asm__ __volatile__("lda [%1] %2, %0\n\t":
+                            "=r"(retval):
+                            "r"(vaddr | 0x400), "i"(ASI_M_FLUSH_PROBE));
+
+       return retval;
+}
+
+extern __inline__ int srmmu_get_pte(unsigned long addr)
+{
+       register unsigned long entry;
+
+       __asm__ __volatile__("\n\tlda [%1] %2,%0\n\t":
+                            "=r"(entry):
+                            "r"((addr & 0xfffff000) | 0x400),
+                            "i"(ASI_M_FLUSH_PROBE));
+       return entry;
+}
+
+extern unsigned long (*srmmu_read_physical) (unsigned long paddr);
+extern void (*srmmu_write_physical) (unsigned long paddr, unsigned long word);
+
+#endif                         /* !(__ASSEMBLY__) */
+
+#endif                         /* !(__SPARC_SRMMU_H__) */
diff --git a/include/asm-sparc/stack.h b/include/asm-sparc/stack.h
new file mode 100644 (file)
index 0000000..b40a9f3
--- /dev/null
@@ -0,0 +1,162 @@
+/* SPARC stack layout Macros and structures,
+ * mainly taken from BCC (the Bare C compiler for
+ * SPARC LEON2/3) sources.
+ *
+ * (C) Copyright 2007
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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 __SPARC_STACK_H__
+#define __SPARC_STACK_H__
+
+#include <asm/ptrace.h>
+
+#ifndef __ASSEMBLER__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define PT_REGS_SZ   sizeof(struct pt_regs)
+
+/* A Sparc stack frame */
+       struct sparc_stackframe_regs {
+               unsigned long sf_locals[8];
+               unsigned long sf_ins[6];
+               struct sparc_stackframe_regs *sf_fp;
+               unsigned long sf_callers_pc;
+               char *sf_structptr;
+               unsigned long sf_xargs[6];
+               unsigned long sf_xxargs[1];
+       };
+#define SF_REGS_SZ sizeof(struct sparc_stackframe_regs)
+
+/* A register window */
+       struct sparc_regwindow_regs {
+               unsigned long locals[8];
+               unsigned long ins[8];
+       };
+#define RW_REGS_SZ sizeof(struct sparc_regwindow_regs)
+
+/* A fpu window */
+       struct sparc_fpuwindow_regs {
+               unsigned long locals[32];
+               unsigned long fsr;
+               unsigned long lastctx;
+       };
+#define FW_REGS_SZ sizeof(struct sparc_fpuwindow_regs)
+
+#ifdef __cplusplus
+}
+#endif
+#else
+#define PT_REGS_SZ     0x50    /* 20*4 */
+#define SF_REGS_SZ     0x60    /* 24*4 */
+#define RW_REGS_SZ     0x20    /* 16*4 */
+#define FW_REGS_SZ     0x88    /* 34*4 */
+#endif                         /* !ASM */
+
+/* These are for pt_regs. */
+#define PT_PSR         0x0
+#define PT_PC          0x4
+#define PT_NPC         0x8
+#define PT_Y           0xc
+#define PT_G0          0x10
+#define PT_WIM         PT_G0
+#define PT_G1          0x14
+#define PT_G2          0x18
+#define PT_G3          0x1c
+#define PT_G4          0x20
+#define PT_G5          0x24
+#define PT_G6          0x28
+#define PT_G7          0x2c
+#define PT_I0          0x30
+#define PT_I1          0x34
+#define PT_I2          0x38
+#define PT_I3          0x3c
+#define PT_I4          0x40
+#define PT_I5          0x44
+#define PT_I6          0x48
+#define PT_FP          PT_I6
+#define PT_I7          0x4c
+
+/* Stack_frame offsets */
+#define SF_L0          0x00
+#define SF_L1          0x04
+#define SF_L2          0x08
+#define SF_L3          0x0c
+#define SF_L4          0x10
+#define SF_L5          0x14
+#define SF_L6          0x18
+#define SF_L7          0x1c
+#define SF_I0          0x20
+#define SF_I1          0x24
+#define SF_I2          0x28
+#define SF_I3          0x2c
+#define SF_I4          0x30
+#define SF_I5          0x34
+#define SF_FP          0x38
+#define SF_PC          0x3c
+#define SF_RETP                0x40
+#define SF_XARG0       0x44
+#define        SF_XARG1        0x48
+#define        SF_XARG2        0x4c
+#define        SF_XARG3        0x50
+#define        SF_XARG4        0x54
+#define        SF_XARG5        0x58
+#define        SF_XXARG        0x5c
+
+/* Reg_window offsets */
+#define RW_L0          0x00
+#define RW_L1          0x04
+#define RW_L2          0x08
+#define RW_L3          0x0c
+#define RW_L4          0x10
+#define RW_L5          0x14
+#define RW_L6          0x18
+#define RW_L7          0x1c
+#define RW_I0          0x20
+#define RW_I1          0x24
+#define RW_I2          0x28
+#define RW_I3          0x2c
+#define RW_I4          0x30
+#define RW_I5          0x34
+#define RW_I6          0x38
+#define RW_I7          0x3c
+
+/* Fpu_window offsets */
+#define FW_F0          0x00
+#define FW_F2          0x08
+#define FW_F4          0x10
+#define FW_F6          0x18
+#define FW_F8          0x20
+#define FW_F10         0x28
+#define FW_F12         0x30
+#define FW_F14         0x38
+#define FW_F16         0x40
+#define FW_F18         0x48
+#define FW_F20         0x50
+#define FW_F22         0x58
+#define FW_F24         0x60
+#define FW_F26         0x68
+#define FW_F28         0x70
+#define FW_F30         0x78
+#define FW_FSR         0x80
+
+#endif
diff --git a/include/asm-sparc/string.h b/include/asm-sparc/string.h
new file mode 100644 (file)
index 0000000..c6bbc20
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * (C) Copyright 2000 - 2002
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * (C) Copyright 2007
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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 _SPARC_STRING_H_
+#define _SPARC_STRING_H_
+
+/*
+#define __HAVE_ARCH_STRCPY
+#define __HAVE_ARCH_STRNCPY
+#define __HAVE_ARCH_STRLEN
+#define __HAVE_ARCH_STRCMP
+#define __HAVE_ARCH_STRCAT
+#define __HAVE_ARCH_MEMSET
+#define __HAVE_ARCH_BCOPY
+#define __HAVE_ARCH_MEMCPY
+#define __HAVE_ARCH_MEMMOVE
+#define __HAVE_ARCH_MEMCMP
+#define __HAVE_ARCH_MEMCHR
+*/
+
+extern int strcasecmp(const char *, const char *);
+extern int strncasecmp(const char *, const char *, int);
+extern char *strcpy(char *, const char *);
+extern char *strncpy(char *, const char *, __kernel_size_t);
+extern __kernel_size_t strlen(const char *);
+extern int strcmp(const char *, const char *);
+extern char *strcat(char *, const char *);
+extern void *memset(void *, int, __kernel_size_t);
+extern void *memcpy(void *, const void *, __kernel_size_t);
+extern void *memmove(void *, const void *, __kernel_size_t);
+extern int memcmp(const void *, const void *, __kernel_size_t);
+extern void *memchr(const void *, int, __kernel_size_t);
+
+#endif
diff --git a/include/asm-sparc/types.h b/include/asm-sparc/types.h
new file mode 100644 (file)
index 0000000..69f93d6
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * (C) Copyright 2000 - 2002
+ * Wolfgang Denk, DENX Software Engineering, wd@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.
+ *
+ * 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 _SPARC_TYPES_H
+#define _SPARC_TYPES_H
+
+#ifndef __ASSEMBLY__
+
+typedef unsigned short umode_t;
+
+typedef __signed__ char __s8;
+typedef unsigned char __u8;
+
+typedef __signed__ short __s16;
+typedef unsigned short __u16;
+
+typedef __signed__ int __s32;
+typedef unsigned int __u32;
+
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+typedef __signed__ long long __s64;
+typedef unsigned long long __u64;
+#endif
+
+typedef struct {
+       __u32 u[4];
+} __attribute((aligned(16))) vector128;
+
+#ifdef __KERNEL__
+/*
+ * These aren't exported outside the kernel to avoid name space clashes
+ */
+typedef signed char s8;
+typedef unsigned char u8;
+
+typedef signed short s16;
+typedef unsigned short u16;
+
+typedef signed int s32;
+typedef unsigned int u32;
+
+typedef signed long long s64;
+typedef unsigned long long u64;
+
+#define BITS_PER_LONG 32
+
+/* DMA addresses are 32-bits wide */
+typedef u32 dma_addr_t;
+
+#endif                         /* __KERNEL__ */
+#endif                         /* __ASSEMBLY__ */
+
+#endif
diff --git a/include/asm-sparc/u-boot.h b/include/asm-sparc/u-boot.h
new file mode 100644 (file)
index 0000000..9c594e1
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * (C) Copyright 2000 - 2002
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * (C) Copyright 2007, From asm-ppc/u-boot.h
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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
+ *
+ ********************************************************************
+ * NOTE: This header file defines an interface to U-Boot. Including
+ * this (unmodified) header file in another file is considered normal
+ * use of U-Boot, and does *not* fall under the heading of "derived
+ * work".
+ ********************************************************************
+ */
+
+#ifndef __U_BOOT_H__
+#define __U_BOOT_H__
+
+/*
+ * Currently, this Board information is not passed to
+ * Linux kernel from U-Boot, but may be passed to other
+ * Operating systems. This is because U-boot emulates
+ * a SUN PROM loader (from Linux point of view).
+ *
+ * include/asm-sparc/u-boot.h
+ */
+
+#ifndef __ASSEMBLY__
+
+typedef struct bd_info {
+       unsigned long bi_memstart;      /* start of DRAM memory */
+       unsigned long bi_memsize;       /* size  of DRAM memory in bytes */
+       unsigned long bi_flashstart;    /* start of FLASH memory */
+       unsigned long bi_flashsize;     /* size  of FLASH memory */
+       unsigned long bi_flashoffset;   /* reserved area for startup monitor */
+       unsigned long bi_sramstart;     /* start of SRAM memory */
+       unsigned long bi_sramsize;      /* size  of SRAM memory */
+       unsigned long bi_bootflags;     /* boot / reboot flag (for LynxOS) */
+       unsigned long bi_ip_addr;       /* IP Address */
+       unsigned char bi_enetaddr[6];   /* Ethernet adress */
+       unsigned short bi_ethspeed;     /* Ethernet speed in Mbps */
+       unsigned long bi_intfreq;       /* Internal Freq, in MHz */
+       unsigned long bi_busfreq;       /* Bus Freq, in MHz */
+       unsigned long bi_baudrate;      /* Console Baudrate */
+#ifdef CONFIG_HAS_ETH1
+       /* second onboard ethernet port */
+       unsigned char bi_enet1addr[6];
+#endif
+#ifdef CONFIG_HAS_ETH2
+       /* third onboard ethernet port */
+       unsigned char bi_enet2addr[6];
+#endif
+#ifdef CONFIG_HAS_ETH3
+       unsigned char bi_enet3addr[6];
+#endif
+} bd_t;
+
+#endif                         /* __ASSEMBLY__ */
+#endif                         /* __U_BOOT_H__ */
diff --git a/include/asm-sparc/winmacro.h b/include/asm-sparc/winmacro.h
new file mode 100644 (file)
index 0000000..66fc639
--- /dev/null
@@ -0,0 +1,151 @@
+/*
+ * Added to U-boot,
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.com
+ * Copyright (C) 2007
+ *
+ * LEON2/3 LIBIO low-level routines
+ * Written by Jiri Gaisler.
+ * Copyright (C) 2004  Gaisler Research AB
+
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the 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 __SPARC_WINMACRO_H__
+#define __SPARC_WINMACRO_H__
+
+#include <asm/asmmacro.h>
+#include <asm/stack.h>
+
+/* Store the register window onto the 8-byte aligned area starting
+ * at %reg.  It might be %sp, it might not, we don't care.
+ */
+#define RW_STORE(reg) \
+       std     %l0, [%reg + RW_L0]; \
+       std     %l2, [%reg + RW_L2]; \
+       std     %l4, [%reg + RW_L4]; \
+       std     %l6, [%reg + RW_L6]; \
+       std     %i0, [%reg + RW_I0]; \
+       std     %i2, [%reg + RW_I2]; \
+       std     %i4, [%reg + RW_I4]; \
+       std     %i6, [%reg + RW_I6];
+
+/* Load a register window from the area beginning at %reg. */
+#define RW_LOAD(reg) \
+       ldd     [%reg + RW_L0], %l0; \
+       ldd     [%reg + RW_L2], %l2; \
+       ldd     [%reg + RW_L4], %l4; \
+       ldd     [%reg + RW_L6], %l6; \
+       ldd     [%reg + RW_I0], %i0; \
+       ldd     [%reg + RW_I2], %i2; \
+       ldd     [%reg + RW_I4], %i4; \
+       ldd     [%reg + RW_I6], %i6;
+
+/* Loading and storing struct pt_reg trap frames. */
+#define PT_LOAD_INS(base_reg) \
+       ldd     [%base_reg + SF_REGS_SZ + PT_I0], %i0; \
+       ldd     [%base_reg + SF_REGS_SZ + PT_I2], %i2; \
+       ldd     [%base_reg + SF_REGS_SZ + PT_I4], %i4; \
+       ldd     [%base_reg + SF_REGS_SZ + PT_I6], %i6;
+
+#define PT_LOAD_GLOBALS(base_reg) \
+       ld      [%base_reg + SF_REGS_SZ + PT_G1], %g1; \
+       ldd     [%base_reg + SF_REGS_SZ + PT_G2], %g2; \
+       ldd     [%base_reg + SF_REGS_SZ + PT_G4], %g4; \
+       ldd     [%base_reg + SF_REGS_SZ + PT_G6], %g6;
+
+#define PT_LOAD_YREG(base_reg, scratch) \
+       ld      [%base_reg + SF_REGS_SZ + PT_Y], %scratch; \
+       wr      %scratch, 0x0, %y;
+
+#define PT_LOAD_PRIV(base_reg, pt_psr, pt_pc, pt_npc) \
+       ld      [%base_reg + SF_REGS_SZ + PT_PSR], %pt_psr; \
+       ld      [%base_reg + SF_REGS_SZ + PT_PC], %pt_pc; \
+       ld      [%base_reg + SF_REGS_SZ + PT_NPC], %pt_npc;
+
+#define PT_LOAD_ALL(base_reg, pt_psr, pt_pc, pt_npc, scratch) \
+       PT_LOAD_YREG(base_reg, scratch) \
+       PT_LOAD_INS(base_reg) \
+       PT_LOAD_GLOBALS(base_reg) \
+       PT_LOAD_PRIV(base_reg, pt_psr, pt_pc, pt_npc)
+
+#define PT_STORE_INS(base_reg) \
+       std     %i0, [%base_reg + SF_REGS_SZ + PT_I0]; \
+       std     %i2, [%base_reg + SF_REGS_SZ + PT_I2]; \
+       std     %i4, [%base_reg + SF_REGS_SZ + PT_I4]; \
+       std     %i6, [%base_reg + SF_REGS_SZ + PT_I6];
+
+#define PT_STORE_GLOBALS(base_reg) \
+       st      %g1, [%base_reg + SF_REGS_SZ + PT_G1]; \
+       std     %g2, [%base_reg + SF_REGS_SZ + PT_G2]; \
+       std     %g4, [%base_reg + SF_REGS_SZ + PT_G4]; \
+       std     %g6, [%base_reg + SF_REGS_SZ + PT_G6];
+
+#define PT_STORE_YREG(base_reg, scratch) \
+       rd      %y, %scratch; \
+       st      %scratch, [%base_reg + SF_REGS_SZ + PT_Y];
+
+#define PT_STORE_PRIV(base_reg, pt_psr, pt_pc, pt_npc) \
+       st      %pt_psr, [%base_reg + SF_REGS_SZ + PT_PSR]; \
+       st      %pt_pc,  [%base_reg + SF_REGS_SZ + PT_PC]; \
+       st      %pt_npc, [%base_reg + SF_REGS_SZ + PT_NPC];
+
+#define PT_STORE_ALL(base_reg, reg_psr, reg_pc, reg_npc, g_scratch) \
+       PT_STORE_PRIV(base_reg, reg_psr, reg_pc, reg_npc) \
+       PT_STORE_GLOBALS(base_reg) \
+       PT_STORE_YREG(base_reg, g_scratch) \
+       PT_STORE_INS(base_reg)
+
+/* Store the fpu register window*/
+#define FW_STORE(reg) \
+       std     %f0, [reg + FW_F0]; \
+       std     %f2, [reg + FW_F2]; \
+       std     %f4, [reg + FW_F4]; \
+       std     %f6, [reg + FW_F6]; \
+       std     %f8, [reg + FW_F8]; \
+       std     %f10, [reg + FW_F10]; \
+       std     %f12, [reg + FW_F12]; \
+       std     %f14, [reg + FW_F14]; \
+       std     %f16, [reg + FW_F16]; \
+       std     %f18, [reg + FW_F18]; \
+       std     %f20, [reg + FW_F20]; \
+       std     %f22, [reg + FW_F22]; \
+       std     %f24, [reg + FW_F24]; \
+       std     %f26, [reg + FW_F26]; \
+       std     %f28, [reg + FW_F28]; \
+       std     %f30, [reg + FW_F30]; \
+       st      %fsr, [reg + FW_FSR];
+
+/* Load a fpu register window from the area beginning at reg. */
+#define FW_LOAD(reg) \
+       ldd     [reg + FW_F0], %f0; \
+       ldd     [reg + FW_F2], %f2; \
+       ldd     [reg + FW_F4], %f4; \
+       ldd     [reg + FW_F6], %f6; \
+       ldd     [reg + FW_F8], %f8; \
+       ldd     [reg + FW_F10], %f10; \
+       ldd     [reg + FW_F12], %f12; \
+       ldd     [reg + FW_F14], %f14; \
+       ldd     [reg + FW_F16], %f16; \
+       ldd     [reg + FW_F18], %f18; \
+       ldd     [reg + FW_F20], %f20; \
+       ldd     [reg + FW_F22], %f22; \
+       ldd     [reg + FW_F24], %f24; \
+       ldd     [reg + FW_F26], %f26; \
+       ldd     [reg + FW_F28], %f28; \
+       ldd     [reg + FW_F30], %f30; \
+       ld      [reg + FW_FSR], %fsr;
+
+#endif
index 8d435b9..f12e3bd 100644 (file)
@@ -222,16 +222,14 @@ int mac_read_from_eeprom(void);
 void flash_perror (int);
 
 /* common/cmd_autoscript.c */
-int    autoscript (ulong addr);
-
-/* common/cmd_bootm.c */
-void   print_image_hdr (image_header_t *hdr);
+int    autoscript (ulong addr, const char *fit_uname);
 
 extern ulong load_addr;                /* Default Load Address */
 
 /* common/cmd_nvedit.c */
 int    env_init     (void);
 void   env_relocate (void);
+uchar  env_get_char (int);
 int    envmatch     (uchar *, int);
 char   *getenv      (char *);
 int    getenv_r     (char *name, char *buf, unsigned len);
@@ -606,8 +604,9 @@ int sprintf(char * buf, const char *fmt, ...);
 int    vsprintf(char *buf, const char *fmt, va_list args);
 
 /* lib_generic/crc32.c */
-ulong crc32 (ulong, const unsigned char *, uint);
-ulong crc32_no_comp (ulong, const unsigned char *, uint);
+uint32_t crc32 (uint32_t, const unsigned char *, uint);
+uint32_t crc32_wd (uint32_t, const unsigned char *, uint, uint);
+uint32_t crc32_no_comp (uint32_t, const unsigned char *, uint);
 
 /* common/console.c */
 int    console_init_f(void);   /* Before relocation; uses the serial  stuff    */
@@ -663,7 +662,7 @@ int pcmcia_init (void);
 /*
  * Board-specific Platform code can reimplement show_boot_progress () if needed
  */
-void inline show_boot_progress (int val);
+void __attribute__((weak)) show_boot_progress (int val);
 
 #ifdef CONFIG_INIT_CRITICAL
 #error CONFIG_INIT_CRITICAL is deprecated!
@@ -672,6 +671,9 @@ void inline show_boot_progress (int val);
 
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
 
+#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
+#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
+
 /* Multicore arch functions */
 #ifdef CONFIG_MP
 int cpu_status(int nr);
index f3965ef..d1b5ffb 100644 (file)
@@ -13,6 +13,7 @@
  * Alphabetical list of all possible commands.
  */
 
+#define CONFIG_CMD_AMBAPP      /* AMBA Plug & Play Bus print utility */
 #define CONFIG_CMD_ASKENV      /* ask for env variable         */
 #define CONFIG_CMD_AUTOSCRIPT  /* Autoscript Support           */
 #define CONFIG_CMD_BDI         /* bdinfo                       */
@@ -70,6 +71,7 @@
 #define CONFIG_CMD_SAVES       /* save S record dump           */
 #define CONFIG_CMD_SCSI                /* SCSI Support                 */
 #define CONFIG_CMD_SDRAM       /* SDRAM DIMM SPD info printout */
+#define CONFIG_CMD_SETEXPR     /* setexpr support              */
 #define CONFIG_CMD_SETGETDCR   /* DCR support on 4xx           */
 #define CONFIG_CMD_SNTP                /* SNTP support                 */
 #define CONFIG_CMD_SPI         /* SPI utility                  */
index f6495e4..e2ab39d 100644 (file)
@@ -1,4 +1,7 @@
 /*
+ * (C) Copyright 2005-2008
+ * Matthias Fuchs, esd gmbh germany, matthias.fuchs@esd-electronics.com
+ *
  * (C) Copyright 2001-2004
  * Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.com
  *
@@ -24,7 +27,6 @@
 /*
  * board/config.h - configuration options, board specific
  */
-
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
  * High Level Configuration Options
  * (easy to change)
  */
-
 #define CONFIG_405GP           1       /* This is a PPC405 CPU         */
 #define CONFIG_4xx             1       /* ...member of PPC4xx family   */
 #define CONFIG_APCG405         1       /* ...on a APC405 board         */
 
 #define CONFIG_BOARD_EARLY_INIT_F 1    /* call board_early_init_f()    */
+#define CONFIG_BOARD_EARLY_INIT_R 1
 #define CONFIG_MISC_INIT_R      1       /* call misc_init_r()           */
 
 #define CONFIG_SYS_CLK_FREQ     33333400 /* external frequency to pll   */
 
 #define CONFIG_BOARD_TYPES     1       /* support board types          */
 
-#define CONFIG_BAUDRATE                9600
-#define CONFIG_BOOTDELAY       3       /* autoboot after 3 seconds     */
+#define CONFIG_BAUDRATE                115200
+#define CONFIG_BOOTDELAY       1       /* autoboot after 3 seconds     */
 
 #undef CONFIG_BOOTARGS
-#define CONFIG_RAMBOOTCOMMAND                                                  \
-       "setenv bootargs root=/dev/ram rw nfsroot=${serverip}:${rootpath} "     \
-       "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off;"    \
-       "bootm ffc00000 ffca0000"
-#define CONFIG_NFSBOOTCOMMAND                                                  \
-       "setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${rootpath} "     \
-       "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off;"    \
-       "bootm ffc00000"
-#define CONFIG_BOOTCOMMAND CONFIG_RAMBOOTCOMMAND
+
+#define CFG_USB_LOAD_COMMAND   "fatload usb 0 200000 pImage;"          \
+                               "fatload usb 0 300000 pImage.initrd"
+#define CFG_USB_SELF_COMMAND   "usb start;run usb_load;usb stop;"      \
+                               "run ramargs addip addcon usbargs;"     \
+                               "bootm 200000 300000"
+#define CFG_USB_ARGS           "setenv bootargs $(bootargs) usbboot=1"
+
+#define CONFIG_EXTRA_ENV_SETTINGS                                       \
+       "hostname=abg405\0"                                             \
+       "bd_type=abg405\0"                                              \
+       "serial#=AA0000\0"                                              \
+       "kernel_addr=fe000000\0"                                        \
+       "ramdisk_addr=fe100000\0"                                       \
+       "ramargs=setenv bootargs root=/dev/ram rw\0"                    \
+       "nfsargs=setenv bootargs root=/dev/nfs rw "                     \
+       "nfsroot=$(serverip):$(rootpath)\0"                             \
+       "addip=setenv bootargs $(bootargs) "                            \
+               "ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask)"      \
+               ":$(hostname)::off panic=1\0"                           \
+       "addcon=setenv bootargs $(bootargs) console=ttyS0,$(baudrate)"  \
+               " $(optargs)\0"                                         \
+       "flash_self=run ramargs addip addcon;"                          \
+               "bootm $(kernel_addr) $(ramdisk_addr)\0"                \
+       "net_nfs=tftp 200000 $(img);run nfsargs addip addcon;"          \
+               "bootm\0"                                               \
+       "rootpath=/tftpboot/abg405/target_root\0"                       \
+       "img=/tftpboot/abg405/pImage\0"                                 \
+       "load=tftp 100000 /tftpboot/abg405/u-boot.bin\0"                \
+       "update=protect off fff80000 ffffffff;era fff80000 ffffffff;"   \
+               "cp.b 100000 fff80000 80000\0"                          \
+       "ipaddr=10.0.111.111\0"                                         \
+       "netmask=255.255.0.0\0"                                         \
+       "serverip=10.0.0.190\0"                                         \
+       "splashimage=ffe80000\0"                                        \
+       "usb_load="CFG_USB_LOAD_COMMAND"\0"                             \
+       "usb_self="CFG_USB_SELF_COMMAND"\0"                             \
+       "usbargs="CFG_USB_ARGS"\0"                                      \
+       ""
+#define CONFIG_BOOTCOMMAND     "run flash_self;run usb_self"
+
+#define CONFIG_ETHADDR         00:02:27:8e:00:00
 
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download  */
 #define CFG_LOADS_BAUD_CHANGE  1       /* allow baudrate change        */
 
+#define CONFIG_NET_MULTI       1
+#undef  CONFIG_HAS_ETH1
+
 #define CONFIG_MII             1       /* MII PHY management           */
-#define        CONFIG_PHY_ADDR         0       /* PHY address                  */
-#define CONFIG_LXT971_NO_SLEEP  1       /* disable sleep mode in LXT971 */
+#define CONFIG_PHY_ADDR                0       /* PHY address                  */
+#define CONFIG_LXT971_NO_SLEEP 1
+#define CONFIG_RESET_PHY_R     1       /* use reset_phy() */
 
 #define CONFIG_PHY_CLK_FREQ    EMAC_STACR_CLK_66MHZ /* 66 MHz OPB clock*/
 
-
 /*
  * BOOTP options
  */
 #define CONFIG_BOOTP_GATEWAY
 #define CONFIG_BOOTP_HOSTNAME
 
-
 /*
  * Command line configuration.
  */
 #define CONFIG_CMD_MII
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_USB
+#define CONFIG_CMD_AUTOSCRIPT
 
 #define CONFIG_MAC_PARTITION
 #define CONFIG_DOS_PARTITION
 
 #define CONFIG_SUPPORT_VFAT
 
-#undef  CONFIG_WATCHDOG                        /* watchdog disabled            */
+#define CONFIG_AUTO_UPDATE     1       /* autoupdate via CF or USB */
 
-#define CONFIG_RTC_MC146818             /* DS1685 is MC146818 compatible*/
-#define CFG_RTC_REG_BASE_ADDR   0xF0000500 /* RTC Base Address         */
+#undef  CONFIG_WATCHDOG                        /* watchdog disabled */
 
-#define        CONFIG_SDRAM_BANK0      1       /* init onboard SDRAM bank 0    */
+#define CONFIG_RTC_MC146818            /* DS1685 is MC146818 compatible*/
+#define CFG_RTC_REG_BASE_ADDR 0xF0000500 /* RTC Base Address */
+
+#define CONFIG_SDRAM_BANK0     1       /* init onboard SDRAM bank 0 */
 
 /*
  * Miscellaneous configurable options
  */
-#define CFG_LONGHELP                   /* undef to save memory         */
-#define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
-
-#undef CFG_HUSH_PARSER                 /* use "hush" command parser    */
-#ifdef CFG_HUSH_PARSER
-#define        CFG_PROMPT_HUSH_PS2     "> "
-#endif
+#define CFG_LONGHELP                   /* undef to save memory */
+#define CFG_PROMPT     "=> "           /* Monitor Command Prompt */
+#define CONFIG_CMDLINE_EDITING 1       /* add command line history */
 
 #if defined(CONFIG_CMD_KGDB)
-#define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
+#define CFG_CBSIZE     1024            /* Console I/O Buffer Size */
 #else
-#define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
+#define CFG_CBSIZE     256             /* Console I/O Buffer Size */
 #endif
 #define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
-#define CFG_MAXARGS    16              /* max number of command args   */
-#define CFG_BARGSIZE   CFG_CBSIZE      /* Boot Argument Buffer Size    */
+#define CFG_MAXARGS    16              /* max number of command args */
+#define CFG_BARGSIZE   CFG_CBSIZE      /* Boot Argument Buffer Size */
 
-#define CFG_DEVICE_NULLDEV      1       /* include nulldev device       */
+#define CFG_DEVICE_NULLDEV     1       /* include nulldev device */
 
-#define CFG_CONSOLE_INFO_QUIET  1       /* don't print console @ startup*/
+#define CFG_CONSOLE_INFO_QUIET 1       /* don't print console @ startup*/
 
-#define CFG_MEMTEST_START      0x0400000       /* memtest works on     */
-#define CFG_MEMTEST_END                0x0C00000       /* 4 ... 12 MB in DRAM  */
+#define CFG_MEMTEST_START      0x0400000 /* memtest works on */
+#define CFG_MEMTEST_END                0x0C00000 /* 4 ... 12 MB in DRAM */
 
-#if 1 /* test-only */
 #define CFG_EXT_SERIAL_CLOCK    14745600 /* use external serial clock   */
-#else
-#undef  CFG_EXT_SERIAL_CLOCK           /* no external serial clock used */
-#define CFG_IGNORE_405_UART_ERRATA_59   /* ignore ppc405gp errata #59   */
-#define CFG_BASE_BAUD       691200
-#endif
 
 /* The following table includes the supported baudrates */
 #define CFG_BAUDRATE_TABLE      \
-       { 300, 600, 1200, 2400, 4800, 9600, 19200, 38400,     \
+       { 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, \
         57600, 115200, 230400, 460800, 921600 }
 
 #define CFG_LOAD_ADDR  0x100000        /* default load address */
 #define CFG_EXTBDINFO  1               /* To use extended board_into (bd_t) */
 
-#define        CFG_HZ          1000            /* decrementer freq: 1 ms ticks */
+#define        CFG_HZ          1000            /* decrementer freq: 1 ms ticks */
 
 #define CONFIG_ZERO_BOOTDELAY_CHECK    /* check for keypress on bootdelay==0 */
 
 /* Only interrupt boot if space is pressed */
 /* If a long serial cable is connected but */
 /* other end is dead, garbage will be read */
-#define CONFIG_AUTOBOOT_KEYED 1
-#define CONFIG_AUTOBOOT_PROMPT "Press SPACE to abort autoboot in %d seconds\n"
-#define CONFIG_AUTOBOOT_DELAY_STR "d"
+#define CONFIG_AUTOBOOT_KEYED  1
+#define CONFIG_AUTOBOOT_PROMPT "Press SPACE to abort autoboot in %d seconds\n"
+#undef CONFIG_AUTOBOOT_DELAY_STR
 #define CONFIG_AUTOBOOT_STOP_STR " "
 
-#define CONFIG_VERSION_VARIABLE        1       /* include version env variable */
+#define CONFIG_VERSION_VARIABLE        1       /* include version env variable */
 
-#define CFG_RX_ETH_BUFFER      16      /* use 16 rx buffer on 405 emac */
+#define CFG_RX_ETH_BUFFER      16      /* use 16 rx buffer on 405 emac */
 
-/*-----------------------------------------------------------------------
+/*
  * PCI stuff
- *-----------------------------------------------------------------------
  */
-#define PCI_HOST_ADAPTER 0              /* configure as pci adapter     */
-#define PCI_HOST_FORCE  1               /* configure as pci host        */
-#define PCI_HOST_AUTO   2               /* detected via arbiter enable  */
+#define PCI_HOST_ADAPTER       0       /* configure as pci adapter     */
+#define PCI_HOST_FORCE         1       /* configure as pci host        */
+#define PCI_HOST_AUTO          2       /* detected via arbiter enable  */
 
-#define CONFIG_PCI                     /* include pci support          */
-#define CONFIG_PCI_HOST        PCI_HOST_FORCE  /* select pci host function     */
+#define CONFIG_PCI                     /* include pci support          */
+#define CONFIG_PCI_HOST PCI_HOST_FORCE /* select pci host function     */
 #define CONFIG_PCI_PNP                 /* do pci plug-and-play         */
                                        /* resource configuration       */
 
-#define CONFIG_PCI_SCAN_SHOW            /* print pci devices @ startup  */
-
-#define CONFIG_PCI_CONFIG_HOST_BRIDGE 1 /* don't skip host bridge config*/
-
+#define CONFIG_PCI_SCAN_SHOW           /* print pci devices @ startup  */
+#define CONFIG_PCI_SKIP_HOST_BRIDGE 1
 #define CFG_PCI_SUBSYS_VENDORID 0x12FE  /* PCI Vendor ID: esd gmbh      */
 #define CFG_PCI_SUBSYS_DEVICEID 0x0405  /* PCI Device ID: CPCI-405      */
 #define CFG_PCI_CLASSCODE       0x0b20  /* PCI Class Code: Processor/PPC*/
 #define CFG_PCI_PTM2MS  0xffc00001      /* 4MB, enable                  */
 #define CFG_PCI_PTM2PCI 0x04000000      /* Host: use this pci address   */
 
-/*-----------------------------------------------------------------------
+/*
  * IDE/ATA stuff
- *-----------------------------------------------------------------------
  */
-#undef  CONFIG_IDE_8xx_DIRECT               /* no pcmcia interface required */
-#undef  CONFIG_IDE_LED                  /* no led for ide supported     */
-#define CONFIG_IDE_RESET       1       /* reset for ide supported      */
+#undef  CONFIG_IDE_8xx_DIRECT          /* no pcmcia interface required */
+#undef  CONFIG_IDE_LED                 /* no led for ide supported */
+#define CONFIG_IDE_RESET       1       /* reset for ide supported */
 
-#define        CFG_IDE_MAXBUS          1               /* max. 1 IDE busses    */
-#define        CFG_IDE_MAXDEVICE       (CFG_IDE_MAXBUS*1) /* max. 1 drives per IDE bus */
+#define CFG_IDE_MAXBUS         1               /* max. 1 IDE busses */
+#define CFG_IDE_MAXDEVICE      (CFG_IDE_MAXBUS) /* max. 1 drives per IDE bus */
 
-#define        CFG_ATA_BASE_ADDR       0xF0100000
-#define        CFG_ATA_IDE0_OFFSET     0x0000
+#define CFG_ATA_BASE_ADDR      0xF0100000
+#define CFG_ATA_IDE0_OFFSET    0x0000
 
-#define CFG_ATA_DATA_OFFSET    0x0000  /* Offset for data I/O                  */
-#define        CFG_ATA_REG_OFFSET      0x0000  /* Offset for normal register accesses  */
-#define CFG_ATA_ALT_OFFSET     0x0000  /* Offset for alternate registers       */
+#define CFG_ATA_DATA_OFFSET    0x0000  /* Offset for data I/O */
+#define CFG_ATA_REG_OFFSET     0x0000  /* Offset for normal register access */
+#define CFG_ATA_ALT_OFFSET     0x0000  /* Offset for alternate registers */
 
-/*-----------------------------------------------------------------------
+/*
  * Start addresses for the final memory configuration
  * (Set up by the startup code)
  * Please note that CFG_SDRAM_BASE _must_ start at 0
  */
 #define CFG_SDRAM_BASE         0x00000000
 #define CFG_MONITOR_BASE       0xFFF80000
-#define CFG_MONITOR_LEN                (512 * 1024)    /* Reserve 512 kB for Monitor   */
-#define CFG_MALLOC_LEN         (2*1024*1024)   /* Reserve 2MB for malloc()     */
+#define CFG_MONITOR_LEN                (512 * 1024)    /* Reserve 512 kB for Monitor */
+#define CFG_MALLOC_LEN         (2*1024*1024)   /* Reserve 2MB for malloc() */
 
 /*
  * 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 CFG_BOOTMAPSZ          (8 << 20)       /* Initial Memory map for Linux */
+#define CFG_BOOTMAPSZ          (8 << 20)       /* Init. Memory map for Linux */
 
-/*-----------------------------------------------------------------------
+/*
  * FLASH organization
  */
-#define CFG_FLASH_CFI          1       /* Flash is CFI conformant              */
-#define CFG_MAX_FLASH_SECT     128     /* max number of sectors on one chip    */
-#define CFG_MAX_FLASH_BANKS    2       /* max number of memory banks           */
-#undef CFG_FLASH_PROTECTION            /* don't use hardware protection        */
-#define CFG_FLASH_USE_BUFFER_WRITE 1   /* use buffered writes (20x faster)     */
-#define CFG_FLASH_BASE         0xFE000000 /* test-only...*/
-#define CFG_FLASH_INCREMENT    0x01000000 /* test-only */
-
-#define CFG_FLASH_EMPTY_INFO            /* print 'E' for empty sector on flinfo */
+#ifndef __ASSEMBLY__
+extern int flash_banks;
+#endif
 
-#define CFG_JFFS2_FIRST_BANK    0           /* use for JFFS2 */
-#define CFG_JFFS2_NUM_BANKS     1           /* ! second bank contains u-boot    */
+#define CFG_FLASH_BASE         0xFE000000
+#define CFG_FLASH_CFI          1       /* Flash is CFI conformant */
+#define CFG_FLASH_CFI_DRIVER   1       /* Use the common driver */
+#define CFG_MAX_FLASH_SECT     256     /* max num of sects on one chip */
+#define CFG_MAX_FLASH_BANKS    flash_banks /* max num of flash banks */
+                                           /* updated in board_early_init_r */
+#define CFG_MAX_FLASH_BANKS_DETECT 2
+#define CFG_FLASH_QUIET_TEST   1
+#define CFG_FLASH_INCREMENT    0x01000000
+#define CFG_FLASH_PROTECTION   1       /* use hardware protection */
+#define CFG_FLASH_AUTOPROTECT_LIST { \
+                               {0xfe000000, 0x500000}, \
+                               {0xffe80000, 0x180000} \
+                               }
+#define CFG_FLASH_USE_BUFFER_WRITE 1   /* use buffered writes (20x faster) */
+#define CFG_FLASH_BANKS_LIST   { \
+                               CFG_FLASH_BASE, \
+                               CFG_FLASH_BASE + CFG_FLASH_INCREMENT \
+                               }
+#define CFG_FLASH_EMPTY_INFO   /* print 'E' for empty sector on flinfo */
 
-/*-----------------------------------------------------------------------
+/*
  * Environment Variable setup
  */
-#define CFG_ENV_IS_IN_EEPROM    1       /* use EEPROM for environment vars */
-#define CFG_ENV_OFFSET          0x000   /* environment starts at the beginning of the EEPROM */
-#define CFG_ENV_SIZE            0x800   /* 2048 bytes may be used for env vars*/
-                                  /* total size of a CAT24WC16 is 2048 bytes */
+#define CFG_ENV_IS_IN_EEPROM   1       /* use EEPROM for environment vars */
+#define CFG_ENV_OFFSET         0x000   /* environment starts at the */
+                                       /* beginning of the EEPROM */
+#define CFG_ENV_SIZE           0x800   /* 2048 bytes may be used for env vars*/
+#define CONFIG_ENV_OVERWRITE   1       /* allow overwriting vendor vars */
 
-#define CFG_NVRAM_BASE_ADDR    0xF0000500              /* NVRAM base address   */
-#define CFG_NVRAM_SIZE         242                     /* NVRAM size           */
+#define CFG_NVRAM_BASE_ADDR    0xF0000500      /* NVRAM base address */
+#define CFG_NVRAM_SIZE         242             /* NVRAM size */
 
-/*-----------------------------------------------------------------------
+/*
  * I2C EEPROM (CAT24WC16) for environment
  */
 #define CONFIG_HARD_I2C                        /* I2c with hardware support */
-#define CFG_I2C_SPEED          400000  /* I2C speed and slave address */
+#define CFG_I2C_SPEED          100000  /* I2C speed and slave address */
 #define CFG_I2C_SLAVE          0x7F
 
-#define CFG_I2C_EEPROM_ADDR    0x50    /* EEPROM CAT28WC08             */
-#define CFG_I2C_EEPROM_ADDR_LEN        1       /* Bytes of address             */
-/* mask of address bits that overflow into the "EEPROM chip address"    */
+#define CFG_I2C_EEPROM_ADDR    0x50    /* EEPROM CAT28WC08 */
+#define CFG_I2C_EEPROM_ADDR_LEN        1       /* Bytes of address */
+/* mask of address bits that overflow into the "EEPROM chip address" */
 #define CFG_I2C_EEPROM_ADDR_OVERFLOW   0x07
-#define CFG_EEPROM_PAGE_WRITE_BITS 4   /* The Catalyst CAT24WC08 has   */
+#define CFG_EEPROM_PAGE_WRITE_BITS 4   /* The Catalyst CAT24WC08 has */
                                        /* 16 byte page write mode using*/
-                                       /* last 4 bits of the address   */
-#define CFG_EEPROM_PAGE_WRITE_DELAY_MS 10   /* and takes up to 10 msec */
+                                       /* last 4 bits of the address */
+#define CFG_EEPROM_PAGE_WRITE_DELAY_MS 10 /* and takes up to 10 msec */
 #define CFG_EEPROM_PAGE_WRITE_ENABLE
 
-/*-----------------------------------------------------------------------
- * Cache Configuration
- */
-#define CFG_DCACHE_SIZE                16384   /* For AMCC 405 CPUs, older 405 ppc's   */
-                                       /* have only 8kB, 16kB is save here     */
-#define CFG_CACHELINE_SIZE     32      /* ...                  */
-#if defined(CONFIG_CMD_KGDB)
-#define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
-#endif
-
-/*-----------------------------------------------------------------------
+/*
  * External Bus Controller (EBC) Setup
  */
-#define FLASH0_BA       0xFF000000          /* FLASH 0 Base Address             */
-#define FLASH1_BA       0xFE000000          /* FLASH 1 Base Address             */
-#define CAN_BA          0xF0000000          /* CAN Base Address                 */
-#define DUART0_BA       0xF0000400          /* DUART Base Address               */
-#define DUART1_BA       0xF0000408          /* DUART Base Address               */
-#define RTC_BA          0xF0000500          /* RTC Base Address                 */
-#define PS2_BA          0xF0000600          /* PS/2 Base Address                */
-#define CF_BA           0xF0100000          /* CompactFlash Base Address        */
-#define FPGA_BA         0xF0100100          /* FPGA internal Base Address       */
-#define FUJI_BA         0xF0100200          /* Fuji internal Base Address       */
-#define PCMCIA1_BA      0x20000000          /* PCMCIA Slot 1 Base Address       */
-#define PCMCIA2_BA      0x28000000          /* PCMCIA Slot 2 Base Address       */
-#define VGA_BA          0xF1000000          /* Epson VGA Base Address           */
-
-#define CFG_FPGA_BASE_ADDR      FPGA_BA     /* FPGA internal Base Address       */
-
-/* Memory Bank 0 (Flash Bank 0) initialization                                  */
+#define FLASH0_BA       (CFG_FLASH_BASE + CFG_FLASH_INCREMENT) /* FLASH 0 BA */
+#define FLASH1_BA       CFG_FLASH_BASE      /* FLASH 1 Base Address          */
+#define CAN_BA          0xF0000000          /* CAN Base Address              */
+#define DUART0_BA       0xF0000400          /* DUART Base Address            */
+#define DUART1_BA       0xF0000408          /* DUART Base Address            */
+#define RTC_BA          0xF0000500          /* RTC Base Address              */
+#define PS2_BA          0xF0000600          /* PS/2 Base Address             */
+#define CF_BA           0xF0100000          /* CompactFlash Base Address     */
+#define FPGA_BA         0xF0100100          /* FPGA internal Base Address    */
+#define FUJI_BA         0xF0100200          /* Fuji internal Base Address    */
+#define PCMCIA1_BA      0x20000000          /* PCMCIA Slot 1 Base Address    */
+#define PCMCIA2_BA      0x28000000          /* PCMCIA Slot 2 Base Address    */
+#define VGA_BA          0xF1000000          /* Epson VGA Base Address        */
+
+#define CFG_FPGA_BASE_ADDR      FPGA_BA     /* FPGA internal Base Address    */
+
+/* Memory Bank 0 (Flash Bank 0) initialization                               */
 #define CFG_EBC_PB0AP   0x92015480
 #define CFG_EBC_PB0CR   FLASH0_BA | 0x9A000 /* BAS=0xFF0,BS=16MB,BU=R/W,BW=16bit*/
+#define CFG_EBC_PB0AP_HWREV8 CFG_EBC_PB0AP
+#define CFG_EBC_PB0CR_HWREV8 FLASH1_BA | 0xBA000 /* BS=32MB */
 
-/* Memory Bank 1 (Flash Bank 1) initialization                                  */
+/* Memory Bank 1 (Flash Bank 1) initialization                               */
 #define CFG_EBC_PB1AP   0x92015480
 #define CFG_EBC_PB1CR   FLASH1_BA | 0x9A000 /* BAS=0xFE0,BS=16MB,BU=R/W,BW=16bit*/
 
 #define CFG_EBC_PB6AP   0x050007C0   /* BWT=2,WBN=1,WBF=1,TH=1,RE=1,SOR=1,BEM=1 */
 #define CFG_EBC_PB6CR   PCMCIA2_BA | 0xFA000 /*BAS=0x280,BS=128MB,BU=R/W,BW=16bit*/
 
-/*-----------------------------------------------------------------------
+/*
  * FPGA stuff
  */
 
 #define CFG_FPGA_INIT           0x00010000  /* FPGA init pin (ppc input)     */
 #define CFG_FPGA_DONE           0x00008000  /* FPGA done pin (ppc input)     */
 
-/*-----------------------------------------------------------------------
+/*
  * LCD Setup
  */
+#define CFG_LCD_BIG_MEM                (VGA_BA + 0x200000) /* S1D13806 Mem Base */
+#define CFG_LCD_BIG_REG                VGA_BA /* S1D13806 Reg Base */
 
-#define CFG_LCD_BIG_MEM         0xF1200000  /* Epson S1D13806 Mem Base Address  */
-#define CFG_LCD_BIG_REG         0xF1000000  /* Epson S1D13806 Reg Base Address  */
-
-#define CONFIG_LCD_BIG          2           /* Epson S1D13806 used              */
+#define CONFIG_LCD_BIG         2 /* Epson S1D13806 used */
 
 /* Image information... */
-#define CONFIG_LCD_USED         CONFIG_LCD_BIG
-#define CFG_LCD_HEADER_NAME     "../common/s1d13806_640_480_16bpp.h"
-#define CFG_LCD_LOGO_NAME       "logo_640_480_24bpp.c"
+#define CONFIG_LCD_USED                CONFIG_LCD_BIG
 
-#define CFG_LCD_MEM             CFG_LCD_BIG_MEM
-#define CFG_LCD_REG             CFG_LCD_BIG_REG
+#define CFG_LCD_MEM            CFG_LCD_BIG_MEM
+#define CFG_LCD_REG            CFG_LCD_BIG_REG
 
 #define CFG_VIDEO_LOGO_MAX_SIZE (1 << 20)
 
-/*-----------------------------------------------------------------------
+/*
  * Definitions for initial stack pointer and data area (in data cache)
  */
 
 /* use on chip memory ( OCM ) for temperary stack until sdram is tested */
-#define CFG_TEMP_STACK_OCM        1
+#define CFG_TEMP_STACK_OCM     1
 
 /* On Chip Memory location */
 #define CFG_OCM_DATA_ADDR      0xF8000000
 #define CFG_OCM_DATA_SIZE      0x1000
 
-#define CFG_INIT_RAM_ADDR      CFG_OCM_DATA_ADDR /* inside of SDRAM            */
-#define CFG_INIT_RAM_END       CFG_OCM_DATA_SIZE /* End of used area in RAM    */
-#define CFG_GBL_DATA_SIZE      128  /* size in bytes reserved for initial data */
-#define CFG_GBL_DATA_OFFSET    (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
-#define CFG_INIT_SP_OFFSET      CFG_GBL_DATA_OFFSET
+#define CFG_INIT_RAM_ADDR      CFG_OCM_DATA_ADDR /* inside of SDRAM */
+#define CFG_INIT_RAM_END       CFG_OCM_DATA_SIZE /* End of used area in RAM */
+#define CFG_GBL_DATA_SIZE      128 /* reserved bytes for initial data */
+#define CFG_GBL_DATA_OFFSET    (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
+#define CFG_INIT_SP_OFFSET     CFG_GBL_DATA_OFFSET
 
 /*
  * Internal Definitions
  *
  * Boot Flags
  */
-#define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH     */
-#define BOOTFLAG_WARM  0x02            /* Software reboot                      */
+#define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH */
+#define BOOTFLAG_WARM  0x02            /* Software reboot */
 
-#endif /* __CONFIG_H */
+/*
+ * PCI OHCI controller
+ */
+#define CONFIG_USB_OHCI_NEW    1
+#define CONFIG_PCI_OHCI                1
+#define CFG_OHCI_SWAP_REG_ACCESS 1
+#define CFG_USB_OHCI_MAX_ROOT_PORTS 15
+#define CFG_USB_OHCI_SLOT_NAME "ohci_pci"
+#define CONFIG_USB_STORAGE     1
+#define CFG_USB_OHCI_BOARD_INIT 1
+
+#endif /* __CONFIG_H */
index c14376e..0d644da 100644 (file)
@@ -96,6 +96,7 @@
  */
 #define CFG_CCSRBAR_DEFAULT    0xff700000      /* CCSRBAR Default */
 #define CFG_CCSRBAR            0xe0000000      /* relocated CCSRBAR */
+#define CFG_CCSRBAR_PHYS       CFG_CCSRBAR     /* physical addr of CCSRBAR */
 #define CFG_IMMR               CFG_CCSRBAR     /* PQII uses CFG_IMMR */
 
 #define PCI_SPEED              33333000        /* CPLD currenlty does not have PCI setup info */
index 4304ecc..8a76c26 100644 (file)
 
 #define CONFIG_ETHER_ON_FEC1
 #define CONFIG_ETHER_ON_FEC2
+#define CONFIG_HAS_ETH0
+#define CONFIG_HAS_ETH1
 
 #if defined(CONFIG_ETHER_ON_FEC1) || defined(CONFIG_ETHER_ON_FEC2)
 #define CFG_DISCOVER_PHY
+#define CONFIG_MII_INIT                1
 #define FEC_ENET
 #endif /* CONFIG_ETHER_ON_FEC || CONFIG_ETHER_ON_FEC2 */
 
 #define BOOTFLAG_COLD          0x01    /* Normal Power-On: Boot from flash     */
 #define BOOTFLAG_WARM          0x02    /* Software reboot                      */
 
+/* pass open firmware flat tree */
+#define CONFIG_OF_LIBFDT       1
+#define CONFIG_OF_BOARD_SETUP  1
+
 #endif /* __CONFIG_H */
index 3d09ee7..706c13e 100644 (file)
@@ -87,6 +87,7 @@
 # define CONFIG_PCI            1
 # define CONFIG_PCI_PNP                1
 /* #define CONFIG_PCI_SCAN_SHOW 1 */
+#define CONFIG_PCIAUTO_SKIP_HOST_BRIDGE        1
 
 #define CONFIG_PCI_MEM_BUS     0x40000000
 #define CONFIG_PCI_MEM_PHYS    CONFIG_PCI_MEM_BUS
index 4fb6921..d54da97 100644 (file)
  */
 #define CFG_MBYTES_SDRAM        (1024) /* 512 MiB      TODO: remove    */
 #define CONFIG_DDR_DATA_EYE            /* use DDR2 optimization        */
+#define CFG_MEM_TOP_HIDE        (4 << 10) /* don't use last 4kbytes     */
+                                       /* 440EPx errata CHIP 11        */
 #define CONFIG_SPD_EEPROM              /* Use SPD EEPROM for setup     */
-#if 0
-#define CONFIG_ZERO_SDRAM              /* Zero SDRAM after setup       */
-#endif
 #define CONFIG_DDR_ECC                 /* Use ECC when available       */
 #define SPD_EEPROM_ADDRESS     {0x50}
 #define CONFIG_PROG_SDRAM_TLB
        "update=protect off FFFA0000 FFFFFFFF;era FFFA0000 FFFFFFFF;"   \
                "cp.b 100000 FFFA0000 60000\0"                          \
        ""
-#if 0
-#define CONFIG_BOOTCOMMAND     "run flash_self"
-#endif
 
 #define CONFIG_PREBOOT                  /* enable preboot variable      */
 
@@ -264,7 +260,7 @@ int du440_phy_addr(int devnum);
 #define CONFIG_PHY_ADDR                du440_phy_addr(0) /* PHY address        */
 
 #define CONFIG_PHY_RESET        1      /* reset phy upon startup       */
-#define CONFIG_PHY_GIGE                1       /* Include GbE detection        */
+#undef CONFIG_PHY_GIGE                 /* no GbE detection             */
 
 #define CONFIG_HAS_ETH0
 #define CFG_RX_ETH_BUFFER      128
@@ -295,7 +291,9 @@ int du440_phy_addr(int devnum);
 
 #include <config_cmd_default.h>
 
+#define CONFIG_CMD_AUTOSCRIPT
 #define CONFIG_CMD_BSP
+#define CONFIG_CMD_BMP
 #define CONFIG_CMD_DATE
 #define CONFIG_CMD_ASKENV
 #define CONFIG_CMD_DHCP
@@ -431,8 +429,6 @@ int du440_phy_addr(int devnum);
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
 
-#if 0
-#define CONFIG_SHOW_ACTIVITY      1
-#endif
+#define CONFIG_AUTOSCRIPT      1
 
 #endif /* __CONFIG_H */
index ea49a5d..5ba7585 100644 (file)
@@ -88,6 +88,7 @@
 #ifdef CONFIG_MCFFEC
 #      define CONFIG_NET_MULTI         1
 #      define CONFIG_MII               1
+#      define CONFIG_MII_INIT          1
 #      define CFG_DISCOVER_PHY
 #      define CFG_RX_ETH_BUFFER        8
 #      define CFG_FAULT_ECHO_LINK_DOWN
index 89e0eeb..c2ab18a 100644 (file)
@@ -42,6 +42,7 @@
 #define        CONFIG_ETHER_ON_FEC2                    /* Enable Ethernet on FEC2      */
 #if defined(CONFIG_ETHER_ON_FEC1) || defined(CONFIG_ETHER_ON_FEC2)
 #define CFG_DISCOVER_PHY
+#define CONFIG_MII_INIT                1
 #define FEC_ENET
 #endif /* CONFIG_FEC_ENET */
 
index f810af2..86cbe58 100644 (file)
 */
 #define NR_8259_INTS   0
 
-/* Machine type
-*/
-#define _MACH_8xx (_MACH_fads)
-
 /*
  * MPC8xx CPM Options
  */
index a09c0e0..356705b 100644 (file)
 */
 #define NR_8259_INTS   0
 
-/* Machine type
-*/
-#define _MACH_8xx (_MACH_fads)
-
 #define CONFIG_DISK_SPINUP_TIME 1000000
 
 
index 3eb3131..c8b5a6d 100644 (file)
 #define CONFIG_FEC_ENET
 #define CFG_DISCOVER_PHY
 #define CONFIG_MII
+#define CONFIG_MII_INIT                        1
 #define CONFIG_PHY_ADDR                        0
 
 /*
index 785355a..3a660ed 100644 (file)
 */
 #define NR_8259_INTS   0
 
-/* Machine type
-*/
-#define _MACH_8xx (_MACH_fads)
-
 /*
  * MPC8xx CPM Options
  */
index 9b485a9..38a0226 100644 (file)
@@ -56,6 +56,7 @@
 #if defined(CONFIG_PCI)
 #define CONFIG_PCI_PNP         1
 #define CONFIG_PCI_SCAN_SHOW   1
+#define CONFIG_PCIAUTO_SKIP_HOST_BRIDGE        1
 
 #define CONFIG_PCI_MEM_BUS     0x40000000
 #define CONFIG_PCI_MEM_PHYS    CONFIG_PCI_MEM_BUS
index a3d7bc4..3d28913 100644 (file)
@@ -86,6 +86,7 @@
        "save\0"                                \
        ""
 
+#define CONFIG_BOOTDELAY       3       /* autoboot after 3 seconds */
 /* LCD */
 #ifdef CONFIG_CMD_BMP
 #define CONFIG_LCD
index 3b4bff3..3ee2b39 100644 (file)
@@ -77,6 +77,7 @@
 #ifdef CONFIG_MCFFEC
 #      define CONFIG_NET_MULTI         1
 #      define CONFIG_MII               1
+#      define CONFIG_MII_INIT          1
 #      define CFG_DISCOVER_PHY
 #      define CFG_RX_ETH_BUFFER        8
 #      define CFG_FAULT_ECHO_LINK_DOWN
index 47e1e03..e1cc720 100644 (file)
@@ -88,6 +88,7 @@
 #ifdef CONFIG_MCFFEC
 #      define CONFIG_NET_MULTI         1
 #      define CONFIG_MII               1
+#      define CONFIG_MII_INIT          1
 #      define CFG_DISCOVER_PHY
 #      define CFG_RX_ETH_BUFFER        8
 #      define CFG_FAULT_ECHO_LINK_DOWN
similarity index 55%
rename from include/configs/r5200.h
rename to include/configs/M5275EVB.h
index fc7658b..283c873 100644 (file)
@@ -1,9 +1,11 @@
 /*
- * Configuation settings for the R5200 board
+ * Configuation settings for the Motorola MC5275EVB board.
  *
- * (C) Copyright 2006 Lab X Technologies <zachary.landau@labxtechnologies.com>
- * Based on Motorola MC5272C3 board config
- * (C) Copyright 2003 Josef Baumgartner <josef.baumgartner@telex.de>
+ * By Arthur Shipkowski <art@videon-central.com>
+ * Copyright (C) 2005 Videon Central, Inc.
+ *
+ * Based off of M5272C3 board code by Josef Baumgartner
+ * <josef.baumgartner@telex.de>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
  * board/config.h - configuration options, board specific
  */
 
-#ifndef _R5200_H
-#define _R5200_H
+#ifndef _M5275EVB_H
+#define _M5275EVB_H
 
 /*
  * High Level Configuration Options
  * (easy to change)
  */
 #define CONFIG_MCF52x2                 /* define processor family */
-#define CONFIG_M5271                   /* define processor type */
-#define CONFIG_R5200                   /* define board type */
+#define CONFIG_M5275                   /* define processor type */
+#define CONFIG_M5275EVB                        /* define board type */
 
 #define CONFIG_MCFTMR
 
 #define CONFIG_MCFUART
 #define CFG_UART_PORT          (0)
 #define CONFIG_BAUDRATE                19200
-#define CFG_BAUDRATE_TABLE { 9600 , 19200 , 38400 , 57600, 115200 }
-
-#define CONFIG_WATCHDOG
-#define CONFIG_WATCHDOG_TIMEOUT 0xFFFF /* clock modulus */
+#define CFG_BAUDRATE_TABLE     { 9600 , 19200 , 38400 , 57600, 115200 }
 
 /* Configuration for environment
  * Environment is embedded in u-boot in the second sector of the flash
  */
 #ifndef CONFIG_MONITOR_IS_IN_RAM
-#define CFG_ENV_OFFSET         0x20000
-#define CFG_ENV_SECT_SIZE      0x20000
+#define CFG_ENV_OFFSET         0x4000
+#define CFG_ENV_SECT_SIZE      0x2000
 #define CFG_ENV_IS_IN_FLASH    1
 #define CFG_ENV_IS_EMBEDDED    1
 #else
-#define CFG_ENV_ADDR           0xf0020000
+#define CFG_ENV_ADDR           0xffe04000
 #define CFG_ENV_SECT_SIZE      0x2000
 #define CFG_ENV_IS_IN_FLASH    1
 #endif
 
-
 /*
  * BOOTP options
  */
 #define CONFIG_BOOTP_GATEWAY
 #define CONFIG_BOOTP_HOSTNAME
 
-
-/*
- * Command line configuration.
- */
+/* Available command configuration */
 #include <config_cmd_default.h>
 
 #define CONFIG_CMD_PING
+#define CONFIG_CMD_MII
 #define CONFIG_CMD_NET
+#define CONFIG_CMD_ELF
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_I2C
+#define CONFIG_CMD_MEMORY
+#define CONFIG_CMD_DHCP
 
 #undef CONFIG_CMD_LOADS
 #undef CONFIG_CMD_LOADB
 
 #define CONFIG_MCFFEC
 #ifdef CONFIG_MCFFEC
-#      define CONFIG_NET_MULTI         1
-#      define CONFIG_MII               1
-#      define CFG_DISCOVER_PHY
-#      define CFG_RX_ETH_BUFFER        8
-#      define CFG_FAULT_ECHO_LINK_DOWN
-
-#      define CFG_FEC0_PINMUX          0
-#      define CFG_FEC0_MIIBASE         CFG_FEC0_IOBASE
-#      define MCFFEC_TOUT_LOOP         50000
+#define CONFIG_NET_MULTI       1
+#define CONFIG_MII             1
+#define CONFIG_MII_INIT                1
+#define CFG_DISCOVER_PHY
+#define CFG_RX_ETH_BUFFER      8
+#define CFG_FAULT_ECHO_LINK_DOWN
+#define CFG_FEC0_PINMUX                0
+#define CFG_FEC0_MIIBASE       CFG_FEC0_IOBASE
+#define CFG_FEC1_PINMUX                0
+#define CFG_FEC1_MIIBASE       CFG_FEC1_IOBASE
+#define MCFFEC_TOUT_LOOP       50000
+#define CONFIG_HAS_ETH1
 /* If CFG_DISCOVER_PHY is not defined - hardcoded */
-#      ifndef CFG_DISCOVER_PHY
-#              define FECDUPLEX        FULL
-#              define FECSPEED         _100BASET
-#      else
-#              ifndef CFG_FAULT_ECHO_LINK_DOWN
-#                      define CFG_FAULT_ECHO_LINK_DOWN
-#              endif
-#      endif                   /* CFG_DISCOVER_PHY */
+#ifndef CFG_DISCOVER_PHY
+#define FECDUPLEX              FULL
+#define FECSPEED               _100BASET
+#else
+#ifndef CFG_FAULT_ECHO_LINK_DOWN
+#define CFG_FAULT_ECHO_LINK_DOWN
+#endif
+#endif
 #endif
 
-/* Note: We only copy one sectors worth of application code from location
- * 10200000 for speed purposes.  Increase the size if necessary */
-#define CONFIG_BOOTCOMMAND     "cp.b 10200000 0 20000; go 400"
-#define        CONFIG_BOOTDELAY        1
+/* I2C */
+#define CONFIG_FSL_I2C
+#define CONFIG_HARD_I2C                /* I2C with hw support */
+#undef CONFIG_SOFT_I2C
+#define CFG_I2C_SPEED          80000
+#define CFG_I2C_SLAVE          0x7F
+#define CFG_I2C_OFFSET         0x00000300
+#define CFG_IMMR               CFG_MBAR
 
-#define CFG_PROMPT             "u-boot> "
-#define CFG_LONGHELP                           /* undef to save memory         */
+#ifdef CONFIG_MCFFEC
+#define CONFIG_ETHADDR         00:06:3b:01:41:55
+#define CONFIG_ETH1ADDR                00:0e:0c:bc:e5:60
+#endif
 
-#if defined(CONFIG_CMD_KGDB)
-#define CFG_CBSIZE             1024            /* Console I/O Buffer Size      */
+#define CFG_PROMPT             "-> "
+#define CFG_LONGHELP           /* undef to save memory */
+
+#if (CONFIG_CMD_KGDB)
+#      define CFG_CBSIZE       1024
 #else
-#define CFG_CBSIZE             256             /* Console I/O Buffer Size      */
+#      define CFG_CBSIZE       256
 #endif
-#define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
-#define CFG_MAXARGS            16              /* max number of command args   */
-#define CFG_BARGSIZE           CFG_CBSIZE      /* Boot Argument Buffer Size    */
+#define CFG_PBSIZE             (CFG_CBSIZE + sizeof(CFG_PROMPT) + 16)
+#define CFG_MAXARGS            16
+#define CFG_BARGSIZE           CFG_CBSIZE
 
-#define CFG_LOAD_ADDR          0x00002000
+#define CFG_LOAD_ADDR          0x800000
 
+#define CONFIG_BOOTDELAY       5
+#define CONFIG_BOOTCOMMAND     "bootm ffe40000"
 #define CFG_MEMTEST_START      0x400
 #define CFG_MEMTEST_END                0x380000
 
-#define CFG_HZ                 1000000
-#define CFG_CLK                        100000000
+#define CFG_HZ                 1000
+#define CFG_CLK                        150000000
 
 /*
  * Low Level Configuration Settings
  * You should know what you are doing if you make changes here.
  */
 
-#define CFG_MBAR               0x40000000      /* Register Base Addrs */
-
-#define CFG_ENET_BD_BASE       0x480000
+#define CFG_MBAR               0x40000000
 
 /*-----------------------------------------------------------------------
  * Definitions for initial stack pointer and data area (in DPRAM)
  */
 #define CFG_INIT_RAM_ADDR      0x20000000
-#define CFG_INIT_RAM_END       0x1000  /* End of used area in internal SRAM    */
-#define CFG_GBL_DATA_SIZE      64      /* size in bytes reserved for initial data */
+#define CFG_INIT_RAM_END       0x10000 /* End of used area in internal SRAM */
+#define CFG_GBL_DATA_SIZE      1000    /* bytes reserved for initial data */
 #define CFG_GBL_DATA_OFFSET    (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
 #define CFG_INIT_SP_OFFSET     CFG_GBL_DATA_OFFSET
 
  * Please note that CFG_SDRAM_BASE _must_ start at 0
  */
 #define CFG_SDRAM_BASE         0x00000000
-#define CFG_SDRAM_SIZE         8               /* SDRAM size in MB */
-#define CFG_FLASH_BASE         0x10000000
+#define CFG_SDRAM_SIZE         16      /* SDRAM size in MB */
+#define CFG_FLASH_BASE         0xffe00000
 
-#ifdef CONFIG_MONITOR_IS_IN_RAM
+#ifdef CONFIG_MONITOR_IS_IN_RAM
 #define CFG_MONITOR_BASE       0x20000
 #else
 #define CFG_MONITOR_BASE       (CFG_FLASH_BASE + 0x400)
 #endif
 
-#define CFG_MONITOR_LEN                0x20001
+#define CFG_MONITOR_LEN                0x20000
 #define CFG_MALLOC_LEN         (256 << 10)
 #define CFG_BOOTPARAMS_LEN     64*1024
 
  * have to be in the first 8 MB of memory, since this is
  * the maximum mapped by the Linux kernel during initialization ??
  */
-#define CFG_BOOTMAPSZ          (8 << 20)       /* Initial Memory map for Linux */
+#define CFG_BOOTMAPSZ          (8 << 20)       /* Initial mmap for Linux */
 
 /*-----------------------------------------------------------------------
  * FLASH organization
  */
-#define CFG_MAX_FLASH_BANKS    1       /* max number of memory banks           */
-#define CFG_MAX_FLASH_SECT     1024    /* max number of sectors on one chip    */
+#define CFG_MAX_FLASH_BANKS    1       /* max number of memory banks */
+#define CFG_MAX_FLASH_SECT     11      /* max number of sectors on one chip */
 #define CFG_FLASH_ERASE_TOUT   1000
 
 #define CFG_FLASH_CFI          1
 #define CFG_FLASH_CFI_DRIVER   1
-#define CFG_FLASH_SIZE         0x800000
+#define CFG_FLASH_SIZE         0x200000
 
 /*-----------------------------------------------------------------------
  * Cache Configuration
 /*-----------------------------------------------------------------------
  * Memory bank definitions
  */
+#define CFG_AR0_PRELIM         (CFG_FLASH_BASE >> 16)
+#define CFG_CR0_PRELIM         0x1980
+#define CFG_MR0_PRELIM         0x001F0001
+
+#define CFG_AR1_PRELIM         0x3000
+#define CFG_CR1_PRELIM         0x1900
+#define CFG_MR1_PRELIM         0x00070001
 
 /*-----------------------------------------------------------------------
  * Port configuration
  */
-#define CFG_FECI2C             0xF0
+#define CFG_FECI2C             0x0FA0
 
-#endif /* _R5200_H */
+#endif /* _M5275EVB_H */
index 7bb9f60..826778c 100644 (file)
@@ -75,6 +75,7 @@
 #ifdef CONFIG_MCFFEC
 #      define CONFIG_NET_MULTI         1
 #      define CONFIG_MII               1
+#      define CONFIG_MII_INIT          1
 #      define CFG_DISCOVER_PHY
 #      define CFG_RX_ETH_BUFFER        8
 #      define CFG_FAULT_ECHO_LINK_DOWN
index 1a15c77..42692d6 100644 (file)
@@ -70,6 +70,7 @@
 #ifdef CONFIG_MCFFEC
 #      define CONFIG_NET_MULTI         1
 #      define CONFIG_MII               1
+#      define CONFIG_MII_INIT          1
 #      define CFG_DISCOVER_PHY
 #      define CFG_RX_ETH_BUFFER        8
 #      define CFG_FAULT_ECHO_LINK_DOWN
index da4156c..3b9da17 100644 (file)
@@ -70,6 +70,7 @@
 #ifdef CONFIG_MCFFEC
 #      define CONFIG_NET_MULTI         1
 #      define CONFIG_MII               1
+#      define CONFIG_MII_INIT          1
 #      define CFG_DISCOVER_PHY
 #      define CFG_RX_ETH_BUFFER        8
 #      define CFG_FAULT_ECHO_LINK_DOWN
index 5f55761..3a022af 100644 (file)
@@ -83,9 +83,9 @@
 /* Network configuration */
 #define CONFIG_MCFFEC
 #ifdef CONFIG_MCFFEC
-#      define CONFIG_NET_MULTI 1
+#      define CONFIG_NET_MULTI         1
 #      define CONFIG_MII               1
-#      define CONFIG_CF_DOMII
+#      define CONFIG_MII_INIT          1
 #      define CFG_DISCOVER_PHY
 #      define CFG_RX_ETH_BUFFER        8
 #      define CFG_FAULT_ECHO_LINK_DOWN
 #define CFG_I2C_OFFSET         0x58000
 #define CFG_IMMR               CFG_MBAR
 
+/* DSPI and Serial Flash */
+#define CONFIG_CF_DSPI
+#define CONFIG_SERIAL_FLASH
+
 /* PCI */
 #ifdef CONFIG_CMD_PCI
 #define CONFIG_PCI             1
 #define CONFIG_PCI_PNP         1
-#define CONFIG_SKIPPCI_HOSTBRIDGE
+#define CONFIG_PCIAUTO_SKIP_HOST_BRIDGE        1
 
 #define CFG_PCI_CACHE_LINE_SIZE        4
 
 
 #else
 
-#      define CFG_MAX_FLASH_BANKS      2       /* max number of memory banks */
+#      define CFG_MAX_FLASH_BANKS      3       /* max number of memory banks */
 
 #      define CFG_ATMEL_REGION         4
 #      define CFG_ATMEL_TOTALSECT      11
 #      define CFG_FLASH_PROTECTION     /* "Real" (hardware) sectors protection */
 #      define CFG_FLASH_CHECKSUM
 
+#ifdef CONFIG_SERIAL_FLASH
+#      define CFG_FLASH2_BASE          0x01000000
+#      define CFG_STM_SECT             32
+#      define CFG_STM_SECTSZ           0x10000
+
+#      undef CFG_FLASH_ERASE_TOUT
+#      define CFG_FLASH_ERASE_TOUT     20000
+
+#      define SER_WREN                 0x06
+#      define SER_WRDI                 0x04
+#      define SER_RDID                 0x9F
+#      define SER_RDSR                 0x05
+#      define SER_WRSR                 0x01
+#      define SER_READ                 0x03
+#      define SER_F_READ               0x0B
+#      define SER_PAGE_PROG            0x02
+#      define SER_SECT_ERASE           0xD8
+#      define SER_BULK_ERASE           0xC7
+#      define SER_DEEP_PWRDN           0xB9
+#      define SER_RES                  0xAB
+#endif
+
 #endif
 
 /*
index f0d42be..6bb4619 100644 (file)
@@ -69,6 +69,7 @@
 #ifdef CONFIG_FSLDMAFEC
 #      define CONFIG_NET_MULTI         1
 #      define CONFIG_MII               1
+#      define CONFIG_MII_INIT          1
 #      define CONFIG_HAS_ETH1
 
 #      define CFG_DISCOVER_PHY
 #ifdef CONFIG_CMD_PCI
 #define CONFIG_PCI             1
 #define CONFIG_PCI_PNP         1
-#define CONFIG_SKIPPCI_HOSTBRIDGE
+#define CONFIG_PCIAUTO_SKIP_HOST_BRIDGE        1
 
 #define CFG_PCI_CACHE_LINE_SIZE        8
 
index 88dd219..cba51c8 100644 (file)
@@ -69,6 +69,7 @@
 #ifdef CONFIG_FSLDMAFEC
 #      define CONFIG_NET_MULTI         1
 #      define CONFIG_MII               1
+#      define CONFIG_MII_INIT          1
 #      define CONFIG_HAS_ETH1
 
 #      define CFG_DISCOVER_PHY
 #ifdef CONFIG_CMD_PCI
 #define CONFIG_PCI             1
 #define CONFIG_PCI_PNP         1
+#define CONFIG_PCIAUTO_SKIP_HOST_BRIDGE        1
 
 #define CFG_PCI_MEM_BUS                0x80000000
 #define CFG_PCI_MEM_PHYS       CFG_PCI_MEM_BUS
index 69d195d..3b88507 100644 (file)
 */
 #define NR_8259_INTS   0
 
-/* Machine type
-*/
-#define _MACH_8xx (_MACH_fads)
-
 /*
  * MPC8xx CPM Options
  */
index f12a3e6..9576fa5 100644 (file)
 #define CONFIG_PCI
 #define CONFIG_83XX_GENERIC_PCI
 
+#define CONFIG_MISC_INIT_R
+
+/*
+ * On-board devices
+ */
+#define CONFIG_VSC7385_ENET
+
+
 #ifdef CFG_66MHZ
 #define CONFIG_83XX_CLKIN      66666667        /* in Hz */
 #elif defined(CFG_33MHZ)
 #define CFG_ACR_RPTCNT         3       /* Arbiter repeat count (0-7) */
 
 /*
+ * Device configurations
+ */
+
+/* Vitesse 7385 */
+
+#ifdef CONFIG_VSC7385_ENET
+
+#define CONFIG_TSEC2
+
+/* The flash address and size of the VSC7385 firmware image */
+#define CONFIG_VSC7385_IMAGE           0xFE7FE000
+#define CONFIG_VSC7385_IMAGE_SIZE      8192
+
+#endif
+
+/*
  * DDR Setup
  */
 #define CFG_DDR_BASE           0x00000000      /* DDR is system memory*/
 #define CFG_LBLAWBAR1_PRELIM   CFG_NAND_BASE
 #define CFG_LBLAWAR1_PRELIM    0x8000000E      /* 32KB  */
 
+/* local bus read write buffer mapping */
+#define CFG_BR3_PRELIM         0xFA000801      /* map at 0xFA000000 */
+#define CFG_OR3_PRELIM         0xFFFF8FF7      /* 32kB */
+#define CFG_LBLAWBAR3_PRELIM   0xFA000000
+#define CFG_LBLAWAR3_PRELIM    0x8000000E      /* 32KB  */
+
+/* Vitesse 7385 */
+
 #define CFG_VSC7385_BASE       0xF0000000
 
-#define CONFIG_VSC7385_ENET                    /* VSC7385 ethernet support */
+#ifdef CONFIG_VSC7385_ENET
+
 #define CFG_BR2_PRELIM         0xf0000801      /* VSC7385 Base address */
 #define CFG_OR2_PRELIM         0xfffe09ff      /* VSC7385, 128K bytes*/
 #define CFG_LBLAWBAR2_PRELIM   CFG_VSC7385_BASE/* Access window base at VSC7385 base */
 #define CFG_LBLAWAR2_PRELIM    0x80000010      /* Access window size 128K */
 
-/* local bus read write buffer mapping */
-#define CFG_BR3_PRELIM         0xFA000801      /* map at 0xFA000000 */
-#define CFG_OR3_PRELIM         0xFFFF8FF7      /* 32kB */
-#define CFG_LBLAWBAR3_PRELIM   0xFA000000
-#define CFG_LBLAWAR3_PRELIM    0x8000000E      /* 32KB  */
+#endif
 
 /* pass open firmware flat tree */
 #define CONFIG_OF_LIBFDT       1
 #define CFG_I2C_OFFSET         0x3000
 #define CFG_I2C2_OFFSET                0x3100
 
-/* TSEC */
-#define CFG_TSEC1_OFFSET       0x24000
-#define CFG_TSEC1              (CFG_IMMR+CFG_TSEC1_OFFSET)
-#define CFG_TSEC2_OFFSET       0x25000
-#define CFG_TSEC2              (CFG_IMMR+CFG_TSEC2_OFFSET)
-#define CONFIG_NET_MULTI
-
 /*
  * General PCI
  * Addresses are mapped 1-1.
 #define CFG_PCI_SUBSYS_VENDORID 0x1057 /* Motorola */
 
 /*
- * TSEC configuration
+ * TSEC
  */
 #define CONFIG_TSEC_ENET               /* TSEC ethernet support */
 
-#ifndef CONFIG_NET_MULTI
-#define CONFIG_NET_MULTI               1
-#endif
-
-#define CONFIG_GMII                    1       /* MII PHY management */
-#define CONFIG_TSEC1           1
+#define CONFIG_NET_MULTI
+#define CONFIG_GMII                    /* MII PHY management */
 
+#ifdef CONFIG_TSEC1
+#define CONFIG_HAS_ETH0
 #define CONFIG_TSEC1_NAME      "TSEC0"
-#define CONFIG_TSEC2           1
+#define CFG_TSEC1_OFFSET       0x24000
+#define TSEC1_PHY_ADDR         0x1c
+#define TSEC1_FLAGS            TSEC_GIGABIT
+#define TSEC1_PHYIDX           0
+#endif
+
+#ifdef CONFIG_TSEC2
+#define CONFIG_HAS_ETH1
 #define CONFIG_TSEC2_NAME      "TSEC1"
-#define TSEC1_PHY_ADDR                 0x1c
-#define TSEC2_PHY_ADDR                 4
-#define TSEC1_FLAGS                    TSEC_GIGABIT
-#define TSEC2_FLAGS                    TSEC_GIGABIT
-#define TSEC1_PHYIDX                   0
-#define TSEC2_PHYIDX                   0
+#define CFG_TSEC2_OFFSET       0x25000
+#define TSEC2_PHY_ADDR         4
+#define TSEC2_FLAGS            TSEC_GIGABIT
+#define TSEC2_PHYIDX           0
+#endif
+
 
 /* Options are: TSEC[0-1] */
 #define CONFIG_ETHPRIME                        "TSEC1"
  */
 #define CONFIG_ENV_OVERWRITE
 
+#ifdef CONFIG_HAS_ETH0
 #define CONFIG_ETHADDR         00:E0:0C:00:95:01
-#define CONFIG_HAS_ETH1
-#define CONFIG_HAS_ETH0
+#endif
+
+#ifdef CONFIG_HAS_ETH1
 #define CONFIG_ETH1ADDR                00:E0:0C:00:95:02
+#endif
 
 #define CONFIG_IPADDR          10.0.0.2
 #define CONFIG_SERVERIP                10.0.0.1
index ff7101f..432fb31 100644 (file)
 #define CFG_PCI_MMIO_BASE      0x90000000
 #define CFG_PCI_MMIO_PHYS      CFG_PCI_MMIO_BASE
 #define CFG_PCI_MMIO_SIZE      0x10000000 /* 256M */
-#define CFG_PCI_IO_BASE                0xE0300000
+#define CFG_PCI_IO_BASE                0x00000000
 #define CFG_PCI_IO_PHYS                0xE0300000
 #define CFG_PCI_IO_SIZE                0x100000 /* 1M */
 
 #define CONFIG_ETHPRIME                "eTSEC1"
 
 /*
+ * SATA
+ */
+#define CONFIG_LIBATA
+#define CONFIG_FSL_SATA
+
+#define CFG_SATA_MAX_DEVICE    2
+#define CONFIG_SATA1
+#define CFG_SATA1_OFFSET       0x18000
+#define CFG_SATA1              (CFG_IMMR + CFG_SATA1_OFFSET)
+#define CFG_SATA1_FLAGS                FLAGS_DMA
+#define CONFIG_SATA2
+#define CFG_SATA2_OFFSET       0x19000
+#define CFG_SATA2              (CFG_IMMR + CFG_SATA2_OFFSET)
+#define CFG_SATA2_FLAGS                FLAGS_DMA
+
+#ifdef CONFIG_FSL_SATA
+#define CONFIG_LBA48
+#define CONFIG_CMD_SATA
+#define CONFIG_DOS_PARTITION
+#define CONFIG_CMD_EXT2
+#endif
+
+/*
  * Environment
  */
 #ifndef CFG_RAMBOOT
index bf5ef4b..92d7aa4 100644 (file)
 #define CFG_IMMR               0xE0000000
 
 /*
+ * System performance
+ */
+#define CFG_ACR_PIPE_DEP       3       /* Arbiter pipeline depth (0-3) */
+#define CFG_ACR_RPTCNT         3       /* Arbiter repeat count (0-7) */
+#define CFG_SPCR_OPT           1       /* (0-1) Optimize transactions between  CSB and the SEC and QUICC Engine block */
+
+/*
  * DDR Setup
  */
 #define CFG_DDR_BASE           0x00000000      /* DDR is system memory */
 /* Manually set up DDR parameters
  */
 #define CFG_DDR_SIZE           64      /* MB */
-#define CFG_DDR_CS0_CONFIG     0x80840101
-#define CFG_DDR_TIMING_0       0x00220802
-#define CFG_DDR_TIMING_1       0x3935d322
-#define CFG_DDR_TIMING_2       0x0f9048ca
+#define CFG_DDR_CS0_CONFIG     ( CSCONFIG_EN \
+                               | CSCONFIG_ODT_WR_ACS \
+                               | CSCONFIG_ROW_BIT_13 | CSCONFIG_COL_BIT_9 )
+                               /* 0x80010101 */
+#define CFG_DDR_TIMING_0       ( ( 0 << TIMING_CFG0_RWT_SHIFT ) \
+                               | ( 0 << TIMING_CFG0_WRT_SHIFT ) \
+                               | ( 0 << TIMING_CFG0_RRT_SHIFT ) \
+                               | ( 0 << TIMING_CFG0_WWT_SHIFT ) \
+                               | ( 2 << TIMING_CFG0_ACT_PD_EXIT_SHIFT ) \
+                               | ( 2 << TIMING_CFG0_PRE_PD_EXIT_SHIFT ) \
+                               | ( 8 << TIMING_CFG0_ODT_PD_EXIT_SHIFT ) \
+                               | ( 2 << TIMING_CFG0_MRS_CYC_SHIFT ) )
+                               /* 0x00220802 */
+#define CFG_DDR_TIMING_1       ( ( 2 << TIMING_CFG1_PRETOACT_SHIFT ) \
+                               | ( 6 << TIMING_CFG1_ACTTOPRE_SHIFT ) \
+                               | ( 2 << TIMING_CFG1_ACTTORW_SHIFT ) \
+                               | ( 5 << TIMING_CFG1_CASLAT_SHIFT ) \
+                               | ( 3 << TIMING_CFG1_REFREC_SHIFT ) \
+                               | ( 2 << TIMING_CFG1_WRREC_SHIFT ) \
+                               | ( 2 << TIMING_CFG1_ACTTOACT_SHIFT ) \
+                               | ( 2 << TIMING_CFG1_WRTORD_SHIFT ) )
+                               /* 0x26253222 */
+#define CFG_DDR_TIMING_2       ( ( 1 << TIMING_CFG2_ADD_LAT_SHIFT ) \
+                               | (31 << TIMING_CFG2_CPO_SHIFT ) \
+                               | ( 2 << TIMING_CFG2_WR_LAT_DELAY_SHIFT ) \
+                               | ( 2 << TIMING_CFG2_RD_TO_PRE_SHIFT ) \
+                               | ( 2 << TIMING_CFG2_WR_DATA_DELAY_SHIFT ) \
+                               | ( 3 << TIMING_CFG2_CKE_PLS_SHIFT ) \
+                               | ( 7 << TIMING_CFG2_FOUR_ACT_SHIFT) )
+                               /* 0x1f9048c7 */
 #define CFG_DDR_TIMING_3       0x00000000
-#define CFG_DDR_CLK_CNTL       0x02000000
-#define CFG_DDR_MODE           0x44400232
+#define CFG_DDR_CLK_CNTL       DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05
+                               /* 0x02000000 */
+#define CFG_DDR_MODE           ( ( 0x4448 << SDRAM_MODE_ESD_SHIFT ) \
+                               | ( 0x0232 << SDRAM_MODE_SD_SHIFT ) )
+                               /* 0x44480232 */
 #define CFG_DDR_MODE2          0x8000c000
-#define CFG_DDR_INTERVAL       0x03200064
+#define CFG_DDR_INTERVAL       ( ( 800 << SDRAM_INTERVAL_REFINT_SHIFT ) \
+                               | ( 100 << SDRAM_INTERVAL_BSTOPRE_SHIFT ) )
+                               /* 0x03200064 */
 #define CFG_DDR_CS0_BNDS       0x00000003
-#define CFG_DDR_SDRAM_CFG      0x43080000
+#define CFG_DDR_SDRAM_CFG      ( SDRAM_CFG_SREN \
+                               | SDRAM_CFG_SDRAM_TYPE_DDR2 \
+                               | SDRAM_CFG_32_BE )
+                               /* 0x43080000 */
 #define CFG_DDR_SDRAM_CFG2     0x00401000
 #endif
 
 #define CFG_I2C_OFFSET 0x3000
 
 /*
- * Config on-board RTC
+ * Config on-board EEPROM
  */
-#define CONFIG_RTC_DS1374              /* use ds1374 rtc via i2c */
-#define CFG_I2C_RTC_ADDR       0x68    /* at address 0x68 */
+#define CFG_I2C_EEPROM_ADDR            0x50
+#define CFG_I2C_EEPROM_ADDR_LEN                2
+#define CFG_EEPROM_PAGE_WRITE_BITS     6
+#define CFG_EEPROM_PAGE_WRITE_DELAY_MS 10
+#define CFG_EEPROM_PAGE_WRITE_ENABLE
 
 /*
  * General PCI
 #define CFG_PCI1_IO_SIZE               0x04000000      /* 64M */
 
 #ifdef CONFIG_PCI
-
+#define CONFIG_PCI_SKIP_HOST_BRIDGE
 #define CONFIG_NET_MULTI
 #define CONFIG_PCI_PNP         /* do pci plug-and-play */
 
 
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_I2C
+#define CONFIG_CMD_EEPROM
 #define CONFIG_CMD_ASKENV
 
 #if defined(CONFIG_PCI)
 #define CONFIG_HAS_ETH1                                /* add support for "eth1addr" */
 #define CONFIG_ETH1ADDR        00:04:9f:ef:03:02
 
+/* use mac_read_from_eeprom() to read ethaddr from I2C EEPROM (see CFG_I2C_EEPROM) */
+#define CFG_I2C_MAC_OFFSET     0x7f00  /* MAC address offset in I2C EEPROM */
+
 #define CONFIG_IPADDR          10.0.0.2
 #define CONFIG_SERVERIP                10.0.0.1
 #define CONFIG_GATEWAYIP       10.0.0.1
index f32c4f7..be2ab45 100644 (file)
 #define CFG_PCI_MMIO_BASE      0x90000000
 #define CFG_PCI_MMIO_PHYS      CFG_PCI_MMIO_BASE
 #define CFG_PCI_MMIO_SIZE      0x10000000      /* 256M */
-#define CFG_PCI_IO_BASE                0xE0300000
+#define CFG_PCI_IO_BASE                0x00000000
 #define CFG_PCI_IO_PHYS                0xE0300000
 #define CFG_PCI_IO_SIZE                0x100000        /* 1M */
 
index 48c2736..6b8b74d 100644 (file)
 
 #define CFG_IMMR               0xE0000000      /* The IMMR is relocated to here */
 
+#define CONFIG_MISC_INIT_F
+#define CONFIG_MISC_INIT_R
 
-/* On-board devices */
+/*
+ * On-board devices
+ */
 
 #ifdef CONFIG_MPC8349ITX
 #define CONFIG_COMPACT_FLASH   /* The CF card interface on the back of the board */
-#define CONFIG_VSC7385         /* The Vitesse 7385 5-port switch */
+#define CONFIG_VSC7385_ENET    /* VSC7385 ethernet support */
 #endif
 
 #define CONFIG_PCI
@@ -88,9 +92,6 @@
 /* I2C */
 #ifdef CONFIG_HARD_I2C
 
-#define CONFIG_MISC_INIT_F
-#define CONFIG_MISC_INIT_R
-
 #define CONFIG_FSL_I2C
 #define CONFIG_I2C_MULTI_BUS
 #define CONFIG_I2C_CMD_TREE
 #define CFG_MEMTEST_END                0x2000
 
 #define CFG_DDR_SDRAM_CLK_CNTL (DDR_SDRAM_CLK_CNTL_SS_EN | \
-                               DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
+                               DDR_SDRAM_CLK_CNTL_CLK_ADJUST_075)
 
 #ifdef CONFIG_HARD_I2C
 #define CONFIG_SPD_EEPROM              /* use SPD EEPROM for DDR setup*/
@@ -190,6 +191,18 @@ boards, we say we have two, but don't display a message if we find only one. */
 #define CFG_FLASH_SIZE         16              /* FLASH size in MB */
 #define CFG_FLASH_SIZE_SHIFT   4               /* log2 of the above value */
 
+/* Vitesse 7385 */
+
+#ifdef CONFIG_VSC7385_ENET
+
+#define CONFIG_TSEC2
+
+/* The flash address and size of the VSC7385 firmware image */
+#define CONFIG_VSC7385_IMAGE           0xFEFFE000
+#define CONFIG_VSC7385_IMAGE_SIZE      8192
+
+#endif
+
 /*
  * BRx, ORx, LBLAWBARx, and LBLAWARx
  */
@@ -205,10 +218,10 @@ boards, we say we have two, but don't display a message if we find only one. */
 
 /* Vitesse 7385 */
 
-#ifdef CONFIG_VSC7385
-
 #define CFG_VSC7385_BASE       0xF8000000
 
+#ifdef CONFIG_VSC7385_ENET
+
 #define CFG_BR1_PRELIM         (CFG_VSC7385_BASE | BR_PS_8 | BR_V)
 #define CFG_OR1_PRELIM         (OR_AM_128KB | OR_GPCM_CSNT | OR_GPCM_XACS | \
                                OR_GPCM_SCY_15 | OR_GPCM_SETA | OR_GPCM_TRLX | \
@@ -384,7 +397,7 @@ boards, we say we have two, but don't display a message if we find only one. */
 #define CONFIG_HAS_ETH1
 #define CONFIG_TSEC2_NAME  "TSEC1"
 #define CFG_TSEC2_OFFSET       0x25000
-#define CONFIG_UNKNOWN_TSEC    /* TSEC2 is proprietary */
+
 #define TSEC2_PHY_ADDR         4
 #define TSEC2_PHYIDX           0
 #define TSEC2_FLAGS            TSEC_GIGABIT
@@ -619,11 +632,11 @@ boards, we say we have two, but don't display a message if we find only one. */
  */
 #define CONFIG_ENV_OVERWRITE
 
-#ifdef CONFIG_TSEC1
+#ifdef CONFIG_HAS_ETH0
 #define CONFIG_ETHADDR         00:E0:0C:00:8C:01
 #endif
 
-#ifdef CONFIG_TSEC2
+#ifdef CONFIG_HAS_ETH1
 #define CONFIG_ETH1ADDR                00:E0:0C:00:8C:02
 #endif
 
index c8dcbc6..46451c4 100644 (file)
 #define CFG_FLASH_CFI_DRIVER   /* use the CFI driver */
 #define CFG_FLASH_BASE         0xFE000000 /* FLASH base address */
 #define CFG_FLASH_SIZE         32 /* max FLASH size is 32M */
+#define CONFIG_FLASH_SHOW_PROGRESS 45 /* count down from 45/5: 9..1 */
 
 #define CFG_LBLAWBAR0_PRELIM   CFG_FLASH_BASE /* Window base at flash base */
 #define CFG_LBLAWAR0_PRELIM    0x80000018 /* 32MB window size */
 #define CFG_PCI_MMIO_BASE      0x90000000
 #define CFG_PCI_MMIO_PHYS      CFG_PCI_MMIO_BASE
 #define CFG_PCI_MMIO_SIZE      0x10000000 /* 256M */
-#define CFG_PCI_IO_BASE                0xE0300000
+#define CFG_PCI_IO_BASE                0x00000000
 #define CFG_PCI_IO_PHYS                0xE0300000
 #define CFG_PCI_IO_SIZE                0x100000 /* 1M */
 
index 27b037a..a4f6af6 100644 (file)
@@ -30,8 +30,8 @@
  * System Clock Setup
  */
 #ifdef CONFIG_CLKIN_33MHZ
-#define CONFIG_83XX_CLKIN              33000000
-#define CONFIG_SYS_CLK_FREQ            33000000
+#define CONFIG_83XX_CLKIN              33333333
+#define CONFIG_SYS_CLK_FREQ            33333333
 #define PCI_33M                                1
 #define HRCWL_CSB_TO_CLKIN_MPC8360ERDK HRCWL_CSB_TO_CLKIN_10X1
 #else
@@ -89,8 +89,8 @@
 
 #define CFG_83XX_DDR_USES_CS0
 
-#undef CONFIG_DDR_ECC          /* support DDR ECC function */
-#undef CONFIG_DDR_ECC_CMD      /* Use DDR ECC user commands */
+#define CONFIG_DDR_ECC         /* support DDR ECC function */
+#define CONFIG_DDR_ECC_CMD     /* Use DDR ECC user commands */
 
 /*
  * DDRCDR - DDR Control Driver Register
  */
 #define CONFIG_DDR_II
 #define CFG_DDR_SIZE           256 /* MB */
-#define CFG_DDRCDR             0x80080001
 #define CFG_DDR_CS0_BNDS       0x0000000f
 #define CFG_DDR_CS0_CONFIG     (CSCONFIG_EN | CSCONFIG_ROW_BIT_13 | \
-                                CSCONFIG_COL_BIT_10)
-#define CFG_DDR_TIMING_0       0x00330903
-#define CFG_DDR_TIMING_1       0x3835a322
-#define CFG_DDR_TIMING_2       0x00104909
-#define CFG_DDR_TIMING_3       0x00000000
-#define CFG_DDR_CLK_CNTL       0x02000000
+                                CSCONFIG_COL_BIT_10 | CSCONFIG_ODT_WR_ACS)
+#define CFG_DDR_SDRAM_CFG      (SDRAM_CFG_SDRAM_TYPE_DDR2 | SDRAM_CFG_ECC_EN)
+#define CFG_DDR_SDRAM_CFG2     0x00001000
+#define CFG_DDR_CLK_CNTL       (DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
+#define CFG_DDR_INTERVAL       ((256 << SDRAM_INTERVAL_BSTOPRE_SHIFT) | \
+                                (1115 << SDRAM_INTERVAL_REFINT_SHIFT))
 #define CFG_DDR_MODE           0x47800432
 #define CFG_DDR_MODE2          0x8000c000
-#define CFG_DDR_INTERVAL       0x045b0100
-#define CFG_DDR_SDRAM_CFG      0x03000000
-#define CFG_DDR_SDRAM_CFG2     0x00001000
+
+#define CFG_DDR_TIMING_0       ((2 << TIMING_CFG0_MRS_CYC_SHIFT) | \
+                                (9 << TIMING_CFG0_ODT_PD_EXIT_SHIFT) | \
+                                (3 << TIMING_CFG0_PRE_PD_EXIT_SHIFT) | \
+                                (3 << 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 CFG_DDR_TIMING_1       ((      TIMING_CFG1_CASLAT_30) | \
+                                ( 2 << TIMING_CFG1_WRTORD_SHIFT) | \
+                                ( 2 << TIMING_CFG1_ACTTOACT_SHIFT) | \
+                                ( 3 << TIMING_CFG1_WRREC_SHIFT) | \
+                                (10 << TIMING_CFG1_REFREC_SHIFT) | \
+                                ( 3 << TIMING_CFG1_ACTTORW_SHIFT) | \
+                                ( 8 << TIMING_CFG1_ACTTOPRE_SHIFT) | \
+                                ( 3 << TIMING_CFG1_PRETOACT_SHIFT))
+
+#define CFG_DDR_TIMING_2       ((9 << TIMING_CFG2_FOUR_ACT_SHIFT) | \
+                                (4 << TIMING_CFG2_CKE_PLS_SHIFT) | \
+                                (2 << TIMING_CFG2_WR_DATA_DELAY_SHIFT) | \
+                                (2 << TIMING_CFG2_RD_TO_PRE_SHIFT) | \
+                                (2 << TIMING_CFG2_WR_LAT_DELAY_SHIFT) | \
+                                (0 << TIMING_CFG2_ADD_LAT_SHIFT) | \
+                                (0 << TIMING_CFG2_CPO_SHIFT))
+
+#define CFG_DDR_TIMING_3       0x00000000
 
 /*
  * Memory test
  * NAND flash on the local bus
  */
 #define CFG_NAND_BASE          0x60000000
+#define CONFIG_CMD_NAND                1
+#define CONFIG_NAND_FSL_UPM    1
+#define CFG_MAX_NAND_DEVICE    1
+#define NAND_MAX_CHIPS         1
+#define CONFIG_MTD_NAND_VERIFY_WRITE
 
 #define CFG_LBLAWBAR1_PRELIM   CFG_NAND_BASE
 #define CFG_LBLAWAR1_PRELIM    0x8000001b /* Access window size 4K */
 /* Pass open firmware flat tree */
 #define CONFIG_OF_LIBFDT       1
 #define CONFIG_OF_BOARD_SETUP  1
+#define CONFIG_OF_STDOUT_VIA_ALIAS
 
 /* I2C */
 #define CONFIG_HARD_I2C                /* I2C with hardware support */
 #define CFG_UEC1_TX_CLK                QE_CLK9
 #define CFG_UEC1_ETH_TYPE      GIGA_ETH
 #define CFG_UEC1_PHY_ADDR      2
-#define CFG_UEC1_INTERFACE_MODE ENET_1000_GMII
+#define CFG_UEC1_INTERFACE_MODE ENET_1000_RGMII_RXID
 #endif
 
 #define CONFIG_UEC_ETH2                /* GETH2 */
 #define CFG_UEC2_TX_CLK                QE_CLK4
 #define CFG_UEC2_ETH_TYPE      GIGA_ETH
 #define CFG_UEC2_PHY_ADDR      4
-#define CFG_UEC2_INTERFACE_MODE ENET_1000_GMII
+#define CFG_UEC2_INTERFACE_MODE ENET_1000_RGMII_RXID
 #endif
 
 /*
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DHCP
 
 #if defined(CONFIG_PCI)
 #define CONFIG_CMD_PCI
    "consoledev=ttyS0\0"\
    "loadaddr=a00000\0"\
    "fdtaddr=900000\0"\
-   "bootfile=uImage\0"\
    "fdtfile=dtb\0"\
    "fsfile=fs\0"\
    "ubootfile=u-boot.bin\0"\
+   "mtdparts=mtdparts=60000000.nand-flash:4096k(kernel),128k(dtb),-(rootfs)\0"\
    "setbootargs=setenv bootargs console=$consoledev,$baudrate "\
                "$mtdparts panic=1\0"\
    "adddhcpargs=setenv bootargs $bootargs ip=on\0"\
    "addnfsargs=setenv bootargs $bootargs ip=$ipaddr:$serverip:"\
                "$gatewayip:$netmask:$hostname:$netdev:off "\
                "root=/dev/nfs rw nfsroot=$serverip:$rootpath\0"\
+   "addnandargs=setenv bootargs $bootargs root=/dev/mtdblock3 "\
+               "rootfstype=jffs2 rw\0"\
    "tftp_get_uboot=tftp 100000 $ubootfile\0"\
    "tftp_get_kernel=tftp $loadaddr $bootfile\0"\
    "tftp_get_dtb=tftp $fdtaddr $fdtfile\0"\
    "tftp_get_fs=tftp c00000 $fsfile\0"\
+   "nand_erase_kernel=nand erase 0 400000\0"\
+   "nand_erase_dtb=nand erase 400000 20000\0"\
+   "nand_erase_fs=nand erase 420000 3be0000\0"\
+   "nand_write_kernel=nand write.jffs2 $loadaddr 0 400000\0"\
+   "nand_write_dtb=nand write.jffs2 $fdtaddr 400000 20000\0"\
+   "nand_write_fs=nand write.jffs2 c00000 420000 $filesize\0"\
+   "nand_read_kernel=nand read.jffs2 $loadaddr 0 400000\0"\
+   "nand_read_dtb=nand read.jffs2 $fdtaddr 400000 20000\0"\
    "nor_reflash=protect off ff800000 ff87ffff ; erase ff800000 ff87ffff ; "\
                "cp.b 100000 ff800000 $filesize\0"\
+   "nand_reflash_kernel=run tftp_get_kernel nand_erase_kernel "\
+               "nand_write_kernel\0"\
+   "nand_reflash_dtb=run tftp_get_dtb nand_erase_dtb nand_write_dtb\0"\
+   "nand_reflash_fs=run tftp_get_fs nand_erase_fs nand_write_fs\0"\
+   "nand_reflash=run nand_reflash_kernel nand_reflash_dtb "\
+               "nand_reflash_fs\0"\
    "boot_m=bootm $loadaddr - $fdtaddr\0"\
-   "dhcpboot=run setbootargs adddhcpargs tftp_get_kernel tftp_get_dtb "\
-               "boot_m\0"\
+   "dhcpboot=dhcp ; run setbootargs adddhcpargs tftp_get_dtb boot_m\0"\
    "nfsboot=run setbootargs addnfsargs tftp_get_kernel tftp_get_dtb "\
-               "boot_m\0"\
+               "boot_m\0"\
+   "nandboot=run setbootargs addnandargs nand_read_kernel nand_read_dtb "\
+               "boot_m\0"\
    ""
 
 #define CONFIG_BOOTCOMMAND "run dhcpboot"
index 5586533..7fc0f7e 100644 (file)
@@ -96,7 +96,7 @@
  */
 #define CFG_SCCR_TSEC1CM       1       /* CSB:eTSEC1 = 1:1 */
 #define CFG_SCCR_TSEC2CM       1       /* CSB:eTSEC2 = 1:1 */
-#define CFG_SCCR_SATACM                SCCR_SATACM_1   /* CSB:SATA[0:3] = 1:1 */
+#define CFG_SCCR_SATACM                SCCR_SATACM_2   /* CSB:SATA[0:3] = 2:1 */
 
 /*
  * System IO Config
 #define CFG_PCI_MMIO_BASE      0x90000000
 #define CFG_PCI_MMIO_PHYS      CFG_PCI_MMIO_BASE
 #define CFG_PCI_MMIO_SIZE      0x10000000 /* 256M */
-#define CFG_PCI_IO_BASE                0xE0300000
+#define CFG_PCI_IO_BASE                0x00000000
 #define CFG_PCI_IO_PHYS                0xE0300000
 #define CFG_PCI_IO_SIZE                0x100000 /* 1M */
 
 /* Options are: TSEC[0-1] */
 #define CONFIG_ETHPRIME                "eTSEC1"
 
+/* SERDES */
+#define CONFIG_FSL_SERDES
+#define CONFIG_FSL_SERDES1     0xe3000
+#define CONFIG_FSL_SERDES2     0xe3100
+
+/*
+ * SATA
+ */
+#define CONFIG_LIBATA
+#define CONFIG_FSL_SATA
+
+#define CFG_SATA_MAX_DEVICE    2
+#define CONFIG_SATA1
+#define CFG_SATA1_OFFSET       0x18000
+#define CFG_SATA1              (CFG_IMMR + CFG_SATA1_OFFSET)
+#define CFG_SATA1_FLAGS                FLAGS_DMA
+#define CONFIG_SATA2
+#define CFG_SATA2_OFFSET       0x19000
+#define CFG_SATA2              (CFG_IMMR + CFG_SATA2_OFFSET)
+#define CFG_SATA2_FLAGS                FLAGS_DMA
+
+#ifdef CONFIG_FSL_SATA
+#define CONFIG_LBA48
+#define CONFIG_CMD_SATA
+#define CONFIG_DOS_PARTITION
+#define CONFIG_CMD_EXT2
+#endif
+
 /*
  * Environment
  */
index 1964946..c698ff8 100644 (file)
 
 #define CONFIG_PCI     1
 
+#define CONFIG_BOARD_EARLY_INIT_F
+#define CONFIG_MISC_INIT_R
+
+/*
+ * On-board devices
+ */
+#define CONFIG_TSEC_ENET               /* TSEC Ethernet support */
+#define CONFIG_VSC7385_ENET
+
 /*
  * System Clock Setup
  */
 /* System Clock Configuration Register */
 #define CFG_SCCR_TSEC1CM       1               /* eTSEC1 clock mode (0-3) */
 #define CFG_SCCR_TSEC2CM       1               /* eTSEC2 clock mode (0-3) */
-#define CFG_SCCR_SATACM                SCCR_SATACM_1   /* SATA1-4 clock mode (0-3) */
+#define CFG_SCCR_SATACM                SCCR_SATACM_2   /* SATA1-4 clock mode (0-3) */
 
 /*
  * System IO Config
 #define CFG_IMMR               0xE0000000
 
 /*
+ * Device configurations
+ */
+
+/* Vitesse 7385 */
+
+#ifdef CONFIG_VSC7385_ENET
+
+#define CONFIG_TSEC2
+
+/* The flash address and size of the VSC7385 firmware image */
+#define CONFIG_VSC7385_IMAGE           0xFE7FE000
+#define CONFIG_VSC7385_IMAGE_SIZE      8192
+
+#endif
+
+/*
  * DDR Setup
  */
 #define CFG_DDR_BASE           0x00000000 /* DDR is system memory */
 #define CFG_FLASH_ERASE_TOUT   60000   /* Flash Erase Timeout (ms) */
 #define CFG_FLASH_WRITE_TOUT   500     /* Flash Write Timeout (ms) */
 
+/*
+ * NAND Flash on the Local Bus
+ */
+#define CFG_NAND_BASE          0xE0600000      /* 0xE0600000 */
+#define CFG_BR1_PRELIM         (CFG_NAND_BASE | \
+                                (2 << BR_DECC_SHIFT) | /* Use HW ECC */ \
+                                BR_PS_8 |              /* Port Size = 8 bit */ \
+                                BR_MS_FCM |            /* MSEL = FCM */ \
+                                BR_V)                  /* valid */
+#define CFG_OR1_PRELIM         (0xFFFF8000 |           /* length 32K */ \
+                                OR_FCM_CSCT | \
+                                OR_FCM_CST | \
+                                OR_FCM_CHT | \
+                                OR_FCM_SCY_1 | \
+                                OR_FCM_TRLX | \
+                                OR_FCM_EHTR)
+#define CFG_LBLAWBAR1_PRELIM   CFG_NAND_BASE
+#define CFG_LBLAWAR1_PRELIM    0x8000000E      /* 32KB  */
+
+/* Vitesse 7385 */
+
 #define CFG_VSC7385_BASE       0xF0000000
 
-/* VSC7385 Gigabit Switch support */
-#define CONFIG_VSC7385_ENET
+#ifdef CONFIG_VSC7385_ENET
+
 #define CFG_BR2_PRELIM         0xf0000801              /* Base address */
 #define CFG_OR2_PRELIM         0xfffe09ff              /* 128K bytes*/
 #define CFG_LBLAWBAR2_PRELIM   CFG_VSC7385_BASE        /* Access Base */
 #define CFG_LBLAWAR2_PRELIM    0x80000010              /* Access Size 128K */
 
+#endif
+
 /*
  * Serial Port
  */
 #define CFG_NS16550_COM1       (CFG_IMMR+0x4500)
 #define CFG_NS16550_COM2       (CFG_IMMR+0x4600)
 
+/* SERDES */
+#define CONFIG_FSL_SERDES
+#define CONFIG_FSL_SERDES1     0xe3000
+#define CONFIG_FSL_SERDES2     0xe3100
+
 /* Use the HUSH parser */
 #define CFG_HUSH_PARSER
 #ifdef CFG_HUSH_PARSER
 /* Pass open firmware flat tree */
 #define CONFIG_OF_LIBFDT       1
 #define CONFIG_OF_BOARD_SETUP  1
+#define CONFIG_OF_STDOUT_VIA_ALIAS 1
 
 /* I2C */
 #define CONFIG_HARD_I2C                /* I2C with hardware support */
 #define CFG_PCI_MMIO_BASE      0x90000000
 #define CFG_PCI_MMIO_PHYS      CFG_PCI_MMIO_BASE
 #define CFG_PCI_MMIO_SIZE      0x10000000 /* 256M */
-#define CFG_PCI_IO_BASE                0xE0300000
+#define CFG_PCI_IO_BASE                0x00000000
 #define CFG_PCI_IO_PHYS                0xE0300000
 #define CFG_PCI_IO_SIZE                0x100000 /* 1M */
 
 #define CONFIG_NET_MULTI
 #define CONFIG_PCI_PNP         /* do pci plug-and-play */
 
-#undef CONFIG_EEPRO100
 #undef CONFIG_PCI_SCAN_SHOW    /* show pci devices on startup */
 #define CFG_PCI_SUBSYS_VENDORID 0x1957 /* Freescale */
 #endif /* CONFIG_PCI */
 
-#ifndef CONFIG_NET_MULTI
-#define CONFIG_NET_MULTI       1
-#endif
-
 /*
  * TSEC
  */
-#define CONFIG_TSEC_ENET       /* TSEC ethernet support */
-#define CFG_TSEC1_OFFSET       0x24000
-#define CFG_TSEC1              (CFG_IMMR+CFG_TSEC1_OFFSET)
-#define CFG_TSEC2_OFFSET       0x25000
-#define CFG_TSEC2              (CFG_IMMR+CFG_TSEC2_OFFSET)
+#ifdef CONFIG_TSEC_ENET
 
-/*
- * TSEC ethernet configuration
- */
-#define CONFIG_GMII                    1       /* MII PHY management */
-#define CONFIG_TSEC1                   1
+#define CONFIG_NET_MULTI
+#define CONFIG_GMII                    /* MII PHY management */
+
+#define CONFIG_TSEC1
+
+#ifdef CONFIG_TSEC1
+#define CONFIG_HAS_ETH0
 #define CONFIG_TSEC1_NAME              "TSEC0"
-#define CONFIG_TSEC2                   1
-#define CONFIG_TSEC2_NAME              "TSEC1"
+#define CFG_TSEC1_OFFSET               0x24000
 #define TSEC1_PHY_ADDR                 2
-#define TSEC2_PHY_ADDR                 0x1c
 #define TSEC1_FLAGS                    (TSEC_GIGABIT | TSEC_REDUCED)
-#define TSEC2_FLAGS                    (TSEC_GIGABIT | TSEC_REDUCED)
 #define TSEC1_PHYIDX                   0
-#define TSEC2_PHYIDX                   0
+#endif
 
+#ifdef CONFIG_TSEC2
+#define CONFIG_HAS_ETH1
+#define CONFIG_TSEC2_NAME              "TSEC1"
+#define CFG_TSEC2_OFFSET               0x25000
+#define TSEC2_PHY_ADDR                 0x1c
+#define TSEC2_FLAGS                    (TSEC_GIGABIT | TSEC_REDUCED)
+#define TSEC2_PHYIDX                   0
+#endif
 
 /* Options are: TSEC[0-1] */
 #define CONFIG_ETHPRIME                        "TSEC0"
 
+#endif
+
+/*
+ * SATA
+ */
+#define CONFIG_LIBATA
+#define CONFIG_FSL_SATA
+
+#define CFG_SATA_MAX_DEVICE    2
+#define CONFIG_SATA1
+#define CFG_SATA1_OFFSET       0x18000
+#define CFG_SATA1              (CFG_IMMR + CFG_SATA1_OFFSET)
+#define CFG_SATA1_FLAGS                FLAGS_DMA
+#define CONFIG_SATA2
+#define CFG_SATA2_OFFSET       0x19000
+#define CFG_SATA2              (CFG_IMMR + CFG_SATA2_OFFSET)
+#define CFG_SATA2_FLAGS                FLAGS_DMA
+
+#ifdef CONFIG_FSL_SATA
+#define CONFIG_LBA48
+#define CONFIG_CMD_SATA
+#define CONFIG_DOS_PARTITION
+#define CONFIG_CMD_EXT2
+#endif
+
 /*
  * Environment
  */
  */
 #define CONFIG_ENV_OVERWRITE
 
-#define CONFIG_HAS_ETH0                                /* add support for "ethaddr" */
-#define CONFIG_ETHADDR 00:04:9f:ef:04:01
-#define CONFIG_HAS_ETH1                                /* add support for "eth1addr" */
-#define CONFIG_ETH1ADDR        00:04:9f:ef:04:02
+#ifdef CONFIG_HAS_ETH0
+#define CONFIG_ETHADDR         00:04:9f:ef:04:01
+#endif
+
+#ifdef CONFIG_HAS_ETH1
+#define CONFIG_ETH1ADDR                00:04:9f:ef:04:02
+#endif
+
+#define CONFIG_HAS_FSL_DR_USB
 
 #define CONFIG_IPADDR          10.0.0.2
 #define CONFIG_SERVERIP                10.0.0.1
index 5ea7b25..85934d7 100644 (file)
  */
 #define CFG_CCSRBAR_DEFAULT    0xff700000      /* CCSRBAR Default */
 #define CFG_CCSRBAR            0xe0000000      /* relocated CCSRBAR */
+#define CFG_CCSRBAR_PHYS       CFG_CCSRBAR     /* physical addr of CCSRBAR */
 #define CFG_IMMR               CFG_CCSRBAR     /* PQII uses CFG_IMMR */
 
 
index 174215c..77eea73 100644 (file)
@@ -83,6 +83,7 @@
  */
 #define CFG_CCSRBAR_DEFAULT    0xff700000      /* CCSRBAR Default      */
 #define CFG_CCSRBAR            0xe0000000      /* relocated CCSRBAR    */
+#define CFG_CCSRBAR_PHYS       CFG_CCSRBAR     /* physical addr of CCSRBAR */
 #define CFG_IMMR               CFG_CCSRBAR     /* PQII uses CFG_IMMR   */
 
 #define CFG_DDR_SDRAM_BASE     0x00000000      /* DDR is system memory  */
index 7334088..3f3f741 100644 (file)
@@ -49,6 +49,9 @@
 
 #define CONFIG_FSL_LAW         1       /* Use common FSL init code */
 
+#define CONFIG_FSL_VIA
+#define CONFIG_FSL_CDS_EEPROM
+
 /*
  * When initializing flash, if we cannot find the manufacturer ID,
  * assume this is the AMD flash associated with the CDS board.
@@ -82,6 +85,7 @@ extern unsigned long get_clock_freq(void);
  */
 #define CFG_CCSRBAR_DEFAULT    0xff700000      /* CCSRBAR Default */
 #define CFG_CCSRBAR            0xe0000000      /* relocated CCSRBAR */
+#define CFG_CCSRBAR_PHYS       CFG_CCSRBAR     /* physical addr of CCSRBAR */
 #define CFG_IMMR               CFG_CCSRBAR     /* PQII uses CFG_IMMR */
 
 /*
@@ -273,6 +277,8 @@ extern unsigned long get_clock_freq(void);
  * 1111 1111 1111 0000 0000 1111 1111 0111 = fff00ff7
  */
 
+#define CONFIG_FSL_CADMUS
+
 #define CADMUS_BASE_ADDR 0xf8000000
 #define CFG_BR3_PRELIM   0xf8000801
 #define CFG_OR3_PRELIM   0xfff00ff7
index a894209..c83d9e2 100644 (file)
@@ -98,6 +98,7 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
  */
 #define CFG_CCSRBAR_DEFAULT    0xff700000      /* CCSRBAR Default */
 #define CFG_CCSRBAR            0xe0000000      /* relocated CCSRBAR */
+#define CFG_CCSRBAR_PHYS       CFG_CCSRBAR     /* physical addr of CCSRBAR */
 #define CFG_IMMR               CFG_CCSRBAR     /* PQII uses CFG_IMMR */
 
 #define CFG_PCI1_ADDR          (CFG_CCSRBAR+0x8000)
index a3db9f4..fc8ad88 100644 (file)
@@ -57,6 +57,9 @@
 
 #define CONFIG_FSL_LAW         1       /* Use common FSL init code */
 
+#define CONFIG_FSL_VIA
+#define CONFIG_FSL_CDS_EEPROM
+
 /*
  * When initializing flash, if we cannot find the manufacturer ID,
  * assume this is the AMD flash associated with the CDS board.
@@ -96,6 +99,7 @@ extern unsigned long get_clock_freq(void);
  */
 #define CFG_CCSRBAR_DEFAULT    0xff700000      /* CCSRBAR Default */
 #define CFG_CCSRBAR            0xe0000000      /* relocated CCSRBAR */
+#define CFG_CCSRBAR_PHYS       CFG_CCSRBAR     /* physical addr of CCSRBAR */
 #define CFG_IMMR               CFG_CCSRBAR     /* PQII uses CFG_IMMR */
 
 #define CFG_PCI1_ADDR  (CFG_CCSRBAR+0x8000)
@@ -296,6 +300,8 @@ extern unsigned long get_clock_freq(void);
  * 1111 1111 1111 0000 0000 1111 1111 0111 = fff00ff7
  */
 
+#define CONFIG_FSL_CADMUS
+
 #define CADMUS_BASE_ADDR 0xf8000000
 #define CFG_BR3_PRELIM  0xf8000801
 #define CFG_OR3_PRELIM  0xfff00ff7
index 93877ae..500b57c 100644 (file)
@@ -49,6 +49,9 @@
 
 #define CONFIG_FSL_LAW         1       /* Use common FSL init code */
 
+#define CONFIG_FSL_VIA
+#define CONFIG_FSL_CDS_EEPROM
+
 /*
  * When initializing flash, if we cannot find the manufacturer ID,
  * assume this is the AMD flash associated with the CDS board.
@@ -82,6 +85,7 @@ extern unsigned long get_clock_freq(void);
  */
 #define CFG_CCSRBAR_DEFAULT    0xff700000      /* CCSRBAR Default */
 #define CFG_CCSRBAR            0xe0000000      /* relocated CCSRBAR */
+#define CFG_CCSRBAR_PHYS       CFG_CCSRBAR     /* physical addr of CCSRBAR */
 #define CFG_IMMR               CFG_CCSRBAR     /* PQII uses CFG_IMMR */
 
 /*
@@ -273,6 +277,8 @@ extern unsigned long get_clock_freq(void);
  * 1111 1111 1111 0000 0000 1111 1111 0111 = fff00ff7
  */
 
+#define CONFIG_FSL_CADMUS
+
 #define CADMUS_BASE_ADDR 0xf8000000
 #define CFG_BR3_PRELIM   0xf8000801
 #define CFG_OR3_PRELIM   0xfff00ff7
index 08884b3..e30302c 100644 (file)
@@ -95,6 +95,7 @@
  */
 #define CFG_CCSRBAR_DEFAULT    0xff700000      /* CCSRBAR Default */
 #define CFG_CCSRBAR            0xe0000000      /* relocated CCSRBAR */
+#define CFG_CCSRBAR_PHYS       CFG_CCSRBAR     /* physical addr of CCSRBAR */
 #define CFG_IMMR               CFG_CCSRBAR     /* PQII uses CFG_IMMR */
 
 
index a12d193..7bb20e5 100644 (file)
@@ -90,6 +90,7 @@ extern unsigned long get_clock_freq(void);
  */
 #define CFG_CCSRBAR_DEFAULT    0xff700000      /* CCSRBAR Default */
 #define CFG_CCSRBAR            0xe0000000      /* relocated CCSRBAR */
+#define CFG_CCSRBAR_PHYS       CFG_CCSRBAR     /* physical addr of CCSRBAR */
 #define CFG_IMMR               CFG_CCSRBAR     /* PQII uses CFG_IMMR */
 
 #define CFG_PCI1_ADDR           (CFG_CCSRBAR+0x8000)
diff --git a/include/configs/MigoR.h b/include/configs/MigoR.h
new file mode 100644 (file)
index 0000000..99e1179
--- /dev/null
@@ -0,0 +1,151 @@
+/*
+ * Configuation settings for the Renesas Solutions Migo-R board
+ *
+ * Copyright (C) 2007 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+ *
+ * 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 __MIGO_R_H
+#define __MIGO_R_H
+
+#undef DEBUG
+#define CONFIG_SH              1
+#define CONFIG_SH4             1
+#define CONFIG_CPU_SH7722      1
+#define CONFIG_MIGO_R          1
+
+#define CONFIG_CMD_LOADB
+#define CONFIG_CMD_LOADS
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_MEMORY
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_DFL
+#define CONFIG_CMD_SDRAM
+#define CONFIG_CMD_ENV
+
+#define CONFIG_BAUDRATE                115200
+#define CONFIG_BOOTDELAY       3
+#define CONFIG_BOOTARGS                "console=ttySC0,115200 root=1f01"
+#define CONFIG_NETMASK         255.255.255.0
+#define CONFIG_IPADDR          192.168.10.100
+#define CONFIG_SERVERIP                192.168.10.77
+#define CONFIG_GATEWAYIP       192.168.10.77
+
+#define CONFIG_VERSION_VARIABLE
+#undef  CONFIG_SHOW_BOOT_PROGRESS
+
+/* SMC9111 */
+#define CONFIG_DRIVER_SMC91111
+#define CONFIG_SMC91111_BASE    (0xB0000000)
+
+/* MEMORY */
+#define MIGO_R_SDRAM_BASE      (0x8C000000)
+#define MIGO_R_FLASH_BASE_1    (0xA0000000)
+#define MIGO_R_FLASH_BANK_SIZE (64 * 1024 * 1024)
+
+#define CFG_LONGHELP                   /* undef to save memory */
+#define CFG_PROMPT             "=> "   /* Monitor Command Prompt */
+#define CFG_CBSIZE             256             /* Buffer size for input from the Console */
+#define CFG_PBSIZE             256             /* Buffer size for Console output */
+#define CFG_MAXARGS            16              /* max args accepted for monitor commands */
+#define CFG_BARGSIZE   512             /* Buffer size for Boot Arguments passed to kernel */
+#define CFG_BAUDRATE_TABLE     { 115200 }      /* List of legal baudrate settings for this board */
+
+/* SCIF */
+#define CFG_SCIF_CONSOLE       1
+#define CONFIG_CONS_SCIF0      1
+#undef  CFG_CONSOLE_INFO_QUIET /* Suppress display of console
+                                                                  information at boot */
+#undef  CFG_CONSOLE_OVERWRITE_ROUTINE
+#undef  CFG_CONSOLE_ENV_OVERWRITE
+
+#define CFG_MEMTEST_START      (MIGO_R_SDRAM_BASE)
+#define CFG_MEMTEST_END                (CFG_MEMTEST_START + (60 * 1024 * 1024))
+
+/* Enable alternate, more extensive, memory test */
+#undef  CFG_ALT_MEMTEST
+/* Scratch address used by the alternate memory test */
+#undef  CFG_MEMTEST_SCRATCH
+
+/* Enable temporary baudrate change while serial download */
+#undef  CFG_LOADS_BAUD_CHANGE
+
+#define CFG_SDRAM_BASE (MIGO_R_SDRAM_BASE)
+/* maybe more, but if so u-boot doesn't know about it... */
+#define CFG_SDRAM_SIZE (64 * 1024 * 1024)
+/* default load address for scripts ?!? */
+#define CFG_LOAD_ADDR  (CFG_SDRAM_BASE + 16 * 1024 * 1024)
+
+/* Address of u-boot image in Flash (NOT run time address in SDRAM) ?!? */
+#define CFG_MONITOR_BASE       (MIGO_R_FLASH_BASE_1)
+/* Monitor size */
+#define CFG_MONITOR_LEN        (128 * 1024)
+/* Size of DRAM reserved for malloc() use */
+#define CFG_MALLOC_LEN (256 * 1024)
+/* size in bytes reserved for initial data */
+#define CFG_GBL_DATA_SIZE      (256)
+#define CFG_BOOTMAPSZ  (8 * 1024 * 1024)
+
+/* FLASH */
+#define CFG_FLASH_CFI
+#define CFG_FLASH_CFI_DRIVER
+#undef  CFG_FLASH_QUIET_TEST
+/* print 'E' for empty sector on flinfo */
+#define CFG_FLASH_EMPTY_INFO
+/* Physical start address of Flash memory */
+#define CFG_FLASH_BASE (MIGO_R_FLASH_BASE_1)
+/* Max number of sectors on each Flash chip */
+#define CFG_MAX_FLASH_SECT     512
+
+/* if you use all NOR Flash , you change dip-switch. Please see MIGO_R01 Manual. */
+#define CFG_MAX_FLASH_BANKS    1
+#define CFG_FLASH_BANKS_LIST   { CFG_FLASH_BASE + (0 * MIGO_R_FLASH_BANK_SIZE) }
+
+/* Timeout for Flash erase operations (in ms) */
+#define CFG_FLASH_ERASE_TOUT   (3 * 1000)
+/* Timeout for Flash write operations (in ms) */
+#define CFG_FLASH_WRITE_TOUT   (3 * 1000)
+/* Timeout for Flash set sector lock bit operations (in ms) */
+#define CFG_FLASH_LOCK_TOUT    (3 * 1000)
+/* Timeout for Flash clear lock bit operations (in ms) */
+#define CFG_FLASH_UNLOCK_TOUT  (3 * 1000)
+
+/* Use hardware flash sectors protection instead of U-Boot software protection */
+#undef  CFG_FLASH_PROTECTION
+#undef  CFG_DIRECT_FLASH_TFTP
+
+/* ENV setting */
+#define CFG_ENV_IS_IN_FLASH
+#define CONFIG_ENV_OVERWRITE   1
+#define CFG_ENV_SECT_SIZE      (128 * 1024)
+#define CFG_ENV_SIZE           (CFG_ENV_SECT_SIZE)
+#define CFG_ENV_ADDR           (CFG_FLASH_BASE + CFG_MONITOR_LEN)
+/* Offset of env Flash sector relative to CFG_FLASH_BASE */
+#define CFG_ENV_OFFSET         (CFG_ENV_ADDR - CFG_FLASH_BASE)
+#define CFG_ENV_SIZE_REDUND    (CFG_ENV_SECT_SIZE)
+
+/* Board Clock */
+#define CONFIG_SYS_CLK_FREQ    33333333
+#define TMU_CLK_DIVIDER                (4)     /* 4 (default), 16, 64, 256 or 1024 */
+#define CFG_HZ                 (CONFIG_SYS_CLK_FREQ / TMU_CLK_DIVIDER)
+
+#endif /* __MIGO_R_H */
index bb3d19d..e3c6fd3 100644 (file)
 #define        FEC_ENET                1       /* eth.c needs it that way... */
 #undef CFG_DISCOVER_PHY
 #define CONFIG_MII             1
+#define CONFIG_MII_INIT                1
 #define CONFIG_RMII            1       /* use RMII interface */
 
 #define CONFIG_ETHER_ON_FEC1   1
index 945f47f..20404a3 100644 (file)
@@ -97,6 +97,7 @@
 #define        FEC_ENET                1       /* eth.c needs it that way... */
 #undef  CFG_DISCOVER_PHY               /* do not discover phys */
 #define CONFIG_MII             1
+#define CONFIG_MII_INIT                1
 #define CONFIG_RMII            1       /* use RMII interface */
 
 #if defined(CONFIG_NETTA_ISDN)
index fb8085d..cf66e04 100644 (file)
 #define        FEC_ENET                1       /* eth.c needs it that way... */
 #undef CFG_DISCOVER_PHY
 #define CONFIG_MII             1
+#define CONFIG_MII_INIT                1
 #define CONFIG_RMII            1       /* use RMII interface */
 
 #define CONFIG_ETHER_ON_FEC1   1
index d9405b0..ad480a6 100644 (file)
@@ -57,6 +57,7 @@
 #define CONFIG_PCI             1
 #define CONFIG_PCI_PNP         1
 #define CONFIG_PCI_SCAN_SHOW   1
+#define CONFIG_PCIAUTO_SKIP_HOST_BRIDGE        1
 
 #define CONFIG_PCI_MEM_BUS     0x40000000
 #define CONFIG_PCI_MEM_PHYS    CONFIG_PCI_MEM_BUS
index 819bee7..bd058fc 100644 (file)
@@ -92,6 +92,7 @@
  */
 #define CFG_CCSRBAR_DEFAULT    0xff700000      /* CCSRBAR Default */
 #define CFG_CCSRBAR            0xe0000000      /* relocated CCSRBAR */
+#define CFG_CCSRBAR_PHYS       CFG_CCSRBAR     /* physical addr of CCSRBAR */
 #define CFG_IMMR               CFG_CCSRBAR     /* PQII uses CFG_IMMR */
 
 
index 8902f42..38a26dc 100644 (file)
@@ -94,6 +94,7 @@
  */
 #define CFG_CCSRBAR_DEFAULT    0xff700000      /* CCSRBAR Default */
 #define CFG_CCSRBAR            0xe0000000      /* relocated CCSRBAR */
+#define CFG_CCSRBAR_PHYS       CFG_CCSRBAR     /* physical addr of CCSRBAR */
 #define CFG_IMMR               CFG_CCSRBAR     /* PQII uses CFG_IMMR */
 
 
index 2bbfe9a..946b3c2 100644 (file)
@@ -99,6 +99,7 @@
 #else
   #define CFG_CCSRBAR          0xff700000      /* default CCSRBAR      */
 #endif
+#define CFG_CCSRBAR_PHYS       CFG_CCSRBAR     /* physical addr of CCSRBAR */
 #define CFG_IMMR               CFG_CCSRBAR     /* PQII uses CFG_IMMR   */
 
 #define CFG_DDR_SDRAM_BASE     0x00000000      /* DDR is system memory  */
index 50f1c63..7310abf 100644 (file)
 #define CONFIG_FEC2_PHY        2
 #endif
 
+#define CONFIG_MII_INIT        1
+
 #define CONFIG_NET_RETRY_COUNT 3
 #define CONFIG_ETHPRIME                "FEC ETHERNET"
 
index dea5ead..1affcfd 100644 (file)
@@ -67,6 +67,7 @@
 #  define CONFIG_PCI           1
 #  define CONFIG_PCI_PNP               1
 #  define CONFIG_PCI_SCAN_SHOW 1
+#  define CONFIG_PCIAUTO_SKIP_HOST_BRIDGE      1
 
 #  define CONFIG_PCI_MEM_BUS   0x40000000
 #  define CONFIG_PCI_MEM_PHYS  CONFIG_PCI_MEM_BUS
index 66f7a11..8237ba1 100644 (file)
 #define        FEC_ENET                        1       /* eth.c needs it that way... */
 #define CFG_DISCOVER_PHY       1
 #define CONFIG_MII                     1
+#define CONFIG_MII_INIT                1
 #define CONFIG_PHY_ADDR                31
 
 /*-----------------------------------------------------------------------
index 9a0e9b8..bff2edf 100644 (file)
 
 #ifdef CONFIG_PCI
 #define CONFIG_CMD_PCI
+#define CONFIG_PCIAUTO_SKIP_HOST_BRIDGE        1
 #endif
 
 #if defined(CONFIG_MINIFAP) || defined(CONFIG_STK52XX) || defined(CONFIG_FO300)
        "setup=tftp 200000 cam5200/setup.img; autoscr 200000\0"
 #endif
 
+#if defined(CONFIG_TQM5200_B)
+#define ENV_FLASH_LAYOUT                                               \
+       "fdt_addr=FC100000\0"                                           \
+       "kernel_addr=FC140000\0"                                        \
+       "ramdisk_addr=FC600000\0"
+#else  /* !CONFIG_TQM5200_B */
+#define ENV_FLASH_LAYOUT                                               \
+       "fdt_addr=FC0A0000\0"                                           \
+       "kernel_addr=FC0C0000\0"                                        \
+       "ramdisk_addr=FC300000\0"
+#endif
+
 #define CONFIG_EXTRA_ENV_SETTINGS                                      \
        "netdev=eth0\0"                                                 \
        "console=ttyPSC0\0"                                             \
-       "fdt_addr=FC0A0000\0"                                           \
-       "kernel_addr=FC0C0000\0"                                        \
-       "ramdisk_addr=FC300000\0"                                       \
+       ENV_FLASH_LAYOUT                                                \
        "kernel_addr_r=400000\0"                                        \
        "fdt_addr_r=600000\0"                                           \
        "rootpath=/opt/eldk/ppc_6xx\0"                                  \
 # if defined(CONFIG_TQM5200_B)
 #  if defined(CFG_LOWBOOT)
 #   define MTDPARTS_DEFAULT    "mtdparts=TQM5200-0:1m(firmware),"      \
-                                               "1536k(kernel),"        \
-                                               "3584k(small-fs),"      \
+                                               "256k(dtb),"            \
+                                               "2304k(kernel),"        \
+                                               "2560k(small-fs),"      \
                                                "2m(initrd),"           \
                                                "8m(misc),"             \
                                                "16m(big-fs)"
index 21e8baf..fca5f74 100644 (file)
@@ -89,6 +89,7 @@
  */
 #define CFG_CCSRBAR_DEFAULT    0xFF700000      /* CCSRBAR Default      */
 #define CFG_CCSRBAR            0xE0000000      /* relocated CCSRBAR    */
+#define CFG_CCSRBAR_PHYS       CFG_CCSRBAR     /* physical addr of CCSRBAR */
 #define CFG_IMMR               CFG_CCSRBAR     /* PQII uses CFG_IMMR   */
 
 /*
index a254bcd..f075442 100644 (file)
 
 #if defined(CONFIG_CMD_MII)
 #define CFG_DISCOVER_PHY
+#define CONFIG_MII_INIT        1
 #endif
 
 #define CONFIG_NET_RETRY_COUNT 1       /* reduce max. timeout before
index 2e9a2bc..2507d77 100644 (file)
@@ -80,6 +80,7 @@
 #define CONFIG_PCI             1
 #define CONFIG_PCI_PNP         1
 #define CONFIG_PCI_SCAN_SHOW   1
+#define CONFIG_PCIAUTO_SKIP_HOST_BRIDGE        1
 
 #define CONFIG_PCI_MEM_BUS     0x40000000
 #define CONFIG_PCI_MEM_PHYS    CONFIG_PCI_MEM_BUS
index c147424..81e7c1e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2007 DENX Software Engineering
+ * (C) Copyright 2007, 2008 DENX Software Engineering
  *
  * See file CREDITS for list of people who contributed to this
  * project.
        "addtty=setenv bootargs ${bootargs} "                           \
                "console=${consdev},${baudrate}\0"                      \
        "flash_nfs=run nfsargs addip addtty;"                           \
-               "bootm ${kernel_addr} - ${fdt_addr}\0"          \
+               "bootm ${kernel_addr} - ${fdt_addr}\0"                  \
        "flash_self=run ramargs addip addtty;"                          \
                "bootm ${kernel_addr} ${ramdisk_addr} ${fdt_addr}\0"    \
        "net_nfs=tftp ${kernel_addr_r} ${bootfile};"                    \
                "bootm ${kernel_addr_r} - ${fdt_addr_r}\0"              \
        "net_self=tftp ${kernel_addr_r} ${bootfile};"                   \
                "tftp ${ramdisk_addr_r} ${ramdiskfile};"                \
-               "tftp ${fdt_addr_r} ${fdtfile};"                                \
+               "tftp ${fdt_addr_r} ${fdtfile};"                        \
                "run ramargs addip addtty;"                             \
                "bootm ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}\0"\
-       "load=tftp ${u-boot_addr_r} ${u-boot}\0"                                \
+       "load=tftp ${u-boot_addr_r} ${u-boot}\0"                        \
        "update=protect off ${u-boot_addr} +${filesize};"               \
                "era ${u-boot_addr} +${filesize};"                      \
                "cp.b ${u-boot_addr_r} ${u-boot_addr} ${filesize}\0"    \
index 0163025..e3f810c 100644 (file)
@@ -60,6 +60,7 @@
 #define CONFIG_PCI             1
 #define CONFIG_PCI_PNP         1
 /* #define CONFIG_PCI_SCAN_SHOW        1 */
+#define CONFIG_PCIAUTO_SKIP_HOST_BRIDGE                1
 
 #define CONFIG_PCI_MEM_BUS     0x40000000
 #define CONFIG_PCI_MEM_PHYS    CONFIG_PCI_MEM_BUS
index 38fb7c6..3e906c4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2006-2007
+ * (C) Copyright 2006-2008
  * Stefan Roese, DENX Software Engineering, sr@denx.de.
  *
  * See file CREDITS for list of people who contributed to this
@@ -35,6 +35,7 @@
 #define CONFIG_LAST_STAGE_INIT 1           /* call last_stage_init()   */
 #undef CFG_DRAM_TEST                       /* Disable-takes long time! */
 #define CONFIG_SYS_CLK_FREQ    33333333    /* external freq to pll     */
+#define CONFIG_4xx_DCACHE              /* Enable i- and d-cache        */
 
 /*-----------------------------------------------------------------------
  * Base addresses -- Note these are effective addresses where the
 #define        CONFIG_EXTRA_ENV_SETTINGS                                       \
        "netdev=eth3\0"                                                 \
        "hostname=alpr\0"                                               \
+       "fdt_file=alpr/alpr.dtb\0"                                      \
+       "fdt_addr=400000\0"                                             \
        "nfsargs=setenv bootargs root=/dev/nfs rw "                     \
                "nfsroot=${serverip}:${rootpath} ${init}\0"             \
        "ramargs=setenv bootargs root=/dev/ram rw\0"                    \
                "bootm ${kernel_addr} ${ramdisk_addr}\0"                \
        "net_nfs=tftp 200000 ${bootfile};run nfsargs addip addtty;"     \
                "bootm\0"                                               \
+       "net_nfs_fdt=tftp 200000 ${bootfile};"                          \
+               "tftp ${fdt_addr} ${fdt_file};"                         \
+               "run nfsargs addip addtty;"                             \
+               "bootm 200000 - ${fdt_addr}\0"                          \
        "rootpath=/opt/projects/alpr/nfs_root\0"                        \
        "bootfile=/alpr/uImage\0"                                       \
        "kernel_addr=fff00000\0"                                        \
 #define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
 #define CONFIG_KGDB_SER_INDEX  2       /* which serial port to use */
 #endif
+
+/* pass open firmware flat tree */
+#define CONFIG_OF_LIBFDT       1
+#define CONFIG_OF_BOARD_SETUP  1
+
 #endif /* __CONFIG_H */
index f101206..294cd26 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2005-2007
+ * (C) Copyright 2005-2008
  * Samsung Electronics,
  * Kyungmin Park <kyungmin.park@samsung.com>
  *
        "norboot=cp32 0x18040000 0x80008000 0x200000; go 0x80008000\0"  \
        "oneboot=onenand read 0x80008000 0x40000 0x200000; go 0x80008000\0"\
        "onesyncboot=run syncmode oneboot\0"                            \
+       "updateb=tftp 0x80180000 u-boot-onenand.bin; onenand erase 0x0 0x20000; onenand write 0x80180000 0x0 0x20000\0"                                 \
        "bootcmd=run uboot\0"
 
 /*
index f0dfd71..dab21d0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2007
+ * (C) Copyright 2007-2008
  * Stelian Pop <stelian.pop <at> leadtechdesign.com>
  * Lead Tech Design <www.leadtechdesign.com>
  *
@@ -28,8 +28,8 @@
 #define __CONFIG_H
 
 /* ARM asynchronous clock */
-#define AT91C_MAIN_CLOCK       200000000       /* from 12 MHz crystal */
-#define AT91C_MASTER_CLOCK     100000000       /* peripheral = main / 2 */
+#define AT91_MAIN_CLOCK                200000000       /* from 12 MHz crystal */
+#define AT91_MASTER_CLOCK      100000000       /* peripheral = main / 2 */
 #define CFG_HZ                 1000000         /* 1us resolution */
 
 #define AT91_SLOW_CLOCK                32768   /* slow clock */
 #define CONFIG_SKIP_LOWLEVEL_INIT
 #define CONFIG_SKIP_RELOCATE_UBOOT
 
-#define ROUND(A, B)            (((A) + (B)) & ~((B) - 1))
-/*
- * Size of malloc() pool
- */
-#define CFG_MALLOC_LEN         ROUND(CFG_ENV_SIZE + 128*1024, 0x1000)
-#define CFG_GBL_DATA_SIZE      128     /* 128 bytes for initial data */
-
-#define CONFIG_BAUDRATE                115200
-
 /*
  * Hardware drivers
  */
-
 #define CONFIG_ATMEL_USART     1
 #undef CONFIG_USART0
 #undef CONFIG_USART1
 #define CFG_SPI_WRITE_TOUT             (5*CFG_HZ)
 #define CFG_MAX_DATAFLASH_BANKS                1
 #define CFG_DATAFLASH_LOGIC_ADDR_CS0   0xC0000000      /* CS0 */
-#define CONFIG_NEW_PARTITION           1
+#define AT91_SPI_CLK                   20000000
+#define DATAFLASH_TCSS                 (0xFA << 16)
+#define DATAFLASH_TCHS                 (0x8 << 24)
 
 /* NOR flash */
 #define CFG_FLASH_CFI                  1
 #define CFG_MAX_FLASH_SECT             256
 #define CFG_MAX_FLASH_BANKS            1
 
-#define AT91C_FLASH_NWE_SETUP          (4 << 0)
-#define AT91C_FLASH_NCS_WR_SETUP       (2 << 8)
-#define AT91C_FLASH_NRD_SETUP          (4 << 16)
-#define AT91C_FLASH_NCS_RD_SETUP       (2 << 24)
-
-#define AT91C_FLASH_NWE_PULSE          (8 << 0)
-#define AT91C_FLASH_NCS_WR_PULSE       (10 << 8)
-#define AT91C_FLASH_NRD_PULSE          (8 << 16)
-#define AT91C_FLASH_NCS_RD_PULSE       (10 << 24)
-
-#define AT91C_FLASH_NWE_CYCLE          (16 << 0)
-#define AT91C_FLASH_NRD_CYCLE          (16 << 16)
-
 /* NAND flash */
 #define NAND_MAX_CHIPS                 1
 #define CFG_MAX_NAND_DEVICE            1
 #define CFG_NAND_BASE                  0x40000000
 
-#define AT91C_SM_NWE_SETUP             (2 << 0)
-#define AT91C_SM_NCS_WR_SETUP          (1 << 8)
-#define AT91C_SM_NRD_SETUP             (2 << 16)
-#define AT91C_SM_NCS_RD_SETUP          (1 << 24)
-
-#define AT91C_SM_NWE_PULSE             (4 << 0)
-#define AT91C_SM_NCS_WR_PULSE          (6 << 8)
-#define AT91C_SM_NRD_PULSE             (4 << 16)
-#define AT91C_SM_NCS_RD_PULSE          (6 << 24)
-
-#define AT91C_SM_NWE_CYCLE             (8 << 0)
-#define AT91C_SM_NRD_CYCLE             (8 << 16)
-
-#define AT91C_SM_TDF                   (1 << 16)
-
 /* Ethernet */
 #define CONFIG_MACB                    1
 #define CONFIG_RMII                    1
 #define LITTLEENDIAN                   1
 #define CONFIG_DOS_PARTITION           1
 #define CFG_USB_OHCI_CPU_INIT          1
-#define CFG_USB_OHCI_REGS_BASE         0x00700000      /* AT91C_BASE_UHP */
+#define CFG_USB_OHCI_REGS_BASE         0x00700000      /* AT91_BASE_UHP */
 #define CFG_USB_OHCI_SLOT_NAME         "at91cap9"
 #define CFG_USB_OHCI_MAX_ROOT_PORTS    2
 
-
 #define CFG_LOAD_ADDR                  0x72000000      /* load address */
 
 #define CFG_MEMTEST_START              PHYS_SDRAM
-#define CFG_MEMTEST_END                        0x73000000
+#define CFG_MEMTEST_END                        0x73e00000
 
 #define CFG_USE_DATAFLASH              1
 #undef CFG_USE_NORFLASH
 
 #endif
 
+#define CONFIG_BAUDRATE                115200
 #define CFG_BAUDRATE_TABLE     {115200 , 19200, 38400, 57600, 9600 }
 
 #define CFG_PROMPT             "U-Boot> "
 #define CFG_LONGHELP           1
 #define CONFIG_CMDLINE_EDITING 1
 
+#define ROUND(A, B)            (((A) + (B)) & ~((B) - 1))
+/*
+ * Size of malloc() pool
+ */
+#define CFG_MALLOC_LEN         ROUND(CFG_ENV_SIZE + 128*1024, 0x1000)
+#define CFG_GBL_DATA_SIZE      128     /* 128 bytes for initial data */
+
 #define CONFIG_STACKSIZE       (32*1024)       /* regular stack */
 
 #ifdef CONFIG_USE_IRQ
index 5b7212a..951ce16 100644 (file)
@@ -51,7 +51,7 @@
 #define MC_ASR_VAL     0x00000000
 #define MC_AASR_VAL    0x00000000
 #define EBI_CFGR_VAL   0x00000000
-#define SMC2_CSR_VAL   0x00003284 /* 16bit, 2 TDF, 4 WS */
+#define SMC_CSR0_VAL   0x00003284 /* 16bit, 2 TDF, 4 WS */
 
 /* clocks */
 #define PLLAR_VAL      0x20263E04 /* 179.712000 MHz for PCK */
diff --git a/include/configs/at91sam9260ek.h b/include/configs/at91sam9260ek.h
new file mode 100644 (file)
index 0000000..96d1b8d
--- /dev/null
@@ -0,0 +1,191 @@
+/*
+ * (C) Copyright 2007-2008
+ * Stelian Pop <stelian.pop <at> leadtechdesign.com>
+ * Lead Tech Design <www.leadtechdesign.com>
+ *
+ * Configuation settings for the AT91SAM9260EK 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
+
+/* ARM asynchronous clock */
+#define AT91_MAIN_CLOCK                198656000       /* from 18.432 MHz crystal */
+#define AT91_MASTER_CLOCK      99328000        /* peripheral = main / 2 */
+#define CFG_HZ                 1000000         /* 1us resolution */
+
+#define AT91_SLOW_CLOCK                32768   /* slow clock */
+
+#define CONFIG_ARM926EJS       1       /* This is an ARM926EJS Core    */
+#define CONFIG_AT91SAM9260     1       /* It's an Atmel AT91SAM9260 SoC*/
+#define CONFIG_AT91SAM9260EK   1       /* on an AT91SAM9260EK Board    */
+#undef CONFIG_USE_IRQ                  /* we don't need IRQ/FIQ stuff  */
+
+#define CONFIG_CMDLINE_TAG     1       /* enable passing of ATAGs      */
+#define CONFIG_SETUP_MEMORY_TAGS 1
+#define CONFIG_INITRD_TAG      1
+
+#define CONFIG_SKIP_LOWLEVEL_INIT
+#define CONFIG_SKIP_RELOCATE_UBOOT
+
+/*
+ * Hardware drivers
+ */
+#define CONFIG_ATMEL_USART     1
+#undef CONFIG_USART0
+#undef CONFIG_USART1
+#undef CONFIG_USART2
+#define CONFIG_USART3          1       /* USART 3 is DBGU */
+
+#define CONFIG_BOOTDELAY       3
+#define CONFIG_BOOTARGS                "console=ttyS0,115200 " \
+                               "root=/dev/mtdblock0 rw rootfstype=jffs2"
+
+/* #define CONFIG_ENV_OVERWRITE        1 */
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE      1
+#define CONFIG_BOOTP_BOOTPATH          1
+#define CONFIG_BOOTP_GATEWAY           1
+#define CONFIG_BOOTP_HOSTNAME          1
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+#undef CONFIG_CMD_BDI
+#undef CONFIG_CMD_IMI
+#undef CONFIG_CMD_AUTOSCRIPT
+#undef CONFIG_CMD_FPGA
+#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
+
+/* SDRAM */
+#define CONFIG_NR_DRAM_BANKS           1
+#define PHYS_SDRAM                     0x20000000
+#define PHYS_SDRAM_SIZE                        0x04000000      /* 64 megs */
+
+/* DataFlash */
+#define CONFIG_HAS_DATAFLASH           1
+#define CFG_SPI_WRITE_TOUT             (5*CFG_HZ)
+#define CFG_MAX_DATAFLASH_BANKS                2
+#define CFG_DATAFLASH_LOGIC_ADDR_CS0   0xC0000000      /* CS0 */
+#define CFG_DATAFLASH_LOGIC_ADDR_CS1   0xD0000000      /* CS1 */
+#define AT91_SPI_CLK                   33000000
+#define DATAFLASH_TCSS                 (0x1a << 16)
+#define DATAFLASH_TCHS                 (0x1 << 24)
+
+/* NAND flash */
+#define NAND_MAX_CHIPS                 1
+#define CFG_MAX_NAND_DEVICE            1
+#define CFG_NAND_BASE                  0x40000000
+
+/* NOR flash - no real flash on this board */
+#define CFG_NO_FLASH                   1
+
+/* Ethernet */
+#define CONFIG_MACB                    1
+#define CONFIG_RMII                    1
+#define CONFIG_NET_MULTI               1
+#define CONFIG_NET_RETRY_COUNT         20
+#define CONFIG_RESET_PHY_R             1
+
+/* USB */
+#define CONFIG_USB_OHCI_NEW            1
+#define LITTLEENDIAN                   1
+#define CONFIG_DOS_PARTITION           1
+#define CFG_USB_OHCI_CPU_INIT          1
+#define CFG_USB_OHCI_REGS_BASE         0x00500000      /* AT91SAM9260_UHP_BASE */
+#define CFG_USB_OHCI_SLOT_NAME         "at91sam9260"
+#define CFG_USB_OHCI_MAX_ROOT_PORTS    2
+#define CONFIG_USB_STORAGE             1
+
+#define CFG_LOAD_ADDR                  0x22000000      /* load address */
+
+#define CFG_MEMTEST_START              PHYS_SDRAM
+#define CFG_MEMTEST_END                        0x23e00000
+
+#undef CFG_USE_DATAFLASH_CS0
+#define CFG_USE_DATAFLASH_CS1          1
+#undef CFG_USE_NANDFLASH
+
+#ifdef CFG_USE_DATAFLASH_CS0
+
+/* bootstrap + u-boot + env + linux in dataflash on CS0 */
+#define CFG_ENV_IS_IN_DATAFLASH        1
+#define CFG_MONITOR_BASE       (CFG_DATAFLASH_LOGIC_ADDR_CS0 + 0x8400)
+#define CFG_ENV_OFFSET         0x4200
+#define CFG_ENV_ADDR           (CFG_DATAFLASH_LOGIC_ADDR_CS0 + CFG_ENV_OFFSET)
+#define CFG_ENV_SIZE           0x4200
+#define CONFIG_BOOTCOMMAND     "cp.b 0xC003DE00 0x22000000 0x200040; bootm"
+
+#elif CFG_USE_DATAFLASH_CS1
+
+/* bootstrap + u-boot + env + linux in dataflash on CS1 */
+#define CFG_ENV_IS_IN_DATAFLASH        1
+#define CFG_MONITOR_BASE       (CFG_DATAFLASH_LOGIC_ADDR_CS1 + 0x8400)
+#define CFG_ENV_OFFSET         0x4200
+#define CFG_ENV_ADDR           (CFG_DATAFLASH_LOGIC_ADDR_CS1 + CFG_ENV_OFFSET)
+#define CFG_ENV_SIZE           0x4200
+#define CONFIG_BOOTCOMMAND     "cp.b 0xD003DE00 0x22000000 0x200040; bootm"
+
+#else /* CFG_USE_NANDFLASH */
+
+/* bootstrap + u-boot + env + linux in nandflash */
+#define CFG_ENV_IS_IN_NAND     1
+#define CFG_ENV_OFFSET         0x60000
+#define CFG_ENV_OFFSET_REDUND  0x80000
+#define CFG_ENV_SIZE           0x20000         /* 1 sector = 128 kB */
+#define CONFIG_BOOTCOMMAND     "nand read 0x22000000 0xA0000 0x200000; bootm"
+
+#endif
+
+#define CONFIG_BAUDRATE                115200
+#define CFG_BAUDRATE_TABLE     {115200 , 19200, 38400, 57600, 9600 }
+
+#define CFG_PROMPT             "U-Boot> "
+#define CFG_CBSIZE             256
+#define CFG_MAXARGS            16
+#define CFG_PBSIZE             (CFG_CBSIZE + sizeof(CFG_PROMPT) + 16)
+#define CFG_LONGHELP           1
+#define CONFIG_CMDLINE_EDITING 1
+
+#define ROUND(A, B)            (((A) + (B)) & ~((B) - 1))
+/*
+ * Size of malloc() pool
+ */
+#define CFG_MALLOC_LEN         ROUND(3 * CFG_ENV_SIZE + 128*1024, 0x1000)
+#define CFG_GBL_DATA_SIZE      128     /* 128 bytes for initial data */
+
+#define CONFIG_STACKSIZE       (32*1024)       /* regular stack */
+
+#ifdef CONFIG_USE_IRQ
+#error CONFIG_USE_IRQ not supported
+#endif
+
+#endif
index 6cb6bc4..2f551ad 100644 (file)
@@ -5,8 +5,9 @@
 #ifndef __CONFIG_EZKIT533_H__
 #define __CONFIG_EZKIT533_H__
 
+#include <asm/blackfin-config-pre.h>
+
 #define CONFIG_BAUDRATE                57600
-#define CONFIG_STAMP           1
 
 #define CONFIG_BOOTDELAY       5
 #define CFG_AUTOLOAD           "no"    /*rarpb, bootp or dhcp commands will perform only a */
 #define CONFIG_RTC_BFIN                1
 #define CONFIG_BOOT_RETRY_TIME -1      /* Enable this if bootretry required, currently its disabled */
 
-/*
- * Boot Mode Set
- * Blackfin can support several boot modes
- */
-#define BF533_BYPASS_BOOT      0x0001  /* Bootmode 0: Execute from 16-bit externeal memory ( bypass BOOT ROM) */
-#define BF533_PARA_BOOT                0x0002  /* Bootmode 1: Boot from 8-bit or 16-bit flash */
-#define BF533_SPI_BOOT         0x0004  /* Bootmode 3: Boot from SPI flash */
-/* Define the boot mode */
-#define BFIN_BOOT_MODE         BF533_BYPASS_BOOT
-/* #define BFIN_BOOT_MODE      BF533_SPI_BOOT */
-
 #define CONFIG_PANIC_HANG 1
 
-#define ADSP_BF531             0x31
-#define ADSP_BF532             0x32
-#define ADSP_BF533             0x33
-#define BFIN_CPU               ADSP_BF533
+#define CONFIG_BFIN_CPU        bf533-0.3
+#define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_BYPASS
 
 /* This sets the default state of the cache on U-Boot's boot */
 #define CONFIG_ICACHE_ON
 #define CONFIG_DCACHE_ON
 
-/* Define where the uboot will be loaded by on-chip boot rom */
-#define APP_ENTRY 0x00001000
-
 /* CONFIG_CLKIN_HZ is any value in Hz                          */
 #define CONFIG_CLKIN_HZ                27000000
 /* CONFIG_CLKIN_HALF controls what is passed to PLL 0=CLKIN    */
 
 #define CONFIG_BOOTARGS "root=/dev/mtdblock0 ip=192.168.0.15:192.168.0.2:192.168.0.1:255.255.255.0:ezkit:eth0:off console=ttyBF0,57600"
 
-#define        CFG_PROMPT              "ezkit> "       /* Monitor Command Prompt */
+#define        CFG_PROMPT              "bfin> "        /* Monitor Command Prompt */
 #if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE              1024    /* Console I/O Buffer Size */
 #else
 
 #define CFG_BOOTM_LEN          0x4000000       /* Large Image Length, set to 64 Meg */
 
-/* 0xFF, 0x7BB07BB0, 0x22547BB0 */
-/* #define AMGCTLVAL           (AMBEN_P0 | AMBEN_P1 | AMBEN_P2 | AMCKEN)
-#define AMBCTL0VAL             (B1WAT_7 | B1RAT_11 | B1HT_2 | B1ST_3 | B1TT_4 | ~B1RDYPOL | \
-                               ~B1RDYEN | B0WAT_7 | B0RAT_11 | B0HT_2 | B0ST_3 | B0TT_4 | ~B0RDYPOL | ~B0RDYEN)
-#define AMBCTL1VAL             (B3WAT_2 | B3RAT_2 | B3HT_1 | B3ST_1 | B3TT_4 | B3RDYPOL | ~B3RDYEN | \
-                               B2WAT_7 | B2RAT_11 | B2HT_2 | B2ST_3 | B2TT_4 | ~B2RDYPOL | ~B2RDYEN)
-*/
-#define AMGCTLVAL              0xFF
-#define AMBCTL0VAL             0x7BB07BB0
-#define AMBCTL1VAL             0xFFC27BB0
-
-#define CONFIG_VDSP            1
-
-#ifdef CONFIG_VDSP
-#define ET_EXEC_VDSP           0x8
-#define SHT_STRTAB_VDSP                0x1
-#define ELFSHDRSIZE_VDSP       0x2C
-#define VDSP_ENTRY_ADDR                0xFFA00000
-#endif
+#define CONFIG_EBIU_SDRRC_VAL  0x398
+#define CONFIG_EBIU_SDGCTL_VAL 0x91118d
+#define CONFIG_EBIU_SDBCTL_VAL 0x13
+
+#define CONFIG_EBIU_AMGCTL_VAL         0xFF
+#define CONFIG_EBIU_AMBCTL0_VAL                0x7BB07BB0
+#define CONFIG_EBIU_AMBCTL1_VAL                0xFFC27BB0
+
+#include <asm/blackfin-config-post.h>
 
 #endif
index cce6ef7..66a0af6 100644 (file)
@@ -5,40 +5,19 @@
 #ifndef __CONFIG_STAMP_H__
 #define __CONFIG_STAMP_H__
 
-#define CONFIG_STAMP                   1
+#include <asm/blackfin-config-pre.h>
+
 #define CONFIG_RTC_BFIN                        1
-#define CONFIG_BF533                   1
-/*
- * Boot Mode Set
- * Blackfin can support several boot modes
- */
-#define BF533_BYPASS_BOOT      0x0001  /* Bootmode 0: Execute from 16-bit externeal memory ( bypass BOOT ROM) */
-#define BF533_PARA_BOOT                0x0002  /* Bootmode 1: Boot from 8-bit or 16-bit flash */
-#define BF533_SPI_BOOT         0x0004  /* Bootmode 3: Boot from SPI flash */
-/* Define the boot mode */
-#define BFIN_BOOT_MODE         BF533_BYPASS_BOOT
-/* #define BFIN_BOOT_MODE      BF533_SPI_BOOT */
 
 #define CONFIG_PANIC_HANG 1
 
-#define ADSP_BF531             0x31
-#define ADSP_BF532             0x32
-#define ADSP_BF533             0x33
-#define BFIN_CPU               ADSP_BF533
+#define CONFIG_BFIN_CPU        bf533-0.3
+#define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_BYPASS
 
 /* This sets the default state of the cache on U-Boot's boot */
 #define CONFIG_ICACHE_ON
 #define CONFIG_DCACHE_ON
 
-/* Define where the uboot will be loaded by on-chip boot rom */
-#define APP_ENTRY 0x00001000
-
-/*
- * Stringize definitions - needed for environmental settings
- */
-#define STRINGIZE2(x) #x
-#define STRINGIZE(x) STRINGIZE2(x)
-
 /*
  * Board settings
  */
@@ -62,8 +41,6 @@
  */
 #define  CONFIG_VIDEO          0
 
-#define CONFIG_VDSP            1
-
 /*
  * Clock settings
  */
 /* Values can range from 2-65535                               */
 /* SCK Frequency = SCLK / (2 * CONFIG_SPI_BAUD)                        */
 #define CONFIG_SPI_BAUD                2
-
-#if (BFIN_BOOT_MODE == BF533_SPI_BOOT)
 #define CONFIG_SPI_BAUD_INITBLOCK      4
-#endif
 
 /*
  * Network settings
 #define CFG_MAX_FLASH_BANKS    1       /* max number of memory banks */
 #define CFG_MAX_FLASH_SECT     67      /* max number of sectors on one chip */
 
-#if (BFIN_BOOT_MODE == BF533_BYPASS_BOOT)
-#define CFG_ENV_IS_IN_FLASH    1
-#define CFG_ENV_ADDR           0x20004000
-#define        CFG_ENV_OFFSET          (CFG_ENV_ADDR - CFG_FLASH_BASE)
-#elif (BFIN_BOOT_MODE == BF533_SPI_BOOT)
+#if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_SPI_MASTER)
 #define CFG_ENV_IS_IN_EEPROM   1
 #define CFG_ENV_OFFSET         0x4000
 #define CFG_ENV_HEADER         (CFG_ENV_OFFSET + 0x12A)        /* 0x12A is the length of LDR file header */
+#else
+#define CFG_ENV_IS_IN_FLASH    1
+#define CFG_ENV_ADDR           0x20004000
+#define        CFG_ENV_OFFSET          (CFG_ENV_ADDR - CFG_FLASH_BASE)
 #endif
 
 #define        CFG_ENV_SIZE            0x2000
 #define CONFIG_MEM_ADD_WDTH     11     /* 8, 9, 10, 11    */
 #define CONFIG_MEM_MT48LC64M4A2FB_7E   1
 
-#if (BFIN_BOOT_MODE == BF533_BYPASS_BOOT)
 #define CFG_MEMTEST_START      0x00000000      /* memtest works on */
-#elif (BFIN_BOOT_MODE == BF533_SPI_BOOT)
-#define CFG_MEMTEST_START      0x00100000      /* memtest works on */
-#endif
 
 #define        CFG_SDRAM_BASE          0x00000000
 
 #define CONFIG_SCLK_HZ         CONFIG_CLKIN_HZ
 #endif
 
-#if (BFIN_BOOT_MODE == BF533_SPI_BOOT)
-#if (CONFIG_SCLK_HZ / (2*CONFIG_SPI_BAUD) > 20000000)
-#define CONFIG_SPI_FLASH_FAST_READ 1 /* Needed if SPI_CLK > 20 MHz */
-#else
-#undef CONFIG_SPI_FLASH_FAST_READ
-#endif
-#endif
-
 /*
  * Command settings
  */
 #define CFG_LONGHELP           1
 #define CONFIG_CMDLINE_EDITING 1
 
-#if (BFIN_BOOT_MODE == BF533_BYPASS_BOOT)
 #define CFG_AUTOLOAD           "no"    /*rarpb, bootp or dhcp commands will perform only a */
-#endif
 
 /* configuration lookup from the BOOTP/DHCP server, */
 /* but not try to load any image using TFTP        */
 
 #define CONFIG_BOOTDELAY       5
 #define CONFIG_BOOT_RETRY_TIME -1      /* Enable this if bootretry required, currently its disabled */
-#if (BFIN_BOOT_MODE == BF533_BYPASS_BOOT)
 #define CONFIG_BOOTCOMMAND     "run ramboot"
-#elif (BFIN_BOOT_MODE == BF533_SPI_BOOT)
-#define CONFIG_BOOTCOMMAND     "eeprom read 0x1000000 0x100000 0x180000;icache on;dcache on;bootm 0x1000000"
-#endif
 
 #define CONFIG_BOOTARGS                "root=/dev/mtdblock0 rw console=ttyBF0,57600"
 
 
-#if (BFIN_BOOT_MODE == BF533_BYPASS_BOOT)
-#if (CONFIG_DRIVER_SMC91111)
 #define CONFIG_EXTRA_ENV_SETTINGS \
        "ramargs=setenv bootargs root=/dev/mtdblock0 rw console=ttyBF0,57600\0" \
        "nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=$(serverip):" \
                "protect off 0x20000000 0x2003FFFF; erase 0x20000000 0x2003FFFF;" \
                "cp.b $(loadaddr) 0x20000000 $(filesize)\0" \
        ""
-#else
-#define CONFIG_EXTRA_ENV_SETTINGS \
-       "ramargs=setenv bootargs root=/dev/mtdblock0 rw console=ttyBF0,57600\0" \
-       "flashboot=bootm 0x20100000\0" \
-       "
-#endif
-
-#elif (BFIN_BOOT_MODE == BF533_SPI_BOOT)
-#define CONFIG_EXTRA_ENV_SETTINGS \
-       "ramargs=setenv bootargs root=/dev/mtdblock0 rw console=ttyBF0,57600\0" \
-       "nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=$(serverip):" \
-               "$(rootpath) console=ttyBF0,57600\0"    \
-       "addip=setenv bootargs $(bootargs) ip=$(ipaddr):$(serverip):" \
-               "$(gatewayip):$(netmask):$(hostname):eth0:off\0" \
-       "ramboot=tftpboot $(loadaddr) linux; " \
-               "run ramargs;run addip;bootelf\0" \
-       "nfsboot=tftpboot $(loadaddr) linux; "  \
-               "run nfsargs;run addip;bootelf\0" \
-       "flashboot=bootm 0x20100000\0" \
-       "update=tftpboot $(loadaddr) u-boot.ldr;"       \
-               "eeprom write $(loadaddr) 0x0 $(filesize);\0"\
-       ""
-#endif
 
 #ifdef CONFIG_SOFT_I2C
 #if (!CONFIG_SOFT_I2C)
 #define CONFIG_CMD_I2C
 #endif
 
-#if (BFIN_BOOT_MODE == BF533_BYPASS_BOOT)
 #define CONFIG_CMD_DHCP
-#endif
 
 
 /*
 #define CONFIG_BAUDRATE                57600
 #define CFG_BAUDRATE_TABLE     { 9600, 19200, 38400, 57600, 115200 }
 
-#if (BFIN_BOOT_MODE == BF533_SPI_BOOT)
-#if (BFIN_CPU == ADSP_BF531)
-#define        CFG_PROMPT      "serial_bf531> "        /* Monitor Command Prompt */
-#elif (BFIN_CPU == ADSP_BF532)
-#define        CFG_PROMPT      "serial_bf532> "        /* Monitor Command Prompt */
-#else
-#define        CFG_PROMPT      "serial_bf533> "        /* Monitor Command Prompt */
-#endif
-#else
-#if (BFIN_CPU == ADSP_BF531)
-#define        CFG_PROMPT      "bf531> "       /* Monitor Command Prompt */
-#elif (BFIN_CPU == ADSP_BF532)
-#define        CFG_PROMPT      "bf532> "       /* Monitor Command Prompt */
-#else
-#define        CFG_PROMPT      "bf533> "       /* Monitor Command Prompt */
-#endif
-#endif
+#define        CFG_PROMPT              "bfin> "        /* Monitor Command Prompt */
 
 #if defined(CONFIG_CMD_KGDB)
 #define CFG_CBSIZE     1024            /* Console I/O Buffer Size */
 /*
  * FLASH organization and environment definitions
  */
-#define        CFG_BOOTMAPSZ           (8 << 20)/* Initial Memory map for Linux */
-
-/* 0xFF, 0xBBC3BBc3, 0x99B39983 */
-/*#define AMGCTLVAL            (AMBEN_P0 | AMBEN_P1 | AMBEN_P2 | AMCKEN)
-#define AMBCTL0VAL             (B1WAT_11 | B1RAT_11 | B1HT_3 | B1ST_4 | B1TT_4 | B1RDYPOL | \
-                               B1RDYEN | B0WAT_11 | B0RAT_11 | B0HT_3 | B0ST_4 | B0TT_4 | B0RDYPOL | B0RDYEN)
-#define AMBCTL1VAL             (B3WAT_9 | B3RAT_9 | B3HT_2 | B3ST_3 | B3TT_4 | B3RDYPOL | \
-                               B3RDYEN | B2WAT_9 | B2RAT_9 | B2HT_2 | B2ST_4 | B2TT_4 | B2RDYPOL | B2RDYEN)
-*/
-#define AMGCTLVAL              0xFF
-#define AMBCTL0VAL             0xBBC3BBC3
-#define AMBCTL1VAL             0x99B39983
-#define CF_AMBCTL1VAL          0x99B3ffc2
-
-#ifdef CONFIG_VDSP
-#define ET_EXEC_VDSP           0x8
-#define SHT_STRTAB_VDSP                0x1
-#define ELFSHDRSIZE_VDSP       0x2C
-#define VDSP_ENTRY_ADDR                0xFFA00000
-#endif
+
+#define CONFIG_EBIU_SDRRC_VAL  0x268
+#define CONFIG_EBIU_SDGCTL_VAL 0x911109
+#define CONFIG_EBIU_SDBCTL_VAL 0x37
+
+#define CONFIG_EBIU_AMGCTL_VAL         0xFF
+#define CONFIG_EBIU_AMBCTL0_VAL                0xBBC3BBC3
+#define CONFIG_EBIU_AMBCTL1_VAL                0x99B39983
+#define CF_CONFIG_EBIU_AMBCTL1_VAL             0x99B3ffc2
+
+#include <asm/blackfin-config-post.h>
 
 #endif
index b9a9e3c..39c7359 100644 (file)
@@ -5,36 +5,23 @@
 #ifndef __CONFIG_BF537_H__
 #define __CONFIG_BF537_H__
 
+#include <asm/blackfin-config-pre.h>
+
 #define CFG_LONGHELP           1
 #define CONFIG_CMDLINE_EDITING 1
 #define CONFIG_BAUDRATE                57600
 /* Set default serial console for bf537 */
 #define CONFIG_UART_CONSOLE    0
-#define CONFIG_BF537           1
 #define CONFIG_BOOTDELAY       5
 /* define CONFIG_BF537_STAMP_LEDCMD to enable LED command*/
 /*#define CONFIG_BF537_STAMP_LEDCMD    1*/
 
-/*
- * Boot Mode Set
- * Blackfin can support several boot modes
- */
-#define BF537_BYPASS_BOOT      0x0011  /* Bootmode 0: Execute from 16-bit externeal memory ( bypass BOOT ROM)  */
-#define BF537_PARA_BOOT                0x0012  /* Bootmode 1: Boot from 8-bit or 16-bit flash                          */
-#define BF537_SPI_MASTER_BOOT  0x0014  /* Bootmode 3: SPI master mode boot from SPI flash                      */
-#define BF537_SPI_SLAVE_BOOT   0x0015  /* Bootmode 4: SPI slave mode boot from SPI flash                       */
-#define BF537_TWI_MASTER_BOOT  0x0016  /* Bootmode 5: TWI master mode boot from EEPROM                         */
-#define BF537_TWI_SLAVE_BOOT   0x0017  /* Bootmode 6: TWI slave mode boot from EEPROM                          */
-#define BF537_UART_BOOT                0x0018  /* Bootmode 7: UART slave mdoe boot via UART host                       */
-/* Define the boot mode */
-#define BFIN_BOOT_MODE         BF537_BYPASS_BOOT
-
 #define CONFIG_PANIC_HANG 1
 
-#define ADSP_BF534             0x34
-#define ADSP_BF536             0x36
-#define ADSP_BF537             0x37
-#define BFIN_CPU               ADSP_BF537
+#define CONFIG_BFIN_CPU        bf537-0.2
+#define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_BYPASS
+
+#define CONFIG_BFIN_MAC
 
 /* This sets the default state of the cache on U-Boot's boot */
 #define CONFIG_ICACHE_ON
@@ -43,9 +30,6 @@
 /* Define if want to do post memory test */
 #undef CONFIG_POST_TEST
 
-/* Define where the uboot will be loaded by on-chip boot rom */
-#define APP_ENTRY 0x00001000
-
 #define CONFIG_RTC_BFIN                1
 #define CONFIG_BOOT_RETRY_TIME -1      /* Enable this if bootretry required, currently its disabled */
 
@@ -70,9 +54,7 @@
 /* Values can range from 2-65535                               */
 /* SCK Frequency = SCLK / (2 * CONFIG_SPI_BAUD)                        */
 #define CONFIG_SPI_BAUD                        2
-#if (BFIN_BOOT_MODE == BF537_SPI_MASTER_BOOT)
 #define CONFIG_SPI_BAUD_INITBLOCK      4
-#endif
 
 #if ( CONFIG_CLKIN_HALF == 0 )
 #define CONFIG_VCO_HZ ( CONFIG_CLKIN_HZ * CONFIG_VCO_MULT )
 #define CONFIG_SCLK_HZ CONFIG_CLKIN_HZ
 #endif
 
-#if (BFIN_BOOT_MODE == BF537_SPI_MASTER_BOOT)
-#if (CONFIG_SCLK_HZ / (2*CONFIG_SPI_BAUD) > 20000000)
-#define CONFIG_SPI_FLASH_FAST_READ 1   /* Needed if SPI_CLK > 20 MHz */
-#else
-#undef CONFIG_SPI_FLASH_FAST_READ
-#endif
-#endif
-
 #define CONFIG_MEM_SIZE                        64      /* 128, 64, 32, 16 */
 #define CONFIG_MEM_ADD_WDTH            10      /* 8, 9, 10, 11 */
 #define CONFIG_MEM_MT48LC32M8A2_75     1
  * Network Settings
  */
 /* network support */
-#if (BFIN_CPU != ADSP_BF534)
+#ifdef CONFIG_BFIN_MAC
 #define CONFIG_IPADDR          192.168.0.15
 #define CONFIG_NETMASK         255.255.255.0
 #define CONFIG_GATEWAYIP       192.168.0.1
 #define CONFIG_BOOT_RETRY_TIME -1      /* Enable this if bootretry required, currently its disabled */
 #define CONFIG_BOOTCOMMAND     "run ramboot"
 
-#if (BFIN_BOOT_MODE == BF537_BYPASS_BOOT) && defined(CONFIG_POST_TEST)
+#if defined(CONFIG_POST_TEST)
 /* POST support */
 #define CONFIG_POST            ( CFG_POST_MEMORY | \
                                  CFG_POST_UART   | \
  */
 #include <config_cmd_default.h>
 
-#if (BFIN_BOOT_MODE == BF537_BYPASS_BOOT) || (BFIN_BOOT_MODE == BF537_SPI_MASTER_BOOT)
-
 #define CONFIG_CMD_ELF
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_CACHE
 #define CONFIG_CMD_EEPROM
 #define CONFIG_CMD_DATE
 
-#if (BFIN_CPU == ADSP_BF534)
+#ifndef CONFIG_BFIN_MAC
 #undef CONFIG_CMD_NET
 #else
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_IDE
 #endif
 
-#endif
-
-#if (BFIN_BOOT_MODE == BF537_BYPASS_BOOT)
-
 #define CONFIG_CMD_DHCP
 
 #if defined(CONFIG_POST)
 #define CONFIG_CMD_NAND
 #endif
 
-#endif
-
 
 #define CONFIG_BOOTARGS "root=/dev/mtdblock0 rw console=ttyBF0,57600"
 #define CONFIG_LOADADDR        0x1000000
 
-#if (BFIN_BOOT_MODE == BF537_BYPASS_BOOT)
-#if (BFIN_CPU != ADSP_BF534)
 #define CONFIG_EXTRA_ENV_SETTINGS                              \
        "ramargs=setenv bootargs root=/dev/mtdblock0 rw console=ttyBF0,57600\0" \
        "nfsargs=setenv bootargs root=/dev/nfs rw "             \
        "protect off 0x20000000 0x2007FFFF;"                    \
        "erase 0x20000000 0x2007FFFF;cp.b 0x1000000 0x20000000 $(filesize)\0"   \
        ""
-#else
-#define CONFIG_EXTRA_ENV_SETTINGS                              \
-       "ramargs=setenv bootargs root=/dev/mtdblock0 rw console=ttyBF0,57600\0" \
-       "flashboot=bootm 0x20100000\0"                          \
-       ""
-#endif
-#elif (BFIN_BOOT_MODE == BF537_SPI_MASTER_BOOT)
-#if (BFIN_CPU != ADSP_BF534)
-#define CONFIG_EXTRA_ENV_SETTINGS                              \
-       "ramargs=setenv bootargs root=/dev/mtdblock0 rw console=ttyBF0,57600\0" \
-       "nfsargs=setenv bootargs root=/dev/nfs rw "             \
-       "nfsroot=$(serverip):$(rootpath) console=ttyBF0,57600\0"\
-       "addip=setenv bootargs $(bootargs) "                    \
-       "ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask)"      \
-       ":$(hostname):eth0:off\0"                               \
-       "ramboot=tftpboot $(loadaddr) linux;"                   \
-       "run ramargs;run addip;bootelf\0"                       \
-       "nfsboot=tftpboot $(loadaddr) linux;"                   \
-       "run nfsargs;run addip;bootelf\0"                       \
-       "flashboot=bootm 0x20100000\0"                          \
-       "update=tftpboot $(loadaddr) u-boot.ldr;"               \
-       "eeprom write $(loadaddr) 0x0 $(filesize);\0"           \
-       ""
-#else
-#define CONFIG_EXTRA_ENV_SETTINGS                              \
-       "ramargs=setenv bootargs root=/dev/mtdblock0 rw console=ttyBF0,57600\0" \
-       "flashboot=bootm 0x20100000\0"                          \
-       ""
-#endif
-#endif
 
-#if (BFIN_BOOT_MODE == BF537_SPI_MASTER_BOOT)
-#if (BFIN_CPU == ADSP_BF534)
-#define        CFG_PROMPT              "serial_bf534> "        /* Monitor Command Prompt */
-#elif (BFIN_CPU == ADSP_BF536)
-#define        CFG_PROMPT              "serial_bf536> "        /* Monitor Command Prompt */
-#else
-#define        CFG_PROMPT              "serial_bf537> "        /* Monitor Command Prompt */
-#endif
-#else
-#if (BFIN_CPU == ADSP_BF534)
-#define        CFG_PROMPT              "bf534> "       /* Monitor Command Prompt */
-#elif (BFIN_CPU == ADSP_BF536)
-#define        CFG_PROMPT              "bf536> "       /* Monitor Command Prompt */
-#else
-#define        CFG_PROMPT              "bf537> "       /* Monitor Command Prompt */
-#endif
-#endif
+#define        CFG_PROMPT              "bfin> "        /* Monitor Command Prompt */
 
 #if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE              1024    /* Console I/O Buffer Size */
 #define        CFG_SDRAM_BASE          0x00000000
 
 #define CFG_FLASH_BASE         0x20000000
+#define CFG_FLASH_CFI          /* The flash is CFI compatible */
+#define CFG_FLASH_CFI_DRIVER   /* Use common CFI driver */
+#define CFG_FLASH_PROTECTION
+#define CFG_MAX_FLASH_BANKS    1
+#define CFG_MAX_FLASH_SECT     71      /* some have 67 sectors (M29W320DB), but newer have 71 (M29W320EB) */
 
 #define        CFG_MONITOR_LEN         (256 << 10)     /* Reserve 256 kB for Monitor   */
 #define CFG_MONITOR_BASE       (CFG_MAX_RAM_SIZE - CFG_MONITOR_LEN)
 #define CFG_GBL_DATA_ADDR      (CFG_MALLOC_BASE - CFG_GBL_DATA_SIZE)
 #define CONFIG_STACKBASE       (CFG_GBL_DATA_ADDR  - 4)
 
-#define        CFG_BOOTMAPSZ           (8 << 20)       /* Initial Memory map for Linux */
-#define CFG_MAX_FLASH_BANKS    1       /* max number of memory banks */
-#define CFG_MAX_FLASH_SECT     71      /* max number of sectors on one chip */
-
-#if (BFIN_BOOT_MODE == BF537_BYPASS_BOOT) || (BFIN_BOOT_MODE == BF537_UART_BOOT)
-/* for bf537-stamp, usrt boot mode still store env in flash */
-#define        CFG_ENV_IS_IN_FLASH     1
-#define CFG_ENV_ADDR           0x20004000
-#define CFG_ENV_OFFSET         (CFG_ENV_ADDR - CFG_FLASH_BASE)
-#elif (BFIN_BOOT_MODE == BF537_SPI_MASTER_BOOT)
+#if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_SPI_MASTER)
 #define CFG_ENV_IS_IN_EEPROM   1
 #define CFG_ENV_OFFSET         0x4000
 #define CFG_ENV_HEADER         (CFG_ENV_OFFSET + 0x16e) /* 0x12A is the length of LDR file header */
+#else
+#define        CFG_ENV_IS_IN_FLASH     1
+#define CFG_ENV_ADDR           0x20004000
+#define CFG_ENV_OFFSET         (CFG_ENV_ADDR - CFG_FLASH_BASE)
 #endif
 #define CFG_ENV_SIZE           0x2000
 #define        CFG_ENV_SECT_SIZE       0x2000  /* Total Size of Environment Sector */
-/* #if (BFIN_BOOT_MODE == BF537_BYPASS_BOOT) */
 #define ENV_IS_EMBEDDED
-/* #endif */
 
 /* JFFS Partition offset set  */
 #define CFG_JFFS2_FIRST_BANK   0
 #define CONFIG_TWICLK_KHZ      50
 #endif
 
+#define CONFIG_EBIU_SDRRC_VAL  0x306
+#define CONFIG_EBIU_SDGCTL_VAL 0x91114d
+#define CONFIG_EBIU_SDBCTL_VAL 0x25
+
+#define CONFIG_EBIU_AMGCTL_VAL         0xFF
+#define CONFIG_EBIU_AMBCTL0_VAL                0x7BB07BB0
+#define CONFIG_EBIU_AMBCTL1_VAL                0xFFC27BB0
+
 #if defined CONFIG_SOFT_I2C
 /*
  * Software (bit-bang) I2C driver configuration
 #define AMBCTL0VAL             0x7BB07BB0
 #define AMBCTL1VAL             0xFFC27BB0
 
-#define CONFIG_VDSP            1
-
-#ifdef CONFIG_VDSP
-#define ET_EXEC_VDSP           0x8
-#define SHT_STRTAB_VDSP                0x1
-#define ELFSHDRSIZE_VDSP       0x2C
-#define VDSP_ENTRY_ADDR                0xFFA00000
-#endif
-
 #if defined(CONFIG_BFIN_IDE)
 
 #define CONFIG_DOS_PARTITION   1
 
 #endif                         /*CONFIG_BFIN_IDE */
 
+#include <asm/blackfin-config-post.h>
+
 #endif
index 2966260..641548d 100644 (file)
@@ -5,8 +5,7 @@
 #ifndef __CONFIG_EZKIT561_H__
 #define __CONFIG_EZKIT561_H__
 
-#define CONFIG_VDSP            1
-#define CONFIG_BF561           1
+#include <asm/blackfin-config-pre.h>
 
 #define CFG_LONGHELP           1
 #define CONFIG_CMDLINE_EDITING 1
 
 #define CONFIG_PANIC_HANG 1
 
-/*
-* Boot Mode Set
-* Blackfin can support several boot modes
-*/
-#define BF561_BYPASS_BOOT      0x21
-#define BF561_PARA_BOOT                0x22
-#define BF561_SPI_BOOT         0x24
-/* Define the boot mode */
-#define BFIN_BOOT_MODE BF561_BYPASS_BOOT
+#define CONFIG_BFIN_CPU        bf561-0.3
+#define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_BYPASS
 
 /* This sets the default state of the cache on U-Boot's boot */
 #define CONFIG_ICACHE_ON
 #define CONFIG_DCACHE_ON
 
-/* Define where the uboot will be loaded by on-chip boot rom */
-#define APP_ENTRY 0x00001000
-
-/*
- * Stringize definitions - needed for environmental settings
- */
-#define STRINGIZE2(x) #x
-#define STRINGIZE(x) STRINGIZE2(x)
-
 /*
  * Board settings
  */
  */
 #define CFG_BAUDRATE_TABLE     { 9600, 19200, 38400, 57600, 115200 }
 
-#define        CFG_PROMPT              "ezkit> "       /* Monitor Command Prompt */
+#define        CFG_PROMPT              "bfin> "        /* Monitor Command Prompt */
 
 #if defined(CONFIG_CMD_KGDB)
 #define        CFG_CBSIZE              1024            /* Console I/O Buffer Size */
 /*
  * FLASH organization and environment definitions
  */
-#define        CFG_BOOTMAPSZ           (8 << 20)       /* Initial Memory map for Linux */
+#define CONFIG_EBIU_SDRRC_VAL  0x306
+#define CONFIG_EBIU_SDGCTL_VAL 0x91114d
+#define CONFIG_EBIU_SDBCTL_VAL 0x15
 
-#define AMGCTLVAL              0x3F
-#define AMBCTL0VAL             0x7BB07BB0
-#define AMBCTL1VAL             0xFFC27BB0
+#define CONFIG_EBIU_AMGCTL_VAL         0x3F
+#define CONFIG_EBIU_AMBCTL0_VAL                0x7BB07BB0
+#define CONFIG_EBIU_AMBCTL1_VAL                0xFFC27BB0
 
-#ifdef CONFIG_VDSP
-#define ET_EXEC_VDSP           0x8
-#define SHT_STRTAB_VDSP                0x1
-#define ELFSHDRSIZE_VDSP       0x2C
-#define VDSP_ENTRY_ADDR                0xFFA00000
-#endif
+#include <asm/blackfin-config-post.h>
 
 #endif                         /* __CONFIG_EZKIT561_H__ */
index a4bcc65..3dd577a 100644 (file)
 /*-----------------------------------------------------------------------
  * High Level Configuration Options
  *----------------------------------------------------------------------*/
-#define CONFIG_CANYONLANDS     1       /* Board is Canyonlands */
+/* This config file is used for Canyonlands (460EX) and Glacier (460GT)        */
+#ifndef CONFIG_CANYONLANDS
+#define CONFIG_460GT           1       /* Specific PPC460GT            */
+#else
+#define CONFIG_460EX           1       /* Specific PPC460EX            */
+#endif
 #define CONFIG_440             1
 #define CONFIG_4xx             1       /* ... PPC4xx family */
-#define CONFIG_460EX           1       /* Specific PPC460EX support */
 
 #define CONFIG_SYS_CLK_FREQ    66666667        /* external freq to pll */
 
 #define CONFIG_BOARD_EARLY_INIT_F      1       /* Call board_early_init_f */
 #define CONFIG_BOARD_EARLY_INIT_R      1       /* Call board_early_init_r */
 #define CONFIG_MISC_INIT_R             1       /* Call misc_init_r */
+#define CONFIG_BOARD_TYPES             1       /* support board types */
 
 /*-----------------------------------------------------------------------
  * Base addresses -- Note these are effective addresses where the
  * On 440EPx the SPL is copied to SDRAM before the NAND controller is
  * set up. While still running from cache, I experienced problems accessing
  * the NAND controller.        sr - 2006-08-25
+ *
+ * This is the first official implementation of booting from 2k page sized
+ * NAND devices (e.g. Micron 29F2G08AA 256Mbit * 8)
  */
 #define CFG_NAND_BOOT_SPL_SRC  0xfffff000      /* SPL location               */
 #define CFG_NAND_BOOT_SPL_SIZE (4 << 10)       /* SPL size                   */
 /*
  * Define the partitioning of the NAND chip (only RAM U-Boot is needed here)
  */
-#define CFG_NAND_U_BOOT_OFFS   (16 << 10)      /* Offset to RAM U-Boot image */
-#define CFG_NAND_U_BOOT_SIZE   (384 << 10)     /* Size of RAM U-Boot image   */
+#define CFG_NAND_U_BOOT_OFFS   (128 << 10)     /* Offset to RAM U-Boot image */
+#define CFG_NAND_U_BOOT_SIZE   (1 << 20)       /* Size of RAM U-Boot image   */
 
 /*
  * Now the NAND chip has to be defined (no autodetection used!)
  */
-#define CFG_NAND_PAGE_SIZE     512             /* NAND chip page size        */
-#define CFG_NAND_BLOCK_SIZE    (16 << 10)      /* NAND chip block size       */
-#define CFG_NAND_PAGE_COUNT    32              /* NAND chip page count       */
-#define CFG_NAND_BAD_BLOCK_POS 5             /* Location of bad block marker */
-#undef CFG_NAND_4_ADDR_CYCLE                 /* No fourth addr used (<=32MB) */
+#define CFG_NAND_PAGE_SIZE     (2 << 10)       /* NAND chip page size        */
+#define CFG_NAND_BLOCK_SIZE    (128 << 10)     /* NAND chip block size       */
+#define CFG_NAND_PAGE_COUNT    (CFG_NAND_BLOCK_SIZE / CFG_NAND_PAGE_SIZE)
+                                               /* NAND chip page count       */
+#define CFG_NAND_BAD_BLOCK_POS 0               /* Location of bad block marker*/
+#define CFG_NAND_5_ADDR_CYCLE                  /* Fifth addr used (<=128MB)  */
 
 #define CFG_NAND_ECCSIZE       256
 #define CFG_NAND_ECCBYTES      3
 #define CFG_NAND_ECCSTEPS      (CFG_NAND_PAGE_SIZE / CFG_NAND_ECCSIZE)
-#define CFG_NAND_OOBSIZE       16
+#define CFG_NAND_OOBSIZE       64
 #define CFG_NAND_ECCTOTAL      (CFG_NAND_ECCBYTES * CFG_NAND_ECCSTEPS)
-#define CFG_NAND_ECCPOS                {0, 1, 2, 3, 6, 7}
+#define CFG_NAND_ECCPOS                {40, 41, 42, 43, 44, 45, 46, 47, \
+                                48, 49, 50, 51, 52, 53, 54, 55, \
+                                56, 57, 58, 59, 60, 61, 62, 63}
 
 #ifdef CFG_ENV_IS_IN_NAND
 /*
 #define CONFIG_DDR_ECC         1       /* with ECC support             */
 #define CONFIG_DDR_RQDC_FIXED  0x80000038 /* fixed value for RQDC      */
 #endif
-#define CFG_MBYTES_SDRAM        256    /* 256MB                        */
+#define CFG_MBYTES_SDRAM       512     /* 512MB                        */
 
 /*-----------------------------------------------------------------------
  * I2C
 #define CONFIG_MII             1       /* MII PHY management           */
 #define CONFIG_PHY_ADDR                0       /* PHY address, See schematics  */
 #define CONFIG_PHY1_ADDR       1
-#define CONFIG_HAS_ETH0                1
-#define CONFIG_HAS_ETH1                1       /* add support for "eth1addr"   */
+#define CONFIG_HAS_ETH0
+#define CONFIG_HAS_ETH1
+/* Only Glacier (460GT) has 4 EMAC interfaces */
+#ifdef CONFIG_460GT
+#define CONFIG_PHY2_ADDR       2
+#define CONFIG_PHY3_ADDR       3
+#define CONFIG_HAS_ETH2
+#define CONFIG_HAS_ETH3
+#endif
 #define CONFIG_NET_MULTI       1
 
 #define CONFIG_PHY_RESET       1       /* reset phy upon startup       */
 /*-----------------------------------------------------------------------
  * USB-OHCI
  *----------------------------------------------------------------------*/
+/* Only Canyonlands (460EX) has USB */
+#ifdef CONFIG_460EX
 #define CONFIG_USB_OHCI_NEW
 #define CONFIG_USB_STORAGE
 #undef CFG_OHCI_BE_CONTROLLER          /* 460EX has little endian descriptors  */
 #define CFG_USB_OHCI_REGS_BASE (CFG_AHB_BASE | 0xd0000)
 #define CFG_USB_OHCI_SLOT_NAME "ppc440"
 #define CFG_USB_OHCI_MAX_ROOT_PORTS 15
+#endif
 
 /*-----------------------------------------------------------------------
  * Default environment
 
 #undef CONFIG_BOOTARGS
 
+/* Setup some board specific values for the default environment variables */
+#ifdef CONFIG_CANYONLANDS
+#define CONFIG_HOSTNAME                canyonlands
+#define CFG_BOOTFILE           "bootfile=canyonlands/uImage\0"
+#define CFG_DTBFILE            "fdt_file=canyonlands/canyonlands.dtb\0"
+#define CFG_ROOTPATH           "rootpath=/opt/eldk/ppc_4xxFP\0"
+#else
+#define CONFIG_HOSTNAME                glacier
+#define CFG_BOOTFILE           "bootfile=glacier/uImage\0"
+#define CFG_DTBFILE            "fdt_file=glacier/glacier.dtb\0"
+#define CFG_ROOTPATH           "rootpath=/opt/eldk/ppc_4xx\0"
+#endif
+
 #define        CONFIG_EXTRA_ENV_SETTINGS                                       \
+       CFG_BOOTFILE                                                    \
+       CFG_DTBFILE                                                     \
+       CFG_ROOTPATH                                                    \
        "netdev=eth0\0"                                                 \
-       "hostname=canyonlands\0"                                        \
        "nfsargs=setenv bootargs root=/dev/nfs rw "                     \
                "nfsroot=${serverip}:${rootpath}\0"                     \
        "ramargs=setenv bootargs root=/dev/ram rw\0"                    \
                "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}"      \
                ":${hostname}:${netdev}:off panic=1\0"                  \
        "addtty=setenv bootargs ${bootargs} console=ttyS0,${baudrate}\0"\
-       "net_nfs=tftp 200000 ${bootfile};"                              \
-               "run nfsargs addip addtty;"                             \
-               "bootm 200000\0"                                        \
-       "net_nfs_fdt=tftp 200000 ${bootfile};"                          \
-               "tftp ${fdt_addr} ${fdt_file};"                         \
-               "run nfsargs addip addtty;"                             \
-               "bootm 200000 - ${fdt_addr}\0"                          \
-       "flash_nfs=run nfsargs addip addtty;"                           \
-               "bootm ${kernel_addr}\0"                                \
        "flash_self=run ramargs addip addtty;"                          \
-               "bootm ${kernel_addr} ${ramdisk_addr}\0"                \
-       "rootpath=/opt/eldk/ppc_4xxFP\0"                                \
-       "bootfile=canyonlands/uImage\0"                                 \
-       "fdt_file=canyonlands/canyonlands.dtb\0"                        \
-       "fdt_addr=400000\0"                                             \
+               "bootm ${kernel_addr} ${ramdisk_addr} ${fdt_addr}\0"    \
+       "flash_nfs=run nfsargs addip addtty;"                           \
+               "bootm ${kernel_addr} - ${fdt_addr}\0"                  \
+       "net_nfs=tftp ${kernel_addr_r} ${bootfile}; "                   \
+               "tftp ${fdt_addr_r} ${fdt_file}; "                      \
+               "run nfsargs addip addtty;"                             \
+               "bootm ${kernel_addr_r} - ${fdt_addr_r}\0"              \
+       "kernel_addr_r=400000\0"                                        \
+       "fdt_addr_r=800000\0"                                           \
        "kernel_addr=fc000000\0"                                        \
+       "fdt_addr=fc1e0000\0"                                           \
        "ramdisk_addr=fc200000\0"                                       \
        "initrd_high=30000000\0"                                        \
-       "load=tftp 200000 canyonlands/u-boot.bin\0"                     \
+       "load=tftp 200000 ${hostname}/u-boot.bin\0"                     \
        "update=protect off fffa0000 ffffffff;era fffa0000 ffffffff;"   \
                "cp.b ${fileaddr} fffa0000 ${filesize};"                \
                "setenv filesize;saveenv\0"                             \
        "upd=run load update\0"                                         \
-       "nload=tftp 200000 canyonlands/u-boot-nand.bin\0"               \
-       "nupdate=nand erase 0 60000;nand write 200000 0 60000;"         \
+       "nload=tftp 200000 ${hostname}/u-boot-nand.bin\0"               \
+       "nupdate=nand erase 0 100000;nand write 200000 0 100000;"       \
                "setenv filesize;saveenv\0"                             \
        "nupd=run nload nupdate\0"                                      \
        "pciconfighost=1\0"                                             \
 #define CONFIG_CMD_DIAG
 #define CONFIG_CMD_EEPROM
 #define CONFIG_CMD_ELF
-#define CONFIG_CMD_EXT2
-#define CONFIG_CMD_FAT
 #define CONFIG_CMD_I2C
 #define CONFIG_CMD_IRQ
 #define CONFIG_CMD_MII
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_REGINFO
 #define CONFIG_CMD_SDRAM
+#ifdef CONFIG_460EX
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_FAT
 #define CONFIG_CMD_USB
+#endif
 
 /* Partitions */
 #define CONFIG_MAC_PARTITION
 /*
  * PPC4xx GPIO Configuration
  */
+#ifdef CONFIG_460EX
+/* 460EX: Use USB configuration */
 #define CFG_4xx_GPIO_TABLE { /*          Out             GPIO  Alternate1      Alternate2      Alternate3 */ \
 {                                                                                      \
 /* GPIO Core 0 */                                                                      \
 {GPIO1_BASE, GPIO_IN , GPIO_SEL , GPIO_OUT_0}, /* GPIO63  Unselect via TraceSelect Bit */      \
 }                                                                                      \
 }
+#else
+/* 460GT: Use EMAC2+3 configuration */
+#define CFG_4xx_GPIO_TABLE { /*          Out             GPIO  Alternate1      Alternate2      Alternate3 */ \
+{                                                                                      \
+/* GPIO Core 0 */                                                                      \
+{GPIO0_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_0}, /* GPIO0        GMC1TxD(0)      USB2HostD(0)    */      \
+{GPIO0_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_0}, /* GPIO1        GMC1TxD(1)      USB2HostD(1)    */      \
+{GPIO0_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_0}, /* GPIO2        GMC1TxD(2)      USB2HostD(2)    */      \
+{GPIO0_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_0}, /* GPIO3        GMC1TxD(3)      USB2HostD(3)    */      \
+{GPIO0_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_0}, /* GPIO4        GMC1TxD(4)      USB2HostD(4)    */      \
+{GPIO0_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_0}, /* GPIO5        GMC1TxD(5)      USB2HostD(5)    */      \
+{GPIO0_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_0}, /* GPIO6        GMC1TxD(6)      USB2HostD(6)    */      \
+{GPIO0_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_0}, /* GPIO7        GMC1TxD(7)      USB2HostD(7)    */      \
+{GPIO0_BASE, GPIO_IN , GPIO_ALT1, GPIO_OUT_0}, /* GPIO8        GMC1RxD(0)      USB2OTGD(0)     */      \
+{GPIO0_BASE, GPIO_IN , GPIO_ALT1, GPIO_OUT_0}, /* GPIO9        GMC1RxD(1)      USB2OTGD(1)     */      \
+{GPIO0_BASE, GPIO_IN , GPIO_ALT1, GPIO_OUT_0}, /* GPIO10 GMC1RxD(2)    USB2OTGD(2)     */      \
+{GPIO0_BASE, GPIO_IN , GPIO_ALT1, GPIO_OUT_0}, /* GPIO11 GMC1RxD(3)    USB2OTGD(3)     */      \
+{GPIO0_BASE, GPIO_IN , GPIO_ALT1, GPIO_OUT_0}, /* GPIO12 GMC1RxD(4)    USB2OTGD(4)     */      \
+{GPIO0_BASE, GPIO_IN , GPIO_ALT1, GPIO_OUT_0}, /* GPIO13 GMC1RxD(5)    USB2OTGD(5)     */      \
+{GPIO0_BASE, GPIO_IN , GPIO_ALT1, GPIO_OUT_0}, /* GPIO14 GMC1RxD(6)    USB2OTGD(6)     */      \
+{GPIO0_BASE, GPIO_IN , GPIO_ALT1, GPIO_OUT_0}, /* GPIO15 GMC1RxD(7)    USB2OTGD(7)     */      \
+{GPIO0_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_0}, /* GPIO16 GMC1TxER      USB2HostStop    */      \
+{GPIO0_BASE, GPIO_IN , GPIO_ALT1, GPIO_OUT_0}, /* GPIO17 GMC1CD                USB2HostNext    */      \
+{GPIO0_BASE, GPIO_IN , GPIO_ALT1, GPIO_OUT_0}, /* GPIO18 GMC1RxER      USB2HostDir     */      \
+{GPIO0_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_0}, /* GPIO19 GMC1TxEN      USB2OTGStop     */      \
+{GPIO0_BASE, GPIO_BI , GPIO_ALT1, GPIO_OUT_0}, /* GPIO20 GMC1CRS       USB2OTGNext     */      \
+{GPIO0_BASE, GPIO_IN , GPIO_ALT1, GPIO_OUT_0}, /* GPIO21 GMC1RxDV      USB2OTGDir      */      \
+{GPIO0_BASE, GPIO_IN , GPIO_ALT1, GPIO_OUT_0}, /* GPIO22 NFRDY                         */      \
+{GPIO0_BASE, GPIO_IN , GPIO_ALT1, GPIO_OUT_0}, /* GPIO23 NFREN                         */      \
+{GPIO0_BASE, GPIO_IN , GPIO_ALT1, GPIO_OUT_0}, /* GPIO24 NFWEN                         */      \
+{GPIO0_BASE, GPIO_IN , GPIO_ALT1, GPIO_OUT_0}, /* GPIO25 NFCLE                         */      \
+{GPIO0_BASE, GPIO_IN , GPIO_ALT1, GPIO_OUT_0}, /* GPIO26 NFALE                         */      \
+{GPIO0_BASE, GPIO_IN , GPIO_ALT1, GPIO_OUT_0}, /* GPIO27 IRQ(0)                                */      \
+{GPIO0_BASE, GPIO_IN , GPIO_ALT1, GPIO_OUT_0}, /* GPIO28 IRQ(1)                                */      \
+{GPIO0_BASE, GPIO_IN , GPIO_ALT1, GPIO_OUT_0}, /* GPIO29 IRQ(2)                                */      \
+{GPIO0_BASE, GPIO_OUT, GPIO_SEL , GPIO_OUT_1}, /* GPIO30 PerPar0       DMAReq2         IRQ(7)*/ \
+{GPIO0_BASE, GPIO_OUT, GPIO_SEL , GPIO_OUT_1}, /* GPIO31 PerPar1       DMAAck2         IRQ(8)*/ \
+},                                                                                     \
+{                                                                                      \
+/* GPIO Core 1 */                                                                      \
+{GPIO1_BASE, GPIO_OUT, GPIO_SEL , GPIO_OUT_1}, /* GPIO32 PerPar2       EOT2/TC2        IRQ(9)*/ \
+{GPIO1_BASE, GPIO_OUT, GPIO_SEL , GPIO_OUT_1}, /* GPIO33 PerPar3       DMAReq3         IRQ(4)*/ \
+{GPIO1_BASE, GPIO_OUT, GPIO_ALT3, GPIO_OUT_1}, /* GPIO34 UART0_DCD_N   UART1_DSR_CTS_N UART2_SOUT*/ \
+{GPIO1_BASE, GPIO_IN , GPIO_ALT3, GPIO_OUT_0}, /* GPIO35 UART0_8PIN_DSR_N UART1_RTS_DTR_N UART2_SIN*/ \
+{GPIO1_BASE, GPIO_IN , GPIO_ALT3, GPIO_OUT_0}, /* GPIO36 UART0_8PIN_CTS_N DMAAck3      UART3_SIN*/ \
+{GPIO1_BASE, GPIO_BI , GPIO_ALT2, GPIO_OUT_0}, /* GPIO37 UART0_RTS_N   EOT3/TC3        UART3_SOUT*/ \
+{GPIO1_BASE, GPIO_OUT, GPIO_ALT2, GPIO_OUT_1}, /* GPIO38 UART0_DTR_N   UART1_SOUT      */      \
+{GPIO1_BASE, GPIO_IN , GPIO_ALT2, GPIO_OUT_0}, /* GPIO39 UART0_RI_N    UART1_SIN       */      \
+{GPIO1_BASE, GPIO_IN , GPIO_ALT1, GPIO_OUT_0}, /* GPIO40 IRQ(3)                                */      \
+{GPIO1_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_0}, /* GPIO41 CS(1)                         */      \
+{GPIO1_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_0}, /* GPIO42 CS(2)                         */      \
+{GPIO1_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_0}, /* GPIO43 CS(3)         DMAReq1         IRQ(10)*/ \
+{GPIO1_BASE, GPIO_IN , GPIO_ALT3, GPIO_OUT_0}, /* GPIO44 CS(4)         DMAAck1         IRQ(11)*/ \
+{GPIO1_BASE, GPIO_IN , GPIO_ALT3, GPIO_OUT_0}, /* GPIO45 CS(5)         EOT/TC1         IRQ(12)*/ \
+{GPIO1_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_0}, /* GPIO46 PerAddr(5)    DMAReq0         IRQ(13)*/ \
+{GPIO1_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_0}, /* GPIO47 PerAddr(6)    DMAAck0         IRQ(14)*/ \
+{GPIO1_BASE, GPIO_OUT, GPIO_ALT1, GPIO_OUT_0}, /* GPIO48 PerAddr(7)    EOT/TC0         IRQ(15)*/ \
+{GPIO1_BASE, GPIO_IN , GPIO_SEL , GPIO_OUT_0}, /* GPIO49  Unselect via TraceSelect Bit */      \
+{GPIO1_BASE, GPIO_IN , GPIO_SEL , GPIO_OUT_0}, /* GPIO50  Unselect via TraceSelect Bit */      \
+{GPIO1_BASE, GPIO_IN , GPIO_SEL , GPIO_OUT_0}, /* GPIO51  Unselect via TraceSelect Bit */      \
+{GPIO1_BASE, GPIO_IN , GPIO_SEL , GPIO_OUT_0}, /* GPIO52  Unselect via TraceSelect Bit */      \
+{GPIO1_BASE, GPIO_IN , GPIO_SEL , GPIO_OUT_0}, /* GPIO53  Unselect via TraceSelect Bit */      \
+{GPIO1_BASE, GPIO_IN , GPIO_SEL , GPIO_OUT_0}, /* GPIO54  Unselect via TraceSelect Bit */      \
+{GPIO1_BASE, GPIO_IN , GPIO_SEL , GPIO_OUT_0}, /* GPIO55  Unselect via TraceSelect Bit */      \
+{GPIO1_BASE, GPIO_IN , GPIO_SEL , GPIO_OUT_0}, /* GPIO56  Unselect via TraceSelect Bit */      \
+{GPIO1_BASE, GPIO_IN , GPIO_SEL , GPIO_OUT_0}, /* GPIO57  Unselect via TraceSelect Bit */      \
+{GPIO1_BASE, GPIO_IN , GPIO_SEL , GPIO_OUT_0}, /* GPIO58  Unselect via TraceSelect Bit */      \
+{GPIO1_BASE, GPIO_IN , GPIO_SEL , GPIO_OUT_0}, /* GPIO59  Unselect via TraceSelect Bit */      \
+{GPIO1_BASE, GPIO_IN , GPIO_SEL , GPIO_OUT_0}, /* GPIO60  Unselect via TraceSelect Bit */      \
+{GPIO1_BASE, GPIO_IN , GPIO_SEL , GPIO_OUT_0}, /* GPIO61  Unselect via TraceSelect Bit */      \
+{GPIO1_BASE, GPIO_IN , GPIO_SEL , GPIO_OUT_0}, /* GPIO62  Unselect via TraceSelect Bit */      \
+{GPIO1_BASE, GPIO_IN , GPIO_SEL , GPIO_OUT_0}, /* GPIO63  Unselect via TraceSelect Bit */      \
+}                                                                                      \
+}
+#endif
 
 /* pass open firmware flat tree */
 #define CONFIG_OF_LIBFDT       1
index d22d350..bce5fcd 100644 (file)
@@ -50,7 +50,7 @@
 #define MC_ASR_VAL     0x00000000
 #define MC_AASR_VAL    0x00000000
 #define EBI_CFGR_VAL   0x00000000
-#define SMC2_CSR_VAL   0x100032ad /* 16bit, 2 TDF, 4 WS */
+#define SMC_CSR0_VAL   0x100032ad /* 16bit, 2 TDF, 4 WS */
 
 /* clocks */
 #define PLLAR_VAL      0x2026BE04 /* 179,712 MHz for PCK */
index 104d94e..c7e3899 100644 (file)
 #ifdef CONFIG_MCFFEC
 #      define CONFIG_NET_MULTI         1
 #      define CONFIG_MII               1
+#      define CONFIG_MII_INIT          1
 #      define CFG_DISCOVER_PHY
 #      define CFG_RX_ETH_BUFFER        8
 #      define CFG_FAULT_ECHO_LINK_DOWN
index ce4ea1f..1b30e51 100644 (file)
@@ -69,6 +69,7 @@
 #define CONFIG_PCI_PNP         1
 #endif
 #define CONFIG_PCI_SCAN_SHOW   1
+#define CONFIG_PCIAUTO_SKIP_HOST_BRIDGE        1
 
 #define CONFIG_PCI_MEM_BUS     0x40000000
 #define CONFIG_PCI_MEM_PHYS    CONFIG_PCI_MEM_BUS
index f93c3bc..e9c6d8e 100644 (file)
@@ -51,7 +51,7 @@
 #define MC_ASR_VAL     0x00000000
 #define MC_AASR_VAL    0x00000000
 #define EBI_CFGR_VAL   0x00000000
-#define SMC2_CSR_VAL   0x00003284 /* 16bit, 2 TDF, 4 WS */
+#define SMC_CSR0_VAL   0x00003284 /* 16bit, 2 TDF, 4 WS */
 
 /* clocks */
 #define PLLAR_VAL      0x2031BE01 /* 184.320000 MHz for PCK */
diff --git a/include/configs/gr_cpci_ax2000.h b/include/configs/gr_cpci_ax2000.h
new file mode 100644 (file)
index 0000000..1276f4d
--- /dev/null
@@ -0,0 +1,380 @@
+/* Configuration header file for Gaisler GR-CPCI-AX2000
+ * AX board. Note that since the AX is removable the configuration
+ * for this board must be edited below.
+ *
+ * (C) Copyright 2003-2005
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * (C) Copyright 2008
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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 __CONFIG_H__
+#define __CONFIG_H__
+
+/*
+ * High Level Configuration Options
+ * (easy to change)
+ */
+
+#define CONFIG_LEON3           /* This is an LEON3 CPU */
+#define CONFIG_LEON            1       /* This is an LEON CPU */
+#define CONFIG_CPCI_AX2000     1       /* ... on GR-CPCI-AX2000 board */
+
+#define CONFIG_LEON_RAM_SRAM 1
+#define CONFIG_LEON_RAM_SDRAM 2
+#define CONFIG_LEON_RAM_SDRAM_NOSRAM 3
+
+/* Select Memory to run from
+ *
+ * SRAM          - UBoot is run in SRAM, SRAM-0x40000000, SDRAM-0x60000000
+ * SDRAM         - UBoot is run in SDRAM, SRAM-0x40000000 and SDRAM-0x60000000
+ * SDRAM_NOSRAM  - UBoot is run in SDRAM, SRAM not available, SDRAM at 0x40000000
+ *
+ * Note, if Linux is to be used, SDRAM or SDRAM_NOSRAM is required since
+ * it doesn't fit into the 4Mb SRAM.
+ *
+ * SRAM is default since it will work for all systems, however will not
+ * be able to boot linux.
+ */
+#define CONFIG_LEON_RAM_SELECT CONFIG_LEON_RAM_SRAM
+
+/* CPU / AMBA BUS configuration */
+#define CONFIG_SYS_CLK_FREQ    20000000        /* 20MHz */
+
+/* Number of SPARC register windows */
+#define CFG_SPARC_NWINDOWS 8
+
+/*
+ * Serial console configuration
+ */
+#define CONFIG_BAUDRATE                38400   /* ... at 38400 bps */
+#define CFG_BAUDRATE_TABLE     { 9600, 19200, 38400, 57600, 115200, 230400 }
+
+/* Partitions */
+#define CONFIG_DOS_PARTITION
+#define CONFIG_MAC_PARTITION
+#define CONFIG_ISO_PARTITION
+
+/*
+ * Supported commands
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_AMBAPP
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_IRQ
+
+/*
+ * Autobooting
+ */
+#define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds */
+
+#define CONFIG_PREBOOT "echo;" \
+       "echo Type \"run flash_nfs\" to mount root filesystem over NFS;" \
+       "echo"
+
+#undef CONFIG_BOOTARGS
+
+#define        CONFIG_EXTRA_ENV_SETTINGS_BASE                                  \
+       "netdev=eth0\0"                                                 \
+       "nfsargs=setenv bootargs console=ttyS0,38400 root=/dev/nfs rw " \
+               "nfsroot=${serverip}:${rootpath}\0"                     \
+       "ramargs=setenv bootargs console=ttyS0,${baudrate} root=/dev/ram rw\0"                  \
+       "addip=setenv bootargs ${bootargs} "                            \
+               "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}"      \
+               ":${hostname}:${netdev}:off panic=1\0"                  \
+       "flash_nfs=run nfsargs addip;"                                  \
+               "bootm ${kernel_addr}\0"                                \
+       "flash_self=run ramargs addip;"                                 \
+               "bootm ${kernel_addr} ${ramdisk_addr}\0"                \
+       "getkernel=tftpboot \$\(scratch\)\ \$\(bootfile\)\0" \
+       "bootargs=console=ttyS0,38400 root=/dev/nfs rw nfsroot=192.168.0.20:/export/rootfs ip=192.168.0.206:192.168.0.20:192.168.0.1:255.255.255.0:ax2000:eth0\0"
+
+#if CONFIG_LEON_RAM_SELECT == CONFIG_LEON_RAM_SRAM
+#define CONFIG_EXTRA_ENV_SETTINGS_SELECT \
+       "net_nfs=tftp 40000000 ${bootfile};run nfsargs addip;bootm\0"   \
+       "scratch=40200000\0"                                    \
+       ""
+#elif CONFIG_LEON_RAM_SELECT == CONFIG_LEON_RAM_SDRAM
+#define CONFIG_EXTRA_ENV_SETTINGS_SELECT \
+       "net_nfs=tftp 60000000 ${bootfile};run nfsargs addip;bootm\0"   \
+       "scratch=60800000\0"                                    \
+       ""
+#else
+/* More than 4Mb is assumed when running from SDRAM */
+#define CONFIG_EXTRA_ENV_SETTINGS_SELECT \
+       "net_nfs=tftp 40000000 ${bootfile};run nfsargs addip;bootm\0"   \
+       "scratch=40800000\0"                                    \
+       ""
+#endif
+
+#define        CONFIG_EXTRA_ENV_SETTINGS CONFIG_EXTRA_ENV_SETTINGS_BASE CONFIG_EXTRA_ENV_SETTINGS_SELECT
+
+#define CONFIG_NETMASK 255.255.255.0
+#define CONFIG_GATEWAYIP 192.168.0.1
+#define CONFIG_SERVERIP 192.168.0.20
+#define CONFIG_IPADDR 192.168.0.206
+#define CONFIG_ROOTPATH /export/rootfs
+#define CONFIG_HOSTNAME  ax2000
+#define CONFIG_BOOTFILE  /uImage
+
+#define CONFIG_BOOTCOMMAND     "run flash_self"
+
+/* Memory MAP
+ *
+ *  Flash:
+ *  |--------------------------------|
+ *  | 0x00000000 Text & Data & BSS   | *
+ *  |            for Monitor         | *
+ *  | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| *
+ *  | UNUSED / Growth                | * 256kb
+ *  |--------------------------------|
+ *  | 0x00050000 Base custom area    | *
+ *  |            kernel / FS         | *
+ *  |                                | * Rest of Flash
+ *  |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
+ *  | END-0x00008000 Environment     | * 32kb
+ *  |--------------------------------|
+ *
+ *
+ *
+ *  Main Memory (4Mb SRAM or XMb SDRAM):
+ *  |--------------------------------|
+ *  | UNUSED / scratch area          |
+ *  |                                |
+ *  |                                |
+ *  |                                |
+ *  |                                |
+ *  |--------------------------------|
+ *  | Monitor .Text / .DATA / .BSS   | * 256kb
+ *  | Relocated!                     | *
+ *  |--------------------------------|
+ *  | Monitor Malloc                 | * 128kb (contains relocated environment)
+ *  |--------------------------------|
+ *  | Monitor/kernel STACK           | * 64kb
+ *  |--------------------------------|
+ *  | Page Table for MMU systems     | * 2k
+ *  |--------------------------------|
+ *  | PROM Code accessed from Linux  | * 6kb-128b
+ *  |--------------------------------|
+ *  | Global data (avail from kernel)| * 128b
+ *  |--------------------------------|
+ *
+ */
+
+/*
+ * Flash configuration (8,16 or 32 MB)
+ * TEXT base always at 0xFFF00000
+ * ENV_ADDR always at  0xFFF40000
+ * FLASH_BASE at 0xFC000000 for 64 MB
+ *               0xFE000000 for 32 MB
+ *               0xFF000000 for 16 MB
+ *               0xFF800000 for  8 MB
+ */
+/*#define CFG_NO_FLASH         1*/
+#define CFG_FLASH_BASE         0x00000000
+#define CFG_FLASH_SIZE         0x00800000
+
+#define PHYS_FLASH_SECT_SIZE   0x00020000      /* 128 KB sectors */
+#define CFG_MAX_FLASH_SECT     64      /* max num of sects on one chip */
+#define CFG_MAX_FLASH_BANKS    1       /* max num of memory banks      */
+
+#define CFG_FLASH_ERASE_TOUT   240000  /* Flash Erase Timeout (in ms)  */
+#define CFG_FLASH_WRITE_TOUT   500     /* Flash Write Timeout (in ms)  */
+#define CFG_FLASH_LOCK_TOUT    5       /* Timeout for Flash Set Lock Bit (in ms) */
+#define CFG_FLASH_UNLOCK_TOUT  10000   /* Timeout for Flash Clear Lock Bits (in ms) */
+#define CFG_FLASH_PROTECTION   /* "Real" (hardware) sectors protection */
+
+/*** CFI CONFIG ***/
+#define CFG_FLASH_CFI_WIDTH    FLASH_CFI_8BIT
+#define CFG_FLASH_CFI_DRIVER
+#define CFG_FLASH_CFI
+/* Bypass cache when reading regs from flash memory */
+#define CFG_FLASH_CFI_BYPASS_READ
+/* Buffered writes (32byte/go) instead of single accesses */
+#define CFG_FLASH_USE_BUFFER_WRITE
+
+/*
+ * Environment settings
+ */
+/*#define CFG_ENV_IS_NOWHERE 1*/
+#define CFG_ENV_IS_IN_FLASH    1
+/* CFG_ENV_ADDR need to be at sector boundary */
+#define CFG_ENV_SIZE           0x8000
+#define CFG_ENV_SECT_SIZE      0x20000
+#define CFG_ENV_ADDR           (CFG_FLASH_BASE+CFG_FLASH_SIZE-CFG_ENV_SECT_SIZE)
+#define CONFIG_ENV_OVERWRITE   1
+
+/*
+ * Memory map
+ *
+ * Always 4Mb SRAM available
+ * SDRAM module may be available on 0x60000000, SDRAM
+ * is configured as if a 128Mb SDRAM module is available.
+ */
+
+#if CONFIG_LEON_RAM_SELECT == CONFIG_LEON_RAM_SDRAM_NOSRAM
+#define CFG_SDRAM_BASE         0x40000000
+#else
+#define CFG_SDRAM_BASE         0x60000000
+#endif
+
+#define CFG_SDRAM_SIZE         0x08000000
+#define CFG_SDRAM_END          (CFG_SDRAM_BASE+CFG_SDRAM_SIZE)
+
+/* 4Mb SRAM available */
+#if CONFIG_LEON_RAM_SELECT != CONFIG_LEON_RAM_SDRAM_NOSRAM
+#define CFG_SRAM_BASE 0x40000000
+#define CFG_SRAM_SIZE 0x400000
+#define CFG_SRAM_END  (CFG_SRAM_BASE+CFG_SRAM_SIZE)
+#endif
+
+/* Select RAM used to run U-BOOT from... */
+#if CONFIG_LEON_RAM_SELECT == CONFIG_LEON_RAM_SRAM
+#define CFG_RAM_BASE CFG_SRAM_BASE
+#define CFG_RAM_SIZE CFG_SRAM_SIZE
+#define CFG_RAM_END CFG_SRAM_END
+#else
+#define CFG_RAM_BASE CFG_SDRAM_BASE
+#define CFG_RAM_SIZE CFG_SDRAM_SIZE
+#define CFG_RAM_END CFG_SDRAM_END
+#endif
+
+#define CFG_GBL_DATA_SIZE      128     /* size in bytes reserved for initial data */
+#define CFG_GBL_DATA_OFFSET    (CFG_RAM_END - CFG_GBL_DATA_SIZE)
+
+#define CFG_PROM_SIZE          (8192-CFG_GBL_DATA_SIZE)
+#define CFG_PROM_OFFSET                (CFG_GBL_DATA_OFFSET-CFG_PROM_SIZE)
+
+#define CFG_INIT_SP_OFFSET     (CFG_PROM_OFFSET-32)
+#define CFG_STACK_SIZE         (0x10000-32)
+
+#define CFG_MONITOR_BASE    TEXT_BASE
+#if (CFG_MONITOR_BASE < CFG_FLASH_BASE)
+#   define CFG_RAMBOOT         1
+#endif
+
+#define CFG_MONITOR_LEN                (256 << 10)     /* Reserve 256 kB for Monitor   */
+#define CFG_MALLOC_LEN         (128 << 10)     /* Reserve 128 kB for malloc()  */
+#define CFG_BOOTMAPSZ          (8 << 20)       /* Initial Memory map for Linux */
+
+#define CFG_MALLOC_END         (CFG_INIT_SP_OFFSET-CFG_STACK_SIZE)
+#define CFG_MALLOC_BASE                (CFG_MALLOC_END-CFG_MALLOC_LEN)
+
+/* relocated monitor area */
+#define CFG_RELOC_MONITOR_MAX_END   CFG_MALLOC_BASE
+#define CFG_RELOC_MONITOR_BASE     (CFG_RELOC_MONITOR_MAX_END-CFG_MONITOR_LEN)
+
+/* make un relocated address from relocated address */
+#define UN_RELOC(address) (address-(CFG_RELOC_MONITOR_BASE-TEXT_BASE))
+
+/*
+ * Ethernet configuration uses on board SMC91C111
+ */
+#define CONFIG_DRIVER_SMC91111          1
+#define CONFIG_SMC91111_BASE           0x20000300      /* chip select 3         */
+#define CONFIG_SMC_USE_32_BIT          1       /* 32 bit bus  */
+#undef  CONFIG_SMC_91111_EXT_PHY       /* we use internal phy   */
+/*#define CONFIG_SHOW_ACTIVITY*/
+#define CONFIG_NET_RETRY_COUNT         10      /* # of retries          */
+
+#define CONFIG_ETHADDR   00:00:7a:cc:00:13
+#define CONFIG_PHY_ADDR         0x00
+
+/*
+ * Miscellaneous configurable options
+ */
+#define CFG_LONGHELP           /* undef to save memory     */
+#define CFG_PROMPT             "=> "   /* Monitor Command Prompt   */
+#if defined(CONFIG_CMD_KGDB)
+#define CFG_CBSIZE             1024    /* Console I/O Buffer Size  */
+#else
+#define CFG_CBSIZE             256     /* Console I/O Buffer Size  */
+#endif
+#define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16)  /* Print Buffer Size */
+#define CFG_MAXARGS            16      /* max number of command args   */
+#define CFG_BARGSIZE           CFG_CBSIZE      /* Boot Argument Buffer Size    */
+
+#define CFG_MEMTEST_START      0x00100000      /* memtest works on */
+#define CFG_MEMTEST_END                0x00f00000      /* 1 ... 15 MB in DRAM  */
+
+#define CFG_LOAD_ADDR          0x100000        /* default load address */
+
+#define CFG_HZ                 1000    /* decrementer freq: 1 ms ticks */
+
+/*
+ * Various low-level settings
+ */
+
+/*-----------------------------------------------------------------------
+ * USB stuff
+ *-----------------------------------------------------------------------
+ */
+#define CONFIG_USB_CLOCK       0x0001BBBB
+#define CONFIG_USB_CONFIG      0x00005000
+
+/***** Gaisler GRLIB IP-Cores Config ********/
+
+/* AMBA Plug & Play info display on startup */
+/*#define CFG_AMBAPP_PRINT_ON_STARTUP*/
+
+#define CFG_GRLIB_SDRAM    0
+
+/* See, GRLIB Docs (grip.pdf) on how to set up
+ * These the memory controller registers.
+ */
+#define CFG_GRLIB_MEMCFG1   (0x10f800ff | (1<<11))
+#if CONFIG_LEON_RAM_SELECT == CONFIG_LEON_RAM_SDRAM_NOSRAM
+#define CFG_GRLIB_MEMCFG2   0x82206000
+#else
+#define CFG_GRLIB_MEMCFG2   0x82205260
+#endif
+#define CFG_GRLIB_MEMCFG3   0x0809a000
+
+#define CFG_GRLIB_FT_MEMCFG1   (0x10f800ff | (1<<11))
+#if CONFIG_LEON_RAM_SELECT == CONFIG_LEON_RAM_SDRAM_NOSRAM
+#define CFG_GRLIB_FT_MEMCFG2   0x82206000
+#else
+#define CFG_GRLIB_FT_MEMCFG2   0x82205260
+#endif
+#define CFG_GRLIB_FT_MEMCFG3   0x0809a000
+
+/* no DDR controller */
+#define CFG_GRLIB_DDR_CFG   0x00000000
+
+/* no DDR2 Controller */
+#define CFG_GRLIB_DDR2_CFG1 0x00000000
+#define CFG_GRLIB_DDR2_CFG3 0x00000000
+
+/* Calculate scaler register value from default baudrate */
+#define CFG_GRLIB_APBUART_SCALER \
+ ((((CONFIG_SYS_CLK_FREQ*10)/(CONFIG_BAUDRATE*8))-5)/10)
+
+/* Identification string */
+#define CONFIG_IDENT_STRING "GAISLER LEON3 GR-CPCI-AX2000"
+
+/* default kernel command line */
+#define CONFIG_DEFAULT_KERNEL_COMMAND_LINE "console=ttyS0,38400\0\0"
+
+#endif                         /* __CONFIG_H */
diff --git a/include/configs/gr_ep2s60.h b/include/configs/gr_ep2s60.h
new file mode 100644 (file)
index 0000000..710a082
--- /dev/null
@@ -0,0 +1,356 @@
+/* Configuration header file for Gaisler Research AB's Template
+ * design (GPL Open Source SPARC/LEON3 96MHz) for Altera NIOS
+ * Development board Stratix II edition, with the FPGA device
+ * EP2S60.
+ *
+ * (C) Copyright 2003-2005
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * (C) Copyright 2008
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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 __CONFIG_H__
+#define __CONFIG_H__
+
+/*
+ * High Level Configuration Options
+ * (easy to change)
+ */
+
+#define CONFIG_LEON3           /* This is an LEON3 CPU */
+#define CONFIG_LEON            1       /* This is an LEON CPU */
+/* Altera NIOS Development board, Stratix II board */
+#define CONFIG_GR_EP2S60       1
+
+/* CPU / AMBA BUS configuration */
+#define CONFIG_SYS_CLK_FREQ    96000000        /* 96MHz */
+
+/* Number of SPARC register windows */
+#define CFG_SPARC_NWINDOWS 8
+
+/* Define this is the GR-2S60-MEZZ mezzanine is available and you
+ * want to use the USB and GRETH functionality of the board
+ */
+#undef GR_2S60_MEZZ
+
+#ifdef GR_2S60_MEZZ
+#define USE_GRETH 1
+#define USE_GRUSB 1
+#endif
+
+/*
+ * Serial console configuration
+ */
+#define CONFIG_BAUDRATE                38400   /* ... at 38400 bps */
+#define CFG_BAUDRATE_TABLE     { 9600, 19200, 38400, 57600, 115200, 230400 }
+
+/* Partitions */
+#define CONFIG_DOS_PARTITION
+#define CONFIG_MAC_PARTITION
+#define CONFIG_ISO_PARTITION
+
+/*
+ * Supported commands
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_AMBAPP
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_IRQ
+
+/* USB support */
+#if USE_GRUSB
+#define CONFIG_USB_UHCI
+#define CONFIG_CMD_FAT
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_USB
+#define CONFIG_USB_STORAGE
+/* Enable needed helper functions */
+#define CFG_DEVICE_DEREGISTER  /* needs device_deregister */
+#endif
+
+/*
+ * Autobooting
+ */
+#define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds */
+
+#define CONFIG_PREBOOT "echo;" \
+       "echo Type \"run flash_nfs\" to mount root filesystem over NFS;" \
+       "echo"
+
+#undef CONFIG_BOOTARGS
+
+#define        CONFIG_EXTRA_ENV_SETTINGS                                       \
+       "netdev=eth0\0"                                                 \
+       "nfsargs=setenv bootargs console=ttyS0,38400 root=/dev/nfs rw " \
+               "nfsroot=${serverip}:${rootpath}\0"                     \
+       "ramargs=setenv bootargs console=ttyS0,${baudrate} root=/dev/ram rw\0"                  \
+       "addip=setenv bootargs ${bootargs} "                            \
+               "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}"      \
+               ":${hostname}:${netdev}:off panic=1\0"                  \
+       "flash_nfs=run nfsargs addip;"                                  \
+               "bootm ${kernel_addr}\0"                                \
+       "flash_self=run ramargs addip;"                                 \
+               "bootm ${kernel_addr} ${ramdisk_addr}\0"                \
+       "net_nfs=tftp 40000000 ${bootfile};run nfsargs addip;bootm\0"   \
+       "scratch=40800000\0"                                    \
+       "getkernel=tftpboot \$\(scratch\)\ \$\(bootfile\)\0" \
+       "bootargs=console=ttyS0,38400 root=/dev/nfs rw nfsroot=192.168.0.20:/export/rootfs ip=192.168.0.207:192.168.0.20:192.168.0.1:255.255.255.0:ml401:eth0\0" \
+       ""
+
+#define CONFIG_NETMASK 255.255.255.0
+#define CONFIG_GATEWAYIP 192.168.0.1
+#define CONFIG_SERVERIP 192.168.0.20
+#define CONFIG_IPADDR 192.168.0.207
+#define CONFIG_ROOTPATH /export/rootfs
+#define CONFIG_HOSTNAME  ml401
+#define CONFIG_BOOTFILE  /uImage
+
+#define CONFIG_BOOTCOMMAND     "run flash_self"
+
+/* Memory MAP
+ *
+ *  Flash:
+ *  |--------------------------------|
+ *  | 0x00000000 Text & Data & BSS   | *
+ *  |            for Monitor         | *
+ *  | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| *
+ *  | UNUSED / Growth                | * 256kb
+ *  |--------------------------------|
+ *  | 0x00050000 Base custom area    | *
+ *  |            kernel / FS         | *
+ *  |                                | * Rest of Flash
+ *  |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
+ *  | END-0x00008000 Environment     | * 32kb
+ *  |--------------------------------|
+ *
+ *
+ *
+ *  Main Memory:
+ *  |--------------------------------|
+ *  | UNUSED / scratch area          |
+ *  |                                |
+ *  |                                |
+ *  |                                |
+ *  |                                |
+ *  |--------------------------------|
+ *  | Monitor .Text / .DATA / .BSS   | * 512kb
+ *  | Relocated!                     | *
+ *  |--------------------------------|
+ *  | Monitor Malloc                 | * 128kb (contains relocated environment)
+ *  |--------------------------------|
+ *  | Monitor/kernel STACK           | * 64kb
+ *  |--------------------------------|
+ *  | Page Table for MMU systems     | * 2k
+ *  |--------------------------------|
+ *  | PROM Code accessed from Linux  | * 6kb-128b
+ *  |--------------------------------|
+ *  | Global data (avail from kernel)| * 128b
+ *  |--------------------------------|
+ *
+ */
+
+/*
+ * Flash configuration (8,16 or 32 MB)
+ * TEXT base always at 0xFFF00000
+ * ENV_ADDR always at  0xFFF40000
+ * FLASH_BASE at 0xFC000000 for 64 MB
+ *               0xFE000000 for 32 MB
+ *               0xFF000000 for 16 MB
+ *               0xFF800000 for  8 MB
+ */
+/*#define CFG_NO_FLASH         1*/
+#define CFG_FLASH_BASE         0x00000000
+#define CFG_FLASH_SIZE         0x00400000      /* FPGA Bit file is in top of FLASH, we only ues the bottom 4Mb */
+
+#define PHYS_FLASH_SECT_SIZE   0x00010000      /* 64 KB sectors */
+#define CFG_MAX_FLASH_SECT     256     /* max num of sects on one chip */
+#define CFG_MAX_FLASH_BANKS    1       /* max num of memory banks      */
+
+#define CFG_FLASH_ERASE_TOUT   240000  /* Flash Erase Timeout (in ms)  */
+#define CFG_FLASH_WRITE_TOUT   500     /* Flash Write Timeout (in ms)  */
+#define CFG_FLASH_LOCK_TOUT    5       /* Timeout for Flash Set Lock Bit (in ms) */
+#define CFG_FLASH_UNLOCK_TOUT  10000   /* Timeout for Flash Clear Lock Bits (in ms) */
+#define CFG_FLASH_PROTECTION   /* "Real" (hardware) sectors protection */
+
+/*** CFI CONFIG ***/
+#define CFG_FLASH_CFI_WIDTH    FLASH_CFI_8BIT
+#define CFG_FLASH_CFI_DRIVER
+#define CFG_FLASH_CFI
+/* Bypass cache when reading regs from flash memory */
+#define CFG_FLASH_CFI_BYPASS_READ
+/* Buffered writes (32byte/go) instead of single accesses */
+#define CFG_FLASH_USE_BUFFER_WRITE
+
+/*
+ * Environment settings
+ */
+/*#define CFG_ENV_IS_NOWHERE 1*/
+#define CFG_ENV_IS_IN_FLASH    1
+/* CFG_ENV_ADDR need to be at sector boundary */
+#define CFG_ENV_SIZE           0x8000
+#define CFG_ENV_SECT_SIZE      0x20000
+#define CFG_ENV_ADDR           (CFG_FLASH_BASE+CFG_FLASH_SIZE-CFG_ENV_SECT_SIZE)
+#define CONFIG_ENV_OVERWRITE   1
+
+/*
+ * Memory map
+ */
+#define CFG_SDRAM_BASE         0x40000000
+#define CFG_SDRAM_SIZE         0x02000000
+#define CFG_SDRAM_END          (CFG_SDRAM_BASE+CFG_SDRAM_SIZE)
+
+/* no SRAM available */
+#undef CFG_SRAM_BASE
+#undef CFG_SRAM_SIZE
+
+#define CFG_RAM_BASE CFG_SDRAM_BASE
+#define CFG_RAM_SIZE CFG_SDRAM_SIZE
+#define CFG_RAM_END CFG_SDRAM_END
+
+#define CFG_GBL_DATA_SIZE      128     /* size in bytes reserved for initial data */
+#define CFG_GBL_DATA_OFFSET    (CFG_SDRAM_END - CFG_GBL_DATA_SIZE)
+
+#define CFG_PROM_SIZE          (8192-CFG_GBL_DATA_SIZE)
+#define CFG_PROM_OFFSET                (CFG_GBL_DATA_OFFSET-CFG_PROM_SIZE)
+
+#define CFG_INIT_SP_OFFSET     (CFG_PROM_OFFSET-32)
+#define CFG_STACK_SIZE         (0x10000-32)
+
+#define CFG_MONITOR_BASE    TEXT_BASE
+#if (CFG_MONITOR_BASE < CFG_FLASH_BASE)
+#   define CFG_RAMBOOT         1
+#endif
+
+#define CFG_MONITOR_LEN                (512 << 10)     /* Reserve 512 kB for Monitor   */
+#define CFG_MALLOC_LEN         (128 << 10)     /* Reserve 128 kB for malloc()  */
+#define CFG_BOOTMAPSZ          (8 << 20)       /* Initial Memory map for Linux */
+
+#define CFG_MALLOC_END         (CFG_INIT_SP_OFFSET-CFG_STACK_SIZE)
+#define CFG_MALLOC_BASE                (CFG_MALLOC_END-CFG_MALLOC_LEN)
+
+/* relocated monitor area */
+#define CFG_RELOC_MONITOR_MAX_END   CFG_MALLOC_BASE
+#define CFG_RELOC_MONITOR_BASE     (CFG_RELOC_MONITOR_MAX_END-CFG_MONITOR_LEN)
+
+/* make un relocated address from relocated address */
+#define UN_RELOC(address) (address-(CFG_RELOC_MONITOR_BASE-TEXT_BASE))
+
+/*
+ * Ethernet configuration uses on board SMC91C111, however if a mezzanine
+ * with a PHY is attached the GRETH can be used on this board.
+ * Define USE_GRETH in order to use the mezzanine provided PHY with the
+ * onchip GRETH network MAC, note that this is not supported by the
+ * template design.
+ */
+#ifndef USE_GRETH
+
+/* USE SMC91C111 MAC */
+#define CONFIG_DRIVER_SMC91111          1
+#define CONFIG_SMC91111_BASE           0x20000300      /* chip select 3         */
+#define CONFIG_SMC_USE_32_BIT          1       /* 32 bit bus  */
+#undef  CONFIG_SMC_91111_EXT_PHY       /* we use internal phy   */
+/*#define CONFIG_SHOW_ACTIVITY*/
+#define CONFIG_NET_RETRY_COUNT         10      /* # of retries          */
+
+#else
+
+/* USE GRETH Ethernet Driver */
+#define CONFIG_NET_MULTI       1
+#define CONFIG_GRETH   1
+
+/* Default GRETH Ethernet HARDWARE address */
+#define GRETH_HWADDR_0 0x00
+#define GRETH_HWADDR_1 0x00
+#define GRETH_HWADDR_2 0x7a
+#define GRETH_HWADDR_3 0xcc
+#define GRETH_HWADDR_4 0x00
+#define GRETH_HWADDR_5 0x13
+#endif
+
+#define CONFIG_ETHADDR   00:00:7a:cc:00:13
+#define CONFIG_PHY_ADDR         0x00
+
+/*
+ * Miscellaneous configurable options
+ */
+#define CFG_LONGHELP           /* undef to save memory     */
+#define CFG_PROMPT             "=> "   /* Monitor Command Prompt   */
+#if defined(CONFIG_CMD_KGDB)
+#define CFG_CBSIZE             1024    /* Console I/O Buffer Size  */
+#else
+#define CFG_CBSIZE             256     /* Console I/O Buffer Size  */
+#endif
+#define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16)  /* Print Buffer Size */
+#define CFG_MAXARGS            16      /* max number of command args   */
+#define CFG_BARGSIZE           CFG_CBSIZE      /* Boot Argument Buffer Size    */
+
+#define CFG_MEMTEST_START      0x00100000      /* memtest works on */
+#define CFG_MEMTEST_END                0x00f00000      /* 1 ... 15 MB in DRAM  */
+
+#define CFG_LOAD_ADDR          0x100000        /* default load address */
+
+#define CFG_HZ                 1000    /* decrementer freq: 1 ms ticks */
+
+/*-----------------------------------------------------------------------
+ * USB stuff
+ *-----------------------------------------------------------------------
+ */
+#define CONFIG_USB_CLOCK       0x0001BBBB
+#define CONFIG_USB_CONFIG      0x00005000
+
+/***** Gaisler GRLIB IP-Cores Config ********/
+
+/* AMBA Plug & Play info display on startup */
+/*#define CFG_AMBAPP_PRINT_ON_STARTUP*/
+
+#define CFG_GRLIB_SDRAM    0
+
+/* See, GRLIB Docs (grip.pdf) on how to set up
+ * These the memory controller registers.
+ */
+#define CFG_GRLIB_MEMCFG1  (0x10f800ff | (1<<11))
+#define CFG_GRLIB_MEMCFG2  0x00000000
+#define CFG_GRLIB_MEMCFG3  0x00000000
+
+#define CFG_GRLIB_FT_MEMCFG1  (0x10f800ff | (1<<11))
+#define CFG_GRLIB_FT_MEMCFG2  0x00000000
+#define CFG_GRLIB_FT_MEMCFG3  0x00000000
+
+#define CFG_GRLIB_DDR_CFG  0xa900830a
+
+#define CFG_GRLIB_DDR2_CFG1 0x00000000
+#define CFG_GRLIB_DDR2_CFG3 0x00000000
+
+/* Calculate scaler register value from default baudrate */
+#define CFG_GRLIB_APBUART_SCALER \
+ ((((CONFIG_SYS_CLK_FREQ*10)/(CONFIG_BAUDRATE*8))-5)/10)
+
+/* Identification string */
+#define CONFIG_IDENT_STRING "GAISLER LEON3 EP2S60"
+
+/* default kernel command line */
+#define CONFIG_DEFAULT_KERNEL_COMMAND_LINE "console=ttyS0,38400\0\0"
+
+#endif                         /* __CONFIG_H */
diff --git a/include/configs/gr_xc3s_1500.h b/include/configs/gr_xc3s_1500.h
new file mode 100644 (file)
index 0000000..1fdef3d
--- /dev/null
@@ -0,0 +1,321 @@
+/* Configuration header file for Gaisler GR-XC3S-1500
+ * spartan board.
+ *
+ * (C) Copyright 2003-2005
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * (C) Copyright 2007
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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 __CONFIG_H__
+#define __CONFIG_H__
+
+/*
+ * High Level Configuration Options
+ * (easy to change)
+ */
+
+#define CONFIG_LEON3           /* This is an LEON3 CPU */
+#define CONFIG_LEON            1       /* This is an LEON CPU */
+#define CONFIG_GRXC3S1500      1       /* ... on GR-XC3S-1500 board */
+
+/* CPU / AMBA BUS configuration */
+#define CONFIG_SYS_CLK_FREQ    40000000        /* 40MHz */
+
+/* Number of SPARC register windows */
+#define CFG_SPARC_NWINDOWS 8
+
+/*
+ * Serial console configuration
+ */
+#define CONFIG_BAUDRATE                38400   /* ... at 38400 bps */
+#define CFG_BAUDRATE_TABLE     { 9600, 19200, 38400, 57600, 115200, 230400 }
+
+/* Partitions */
+#define CONFIG_DOS_PARTITION
+#define CONFIG_MAC_PARTITION
+#define CONFIG_ISO_PARTITION
+
+/*
+ * Supported commands
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_AMBAPP
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_IRQ
+
+/*
+ * Autobooting
+ */
+#define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds */
+
+#define CONFIG_PREBOOT "echo;" \
+       "echo Type \"run flash_nfs\" to mount root filesystem over NFS;" \
+       "echo"
+
+#undef CONFIG_BOOTARGS
+
+#define        CONFIG_EXTRA_ENV_SETTINGS                                       \
+       "netdev=eth0\0"                                                 \
+       "nfsargs=setenv bootargs console=ttyS0,38400 root=/dev/nfs rw " \
+               "nfsroot=${serverip}:${rootpath}\0"                     \
+       "ramargs=setenv bootargs console=ttyS0,${baudrate} root=/dev/ram rw\0"                  \
+       "addip=setenv bootargs ${bootargs} "                            \
+               "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}"      \
+               ":${hostname}:${netdev}:off panic=1\0"                  \
+       "flash_nfs=run nfsargs addip;"                                  \
+               "bootm ${kernel_addr}\0"                                \
+       "flash_self=run ramargs addip;"                                 \
+               "bootm ${kernel_addr} ${ramdisk_addr}\0"                \
+       "net_nfs=tftp 40000000 ${bootfile};run nfsargs addip;bootm\0"   \
+       "scratch=40200000\0"                                    \
+       "getkernel=tftpboot \$\(scratch\)\ \$\(bootfile\)\0" \
+       "bootargs=console=ttyS0,38400 root=/dev/nfs rw nfsroot=192.168.0.20:/export/rootfs ip=192.168.0.206:192.168.0.20:192.168.0.1:255.255.255.0:grxc3s1500_daniel:eth0\0" \
+       ""
+
+#define CONFIG_NETMASK 255.255.255.0
+#define CONFIG_GATEWAYIP 192.168.0.1
+#define CONFIG_SERVERIP 192.168.0.20
+#define CONFIG_IPADDR 192.168.0.206
+#define CONFIG_ROOTPATH /export/rootfs
+#define CONFIG_HOSTNAME  grxc3s1500
+#define CONFIG_BOOTFILE  /uImage
+
+#define CONFIG_BOOTCOMMAND     "run flash_self"
+
+/* Memory MAP
+ *
+ *  Flash:
+ *  |--------------------------------|
+ *  | 0x00000000 Text & Data & BSS   | *
+ *  |            for Monitor         | *
+ *  | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| *
+ *  | UNUSED / Growth                | * 256kb
+ *  |--------------------------------|
+ *  | 0x00050000 Base custom area    | *
+ *  |            kernel / FS         | *
+ *  |                                | * Rest of Flash
+ *  |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
+ *  | END-0x00008000 Environment     | * 32kb
+ *  |--------------------------------|
+ *
+ *
+ *
+ *  Main Memory:
+ *  |--------------------------------|
+ *  | UNUSED / scratch area          |
+ *  |                                |
+ *  |                                |
+ *  |                                |
+ *  |                                |
+ *  |--------------------------------|
+ *  | Monitor .Text / .DATA / .BSS   | * 256kb
+ *  | Relocated!                     | *
+ *  |--------------------------------|
+ *  | Monitor Malloc                 | * 128kb (contains relocated environment)
+ *  |--------------------------------|
+ *  | Monitor/kernel STACK           | * 64kb
+ *  |--------------------------------|
+ *  | Page Table for MMU systems     | * 2k
+ *  |--------------------------------|
+ *  | PROM Code accessed from Linux  | * 6kb-128b
+ *  |--------------------------------|
+ *  | Global data (avail from kernel)| * 128b
+ *  |--------------------------------|
+ *
+ */
+
+/*
+ * Flash configuration (8,16 or 32 MB)
+ * TEXT base always at 0xFFF00000
+ * ENV_ADDR always at  0xFFF40000
+ * FLASH_BASE at 0xFC000000 for 64 MB
+ *               0xFE000000 for 32 MB
+ *               0xFF000000 for 16 MB
+ *               0xFF800000 for  8 MB
+ */
+/*#define CFG_NO_FLASH         1*/
+#define CFG_FLASH_BASE         0x00000000
+#define CFG_FLASH_SIZE         0x00800000
+
+#define PHYS_FLASH_SECT_SIZE   0x00020000      /* 128 KB sectors */
+#define CFG_MAX_FLASH_SECT     64      /* max num of sects on one chip */
+#define CFG_MAX_FLASH_BANKS    1       /* max num of memory banks      */
+
+#define CFG_FLASH_ERASE_TOUT   240000  /* Flash Erase Timeout (in ms)  */
+#define CFG_FLASH_WRITE_TOUT   500     /* Flash Write Timeout (in ms)  */
+#define CFG_FLASH_LOCK_TOUT    5       /* Timeout for Flash Set Lock Bit (in ms) */
+#define CFG_FLASH_UNLOCK_TOUT  10000   /* Timeout for Flash Clear Lock Bits (in ms) */
+#define CFG_FLASH_PROTECTION   /* "Real" (hardware) sectors protection */
+
+/*** CFI CONFIG ***/
+#define CFG_FLASH_CFI_WIDTH    FLASH_CFI_8BIT
+#define CFG_FLASH_CFI_DRIVER
+#define CFG_FLASH_CFI
+/* Bypass cache when reading regs from flash memory */
+#define CFG_FLASH_CFI_BYPASS_READ
+/* Buffered writes (32byte/go) instead of single accesses */
+#define CFG_FLASH_USE_BUFFER_WRITE
+
+/*
+ * Environment settings
+ */
+/*#define CFG_ENV_IS_NOWHERE 1*/
+#define CFG_ENV_IS_IN_FLASH    1
+/* CFG_ENV_ADDR need to be at sector boundary */
+#define CFG_ENV_SIZE           0x8000
+#define CFG_ENV_SECT_SIZE      0x20000
+#define CFG_ENV_ADDR           (CFG_FLASH_BASE+CFG_FLASH_SIZE-CFG_ENV_SECT_SIZE)
+#define CONFIG_ENV_OVERWRITE   1
+
+/*
+ * Memory map
+ */
+#define CFG_SDRAM_BASE         0x40000000
+#define CFG_SDRAM_SIZE         0x4000000
+#define CFG_SDRAM_END          (CFG_SDRAM_BASE+CFG_SDRAM_SIZE)
+
+/* no SRAM available */
+#undef CFG_SRAM_BASE
+#undef CFG_SRAM_SIZE
+
+/* Always Run U-Boot from SDRAM */
+#define CFG_RAM_BASE CFG_SDRAM_BASE
+#define CFG_RAM_SIZE CFG_SDRAM_SIZE
+#define CFG_RAM_END CFG_SDRAM_END
+
+#define CFG_GBL_DATA_SIZE      128     /* size in bytes reserved for initial data */
+#define CFG_GBL_DATA_OFFSET    (CFG_RAM_END - CFG_GBL_DATA_SIZE)
+
+#define CFG_PROM_SIZE          (8192-CFG_GBL_DATA_SIZE)
+#define CFG_PROM_OFFSET                (CFG_GBL_DATA_OFFSET-CFG_PROM_SIZE)
+
+#define CFG_INIT_SP_OFFSET     (CFG_PROM_OFFSET-32)
+#define CFG_STACK_SIZE         (0x10000-32)
+
+#define CFG_MONITOR_BASE    TEXT_BASE
+#if (CFG_MONITOR_BASE < CFG_FLASH_BASE)
+#   define CFG_RAMBOOT         1
+#endif
+
+#define CFG_MONITOR_LEN                (256 << 10)     /* Reserve 256 kB for Monitor   */
+#define CFG_MALLOC_LEN         (128 << 10)     /* Reserve 128 kB for malloc()  */
+#define CFG_BOOTMAPSZ          (8 << 20)       /* Initial Memory map for Linux */
+
+#define CFG_MALLOC_END         (CFG_INIT_SP_OFFSET-CFG_STACK_SIZE)
+#define CFG_MALLOC_BASE                (CFG_MALLOC_END-CFG_MALLOC_LEN)
+
+/* relocated monitor area */
+#define CFG_RELOC_MONITOR_MAX_END   CFG_MALLOC_BASE
+#define CFG_RELOC_MONITOR_BASE     (CFG_RELOC_MONITOR_MAX_END-CFG_MONITOR_LEN)
+
+/* make un relocated address from relocated address */
+#define UN_RELOC(address) (address-(CFG_RELOC_MONITOR_BASE-TEXT_BASE))
+
+/*
+ * Ethernet configuration
+ */
+#define CONFIG_GRETH   1
+#define CONFIG_NET_MULTI       1
+
+/* Default GRETH Ethernet HARDWARE address */
+#define GRETH_HWADDR_0 0x00
+#define GRETH_HWADDR_1 0x00
+#define GRETH_HWADDR_2 0x7a
+#define GRETH_HWADDR_3 0xcc
+#define GRETH_HWADDR_4 0x00
+#define GRETH_HWADDR_5 0x12
+
+#define CONFIG_ETHADDR   00:00:7a:cc:00:12
+#define CONFIG_PHY_ADDR         0x00
+
+/*
+ * Miscellaneous configurable options
+ */
+#define CFG_LONGHELP           /* undef to save memory     */
+#define CFG_PROMPT             "=> "   /* Monitor Command Prompt   */
+#if defined(CONFIG_CMD_KGDB)
+#define CFG_CBSIZE             1024    /* Console I/O Buffer Size  */
+#else
+#define CFG_CBSIZE             256     /* Console I/O Buffer Size  */
+#endif
+#define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16)  /* Print Buffer Size */
+#define CFG_MAXARGS            16      /* max number of command args   */
+#define CFG_BARGSIZE           CFG_CBSIZE      /* Boot Argument Buffer Size    */
+
+#define CFG_MEMTEST_START      0x00100000      /* memtest works on */
+#define CFG_MEMTEST_END                0x00f00000      /* 1 ... 15 MB in DRAM  */
+
+#define CFG_LOAD_ADDR          0x100000        /* default load address */
+
+#define CFG_HZ                 1000    /* decrementer freq: 1 ms ticks */
+
+/*
+ * Various low-level settings
+ */
+
+/*-----------------------------------------------------------------------
+ * USB stuff
+ *-----------------------------------------------------------------------
+ */
+#define CONFIG_USB_CLOCK       0x0001BBBB
+#define CONFIG_USB_CONFIG      0x00005000
+
+/***** Gaisler GRLIB IP-Cores Config ********/
+
+/* AMBA Plug & Play info display on startup */
+/*#define CFG_AMBAPP_PRINT_ON_STARTUP*/
+
+#define CFG_GRLIB_SDRAM    0
+
+/* See, GRLIB Docs (grip.pdf) on how to set up
+ * These the memory controller registers.
+ */
+#define CFG_GRLIB_MEMCFG1   (0x000000ff | (1<<11))
+#define CFG_GRLIB_MEMCFG2   0x82206000
+#define CFG_GRLIB_MEMCFG3   0x00136000
+
+#define CFG_GRLIB_FT_MEMCFG1   (0x000000ff | (1<<11))
+#define CFG_GRLIB_FT_MEMCFG2   0x82206000
+#define CFG_GRLIB_FT_MEMCFG3   0x00136000
+
+/* no DDR controller */
+#define CFG_GRLIB_DDR_CFG   0x00000000
+
+/* no DDR2 Controller */
+#define CFG_GRLIB_DDR2_CFG1 0x00000000
+#define CFG_GRLIB_DDR2_CFG3 0x00000000
+
+/* Calculate scaler register value from default baudrate */
+#define CFG_GRLIB_APBUART_SCALER \
+ ((((CONFIG_SYS_CLK_FREQ*10)/(CONFIG_BAUDRATE*8))-5)/10)
+
+/* Identification string */
+#define CONFIG_IDENT_STRING "GAISLER LEON3 GR-XC3S-1500"
+
+/* default kernel command line */
+#define CONFIG_DEFAULT_KERNEL_COMMAND_LINE "console=ttyS0,38400\0\0"
+
+#endif                         /* __CONFIG_H */
diff --git a/include/configs/grsim.h b/include/configs/grsim.h
new file mode 100644 (file)
index 0000000..60ad396
--- /dev/null
@@ -0,0 +1,340 @@
+/* Configuration header file for LEON3 GRSIM, trying to be similar
+ * to Gaisler's GR-XC3S-1500 board.
+ *
+ * (C) Copyright 2003-2005
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * (C) Copyright 2007
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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 __CONFIG_H__
+#define __CONFIG_H__
+
+/*
+ * High Level Configuration Options
+ * (easy to change)
+ *
+ * Select between TSIM or GRSIM by setting CONFIG_GRSIM or CONFIG_TSIM to 1.
+ *
+ * TSIM command
+ *  tsim-leon3 -sdram 0 -ram 32000 -rom 8192 -mmu
+ *
+ */
+
+#define CONFIG_LEON3                   /* This is an LEON3 CPU */
+#define CONFIG_LEON            1       /* This is an LEON CPU */
+#define CONFIG_GRSIM           0       /* ... not running on GRSIM */
+#define CONFIG_TSIM            1       /* ... running on TSIM */
+
+/* CPU / AMBA BUS configuration */
+#define CONFIG_SYS_CLK_FREQ    40000000        /* 40MHz */
+
+/* Number of SPARC register windows */
+#define CFG_SPARC_NWINDOWS 8
+
+/*
+ * Serial console configuration
+ */
+#define CONFIG_BAUDRATE                38400   /* ... at 38400 bps */
+#define CFG_BAUDRATE_TABLE     { 9600, 19200, 38400, 57600, 115200, 230400 }
+
+/* Partitions */
+#define CONFIG_DOS_PARTITION
+#define CONFIG_MAC_PARTITION
+#define CONFIG_ISO_PARTITION
+
+/*
+ * Supported commands
+ */
+#define CONFIG_CMD_AMBAPP      /* AMBA Plyg&Play information   */
+#define CONFIG_CMD_AUTOSCRIPT  /* Autoscript Support           */
+#define CONFIG_CMD_BDI         /* bdinfo                       */
+#define CONFIG_CMD_CONSOLE     /* coninfo                      */
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_ECHO                /* echo arguments               */
+#define CONFIG_CMD_FPGA                /* FPGA configuration Support   */
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_ITEST       /* Integer (and string) test    */
+#define CONFIG_CMD_LOADB       /* loadb                        */
+#define CONFIG_CMD_LOADS       /* loads                        */
+#define CONFIG_CMD_MISC                /* Misc functions like sleep etc */
+#define CONFIG_CMD_NET         /* bootp, tftpboot, rarpboot    */
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_RUN         /* run command in env variable  */
+#define CONFIG_CMD_SETGETDCR   /* DCR support on 4xx           */
+#define CONFIG_CMD_XIMG                /* Load part of Multi Image     */
+
+/*
+ * Autobooting
+ */
+#define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds */
+
+#define CONFIG_PREBOOT "echo;" \
+       "echo Type \"run flash_nfs\" to mount root filesystem over NFS;" \
+       "echo"
+
+#undef CONFIG_BOOTARGS
+/*#define CFG_HUSH_PARSER 0*/
+#ifdef CFG_HUSH_PARSER
+#define        CFG_PROMPT_HUSH_PS2     "> "
+#endif
+
+#define        CONFIG_EXTRA_ENV_SETTINGS                                       \
+       "netdev=eth0\0"                                                 \
+       "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 panic=1\0"                  \
+       "flash_nfs=run nfsargs addip;"                                  \
+               "bootm ${kernel_addr}\0"                                \
+       "flash_self=run ramargs addip;"                                 \
+               "bootm ${kernel_addr} ${ramdisk_addr}\0"                \
+       "net_nfs=tftp 40000000 ${bootfile};run nfsargs addip;bootm\0"   \
+       "rootpath=/export/roofs\0"                                      \
+       "scratch=40000000\0"                                    \
+       "getkernel=tftpboot \$\(scratch\)\ \$\(bootfile\)\0" \
+       "ethaddr=00:00:7A:CC:00:12\0" \
+       "bootargs=console=ttyS0,38400" \
+       ""
+#define CONFIG_NETMASK 255.255.255.0
+#define CONFIG_GATEWAYIP 192.168.0.1
+#define CONFIG_SERVERIP 192.168.0.81
+#define CONFIG_IPADDR 192.168.0.80
+#define CONFIG_ROOTPATH /export/rootfs
+#define CONFIG_HOSTNAME  grxc3s1500
+#define CONFIG_BOOTFILE  /uImage
+
+#define CONFIG_BOOTCOMMAND     "run flash_self"
+
+/* Memory MAP
+ *
+ *  Flash:
+ *  |--------------------------------|
+ *  | 0x00000000 Text & Data & BSS   | *
+ *  |            for Monitor         | *
+ *  | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| *
+ *  | UNUSED / Growth                | * 256kb
+ *  |--------------------------------|
+ *  | 0x00050000 Base custom area    | *
+ *  |            kernel / FS         | *
+ *  |                                | * Rest of Flash
+ *  |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
+ *  | END-0x00008000 Environment     | * 32kb
+ *  |--------------------------------|
+ *
+ *
+ *
+ *  Main Memory:
+ *  |--------------------------------|
+ *  | UNUSED / scratch area          |
+ *  |                                |
+ *  |                                |
+ *  |                                |
+ *  |                                |
+ *  |--------------------------------|
+ *  | Monitor .Text / .DATA / .BSS   | * 256kb
+ *  | Relocated!                     | *
+ *  |--------------------------------|
+ *  | Monitor Malloc                 | * 128kb (contains relocated environment)
+ *  |--------------------------------|
+ *  | Monitor/kernel STACK           | * 64kb
+ *  |--------------------------------|
+ *  | Page Table for MMU systems     | * 2k
+ *  |--------------------------------|
+ *  | PROM Code accessed from Linux  | * 6kb-128b
+ *  |--------------------------------|
+ *  | Global data (avail from kernel)| * 128b
+ *  |--------------------------------|
+ *
+ */
+
+/*
+ * Flash configuration (8,16 or 32 MB)
+ * TEXT base always at 0xFFF00000
+ * ENV_ADDR always at  0xFFF40000
+ * FLASH_BASE at 0xFC000000 for 64 MB
+ *               0xFE000000 for 32 MB
+ *               0xFF000000 for 16 MB
+ *               0xFF800000 for  8 MB
+ */
+#define CFG_NO_FLASH           1
+#define CFG_FLASH_BASE         0x00000000
+#define CFG_FLASH_SIZE         0x00800000
+#define CFG_ENV_SIZE           0x8000
+
+#define CFG_ENV_ADDR           (CFG_FLASH_BASE+CFG_FLASH_SIZE-CFG_ENV_SIZE)
+
+#define PHYS_FLASH_SECT_SIZE   0x00020000      /* 128 KB sectors */
+#define CFG_MAX_FLASH_SECT     64      /* max num of sects on one chip */
+#define CFG_MAX_FLASH_BANKS    1       /* max num of memory banks      */
+
+#define CFG_FLASH_ERASE_TOUT   240000  /* Flash Erase Timeout (in ms)  */
+#define CFG_FLASH_WRITE_TOUT   500     /* Flash Write Timeout (in ms)  */
+#define CFG_FLASH_LOCK_TOUT    5       /* Timeout for Flash Set Lock Bit (in ms) */
+#define CFG_FLASH_UNLOCK_TOUT  10000   /* Timeout for Flash Clear Lock Bits (in ms) */
+
+#ifdef ENABLE_FLASH_SUPPORT
+/* For use with grsim FLASH emulation extension */
+#define CFG_FLASH_PROTECTION   /* "Real" (hardware) sectors protection */
+
+#undef CONFIG_FLASH_8BIT       /* Flash is 32-bit */
+
+/*** CFI CONFIG ***/
+#define CFG_FLASH_CFI_WIDTH    FLASH_CFI_8BIT
+#define CFG_FLASH_CFI_DRIVER
+#define CFG_FLASH_CFI
+#endif
+
+/*
+ * Environment settings
+ */
+#define CFG_ENV_IS_NOWHERE 1
+/*#define CFG_ENV_IS_IN_FLASH  0*/
+/*#define CFG_ENV_SIZE         0x8000*/
+#define CFG_ENV_SECT_SIZE      0x40000
+#define CONFIG_ENV_OVERWRITE   1
+
+/*
+ * Memory map
+ */
+#define CFG_SDRAM_BASE         0x40000000
+#define CFG_SDRAM_SIZE         0x02000000
+#define CFG_SDRAM_END          (CFG_SDRAM_BASE+CFG_SDRAM_SIZE)
+
+/* no SRAM available */
+#undef CFG_SRAM_BASE
+#undef CFG_SRAM_SIZE
+
+/* Always Run U-Boot from SDRAM */
+#define CFG_RAM_BASE CFG_SDRAM_BASE
+#define CFG_RAM_SIZE CFG_SDRAM_SIZE
+#define CFG_RAM_END CFG_SDRAM_END
+
+#define CFG_GBL_DATA_SIZE      128     /* size in bytes reserved for initial data */
+#define CFG_GBL_DATA_OFFSET    (CFG_RAM_END - CFG_GBL_DATA_SIZE)
+
+#define CFG_PROM_SIZE          (8192-CFG_GBL_DATA_SIZE)
+#define CFG_PROM_OFFSET                (CFG_GBL_DATA_OFFSET-CFG_PROM_SIZE)
+
+#define CFG_INIT_SP_OFFSET     (CFG_PROM_OFFSET-32)
+#define CFG_STACK_SIZE         (0x10000-32)
+
+#define CFG_MONITOR_BASE    TEXT_BASE
+#if (CFG_MONITOR_BASE < CFG_FLASH_BASE)
+#   define CFG_RAMBOOT         1
+#endif
+
+#define CFG_MONITOR_LEN                (256 << 10)     /* Reserve 256 kB for Monitor   */
+#define CFG_MALLOC_LEN         (128 << 10)     /* Reserve 128 kB for malloc()  */
+#define CFG_BOOTMAPSZ          (8 << 20)       /* Initial Memory map for Linux */
+
+#define CFG_MALLOC_END         (CFG_INIT_SP_OFFSET-CFG_STACK_SIZE)
+#define CFG_MALLOC_BASE                (CFG_MALLOC_END-CFG_MALLOC_LEN)
+
+/* relocated monitor area */
+#define CFG_RELOC_MONITOR_MAX_END   CFG_MALLOC_BASE
+#define CFG_RELOC_MONITOR_BASE     (CFG_RELOC_MONITOR_MAX_END-CFG_MONITOR_LEN)
+
+/* make un relocated address from relocated address */
+#define UN_RELOC(address) (address-(CFG_RELOC_MONITOR_BASE-TEXT_BASE))
+
+/*
+ * Ethernet configuration
+ */
+#define CONFIG_GRETH   1
+#define CONFIG_NET_MULTI       1
+
+/* Default HARDWARE address */
+#define GRETH_HWADDR_0 0x00
+#define GRETH_HWADDR_1 0x00
+#define GRETH_HWADDR_2 0x7A
+#define GRETH_HWADDR_3 0xcc
+#define GRETH_HWADDR_4 0x00
+#define GRETH_HWADDR_5 0x12
+
+#define CONFIG_ETHADDR   00:00:7a:cc:00:12
+
+/*
+ * Define CONFIG_GRETH_10MBIT to force GRETH at 10Mb/s
+ */
+/* #define CONFIG_GRETH_10MBIT 1 */
+#define CONFIG_PHY_ADDR                0x00
+
+/*
+ * Miscellaneous configurable options
+ */
+#define CFG_LONGHELP           /* undef to save memory     */
+#define CFG_PROMPT             "=> "   /* Monitor Command Prompt   */
+#if defined(CONFIG_CMD_KGDB)
+#define CFG_CBSIZE             1024    /* Console I/O Buffer Size  */
+#else
+#define CFG_CBSIZE             256     /* Console I/O Buffer Size  */
+#endif
+#define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16)  /* Print Buffer Size */
+#define CFG_MAXARGS            16      /* max number of command args   */
+#define CFG_BARGSIZE           CFG_CBSIZE      /* Boot Argument Buffer Size    */
+
+#define CFG_MEMTEST_START      0x00100000      /* memtest works on */
+#define CFG_MEMTEST_END                0x00f00000      /* 1 ... 15 MB in DRAM  */
+
+#define CFG_LOAD_ADDR          0x100000        /* default load address */
+
+#define CFG_HZ                 1000    /* decrementer freq: 1 ms ticks */
+
+/***** Gaisler GRLIB IP-Cores Config ********/
+
+/* AMBA Plug & Play info display on startup */
+/*#define CFG_AMBAPP_PRINT_ON_STARTUP*/
+
+#define CFG_GRLIB_SDRAM     0
+#define CFG_GRLIB_MEMCFG1   (0x000000ff | (1<<11))
+#if CONFIG_GRSIM
+/* GRSIM configuration */
+#define CFG_GRLIB_MEMCFG2   0x82206000
+#else
+/* TSIM configuration */
+#define CFG_GRLIB_MEMCFG2   0x00001820
+#endif
+#define CFG_GRLIB_MEMCFG3   0x00136000
+
+#define CFG_GRLIB_FT_MEMCFG1   (0x000000ff | (1<<11))
+#define CFG_GRLIB_FT_MEMCFG2   0x82206000
+#define CFG_GRLIB_FT_MEMCFG3   0x00136000
+
+/* no DDR controller */
+#define CFG_GRLIB_DDR_CFG   0x00000000
+
+/* no DDR2 Controller */
+#define CFG_GRLIB_DDR2_CFG1 0x00000000
+#define CFG_GRLIB_DDR2_CFG3 0x00000000
+
+#define CFG_GRLIB_APBUART_SCALER \
+ ((((CONFIG_SYS_CLK_FREQ*10)/(CONFIG_BAUDRATE*8))-5)/10)
+
+/* default kernel command line */
+#define CONFIG_DEFAULT_KERNEL_COMMAND_LINE "console=ttyS0,38400\0\0"
+
+#define CONFIG_IDENT_STRING "Gaisler GRSIM"
+
+#endif                         /* __CONFIG_H */
diff --git a/include/configs/grsim_leon2.h b/include/configs/grsim_leon2.h
new file mode 100644 (file)
index 0000000..2ad5b95
--- /dev/null
@@ -0,0 +1,349 @@
+/* Configuration header file for LEON2 GRSIM.
+ *
+ * (C) Copyright 2003-2005
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * (C) Copyright 2007
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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 __CONFIG_H__
+#define __CONFIG_H__
+
+/*
+ * High Level Configuration Options
+ * (easy to change)
+ *
+ * Select between TSIM or GRSIM by setting CONFIG_GRSIM or CONFIG_TSIM to 1.
+ *
+ * TSIM command
+ *  tsim-leon -sdram 0 -ram 32000 -rom 8192 -mmu
+ *
+ */
+
+#define CONFIG_LEON2           /* This is an LEON2 CPU */
+#define CONFIG_LEON            1       /* This is an LEON CPU */
+#define CONFIG_GRSIM           0       /* ... not running on GRSIM */
+#define CONFIG_TSIM            1       /* ... running on TSIM */
+
+/* CPU / AMBA BUS configuration */
+#define CONFIG_SYS_CLK_FREQ    40000000        /* 40MHz */
+
+/* Number of SPARC register windows */
+#define CFG_SPARC_NWINDOWS 8
+
+/*
+ * Serial console configuration
+ */
+#define CONFIG_BAUDRATE                38400   /* ... at 38400 bps */
+#define CFG_BAUDRATE_TABLE     { 9600, 19200, 38400, 57600, 115200, 230400 }
+
+/* Partitions */
+#define CONFIG_DOS_PARTITION
+#define CONFIG_MAC_PARTITION
+#define CONFIG_ISO_PARTITION
+
+/*
+ * Supported commands
+ */
+#define CONFIG_CMD_AUTOSCRIPT  /* Autoscript Support           */
+#define CONFIG_CMD_BDI         /* bdinfo                       */
+#define CONFIG_CMD_CONSOLE     /* coninfo                      */
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_ECHO                /* echo arguments               */
+#define CONFIG_CMD_FPGA                /* FPGA configuration Support   */
+#define CONFIG_CMD_IRQ
+#define CONFIG_CMD_ITEST       /* Integer (and string) test    */
+#define CONFIG_CMD_LOADB       /* loadb                        */
+#define CONFIG_CMD_LOADS       /* loads                        */
+#define CONFIG_CMD_MISC                /* Misc functions like sleep etc */
+#define CONFIG_CMD_REGINFO
+#define CONFIG_CMD_RUN         /* run command in env variable  */
+#define CONFIG_CMD_SETGETDCR   /* DCR support on 4xx           */
+#define CONFIG_CMD_XIMG                /* Load part of Multi Image     */
+
+/*
+ * Autobooting
+ */
+#define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds */
+
+#define CONFIG_PREBOOT "echo;" \
+       "echo Type \"run flash_nfs\" to mount root filesystem over NFS;" \
+       "echo"
+
+#undef CONFIG_BOOTARGS
+/*#define CFG_HUSH_PARSER 0*/
+#ifdef CFG_HUSH_PARSER
+#define        CFG_PROMPT_HUSH_PS2     "> "
+#endif
+
+#define        CONFIG_EXTRA_ENV_SETTINGS                                       \
+       "netdev=eth0\0"                                                 \
+       "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 panic=1\0"                  \
+       "flash_nfs=run nfsargs addip;"                                  \
+               "bootm ${kernel_addr}\0"                                \
+       "flash_self=run ramargs addip;"                                 \
+               "bootm ${kernel_addr} ${ramdisk_addr}\0"                \
+       "net_nfs=tftp 40000000 ${bootfile};run nfsargs addip;bootm\0"   \
+       "rootpath=/export/roofs\0"                                      \
+       "scratch=40000000\0"                                    \
+       "getkernel=tftpboot \$\(scratch\)\ \$\(bootfile\)\0" \
+       "ethaddr=00:00:7A:CC:00:12\0" \
+       "bootargs=console=ttyS0,38400" \
+       ""
+#define CONFIG_NETMASK 255.255.255.0
+#define CONFIG_GATEWAYIP 192.168.0.1
+#define CONFIG_SERVERIP 192.168.0.81
+#define CONFIG_IPADDR 192.168.0.80
+#define CONFIG_ROOTPATH /export/rootfs
+#define CONFIG_HOSTNAME  grxc3s1500
+#define CONFIG_BOOTFILE  /uImage
+
+#define CONFIG_BOOTCOMMAND     "run flash_self"
+
+/* Memory MAP
+ *
+ *  Flash:
+ *  |--------------------------------|
+ *  | 0x00000000 Text & Data & BSS   | *
+ *  |            for Monitor         | *
+ *  | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| *
+ *  | UNUSED / Growth                | * 256kb
+ *  |--------------------------------|
+ *  | 0x00050000 Base custom area    | *
+ *  |            kernel / FS         | *
+ *  |                                | * Rest of Flash
+ *  |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
+ *  | END-0x00008000 Environment     | * 32kb
+ *  |--------------------------------|
+ *
+ *
+ *
+ *  Main Memory:
+ *  |--------------------------------|
+ *  | UNUSED / scratch area          |
+ *  |                                |
+ *  |                                |
+ *  |                                |
+ *  |                                |
+ *  |--------------------------------|
+ *  | Monitor .Text / .DATA / .BSS   | * 256kb
+ *  | Relocated!                     | *
+ *  |--------------------------------|
+ *  | Monitor Malloc                 | * 128kb (contains relocated environment)
+ *  |--------------------------------|
+ *  | Monitor/kernel STACK           | * 64kb
+ *  |--------------------------------|
+ *  | Page Table for MMU systems     | * 2k
+ *  |--------------------------------|
+ *  | PROM Code accessed from Linux  | * 6kb-128b
+ *  |--------------------------------|
+ *  | Global data (avail from kernel)| * 128b
+ *  |--------------------------------|
+ *
+ */
+
+/*
+ * Flash configuration (8,16 or 32 MB)
+ * TEXT base always at 0xFFF00000
+ * ENV_ADDR always at  0xFFF40000
+ * FLASH_BASE at 0xFC000000 for 64 MB
+ *               0xFE000000 for 32 MB
+ *               0xFF000000 for 16 MB
+ *               0xFF800000 for  8 MB
+ */
+#define CFG_NO_FLASH           1
+#define CFG_FLASH_BASE         0x00000000
+#define CFG_FLASH_SIZE         0x00800000
+#define CFG_ENV_SIZE           0x8000
+
+#define CFG_ENV_ADDR           (CFG_FLASH_BASE+CFG_FLASH_SIZE-CFG_ENV_SIZE)
+
+#define PHYS_FLASH_SECT_SIZE   0x00020000      /* 128 KB sectors */
+#define CFG_MAX_FLASH_SECT     64      /* max num of sects on one chip */
+#define CFG_MAX_FLASH_BANKS    1       /* max num of memory banks      */
+
+#define CFG_FLASH_ERASE_TOUT   240000  /* Flash Erase Timeout (in ms)  */
+#define CFG_FLASH_WRITE_TOUT   500     /* Flash Write Timeout (in ms)  */
+#define CFG_FLASH_LOCK_TOUT    5       /* Timeout for Flash Set Lock Bit (in ms) */
+#define CFG_FLASH_UNLOCK_TOUT  10000   /* Timeout for Flash Clear Lock Bits (in ms) */
+
+#ifdef ENABLE_FLASH_SUPPORT
+/* For use with grsim FLASH emulation extension */
+#define CFG_FLASH_PROTECTION   /* "Real" (hardware) sectors protection */
+
+#undef CONFIG_FLASH_8BIT       /* Flash is 32-bit */
+
+/*** CFI CONFIG ***/
+#define CFG_FLASH_CFI_WIDTH    FLASH_CFI_8BIT
+#define CFG_FLASH_CFI_DRIVER
+#define CFG_FLASH_CFI
+#endif
+
+/*
+ * Environment settings
+ */
+#define CFG_ENV_IS_NOWHERE 1
+/*#define CFG_ENV_IS_IN_FLASH  0*/
+/*#define CFG_ENV_SIZE         0x8000*/
+#define CFG_ENV_SECT_SIZE      0x40000
+#define CONFIG_ENV_OVERWRITE   1
+
+/*
+ * Memory map
+ */
+#define CFG_SDRAM_BASE         0x40000000
+#define CFG_SDRAM_SIZE         0x00800000
+#define CFG_SDRAM_END          (CFG_SDRAM_BASE+CFG_SDRAM_SIZE)
+
+/* no SRAM available */
+#undef CFG_SRAM_BASE
+#undef CFG_SRAM_SIZE
+
+
+/* Always Run U-Boot from SDRAM */
+#define CFG_RAM_BASE CFG_SDRAM_BASE
+#define CFG_RAM_SIZE CFG_SDRAM_SIZE
+#define CFG_RAM_END CFG_SDRAM_END
+
+#define CFG_GBL_DATA_SIZE      128     /* size in bytes reserved for initial data */
+#define CFG_GBL_DATA_OFFSET    (CFG_RAM_END - CFG_GBL_DATA_SIZE)
+
+#define CFG_PROM_SIZE          (8192-CFG_GBL_DATA_SIZE)
+#define CFG_PROM_OFFSET                (CFG_GBL_DATA_OFFSET-CFG_PROM_SIZE)
+
+#define CFG_INIT_SP_OFFSET     (CFG_PROM_OFFSET-32)
+#define CFG_STACK_SIZE         (0x10000-32)
+
+#define CFG_MONITOR_BASE    TEXT_BASE
+#if (CFG_MONITOR_BASE < CFG_FLASH_BASE)
+#   define CFG_RAMBOOT         1
+#endif
+
+#define CFG_MONITOR_LEN                (256 << 10)     /* Reserve 256 kB for Monitor   */
+#define CFG_MALLOC_LEN         (128 << 10)     /* Reserve 128 kB for malloc()  */
+#define CFG_BOOTMAPSZ          (8 << 20)       /* Initial Memory map for Linux */
+
+#define CFG_MALLOC_END         (CFG_INIT_SP_OFFSET-CFG_STACK_SIZE)
+#define CFG_MALLOC_BASE                (CFG_MALLOC_END-CFG_MALLOC_LEN)
+
+/* relocated monitor area */
+#define CFG_RELOC_MONITOR_MAX_END   CFG_MALLOC_BASE
+#define CFG_RELOC_MONITOR_BASE     (CFG_RELOC_MONITOR_MAX_END-CFG_MONITOR_LEN)
+
+/* make un relocated address from relocated address */
+#define UN_RELOC(address) (address-(CFG_RELOC_MONITOR_BASE-TEXT_BASE))
+
+/*
+ * Ethernet configuration
+ */
+/*#define CONFIG_GRETH 1*/
+/*#define CONFIG_NET_MULTI     1*/
+
+/* Default HARDWARE address */
+#define GRETH_HWADDR_0 0x00
+#define GRETH_HWADDR_1 0x00
+#define GRETH_HWADDR_2 0x7A
+#define GRETH_HWADDR_3 0xcc
+#define GRETH_HWADDR_4 0x00
+#define GRETH_HWADDR_5 0x12
+
+#define CONFIG_ETHADDR   00:00:7a:cc:00:12
+
+/*
+ * Define CONFIG_GRETH_10MBIT to force GRETH at 10Mb/s
+ */
+/* #define CONFIG_GRETH_10MBIT 1 */
+#define CONFIG_PHY_ADDR                0x00
+
+/*
+ * Miscellaneous configurable options
+ */
+#define CFG_LONGHELP           /* undef to save memory     */
+#define CFG_PROMPT             "=> "   /* Monitor Command Prompt   */
+#if defined(CONFIG_CMD_KGDB)
+#define CFG_CBSIZE             1024    /* Console I/O Buffer Size  */
+#else
+#define CFG_CBSIZE             256     /* Console I/O Buffer Size  */
+#endif
+#define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16)  /* Print Buffer Size */
+#define CFG_MAXARGS            16      /* max number of command args   */
+#define CFG_BARGSIZE           CFG_CBSIZE      /* Boot Argument Buffer Size    */
+
+#define CFG_MEMTEST_START      0x00100000      /* memtest works on */
+#define CFG_MEMTEST_END                0x00f00000      /* 1 ... 15 MB in DRAM  */
+
+#define CFG_LOAD_ADDR          0x100000        /* default load address */
+
+#define CFG_HZ                 1000    /* decrementer freq: 1 ms ticks */
+
+/***** Gaisler GRLIB IP-Cores Config ********/
+
+#define CFG_GRLIB_SDRAM    0
+#define CFG_GRLIB_MEMCFG1  (0x000000ff | (1<<11))
+#if CONFIG_GRSIM
+#define CFG_GRLIB_MEMCFG2  0x82206000
+#else
+#define CFG_GRLIB_MEMCFG2  0x00001820
+#endif
+#define CFG_GRLIB_MEMCFG3  0x00136000
+
+/*** LEON2 UART 1 ***/
+#define CFG_LEON2_UART1_SCALER \
+       ((((CONFIG_SYS_CLK_FREQ*10)/(CONFIG_BAUDRATE*8))-5)/10)
+
+/* UART1 Define to 1 or 0 */
+#define LEON2_UART1_LOOPBACK_ENABLE 0
+#define LEON2_UART1_FLOWCTRL_ENABLE 0
+#define LEON2_UART1_PARITY_ENABLE 0
+#define LEON2_UART1_ODDPAR_ENABLE 0
+
+/*** LEON2 UART 2 ***/
+
+#define CFG_LEON2_UART2_SCALER \
+       ((((CONFIG_SYS_CLK_FREQ*10)/(CONFIG_BAUDRATE*8))-5)/10)
+
+/* UART2 Define to 1 or 0 */
+#define LEON2_UART2_LOOPBACK_ENABLE 0
+#define LEON2_UART2_FLOWCTRL_ENABLE 0
+#define LEON2_UART2_PARITY_ENABLE 0
+#define LEON2_UART2_ODDPAR_ENABLE 0
+
+#define LEON_CONSOLE_UART1 1
+#define LEON_CONSOLE_UART2 2
+
+/* Use UART2 as console */
+#define LEON2_CONSOLE_SELECT LEON_CONSOLE_UART1
+
+/* LEON2 I/O Port */
+/*#define LEON2_IO_PORT_DIR 0x0000aa00*/
+
+/* default kernel command line */
+#define CONFIG_DEFAULT_KERNEL_COMMAND_LINE "console=ttyS0,38400\0\0"
+
+#define CONFIG_IDENT_STRING "Gaisler GRSIM LEON2"
+
+#endif                         /* __CONFIG_H */
index 4347625..e5a8897 100644 (file)
 #define CONFIG_PCI             1
 #define CONFIG_PCI_PNP         1
 #define CONFIG_PCI_SCAN_SHOW   1
+#define CONFIG_PCIAUTO_SKIP_HOST_BRIDGE        1
 
 #define CONFIG_PCI_MEM_BUS     0x40000000
 #define CONFIG_PCI_MEM_PHYS    CONFIG_PCI_MEM_BUS
index a15f69a..2ed51f7 100644 (file)
 #define CONFIG_MCFFEC
 #ifdef CONFIG_MCFFEC
 #      define CONFIG_NET_MULTI         1
-#define CONFIG_MII             1
+#      define CONFIG_MII               1
+#      define CONFIG_MII_INIT          1
 #      define CFG_DISCOVER_PHY
 #      define CFG_RX_ETH_BUFFER        8
 #      define CFG_FAULT_ECHO_LINK_DOWN
diff --git a/include/configs/imx31_litekit.h b/include/configs/imx31_litekit.h
new file mode 100644 (file)
index 0000000..5e97cfa
--- /dev/null
@@ -0,0 +1,166 @@
+/*
+ * (C) Copyright 2004
+ * Texas Instruments.
+ * Richard Woodruff <r-woodruff2@ti.com>
+ * Kshitij Gupta <kshitij@ti.com>
+ *
+ * Configuration settings for the LogicPD i.MX31 Litekit 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
+
+#include <asm/arch/mx31-regs.h>
+
+ /* High Level Configuration Options */
+#define CONFIG_ARM1136         1    /* This is an arm1136 CPU core */
+#define CONFIG_MX31            1    /* in a mx31 */
+#define CONFIG_MX31_HCLK_FREQ  26000000
+#define CONFIG_MX31_CLK32      32000
+
+#define CONFIG_DISPLAY_CPUINFO
+#define CONFIG_DISPLAY_BOARDINFO
+
+/* Temporarily disabled */
+#if 0
+#define CONFIG_OF_LIBFDT               1
+#define CONFIG_FIT                     1
+#define CONFIG_FIT_VERBOSE             1
+#endif
+
+#define CONFIG_CMDLINE_TAG             1    /* enable passing of ATAGs */
+#define CONFIG_SETUP_MEMORY_TAGS       1
+#define CONFIG_INITRD_TAG              1
+
+/*
+ * Size of malloc() pool
+ */
+#define CFG_MALLOC_LEN         (CFG_ENV_SIZE + 128 * 1024)
+#define CFG_GBL_DATA_SIZE      128  /* size in bytes reserved for initial data */
+
+/*
+ * Hardware drivers
+ */
+
+#define CONFIG_MX31_UART       1
+#define CFG_MX31_UART1         1
+
+/* allow to overwrite serial and ethaddr */
+#define CONFIG_ENV_OVERWRITE
+#define CONFIG_CONS_INDEX      1
+#define CONFIG_BAUDRATE                115200
+#define CFG_BAUDRATE_TABLE     {9600, 19200, 38400, 57600, 115200}
+
+/***********************************************************
+ * Command definition
+ ***********************************************************/
+
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+
+#define CONFIG_BOOTDELAY       3
+
+#define CONFIG_NETMASK         255.255.255.0
+#define CONFIG_IPADDR          192.168.23.168
+#define CONFIG_SERVERIP                192.168.23.2
+
+#define        CONFIG_EXTRA_ENV_SETTINGS                                                                                       \
+       "bootargs_base=setenv bootargs console=ttySMX0,115200\0"                                                        \
+       "bootargs_nfs=setenv bootargs $(bootargs) root=/dev/nfs ip=dhcp nfsroot=$(serverip):$(nfsrootfs),v3,tcp\0"      \
+       "bootcmd=run bootcmd_net\0"                                                                                     \
+       "bootcmd_net=run bootargs_base bootargs_mtd bootargs_nfs; tftpboot 0x80000000 uImage-mx31; bootm\0"             \
+       "prg_uboot=tftpboot 0x80000000 u-boot-imx31_litekit.bin; protect off all; erase 0xa00d0000 0xa01effff; cp.b 0x80000000 0xa00d0000 $(filesize)\0"
+
+
+#define CONFIG_DRIVER_SMC911X          1
+#define CONFIG_DRIVER_SMC911X_BASE     (CS4_BASE + 0x00020000)
+#define CONFIG_DRIVER_SMC911X_32_BIT   1
+
+/*
+ * Miscellaneous configurable options
+ */
+#define CFG_LONGHELP           /* undef to save memory */
+#define CFG_PROMPT             "uboot> "
+#define CFG_CBSIZE             256  /* Console I/O Buffer Size */
+/* Print Buffer Size */
+#define CFG_PBSIZE             (CFG_CBSIZE+sizeof(CFG_PROMPT)+16)
+#define CFG_MAXARGS            16          /* max number of command args */
+#define CFG_BARGSIZE           CFG_CBSIZE  /* Boot Argument Buffer Size */
+
+#define CFG_MEMTEST_START      0  /* memtest works on */
+#define CFG_MEMTEST_END                0x10000
+
+#undef CFG_CLKS_IN_HZ          /* everything, incl board info, in Hz */
+
+#define CFG_LOAD_ADDR          0 /* default load address */
+
+#define CFG_HZ                 32000
+
+#define CONFIG_CMDLINE_EDITING 1
+
+/*-----------------------------------------------------------------------
+ * Stack sizes
+ *
+ * The stack sizes are set up in start.S using the settings below
+ */
+#define CONFIG_STACKSIZE       (128 * 1024) /* regular stack */
+
+/*-----------------------------------------------------------------------
+ * Physical Memory Map
+ */
+#define CONFIG_NR_DRAM_BANKS   1
+#define PHYS_SDRAM_1           CSD0_BASE
+#define PHYS_SDRAM_1_SIZE      (128 * 1024 * 1024)
+
+/*-----------------------------------------------------------------------
+ * FLASH and environment organization
+ */
+#define CFG_FLASH_BASE         CS0_BASE
+#define CFG_MAX_FLASH_BANKS    1           /* max number of memory banks */
+#define CFG_MAX_FLASH_SECT     128          /* max number of sectors on one chip */
+#define CFG_MONITOR_BASE       CFG_FLASH_BASE /* Monitor at beginning of flash */
+
+#define CFG_ENV_ADDR           (CFG_FLASH_BASE + 0x001f0000)
+#define        CFG_ENV_IS_IN_FLASH     1
+#define CFG_ENV_SECT_SIZE      (64 * 1024)
+#define CFG_ENV_SIZE           (64 * 1024)
+
+/*-----------------------------------------------------------------------
+ * CFI FLASH driver setup
+ */
+#define CFG_FLASH_CFI          1       /* Flash memory is CFI compliant */
+#define CFG_FLASH_CFI_DRIVER   1       /* Use drivers/cfi_flash.c */
+#define CFG_FLASH_USE_BUFFER_WRITE 1   /* Use buffered writes (~10x faster) */
+#define CFG_FLASH_PROTECTION   1       /* Use hardware sector protection */
+
+/* timeout values are in ticks */
+#define CFG_FLASH_ERASE_TOUT   (100*CFG_HZ) /* Timeout for Flash Erase */
+#define CFG_FLASH_WRITE_TOUT   (100*CFG_HZ) /* Timeout for Flash Write */
+
+/*
+ * JFFS2 partitions
+ */
+#undef CONFIG_JFFS2_CMDLINE
+#define CONFIG_JFFS2_DEV       "nor0"
+
+#endif /* __CONFIG_H */
diff --git a/include/configs/imx31_phycore.h b/include/configs/imx31_phycore.h
new file mode 100644 (file)
index 0000000..7d6aaa1
--- /dev/null
@@ -0,0 +1,181 @@
+/*
+ * (C) Copyright 2004
+ * Texas Instruments.
+ * Richard Woodruff <r-woodruff2@ti.com>
+ * Kshitij Gupta <kshitij@ti.com>
+ *
+ * Configuration settings for the phyCORE-i.MX31 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_ARM1136         1    /* This is an arm1136 CPU core */
+#define CONFIG_MX31            1    /* in a mx31 */
+#define CONFIG_MX31_HCLK_FREQ  26000000
+#define CONFIG_MX31_CLK32      32000
+
+#define CONFIG_DISPLAY_CPUINFO
+#define CONFIG_DISPLAY_BOARDINFO
+
+/* Temporarily disabled */
+#if 0
+#define CONFIG_OF_LIBFDT               1
+#define CONFIG_FIT                     1
+#define CONFIG_FIT_VERBOSE             1
+#endif
+
+#define CONFIG_CMDLINE_TAG             1    /* enable passing of ATAGs */
+#define CONFIG_SETUP_MEMORY_TAGS       1
+#define CONFIG_INITRD_TAG              1
+
+/*
+ * Size of malloc() pool
+ */
+#define CFG_MALLOC_LEN         (CFG_ENV_SIZE + 128 * 1024)
+#define CFG_GBL_DATA_SIZE      128  /* size in bytes reserved for initial data */
+
+/*
+ * Hardware drivers
+ */
+
+#define CONFIG_HARD_I2C                1
+#define CONFIG_I2C_MXC         1
+#define CFG_I2C_MX31_PORT2     1
+#define CFG_I2C_SPEED          100000
+#define CFG_I2C_SLAVE          0xfe
+
+#define CONFIG_MX31_UART       1
+#define CFG_MX31_UART1         1
+
+/* allow to overwrite serial and ethaddr */
+#define CONFIG_ENV_OVERWRITE
+#define CONFIG_CONS_INDEX      1
+#define CONFIG_BAUDRATE                115200
+#define CFG_BAUDRATE_TABLE     {9600, 19200, 38400, 57600, 115200}
+
+/***********************************************************
+ * Command definition
+ ***********************************************************/
+
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_I2C
+
+#define CONFIG_BOOTDELAY       3
+
+#define MTDPARTS_DEFAULT       "mtdparts=physmap-flash.0:128k(uboot)ro,1536k(kernel),-(root)"
+
+#define CONFIG_NETMASK         255.255.255.0
+#define CONFIG_IPADDR          192.168.23.168
+#define CONFIG_SERVERIP                192.168.23.2
+
+#define        CONFIG_EXTRA_ENV_SETTINGS                                                                                       \
+       "bootargs_base=setenv bootargs console=ttySMX0,115200\0"                                                        \
+       "bootargs_nfs=setenv bootargs $(bootargs) root=/dev/nfs ip=dhcp nfsroot=$(serverip):$(nfsrootfs),v3,tcp\0"      \
+       "bootargs_flash=setenv bootargs $(bootargs) root=/dev/mtdblock2 rootfstype=jffs2"                               \
+       "bootargs_mtd=setenv bootargs $(bootargs) $(mtdparts)"                                                          \
+       "bootcmd=run bootcmd_net\0"                                                                                     \
+       "bootcmd_net=run bootargs_base bootargs_mtd bootargs_nfs; tftpboot 0x80000000 $(uimage); bootm\0"               \
+       "bootcmd_flash=run bootargs_base bootargs_mtd bootargs_flash; bootm 0x80000000\0"                               \
+       "unlock=yes\0"                                                                                                  \
+       "mtdparts=" MTDPARTS_DEFAULT "\0"                                                                               \
+       "prg_uboot=tftpboot 0x80000000 $(uboot); protect off 0xa0000000 +0x20000; erase 0xa0000000 +0x20000; cp.b 0x80000000 0xa0000000 $(filesize)\0" \
+       "prg_kernel=tftpboot 0x80000000 $(uimage); erase 0xa0040000 +0x180000; cp.b 0x80000000 0xa0040000 $(filesize)\0"        \
+       "prg_jffs2=tftpboot 0x80000000 $(jffs2); erase 0xa01c0000 0xa1ffffff; cp.b 0x80000000 0xa01c0000 $(filesize)\0"
+
+
+#define CONFIG_DRIVER_SMC911X          1
+#define CONFIG_DRIVER_SMC911X_BASE     0xa8000000
+#define CONFIG_DRIVER_SMC911X_32_BIT   1
+
+/*
+ * Miscellaneous configurable options
+ */
+#define CFG_LONGHELP           /* undef to save memory */
+#define CFG_PROMPT             "uboot> "
+#define CFG_CBSIZE             256  /* Console I/O Buffer Size */
+/* Print Buffer Size */
+#define CFG_PBSIZE             (CFG_CBSIZE+sizeof(CFG_PROMPT)+16)
+#define CFG_MAXARGS            16          /* max number of command args */
+#define CFG_BARGSIZE           CFG_CBSIZE  /* Boot Argument Buffer Size */
+
+#define CFG_MEMTEST_START      0  /* memtest works on */
+#define CFG_MEMTEST_END                0x10000
+
+#define CFG_LOAD_ADDR          0 /* default load address */
+
+#define CFG_HZ                 32000
+
+#define CONFIG_CMDLINE_EDITING 1
+
+/*-----------------------------------------------------------------------
+ * Stack sizes
+ *
+ * The stack sizes are set up in start.S using the settings below
+ */
+#define CONFIG_STACKSIZE       (128 * 1024) /* regular stack */
+
+/*-----------------------------------------------------------------------
+ * Physical Memory Map
+ */
+#define CONFIG_NR_DRAM_BANKS   1
+#define PHYS_SDRAM_1           0x80000000
+#define PHYS_SDRAM_1_SIZE      (128 * 1024 * 1024)
+
+/*-----------------------------------------------------------------------
+ * FLASH and environment organization
+ */
+#define CFG_FLASH_BASE         0xa0000000
+#define CFG_MAX_FLASH_BANKS    1           /* max number of memory banks */
+#define CFG_MAX_FLASH_SECT     259          /* max number of sectors on one chip */
+#define CFG_MONITOR_BASE       CFG_FLASH_BASE /* Monitor at beginning of flash */
+
+#define        CFG_ENV_IS_IN_EEPROM            1
+#define CFG_ENV_OFFSET                 0x00    /* environment starts here     */
+#define CFG_ENV_SIZE                   4096
+#define CFG_I2C_EEPROM_ADDR            0x52
+#define CFG_EEPROM_PAGE_WRITE_BITS     5       /* 5 bits = 32 octets          */
+#define CFG_EEPROM_PAGE_WRITE_DELAY_MS 10      /* between stop and start      */
+#define CFG_I2C_EEPROM_ADDR_LEN                2       /* length of byte address      */
+
+/*-----------------------------------------------------------------------
+ * CFI FLASH driver setup
+ */
+#define CFG_FLASH_CFI          1       /* Flash memory is CFI compliant */
+#define CFG_FLASH_CFI_DRIVER   1       /* Use drivers/cfi_flash.c */
+#define CFG_FLASH_USE_BUFFER_WRITE 1   /* Use buffered writes (~10x faster) */
+#define CFG_FLASH_PROTECTION   1       /* Use hardware sector protection */
+
+/* timeout values are in ticks */
+#define CFG_FLASH_ERASE_TOUT   (100*CFG_HZ) /* Timeout for Flash Erase */
+#define CFG_FLASH_WRITE_TOUT   (100*CFG_HZ) /* Timeout for Flash Write */
+
+/*
+ * JFFS2 partitions
+ */
+#undef CONFIG_JFFS2_CMDLINE
+#define CONFIG_JFFS2_DEV       "nor0"
+
+#endif /* __CONFIG_H */
index 6f45c04..c89f041 100644 (file)
@@ -55,6 +55,7 @@
 #define CONFIG_PCI             1
 #define CONFIG_PCI_PNP         1
 #define CONFIG_PCI_SCAN_SHOW   1
+#define CONFIG_PCIAUTO_SKIP_HOST_BRIDGE        1
 
 #define CONFIG_PCI_MEM_BUS     0x40000000
 #define CONFIG_PCI_MEM_PHYS    CONFIG_PCI_MEM_BUS
index 8c6075f..0ac3e7e 100644 (file)
@@ -58,6 +58,7 @@
 #if defined(CONFIG_PCI)
 #define CONFIG_PCI_PNP         1
 #define CONFIG_PCI_SCAN_SHOW   1
+#define CONFIG_PCIAUTO_SKIP_HOST_BRIDGE        1
 
 #define CONFIG_PCI_MEM_BUS     0x40000000
 #define CONFIG_PCI_MEM_PHYS    CONFIG_PCI_MEM_BUS
index 3f4b8e6..f4cf42c 100644 (file)
                "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}"      \
                ":${hostname}:${netdev}:off panic=1\0"                  \
        "addtty=setenv bootargs ${bootargs} console=ttyS0,${baudrate}\0"\
-       "net_nfs=tftp 200000 ${bootfile};"                              \
-               "run nfsargs addip addtty;"                             \
-               "bootm 200000\0"                                        \
-       "net_nfs_fdt=tftp 200000 ${bootfile};"                          \
-               "tftp ${fdt_addr} ${fdt_file};"                         \
-               "run nfsargs addip addtty;"                             \
-               "bootm 200000 - ${fdt_addr}\0"                          \
-       "flash_nfs=run nfsargs addip addtty;"                           \
-               "bootm ${kernel_addr}\0"                                \
-       "flash_self=run ramargs addip addtty;"                          \
+       "flash_self_old=run ramargs addip addtty;"                      \
                "bootm ${kernel_addr} ${ramdisk_addr}\0"                \
+       "flash_self=run ramargs addip addtty;"                          \
+               "bootm ${kernel_addr} ${ramdisk_addr} ${fdt_addr}\0"    \
+       "flash_nfs_old=run nfsargs addip addtty;"                       \
+               "bootm ${kernel_addr}\0"                                \
+       "flash_nfs=run nfsargs addip addtty;"                           \
+               "bootm ${kernel_addr} - ${fdt_addr}\0"                  \
+       "net_nfs_old=tftp ${kernel_addr_r} ${bootfile};"                \
+               "run nfsargs addip addtty;bootm ${kernel_addr_r}\0"     \
+       "net_nfs=tftp ${kernel_addr_r} ${bootfile}; "                   \
+               "tftp ${fdt_addr_r} ${fdt_file}; "                      \
+               "run nfsargs addip addtty;"                             \
+               "bootm ${kernel_addr_r} - ${fdt_addr_r}\0"              \
        "rootpath=/opt/eldk/ppc_4xx\0"                                  \
        "bootfile=kilauea/uImage\0"                                     \
        "fdt_file=kilauea/kilauea.dtb\0"                                \
-       "fdt_addr=400000\0"                                             \
+       "kernel_addr_r=400000\0"                                        \
+       "fdt_addr_r=800000\0"                                           \
        "kernel_addr=fc000000\0"                                        \
+       "fdt_addr=fc1e0000\0"                                           \
        "ramdisk_addr=fc200000\0"                                       \
        "initrd_high=30000000\0"                                        \
        "load=tftp 200000 kilauea/u-boot.bin\0"                         \
index dcec9b0..48d73ac 100644 (file)
  * Manufacturer's information serial EEPROM parameters
  */
 #define MAN_DATA_EEPROM_ADDR   0x53    /* EEPROM I2C address           */
-#define MAN_SERIAL_NO_FIELD    2
-#define MAN_SERIAL_NO_LENGTH   13
+#define MAN_INFO_FIELD         2
+#define MAN_INFO_LENGTH                9
 #define MAN_MAC_ADDR_FIELD     3
-#define MAN_MAC_ADDR_LENGTH    17
+#define MAN_MAC_ADDR_LENGTH    12
 
 /*
  * Base addresses -- Note these are effective addresses where the actual
 #define CFG_MONITOR_LEN                (384 * 1024) /* Reserve 384 kiB for Monitor  */
 #define CFG_MALLOC_LEN         (256 * 1024) /* Reserve 256 kiB for malloc() */
 
-#define CFG_BOOT_BASE_ADDR     0xf0000000
 #define CFG_SDRAM_BASE         0x00000000      /* _must_ be 0          */
-#define CFG_FLASH_BASE         0xfc000000      /* start of FLASH       */
+#define CFG_FLASH0_SIZE                0x01000000
+#define CFG_FLASH0_ADDR                (-CFG_FLASH0_SIZE)
+#define CFG_FLASH1_TOP         0xF8000000
+#define CFG_FLASH1_MAX_SIZE    0x08000000
+#define CFG_FLASH1_ADDR                (CFG_FLASH1_TOP - CFG_FLASH1_MAX_SIZE)
+#define CFG_FLASH_BASE         CFG_FLASH1_ADDR /* start of FLASH       */
 #define CFG_MONITOR_BASE       TEXT_BASE
 #define CFG_OCM_BASE           0xe0010000      /* ocm                  */
 #define CFG_OCM_DATA_ADDR      CFG_OCM_BASE
 #define CFG_PCI_BASE           0xe0000000      /* Internal PCI regs    */
 #define CFG_PCI_MEMBASE                0x80000000      /* mapped pci memory    */
-#define CFG_PCI_MEMBASE1       CFG_PCI_MEMBASE  + 0x10000000
-#define CFG_PCI_MEMBASE2       CFG_PCI_MEMBASE1 + 0x10000000
-#define CFG_PCI_MEMBASE3       CFG_PCI_MEMBASE2 + 0x10000000
 
 /* Don't change either of these */
 #define CFG_PERIPHERAL_BASE    0xef600000      /* internal peripherals */
 /*
  * FLASH related
  */
-#define CFG_FLASH_CFI                  /* The flash is CFI compatible  */
-#define CFG_FLASH_CFI_DRIVER           /* Use common CFI driver        */
+#define CFG_FLASH_CFI                  /* The flash is CFI compatible        */
+#define CFG_FLASH_CFI_DRIVER           /* Use common CFI driver              */
+#define CONFIG_FLASH_CFI_LEGACY                /* Allow hard-coded config for FLASH0 */
 
-#define CFG_FLASH_BANKS_LIST   { CFG_FLASH_BASE }
+#define CFG_FLASH_BANKS_LIST   { CFG_FLASH1_ADDR, CFG_FLASH0_ADDR }
 
-#define CFG_MAX_FLASH_BANKS    1       /* max number of memory banks         */
-#define CFG_MAX_FLASH_SECT     512     /* max number of sectors on one chip  */
+#define CFG_MAX_FLASH_BANKS    2       /* max number of memory banks         */
+#define CFG_MAX_FLASH_SECT     1024    /* max number of sectors on one chip  */
 
 #define CFG_FLASH_ERASE_TOUT   120000  /* Timeout for Flash Erase (in ms)    */
 #define CFG_FLASH_WRITE_TOUT   500     /* Timeout for Flash Write (in ms)    */
 #define CFG_FLASH_QUIET_TEST   1       /* don't warn upon unknown flash      */
 
 #define CFG_ENV_SECT_SIZE      0x20000 /* size of one complete sector        */
-#define CFG_ENV_ADDR           ((-CFG_MONITOR_LEN)-CFG_ENV_SECT_SIZE)
+#define CFG_ENV_ADDR           (CFG_FLASH1_TOP - CFG_ENV_SECT_SIZE)
 #define        CFG_ENV_SIZE            0x2000  /* Total Size of Environment Sector   */
 
-/* Address and size of Redundant Environment Sector    */
-#define CFG_ENV_ADDR_REDUND    (CFG_ENV_ADDR-CFG_ENV_SECT_SIZE)
-#define CFG_ENV_SIZE_REDUND    (CFG_ENV_SIZE)
+/* Address and size of Redundant Environment Sector */
+#define CFG_ENV_ADDR_REDUND    (CFG_ENV_ADDR - CFG_ENV_SECT_SIZE)
+#define CFG_ENV_SIZE_REDUND    CFG_ENV_SIZE
 
 /*
  * DDR SDRAM
 #define SPD_EEPROM_ADDRESS     {0x50}
 #define CONFIG_PROG_SDRAM_TLB
 #define CFG_DRAM_TEST
+#define CFG_MEM_TOP_HIDE       (4 << 10) /* don't use last 4kbytes     */
+                                       /* 440EPx errata CHIP 11        */
 
 /*
  * I2C
 #define CFG_BOOTFILE           "bootfile=/tftpboot/korat/uImage\0"
 #define CFG_ROOTPATH           "rootpath=/opt/eldk/ppc_4xxFP\0"
 
+/* Note: kernel_addr and ramdisk_addr assume that FLASH1 is 64 MiB. */
 #define        CONFIG_EXTRA_ENV_SETTINGS                                       \
        CFG_BOOTFILE                                                    \
        CFG_ROOTPATH                                                    \
                "bootm ${kernel_addr} ${ramdisk_addr}\0"                \
        "net_nfs=tftp 200000 ${bootfile};run nfsargs addip addtty;"     \
                "bootm\0"                                               \
-       "kernel_addr=FC000000\0"                                        \
-       "ramdisk_addr=FC180000\0"                                       \
+       "kernel_addr=F4000000\0"                                        \
+       "ramdisk_addr=F4400000\0"                                       \
        "load=tftp 200000 /tftpboot/${hostname}/u-boot.bin\0"           \
        "update=protect off FFFA0000 FFFFFFFF;era FFFA0000 FFFFFFFF;"   \
                "cp.b 200000 FFFA0000 60000\0"                          \
 #define CONFIG_PHY_ADDR                2       /* PHY address, See schematics  */
 #define CONFIG_PHY_DYNAMIC_ANEG        1
 
-#define CONFIG_PHY_RESET       1       /* reset phy upon startup       */
+#undef CONFIG_PHY_RESET                        /* Don't do software PHY reset  */
 #define CONFIG_PHY_GIGE                1       /* Include GbE speed/duplex detection */
 
 #define CONFIG_HAS_ETH0
 #define CONFIG_VERSION_VARIABLE 1      /* include version env variable */
 
 /*
+ * Korat-specific options
+ */
+#define CFG_KORAT_MAN_RESET_MS 10000   /* timeout for manufacturer reset */
+
+/*
  * PCI stuff
  */
 /* General PCI */
  */
 
 /* Memory Bank 0 (NOR-FLASH) initialization                            */
+#if CFG_FLASH0_SIZE == 0x01000000
+#define CFG_EBC_PB0AP          0x04017300
+#define CFG_EBC_PB0CR          (CFG_FLASH0_ADDR | 0x0009A000)
+#elif CFG_FLASH0_SIZE == 0x04000000
 #define CFG_EBC_PB0AP          0x04017300
-#define CFG_EBC_PB0CR          (CFG_FLASH_BASE | 0x000DA000)
+#define CFG_EBC_PB0CR          (CFG_FLASH0_ADDR | 0x000DA000)
+#else
+#error Unable to configure chip select for current CFG_FLASH0_SIZE
+#endif
 
 /* Memory Bank 1 (NOR-FLASH) initialization                            */
+#if CFG_FLASH1_MAX_SIZE == 0x08000000
 #define CFG_EBC_PB1AP          0x04017300
-#define CFG_EBC_PB1CR          (0xF8000000 | 0x000DA000)
+#define CFG_EBC_PB1CR          (CFG_FLASH1_ADDR | 0x000FA000)
+#else
+#error Unable to configure chip select for current CFG_FLASH1_MAX_SIZE
+#endif
 
 /* Memory Bank 2 (CPLD) initialization                                 */
 #define CFG_EBC_PB2AP          0x04017300
  * GPIO63  xxxx   x    x   (reserved for trace port)
  */
 
+#define CFG_GPIO_ATMEGA_RESET_ 12
 #define CFG_GPIO_ATMEGA_SS_    13
 #define CFG_GPIO_PHY0_FIBER_SEL        27
 #define CFG_GPIO_PHY1_FIBER_SEL        28
 #define CFG_GPIO_SFP1_TX_EN_   33
 #define CFG_GPIO_PHY0_EN       45
 #define CFG_GPIO_PHY1_EN       46
+#define CFG_GPIO_RESET_PRESSED_        47
 
 /*
  * PPC440 GPIO Configuration
diff --git a/include/configs/linkstation.h b/include/configs/linkstation.h
new file mode 100644 (file)
index 0000000..518186b
--- /dev/null
@@ -0,0 +1,507 @@
+/*
+ * Copyright (C) 2006 Mihai Georgian <u-boot@linuxnotincluded.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#if 0
+#define DEBUG
+#endif
+
+#define CONFIG_BOARD_EARLY_INIT_F 1    /* Call board_early_init_f      */
+
+/*-----------------------------------------------------------------------
+ * User configurable settings:
+ *   Mandatory settings:
+ *     CONFIG_IPADDR_LS                - the IP address of the LinkStation
+ *     CONFIG_SERVERIP_LS      - the address of the server for NFS/TFTP/DHCP/BOOTP
+ *   Optional settins:
+ *     CONFIG_NCIP_LS          - the adress of the computer running net console
+ *                                                       if not configured, it will be set to
+ *                                                       CONFIG_SERVERIP_LS
+ */
+
+
+#define CONFIG_IPADDR_LS       192.168.11.150
+#define CONFIG_SERVERIP_LS     192.168.11.149
+
+#if !defined(CONFIG_IPADDR_LS) || !defined(CONFIG_SERVERIP_LS)
+#error Both CONFIG_IPADDR_LS and CONFIG_SERVERIP_LS must be defined
+#endif
+
+#if !defined(CONFIG_NCIP_LS)
+#define CONFIG_NCIP_LS         CONFIG_SERVERIP_LS
+#endif
+
+/*----------------------------------------------------------------------
+ * DO NOT CHANGE ANYTHING BELOW, UNLESS YOU KNOW WHAT YOU ARE DOING
+ *---------------------------------------------------------------------*/
+
+#define CONFIG_MPC8245         1
+#define CONFIG_LINKSTATION     1
+
+/*---------------------------------------
+ * Supported models
+ *
+ * LinkStation HDLAN /KuroBox Standard (CONFIG_HLAN)
+ * LinkStation old model               (CONFIG_LAN) - totally untested
+ * LinkStation HGLAN / KuroBox HG      (CONFIG_HGLAN)
+ *
+ * Models not supported yet
+ * TeraStatin                          (CONFIG_HTGL)
+ */
+
+#if defined(CONFIG_HLAN) || defined(CONFIG_LAN)
+#define CONFIG_IDENT_STRING            " LinkStation / KuroBox"
+#elif defined(CONFIG_HGLAN)
+#define CONFIG_IDENT_STRING            " LinkStation HG / KuroBox HG"
+#elif defined(CONFIG_HTGL)
+#define CONFIG_IDENT_STRING            " TeraStation"
+#else
+#error No LinkStation model defined
+#endif
+
+#define CONFIG_BOOTDELAY       5
+#define CONFIG_ZERO_BOOTDELAY_CHECK
+#undef CONFIG_BOOT_RETRY_TIME
+
+#define CONFIG_AUTOBOOT_KEYED
+#define CONFIG_AUTOBOOT_PROMPT         "Boot in %02d seconds ('s' to stop)..."
+#define CONFIG_AUTOBOOT_STOP_STR       "s"
+
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_EXT2
+
+#define CONFIG_BOOTP_MASK      CONFIG_BOOTP_ALL
+
+#define CONFIG_OF_LIBFDT       1
+
+#define OF_CPU                 "PowerPC,603e"
+#define OF_SOC                 "soc10x@80000000"
+#define OF_STDOUT_PATH         "/soc10x/serial@80004600"
+
+/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
+#include <config_cmd_default.h>
+
+/*
+ * Miscellaneous configurable options
+ */
+#define CFG_LONGHELP                           /* undef to save memory         */
+#define CFG_PROMPT             "=> "           /* Monitor Command Prompt       */
+#define CFG_CBSIZE             256             /* Console I/O Buffer Size      */
+
+#define CFG_PBSIZE             (CFG_CBSIZE + sizeof(CFG_PROMPT) + 16)
+#define CFG_MAXARGS            16              /* Max number of command args   */
+#define CFG_BARGSIZE           CFG_CBSIZE      /* Boot Argument Buffer Size    */
+#define CFG_LOAD_ADDR          0x00800000      /* Default load address: 8 MB   */
+
+#define CONFIG_BOOTCOMMAND     "run bootcmd1"
+#define CONFIG_BOOTARGS                "root=/dev/sda1 console=ttyS1,57600 netconsole=@192.168.1.7/eth0,@192.168.1.1/00:50:BF:A4:59:71 rtc-rs5c372.probe=0,0x32 debug"
+#define CONFIG_NFSBOOTCOMMAND          "bootp;run nfsargs;bootm"
+
+#define CFG_CONSOLE_IS_IN_ENV
+
+#define XMK_STR(x)             #x
+#define MK_STR(x)              XMK_STR(x)
+
+#if defined(CONFIG_HLAN) || defined(CONFIG_LAN)
+#define UBFILE                 "share/u-boot/u-boot-hd.flash.bin"
+#elif defined(CONFIG_HGLAN)
+#define UBFILE                 "share/u-boot/u-boot-hg.flash.bin"
+#elif defined(CONFIG_HTGL)
+#define UBFILE                 "share/u-boot/u-boot-ht.flash.bin"
+#else
+#error No LinkStation model defined
+#endif
+
+#define CONFIG_EXTRA_ENV_SETTINGS                                              \
+       "autoload=no\0"                                                         \
+       "stdin=nc\0"                                                            \
+       "stdout=nc\0"                                                           \
+       "stderr=nc\0"                                                           \
+       "ipaddr="MK_STR(CONFIG_IPADDR_LS)"\0"                                   \
+       "netmask=255.255.255.0\0"                                               \
+       "serverip="MK_STR(CONFIG_SERVERIP_LS)"\0"                               \
+       "ncip="MK_STR(CONFIG_NCIP_LS)"\0"                                       \
+       "netretry=no\0"                                                         \
+       "nc=setenv stdin nc;setenv stdout nc;setenv stderr nc\0"                \
+       "ser=setenv stdin serial;setenv stdout serial;setenv stderr serial\0"   \
+       "ldaddr=800000\0"                                                       \
+       "hdpart=0:1\0"                                                          \
+       "hdfile=boot/uImage\0"                                                  \
+       "hdload=echo Loading ${hdpart}:${hdfile};ext2load ide ${hdpart} ${ldaddr} ${hdfile};ext2load ide ${hdpart} 7f0000 boot/kuroboxHG.dtb\0" \
+       "boothd=setenv bootargs " CONFIG_BOOTARGS ";bootm ${ldaddr} - 7f0000\0" \
+       "hdboot=run hdload;run boothd\0"                                        \
+       "flboot=setenv bootargs root=/dev/hda1;bootm ffc00000\0"                \
+       "emboot=setenv bootargs root=/dev/ram0;bootm ffc00000\0"                \
+       "nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${rootpath} "     \
+       "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off\0"   \
+       "bootretry=30\0"                                                        \
+       "bootcmd1=run hdboot;run flboot\0"                                      \
+       "bootcmd2=run flboot\0"                                                 \
+       "bootcmd3=run emboot\0"                                                 \
+       "writeng=protect off fff70000 fff7ffff;era fff70000 fff7ffff;mw.l 800000 4e474e47 1;cp.b 800000 fff70000 4\0" \
+       "writeok=protect off fff70000 fff7ffff;era fff70000 fff7ffff;mw.l 800000 4f4b4f4b 1;cp.b 800000 fff70000 4\0" \
+       "ubpart=0:3\0"                                                          \
+       "ubfile="UBFILE"\0"                                                     \
+       "ubload=echo Loading ${ubpart}:${ubfile};ext2load ide ${ubpart} ${ldaddr} ${ubfile}\0" \
+       "ubsaddr=fff00000\0"                                                    \
+       "ubeaddr=fff2ffff\0"                                                    \
+       "ubflash=protect off ${ubsaddr} ${ubeaddr};era ${ubsaddr} ${ubeaddr};cp.b ${ldaddr} ${ubsaddr} ${filesize};cmp.b ${ldaddr} ${ubsaddr} ${filesize}\0" \
+       "upgrade=run ubload ubflash\0"
+
+/*-----------------------------------------------------------------------
+ * PCI stuff
+ */
+#define CONFIG_PCI
+/* Verified: CONFIG_PCI_PNP doesn't work */
+#undef CONFIG_PCI_PNP
+#define CONFIG_PCI_SCAN_SHOW
+
+#ifndef CONFIG_PCI_PNP
+/* Keep the following defines in sync with the BAT mappings */
+
+#define PCI_ETH_IOADDR      0xbfff00
+#define PCI_ETH_MEMADDR     0xbffffc00
+#define PCI_IDE_IOADDR      0xbffed0
+#define PCI_IDE_MEMADDR     0xbffffb00
+#define PCI_USB0_IOADDR     0
+#define PCI_USB0_MEMADDR    0xbfffe000
+#define PCI_USB1_IOADDR     0
+#define PCI_USB1_MEMADDR    0xbfffd000
+#define PCI_USB2_IOADDR     0
+#define PCI_USB2_MEMADDR    0xbfffcf00
+
+#endif
+
+/*-----------------------------------------------------------------------
+ * Ethernet stuff
+ */
+#define CONFIG_NET_MULTI
+
+#if defined(CONFIG_LAN) || defined(CONFIG_HLAN)
+#define CONFIG_TULIP
+#define CONFIG_TULIP_USE_IO
+#elif defined(CONFIG_HGLAN) || defined(CONFIG_HTGL)
+#define CONFIG_RTL8169
+#endif
+
+#define CONFIG_NET_RETRY_COUNT         5
+
+#define CONFIG_NETCONSOLE
+
+/*-----------------------------------------------------------------------
+ * Start addresses for the final memory configuration
+ * (Set up by the startup code)
+ * Please note that CFG_SDRAM_BASE _must_ start at 0
+ */
+#define CFG_SDRAM_BASE         0x00000000
+
+#define CFG_FLASH_BASE         0xFFC00000
+#define CFG_FLASH_SIZE         0x00400000
+#define CFG_MONITOR_BASE       TEXT_BASE
+
+#define CFG_RESET_ADDRESS      0xFFF00100
+#define CFG_EUMB_ADDR          0x80000000
+#define CFG_PCI_MEM_ADDR       0xB0000000
+#define CFG_MISC_REGION_ADDR   0xFE000000
+
+#define CFG_MONITOR_LEN        0x00040000      /* 256 kB                       */
+#define CFG_MALLOC_LEN         (512 << 10)     /* Reserve some kB for malloc() */
+
+#define CFG_MEMTEST_START      0x00100000      /* memtest works on             */
+#define CFG_MEMTEST_END                0x00800000      /* 1M ... 8M in DRAM            */
+
+/* Maximum amount of RAM */
+#if defined(CONFIG_HLAN) || defined(CONFIG_LAN)
+#define CFG_MAX_RAM_SIZE       0x04000000      /* 64MB of SDRAM  */
+#elif defined(CONFIG_HGLAN) || defined(CONFIG_HTGL)
+#define CFG_MAX_RAM_SIZE       0x08000000      /* 128MB of SDRAM */
+#else
+#error Unknown LinkStation type
+#endif
+
+/*-----------------------------------------------------------------------
+ * Change TEXT_BASE in bord/linkstation/config.mk to get a RAM build
+ *
+ * RAM based builds are for testing purposes. A Linux module, uloader.o,
+ * exists to load U-Boot and pass control to it
+ *
+ * Always do "make clean" after changing the build type
+ */
+#if CFG_MONITOR_BASE < CFG_FLASH_BASE
+#define CFG_RAMBOOT
+#endif
+
+/*-----------------------------------------------------------------------
+ * Definitions for initial stack pointer and data area
+ */
+#if 1 /* RAM is available when the first C function is called */
+#define CFG_INIT_RAM_ADDR      (CFG_SDRAM_BASE + CFG_MAX_RAM_SIZE - 0x1000)
+#else
+#define CFG_INIT_RAM_ADDR      0x40000000
+#endif
+#define CFG_INIT_RAM_END       0x1000
+#define CFG_GBL_DATA_SIZE      128
+#define CFG_GBL_DATA_OFFSET    (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
+
+/*----------------------------------------------------------------------
+ * Serial configuration
+ */
+#define CONFIG_CONS_INDEX      1
+#define CONFIG_BAUDRATE                57600
+#define CFG_BAUDRATE_TABLE     { 9600, 19200, 38400, 57600, 115200 }
+
+#define CFG_NS16550
+#define CFG_NS16550_SERIAL
+
+#define CFG_NS16550_REG_SIZE   1
+
+#define CFG_NS16550_CLK                get_bus_freq(0)
+
+#define CFG_NS16550_COM1       (CFG_EUMB_ADDR + 0x4600)        /* Console port */
+#define CFG_NS16550_COM2       (CFG_EUMB_ADDR + 0x4500)        /* AVR port     */
+
+/*
+ * Low Level Configuration Settings
+ * (address mappings, register initial values, etc.)
+ * You should know what you are doing if you make changes here.
+ * For the detail description refer to the MPC8245 user's manual.
+ *
+ * Unless indicated otherwise, the values are
+ * taken from the orignal Linkstation boot code
+ *
+ * Most of the low level configuration setttings are normally used
+ * in cpu/mpc824x/cpu_init.c which is NOT used by this implementation.
+ * Low level initialisation is done in board/linkstation/early_init.S
+ * The values below are included for reference purpose only
+ */
+
+/* FIXME: 32.768 MHz is the crystal frequency but */
+/* the real frequency is lower by about 0.75%     */
+#define CONFIG_SYS_CLK_FREQ    32768000
+#define CFG_HZ                 1000
+
+/* Bit-field values for MCCR1.  */
+#define CFG_ROMNAL      0
+#define CFG_ROMFAL      11
+
+#define CFG_BANK0_ROW  2       /* Only bank 0 used: 13 x n x 4 */
+#define CFG_BANK1_ROW  0
+#define CFG_BANK2_ROW  0
+#define CFG_BANK3_ROW  0
+#define CFG_BANK4_ROW  0
+#define CFG_BANK5_ROW  0
+#define CFG_BANK6_ROW  0
+#define CFG_BANK7_ROW  0
+
+/* Bit-field values for MCCR2.  */
+#define CFG_TSWAIT      0
+#if defined(CONFIG_LAN) || defined(CONFIG_HLAN)
+#define CFG_REFINT      0x15e0
+#elif defined(CONFIG_HGLAN) || defined(CONFIG_HTGL)
+#define CFG_REFINT      0x1580
+#endif
+
+/* Burst To Precharge. Bits of this value go to MCCR3 and MCCR4. */
+#define CFG_BSTOPRE    0x91c
+
+/* Bit-field values for MCCR3.  */
+#define CFG_REFREC      7
+
+/* Bit-field values for MCCR4.  */
+#define CFG_PRETOACT           2
+#define CFG_ACTTOPRE           2       /* Original value was 2 */
+#define CFG_ACTORW             2
+#if defined(CONFIG_LAN) || defined(CONFIG_HLAN)
+#define CFG_SDMODE_CAS_LAT     2       /* For 100MHz bus       */
+/*#define CFG_SDMODE_BURSTLEN  3*/
+#elif defined(CONFIG_HGLAN) || defined(CONFIG_HTGL)
+#define CFG_SDMODE_CAS_LAT     3       /* For 133MHz bus       */
+/*#define CFG_SDMODE_BURSTLEN  2*/
+#endif
+#define CFG_REGISTERD_TYPE_BUFFER 1
+#define CFG_EXTROM             1       /* Original setting but there is no EXTROM */
+#define CFG_REGDIMM            0
+#define CFG_DBUS_SIZE2         1
+#define CFG_SDMODE_WRAP                0
+
+#define CFG_PGMAX              0x32    /* All boards use this setting. Original 0x92 */
+#define CFG_SDRAM_DSCD         0x30
+
+/* Memory bank settings.
+ * Only bits 20-29 are actually used from these vales to set the
+ * start/end addresses. The upper two bits will always be 0, and the lower
+ * 20 bits will be 0x00000 for a start address, or 0xfffff for an end
+ * address. Refer to the MPC8240 book.
+ */
+
+#define CFG_BANK0_START            0x00000000
+#define CFG_BANK0_END      (CFG_MAX_RAM_SIZE - 1)
+#define CFG_BANK0_ENABLE    1
+#define CFG_BANK1_START     0x3ff00000
+#define CFG_BANK1_END       0x3fffffff
+#define CFG_BANK1_ENABLE    0
+#define CFG_BANK2_START     0x3ff00000
+#define CFG_BANK2_END       0x3fffffff
+#define CFG_BANK2_ENABLE    0
+#define CFG_BANK3_START     0x3ff00000
+#define CFG_BANK3_END       0x3fffffff
+#define CFG_BANK3_ENABLE    0
+#define CFG_BANK4_START     0x3ff00000
+#define CFG_BANK4_END       0x3fffffff
+#define CFG_BANK4_ENABLE    0
+#define CFG_BANK5_START     0x3ff00000
+#define CFG_BANK5_END       0x3fffffff
+#define CFG_BANK5_ENABLE    0
+#define CFG_BANK6_START     0x3ff00000
+#define CFG_BANK6_END       0x3fffffff
+#define CFG_BANK6_ENABLE    0
+#define CFG_BANK7_START     0x3ff00000
+#define CFG_BANK7_END       0x3fffffff
+#define CFG_BANK7_ENABLE    0
+
+#define CFG_ODCR           0x15
+
+/*----------------------------------------------------------------------
+ * Initial BAT mappings
+ */
+
+/* NOTES:
+ * 1) GUARDED and WRITETHROUGH not allowed in IBATS
+ * 2) CACHEINHIBIT and WRITETHROUGH not allowed together in same BAT
+ */
+
+/* SDRAM */
+#define CFG_IBAT0L     (CFG_SDRAM_BASE | BATL_PP_10 | BATL_MEMCOHERENCE)
+#define CFG_IBAT0U     (CFG_SDRAM_BASE | BATU_BL_128M | BATU_VS | BATU_VP)
+
+#define CFG_DBAT0L     CFG_IBAT0L
+#define CFG_DBAT0U     CFG_IBAT0U
+
+/* EUMB: 1MB of address space */
+#define CFG_IBAT1L     (CFG_EUMB_ADDR | BATL_PP_10 | BATL_CACHEINHIBIT)
+#define CFG_IBAT1U     (CFG_EUMB_ADDR | BATU_BL_1M | BATU_VS | BATU_VP)
+
+#define CFG_DBAT1L     (CFG_IBAT1L | BATL_GUARDEDSTORAGE)
+#define CFG_DBAT1U     CFG_IBAT1U
+
+/* PCI Mem: 256MB of address space */
+#define CFG_IBAT2L     (CFG_PCI_MEM_ADDR | BATL_PP_10 | BATL_CACHEINHIBIT)
+#define CFG_IBAT2U     (CFG_PCI_MEM_ADDR | BATU_BL_256M | BATU_VS | BATU_VP)
+
+#define CFG_DBAT2L     (CFG_IBAT2L | BATL_GUARDEDSTORAGE)
+#define CFG_DBAT2U     CFG_IBAT2U
+
+/* PCI and local ROM/Flash: last 32MB of address space */
+#define CFG_IBAT3L     (CFG_MISC_REGION_ADDR | BATL_PP_10 | BATL_CACHEINHIBIT)
+#define CFG_IBAT3U     (CFG_MISC_REGION_ADDR | BATU_BL_32M | BATU_VS | BATU_VP)
+
+#define CFG_DBAT3L     (CFG_IBAT3L | BATL_GUARDEDSTORAGE)
+#define CFG_DBAT3U     CFG_IBAT3U
+
+/*
+ * 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.
+ *
+ * FIXME: This doesn't appear to be true for the newer kernels
+ * which map more that 8 MB
+ */
+#define CFG_BOOTMAPSZ  (8 << 20)       /* Initial Memory map for Linux */
+
+/*-----------------------------------------------------------------------
+ * FLASH organization
+ */
+#define CFG_FLASH_CFI                  /* The flash is CFI compatible  */
+#define CFG_FLASH_CFI_DRIVER           /* Use common CFI driver        */
+
+#undef  CFG_FLASH_PROTECTION
+#define CFG_FLASH_BANKS_LIST   { CFG_FLASH_BASE }
+#define CFG_MAX_FLASH_BANKS    1       /* Max number of flash banks            */
+#define CFG_MAX_FLASH_SECT     72      /* Max number of sectors per flash      */
+
+#define CFG_FLASH_ERASE_TOUT   12000
+#define CFG_FLASH_WRITE_TOUT   1000
+
+#define CFG_FLASH_USE_BUFFER_WRITE 1   /* use buffered writes (20x faster)     */
+
+#define CFG_FLASH_EMPTY_INFO           /* print 'E' for empty sector on flinfo */
+#define CFG_FLASH_QUIET_TEST   1       /* don't warn upon unknown flash        */
+
+#define CFG_ENV_IS_IN_FLASH
+/*
+ * The original LinkStation flash organisation uses
+ * 448 kB (0xFFF00000 - 0xFFF6FFFF) for the boot loader
+ * We use the last sector of this area to store the environment
+ * which leaves max. 384 kB for the U-Boot itself
+ */
+#define CFG_ENV_ADDR           0xFFF60000
+#define CFG_ENV_SIZE           0x00010000
+#define CFG_ENV_SECT_SIZE      0x00010000
+
+/*-----------------------------------------------------------------------
+ * Cache Configuration
+ */
+#define CFG_CACHELINE_SIZE     32
+#ifdef CONFIG_CMD_KGDB
+#define CFG_CACHELINE_SHIFT    5       /* log base 2 of the above value        */
+#endif
+
+/*-----------------------------------------------------------------------
+ * IDE/ATA definitions
+ */
+#undef  CONFIG_IDE_LED                         /* No IDE LED                   */
+#define CONFIG_IDE_RESET                       /* no reset for ide supported   */
+#define CONFIG_IDE_PREINIT                     /* check for units              */
+#define CONFIG_LBA48                           /* 48 bit LBA supported         */
+
+#if defined(CONFIG_LAN) || defined(CONFIG_HLAN) || defined(CONFIG_HGLAN)
+#define CFG_IDE_MAXBUS         1               /* Scan only 1 IDE bus          */
+#define CFG_IDE_MAXDEVICE      1               /* Only 1 drive per IDE bus     */
+#elif defined(CONFIG_HGTL)
+#define CFG_IDE_MAXBUS         2               /* Max. 2 IDE busses            */
+#define CFG_IDE_MAXDEVICE      2               /* max. 2 drives per IDE bus    */
+#else
+#error Config IDE: Unknown LinkStation type
+#endif
+
+#define CFG_ATA_BASE_ADDR      0
+
+#define CFG_ATA_DATA_OFFSET    0               /* Offset for data I/O          */
+#define CFG_ATA_REG_OFFSET     0               /* Offset for normal registers  */
+#define CFG_ATA_ALT_OFFSET     0               /* Offset for alternate registers */
+
+/*-----------------------------------------------------------------------
+ * Partitions and file system
+ */
+#define CONFIG_DOS_PARTITION
+
+/*-----------------------------------------------------------------------
+ * Internal Definitions
+ *
+ * Boot Flags
+ */
+#define BOOTFLAG_COLD          0x01    /* Normal Power-On: Boot from FLASH     */
+#define BOOTFLAG_WARM          0x02    /* Software reboot                      */
+
+#endif /* __CONFIG_H */
index 58f078b..cc6f87c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2007
+ * (C) Copyright 2007-2008
  * Stefan Roese, DENX Software Engineering, sr@denx.de.
  *
  * This program is free software; you can redistribute it and/or
 #define CFG_INIT_SP_OFFSET     CFG_GBL_DATA_OFFSET
 #define CFG_POST_ALT_WORD_ADDR (CFG_PERIPHERAL_BASE + GPT0_COMP6)
                                                /* unused GPT0 COMP reg */
+#define CFG_MEM_TOP_HIDE       (4 << 10) /* don't use last 4kbytes     */
+                                       /* 440EPx errata CHIP 11        */
+
+/* Additional registers for watchdog timer post test */
+
+#define CFG_DSPIC_TEST_ADDR    (CFG_PERIPHERAL_BASE + GPT0_COMP5)
+#define CFG_WATCHDOG_TIME_ADDR (CFG_PERIPHERAL_BASE + GPT0_COMP4)
+#define CFG_WATCHDOG_FLAGS_ADDR        (CFG_PERIPHERAL_BASE + GPT0_COMP5)
+#define CFG_WATCHDOG_MAGIC     0x12480000
+#define CFG_WATCHDOG_MAGIC_MASK        0xFFFF0000
+#define CFG_DSPIC_TEST_MASK    0x00000001
 
 /* Additional registers for watchdog timer post test */
 
 #define CFG_MBYTES_SDRAM       (256)           /* 256MB                        */
 #define CFG_DDR_CACHED_ADDR    0x40000000      /* setup 2nd TLB cached here    */
 #define CONFIG_DDR_DATA_EYE    1               /* use DDR2 optimization        */
-#if 0 /* test-only: disable ECC for now */
 #define CONFIG_DDR_ECC         1               /* enable ECC                   */
 #define CFG_POST_ECC_ON                CFG_POST_ECC
-#else
-#define CFG_POST_ECC_ON                0
-#endif
 
 /* POST support */
 #define CONFIG_POST            (CFG_POST_CACHE    | \
 #define CONFIG_CMDLINE_EDITING 1       /* add command line history     */
 #define CONFIG_LOOPW            1       /* enable loopw command         */
 #define CONFIG_MX_CYCLIC        1       /* enable mdc/mwc commands      */
-#define CONFIG_ZERO_BOOTDELAY_CHECK    /* check for keypress on bootdelay==0 */
 #define CONFIG_VERSION_VARIABLE 1      /* include version env variable */
 
 /*-----------------------------------------------------------------------
index a394b4b..a9c86f9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2006
+ * (C) Copyright 2006-2008
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
  * See file CREDITS for list of people who contributed to this
                "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}"      \
                ":${hostname}:${netdev}:off panic=1\0"                  \
        "addcons=setenv bootargs ${bootargs} "                          \
-               "console=${console},${baudrate} "               \
-               "ubootver=${ubootver} board=${board}\0" \
+               "console=${console},${baudrate} "                       \
+               "ubootver=${ubootver} board=${board}\0"                 \
        "flash_nfs=run nfsargs addip addcons;"                          \
                "bootm ${kernel_addr}\0"                                \
        "flash_self=run ramargs addip addcons;"                         \
index b1e3d53..2924acc 100644 (file)
 /*
  * Default environment settings
  */
-#define CONFIG_EXTRA_ENV_SETTINGS                                      \
-       "netdev=eth0\0"                                                 \
-       "u-boot_addr=100000\0"                                          \
-       "kernel_addr=200000\0"                                          \
-       "fdt_addr=400000\0"                                             \
-       "rootpath=/opt/eldk-4.2/ppc_82xx\0"                             \
-       "u-boot=/tftpboot/mgcoge/u-boot.bin\0"                          \
-       "bootfile=/tftpboot/mgcoge/uImage\0"                            \
-       "fdt_file=/tftpboot/mgcoge/mgcoge.dtb\0"                        \
-       "load=tftp ${u-boot_addr} ${u-boot}\0"                          \
-       "update=prot off fe000000 fe03ffff; era fe000000 fe03ffff; "    \
-               "cp.b ${u-boot_addr} fe000000 ${filesize};"             \
-               "prot on fe000000 fe03ffff\0"                           \
-       "ramargs=setenv bootargs root=/dev/ram rw\0"                    \
-       "nfsargs=setenv bootargs root=/dev/nfs rw "                     \
-               "nfsroot=${serverip}:${rootpath}\0"                     \
-       "addcon=setenv bootargs ${bootargs} console=ttyCPM0,${baudrate}\0"      \
-       "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0"              \
-       "addip=setenv bootargs ${bootargs} "                            \
-               "ip=${ipaddr}:${serverip}:${gatewayip}:"                \
-               "${netmask}:${hostname}:${netdev}:off panic=1\0"        \
-       "net_nfs=tftp ${kernel_addr} ${bootfile}; "                     \
-               "tftp ${fdt_addr} ${fdt_file}; run nfsargs addip addcon;"\
-               "bootm ${kernel_addr} - ${fdt_addr}\0"                  \
-       "net_self=tftp ${kernel_addr} ${bootfile}; "                    \
-               "tftp ${fdt_addr} ${fdt_file}; "                        \
-               "tftp ${ramdisk_addr} ${ramdisk_file}; "                \
-               "run ramargs addip; "                                   \
-               "bootm ${kernel_addr} ${ramdisk_addr} ${fdt_addr}\0"    \
+#define CONFIG_EXTRA_ENV_SETTINGS                                              \
+       "netdev=eth0\0"                                                         \
+       "u-boot_addr=100000\0"                                                  \
+       "kernel_addr=200000\0"                                                  \
+       "fdt_addr=400000\0"                                                     \
+       "rootpath=/opt/eldk-4.2/ppc_82xx\0"                                     \
+       "u-boot=/tftpboot/mgcoge/u-boot.bin\0"                                  \
+       "bootfile=/tftpboot/mgcoge/uImage\0"                                    \
+       "fdt_file=/tftpboot/mgcoge/mgcoge.dtb\0"                                \
+       "load=tftp ${u-boot_addr} ${u-boot}\0"                                  \
+       "update=prot off fe000000 fe03ffff; era fe000000 fe03ffff; "            \
+               "cp.b ${u-boot_addr} fe000000 ${filesize};"                     \
+               "prot on fe000000 fe03ffff\0"                                   \
+       "ramargs=setenv bootargs root=/dev/ram rw\0"                            \
+       "nfsargs=setenv bootargs root=/dev/nfs rw "                             \
+               "nfsroot=${serverip}:${rootpath}\0"                             \
+       "addcons=setenv bootargs ${bootargs} console=ttyCPM0,${baudrate}\0"     \
+       "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0"                      \
+       "addip=setenv bootargs ${bootargs} "                                    \
+               "ip=${ipaddr}:${serverip}:${gatewayip}:"                        \
+               "${netmask}:${hostname}:${netdev}:off panic=1\0"                \
+       "net_nfs=tftp ${kernel_addr} ${bootfile}; "                             \
+               "tftp ${fdt_addr} ${fdt_file}; run nfsargs addip addcons;"      \
+               "bootm ${kernel_addr} - ${fdt_addr}\0"                          \
+       "net_self=tftp ${kernel_addr} ${bootfile}; "                            \
+               "tftp ${fdt_addr} ${fdt_file}; "                                \
+               "tftp ${ramdisk_addr} ${ramdisk_file}; "                        \
+               "run ramargs addip; "                                           \
+               "bootm ${kernel_addr} ${ramdisk_addr} ${fdt_addr}\0"            \
        ""
 #define CONFIG_BOOTCOMMAND     "run net_nfs"
 #define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds */
index 5482089..9cbc9cc 100644 (file)
 
 #undef CONFIG_BOOTARGS
 
-#define CONFIG_EXTRA_ENV_SETTINGS                                      \
-       "netdev=eth0\0"                                                 \
-       "addcon=setenv bootargs ${bootargs} console=ttyCPM0,${baudrate}\0"      \
-       "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 panic=1\0"                  \
-       "flash_nfs=run nfsargs addip;"                                  \
-               "bootm ${kernel_addr}\0"                                \
-       "flash_self=run ramargs addip;"                                 \
-               "bootm ${kernel_addr} ${ramdisk_addr}\0"                \
-       "net_nfs=tftp ${kernel_addr} ${bootfile}; "                     \
-               "tftp ${fdt_addr} ${fdt_file}; run nfsargs addip addcon;"\
-               "bootm ${kernel_addr} - ${fdt_addr}\0"                  \
-       "rootpath=/opt/eldk/ppc_8xx\0"                                  \
-       "bootfile=/tftpboot/mgsuvd/uImage\0"                            \
-       "fdt_addr=400000\0"                                             \
-       "kernel_addr=200000\0"                                          \
-       "fdt_file=/tftpboot/mgsuvd/mgsuvd.dtb\0"                        \
-       "load=tftp 200000 ${u-boot}\0"                                  \
-       "update=protect off f0000000 +${filesize};"                     \
-               "erase f0000000 +${filesize};"                          \
-               "cp.b 200000 f0000000 ${filesize};"                     \
-               "protect on f0000000 +${filesize}\0"                    \
+#define CONFIG_EXTRA_ENV_SETTINGS                                              \
+       "netdev=eth0\0"                                                         \
+       "addcons=setenv bootargs ${bootargs} console=ttyCPM0,${baudrate}\0"     \
+       "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 panic=1\0"                          \
+       "flash_nfs=run nfsargs addip;"                                          \
+               "bootm ${kernel_addr}\0"                                        \
+       "flash_self=run ramargs addip;"                                         \
+               "bootm ${kernel_addr} ${ramdisk_addr}\0"                        \
+       "net_nfs=tftp ${kernel_addr} ${bootfile}; "                             \
+               "tftp ${fdt_addr} ${fdt_file}; run nfsargs addip addcons;"      \
+               "bootm ${kernel_addr} - ${fdt_addr}\0"                          \
+       "rootpath=/opt/eldk/ppc_8xx\0"                                          \
+       "bootfile=/tftpboot/mgsuvd/uImage\0"                                    \
+       "fdt_addr=400000\0"                                                     \
+       "kernel_addr=200000\0"                                                  \
+       "fdt_file=/tftpboot/mgsuvd/mgsuvd.dtb\0"                                \
+       "load=tftp 200000 ${u-boot}\0"                                          \
+       "update=protect off f0000000 +${filesize};"                             \
+               "erase f0000000 +${filesize};"                                  \
+               "cp.b 200000 f0000000 ${filesize};"                             \
+               "protect on f0000000 +${filesize}\0"                            \
        ""
 #define CONFIG_BOOTCOMMAND     "run flash_self"
 
index b320438..360e2e1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2007 Michal Simek
+ * (C) Copyright 2007-2008 Michal Simek
  *
  * Michal SIMEK <monstr@monstr.eu>
  *
 #define        CONFIG_ML401            1       /* ML401 Board */
 
 /* uart */
+#ifdef XILINX_UARTLITE_BASEADDR
 #define        CONFIG_XILINX_UARTLITE
-#define        CONFIG_SERIAL_BASE      XILINX_UART_BASEADDR
-#define        CONFIG_BAUDRATE         XILINX_UART_BAUDRATE
+#define        CONFIG_SERIAL_BASE      XILINX_UARTLITE_BASEADDR
+#define        CONFIG_BAUDRATE         XILINX_UARTLITE_BAUDRATE
 #define        CFG_BAUDRATE_TABLE      { CONFIG_BAUDRATE }
+#else
+#ifdef XILINX_UART16550_BASEADDR
+#define CFG_NS16550
+#define CFG_NS16550_SERIAL
+#define CFG_NS16550_REG_SIZE   4
+#define CONFIG_CONS_INDEX      1
+#define CFG_NS16550_COM1       XILINX_UART16550_BASEADDR
+#define CFG_NS16550_CLK                XILINX_UART16550_CLOCK_HZ
+#define        CONFIG_BAUDRATE         115200
+#define        CFG_BAUDRATE_TABLE      { 9600, 115200 }
+#endif
+#endif
 
 /* setting reset address */
 /*#define      CFG_RESET_ADDRESS       TEXT_BASE*/
 
 /* ethernet */
-#define CONFIG_EMACLITE                1
-#define XPAR_EMAC_0_DEVICE_ID  XPAR_OPB_ETHERNET_0_DEVICE_ID
+#ifdef XILINX_EMAC_BASEADDR
+#define CONFIG_XILINX_EMAC     1
+#else
+#ifdef XILINX_EMACLITE_BASEADDR
+#define CONFIG_XILINX_EMACLITE 1
+#endif
+#endif
+#undef ET_DEBUG
 
 /* gpio */
+#ifdef XILINX_GPIO_BASEADDR
 #define        CFG_GPIO_0              1
 #define        CFG_GPIO_0_ADDR         XILINX_GPIO_BASEADDR
+#endif
 
 /* interrupt controller */
 #define        CFG_INTC_0              1
@@ -62,8 +83,8 @@
 #define        CONFIG_XILINX_CLOCK_FREQ        XILINX_CLOCK_FREQ
 
 /* FSL */
-#define        CFG_FSL_2
-#define        FSL_INTR_2      1
+/* #define     CFG_FSL_2 */
+/* #define     FSL_INTR_2      1 */
 
 /*
  * memory layout - Example
 
        #else   /* !RAMENV */
                #define CFG_ENV_IS_IN_FLASH     1
-               #define CFG_ENV_ADDR            0x40000
                #define CFG_ENV_SECT_SIZE       0x40000 /* 256K(one sector) for env */
-               #define CFG_ENV_SIZE            0x2000
+               #define CFG_ENV_ADDR            (CFG_FLASH_BASE + (2 * CFG_ENV_SECT_SIZE))
+               #define CFG_ENV_SIZE            0x40000
        #endif /* !RAMBOOT */
 #else /* !FLASH */
        /* ENV in RAM */
                                        "256k(u-boot),256k(env),3m(kernel),"\
                                        "1m(romfs),1m(cramfs),-(jffs2)\0"
 
+#define CONFIG_CMDLINE_EDITING
+#define CONFIG_OF_LIBFDT       1
+
 #endif /* __CONFIG_H */
index 294221f..2eb4af1 100644 (file)
@@ -55,7 +55,7 @@
 #define MC_ASR_VAL     0x00000000
 #define MC_AASR_VAL    0x00000000
 #define EBI_CFGR_VAL   0x00000000
-#define SMC2_CSR_VAL   0x00003084 /* 16bit, 2 TDF, 4 WS */
+#define SMC_CSR0_VAL   0x00003084 /* 16bit, 2 TDF, 4 WS */
 
 /* clocks */
 #define PLLAR_VAL      0x20263E04 /* 180 MHz for PCK */
diff --git a/include/configs/mpr2.h b/include/configs/mpr2.h
new file mode 100644 (file)
index 0000000..0fc0b97
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * Configuation settings for MPR2
+ *
+ * Copyright (C) 2008
+ * Mark Jonas <mark.jonas@de.bosch.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 __MPR2_H
+#define __MPR2_H
+
+/* Supported commands */
+#define CONFIG_CMD_ENV
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_MEMORY
+#define CONFIG_CMD_FLASH
+
+/* Default environment variables */
+#define CONFIG_BAUDRATE                115200
+#define CONFIG_BOOTARGS                "console=ttySC0,115200"
+#define CONFIG_BOOTFILE                /boot/zImage
+#define CONFIG_LOADADDR                0x8E000000
+#define CONFIG_VERSION_VARIABLE
+
+/* CPU and platform */
+#define CONFIG_SH              1
+#define CONFIG_SH3             1
+#define CONFIG_CPU_SH7720      1
+#define CONFIG_MPR2            1
+
+/* U-Boot internals */
+#define CFG_LONGHELP                   /* undef to save memory */
+#define CFG_PROMPT             "=> "   /* Monitor Command Prompt */
+#define CFG_CBSIZE             256     /* Buffer size for input from the Console */
+#define CFG_PBSIZE             256     /* Buffer size for Console output */
+#define CFG_MAXARGS            16      /* max args accepted for monitor commands */
+#define CFG_BARGSIZE           512     /* Buffer size for Boot Arguments passed to kernel */
+#define CFG_BAUDRATE_TABLE     { 115200 }      /* List of legal baudrate settings for this board */
+#define CFG_LOAD_ADDR          (CFG_SDRAM_BASE + 32 * 1024 * 1024)
+#define CFG_MONITOR_BASE       CFG_FLASH_BASE
+#define CFG_MONITOR_LEN                (128 * 1024)
+#define CFG_MALLOC_LEN         (256 * 1024)
+#define CFG_GBL_DATA_SIZE      256
+
+/* Memory */
+#define CFG_SDRAM_BASE         0x8C000000
+#define CFG_SDRAM_SIZE         (64 * 1024 * 1024)
+#define CFG_MEMTEST_START      CFG_SDRAM_BASE
+#define CFG_MEMTEST_END                (CFG_MEMTEST_START + (60 * 1024 * 1024))
+
+/* Flash */
+#define CFG_FLASH_CFI
+#define CFG_FLASH_CFI_DRIVER
+#define CFG_FLASH_EMPTY_INFO
+#define CFG_FLASH_BASE         0xA0000000
+#define CFG_MAX_FLASH_SECT     256
+#define CFG_MAX_FLASH_BANKS    1
+#define CFG_FLASH_BANKS_LIST   { CFG_FLASH_BASE }
+#define CFG_ENV_IS_IN_FLASH
+#define CFG_ENV_SECT_SIZE      (128 * 1024)
+#define CFG_ENV_SIZE           CFG_ENV_SECT_SIZE
+#define CFG_ENV_ADDR           (CFG_MONITOR_BASE + CFG_MONITOR_LEN)
+#define CFG_FLASH_ERASE_TOUT   120000
+#define CFG_FLASH_WRITE_TOUT   500
+
+/* Clocks */
+#define CONFIG_SYS_CLK_FREQ    24000000
+#define TMU_CLK_DIVIDER                4       /* 4 (default), 16, 64, 256 or 1024 */
+#define CFG_HZ                 (CONFIG_SYS_CLK_FREQ / TMU_CLK_DIVIDER)
+
+/* UART */
+#define CFG_SCIF_CONSOLE       1
+#define CONFIG_CONS_SCIF0      1
+
+#endif /* __MPR2_H */
diff --git a/include/configs/mx31ads.h b/include/configs/mx31ads.h
new file mode 100644 (file)
index 0000000..5286e1f
--- /dev/null
@@ -0,0 +1,200 @@
+/*
+ * Copyright (C) 2008, Guennadi Liakhovetski <lg@denx.de>
+ *
+ * Configuration settings for the MX31ADS Freescale board.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the 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
+
+#include <asm/arch/mx31-regs.h>
+
+ /* High Level Configuration Options */
+#define CONFIG_ARM1136         1               /* This is an arm1136 CPU core */
+#define CONFIG_MX31            1               /* in a mx31 */
+#define CONFIG_MX31_HCLK_FREQ  26000000        /* RedBoot says 26MHz */
+#define CONFIG_MX31_CLK32      32000
+
+#define CONFIG_DISPLAY_CPUINFO
+#define CONFIG_DISPLAY_BOARDINFO
+
+/*
+ * Disabled for now due to build problems under Debian and a significant increase
+ * in the final file size: 144260 vs. 109536 Bytes.
+ */
+#if 0
+#define CONFIG_OF_LIBFDT               1
+#define CONFIG_FIT                     1
+#define CONFIG_FIT_VERBOSE             1
+#endif
+
+#define CONFIG_CMDLINE_TAG             1       /* enable passing of ATAGs */
+#define CONFIG_SETUP_MEMORY_TAGS       1
+#define CONFIG_INITRD_TAG              1
+
+/*
+ * Size of malloc() pool
+ */
+#define CFG_MALLOC_LEN         (CFG_ENV_SIZE + 128 * 1024)
+#define CFG_GBL_DATA_SIZE      128     /* size in bytes reserved for initial data */
+
+/*
+ * Hardware drivers
+ */
+
+#define CONFIG_MX31_UART       1
+#define CFG_MX31_UART1         1
+
+#define CONFIG_HARD_SPI                1
+#define CONFIG_MXC_SPI         1
+#define CONFIG_MXC_SPI_IFACE   1       /* Default SPI interface number */
+
+#define CONFIG_RTC_MC13783     1
+
+/* allow to overwrite serial and ethaddr */
+#define CONFIG_ENV_OVERWRITE
+#define CONFIG_CONS_INDEX      1
+#define CONFIG_BAUDRATE                115200
+#define CFG_BAUDRATE_TABLE     {9600, 19200, 38400, 57600, 115200}
+
+/***********************************************************
+ * Command definition
+ ***********************************************************/
+
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_SPI
+#define CONFIG_CMD_DATE
+
+#define CONFIG_BOOTDELAY       3
+
+#define CONFIG_NETMASK         255.255.255.0
+#define CONFIG_IPADDR          192.168.23.168
+#define CONFIG_SERVERIP                192.168.23.2
+#define CONFIG_LOADADDR                (CSD0_BASE + 0x800000)  /* loadaddr env var */
+
+#define        CONFIG_EXTRA_ENV_SETTINGS                                       \
+       "netdev=eth0\0"                                                 \
+       "uboot_addr=0xa0000000\0"                                       \
+       "uboot=mx31ads/u-boot.bin\0"                                    \
+       "kernel=mx31ads/uImage\0"                                       \
+       "nfsroot=/opt/eldk/arm\0"                                       \
+       "bootargs_base=setenv bootargs console=ttymxc0,115200\0"        \
+       "bootargs_nfs=setenv bootargs ${bootargs} root=/dev/nfs "       \
+               "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0"       \
+       "bootcmd=run bootcmd_net\0"                                     \
+       "bootcmd_net=run bootargs_base bootargs_nfs; "                  \
+               "tftpboot ${loadaddr} ${kernel}; bootm\0"               \
+       "prg_uboot=tftpboot ${loadaddr} ${uboot}; "                     \
+               "protect off ${uboot_addr} 0xa003ffff; "                \
+               "erase ${uboot_addr} 0xa003ffff; "                      \
+               "cp.b ${loadaddr} ${uboot_addr} ${filesize}; "          \
+               "setenv filesize; saveenv\0"
+
+#define CONFIG_DRIVER_CS8900   1
+#define CS8900_BASE            0xb4020300
+#define CS8900_BUS16           1       /* follow the Linux driver */
+
+/*
+ * The MX31ADS board seems to have a hardware "peculiarity" confirmed under
+ * U-Boot, RedBoot and Linux: the ethernet Rx signal is reaching the CS8900A
+ * controller inverted. The controller is capable of detecting and correcting
+ * this, but it needs 4 network packets for that. Which means, at startup, you
+ * will not receive answers to the first 4 packest, unless there have been some
+ * broadcasts on the network, or your board is on a hub. Reducing the ARP
+ * timeout from default 5 seconds to 200ms we speed up the initial TFTP
+ * transfer, should the user wish one, significantly.
+ */
+#define CONFIG_ARP_TIMEOUT     200UL
+
+/*
+ * Miscellaneous configurable options
+ */
+#define CFG_LONGHELP           /* undef to save memory */
+#define CFG_PROMPT             "=> "
+#define CFG_CBSIZE             256             /* Console I/O Buffer Size */
+/* Print Buffer Size */
+#define CFG_PBSIZE             (CFG_CBSIZE + sizeof(CFG_PROMPT) + 16)
+#define CFG_MAXARGS            16              /* max number of command args */
+#define CFG_BARGSIZE           CFG_CBSIZE      /* Boot Argument Buffer Size */
+
+#define CFG_MEMTEST_START      0               /* memtest works on */
+#define CFG_MEMTEST_END                0x10000
+
+#undef CFG_CLKS_IN_HZ          /* everything, incl board info, in Hz */
+
+#define CFG_LOAD_ADDR          CONFIG_LOADADDR
+
+#define CFG_HZ                 32000
+
+#define CONFIG_CMDLINE_EDITING 1
+
+/*-----------------------------------------------------------------------
+ * Stack sizes
+ *
+ * The stack sizes are set up in start.S using the settings below
+ */
+#define CONFIG_STACKSIZE       (128 * 1024)    /* regular stack */
+
+/*-----------------------------------------------------------------------
+ * Physical Memory Map
+ */
+#define CONFIG_NR_DRAM_BANKS   1
+#define PHYS_SDRAM_1           CSD0_BASE
+#define PHYS_SDRAM_1_SIZE      (128 * 1024 * 1024)
+
+/*-----------------------------------------------------------------------
+ * FLASH and environment organization
+ */
+#define CFG_FLASH_BASE         CS0_BASE
+#define CFG_MAX_FLASH_BANKS    1               /* max number of memory banks */
+#define CFG_MAX_FLASH_SECT     262             /* max number of sectors on one chip */
+#define CFG_MONITOR_BASE       CFG_FLASH_BASE  /* Monitor at beginning of flash */
+#define CFG_MONITOR_LEN                (256 * 1024)    /* Reserve 256KiB */
+
+#define        CFG_ENV_IS_IN_FLASH     1
+#define CFG_ENV_SECT_SIZE      (32 * 1024)
+#define CFG_ENV_SIZE           CFG_ENV_SECT_SIZE
+
+/* Address and size of Redundant Environment Sector    */
+#define CFG_ENV_OFFSET_REDUND  (CFG_ENV_OFFSET + CFG_ENV_SIZE)
+#define CFG_ENV_SIZE_REDUND    CFG_ENV_SIZE
+
+/* S29WS256N NOR flash has 4 32KiB small sectors at the beginning and at the end.
+ * The rest of 32MiB is in 128KiB big sectors. U-Boot occupies the low 4 sectors,
+ * if we put environment next to it, we will have to occupy 128KiB for it.
+ * Putting it at the top of flash we use only 32KiB. */
+#define CFG_ENV_ADDR           (CFG_MONITOR_BASE + CFG_ENV_SECT_SIZE)
+
+/*-----------------------------------------------------------------------
+ * CFI FLASH driver setup
+ */
+#define CFG_FLASH_CFI                  1 /* Flash memory is CFI compliant */
+#define CFG_FLASH_CFI_DRIVER           1 /* Use drivers/cfi_flash.c */
+#define CONFIG_FLASH_SPANSION_S29WS_N  1 /* A non-standard buffered write algorithm */
+#define CFG_FLASH_USE_BUFFER_WRITE     1 /* Use buffered writes (~10x faster) */
+#define CFG_FLASH_PROTECTION           1 /* Use hardware sector protection */
+
+/*
+ * JFFS2 partitions
+ */
+#undef CONFIG_JFFS2_CMDLINE
+#define CONFIG_JFFS2_DEV       "nor0"
+
+#endif /* __CONFIG_H */
index f75e194..8dde1ef 100644 (file)
@@ -52,6 +52,7 @@
 #define CONFIG_PCI             1
 #define CONFIG_PCI_PNP         1
 /* #define CONFIG_PCI_SCAN_SHOW        1 */
+#define CONFIG_PCIAUTO_SKIP_HOST_BRIDGE        1
 
 #define CONFIG_PCI_MEM_BUS     0x40000000
 #define CONFIG_PCI_MEM_PHYS    CONFIG_PCI_MEM_BUS
index 893924b..ba6d932 100644 (file)
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
+
+/* new uImage format support */
+#define CONFIG_FIT             1
+#define CONFIG_OF_LIBFDT       1
+#define CONFIG_FIT_VERBOSE     1 /* enable fit_format_{error,warning}() */
+
 /*-----------------------------------------------------------------------
  * High Level Configuration Options
  *----------------------------------------------------------------------*/
index ed41b2f..ac72f98 100644 (file)
        "upd=run load update\0"                                         \
        "ipaddr=10.0.0.233\0"                                           \
        "serverip=10.0.0.152\0"                                         \
-       "netmask=255.255.0.0\0"                                 \
+       "netmask=255.255.0.0\0"                                         \
        "ethaddr=c6:6f:13:36:f3:81\0"                                   \
        "eth1addr=c6:6f:13:36:f3:82\0"                                  \
        "mtdparts=IXP4XX-Flash.0:504k@0(uboot),4k@504k(env),"           \
index 18d0c87..2ce39c9 100644 (file)
@@ -69,6 +69,7 @@
 #define CONFIG_PCI             1
 #define CONFIG_PCI_PNP         1
 #define CONFIG_PCI_SCAN_SHOW   1
+#define CONFIG_PCIAUTO_SKIP_HOST_BRIDGE        1
 
 #define CONFIG_PCI_MEM_BUS     0x40000000
 #define CONFIG_PCI_MEM_PHYS    CONFIG_PCI_MEM_BUS
index e164019..d6bcc8e 100644 (file)
  */
 
 /*
- * This file contains the configuration parameters for the dbau1x00 board.
+ * This file contains the configuration parameters for qemu-mips target.
  */
 
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
-#define CONFIG_MIPS32          1  /* MIPS32 CPU core   */
-#define CONFIG_QEMU_MIPS        1
+#define CONFIG_MIPS32          1       /* MIPS32 CPU core */
+#define CONFIG_QEMU_MIPS       1
 #define CONFIG_MISC_INIT_R
 
 /*IP address is default used by Qemu*/
-#define CONFIG_IPADDR          10.0.2.15            /* Our IP address */
-#define CONFIG_SERVERIP                10.0.2.2             /* Server IP address*/
+#define CONFIG_IPADDR          10.0.2.15       /* Our IP address */
+#define CONFIG_SERVERIP                10.0.2.2        /* Server IP address */
 
-#define CONFIG_BOOTDELAY       10      /* autoboot after 10 seconds    */
+#define CONFIG_BOOTDELAY       10      /* autoboot after 10 seconds */
 
 #define CONFIG_BAUDRATE                115200
 
 /* valid baudrates */
 #define CFG_BAUDRATE_TABLE     { 9600, 19200, 38400, 57600, 115200 }
 
-#define        CONFIG_TIMESTAMP                /* Print image info with timestamp */
-#undef CONFIG_BOOTARGS
+#define CONFIG_TIMESTAMP               /* Print image info with timestamp */
+#undef CONFIG_BOOTARGS
 
-#define        CONFIG_EXTRA_ENV_SETTINGS                                       \
+#define CONFIG_EXTRA_ENV_SETTINGS                                      \
        "addmisc=setenv bootargs ${bootargs} "                          \
                "console=ttyS0,${baudrate} "                            \
                "panic=1\0"                                             \
@@ -56,7 +56,6 @@
 
 #define CONFIG_BOOTCOMMAND     "bootp;bootelf"
 
-
 /*
  * BOOTP options
  */
@@ -65,7 +64,6 @@
 #define CONFIG_BOOTP_GATEWAY
 #define CONFIG_BOOTP_HOSTNAME
 
-
 /*
  * Command line configuration.
  */
 #define CONFIG_CMD_ELF
 #define CONFIG_CMD_FAT
 #define CONFIG_CMD_EXT2
-#undef  CONFIG_CMD_IMLS
-#undef  CONFIG_CMD_FLASH
-#undef  CONFIG_CMD_LOADB
-#undef  CONFIG_CMD_LOADS
+#undef CONFIG_CMD_LOADB
+#undef CONFIG_CMD_LOADS
 #define CONFIG_CMD_DHCP
 
 #define CONFIG_DRIVER_NE2000
 #define CONFIG_DRIVER_NE2000_BASE      (0xb4000300)
 
-#define CFG_NO_FLASH
 #define CFG_NS16550
 #define CFG_NS16550_SERIAL
-#define CFG_NS16550_REG_SIZE    1
-#define CFG_NS16550_CLK         115200
-#define CFG_NS16550_COM1        (0xb40003f8)
+#define CFG_NS16550_REG_SIZE   1
+#define CFG_NS16550_CLK                115200
+#define CFG_NS16550_COM1       (0xb40003f8)
 #define CONFIG_CONS_INDEX      1
 
 #define CONFIG_CMD_IDE
 #define CONFIG_DOS_PARTITION
 
-#define CFG_IDE_MAXBUS 2
+#define CFG_IDE_MAXBUS         2
 #define CFG_ATA_IDE0_OFFSET    (0x1f0)
 #define CFG_ATA_IDE1_OFFSET    (0x170)
 #define CFG_ATA_DATA_OFFSET    (0)
 /*
  * Miscellaneous configurable options
  */
-#define        CFG_LONGHELP                            /* undef to save memory      */
+#define CFG_LONGHELP                           /* undef to save memory */
 
-#define        CFG_PROMPT              "qemu-mips # "  /* Monitor Command Prompt    */
+#define CFG_PROMPT             "qemu-mips # "  /* Monitor Command Prompt */
 
 #define CONFIG_AUTO_COMPLETE
 #define CONFIG_CMDLINE_EDITING
 #define CFG_HUSH_PARSER
 #define CFG_PROMPT_HUSH_PS2    "> "
 
-#define        CFG_CBSIZE              256             /* Console I/O Buffer Size   */
-#define        CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16)  /* Print Buffer Size */
-#define        CFG_MAXARGS             16              /* max number of command args*/
+#define CFG_CBSIZE             256             /* Console I/O Buffer Size */
+#define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16)  /* Print Buffer Size */
+#define CFG_MAXARGS            16              /* max number of command args */
 
 #define CFG_MALLOC_LEN         128*1024
 
 
 #define CFG_MHZ                        132
 
-#define CFG_HZ                  (CFG_MHZ * 1000000)
+#define CFG_HZ                 (CFG_MHZ * 1000000)
 
-#define CFG_SDRAM_BASE         0x80000000     /* Cached addr */
+#define CFG_SDRAM_BASE         0x80000000      /* Cached addr */
 
-#define        CFG_LOAD_ADDR           0x81000000     /* default load address  */
+#define CFG_LOAD_ADDR          0x81000000      /* default load address */
 
 #define CFG_MEMTEST_START      0x80100000
 #define CFG_MEMTEST_END                0x80800000
  */
 
 /* The following #defines are needed to get flash environment right */
-#define        CFG_MONITOR_BASE        TEXT_BASE
-#define        CFG_MONITOR_LEN         (192 << 10)
+#define CFG_MONITOR_BASE       TEXT_BASE
+#define CFG_MONITOR_LEN                (192 << 10)
 
 #define CFG_INIT_SP_OFFSET     0x400000
 
 /* We boot from this flash, selected with dip switch */
 #define CFG_FLASH_BASE         0xbfc00000
+#define CFG_MAX_FLASH_BANKS    1
+#define CFG_MAX_FLASH_SECT     128
+#define CFG_FLASH_CFI          1       /* Flash memory is CFI compliant */
+#define CFG_FLASH_CFI_DRIVER   1
+#define CFG_FLASH_USE_BUFFER_WRITE     1
+
+#define CFG_ENV_IS_IN_FLASH    1
+#define CFG_ENV_ADDR           (CFG_FLASH_BASE + 0x40000)
+
+/* Address and size of Primary Environment Sector */
+#define CFG_ENV_SIZE           0x8000
 
-#define        CFG_ENV_IS_NOWHERE      1
+#define CONFIG_ENV_OVERWRITE   1
 
-/* Address and size of Primary Environment Sector      */
-#define CFG_ENV_SIZE           0x10000
 #undef CONFIG_NET_MULTI
 
-#define MEM_SIZE 128
+#define MEM_SIZE               128
 
 #undef CONFIG_MEMSIZE_IN_BYTES
 
 #define CFG_ICACHE_SIZE                16384
 #define CFG_CACHELINE_SIZE     32
 
-#endif /* __CONFIG_H */
+#endif /* __CONFIG_H */
diff --git a/include/configs/r2dplus.h b/include/configs/r2dplus.h
new file mode 100644 (file)
index 0000000..c20baca
--- /dev/null
@@ -0,0 +1,150 @@
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#undef DEBUG
+
+#define CONFIG_SH              1
+#define CONFIG_SH4             1
+#define CONFIG_CPU_SH7751      1
+#define CONFIG_CPU_SH_TYPE_R   1
+#define CONFIG_R2DPLUS         1
+#define __LITTLE_ENDIAN__      1
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_DFL
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_EXT2
+#define CONFIG_DOS_PARTITION
+
+/* SCIF */
+#define CFG_SCIF_CONSOLE       1
+#define CONFIG_BAUDRATE                115200
+#define CONFIG_CONS_SCIF1      1
+#define BOARD_LATE_INIT                1
+
+#define CONFIG_BOOTDELAY       -1
+#define CONFIG_BOOTARGS                "console=ttySC0,115200"
+#define CONFIG_ENV_OVERWRITE   1
+
+/* Network setting */
+#define CONFIG_NETMASK         255.0.0.0
+#define CONFIG_IPADDR          10.0.192.51
+#define CONFIG_SERVERIP                10.0.0.1
+#define CONFIG_GATEWAYIP       10.0.0.1
+
+/* SDRAM */
+#define CFG_SDRAM_BASE         (0x8C000000)
+#define CFG_SDRAM_SIZE         (0x04000000)
+
+#define CFG_LONGHELP
+#define CFG_PROMPT             "=> "
+#define CFG_CBSIZE             256
+#define CFG_PBSIZE             256
+#define CFG_MAXARGS            16
+#define CFG_BARGSIZE           512
+/* List of legal baudrate settings for this board */
+#define CFG_BAUDRATE_TABLE     { 115200, 57600, 38400, 19200, 9600 }
+
+#define CFG_MEMTEST_START      (CFG_SDRAM_BASE)
+#define CFG_MEMTEST_END                (TEXT_BASE - 0x100000)
+
+#define CFG_LOAD_ADDR          (CFG_SDRAM_BASE + 32 * 1024 * 1024)
+/* Address of u-boot image in Flash */
+#define CFG_MONITOR_BASE       (CFG_FLASH_BASE)
+#define CFG_MONITOR_LEN                (128 * 1024)
+/* Size of DRAM reserved for malloc() use */
+#define CFG_MALLOC_LEN         (256 * 1024)
+/* size in bytes reserved for initial data */
+#define CFG_GBL_DATA_SIZE      (256)
+#define CFG_BOOTMAPSZ          (8 * 1024 * 1024)
+
+/*
+ * NOR Flash
+ */
+#define CFG_FLASH_CFI
+#define CFG_FLASH_CFI_DRIVER
+
+#if defined(CONFIG_R2DPLUS_OLD)
+#define CFG_FLASH_BASE         (0xA0000000)
+#define CFG_MAX_FLASH_BANKS (1)        /* Max number of
+                                * Flash memory banks
+                                */
+#define CFG_MAX_FLASH_SECT  142
+#define CFG_FLASH_BANKS_LIST    { CFG_FLASH_BASE }
+
+#else /* CONFIG_R2DPLUS_OLD */
+
+#define CFG_FLASH_BASE         (0xA0000000)
+#define CFG_FLASH_CFI_WIDTH    0x04    /* 32bit */
+#define CFG_MAX_FLASH_BANKS    (2)
+#define CFG_MAX_FLASH_SECT     270
+#define CFG_FLASH_BANKS_LIST    { CFG_FLASH_BASE,\
+                       CFG_FLASH_BASE + 0x100000,\
+                       CFG_FLASH_BASE + 0x400000,\
+                       CFG_FLASH_BASE + 0x700000, }
+#endif /* CONFIG_R2DPLUS_OLD */
+
+#define CFG_ENV_IS_IN_FLASH
+#define CFG_ENV_SECT_SIZE      0x20000
+#define CFG_ENV_SIZE           (CFG_ENV_SECT_SIZE)
+#define CFG_ENV_ADDR           (CFG_MONITOR_BASE + CFG_MONITOR_LEN)
+#define CFG_FLASH_ERASE_TOUT   120000
+#define CFG_FLASH_WRITE_TOUT   500
+
+/*
+ * SuperH Clock setting
+ */
+#define CONFIG_SYS_CLK_FREQ    60000000
+#define TMU_CLK_DIVIDER                4
+#define CFG_HZ                 (CONFIG_SYS_CLK_FREQ / TMU_CLK_DIVIDER)
+#define        CFG_PLL_SETTLING_TIME   100/* in us */
+
+/*
+ * IDE support
+ */
+#define CONFIG_IDE_RESET       1
+#define CFG_PIO_MODE           1
+#define CFG_IDE_MAXBUS         1 /* IDE bus */
+#define CFG_IDE_MAXDEVICE      1
+#define CFG_ATA_BASE_ADDR      0xb4000000
+#define CFG_ATA_STRIDE         2 /* 1bit shift */
+#define CFG_ATA_DATA_OFFSET    0x1000  /* data reg offset */
+#define CFG_ATA_REG_OFFSET     0x1000  /* reg offset */
+#define CFG_ATA_ALT_OFFSET     0x800   /* alternate register offset */
+
+/*
+ * SuperH PCI Bridge Configration
+ */
+#define CONFIG_PCI
+#define CONFIG_SH4_PCI
+#define CONFIG_SH7751_PCI
+#define CONFIG_PCI_PNP
+#define CONFIG_PCI_SCAN_SHOW   1
+#define __io
+#define __mem_pci
+
+#define CONFIG_PCI_MEM_BUS     0xFD000000      /* Memory space base addr */
+#define CONFIG_PCI_MEM_PHYS    CONFIG_PCI_MEM_BUS
+#define CONFIG_PCI_MEM_SIZE    0x01000000      /* Size of Memory window */
+#define CONFIG_PCI_IO_BUS      0xFE240000      /* IO space base address */
+#define CONFIG_PCI_IO_PHYS     CONFIG_PCI_IO_BUS
+#define CONFIG_PCI_IO_SIZE     0x00040000      /* Size of IO window */
+
+/*
+ * Network device (RTL8139) support
+ */
+#define CONFIG_NET_MULTI
+#define CONFIG_RTL8139
+#define _IO_BASE               0x00000000
+#define KSEG1ADDR(x)           (x)
+
+#endif /* __CONFIG_H */
diff --git a/include/configs/r7780mp.h b/include/configs/r7780mp.h
new file mode 100644 (file)
index 0000000..42787f4
--- /dev/null
@@ -0,0 +1,165 @@
+/*
+ * Configuation settings for the Renesas R7780MP board
+ *
+ * Copyright (C) 2007 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+ * Copyright (C) 2008 Yusuke Goda <goda.yusuke@renesas.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 __R7780RP_H
+#define __R7780RP_H
+
+#undef DEBUG
+#define CONFIG_SH              1
+#define CONFIG_SH4A            1
+#define CONFIG_CPU_SH7780      1
+#define CONFIG_R7780MP         1
+#define __LITTLE_ENDIAN 1
+
+/*
+ * Command line configuration.
+ */
+#define CONFIG_CMD_SDRAM
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_MEMORY
+#define CONFIG_CMD_PCI
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_ENV
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_IDE
+#define CONFIG_CMD_EXT2
+#define CONFIG_DOS_PARTITION
+
+#define CFG_SCIF_CONSOLE       1
+#define CONFIG_BAUDRATE                115200
+#define CONFIG_CONS_SCIF0      1
+
+#define CONFIG_BOOTDELAY       3
+#define CONFIG_BOOTARGS                "console=ttySC0,115200"
+#define CONFIG_ENV_OVERWRITE   1
+
+/* check for keypress on bootdelay==0 */
+/*#define CONFIG_ZERO_BOOTDELAY_CHECK*/
+
+/* Network setting */
+#define CONFIG_NETMASK         255.0.0.0
+#define CONFIG_IPADDR          10.0.192.82
+#define CONFIG_SERVERIP                10.0.0.1
+#define CONFIG_GATEWAYIP       10.0.0.1
+
+#define CFG_SDRAM_BASE         (0x08000000)
+#define CFG_SDRAM_SIZE         (128 * 1024 * 1024)
+
+#define CFG_LONGHELP
+#define CFG_PROMPT             "=> "
+#define CFG_CBSIZE             256
+#define CFG_PBSIZE             256
+#define CFG_MAXARGS            16
+#define CFG_BARGSIZE   512
+/* List of legal baudrate settings for this board */
+#define CFG_BAUDRATE_TABLE     { 115200, 57600, 38400, 19200, 9600 }
+
+#define CFG_MEMTEST_START      (CFG_SDRAM_BASE)
+#define CFG_MEMTEST_END                (TEXT_BASE - 0x100000)
+
+/* NOR Flash (S29PL127J60TFI130) */
+#define CFG_FLASH_BASE         (0xA0000000)
+#define CFG_FLASH_CFI_WIDTH FLASH_CFI_32BIT
+#define CFG_MAX_FLASH_BANKS (2)
+#define CFG_MAX_FLASH_SECT  270
+#define CFG_FLASH_BANKS_LIST    { CFG_FLASH_BASE,\
+                               CFG_FLASH_BASE + 0x100000,\
+                               CFG_FLASH_BASE + 0x400000,\
+                               CFG_FLASH_BASE + 0x700000, }
+
+#define CFG_LOAD_ADDR          (CFG_SDRAM_BASE + 4 * 1024 * 1024)
+/* Address of u-boot image in Flash */
+#define CFG_MONITOR_BASE       (CFG_FLASH_BASE)
+#define CFG_MONITOR_LEN                (112 * 1024)
+/* Size of DRAM reserved for malloc() use */
+#define CFG_MALLOC_LEN         (256 * 1024)
+
+/* size in bytes reserved for initial data */
+#define CFG_GBL_DATA_SIZE      (256)
+#define CFG_BOOTMAPSZ          (8 * 1024 * 1024)
+#define CFG_RX_ETH_BUFFER      (8)
+
+#define CFG_FLASH_CFI
+#define CFG_FLASH_CFI_DRIVER
+#undef CFG_FLASH_CFI_BROKEN_TABLE
+#undef  CFG_FLASH_QUIET_TEST
+/* print 'E' for empty sector on flinfo */
+#define CFG_FLASH_EMPTY_INFO
+
+#define CFG_ENV_IS_IN_FLASH
+#define CFG_ENV_SECT_SIZE      (16 * 1024)
+#define CFG_ENV_SIZE           (CFG_ENV_SECT_SIZE)
+#define CFG_ENV_ADDR           (CFG_MONITOR_BASE + CFG_MONITOR_LEN)
+#define CFG_FLASH_ERASE_TOUT   120000
+#define CFG_FLASH_WRITE_TOUT   500
+
+/* Board Clock */
+#define CONFIG_SYS_CLK_FREQ    33333333
+#define TMU_CLK_DIVIDER                4
+#define CFG_HZ (CONFIG_SYS_CLK_FREQ / TMU_CLK_DIVIDER)
+
+/* PCI Controller */
+#if defined(CONFIG_CMD_PCI)
+#define CONFIG_PCI
+#define CONFIG_SH4_PCI
+#define CONFIG_SH7780_PCI
+#define CONFIG_PCI_PNP
+#define CONFIG_PCI_SCAN_SHOW   1
+#define __io
+#define __mem_pci
+
+#define CONFIG_PCI_MEM_BUS     0xFD000000      /* Memory space base addr */
+#define CONFIG_PCI_MEM_PHYS    CONFIG_PCI_MEM_BUS
+#define CONFIG_PCI_MEM_SIZE    0x01000000      /* Size of Memory window */
+
+#define CONFIG_PCI_IO_BUS      0xFE200000      /* IO space base address */
+#define CONFIG_PCI_IO_PHYS     CONFIG_PCI_IO_BUS
+#define CONFIG_PCI_IO_SIZE     0x00200000      /* Size of IO window */
+#endif /* CONFIG_CMD_PCI */
+
+#if defined(CONFIG_CMD_NET)
+/* #define CONFIG_NET_MULTI
+   #define CONFIG_RTL8169 */
+/* AX88696L Support(NE2000 base chip) */
+#define CONFIG_DRIVER_NE2000
+#define CONFIG_DRIVER_AX88796L
+#define CONFIG_DRIVER_NE2000_BASE      0xA4100000
+#endif
+
+/* Compact flash Support */
+#if defined(CONFIG_CMD_IDE)
+#define CONFIG_IDE_RESET        1
+#define CFG_PIO_MODE            1
+#define CFG_IDE_MAXBUS          1   /* IDE bus */
+#define CFG_IDE_MAXDEVICE       1
+#define CFG_ATA_BASE_ADDR       0xb4000000
+#define CFG_ATA_STRIDE          2               /* 1bit shift */
+#define CFG_ATA_DATA_OFFSET     0x1000          /* data reg offset */
+#define CFG_ATA_REG_OFFSET      0x1000          /* reg offset */
+#define CFG_ATA_ALT_OFFSET      0x800           /* alternate register offset */
+#endif /* CONFIG_CMD_IDE */
+
+#endif /* __R7780RP_H */
index d00c22f..133cbcf 100644 (file)
 
 #define        CONFIG_EXTRA_ENV_SETTINGS                                       \
        "netdev=eth0\0"                                                 \
-       "hostname=sbc8349\0"                                    \
+       "hostname=sbc8349\0"                                            \
        "nfsargs=setenv bootargs root=/dev/nfs rw "                     \
                "nfsroot=${serverip}:${rootpath}\0"                     \
        "ramargs=setenv bootargs root=/dev/ram rw\0"                    \
                "era fff00000 fff3ffff; cp.b 100000 fff00000 ${filesize}\0"     \
        "upd=run load update\0"                                         \
        "fdtaddr=400000\0"                                              \
-       "fdtfile=sbc8349.dtb\0"                                 \
+       "fdtfile=sbc8349.dtb\0"                                         \
        ""
 
 #define CONFIG_NFSBOOTCOMMAND                                          \
index 516203a..49a7234 100644 (file)
@@ -87,6 +87,7 @@
  */
 #define CFG_CCSRBAR_DEFAULT    0xff700000      /* CCSRBAR Default */
 #define CFG_CCSRBAR            0xe0000000      /* relocated CCSRBAR */
+#define CFG_CCSRBAR_PHYS       CFG_CCSRBAR     /* physical addr of CCSRBAR */
 #define CFG_IMMR               CFG_CCSRBAR     /* PQII uses CFG_IMMR */
 
 #define CFG_PCI1_ADDR  (CFG_CCSRBAR+0x8000)
index f9ede5f..81a1e07 100644 (file)
@@ -93,6 +93,7 @@
 #else
   #define CFG_CCSRBAR          0xff700000      /* default CCSRBAR      */
 #endif
+#define CFG_CCSRBAR_PHYS       CFG_CCSRBAR     /* physical addr of CCSRBAR */
 #define CFG_IMMR               CFG_CCSRBAR     /* PQII uses CFG_IMMR   */
 
 #define CFG_DDR_SDRAM_BASE     0x00000000      /* DDR is system memory  */
index 8491d97..4df461d 100644 (file)
@@ -81,8 +81,8 @@
 #include <config_cmd_default.h>
 
 #define CONFIG_CMD_PCI
+#define CONFIG_CMD_SATA
 #define CONFIG_CMD_JFFS2
-#define CONFIG_CMD_IDE
 #define CONFIG_CMD_NET
 #define CONFIG_CMD_EEPROM
 
 #define PCNET_HAS_PROM         1
 
 /************************************************************
- * IDE/ATA stuff
- ************************************************************/
-#define CFG_IDE_MAXBUS         1   /* max. 2 IDE busses        */
-#define CFG_IDE_MAXDEVICE      (CFG_IDE_MAXBUS*2) /* max. 2 drives per IDE bus */
-
-#define CFG_ATA_IDE0_OFFSET    0x01F0  /* ide0 offste */
-/*#define CFG_ATA_IDE1_OFFSET  0x0170  /###* ide1 offset */
-#define CFG_ATA_DATA_OFFSET    0       /* data reg offset      */
-#define CFG_ATA_REG_OFFSET     0       /* reg offset */
-#define CFG_ATA_ALT_OFFSET     0x200   /* alternate register offset */
-#define CFG_ATA_BASE_ADDR       0
-
-#undef CONFIG_IDE_LED                  /* no led for ide supported     */
-#undef  CONFIG_IDE_RESET               /* reset for ide unsupported... */
-#undef  CONFIG_IDE_RESET_ROUTINE       /* no special reset function */
-
-/************************************************************
 *SATA/Native Stuff
 ************************************************************/
-#define CFG_SATA_SUPPORTED      1
 #define CFG_SATA_MAXBUS         2       /*Max Sata buses supported */
 #define CFG_SATA_DEVS_PER_BUS   2      /*Max no. of devices per bus/port */
-#define CFG_SATA_MAXDEVICES     (CFG_SATA_MAXBUS* CFG_SATA_DEVS_PER_BUS)
+#define CFG_SATA_MAX_DEVICE     (CFG_SATA_MAXBUS* CFG_SATA_DEVS_PER_BUS)
 #define CFG_ATA_PIIX            1       /*Supports ata_piix driver */
 
 /************************************************************
- * ATAPI support (experimental)
- ************************************************************/
-#define CONFIG_ATAPI                   /* enable ATAPI Support */
-
-/************************************************************
  * DISK Partition support
  ************************************************************/
 #define CONFIG_DOS_PARTITION
index dfa8779..555316f 100644 (file)
 #if !defined(CONFIG_NAND_U_BOOT) && !defined(CONFIG_NAND_SPL)
 #define CONFIG_DDR_DATA_EYE            /* use DDR2 optimization        */
 #endif
+#define CFG_MEM_TOP_HIDE       (4 << 10) /* don't use last 4kbytes     */
+                                       /* 440EPx errata CHIP 11        */
 
 /*
  * I2C
                "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}"      \
                ":${hostname}:${netdev}:off panic=1\0"                  \
        "addtty=setenv bootargs ${bootargs} console=ttyS0,${baudrate}\0"\
-       "addmisc=setenv bootargs ${bootargs} mem=${mem}\0"              \
+       "addmisc=setenv bootargs ${bootargs}\0"                         \
        "flash_nfs=run nfsargs addip addtty addmisc;"                   \
                "bootm ${kernel_addr}\0"                                \
        "flash_self=run ramargs addip addtty addmisc;"                  \
index 2efc8f1..f46c464 100644 (file)
@@ -31,6 +31,7 @@
 #undef CONFIG_8xx_CONS_NONE
 
 #define CONFIG_MII
+#define CONFIG_MII_INIT                1
 #undef CONFIG_ETHER_ON_FEC1
 #define CONFIG_ETHER_ON_FEC2
 #define FEC_ENET
 #define        BOOTFLAG_COLD   0x01            /* Normal Power-On: Boot from FLASH     */
 #define BOOTFLAG_WARM  0x02            /* Software reboot                      */
 
-/* Machine type
-*/
-#define _MACH_8xx (_MACH_fads)
-
 #endif /* __CONFIG_H */
index a9ce015..49213dc 100644 (file)
 
 #ifdef CONFIG_PCI
     #define CONFIG_CMD_PCI
+    #define CONFIG_PCIAUTO_SKIP_HOST_BRIDGE    1
 #endif
 
 #ifdef CONFIG_POST
index 047e1cf..fc5d0cc 100644 (file)
 #define CFG_CCSRBAR_DEFAULT    0xff700000      /* CCSRBAR Default      */
 #endif
 #define CFG_CCSRBAR             0xfdf00000      /* relocated CCSRBAR    */
+#define CFG_CCSRBAR_PHYS       CFG_CCSRBAR     /* physical addr of CCSRBAR */
 #define CFG_IMMR               CFG_CCSRBAR     /* PQII uses CFG_IMMR   */
 
 
index e09dd71..15f690a 100644 (file)
 #define CFG_CCSRBAR_DEFAULT    0xff700000      /* CCSRBAR Default      */
 #endif
 #define CFG_CCSRBAR            0xe0000000      /* relocated CCSRBAR    */
+#define CFG_CCSRBAR_PHYS       CFG_CCSRBAR     /* physical addr of CCSRBAR */
 #define CFG_IMMR               CFG_CCSRBAR     /* PQII uses CFG_IMMR   */
 
 
index b035857..a3ab798 100644 (file)
@@ -97,6 +97,7 @@
 #define        FEC_ENET                1       /* eth.c needs it that way... */
 #undef CFG_DISCOVER_PHY
 #define CONFIG_MII             1
+#define CONFIG_MII_INIT                1
 #undef CONFIG_RMII
 
 #define CONFIG_ETHER_ON_FEC1   1
@@ -594,7 +595,5 @@ typedef unsigned int led_id_t;
 
 #define OF_CPU                 "PowerPC,MPC870@0"
 #define OF_TBCLK               (MPC8XX_HZ / 16)
-#define CONFIG_OF_HAS_BD_T     1
-#define CONFIG_OF_HAS_UBOOT_ENV        1
 
 #endif /* __CONFIG_H */
index c1c2e03..3c2de40 100644 (file)
 #define        CONFIG_FEC_ENET         1       /* use FEC ethernet  */
 #define FEC_ENET
 #define CONFIG_MII
+#define CONFIG_MII_INIT                1
 #define CFG_DISCOVER_PHY       1
 
 #endif /* __CONFIG_H */
index c9320c2..30fb303 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2007 Michal Simek
+ * (C) Copyright 2007-2008 Michal Simek
  *
  * Michal SIMEK <monstr@monstr.eu>
  *
 #define        CONFIG_XUPV2P           1
 
 /* uart */
+#ifdef XILINX_UARTLITE_BASEADDR
 #define        CONFIG_XILINX_UARTLITE
-#define        CONFIG_SERIAL_BASE      XILINX_UART_BASEADDR
-#define        CONFIG_BAUDRATE         XILINX_UART_BAUDRATE
+#define        CONFIG_SERIAL_BASE      XILINX_UARTLITE_BASEADDR
+#define        CONFIG_BAUDRATE         XILINX_UARTLITE_BAUDRATE
 #define        CFG_BAUDRATE_TABLE      { CONFIG_BAUDRATE }
-
-/* ethernet */
-#define CONFIG_EMAC    1
-#define XPAR_EMAC_0_DEVICE_ID  XPAR_XEMAC_NUM_INSTANCES
+#else
+#ifdef XILINX_UART16550_BASEADDR
+#define CFG_NS16550
+#define CFG_NS16550_SERIAL
+#define CFG_NS16550_REG_SIZE   4
+#define CONFIG_CONS_INDEX      1
+#define CFG_NS16550_COM1       XILINX_UART16550_BASEADDR
+#define CFG_NS16550_CLK                XILINX_UART16550_CLOCK_HZ
+#define        CONFIG_BAUDRATE         115200
+#define        CFG_BAUDRATE_TABLE      { 9600, 115200 }
+#endif
+#endif
 
 /*
  * setting reset address
  */
 /* #define     CFG_RESET_ADDRESS       0x36000000 */
 
+/* ethernet */
+#ifdef XILINX_EMAC_BASEADDR
+#define CONFIG_XILINX_EMAC     1
+#else
+#ifdef XILINX_EMACLITE_BASEADDR
+#define CONFIG_XILINX_EMACLITE 1
+#endif
+#endif
+#undef ET_DEBUG
+
 /* gpio */
 #ifdef XILINX_GPIO_BASEADDR
 #define        CFG_GPIO_0              1
 #include <config_cmd_default.h>
 
 #undef CONFIG_CMD_FLASH
+#undef CONFIG_CMD_JFFS2
 #undef CONFIG_CMD_IMLS
 
 #define CONFIG_CMD_ASKENV
 #define        CONFIG_DOS_PARTITION
 #endif
 
+#define CONFIG_CMDLINE_EDITING
+#define CONFIG_OF_LIBFDT       1 /* flat device tree */
+
 #endif /* __CONFIG_H */
index fbd5e17..f20c738 100644 (file)
 #include "config.h"
 
 /*number of protected area*/
-#ifdef CONFIG_NEW_PARTITION
-# define NB_DATAFLASH_AREA     6
-#else
-# define NB_DATAFLASH_AREA     4
-#endif
+#define NB_DATAFLASH_AREA              5
 
 #ifdef CFG_NO_FLASH
 
@@ -134,7 +130,10 @@ typedef struct _AT91S_DATAFLASH_INFO {
        unsigned int id;                        /* device id */
 } AT91S_DATAFLASH_INFO, *AT91PS_DATAFLASH_INFO;
 
-
+struct dataflash_addr {
+       unsigned long addr;
+       int cs;
+};
 /*-------------------------------------------------------------------------------------------------*/
 
 #define AT45DB161      0x2c
@@ -211,9 +210,9 @@ extern int read_dataflash (unsigned long addr, unsigned long size, char *result)
 extern int write_dataflash (unsigned long addr, unsigned long dest, unsigned long size);
 extern void dataflash_print_info (void);
 extern void dataflash_perror (int err);
+extern void AT91F_DataflashSetEnv (void);
 
-#ifdef CONFIG_NEW_DF_PARTITION
-extern int AT91F_DataflashSetEnv (void); #endif
-#endif
-
+extern struct dataflash_addr cs[CFG_MAX_DATAFLASH_BANKS];
+extern dataflash_protect_t area_list[NB_DATAFLASH_AREA];
+extern AT91S_DATAFLASH_INFO dataflash_info[];
 #endif
index af605ab..c4f7c33 100644 (file)
 # endif
 #endif /* CFG_ENV_IS_IN_NAND */
 
+#ifdef USE_HOSTCC
+# include <stdint.h>
+#else
+# include <linux/types.h>
+#endif
 
 #ifdef CFG_REDUNDAND_ENVIRONMENT
-# define ENV_HEADER_SIZE       (sizeof(unsigned long) + 1)
+# define ENV_HEADER_SIZE       (sizeof(uint32_t) + 1)
 #else
-# define ENV_HEADER_SIZE       (sizeof(unsigned long))
+# define ENV_HEADER_SIZE       (sizeof(uint32_t))
 #endif
 
 
 #define ENV_SIZE (CFG_ENV_SIZE - ENV_HEADER_SIZE)
 
 typedef        struct environment_s {
-       unsigned long   crc;            /* CRC32 over data bytes        */
+       uint32_t        crc;            /* CRC32 over data bytes        */
 #ifdef CFG_REDUNDAND_ENVIRONMENT
        unsigned char   flags;          /* active/obsolete flags        */
 #endif
index 7836f28..890993f 100644 (file)
@@ -50,13 +50,11 @@ int fdt_find_and_setprop(void *fdt, const char *node, const char *prop,
                         const void *val, int len, int create);
 void fdt_fixup_qe_firmware(void *fdt);
 
-#ifdef CONFIG_OF_HAS_UBOOT_ENV
-int fdt_env(void *fdt);
-#endif
-
-#ifdef CONFIG_OF_HAS_BD_T
-int fdt_bd_t(void *fdt);
-#endif
+#ifdef CONFIG_HAS_FSL_DR_USB
+void fdt_fixup_dr_usb(void *blob, bd_t *bd);
+#else
+static inline void fdt_fixup_dr_usb(void *blob, bd_t *bd) {}
+#endif /* CONFIG_HAS_FSL_DR_USB */
 
 #ifdef CONFIG_OF_BOARD_SETUP
 void ft_board_setup(void *blob, bd_t *bd);
diff --git a/include/fis.h b/include/fis.h
new file mode 100644 (file)
index 0000000..2040b50
--- /dev/null
@@ -0,0 +1,156 @@
+/*
+ * Copyright (C) 2008 Freescale Semiconductor, Inc.
+ *             Dave Liu <daveliu@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 __FIS_H__
+#define __FIS_H__
+/*
+* Register - Host to Device FIS
+*/
+typedef struct sata_fis_h2d {
+       u8 fis_type;
+       u8 pm_port_c;
+       u8 command;
+       u8 features;
+       u8 lba_low;
+       u8 lba_mid;
+       u8 lba_high;
+       u8 device;
+       u8 lba_low_exp;
+       u8 lba_mid_exp;
+       u8 lba_high_exp;
+       u8 features_exp;
+       u8 sector_count;
+       u8 sector_count_exp;
+       u8 res1;
+       u8 control;
+       u8 res2[4];
+} __attribute__ ((packed)) sata_fis_h2d_t;
+
+/*
+* Register - Host to Device FIS for read/write FPDMA queued
+*/
+typedef struct sata_fis_h2d_ncq {
+       u8 fis_type;
+       u8 pm_port_c;
+       u8 command;
+       u8 sector_count_low;
+       u8 lba_low;
+       u8 lba_mid;
+       u8 lba_high;
+       u8 device;
+       u8 lba_low_exp;
+       u8 lba_mid_exp;
+       u8 lba_high_exp;
+       u8 sector_count_high;
+       u8 tag;
+       u8 res1;
+       u8 res2;
+       u8 control;
+       u8 res3[4];
+} __attribute__ ((packed)) sata_fis_h2d_ncq_t;
+
+/*
+* Register - Device to Host FIS
+*/
+typedef struct sata_fis_d2h {
+       u8 fis_type;
+       u8 pm_port_i;
+       u8 status;
+       u8 error;
+       u8 lba_low;
+       u8 lba_mid;
+       u8 lba_high;
+       u8 device;
+       u8 lba_low_exp;
+       u8 lba_mid_exp;
+       u8 lba_high_exp;
+       u8 res1;
+       u8 sector_count;
+       u8 sector_count_exp;
+       u8 res2[2];
+       u8 res3[4];
+} __attribute__ ((packed)) sata_fis_d2h_t;
+
+/*
+* DMA Setup - Device to Host or Host to Device FIS
+*/
+typedef struct sata_fis_dma_setup {
+       u8 fis_type;
+       u8 pm_port_dir_int_act;
+       u8 res1;
+       u8 res2;
+       u32 dma_buffer_id_low;
+       u32 dma_buffer_id_high;
+       u32 res3;
+       u32 dma_buffer_offset;
+       u32 dma_transfer_count;
+       u32 res4;
+} __attribute__ ((packed)) sata_fis_dma_setup_t;
+
+/*
+* PIO Setup - Device to Host FIS
+*/
+typedef struct sata_fis_pio_setup {
+       u8 fis_type;
+       u8 pm_port_dir_int;
+       u8 status;
+       u8 error;
+       u8 lba_low;
+       u8 lba_mid;
+       u8 lba_high;
+       u8 res1;
+       u8 lba_low_exp;
+       u8 lba_mid_exp;
+       u8 lba_high_exp;
+       u8 res2;
+       u8 sector_count;
+       u8 sector_count_exp;
+       u8 res3;
+       u8 e_status;
+       u16 transfer_count;
+       u16 res4;
+} __attribute__ ((packed)) sata_fis_pio_setup_t;
+
+/*
+* Data - Host to Device or Device to Host FIS
+*/
+typedef struct sata_fis_data {
+       u8 fis_type;
+       u8 pm_port;
+       u8 res1;
+       u8 res2;
+       u32 data[2048];
+} __attribute__ ((packed)) sata_fis_data_t;
+
+/* fis_type - SATA FIS type
+ */
+enum sata_fis_type {
+       SATA_FIS_TYPE_REGISTER_H2D              = 0x27,
+       SATA_FIS_TYPE_REGISTER_D2H              = 0x34,
+       SATA_FIS_TYPE_DMA_ACT_D2H               = 0x39,
+       SATA_FIS_TYPE_DMA_SETUP_BI              = 0x41,
+       SATA_FIS_TYPE_DATA_BI                   = 0x46,
+       SATA_FIS_TYPE_BIST_ACT_BI               = 0x58,
+       SATA_FIS_TYPE_PIO_SETUP_D2H             = 0x5F,
+       SATA_FIS_TYPE_SET_DEVICE_BITS_D2H       = 0xA1,
+};
+
+#endif /* __FIS_H__ */
index 432fa22..4076484 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * (C) Copyright 2008 Semihalf
+ *
  * (C) Copyright 2000-2005
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
 #ifndef __IMAGE_H__
 #define __IMAGE_H__
 
+#include <asm/byteorder.h>
+#include <command.h>
+
+#ifndef USE_HOSTCC
+#include <lmb.h>
+#include <linux/string.h>
+#include <asm/u-boot.h>
+
+#else
+
+/* new uImage format support enabled on host */
+#define CONFIG_FIT             1
+#define CONFIG_OF_LIBFDT       1
+#define CONFIG_FIT_VERBOSE     1 /* enable fit_format_{error,warning}() */
+
+#endif /* USE_HOSTCC */
+
+#if defined(CONFIG_FIT) && !defined(CONFIG_OF_LIBFDT)
+#error "CONFIG_OF_LIBFDT not enabled, required by CONFIG_FIT!"
+#endif
+
+#if defined(CONFIG_FIT)
+#include <fdt.h>
+#include <libfdt.h>
+#include <fdt_support.h>
+#define CONFIG_MD5             /* FIT images need MD5 support */
+#endif
+
 /*
  * Operating System Codes
  */
 /*
  * CPU Architecture Codes (supported by Linux)
  */
-#define IH_CPU_INVALID         0       /* Invalid CPU  */
-#define IH_CPU_ALPHA           1       /* Alpha        */
-#define IH_CPU_ARM             2       /* ARM          */
-#define IH_CPU_I386            3       /* Intel x86    */
-#define IH_CPU_IA64            4       /* IA64         */
-#define IH_CPU_MIPS            5       /* MIPS         */
-#define IH_CPU_MIPS64          6       /* MIPS  64 Bit */
-#define IH_CPU_PPC             7       /* PowerPC      */
-#define IH_CPU_S390            8       /* IBM S390     */
-#define IH_CPU_SH              9       /* SuperH       */
-#define IH_CPU_SPARC           10      /* Sparc        */
-#define IH_CPU_SPARC64         11      /* Sparc 64 Bit */
-#define IH_CPU_M68K            12      /* M68K         */
-#define IH_CPU_NIOS            13      /* Nios-32      */
-#define IH_CPU_MICROBLAZE      14      /* MicroBlaze   */
-#define IH_CPU_NIOS2           15      /* Nios-II      */
-#define IH_CPU_BLACKFIN                16      /* Blackfin     */
-#define IH_CPU_AVR32           17      /* AVR32        */
-#define IH_CPU_ST200           18      /* STMicroelectronics ST200  */
+#define IH_ARCH_INVALID                0       /* Invalid CPU  */
+#define IH_ARCH_ALPHA          1       /* Alpha        */
+#define IH_ARCH_ARM            2       /* ARM          */
+#define IH_ARCH_I386           3       /* Intel x86    */
+#define IH_ARCH_IA64           4       /* IA64         */
+#define IH_ARCH_MIPS           5       /* MIPS         */
+#define IH_ARCH_MIPS64         6       /* MIPS  64 Bit */
+#define IH_ARCH_PPC            7       /* PowerPC      */
+#define IH_ARCH_S390           8       /* IBM S390     */
+#define IH_ARCH_SH             9       /* SuperH       */
+#define IH_ARCH_SPARC          10      /* Sparc        */
+#define IH_ARCH_SPARC64                11      /* Sparc 64 Bit */
+#define IH_ARCH_M68K           12      /* M68K         */
+#define IH_ARCH_NIOS           13      /* Nios-32      */
+#define IH_ARCH_MICROBLAZE     14      /* MicroBlaze   */
+#define IH_ARCH_NIOS2          15      /* Nios-II      */
+#define IH_ARCH_BLACKFIN       16      /* Blackfin     */
+#define IH_ARCH_AVR32          17      /* AVR32        */
+#define IH_ARCH_ST200          18      /* STMicroelectronics ST200  */
 
 /*
  * Image Types
 #define IH_NMLEN               32      /* Image Name Length            */
 
 /*
- * all data in network byte order (aka natural aka bigendian)
+ * Legacy format image header,
+ * all data in network byte order (aka natural aka bigendian).
  */
-
 typedef struct image_header {
        uint32_t        ih_magic;       /* Image Header Magic Number    */
        uint32_t        ih_hcrc;        /* Image Header CRC Checksum    */
@@ -157,5 +187,414 @@ typedef struct image_header {
        uint8_t         ih_name[IH_NMLEN];      /* Image Name           */
 } image_header_t;
 
+/*
+ * Legacy and FIT format headers used by do_bootm() and do_bootm_<os>()
+ * routines.
+ */
+typedef struct bootm_headers {
+       /*
+        * Legacy os image header, if it is a multi component image
+        * then boot_get_ramdisk() and get_fdt() will attempt to get
+        * data from second and third component accordingly.
+        */
+       image_header_t  *legacy_hdr_os;         /* image header pointer */
+       image_header_t  legacy_hdr_os_copy;     /* header copy */
+       ulong           legacy_hdr_valid;
+
+#if defined(CONFIG_FIT)
+       const char      *fit_uname_cfg; /* configuration node unit name */
+
+       void            *fit_hdr_os;    /* os FIT image header */
+       const char      *fit_uname_os;  /* os subimage node unit name */
+       int             fit_noffset_os; /* os subimage node offset */
+
+       void            *fit_hdr_rd;    /* init ramdisk FIT image header */
+       const char      *fit_uname_rd;  /* init ramdisk subimage node unit name */
+       int             fit_noffset_rd; /* init ramdisk subimage node offset */
+
+#if defined(CONFIG_PPC)
+       void            *fit_hdr_fdt;   /* FDT blob FIT image header */
+       const char      *fit_uname_fdt; /* FDT blob subimage node unit name */
+       int             fit_noffset_fdt;/* FDT blob subimage node offset */
+#endif
+#endif
+
+       int             verify;         /* getenv("verify")[0] != 'n' */
+       int             autostart;      /* getenv("autostart")[0] != 'n' */
+       struct lmb      *lmb;           /* for memory mgmt */
+} bootm_headers_t;
+
+/*
+ * Some systems (for example LWMON) have very short watchdog periods;
+ * we must make sure to split long operations like memmove() or
+ * crc32() into reasonable chunks.
+ */
+#define CHUNKSZ (64 * 1024)
+
+#define uimage_to_cpu(x)               ntohl(x)
+#define cpu_to_uimage(x)               htonl(x)
+
+const char *genimg_get_os_name (uint8_t os);
+const char *genimg_get_arch_name (uint8_t arch);
+const char *genimg_get_type_name (uint8_t type);
+const char *genimg_get_comp_name (uint8_t comp);
+int genimg_get_os_id (const char *name);
+int genimg_get_arch_id (const char *name);
+int genimg_get_type_id (const char *name);
+int genimg_get_comp_id (const char *name);
+
+#ifndef USE_HOSTCC
+/* Image format types, returned by _get_format() routine */
+#define IMAGE_FORMAT_INVALID   0x00
+#define IMAGE_FORMAT_LEGACY    0x01    /* legacy image_header based format */
+#define IMAGE_FORMAT_FIT       0x02    /* new, libfdt based format */
+
+int genimg_get_format (void *img_addr);
+int genimg_has_config (bootm_headers_t *images);
+ulong genimg_get_image (ulong img_addr);
+
+int boot_get_ramdisk (int argc, char *argv[], bootm_headers_t *images,
+               uint8_t arch, ulong *rd_start, ulong *rd_end);
+
+#if defined(CONFIG_PPC) || defined(CONFIG_M68K)
+int boot_ramdisk_high (struct lmb *lmb, ulong rd_data, ulong rd_len,
+                 ulong *initrd_start, ulong *initrd_end);
+
+int boot_get_cmdline (struct lmb *lmb, ulong *cmd_start, ulong *cmd_end,
+                       ulong bootmap_base);
+int boot_get_kbd (struct lmb *lmb, bd_t **kbd, ulong bootmap_base);
+#endif /* CONFIG_PPC || CONFIG_M68K */
+#endif /* !USE_HOSTCC */
+
+/*******************************************************************/
+/* Legacy format specific code (prefixed with image_) */
+/*******************************************************************/
+static inline uint32_t image_get_header_size (void)
+{
+       return (sizeof (image_header_t));
+}
+
+#define image_get_hdr_l(f) \
+       static inline uint32_t image_get_##f(image_header_t *hdr) \
+       { \
+               return uimage_to_cpu (hdr->ih_##f); \
+       }
+image_get_hdr_l (magic);
+image_get_hdr_l (hcrc);
+image_get_hdr_l (time);
+image_get_hdr_l (size);
+image_get_hdr_l (load);
+image_get_hdr_l (ep);
+image_get_hdr_l (dcrc);
+
+#define image_get_hdr_b(f) \
+       static inline uint8_t image_get_##f(image_header_t *hdr) \
+       { \
+               return hdr->ih_##f; \
+       }
+image_get_hdr_b (os);
+image_get_hdr_b (arch);
+image_get_hdr_b (type);
+image_get_hdr_b (comp);
+
+static inline char *image_get_name (image_header_t *hdr)
+{
+       return (char *)hdr->ih_name;
+}
+
+static inline uint32_t image_get_data_size (image_header_t *hdr)
+{
+       return image_get_size (hdr);
+}
+
+/**
+ * image_get_data - get image payload start address
+ * @hdr: image header
+ *
+ * image_get_data() returns address of the image payload. For single
+ * component images it is image data start. For multi component
+ * images it points to the null terminated table of sub-images sizes.
+ *
+ * returns:
+ *     image payload data start address
+ */
+static inline ulong image_get_data (image_header_t *hdr)
+{
+       return ((ulong)hdr + image_get_header_size ());
+}
+
+static inline uint32_t image_get_image_size (image_header_t *hdr)
+{
+       return (image_get_size (hdr) + image_get_header_size ());
+}
+static inline ulong image_get_image_end (image_header_t *hdr)
+{
+       return ((ulong)hdr + image_get_image_size (hdr));
+}
+
+#define image_set_hdr_l(f) \
+       static inline void image_set_##f(image_header_t *hdr, uint32_t val) \
+       { \
+               hdr->ih_##f = cpu_to_uimage (val); \
+       }
+image_set_hdr_l (magic);
+image_set_hdr_l (hcrc);
+image_set_hdr_l (time);
+image_set_hdr_l (size);
+image_set_hdr_l (load);
+image_set_hdr_l (ep);
+image_set_hdr_l (dcrc);
+
+#define image_set_hdr_b(f) \
+       static inline void image_set_##f(image_header_t *hdr, uint8_t val) \
+       { \
+               hdr->ih_##f = val; \
+       }
+image_set_hdr_b (os);
+image_set_hdr_b (arch);
+image_set_hdr_b (type);
+image_set_hdr_b (comp);
+
+static inline void image_set_name (image_header_t *hdr, const char *name)
+{
+       strncpy (image_get_name (hdr), name, IH_NMLEN);
+}
+
+int image_check_hcrc (image_header_t *hdr);
+int image_check_dcrc (image_header_t *hdr);
+#ifndef USE_HOSTCC
+int image_check_dcrc_wd (image_header_t *hdr, ulong chunksize);
+int getenv_yesno (char *var);
+ulong getenv_bootm_low(void);
+ulong getenv_bootm_size(void);
+void memmove_wd (void *to, void *from, size_t len, ulong chunksz);
+#endif
+
+static inline int image_check_magic (image_header_t *hdr)
+{
+       return (image_get_magic (hdr) == IH_MAGIC);
+}
+static inline int image_check_type (image_header_t *hdr, uint8_t type)
+{
+       return (image_get_type (hdr) == type);
+}
+static inline int image_check_arch (image_header_t *hdr, uint8_t arch)
+{
+       return (image_get_arch (hdr) == arch);
+}
+static inline int image_check_os (image_header_t *hdr, uint8_t os)
+{
+       return (image_get_os (hdr) == os);
+}
+
+ulong image_multi_count (image_header_t *hdr);
+void image_multi_getimg (image_header_t *hdr, ulong idx,
+                       ulong *data, ulong *len);
+
+void image_print_contents (image_header_t *hdr);
+
+#ifndef USE_HOSTCC
+static inline int image_check_target_arch (image_header_t *hdr)
+{
+#if defined(__ARM__)
+       if (!image_check_arch (hdr, IH_ARCH_ARM))
+#elif defined(__avr32__)
+       if (!image_check_arch (hdr, IH_ARCH_AVR32))
+#elif defined(__bfin__)
+       if (!image_check_arch (hdr, IH_ARCH_BLACKFIN))
+#elif defined(__I386__)
+       if (!image_check_arch (hdr, IH_ARCH_I386))
+#elif defined(__M68K__)
+       if (!image_check_arch (hdr, IH_ARCH_M68K))
+#elif defined(__microblaze__)
+       if (!image_check_arch (hdr, IH_ARCH_MICROBLAZE))
+#elif defined(__mips__)
+       if (!image_check_arch (hdr, IH_ARCH_MIPS))
+#elif defined(__nios__)
+       if (!image_check_arch (hdr, IH_ARCH_NIOS))
+#elif defined(__nios2__)
+       if (!image_check_arch (hdr, IH_ARCH_NIOS2))
+#elif defined(__PPC__)
+       if (!image_check_arch (hdr, IH_ARCH_PPC))
+#elif defined(__sh__)
+       if (!image_check_arch (hdr, IH_ARCH_SH))
+#elif defined(__sparc__)
+       if (!image_check_arch (hdr, IH_ARCH_SPARC))
+#else
+# error Unknown CPU type
+#endif
+               return 0;
+
+       return 1;
+}
+#endif /* USE_HOSTCC */
+
+/*******************************************************************/
+/* New uImage format specific code (prefixed with fit_) */
+/*******************************************************************/
+#if defined(CONFIG_FIT)
+
+#define FIT_IMAGES_PATH                "/images"
+#define FIT_CONFS_PATH         "/configurations"
+
+/* hash node */
+#define FIT_HASH_NODENAME      "hash"
+#define FIT_ALGO_PROP          "algo"
+#define FIT_VALUE_PROP         "value"
+
+/* image node */
+#define FIT_DATA_PROP          "data"
+#define FIT_TIMESTAMP_PROP     "timestamp"
+#define FIT_DESC_PROP          "description"
+#define FIT_ARCH_PROP          "arch"
+#define FIT_TYPE_PROP          "type"
+#define FIT_OS_PROP            "os"
+#define FIT_COMP_PROP          "compression"
+#define FIT_ENTRY_PROP         "entry"
+#define FIT_LOAD_PROP          "load"
+
+/* configuration node */
+#define FIT_KERNEL_PROP                "kernel"
+#define FIT_RAMDISK_PROP       "ramdisk"
+#define FIT_FDT_PROP           "fdt"
+#define FIT_DEFAULT_PROP       "default"
+
+#define FIT_MAX_HASH_LEN       20      /* max(crc32_len(4), sha1_len(20)) */
+
+/* cmdline argument format parsing */
+inline int fit_parse_conf (const char *spec, ulong addr_curr,
+               ulong *addr, const char **conf_name);
+inline int fit_parse_subimage (const char *spec, ulong addr_curr,
+               ulong *addr, const char **image_name);
+
+void fit_print_contents (const void *fit);
+void fit_image_print (const void *fit, int noffset, const char *p);
+void fit_image_print_hash (const void *fit, int noffset, const char *p);
+
+/**
+ * fit_get_end - get FIT image size
+ * @fit: pointer to the FIT format image header
+ *
+ * returns:
+ *     size of the FIT image (blob) in memory
+ */
+static inline ulong fit_get_size (const void *fit)
+{
+       return fdt_totalsize (fit);
+}
+
+/**
+ * fit_get_end - get FIT image end
+ * @fit: pointer to the FIT format image header
+ *
+ * returns:
+ *     end address of the FIT image (blob) in memory
+ */
+static inline ulong fit_get_end (const void *fit)
+{
+       return (ulong)fit + fdt_totalsize (fit);
+}
+
+/**
+ * fit_get_name - get FIT node name
+ * @fit: pointer to the FIT format image header
+ *
+ * returns:
+ *     NULL, on error
+ *     pointer to node name, on success
+ */
+static inline const char *fit_get_name (const void *fit_hdr,
+               int noffset, int *len)
+{
+       return fdt_get_name (fit_hdr, noffset, len);
+}
+
+int fit_get_desc (const void *fit, int noffset, char **desc);
+int fit_get_timestamp (const void *fit, int noffset, time_t *timestamp);
+
+int fit_image_get_node (const void *fit, const char *image_uname);
+int fit_image_get_os (const void *fit, int noffset, uint8_t *os);
+int fit_image_get_arch (const void *fit, int noffset, uint8_t *arch);
+int fit_image_get_type (const void *fit, int noffset, uint8_t *type);
+int fit_image_get_comp (const void *fit, int noffset, uint8_t *comp);
+int fit_image_get_load (const void *fit, int noffset, ulong *load);
+int fit_image_get_entry (const void *fit, int noffset, ulong *entry);
+int fit_image_get_data (const void *fit, int noffset,
+                               const void **data, size_t *size);
+
+int fit_image_hash_get_algo (const void *fit, int noffset, char **algo);
+int fit_image_hash_get_value (const void *fit, int noffset, uint8_t **value,
+                               int *value_len);
+
+int fit_set_timestamp (void *fit, int noffset, time_t timestamp);
+int fit_set_hashes (void *fit);
+int fit_image_set_hashes (void *fit, int image_noffset);
+int fit_image_hash_set_value (void *fit, int noffset, uint8_t *value,
+                               int value_len);
+
+int fit_image_check_hashes (const void *fit, int noffset);
+int fit_image_check_os (const void *fit, int noffset, uint8_t os);
+int fit_image_check_arch (const void *fit, int noffset, uint8_t arch);
+int fit_image_check_type (const void *fit, int noffset, uint8_t type);
+int fit_image_check_comp (const void *fit, int noffset, uint8_t comp);
+int fit_check_format (const void *fit);
+
+int fit_conf_get_node (const void *fit, const char *conf_uname);
+int fit_conf_get_kernel_node (const void *fit, int noffset);
+int fit_conf_get_ramdisk_node (const void *fit, int noffset);
+int fit_conf_get_fdt_node (const void *fit, int noffset);
+
+void fit_conf_print (const void *fit, int noffset, const char *p);
+
+#ifndef USE_HOSTCC
+static inline int fit_image_check_target_arch (const void *fdt, int node)
+{
+#if defined(__ARM__)
+       if (!fit_image_check_arch (fdt, node, IH_ARCH_ARM))
+#elif defined(__avr32__)
+       if (!fit_image_check_arch (fdt, node, IH_ARCH_AVR32))
+#elif defined(__bfin__)
+       if (!fit_image_check_arch (fdt, node, IH_ARCH_BLACKFIN))
+#elif defined(__I386__)
+       if (!fit_image_check_arch (fdt, node, IH_ARCH_I386))
+#elif defined(__M68K__)
+       if (!fit_image_check_arch (fdt, node, IH_ARCH_M68K))
+#elif defined(__microblaze__)
+       if (!fit_image_check_arch (fdt, node, IH_ARCH_MICROBLAZE))
+#elif defined(__mips__)
+       if (!fit_image_check_arch (fdt, node, IH_ARCH_MIPS))
+#elif defined(__nios__)
+       if (!fit_image_check_arch (fdt, node, IH_ARCH_NIOS))
+#elif defined(__nios2__)
+       if (!fit_image_check_arch (fdt, node, IH_ARCH_NIOS2))
+#elif defined(__PPC__)
+       if (!fit_image_check_arch (fdt, node, IH_ARCH_PPC))
+#elif defined(__sh__)
+       if (!fit_image_check_arch (fdt, node, IH_ARCH_SH))
+#elif defined(__sparc__)
+       if (!fit_image_check_arch (fdt, node, IH_ARCH_SPARC))
+#else
+# error Unknown CPU type
+#endif
+               return 0;
+
+       return 1;
+}
+#endif /* USE_HOSTCC */
+
+#ifdef CONFIG_FIT_VERBOSE
+#define fit_unsupported(msg)   printf ("! %s:%d " \
+                               "FIT images not supported for '%s'\n", \
+                               __FILE__, __LINE__, (msg))
+
+#define fit_unsupported_reset(msg)     printf ("! %s:%d " \
+                               "FIT images not supported for '%s' " \
+                               "- must reset board to recover!\n", \
+                               __FILE__, __LINE__, (msg))
+#else
+#define fit_unsupported(msg)
+#define fit_unsupported_reset(msg)
+#endif /* CONFIG_FIT_VERBOSE */
+#endif /* CONFIG_FIT */
 
 #endif /* __IMAGE_H__ */
diff --git a/include/libata.h b/include/libata.h
new file mode 100644 (file)
index 0000000..62a1760
--- /dev/null
@@ -0,0 +1,669 @@
+/*
+ * Copyright 2003-2004 Red Hat, Inc.  All rights reserved.
+ * Copyright 2003-2004 Jeff Garzik
+ * Copyright (C) 2008 Freescale Semiconductor, Inc.
+ *             Dave Liu <daveliu@freescale.com>
+ *             port from libata of linux kernel
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the 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 __LIBATA_H__
+#define __LIBATA_H__
+
+#include <common.h>
+
+enum {
+       /* various global constants */
+       ATA_MAX_DEVICES         = 2,    /* per bus/port */
+       ATA_MAX_PRD             = 256,  /* we could make these 256/256 */
+       ATA_SECT_SIZE           = 512,
+       ATA_MAX_SECTORS_128     = 128,
+       ATA_MAX_SECTORS         = 256,
+       ATA_MAX_SECTORS_LBA48   = 65535,
+       ATA_MAX_SECTORS_TAPE    = 65535,
+
+       ATA_ID_WORDS            = 256,
+       ATA_ID_SERNO            = 10,
+       ATA_ID_FW_REV           = 23,
+       ATA_ID_PROD             = 27,
+       ATA_ID_OLD_PIO_MODES    = 51,
+       ATA_ID_FIELD_VALID      = 53,
+       ATA_ID_LBA_SECTORS      = 60,
+       ATA_ID_MWDMA_MODES      = 63,
+       ATA_ID_PIO_MODES        = 64,
+       ATA_ID_EIDE_DMA_MIN     = 65,
+       ATA_ID_EIDE_PIO         = 67,
+       ATA_ID_EIDE_PIO_IORDY   = 68,
+       ATA_ID_PIO4             = (1 << 1),
+       ATA_ID_QUEUE_DEPTH      = 75,
+       ATA_ID_SATA_CAP         = 76,
+       ATA_ID_SATA_FEATURES    = 78,
+       ATA_ID_SATA_FEATURES_EN = 79,
+       ATA_ID_MAJOR_VER        = 80,
+       ATA_ID_MINOR_VER        = 81,
+       ATA_ID_UDMA_MODES       = 88,
+       ATA_ID_LBA48_SECTORS    = 100,
+
+       ATA_ID_SERNO_LEN        = 20,
+       ATA_ID_FW_REV_LEN       = 8,
+       ATA_ID_PROD_LEN         = 40,
+
+       ATA_PCI_CTL_OFS         = 2,
+
+       ATA_PIO0                = (1 << 0),
+       ATA_PIO1                = ATA_PIO0 | (1 << 1),
+       ATA_PIO2                = ATA_PIO1 | (1 << 2),
+       ATA_PIO3                = ATA_PIO2 | (1 << 3),
+       ATA_PIO4                = ATA_PIO3 | (1 << 4),
+       ATA_PIO5                = ATA_PIO4 | (1 << 5),
+       ATA_PIO6                = ATA_PIO5 | (1 << 6),
+
+       ATA_SWDMA0              = (1 << 0),
+       ATA_SWDMA1              = ATA_SWDMA0 | (1 << 1),
+       ATA_SWDMA2              = ATA_SWDMA1 | (1 << 2),
+
+       ATA_SWDMA2_ONLY         = (1 << 2),
+
+       ATA_MWDMA0              = (1 << 0),
+       ATA_MWDMA1              = ATA_MWDMA0 | (1 << 1),
+       ATA_MWDMA2              = ATA_MWDMA1 | (1 << 2),
+
+       ATA_MWDMA12_ONLY        = (1 << 1) | (1 << 2),
+       ATA_MWDMA2_ONLY         = (1 << 2),
+
+       ATA_UDMA0               = (1 << 0),
+       ATA_UDMA1               = ATA_UDMA0 | (1 << 1),
+       ATA_UDMA2               = ATA_UDMA1 | (1 << 2),
+       ATA_UDMA3               = ATA_UDMA2 | (1 << 3),
+       ATA_UDMA4               = ATA_UDMA3 | (1 << 4),
+       ATA_UDMA5               = ATA_UDMA4 | (1 << 5),
+       ATA_UDMA6               = ATA_UDMA5 | (1 << 6),
+       ATA_UDMA7               = ATA_UDMA6 | (1 << 7),
+       /* ATA_UDMA7 is just for completeness... doesn't exist (yet?).  */
+
+       ATA_UDMA_MASK_40C       = ATA_UDMA2,    /* udma0-2 */
+
+       /* DMA-related */
+       ATA_PRD_SZ              = 8,
+       ATA_PRD_TBL_SZ          = (ATA_MAX_PRD * ATA_PRD_SZ),
+       ATA_PRD_EOT             = (1 << 31),    /* end-of-table flag */
+
+       ATA_DMA_TABLE_OFS       = 4,
+       ATA_DMA_STATUS          = 2,
+       ATA_DMA_CMD             = 0,
+       ATA_DMA_WR              = (1 << 3),
+       ATA_DMA_START           = (1 << 0),
+       ATA_DMA_INTR            = (1 << 2),
+       ATA_DMA_ERR             = (1 << 1),
+       ATA_DMA_ACTIVE          = (1 << 0),
+
+       /* bits in ATA command block registers */
+       ATA_HOB                 = (1 << 7),     /* LBA48 selector */
+       ATA_NIEN                = (1 << 1),     /* disable-irq flag */
+       ATA_LBA                 = (1 << 6),     /* LBA28 selector */
+       ATA_DEV1                = (1 << 4),     /* Select Device 1 (slave) */
+       ATA_DEVICE_OBS          = (1 << 7) | (1 << 5), /* obs bits in dev reg */
+       ATA_DEVCTL_OBS          = (1 << 3),     /* obsolete bit in devctl reg */
+       ATA_BUSY                = (1 << 7),     /* BSY status bit */
+       ATA_DRDY                = (1 << 6),     /* device ready */
+       ATA_DF                  = (1 << 5),     /* device fault */
+       ATA_DRQ                 = (1 << 3),     /* data request i/o */
+       ATA_ERR                 = (1 << 0),     /* have an error */
+       ATA_SRST                = (1 << 2),     /* software reset */
+       ATA_ICRC                = (1 << 7),     /* interface CRC error */
+       ATA_UNC                 = (1 << 6),     /* uncorrectable media error */
+       ATA_IDNF                = (1 << 4),     /* ID not found */
+       ATA_ABORTED             = (1 << 2),     /* command aborted */
+
+       /* ATA command block registers */
+       ATA_REG_DATA            = 0x00,
+       ATA_REG_ERR             = 0x01,
+       ATA_REG_NSECT           = 0x02,
+       ATA_REG_LBAL            = 0x03,
+       ATA_REG_LBAM            = 0x04,
+       ATA_REG_LBAH            = 0x05,
+       ATA_REG_DEVICE          = 0x06,
+       ATA_REG_STATUS          = 0x07,
+
+       ATA_REG_FEATURE         = ATA_REG_ERR, /* and their aliases */
+       ATA_REG_CMD             = ATA_REG_STATUS,
+       ATA_REG_BYTEL           = ATA_REG_LBAM,
+       ATA_REG_BYTEH           = ATA_REG_LBAH,
+       ATA_REG_DEVSEL          = ATA_REG_DEVICE,
+       ATA_REG_IRQ             = ATA_REG_NSECT,
+
+       /* ATA device commands */
+       ATA_CMD_DEV_RESET       = 0x08, /* ATAPI device reset */
+       ATA_CMD_CHK_POWER       = 0xE5, /* check power mode */
+       ATA_CMD_STANDBY         = 0xE2, /* place in standby power mode */
+       ATA_CMD_IDLE            = 0xE3, /* place in idle power mode */
+       ATA_CMD_EDD             = 0x90, /* execute device diagnostic */
+       ATA_CMD_FLUSH           = 0xE7,
+       ATA_CMD_FLUSH_EXT       = 0xEA,
+       ATA_CMD_ID_ATA          = 0xEC,
+       ATA_CMD_ID_ATAPI        = 0xA1,
+       ATA_CMD_READ            = 0xC8,
+       ATA_CMD_READ_EXT        = 0x25,
+       ATA_CMD_WRITE           = 0xCA,
+       ATA_CMD_WRITE_EXT       = 0x35,
+       ATA_CMD_WRITE_FUA_EXT   = 0x3D,
+       ATA_CMD_FPDMA_READ      = 0x60,
+       ATA_CMD_FPDMA_WRITE     = 0x61,
+       ATA_CMD_PIO_READ        = 0x20,
+       ATA_CMD_PIO_READ_EXT    = 0x24,
+       ATA_CMD_PIO_WRITE       = 0x30,
+       ATA_CMD_PIO_WRITE_EXT   = 0x34,
+       ATA_CMD_READ_MULTI      = 0xC4,
+       ATA_CMD_READ_MULTI_EXT  = 0x29,
+       ATA_CMD_WRITE_MULTI     = 0xC5,
+       ATA_CMD_WRITE_MULTI_EXT = 0x39,
+       ATA_CMD_WRITE_MULTI_FUA_EXT = 0xCE,
+       ATA_CMD_SET_FEATURES    = 0xEF,
+       ATA_CMD_SET_MULTI       = 0xC6,
+       ATA_CMD_PACKET          = 0xA0,
+       ATA_CMD_VERIFY          = 0x40,
+       ATA_CMD_VERIFY_EXT      = 0x42,
+       ATA_CMD_STANDBYNOW1     = 0xE0,
+       ATA_CMD_IDLEIMMEDIATE   = 0xE1,
+       ATA_CMD_SLEEP           = 0xE6,
+       ATA_CMD_INIT_DEV_PARAMS = 0x91,
+       ATA_CMD_READ_NATIVE_MAX = 0xF8,
+       ATA_CMD_READ_NATIVE_MAX_EXT = 0x27,
+       ATA_CMD_SET_MAX         = 0xF9,
+       ATA_CMD_SET_MAX_EXT     = 0x37,
+       ATA_CMD_READ_LOG_EXT    = 0x2f,
+       ATA_CMD_PMP_READ        = 0xE4,
+       ATA_CMD_PMP_WRITE       = 0xE8,
+       ATA_CMD_CONF_OVERLAY    = 0xB1,
+       ATA_CMD_SEC_FREEZE_LOCK = 0xF5,
+
+       /* READ_LOG_EXT pages */
+       ATA_LOG_SATA_NCQ        = 0x10,
+
+       /* READ/WRITE LONG (obsolete) */
+       ATA_CMD_READ_LONG       = 0x22,
+       ATA_CMD_READ_LONG_ONCE  = 0x23,
+       ATA_CMD_WRITE_LONG      = 0x32,
+       ATA_CMD_WRITE_LONG_ONCE = 0x33,
+
+       /* SETFEATURES stuff */
+       SETFEATURES_XFER        = 0x03,
+       XFER_UDMA_7             = 0x47,
+       XFER_UDMA_6             = 0x46,
+       XFER_UDMA_5             = 0x45,
+       XFER_UDMA_4             = 0x44,
+       XFER_UDMA_3             = 0x43,
+       XFER_UDMA_2             = 0x42,
+       XFER_UDMA_1             = 0x41,
+       XFER_UDMA_0             = 0x40,
+       XFER_MW_DMA_4           = 0x24, /* CFA only */
+       XFER_MW_DMA_3           = 0x23, /* CFA only */
+       XFER_MW_DMA_2           = 0x22,
+       XFER_MW_DMA_1           = 0x21,
+       XFER_MW_DMA_0           = 0x20,
+       XFER_SW_DMA_2           = 0x12,
+       XFER_SW_DMA_1           = 0x11,
+       XFER_SW_DMA_0           = 0x10,
+       XFER_PIO_6              = 0x0E, /* CFA only */
+       XFER_PIO_5              = 0x0D, /* CFA only */
+       XFER_PIO_4              = 0x0C,
+       XFER_PIO_3              = 0x0B,
+       XFER_PIO_2              = 0x0A,
+       XFER_PIO_1              = 0x09,
+       XFER_PIO_0              = 0x08,
+       XFER_PIO_SLOW           = 0x00,
+
+       SETFEATURES_WC_ON       = 0x02, /* Enable write cache */
+       SETFEATURES_WC_OFF      = 0x82, /* Disable write cache */
+
+       SETFEATURES_SPINUP      = 0x07, /* Spin-up drive */
+
+       SETFEATURES_SATA_ENABLE = 0x10, /* Enable use of SATA feature */
+       SETFEATURES_SATA_DISABLE = 0x90, /* Disable use of SATA feature */
+
+       /* SETFEATURE Sector counts for SATA features */
+       SATA_AN                 = 0x05,  /* Asynchronous Notification */
+       SATA_DIPM               = 0x03,  /* Device Initiated Power Management */
+
+       /* feature values for SET_MAX */
+       ATA_SET_MAX_ADDR        = 0x00,
+       ATA_SET_MAX_PASSWD      = 0x01,
+       ATA_SET_MAX_LOCK        = 0x02,
+       ATA_SET_MAX_UNLOCK      = 0x03,
+       ATA_SET_MAX_FREEZE_LOCK = 0x04,
+
+       /* feature values for DEVICE CONFIGURATION OVERLAY */
+       ATA_DCO_RESTORE         = 0xC0,
+       ATA_DCO_FREEZE_LOCK     = 0xC1,
+       ATA_DCO_IDENTIFY        = 0xC2,
+       ATA_DCO_SET             = 0xC3,
+
+       /* ATAPI stuff */
+       ATAPI_PKT_DMA           = (1 << 0),
+       ATAPI_DMADIR            = (1 << 2),     /* ATAPI data dir:
+                                                  0=to device, 1=to host */
+       ATAPI_CDB_LEN           = 16,
+
+       /* PMP stuff */
+       SATA_PMP_MAX_PORTS      = 15,
+       SATA_PMP_CTRL_PORT      = 15,
+
+       SATA_PMP_GSCR_DWORDS    = 128,
+       SATA_PMP_GSCR_PROD_ID   = 0,
+       SATA_PMP_GSCR_REV       = 1,
+       SATA_PMP_GSCR_PORT_INFO = 2,
+       SATA_PMP_GSCR_ERROR     = 32,
+       SATA_PMP_GSCR_ERROR_EN  = 33,
+       SATA_PMP_GSCR_FEAT      = 64,
+       SATA_PMP_GSCR_FEAT_EN   = 96,
+
+       SATA_PMP_PSCR_STATUS    = 0,
+       SATA_PMP_PSCR_ERROR     = 1,
+       SATA_PMP_PSCR_CONTROL   = 2,
+
+       SATA_PMP_FEAT_BIST      = (1 << 0),
+       SATA_PMP_FEAT_PMREQ     = (1 << 1),
+       SATA_PMP_FEAT_DYNSSC    = (1 << 2),
+       SATA_PMP_FEAT_NOTIFY    = (1 << 3),
+
+       /* cable types */
+       ATA_CBL_NONE            = 0,
+       ATA_CBL_PATA40          = 1,
+       ATA_CBL_PATA80          = 2,
+       ATA_CBL_PATA40_SHORT    = 3,    /* 40 wire cable to high UDMA spec */
+       ATA_CBL_PATA_UNK        = 4,    /* don't know, maybe 80c? */
+       ATA_CBL_PATA_IGN        = 5,    /* don't know, ignore cable handling */
+       ATA_CBL_SATA            = 6,
+
+       /* SATA Status and Control Registers */
+       SCR_STATUS              = 0,
+       SCR_ERROR               = 1,
+       SCR_CONTROL             = 2,
+       SCR_ACTIVE              = 3,
+       SCR_NOTIFICATION        = 4,
+
+       /* SError bits */
+       SERR_DATA_RECOVERED     = (1 << 0), /* recovered data error */
+       SERR_COMM_RECOVERED     = (1 << 1), /* recovered comm failure */
+       SERR_DATA               = (1 << 8), /* unrecovered data error */
+       SERR_PERSISTENT         = (1 << 9), /* persistent data/comm error */
+       SERR_PROTOCOL           = (1 << 10), /* protocol violation */
+       SERR_INTERNAL           = (1 << 11), /* host internal error */
+       SERR_PHYRDY_CHG         = (1 << 16), /* PHY RDY changed */
+       SERR_PHY_INT_ERR        = (1 << 17), /* PHY internal error */
+       SERR_COMM_WAKE          = (1 << 18), /* Comm wake */
+       SERR_10B_8B_ERR         = (1 << 19), /* 10b to 8b decode error */
+       SERR_DISPARITY          = (1 << 20), /* Disparity */
+       SERR_CRC                = (1 << 21), /* CRC error */
+       SERR_HANDSHAKE          = (1 << 22), /* Handshake error */
+       SERR_LINK_SEQ_ERR       = (1 << 23), /* Link sequence error */
+       SERR_TRANS_ST_ERROR     = (1 << 24), /* Transport state trans. error */
+       SERR_UNRECOG_FIS        = (1 << 25), /* Unrecognized FIS */
+       SERR_DEV_XCHG           = (1 << 26), /* device exchanged */
+
+       /* struct ata_taskfile flags */
+       ATA_TFLAG_LBA48         = (1 << 0), /* enable 48-bit LBA and "HOB" */
+       ATA_TFLAG_ISADDR        = (1 << 1), /* enable r/w to nsect/lba regs */
+       ATA_TFLAG_DEVICE        = (1 << 2), /* enable r/w to device reg */
+       ATA_TFLAG_WRITE         = (1 << 3), /* data dir: host->dev==1 (write) */
+       ATA_TFLAG_LBA           = (1 << 4), /* enable LBA */
+       ATA_TFLAG_FUA           = (1 << 5), /* enable FUA */
+       ATA_TFLAG_POLLING       = (1 << 6), /* set nIEN to 1 and use polling */
+
+       /* protocol flags */
+       ATA_PROT_FLAG_PIO       = (1 << 0), /* is PIO */
+       ATA_PROT_FLAG_DMA       = (1 << 1), /* is DMA */
+       ATA_PROT_FLAG_DATA      = ATA_PROT_FLAG_PIO | ATA_PROT_FLAG_DMA,
+       ATA_PROT_FLAG_NCQ       = (1 << 2), /* is NCQ */
+       ATA_PROT_FLAG_ATAPI     = (1 << 3), /* is ATAPI */
+};
+
+enum ata_tf_protocols {
+       /* ATA taskfile protocols */
+       ATA_PROT_UNKNOWN,       /* unknown/invalid */
+       ATA_PROT_NODATA,        /* no data */
+       ATA_PROT_PIO,           /* PIO data xfer */
+       ATA_PROT_DMA,           /* DMA */
+       ATA_PROT_NCQ,           /* NCQ */
+       ATAPI_PROT_NODATA,      /* packet command, no data */
+       ATAPI_PROT_PIO,         /* packet command, PIO data xfer*/
+       ATAPI_PROT_DMA,         /* packet command with special DMA sauce */
+};
+
+enum ata_ioctls {
+       ATA_IOC_GET_IO32        = 0x309,
+       ATA_IOC_SET_IO32        = 0x324,
+};
+
+enum ata_dev_typed {
+       ATA_DEV_ATA,            /* ATA device */
+       ATA_DEV_ATAPI,          /* ATAPI device */
+       ATA_DEV_PMP,            /* Port Multiplier Port */
+       ATA_DEV_UNKNOWN,        /* unknown */
+};
+
+struct ata_taskfile {
+       unsigned long           flags;          /* ATA_TFLAG_xxx */
+       u8                      protocol;       /* ATA_PROT_xxx */
+
+       u8                      ctl;            /* control reg */
+
+       u8                      hob_feature;    /* additional data */
+       u8                      hob_nsect;      /* to support LBA48 */
+       u8                      hob_lbal;
+       u8                      hob_lbam;
+       u8                      hob_lbah;
+
+       u8                      feature;
+       u8                      nsect;
+       u8                      lbal;
+       u8                      lbam;
+       u8                      lbah;
+
+       u8                      device;
+
+       u8                      command;        /* IO operation */
+};
+
+/*
+ * protocol tests
+ */
+static inline unsigned int ata_prot_flags(u8 prot)
+{
+       switch (prot) {
+       case ATA_PROT_NODATA:
+               return 0;
+       case ATA_PROT_PIO:
+               return ATA_PROT_FLAG_PIO;
+       case ATA_PROT_DMA:
+               return ATA_PROT_FLAG_DMA;
+       case ATA_PROT_NCQ:
+               return ATA_PROT_FLAG_DMA | ATA_PROT_FLAG_NCQ;
+       case ATAPI_PROT_NODATA:
+               return ATA_PROT_FLAG_ATAPI;
+       case ATAPI_PROT_PIO:
+               return ATA_PROT_FLAG_ATAPI | ATA_PROT_FLAG_PIO;
+       case ATAPI_PROT_DMA:
+               return ATA_PROT_FLAG_ATAPI | ATA_PROT_FLAG_DMA;
+       }
+       return 0;
+}
+
+static inline int ata_is_atapi(u8 prot)
+{
+       return ata_prot_flags(prot) & ATA_PROT_FLAG_ATAPI;
+}
+
+static inline int ata_is_nodata(u8 prot)
+{
+       return !(ata_prot_flags(prot) & ATA_PROT_FLAG_DATA);
+}
+
+static inline int ata_is_pio(u8 prot)
+{
+       return ata_prot_flags(prot) & ATA_PROT_FLAG_PIO;
+}
+
+static inline int ata_is_dma(u8 prot)
+{
+       return ata_prot_flags(prot) & ATA_PROT_FLAG_DMA;
+}
+
+static inline int ata_is_ncq(u8 prot)
+{
+       return ata_prot_flags(prot) & ATA_PROT_FLAG_NCQ;
+}
+
+static inline int ata_is_data(u8 prot)
+{
+       return ata_prot_flags(prot) & ATA_PROT_FLAG_DATA;
+}
+
+/*
+ * id tests
+ */
+#define ata_id_is_ata(id)              (((id)[0] & (1 << 15)) == 0)
+#define ata_id_has_lba(id)             ((id)[49] & (1 << 9))
+#define ata_id_has_dma(id)             ((id)[49] & (1 << 8))
+#define ata_id_has_ncq(id)             ((id)[76] & (1 << 8))
+#define ata_id_queue_depth(id)         (((id)[75] & 0x1f) + 1)
+#define ata_id_removeable(id)          ((id)[0] & (1 << 7))
+#define ata_id_iordy_disable(id)       ((id)[49] & (1 << 10))
+#define ata_id_has_iordy(id)           ((id)[49] & (1 << 11))
+
+#define ata_id_u32(id,n)       \
+       (((u32) (id)[(n) + 1] << 16) | ((u32) (id)[(n)]))
+#define ata_id_u64(id,n)       \
+       ( ((u64) (id)[(n) + 3] << 48) | \
+         ((u64) (id)[(n) + 2] << 32) | \
+         ((u64) (id)[(n) + 1] << 16) | \
+         ((u64) (id)[(n) + 0]) )
+
+#define ata_id_cdb_intr(id)            (((id)[0] & 0x60) == 0x20)
+
+static inline int ata_id_has_fua(const u16 *id)
+{
+       if ((id[84] & 0xC000) != 0x4000)
+               return 0;
+       return id[84] & (1 << 6);
+}
+
+static inline int ata_id_has_flush(const u16 *id)
+{
+       if ((id[83] & 0xC000) != 0x4000)
+               return 0;
+       return id[83] & (1 << 12);
+}
+
+static inline int ata_id_has_flush_ext(const u16 *id)
+{
+       if ((id[83] & 0xC000) != 0x4000)
+               return 0;
+       return id[83] & (1 << 13);
+}
+
+static inline int ata_id_has_lba48(const u16 *id)
+{
+       if ((id[83] & 0xC000) != 0x4000)
+               return 0;
+       if (!ata_id_u64(id, 100))
+               return 0;
+       return id[83] & (1 << 10);
+}
+
+static inline int ata_id_hpa_enabled(const u16 *id)
+{
+       /* Yes children, word 83 valid bits cover word 82 data */
+       if ((id[83] & 0xC000) != 0x4000)
+               return 0;
+       /* And 87 covers 85-87 */
+       if ((id[87] & 0xC000) != 0x4000)
+               return 0;
+       /* Check command sets enabled as well as supported */
+       if ((id[85] & ( 1 << 10)) == 0)
+               return 0;
+       return id[82] & (1 << 10);
+}
+
+static inline int ata_id_has_wcache(const u16 *id)
+{
+       /* Yes children, word 83 valid bits cover word 82 data */
+       if ((id[83] & 0xC000) != 0x4000)
+               return 0;
+       return id[82] & (1 << 5);
+}
+
+static inline int ata_id_has_pm(const u16 *id)
+{
+       if ((id[83] & 0xC000) != 0x4000)
+               return 0;
+       return id[82] & (1 << 3);
+}
+
+static inline int ata_id_rahead_enabled(const u16 *id)
+{
+       if ((id[87] & 0xC000) != 0x4000)
+               return 0;
+       return id[85] & (1 << 6);
+}
+
+static inline int ata_id_wcache_enabled(const u16 *id)
+{
+       if ((id[87] & 0xC000) != 0x4000)
+               return 0;
+       return id[85] & (1 << 5);
+}
+
+static inline unsigned int ata_id_major_version(const u16 *id)
+{
+       unsigned int mver;
+
+       if (id[ATA_ID_MAJOR_VER] == 0xFFFF)
+               return 0;
+
+       for (mver = 14; mver >= 1; mver--)
+               if (id[ATA_ID_MAJOR_VER] & (1 << mver))
+                       break;
+       return mver;
+}
+
+static inline int ata_id_is_sata(const u16 *id)
+{
+       return ata_id_major_version(id) >= 5 && id[93] == 0;
+}
+
+static inline int ata_id_has_tpm(const u16 *id)
+{
+       /* The TPM bits are only valid on ATA8 */
+       if (ata_id_major_version(id) < 8)
+               return 0;
+       if ((id[48] & 0xC000) != 0x4000)
+               return 0;
+       return id[48] & (1 << 0);
+}
+
+static inline int ata_id_has_dword_io(const u16 *id)
+{
+       /* ATA 8 reuses this flag for "trusted" computing */
+       if (ata_id_major_version(id) > 7)
+               return 0;
+       if (id[48] & (1 << 0))
+               return 1;
+       return 0;
+}
+
+static inline int ata_id_current_chs_valid(const u16 *id)
+{
+       /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command
+          has not been issued to the device then the values of
+          id[54] to id[56] are vendor specific. */
+       return (id[53] & 0x01) && /* Current translation valid */
+               id[54] &&  /* cylinders in current translation */
+               id[55] &&  /* heads in current translation */
+               id[55] <= 16 &&
+               id[56];    /* sectors in current translation */
+}
+
+static inline int ata_id_is_cfa(const u16 *id)
+{
+       u16 v = id[0];
+       if (v == 0x848A)        /* Standard CF */
+               return 1;
+       /* Could be CF hiding as standard ATA */
+       if (ata_id_major_version(id) >= 3 &&  id[82] != 0xFFFF &&
+                       (id[82] & ( 1 << 2)))
+               return 1;
+       return 0;
+}
+
+static inline int ata_drive_40wire(const u16 *dev_id)
+{
+       if (ata_id_is_sata(dev_id))
+               return 0;       /* SATA */
+       if ((dev_id[93] & 0xE000) == 0x6000)
+               return 0;       /* 80 wire */
+       return 1;
+}
+
+static inline int ata_drive_40wire_relaxed(const u16 *dev_id)
+{
+       if ((dev_id[93] & 0x2000) == 0x2000)
+               return 0;       /* 80 wire */
+       return 1;
+}
+
+static inline int atapi_cdb_len(const u16 *dev_id)
+{
+       u16 tmp = dev_id[0] & 0x3;
+       switch (tmp) {
+       case 0:         return 12;
+       case 1:         return 16;
+       default:        return -1;
+       }
+}
+
+static inline int atapi_command_packet_set(const u16 *dev_id)
+{
+       return (dev_id[0] >> 8) & 0x1f;
+}
+
+static inline int atapi_id_dmadir(const u16 *dev_id)
+{
+       return ata_id_major_version(dev_id) >= 7 && (dev_id[62] & 0x8000);
+}
+
+static inline int is_multi_taskfile(struct ata_taskfile *tf)
+{
+       return (tf->command == ATA_CMD_READ_MULTI) ||
+              (tf->command == ATA_CMD_WRITE_MULTI) ||
+              (tf->command == ATA_CMD_READ_MULTI_EXT) ||
+              (tf->command == ATA_CMD_WRITE_MULTI_EXT) ||
+              (tf->command == ATA_CMD_WRITE_MULTI_FUA_EXT);
+}
+
+static inline int ata_ok(u8 status)
+{
+       return ((status & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ | ATA_ERR))
+                       == ATA_DRDY);
+}
+
+static inline int lba_28_ok(u64 block, u32 n_block)
+{
+       /* check the ending block number */
+       return ((block + n_block - 1) < ((u64)1 << 28)) && (n_block <= 256);
+}
+
+static inline int lba_48_ok(u64 block, u32 n_block)
+{
+       /* check the ending block number */
+       return ((block + n_block - 1) < ((u64)1 << 48)) && (n_block <= 65536);
+}
+
+#define sata_pmp_gscr_vendor(gscr)     ((gscr)[SATA_PMP_GSCR_PROD_ID] & 0xffff)
+#define sata_pmp_gscr_devid(gscr)      ((gscr)[SATA_PMP_GSCR_PROD_ID] >> 16)
+#define sata_pmp_gscr_rev(gscr)                (((gscr)[SATA_PMP_GSCR_REV] >> 8) & 0xff)
+#define sata_pmp_gscr_ports(gscr)      ((gscr)[SATA_PMP_GSCR_PORT_INFO] & 0xf)
+
+u64 ata_id_n_sectors(u16 *id);
+u32 ata_dev_classify(u32 sig);
+void ata_id_c_string(const u16 *id, unsigned char *s,
+                        unsigned int ofs, unsigned int len);
+void ata_dump_id(u16 *id);
+void ata_swap_buf_le16(u16 *buf, unsigned int buf_words);
+
+#endif /* __LIBATA_H__ */
index 6c05236..beeacb2 100644 (file)
@@ -131,6 +131,12 @@ static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen)
 uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset);
 
 /**********************************************************************/
+/* Traversal functions                                                */
+/**********************************************************************/
+
+int fdt_next_node(const void *fdt, int offset, int *depth);
+
+/**********************************************************************/
 /* General functions                                                  */
 /**********************************************************************/
 
@@ -846,6 +852,32 @@ int fdt_add_mem_rsv(void *fdt, uint64_t address, uint64_t size);
 int fdt_del_mem_rsv(void *fdt, int n);
 
 /**
+ * fdt_set_name - change the name of a given node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: structure block offset of a node
+ * @name: name to give the node
+ *
+ * fdt_set_name() replaces the name (including unit address, if any)
+ * of the given node with the given string.  NOTE: this function can't
+ * efficiently check if the new name is unique amongst the given
+ * node's siblings; results are undefined if this function is invoked
+ * with a name equal to one of the given node's siblings.
+ *
+ * This function may insert or delete data from the blob, and will
+ * therefore change the offsets of some existing nodes.
+ *
+ * returns:
+ *     0, on success
+ *     -FDT_ERR_NOSPACE, there is insufficient free space in the blob
+ *             to contain the new name
+ *     -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE, standard meanings
+ */
+int fdt_set_name(void *fdt, int nodeoffset, const char *name);
+
+/**
  * fdt_setprop - create or change a property
  * @fdt: pointer to the device tree blob
  * @nodeoffset: offset of the node whose property to change
index 78f7258..ab5c301 100644 (file)
 #ifndef _LIBFDT_ENV_H
 #define _LIBFDT_ENV_H
 
-#include <stddef.h>
-#include <linux/types.h>
-#include <asm/byteorder.h>
+#ifdef USE_HOSTCC
+#include <stdint.h>
+#include <string.h>
+#else
 #include <linux/string.h>
+#include <linux/types.h>
+#endif /* USE_HOSTCC */
 
+#include <stddef.h>
+#include <asm/byteorder.h>
 extern struct fdt_header *fdt;  /* Pointer to the working fdt */
 
 #define fdt32_to_cpu(x)                __be32_to_cpu(x)
index 37f2924..2ce1c25 100644 (file)
@@ -126,7 +126,7 @@ struct stat {
 
 #endif /* __MIPS__ */
 
-#if defined(__AVR32__)
+#if defined(__AVR32__) || defined(__SH__)
 
 struct stat {
        unsigned long st_dev;
@@ -149,7 +149,7 @@ struct stat {
        unsigned long  __unused5;
 };
 
-#endif /* __AVR32__ */
+#endif /* __AVR32__ || __SH__ */
 
 #ifdef __cplusplus
 }
diff --git a/include/lmb.h b/include/lmb.h
new file mode 100644 (file)
index 0000000..cc64cbb
--- /dev/null
@@ -0,0 +1,54 @@
+#ifndef _LINUX_LMB_H
+#define _LINUX_LMB_H
+#ifdef __KERNEL__
+
+#include <asm/types.h>
+/*
+ * Logical memory blocks.
+ *
+ * Copyright (C) 2001 Peter Bergner, IBM Corp.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#define MAX_LMB_REGIONS 8
+
+struct lmb_property {
+       ulong base;
+       ulong size;
+};
+
+struct lmb_region {
+       unsigned long cnt;
+       ulong size;
+       struct lmb_property region[MAX_LMB_REGIONS+1];
+};
+
+struct lmb {
+       struct lmb_region memory;
+       struct lmb_region reserved;
+};
+
+extern struct lmb lmb;
+
+extern void lmb_init(struct lmb *lmb);
+extern long lmb_add(struct lmb *lmb, ulong base, ulong size);
+extern long lmb_reserve(struct lmb *lmb, ulong base, ulong size);
+extern ulong lmb_alloc(struct lmb *lmb, ulong size, ulong align);
+extern ulong lmb_alloc_base(struct lmb *lmb, ulong size, ulong align, ulong max_addr);
+extern ulong __lmb_alloc_base(struct lmb *lmb, ulong size, ulong align, ulong max_addr);
+extern int lmb_is_reserved(struct lmb *lmb, ulong addr);
+
+extern void lmb_dump_all(struct lmb *lmb);
+
+static inline ulong
+lmb_size_bytes(struct lmb_region *type, unsigned long region_nr)
+{
+       return type->region[region_nr].size;
+}
+#endif /* __KERNEL__ */
+
+#endif /* _LINUX_LMB_H */
index df052e3..d2e1e2b 100644 (file)
 
 /* SPRIDR - System Part and Revision ID Register
  */
-#define SPRIDR_PARTID                  0xFFFF0000      /* Part Identification */
-#define SPRIDR_REVID                   0x0000FFFF      /* Revision Identification */
-
-#define SPR_8349E_REV10                        0x80300100
-#define SPR_8349_REV10                 0x80310100
-#define SPR_8347E_REV10_TBGA           0x80320100
-#define SPR_8347_REV10_TBGA            0x80330100
-#define SPR_8347E_REV10_PBGA           0x80340100
-#define SPR_8347_REV10_PBGA            0x80350100
-#define SPR_8343E_REV10                        0x80360100
-#define SPR_8343_REV10                 0x80370100
-
-#define SPR_8349E_REV11                        0x80300101
-#define SPR_8349_REV11                 0x80310101
-#define SPR_8347E_REV11_TBGA           0x80320101
-#define SPR_8347_REV11_TBGA            0x80330101
-#define SPR_8347E_REV11_PBGA           0x80340101
-#define SPR_8347_REV11_PBGA            0x80350101
-#define SPR_8343E_REV11                        0x80360101
-#define SPR_8343_REV11                 0x80370101
-
-#define SPR_8349E_REV31                        0x80300300
-#define SPR_8349_REV31                 0x80310300
-#define SPR_8347E_REV31_TBGA           0x80320300
-#define SPR_8347_REV31_TBGA            0x80330300
-#define SPR_8347E_REV31_PBGA           0x80340300
-#define SPR_8347_REV31_PBGA            0x80350300
-#define SPR_8343E_REV31                        0x80360300
-#define SPR_8343_REV31                 0x80370300
-
-#define SPR_8360E_REV10                        0x80480010
-#define SPR_8360_REV10                 0x80490010
-#define SPR_8360E_REV11                        0x80480011
-#define SPR_8360_REV11                 0x80490011
-#define SPR_8360E_REV12                        0x80480012
-#define SPR_8360_REV12                 0x80490012
-#define SPR_8360E_REV20                        0x80480020
-#define SPR_8360_REV20                 0x80490020
-#define SPR_8360E_REV21                        0x80480021
-#define SPR_8360_REV21                 0x80490021
-
-#define SPR_8323E_REV10                        0x80620010
-#define SPR_8323_REV10                 0x80630010
-#define SPR_8321E_REV10                        0x80660010
-#define SPR_8321_REV10                 0x80670010
-#define SPR_8323E_REV11                        0x80620011
-#define SPR_8323_REV11                 0x80630011
-#define SPR_8321E_REV11                        0x80660011
-#define SPR_8321_REV11                 0x80670011
-
-#define SPR_8313E_REV10                        0x80B00010
-#define SPR_8313_REV10                 0x80B10010
-#define SPR_8311E_REV10                        0x80B20010
-#define SPR_8311_REV10                 0x80B30010
-#define SPR_8315E_REV10                        0x80B40010
-#define SPR_8315_REV10                 0x80B50010
-#define SPR_8314E_REV10                        0x80B60010
-#define SPR_8314_REV10                 0x80B70010
-
-#define SPR_8379E_REV10                        0x80C20010
-#define SPR_8379_REV10                 0x80C30010
-#define SPR_8378E_REV10                        0x80C40010
-#define SPR_8378_REV10                 0x80C50010
-#define SPR_8377E_REV10                        0x80C60010
-#define SPR_8377_REV10                 0x80C70010
+#define SPRIDR_PARTID                  0xFFFF0000      /* Part Id */
+#define SPRIDR_REVID                   0x0000FFFF      /* Revision Id */
+
+#if defined(CONFIG_MPC834X)
+#define REVID_MAJOR(spridr)            ((spridr & 0x0000FF00) >> 8)
+#define REVID_MINOR(spridr)            (spridr & 0x000000FF)
+#else
+#define REVID_MAJOR(spridr)            ((spridr & 0x000000F0) >> 4)
+#define REVID_MINOR(spridr)            (spridr & 0x0000000F)
+#endif
+
+#define PARTID_NO_E(spridr)            ((spridr & 0xFFFE0000) >> 16)
+#define IS_E_PROCESSOR(spridr)         (!(spridr & 0x00010000)) /* has SEC */
+
+#define SPR_8311                       0x80B2
+#define SPR_8313                       0x80B0
+#define SPR_8314                       0x80B6
+#define SPR_8315                       0x80B4
+#define SPR_8321                       0x8066
+#define SPR_8323                       0x8062
+#define SPR_8343                       0x8036
+#define SPR_8347_TBGA_                 0x8032
+#define SPR_8347_PBGA_                 0x8034
+#define SPR_8349                       0x8030
+#define SPR_8358_TBGA_                 0x804A
+#define SPR_8358_PBGA_                 0x804E
+#define SPR_8360                       0x8048
+#define SPR_8377                       0x80C6
+#define SPR_8378                       0x80C4
+#define SPR_8379                       0x80C2
 
 /* SPCR - System Priority Configuration Register
  */
 #define SPCR_PCIPR                     0x03000000      /* PCI bridge system bus request priority */
 #define SPCR_PCIPR_SHIFT               (31-7)
 #define SPCR_OPT                       0x00800000      /* Optimize */
+#define SPCR_OPT_SHIFT                 (31-8)
 #define SPCR_TBEN                      0x00400000      /* E300 PowerPC core time base unit enable */
 #define SPCR_TBEN_SHIFT                        (31-9)
 #define SPCR_COREPR                    0x00300000      /* E300 PowerPC Core system bus request priority */
 #define TIMING_CFG0_PRE_PD_EXIT_SHIFT  16
 #define TIMING_CFG0_ODT_PD_EXIT                0x00000F00
 #define TIMING_CFG0_ODT_PD_EXIT_SHIFT  8
-#define TIMING_CFG0_MRS_CYC            0x00000F00
+#define TIMING_CFG0_MRS_CYC            0x0000000F
 #define TIMING_CFG0_MRS_CYC_SHIFT      0
 
 /* TIMING_CFG_1 - DDR SDRAM Timing Configuration 1
 #define TIMING_CFG1_WRTORD_SHIFT       0
 #define TIMING_CFG1_CASLAT_20          0x00030000      /* CAS latency = 2.0 */
 #define TIMING_CFG1_CASLAT_25          0x00040000      /* CAS latency = 2.5 */
+#define TIMING_CFG1_CASLAT_30          0x00050000      /* CAS latency = 2.5 */
 
 /* TIMING_CFG_2 - DDR SDRAM Timing Configuration 2
  */
index 8407aa0..b22a637 100644 (file)
@@ -27,8 +27,8 @@
 
 typedef struct block_dev_desc {
        int             if_type;        /* type of the interface */
-       int             dev;            /* device number */
-       unsigned char   part_type;      /* partition type */
+       int             dev;            /* device number */
+       unsigned char   part_type;      /* partition type */
        unsigned char   target;         /* target SCSI ID */
        unsigned char   lun;            /* target LUN */
        unsigned char   type;           /* device type */
@@ -36,9 +36,9 @@ typedef struct block_dev_desc {
 #ifdef CONFIG_LBA48
        unsigned char   lba48;          /* device can use 48bit addr (ATA/ATAPI v7) */
 #endif
-       lbaint_t                lba;            /* number of blocks */
+       lbaint_t                lba;            /* number of blocks */
        unsigned long   blksz;          /* block size */
-       char            vendor [40+1];  /* IDE model, SCSI Vendor */
+       char            vendor [40+1];  /* IDE model, SCSI Vendor */
        char            product[20+1];  /* IDE Serial no, SCSI product */
        char            revision[8+1];  /* firmware revision */
        unsigned long   (*block_read)(int dev,
@@ -49,6 +49,7 @@ typedef struct block_dev_desc {
                                       unsigned long start,
                                       lbaint_t blkcnt,
                                       const void *buffer);
+       void            *priv;          /* driver private struct pointer */
 }block_dev_desc_t;
 
 /* Interface types: */
@@ -60,6 +61,7 @@ typedef struct block_dev_desc {
 #define IF_TYPE_DOC            5
 #define IF_TYPE_MMC            6
 #define IF_TYPE_SD             7
+#define IF_TYPE_SATA           8
 
 /* Part types */
 #define PART_TYPE_UNKNOWN      0x00
@@ -92,6 +94,7 @@ typedef struct disk_partition {
 /* Misc _get_dev functions */
 block_dev_desc_t* get_dev(char* ifname, int dev);
 block_dev_desc_t* ide_get_dev(int dev);
+block_dev_desc_t* sata_get_dev(int dev);
 block_dev_desc_t* scsi_get_dev(int dev);
 block_dev_desc_t* usb_stor_get_dev(int dev);
 block_dev_desc_t* mmc_get_dev(int dev);
index 3b10452..61c2203 100644 (file)
 #define PCI_DEVICE_ID_ITE_IT8172G      0x8172
 #define PCI_DEVICE_ID_ITE_IT8172G_AUDIO 0x0801
 #define PCI_DEVICE_ID_ITE_IT8181       0x8181
+#define PCI_DEVICE_ID_ITE_8211         0x8211
+#define PCI_DEVICE_ID_ITE_8212         0x8212
 #define PCI_DEVICE_ID_ITE_8872         0x8872
 
 #define PCI_DEVICE_ID_ITE_IT8330G_0    0xe886
 #define PCI_DEVICE_ID_INTEL_82434      0x04a3
 #define PCI_DEVICE_ID_INTEL_I960       0x0960
 #define PCI_DEVICE_ID_INTEL_I960RM     0x0962
+#define PCI_DEVICE_ID_INTEL_82541ER 0x1078
 #define PCI_DEVICE_ID_INTEL_82542      0x1000
 #define PCI_DEVICE_ID_INTEL_82543GC_FIBER      0x1001
 #define PCI_DEVICE_ID_INTEL_82543GC_COPPER     0x1004
 #define PCI_DEVICE_ID_MICROGATE_USC    0x0010
 #define PCI_DEVICE_ID_MICROGATE_SCC    0x0020
 #define PCI_DEVICE_ID_MICROGATE_SCA    0x0030
+
+#define PCI_VENDOR_ID_FREESCALE                0x1957
+#define PCI_DEVICE_ID_MPC8548E         0x0012
+#define PCI_DEVICE_ID_MPC8548          0x0013
+#define PCI_DEVICE_ID_MPC8543E         0x0014
+#define PCI_DEVICE_ID_MPC8543          0x0015
+#define PCI_DEVICE_ID_MPC8547E         0x0018
+#define PCI_DEVICE_ID_MPC8545E         0x0019
+#define PCI_DEVICE_ID_MPC8545          0x001a
+#define PCI_DEVICE_ID_MPC8568E         0x0020
+#define PCI_DEVICE_ID_MPC8568          0x0021
+#define PCI_DEVICE_ID_MPC8567E         0x0022
+#define PCI_DEVICE_ID_MPC8567          0x0023
+#define PCI_DEVICE_ID_MPC8533E         0x0030
+#define PCI_DEVICE_ID_MPC8533          0x0031
+#define PCI_DEVICE_ID_MPC8544E         0x0032
+#define PCI_DEVICE_ID_MPC8544          0x0033
+#define PCI_DEVICE_ID_MPC8572E         0x0040
+#define PCI_DEVICE_ID_MPC8572          0x0041
+#define PCI_DEVICE_ID_MPC8641          0x7010
+#define PCI_DEVICE_ID_MPC8641D         0x7011
+#define PCI_DEVICE_ID_MPC8610          0x7018
+
+#define PCI_VENDOR_ID_ADMTEK           0x1317
+#define PCI_DEVICE_ID_ADMTEK_AN983B    0x0985
index 10517cb..bb39ad6 100644 (file)
 #else
 #define CNTRL_DCR_BASE 0x0b0
 #endif
-#if defined(CONFIG_440GX) || \
-    defined(CONFIG_440SP) || defined(CONFIG_440SPE) || \
-    defined(CONFIG_460EX) || defined(CONFIG_460GT)
+
 #define cpc0_er                (CNTRL_DCR_BASE+0x00)   /* CPM enable register          */
 #define cpc0_fr                (CNTRL_DCR_BASE+0x01)   /* CPM force register           */
 #define cpc0_sr                (CNTRL_DCR_BASE+0x02)   /* CPM status register          */
-#else
-#define cpc0_sr                (CNTRL_DCR_BASE+0x00)   /* CPM status register          */
-#define cpc0_er                (CNTRL_DCR_BASE+0x01)   /* CPM enable register          */
-#define cpc0_fr                (CNTRL_DCR_BASE+0x02)   /* CPM force register           */
-#endif
 
 #define cpc0_sys0      (CNTRL_DCR_BASE+0x30)   /* System configuration reg 0   */
 #define cpc0_sys1      (CNTRL_DCR_BASE+0x31)   /* System configuration reg 1   */
 #define malrxctp2r  (MAL_DCR_BASE+0x42) /* RX 2 Channel table pointer reg   */
 #define malrxctp3r  (MAL_DCR_BASE+0x43) /* RX 3 Channel table pointer reg   */
 #define malrxctp8r  (MAL_DCR_BASE+0x48) /* RX 8 Channel table pointer reg   */
+#define malrxctp16r (MAL_DCR_BASE+0x50) /* RX 16 Channel table pointer reg  */
+#define malrxctp24r (MAL_DCR_BASE+0x58) /* RX 24 Channel table pointer reg  */
 #define malrcbs2    (MAL_DCR_BASE+0x62) /* RX 2 Channel buffer size reg            */
 #define malrcbs3    (MAL_DCR_BASE+0x63) /* RX 3 Channel buffer size reg            */
 #define malrcbs8    (MAL_DCR_BASE+0x68) /* RX 8 Channel buffer size reg            */
+#define malrcbs16   (MAL_DCR_BASE+0x70) /* RX 16 Channel buffer size reg    */
+#define malrcbs24   (MAL_DCR_BASE+0x78) /* RX 24 Channel buffer size reg    */
 #endif /* CONFIG_440GX */
 
 
index 0208454..89ff26f 100644 (file)
@@ -213,6 +213,10 @@ typedef struct emac_4xx_hw_st {
 #define RGMII_FER              (RGMII_BASE + 0x00)
 #define RGMII_SSR              (RGMII_BASE + 0x04)
 
+#if defined(CONFIG_460GT)
+#define RGMII1_BASE_OFFSET     0x100
+#endif
+
 /* RGMII Function Enable (FER) Register Bit Definitions */
 /* Note: for EMAC 2 and 3 only, 440GX only */
 #define RGMII_FER_DIS          (0x00)
index 15f3571..2995144 100644 (file)
@@ -52,7 +52,7 @@ struct rtc_time {
        int tm_isdst;
 };
 
-void rtc_get (struct rtc_time *);
+int rtc_get (struct rtc_time *);
 void rtc_set (struct rtc_time *);
 void rtc_reset (void);
 
index 165b471..57ee9ac 100644 (file)
+#ifndef __SATA_H__
+#define __SATA_H__
 
-#if (DEBUG_SATA)
-#define PRINTF(fmt,args...)    printf (fmt ,##args)
-#else
-#define PRINTF(fmt,args...)
-#endif
-
-struct sata_ioports {
-       unsigned long cmd_addr;
-       unsigned long data_addr;
-       unsigned long error_addr;
-       unsigned long feature_addr;
-       unsigned long nsect_addr;
-       unsigned long lbal_addr;
-       unsigned long lbam_addr;
-       unsigned long lbah_addr;
-       unsigned long device_addr;
-       unsigned long status_addr;
-       unsigned long command_addr;
-       unsigned long altstatus_addr;
-       unsigned long ctl_addr;
-       unsigned long bmdma_addr;
-       unsigned long scr_addr;
-};
-
-struct sata_port {
-       unsigned char port_no;          /* primary=0, secondary=1       */
-       struct sata_ioports ioaddr;     /* ATA cmd/ctl/dma reg blks     */
-       unsigned char ctl_reg;
-       unsigned char last_ctl;
-       unsigned char port_state;       /* 1-port is available and      */
-                                       /* 0-port is not available      */
-       unsigned char dev_mask;
-};
+int init_sata(int dev);
+int scan_sata(int dev);
+ulong sata_read(int dev, ulong blknr, ulong blkcnt, void *buffer);
+ulong sata_write(int dev, ulong blknr, ulong blkcnt, const void *buffer);
 
-/***********SATA LIBRARY SPECIFIC DEFINITIONS AND DECLARATIONS**************/
-#ifdef SATA_DECL               /*SATA library specific declarations */
-#define ata_id_has_lba48(id)    ((id)[83] & (1 << 10))
-#define ata_id_has_lba(id)      ((id)[49] & (1 << 9))
-#define ata_id_has_dma(id)      ((id)[49] & (1 << 8))
-#define ata_id_u32(id,n)        \
-       (((u32) (id)[(n) + 1] << 16) | ((u32) (id)[(n)]))
-#define ata_id_u64(id,n)        \
-       (((u64) (id)[(n) + 3] << 48) | \
-       ((u64) (id)[(n) + 2] << 32) | \
-       ((u64) (id)[(n) + 1] << 16) | \
-       ((u64) (id)[(n) + 0]) )
-#endif
-
-#ifdef SATA_DECL               /*SATA library specific declarations */
-static inline void
-ata_dump_id (u16 * id)
-{
-       PRINTF ("49==0x%04x  "
-               "53==0x%04x  "
-               "63==0x%04x  "
-               "64==0x%04x  "
-               "75==0x%04x  \n", id[49], id[53], id[63], id[64], id[75]);
-       PRINTF ("80==0x%04x  "
-               "81==0x%04x  "
-               "82==0x%04x  "
-               "83==0x%04x  "
-               "84==0x%04x  \n", id[80], id[81], id[82], id[83], id[84]);
-       PRINTF ("88==0x%04x  " "93==0x%04x\n", id[88], id[93]);
-}
-#endif
-
-#ifdef SATA_DECL               /*SATA library specific declarations */
-int sata_bus_softreset (int num);
-void sata_identify (int num, int dev);
-void sata_port (struct sata_ioports *ioport);
-void set_Feature_cmd (int num, int dev);
-int sata_devchk (struct sata_ioports *ioaddr, int dev);
-void dev_select (struct sata_ioports *ioaddr, int dev);
-u8 sata_busy_wait (struct sata_ioports *ioaddr, int bits, unsigned int max);
-u8 sata_chk_status (struct sata_ioports *ioaddr);
-ulong sata_read (int device, ulong blknr,lbaint_t blkcnt, void * buffer);
-ulong sata_write (int device,ulong blknr, lbaint_t blkcnt, void * buffer);
-void msleep (int count);
-#else
-extern int sata_bus_softreset (int num);
-extern void sata_identify (int num, int dev);
-extern void sata_port (struct sata_ioports *ioport);
-extern void set_Feature_cmd (int num, int dev);
-extern ulong sata_read (int device, ulong blknr,
-                       lbaint_t blkcnt, void * buffer);
-extern ulong sata_write (int device, ulong blknr,
-                       lbaint_t blkcnt, void * buffer);
-extern void msleep (int count);
-#endif
-
-/************DRIVER SPECIFIC DEFINITIONS AND DECLARATIONS**************/
-
-#ifdef DRV_DECL                        /*Driver specific declaration */
-int init_sata (void);
-#else
-extern int init_sata (void);
-#endif
+int sata_initialize(void);
 
-#ifdef DRV_DECL                        /*Defines Driver Specific variables */
-struct sata_port port[CFG_SATA_MAXBUS];
-block_dev_desc_t sata_dev_desc[CFG_SATA_MAXDEVICES];
-int curr_dev = -1;
-#else
-extern struct sata_port port[CFG_SATA_MAXBUS];
-extern block_dev_desc_t sata_dev_desc[CFG_SATA_MAXDEVICES];
-extern int curr_dev;
 #endif
index 15ea13c..734d1fb 100644 (file)
@@ -80,6 +80,17 @@ void sha1_csum( unsigned char *input, int ilen,
                unsigned char output[20] );
 
 /**
+ * \brief         Output = SHA-1( input buffer ), with watchdog triggering
+ *
+ * \param input    buffer holding the  data
+ * \param ilen    length of the input data
+ * \param output   SHA-1 checksum result
+ * \param chunk_sz watchdog triggering period (in bytes of input processed)
+ */
+void sha1_csum_wd (unsigned char *input, int ilen,
+               unsigned char output[20], unsigned int chunk_sz);
+
+/**
  * \brief         Output = SHA-1( file contents )
  *
  * \param path    input file name
index 03dc5bc..3a55a68 100644 (file)
 #ifndef _SPI_H_
 #define _SPI_H_
 
+/* SPI mode flags */
+#define        SPI_CPHA        0x01                    /* clock phase */
+#define        SPI_CPOL        0x02                    /* clock polarity */
+#define        SPI_MODE_0      (0|0)                   /* (original MicroWire) */
+#define        SPI_MODE_1      (0|SPI_CPHA)
+#define        SPI_MODE_2      (SPI_CPOL|0)
+#define        SPI_MODE_3      (SPI_CPOL|SPI_CPHA)
+#define        SPI_CS_HIGH     0x04                    /* chipselect active high? */
+#define        SPI_LSB_FIRST   0x08                    /* per-word bits-on-wire */
+#define        SPI_3WIRE       0x10                    /* SI/SO signals shared */
+#define        SPI_LOOP        0x20                    /* loopback mode */
+
 /*
  * The function call pointer type used to drive the chip select.
  */
@@ -68,6 +80,8 @@ void spi_init(void);
  *
  *   Returns: 0 on success, not 0 on failure
  */
-int  spi_xfer(spi_chipsel_type chipsel, int bitlen, uchar *dout, uchar *din);
+int spi_xfer(spi_chipsel_type chipsel, int bitlen, uchar *dout, uchar *din);
+
+int spi_select(unsigned int bus, unsigned int dev, unsigned long mode);
 
 #endif /* _SPI_H_ */
diff --git a/include/stratixII.h b/include/stratixII.h
new file mode 100644 (file)
index 0000000..37abd9f
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * (C) Copyright 2007
+ * Eran Liberty, Extricom, eran.liberty@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 _STRATIXII_H_
+#define _STRATIXII_H_
+
+extern int StratixII_load (Altera_desc * desc, void *image, size_t size);
+extern int StratixII_dump (Altera_desc * desc, void *buf, size_t bsize);
+extern int StratixII_info (Altera_desc * desc);
+extern int StratixII_reloc (Altera_desc * desc, ulong reloc_off);
+
+#endif                         /* _STRATIXII_H_ */
diff --git a/include/u-boot/md5.h b/include/u-boot/md5.h
new file mode 100644 (file)
index 0000000..8b44a7f
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * This file was transplanted with slight modifications from Linux sources
+ * (fs/cifs/md5.h) into U-Boot by Bartlomiej Sieka <tur@semihalf.com>.
+ */
+
+#ifndef _MD5_H
+#define _MD5_H
+
+#include <linux/types.h>
+
+struct MD5Context {
+       __u32 buf[4];
+       __u32 bits[2];
+       unsigned char in[64];
+};
+
+/*
+ * Calculate and store in 'output' the MD5 digest of 'len' bytes at
+ * 'input'. 'output' must have enough space to hold 16 bytes.
+ */
+void md5 (unsigned char *input, int len, unsigned char output[16]);
+
+/*
+ * Calculate and store in 'output' the MD5 digest of 'len' bytes at 'input'.
+ * 'output' must have enough space to hold 16 bytes. If 'chunk' Trigger the
+ * watchdog every 'chunk_sz' bytes of input processed.
+ */
+void md5_wd (unsigned char *input, int len, unsigned char output[16],
+               unsigned int chunk_sz);
+
+#endif /* _MD5_H */
index 4e1539f..5a6ffdd 100644 (file)
@@ -195,7 +195,7 @@ void usb_event_poll(void);
 #define USB_MAX_STOR_DEV 5
 block_dev_desc_t *usb_stor_get_dev(int index);
 int usb_stor_scan(int mode);
-void usb_stor_info(void);
+int usb_stor_info(void);
 
 #endif
 
diff --git a/include/vsc7385.h b/include/vsc7385.h
new file mode 100644 (file)
index 0000000..fceb078
--- /dev/null
@@ -0,0 +1,12 @@
+/*
+ * Header file for vsc7385.c
+ *
+ * Author: Timur Tabi <timur@freescale.com>
+ *
+ * Copyright 2008 Freescale Semiconductor, Inc.  This file is licensed
+ * under the terms of the GNU General Public License version 2.  This
+ * program is licensed "as is" without any warranty of any kind, whether
+ * express or implied.
+ */
+
+int vsc7385_upload_firmware(void *firmware, unsigned int size);
index bfd5b0e..12a8748 100644 (file)
@@ -25,13 +25,21 @@ include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(ARCH).a
 
-SOBJS  = _ashldi3.o _ashrdi3.o _divsi3.o _modsi3.o _udivsi3.o _umodsi3.o
-
-COBJS  = armlinux.o board.o \
-         cache.o div0.o interrupts.o
-
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+SOBJS-y        += _ashldi3.o
+SOBJS-y        += _ashrdi3.o
+SOBJS-y        += _divsi3.o
+SOBJS-y        += _modsi3.o
+SOBJS-y        += _udivsi3.o
+SOBJS-y        += _umodsi3.o
+
+COBJS-y        += board.o
+COBJS-y        += bootm.o
+COBJS-y        += cache.o
+COBJS-y        += div0.o
+COBJS-y        += interrupts.o
+
+SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
 
 $(LIB):        $(obj).depend $(OBJS)
        $(AR) $(ARFLAGS) $@ $(OBJS)
similarity index 68%
rename from lib_arm/armlinux.c
rename to lib_arm/bootm.c
index 42098fc..6b4a807 100644 (file)
 #include <image.h>
 #include <zlib.h>
 #include <asm/byteorder.h>
-#ifdef CONFIG_HAS_DATAFLASH
-#include <dataflash.h>
-#endif
 
 DECLARE_GLOBAL_DATA_PTR;
 
-/*cmd_boot.c*/
-extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
-
 #if defined (CONFIG_SETUP_MEMORY_TAGS) || \
     defined (CONFIG_CMDLINE_TAG) || \
     defined (CONFIG_INITRD_TAG) || \
@@ -62,165 +56,54 @@ static void setup_end_tag (bd_t *bd);
 static void setup_videolfb_tag (gd_t *gd);
 # endif
 
-
 static struct tag *params;
 #endif /* CONFIG_SETUP_MEMORY_TAGS || CONFIG_CMDLINE_TAG || CONFIG_INITRD_TAG */
 
-extern image_header_t header;  /* from cmd_bootm.c */
-
+extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 
 void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
-                    ulong addr, ulong *len_ptr, int verify)
+                    bootm_headers_t *images)
 {
-       ulong len = 0, checksum;
-       ulong initrd_start, initrd_end;
-       ulong data;
-       void (*theKernel)(int zero, int arch, uint params);
-       image_header_t *hdr = &header;
-       bd_t *bd = gd->bd;
-       int machid = bd->bi_arch_number;
-       char *s;
+       ulong   initrd_start, initrd_end;
+       ulong   ep = 0;
+       bd_t    *bd = gd->bd;
+       char    *s;
+       int     machid = bd->bi_arch_number;
+       void    (*theKernel)(int zero, int arch, uint params);
+       int     ret;
 
 #ifdef CONFIG_CMDLINE_TAG
        char *commandline = getenv ("bootargs");
 #endif
 
-       theKernel = (void (*)(int, int, uint))ntohl(hdr->ih_ep);
-
-       s = getenv ("machid");
-       if (s) {
-               machid = simple_strtoul (s, NULL, 16);
-               printf ("Using machid 0x%x from environment\n", machid);
-       }
-
-       /*
-        * Check if there is an initrd image
-        */
-       if (argc >= 3) {
-               show_boot_progress (9);
-
-               addr = simple_strtoul (argv[2], NULL, 16);
-
-               printf ("## Loading Ramdisk Image at %08lx ...\n", addr);
-
-               /* Copy header so we can blank CRC field for re-calculation */
-#ifdef CONFIG_HAS_DATAFLASH
-               if (addr_dataflash (addr)) {
-                       read_dataflash (addr, sizeof (image_header_t),
-                                       (char *) &header);
-               } else
-#endif
-                       memcpy (&header, (char *) addr,
-                               sizeof (image_header_t));
-
-               if (ntohl (hdr->ih_magic) != IH_MAGIC) {
-                       printf ("Bad Magic Number\n");
-                       show_boot_progress (-10);
-                       do_reset (cmdtp, flag, argc, argv);
-               }
-
-               data = (ulong) & header;
-               len = sizeof (image_header_t);
-
-               checksum = ntohl (hdr->ih_hcrc);
-               hdr->ih_hcrc = 0;
-
-               if (crc32 (0, (unsigned char *) data, len) != checksum) {
-                       printf ("Bad Header Checksum\n");
-                       show_boot_progress (-11);
-                       do_reset (cmdtp, flag, argc, argv);
-               }
-
-               show_boot_progress (10);
-
-               print_image_hdr (hdr);
-
-               data = addr + sizeof (image_header_t);
-               len = ntohl (hdr->ih_size);
-
-#ifdef CONFIG_HAS_DATAFLASH
-               if (addr_dataflash (addr)) {
-                       read_dataflash (data, len, (char *) CFG_LOAD_ADDR);
-                       data = CFG_LOAD_ADDR;
+       /* find kernel entry point */
+       if (images->legacy_hdr_valid) {
+               ep = image_get_ep (&images->legacy_hdr_os_copy);
+#if defined(CONFIG_FIT)
+       } else if (images->fit_uname_os) {
+               ret = fit_image_get_entry (images->fit_hdr_os,
+                                       images->fit_noffset_os, &ep);
+               if (ret) {
+                       puts ("Can't get entry point property!\n");
+                       goto error;
                }
 #endif
-
-               if (verify) {
-                       ulong csum = 0;
-
-                       printf ("   Verifying Checksum ... ");
-                       csum = crc32 (0, (unsigned char *) data, len);
-                       if (csum != ntohl (hdr->ih_dcrc)) {
-                               printf ("Bad Data CRC\n");
-                               show_boot_progress (-12);
-                               do_reset (cmdtp, flag, argc, argv);
-                       }
-                       printf ("OK\n");
-               }
-
-               show_boot_progress (11);
-
-               if ((hdr->ih_os != IH_OS_LINUX) ||
-                   (hdr->ih_arch != IH_CPU_ARM) ||
-                   (hdr->ih_type != IH_TYPE_RAMDISK)) {
-                       printf ("No Linux ARM Ramdisk Image\n");
-                       show_boot_progress (-13);
-                       do_reset (cmdtp, flag, argc, argv);
-               }
-
-#if defined(CONFIG_B2) || defined(CONFIG_EVB4510) ||   \
-               defined(CONFIG_ARMADILLO) || defined(CONFIG_M501SK)
-               /*
-                *we need to copy the ramdisk to SRAM to let Linux boot
-                */
-               memmove ((void *) ntohl(hdr->ih_load), (uchar *)data, len);
-               data = ntohl(hdr->ih_load);
-#endif /* CONFIG_B2 || CONFIG_EVB4510 */
-
-               /*
-                * Now check if we have a multifile image
-                */
-       } else if ((hdr->ih_type == IH_TYPE_MULTI) && (len_ptr[1])) {
-               ulong tail = ntohl (len_ptr[0]) % 4;
-               int i;
-
-               show_boot_progress (13);
-
-               /* skip kernel length and terminator */
-               data = (ulong) (&len_ptr[2]);
-               /* skip any additional image length fields */
-               for (i = 1; len_ptr[i]; ++i)
-                       data += 4;
-               /* add kernel length, and align */
-               data += ntohl (len_ptr[0]);
-               if (tail) {
-                       data += 4 - tail;
-               }
-
-               len = ntohl (len_ptr[1]);
-
        } else {
-               /*
-                * no initrd image
-                */
-               show_boot_progress (14);
-
-               len = data = 0;
+               puts ("Could not find kernel entry point!\n");
+               goto error;
        }
+       theKernel = (void (*)(int, int, uint))ep;
 
-#ifdef DEBUG
-       if (!data) {
-               printf ("No initrd\n");
+       s = getenv ("machid");
+       if (s) {
+               machid = simple_strtoul (s, NULL, 16);
+               printf ("Using machid 0x%x from environment\n", machid);
        }
-#endif
 
-       if (data) {
-               initrd_start = data;
-               initrd_end = initrd_start + len;
-       } else {
-               initrd_start = 0;
-               initrd_end = 0;
-       }
+       ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_ARM,
+                       &initrd_start, &initrd_end);
+       if (ret)
+               goto error;
 
        show_boot_progress (15);
 
@@ -257,6 +140,9 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
        setup_end_tag (bd);
 #endif
 
+       if (!images->autostart)
+               return ;
+
        /* we assume that the kernel is in place */
        printf ("\nStarting kernel ...\n\n");
 
@@ -270,6 +156,13 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
        cleanup_before_linux ();
 
        theKernel (0, machid, bd->bi_boot_params);
+       /* does not return */
+       return;
+
+error:
+       if (images->autostart)
+               do_reset (cmdtp, flag, argc, argv);
+       return;
 }
 
 
index bb2938f..37b8051 100644 (file)
@@ -27,12 +27,14 @@ include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(ARCH).a
 
-SOBJS  = memset.o
+SOBJS-y        += memset.o
 
-COBJS  = board.o interrupts.o avr32_linux.o
+COBJS-y        += board.o
+COBJS-y        += bootm.o
+COBJS-y        += interrupts.o
 
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
 
 $(LIB):        $(obj).depend $(OBJS)
        $(AR) $(ARFLAGS) $@ $(OBJS)
similarity index 65%
rename from lib_avr32/avr32_linux.c
rename to lib_avr32/bootm.c
index 62afbd2..5ff8c79 100644 (file)
 
 DECLARE_GLOBAL_DATA_PTR;
 
-extern int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
-
 /* CPU-specific hook to allow flushing of caches, etc. */
 extern void prepare_to_boot(void);
 
-extern image_header_t header;          /* from cmd_bootm.c */
+extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 
 static struct tag *setup_start_tag(struct tag *params)
 {
@@ -176,113 +174,37 @@ static void setup_end_tag(struct tag *params)
 }
 
 void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
-                   unsigned long addr, unsigned long *len_ptr, int verify)
+                   bootm_headers_t *images)
 {
-       unsigned long data, len = 0;
-       unsigned long initrd_start, initrd_end;
-       unsigned long image_start, image_end;
-       unsigned long checksum;
-       void (*theKernel)(int magic, void *tagtable);
-       image_header_t *hdr;
-       struct tag *params, *params_start;
-       char *commandline = getenv("bootargs");
-
-       hdr = (image_header_t *)addr;
-       image_start = addr;
-       image_end = addr + hdr->ih_size;
-
-       theKernel = (void *)ntohl(hdr->ih_ep);
-
-       /*
-        * Check if there is an initrd image
-        */
-       if (argc >= 3) {
-               show_boot_progress (9);
-
-               addr = simple_strtoul(argv[2], NULL, 16);
-
-               printf("## Loading RAMDISK image at %08lx ...\n", addr);
-
-               memcpy(&header, (char *)addr, sizeof(header));
-               hdr = &header;
-
-               if (ntohl(hdr->ih_magic) != IH_MAGIC) {
-                       puts("Bad Magic Number\n");
-                       show_boot_progress (-10);
-                       do_reset(cmdtp, flag, argc, argv);
+       ulong   initrd_start, initrd_end;
+       ulong   ep = 0;
+       void    (*theKernel)(int magic, void *tagtable);
+       struct  tag *params, *params_start;
+       char    *commandline = getenv("bootargs");
+       int     ret;
+
+       /* find kernel entry point */
+       if (images->legacy_hdr_valid) {
+               ep = image_get_ep (&images->legacy_hdr_os_copy);
+#if defined(CONFIG_FIT)
+       } else if (images->fit_uname_os) {
+               ret = fit_image_get_entry (images->fit_hdr_os,
+                               images->fit_noffset_os, &ep);
+               if (ret) {
+                       puts ("Can't get entry point property!\n");
+                       goto error;
                }
-
-               data = (unsigned long)hdr;
-               len = sizeof(*hdr);
-               checksum = ntohl(hdr->ih_hcrc);
-               hdr->ih_hcrc = 0;
-
-               if (crc32(0, (unsigned char *)data, len) != checksum) {
-                       puts("Bad Header Checksum\n");
-                       show_boot_progress (-11);
-                       do_reset(cmdtp, flag, argc, argv);
-               }
-
-               show_boot_progress (10);
-
-               print_image_hdr(hdr);
-
-               data = addr + sizeof(header);
-               len = ntohl(hdr->ih_size);
-
-               if (verify) {
-                       unsigned long csum = 0;
-
-                       puts("   Verifying Checksum ... ");
-                       csum = crc32(0, (unsigned char *)data, len);
-                       if (csum != ntohl(hdr->ih_dcrc)) {
-                               puts("Bad Data CRC\n");
-                               show_boot_progress (-12);
-                               do_reset(cmdtp, flag, argc, argv);
-                       }
-                       puts("OK\n");
-               }
-
-               show_boot_progress (11);
-
-               if ((hdr->ih_os != IH_OS_LINUX) ||
-                   (hdr->ih_arch != IH_CPU_AVR32) ||
-                   (hdr->ih_type != IH_TYPE_RAMDISK)) {
-                       puts("Not a Linux/AVR32 RAMDISK image\n");
-                       show_boot_progress (-13);
-                       do_reset(cmdtp, flag, argc, argv);
-               }
-       } else if ((hdr->ih_type == IH_TYPE_MULTI) && (len_ptr[1])) {
-               ulong tail = ntohl (len_ptr[0]) % 4;
-               int i;
-
-               show_boot_progress (13);
-
-               /* skip kernel length and terminator */
-               data = (ulong) (&len_ptr[2]);
-               /* skip any additional image length fields */
-               for (i = 1; len_ptr[i]; ++i)
-                       data += 4;
-               /* add kernel length, and align */
-               data += ntohl (len_ptr[0]);
-               if (tail) {
-                       data += 4 - tail;
-               }
-
-               len = ntohl (len_ptr[1]);
+#endif
        } else {
-               /* no initrd image */
-               show_boot_progress (14);
-               len = data = 0;
+               puts ("Could not find kernel entry point!\n");
+               goto error;
        }
+       theKernel = (void *)ep;
 
-       if (data) {
-               initrd_start = data;
-               initrd_end = initrd_start + len;
-       } else {
-               initrd_start = 0;
-               initrd_end = 0;
-       }
+       ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_AVR32,
+                       &initrd_start, &initrd_end);
+       if (ret)
+               goto error;
 
        show_boot_progress (15);
 
@@ -299,10 +221,20 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
        params = setup_ethernet_tags(params);
        setup_end_tag(params);
 
+       if (!images->autostart)
+               return ;
+
        printf("\nStarting kernel at %p (params at %p)...\n\n",
               theKernel, params_start);
 
        prepare_to_boot();
 
        theKernel(ATAG_MAGIC, params_start);
+       /* does not return */
+       return;
+
+error:
+       if (images->autostart)
+               do_reset (cmdtp, flag, argc, argv);
+       return;
 }
index a7aaef7..3617104 100644 (file)
@@ -1,7 +1,7 @@
 #
 # U-boot Makefile
 #
-# Copyright (c) 2005-2007 Analog Devices Inc.
+# Copyright (c) 2005-2008 Analog Devices Inc.
 #
 # (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 
 include $(TOPDIR)/config.mk
 
-LIB    = $(obj)lib$(ARCH).a
-
-SOBJS  = memcpy.o memcmp.o memset.o memmove.o
+CFLAGS += -DBFIN_BOARD_NAME='"$(BOARD)"'
 
-COBJS  = post.o tests.o board.o bf533_linux.o bf533_string.o cache.o muldi3.o
+LIB    = $(obj)lib$(ARCH).a
 
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+SOBJS-y        += memcmp.o
+SOBJS-y        += memcpy.o
+SOBJS-y        += memmove.o
+SOBJS-y        += memset.o
+
+COBJS-y        += board.o
+COBJS-y        += bootm.o
+COBJS-y        += cache.o
+COBJS-y        += muldi3.o
+COBJS-y        += post.o
+COBJS-y        += string.o
+COBJS-y        += tests.o
+
+SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
 
 $(LIB):        $(obj).depend $(OBJS)
        $(AR) $(ARFLAGS) $@ $(OBJS)
diff --git a/lib_blackfin/bf533_linux.c b/lib_blackfin/bf533_linux.c
deleted file mode 100644 (file)
index 80a3dc7..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * U-boot - bf533_linux.c
- *
- * Copyright (c) 2005-2007 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
- */
-
-/* Dummy functions, currently not in Use */
-
-#include <common.h>
-#include <command.h>
-#include <image.h>
-#include <zlib.h>
-#include <asm/byteorder.h>
-
-#define        LINUX_MAX_ENVS          256
-#define        LINUX_MAX_ARGS          256
-
-#define CMD_LINE_ADDR 0xFF900000       /* L1 scratchpad */
-
-#ifdef SHARED_RESOURCES
-extern void swap_to(int device_id);
-#endif
-
-extern image_header_t header;
-extern void flush_instruction_cache(void);
-extern void flush_data_cache(void);
-static char *make_command_line(void);
-
-void do_bootm_linux(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[],
-                   ulong addr, ulong * len_ptr, int verify)
-{
-       int (*appl) (char *cmdline);
-       char *cmdline;
-
-#ifdef SHARED_RESOURCES
-       swap_to(FLASH);
-#endif
-
-       appl = (int (*)(char *))ntohl(header.ih_ep);
-       printf("Starting Kernel at = %x\n", appl);
-       cmdline = make_command_line();
-       if (icache_status()) {
-               flush_instruction_cache();
-               icache_disable();
-       }
-       if (dcache_status()) {
-               flush_data_cache();
-               dcache_disable();
-       }
-       (*appl) (cmdline);
-}
-
-char *make_command_line(void)
-{
-       char *dest = (char *)CMD_LINE_ADDR;
-       char *bootargs;
-
-       if ((bootargs = getenv("bootargs")) == NULL)
-               return NULL;
-
-       strncpy(dest, bootargs, 0x1000);
-       dest[0xfff] = 0;
-       return dest;
-}
diff --git a/lib_blackfin/bf533_string.c b/lib_blackfin/bf533_string.c
deleted file mode 100644 (file)
index 9ceeeef..0000000
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * U-boot - bf533_string.c Contains library routines.
- *
- * Copyright (c) 2005-2007 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/io.h>
-#include "cache.h"
-#include <asm/mach-common/bits/dma.h>
-
-char *strcpy(char *dest, const char *src)
-{
-       char *xdest = dest;
-       char temp = 0;
-
-       __asm__ __volatile__
-           ("1:\t%2 = B [%1++] (Z);\n\t"
-            "B [%0++] = %2;\n\t"
-            "CC = %2;\n\t"
-            "if cc jump 1b (bp);\n":"=a"(dest), "=a"(src), "=d"(temp)
-            :"0"(dest), "1"(src), "2"(temp):"memory");
-
-       return xdest;
-}
-
-char *strncpy(char *dest, const char *src, size_t n)
-{
-       char *xdest = dest;
-       char temp = 0;
-
-       if (n == 0)
-               return xdest;
-
-       __asm__ __volatile__
-           ("1:\t%3 = B [%1++] (Z);\n\t"
-            "B [%0++] = %3;\n\t"
-            "CC = %3;\n\t"
-            "if ! cc jump 2f;\n\t"
-            "%2 += -1;\n\t"
-            "CC = %2 == 0;\n\t"
-            "if ! cc jump 1b (bp);\n"
-            "2:\n":"=a"(dest), "=a"(src), "=da"(n), "=d"(temp)
-            :"0"(dest), "1"(src), "2"(n), "3"(temp)
-            :"memory");
-
-       return xdest;
-}
-
-int strcmp(const char *cs, const char *ct)
-{
-       char __res1, __res2;
-
-       __asm__("1:\t%2 = B[%0++] (Z);\n\t"     /* get *cs */
-               "%3 = B[%1++] (Z);\n\t" /* get *ct */
-               "CC = %2 == %3;\n\t"    /* compare a byte */
-               "if ! cc jump 2f;\n\t"  /* not equal, break out */
-               "CC = %2;\n\t"  /* at end of cs? */
-               "if cc jump 1b (bp);\n\t"       /* no, keep going */
-               "jump.s 3f;\n"  /* strings are equal */
-               "2:\t%2 = %2 - %3;\n"   /* *cs - *ct */
-      "3:\n":  "=a"(cs), "=a"(ct), "=d"(__res1), "=d"(__res2)
-      :        "0"(cs), "1"(ct));
-
-       return __res1;
-}
-
-int strncmp(const char *cs, const char *ct, size_t count)
-{
-       char __res1, __res2;
-
-       if (!count)
-               return 0;
-
-       __asm__("1:\t%3 = B[%0++] (Z);\n\t"     /* get *cs */
-               "%4 = B[%1++] (Z);\n\t" /* get *ct */
-               "CC = %3 == %4;\n\t"    /* compare a byte */
-               "if ! cc jump 3f;\n\t"  /* not equal, break out */
-               "CC = %3;\n\t"  /* at end of cs? */
-               "if ! cc jump 4f;\n\t"  /* yes, all done */
-               "%2 += -1;\n\t" /* no, adjust count */
-               "CC = %2 == 0;\n\t" "if ! cc jump 1b;\n"        /* more to do, keep going */
-               "2:\t%3 = 0;\n\t"       /* strings are equal */
-               "jump.s    4f;\n" "3:\t%3 = %3 - %4;\n" /* *cs - *ct */
-      "4:":    "=a"(cs), "=a"(ct), "=da"(count), "=d"(__res1),
-               "=d"(__res2)
-      :        "0"(cs), "1"(ct), "2"(count));
-
-       return __res1;
-}
-
-#ifndef pMDMA_D0_IRQ_STATUS
-# define pMDMA_D0_IRQ_STATUS pMDMA1_D0_IRQ_STATUS
-# define pMDMA_D0_START_ADDR pMDMA1_D0_START_ADDR
-# define pMDMA_D0_X_COUNT    pMDMA1_D0_X_COUNT
-# define pMDMA_D0_X_MODIFY   pMDMA1_D0_X_MODIFY
-# define pMDMA_D0_CONFIG     pMDMA1_D0_CONFIG
-# define pMDMA_S0_IRQ_STATUS pMDMA1_S0_IRQ_STATUS
-# define pMDMA_S0_START_ADDR pMDMA1_S0_START_ADDR
-# define pMDMA_S0_X_COUNT    pMDMA1_S0_X_COUNT
-# define pMDMA_S0_X_MODIFY   pMDMA1_S0_X_MODIFY
-# define pMDMA_S0_CONFIG     pMDMA1_S0_CONFIG
-#endif
-
-static void *dma_memcpy(void *dest, const void *src, size_t count)
-{
-       *pMDMA_D0_IRQ_STATUS = DMA_DONE | DMA_ERR;
-
-       /* Copy sram functions from sdram to sram */
-       /* Setup destination start address */
-       *pMDMA_D0_START_ADDR = (volatile void **)dest;
-       /* Setup destination xcount */
-       *pMDMA_D0_X_COUNT = count;
-       /* Setup destination xmodify */
-       *pMDMA_D0_X_MODIFY = 1;
-
-       /* Setup Source start address */
-       *pMDMA_S0_START_ADDR = (volatile void **)src;
-       /* Setup Source xcount */
-       *pMDMA_S0_X_COUNT = count;
-       /* Setup Source xmodify */
-       *pMDMA_S0_X_MODIFY = 1;
-
-       /* Enable source DMA */
-       *pMDMA_S0_CONFIG = (DMAEN);
-       SSYNC();
-
-       *pMDMA_D0_CONFIG = (WNR | DMAEN);
-
-       while (*pMDMA_D0_IRQ_STATUS & DMA_RUN) {
-               *pMDMA_D0_IRQ_STATUS |= (DMA_DONE | DMA_ERR);
-       }
-       *pMDMA_D0_IRQ_STATUS |= (DMA_DONE | DMA_ERR);
-
-       dest += count;
-       src += count;
-       return dest;
-}
-
-/*
- * memcpy - Copy one area of memory to another
- * @dest: Where to copy to
- * @src: Where to copy from
- * @count: The size of the area.
- *
- * You should not use this function to access IO space, use memcpy_toio()
- * or memcpy_fromio() instead.
- */
-extern void *memcpy_ASM(void *dest, const void *src, size_t count);
-void *memcpy(void *dest, const void *src, size_t count)
-{
-       char *tmp = (char *) dest, *s = (char *) src;
-
-       if (dcache_status()) {
-               blackfin_dcache_flush_range(src, src+count);
-       }
-       /* L1_INST_SRAM can only be accessed via dma */
-       if ((tmp >= (char *)L1_INST_SRAM) && (tmp < (char *)L1_INST_SRAM_END)) {
-               /* L1 is the destination */
-               dma_memcpy(dest,src,count);
-       } else if ((s >= (char *)L1_INST_SRAM) && (s < (char *)L1_INST_SRAM_END)) {
-               /* L1 is the source */
-               dma_memcpy(dest,src,count);
-
-               if (icache_status()) {
-                       blackfin_icache_flush_range(dest, dest+count);
-               }
-               if (dcache_status()) {
-                       blackfin_dcache_invalidate_range(dest, dest+count);
-               }
-       } else {
-               memcpy_ASM(dest,src,count);
-       }
-       return dest;
-}
diff --git a/lib_blackfin/blackfin_board.h b/lib_blackfin/blackfin_board.h
deleted file mode 100644 (file)
index 1353421..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * U-boot - blackfin_board.h
- *
- * Copyright (c) 2005-2007 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
- */
-
-#ifndef __BLACKFIN_BOARD_H__
-#define __BLACKFIN_BOARD_H__
-
-#include <version.h>
-
-extern void timer_init(void);
-extern void init_IRQ(void);
-extern void rtc_init(void);
-
-extern ulong uboot_end_data;
-extern ulong uboot_end;
-
-ulong monitor_flash_len;
-
-
-#define VERSION_STRING_SIZE  150 /* including 40 bytes buffer to change any string */
-#define VERSION_STRING_FORMAT "%s (%s - %s)\n"
-#define VERSION_STRING         U_BOOT_VERSION, __DATE__, __TIME__
-
-char version_string[VERSION_STRING_SIZE];
-
-int *g_addr;
-static ulong mem_malloc_start;
-static ulong mem_malloc_end;
-static ulong mem_malloc_brk;
-extern char _sram_in_sdram_start[];
-extern char _sram_inst_size[];
-#ifdef DEBUG
-static void display_global_data(void);
-#endif
-
-/* definitions used to check the SMC card availability */
-#define SMC_BASE_ADDRESS CONFIG_SMC91111_BASE
-#define UPPER_BYTE_MASK        0xFF00
-#define SMC_IDENT      0x3300
-
-#endif
index 86a3b67..43d8be8 100644 (file)
@@ -1,54 +1,50 @@
 /*
  * U-boot - board.c First C file to be called contains init routines
  *
- * Copyright (c) 2005-2007 Analog Devices Inc.
+ * 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
+ * Licensed under the GPL-2 or later.
  */
 
 #include <common.h>
 #include <command.h>
-#include <malloc.h>
 #include <devices.h>
-#include <version.h>
-#include <net.h>
 #include <environment.h>
 #include <i2c.h>
-#include "blackfin_board.h"
+#include <malloc.h>
+#include <net.h>
+#include <version.h>
+
 #include <asm/cplb.h>
-#include "../drivers/net/smc91111.h"
+#include <asm/mach-common/bits/mpu.h>
+
+#ifdef CONFIG_CMD_NAND
+#include <nand.h>      /* cannot even include nand.h if it isnt configured */
+#endif
 
-#if defined(CONFIG_BF537)&&defined(CONFIG_POST)
+#if defined(CONFIG_POST)
 #include <post.h>
 int post_flag;
 #endif
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#ifndef CFG_NO_FLASH
-extern flash_info_t flash_info[];
+const char version_string[] = U_BOOT_VERSION " (" __DATE__ " - " __TIME__ ")";
+
+__attribute__((always_inline))
+static inline void serial_early_puts(const char *s)
+{
+#ifdef CONFIG_DEBUG_EARLY_SERIAL
+       serial_puts("Early: ");
+       serial_puts(s);
 #endif
+}
 
-static inline u_long get_vco(void)
+/* Get the input voltage */
+static u_long get_vco(void)
 {
        u_long msel;
        u_long vco;
@@ -63,7 +59,7 @@ static inline u_long get_vco(void)
        return vco;
 }
 
-/*Get the Core clock*/
+/* Get the Core clock */
 u_long get_cclk(void)
 {
        u_long csel, ssel;
@@ -91,153 +87,152 @@ u_long get_sclk(void)
        return get_vco() / ssel;
 }
 
+static void *mem_malloc_start, *mem_malloc_end, *mem_malloc_brk;
+
 static void mem_malloc_init(void)
 {
-       mem_malloc_start = CFG_MALLOC_BASE;
-       mem_malloc_end = (CFG_MALLOC_BASE + CFG_MALLOC_LEN);
+       mem_malloc_start = (void *)CFG_MALLOC_BASE;
+       mem_malloc_end = (void *)(CFG_MALLOC_BASE + CFG_MALLOC_LEN);
        mem_malloc_brk = mem_malloc_start;
-       memset((void *)mem_malloc_start, 0, mem_malloc_end - mem_malloc_start);
+       memset(mem_malloc_start, 0, mem_malloc_end - mem_malloc_start);
 }
 
 void *sbrk(ptrdiff_t increment)
 {
-       ulong old = mem_malloc_brk;
-       ulong new = old + increment;
+       void *old = mem_malloc_brk;
+       void *new = old + increment;
+
+       if (new < mem_malloc_start || new > mem_malloc_end)
+               return NULL;
 
-       if ((new < mem_malloc_start) || (new > mem_malloc_end)) {
-               return (NULL);
-       }
        mem_malloc_brk = new;
 
-       return ((void *)old);
+       return old;
 }
 
 static int display_banner(void)
 {
-       sprintf(version_string, VERSION_STRING_FORMAT, VERSION_STRING);
-       printf("%s\n", version_string);
-       return (0);
-}
-
-static void display_flash_config(ulong size)
-{
-       puts("FLASH:  ");
-       print_size(size, "\n");
-       return;
+       printf("\n\n%s\n\n", version_string);
+       printf("CPU:   ADSP " MK_STR(CONFIG_BFIN_CPU) " (Detected Rev: 0.%d)\n", bfin_revid());
+       return 0;
 }
 
 static int init_baudrate(void)
 {
-       char tmp[64];
-       int i = getenv_r("baudrate", tmp, sizeof(tmp));
+       char baudrate[15];
+       int i = getenv_r("baudrate", baudrate, sizeof(baudrate));
        gd->bd->bi_baudrate = gd->baudrate = (i > 0)
-           ? (int)simple_strtoul(tmp, NULL, 10)
+           ? simple_strtoul(baudrate, NULL, 10)
            : CONFIG_BAUDRATE;
-       return (0);
+       return 0;
 }
 
-#ifdef DEBUG
 static void display_global_data(void)
 {
+#ifdef CONFIG_DEBUG_EARLY_SERIAL
        bd_t *bd;
        bd = gd->bd;
-       printf("--flags:%x\n", gd->flags);
-       printf("--board_type:%x\n", gd->board_type);
-       printf("--baudrate:%x\n", gd->baudrate);
-       printf("--have_console:%x\n", gd->have_console);
-       printf("--ram_size:%x\n", gd->ram_size);
-       printf("--reloc_off:%x\n", gd->reloc_off);
-       printf("--env_addr:%x\n", gd->env_addr);
-       printf("--env_valid:%x\n", gd->env_valid);
-       printf("--bd:%x %x\n", gd->bd, bd);
-       printf("---bi_baudrate:%x\n", bd->bi_baudrate);
-       printf("---bi_ip_addr:%x\n", bd->bi_ip_addr);
-       printf("---bi_enetaddr:%x %x %x %x %x %x\n",
-              bd->bi_enetaddr[0],
-              bd->bi_enetaddr[1],
-              bd->bi_enetaddr[2],
-              bd->bi_enetaddr[3], bd->bi_enetaddr[4], bd->bi_enetaddr[5]);
-       printf("---bi_arch_number:%x\n", bd->bi_arch_number);
-       printf("---bi_boot_params:%x\n", bd->bi_boot_params);
-       printf("---bi_memstart:%x\n", bd->bi_memstart);
-       printf("---bi_memsize:%x\n", bd->bi_memsize);
-       printf("---bi_flashstart:%x\n", bd->bi_flashstart);
-       printf("---bi_flashsize:%x\n", bd->bi_flashsize);
-       printf("---bi_flashoffset:%x\n", bd->bi_flashoffset);
-       printf("--jt:%x *:%x\n", gd->jt, *(gd->jt));
-}
+       printf(" gd: %x\n", gd);
+       printf(" |-flags: %x\n", gd->flags);
+       printf(" |-board_type: %x\n", gd->board_type);
+       printf(" |-baudrate: %i\n", gd->baudrate);
+       printf(" |-have_console: %x\n", gd->have_console);
+       printf(" |-ram_size: %x\n", gd->ram_size);
+       printf(" |-reloc_off: %x\n", gd->reloc_off);
+       printf(" |-env_addr: %x\n", gd->env_addr);
+       printf(" |-env_valid: %x\n", gd->env_valid);
+       printf(" |-jt(%x): %x\n", gd->jt, *(gd->jt));
+       printf(" \\-bd: %x\n", gd->bd);
+       printf("   |-bi_baudrate: %x\n", bd->bi_baudrate);
+       printf("   |-bi_ip_addr: %x\n", bd->bi_ip_addr);
+       printf("   |-bi_enetaddr: %x %x %x %x %x %x\n",
+              bd->bi_enetaddr[0], bd->bi_enetaddr[1],
+              bd->bi_enetaddr[2], bd->bi_enetaddr[3],
+              bd->bi_enetaddr[4], bd->bi_enetaddr[5]);
+       printf("   |-bi_boot_params: %x\n", bd->bi_boot_params);
+       printf("   |-bi_memstart: %x\n", bd->bi_memstart);
+       printf("   |-bi_memsize: %x\n", bd->bi_memsize);
+       printf("   |-bi_flashstart: %x\n", bd->bi_flashstart);
+       printf("   |-bi_flashsize: %x\n", bd->bi_flashsize);
+       printf("   \\-bi_flashoffset: %x\n", bd->bi_flashoffset);
 #endif
+}
 
-/* we cover everything with 4 meg pages, and need an extra for L1 */
-unsigned int icplb_table[page_descriptor_table_size][2];
-unsigned int dcplb_table[page_descriptor_table_size][2];
-
+#define CPLB_PAGE_SIZE (4 * 1024 * 1024)
+#define CPLB_PAGE_MASK (~(CPLB_PAGE_SIZE - 1))
 void init_cplbtables(void)
 {
-       int i, j;
-
-       j = 0;
-       icplb_table[j][0] = 0xFFA00000;
-       icplb_table[j][1] = L1_IMEMORY;
-       j++;
-
-       for (i = 0; i < CONFIG_MEM_SIZE / 4; i++) {
-               icplb_table[j][0] = (i * 4 * 1024 * 1024);
-               if (i * 4 * 1024 * 1024 <= CFG_MONITOR_BASE
-                   && (i + 1) * 4 * 1024 * 1024 >= CFG_MONITOR_BASE) {
-                       icplb_table[j][1] = SDRAM_IKERNEL;
-               } else {
-                       icplb_table[j][1] = SDRAM_IGENERIC;
-               }
-               j++;
-       }
-#if defined(CONFIG_BF561)
-       /* MAC space */
-       icplb_table[j][0] = 0x2C000000;
-       icplb_table[j][1] = SDRAM_INON_CHBL;
-       j++;
-       /* Async Memory space */
-       for (i = 0; i < 3; i++) {
-               icplb_table[j][0] = 0x20000000 + i * 4 * 1024 * 1024;
-               icplb_table[j][1] = SDRAM_INON_CHBL;
-               j++;
+       volatile uint32_t *ICPLB_ADDR, *ICPLB_DATA;
+       volatile uint32_t *DCPLB_ADDR, *DCPLB_DATA;
+       uint32_t extern_memory;
+       size_t i;
+
+       void icplb_add(uint32_t addr, uint32_t data)
+       {
+               *(ICPLB_ADDR + i) = addr;
+               *(ICPLB_DATA + i) = data;
        }
-#else
-       icplb_table[j][0] = 0x20000000;
-       icplb_table[j][1] = SDRAM_INON_CHBL;
-#endif
-       j = 0;
-       dcplb_table[j][0] = 0xFF800000;
-       dcplb_table[j][1] = L1_DMEMORY;
-       j++;
-
-       for (i = 0; i < CONFIG_MEM_SIZE / 4; i++) {
-               dcplb_table[j][0] = (i * 4 * 1024 * 1024);
-               if (i * 4 * 1024 * 1024 <= CFG_MONITOR_BASE
-                   && (i + 1) * 4 * 1024 * 1024 >= CFG_MONITOR_BASE) {
-                       dcplb_table[j][1] = SDRAM_DKERNEL;
-               } else {
-                       dcplb_table[j][1] = SDRAM_DGENERIC;
-               }
-               j++;
+       void dcplb_add(uint32_t addr, uint32_t data)
+       {
+               *(DCPLB_ADDR + i) = addr;
+               *(DCPLB_DATA + i) = data;
        }
 
-#if defined(CONFIG_BF561)
-       /* MAC space */
-       dcplb_table[j][0] = 0x2C000000;
-       dcplb_table[j][1] = SDRAM_EBIU;
-       j++;
-
-       /* Flash space */
-       for (i = 0; i < 3; i++) {
-               dcplb_table[j][0] = 0x20000000 + i * 4 * 1024 * 1024;
-               dcplb_table[j][1] = SDRAM_EBIU;
-               j++;
+       /* populate a few common entries ... we'll let
+        * the memory map and cplb exception handler do
+        * the rest of the work.
+        */
+       i = 0;
+       ICPLB_ADDR = (uint32_t *)ICPLB_ADDR0;
+       ICPLB_DATA = (uint32_t *)ICPLB_DATA0;
+       DCPLB_ADDR = (uint32_t *)DCPLB_ADDR0;
+       DCPLB_DATA = (uint32_t *)DCPLB_DATA0;
+
+       icplb_add(0xFFA00000, L1_IMEMORY);
+       dcplb_add(0xFF800000, L1_DMEMORY);
+       ++i;
+
+       icplb_add(CFG_MONITOR_BASE & CPLB_PAGE_MASK, SDRAM_IKERNEL);
+       dcplb_add(CFG_MONITOR_BASE & CPLB_PAGE_MASK, SDRAM_DKERNEL);
+       ++i;
+
+       /* If the monitor crosses a 4 meg boundary, we'll need
+        * to lock two entries for it.
+        */
+       if ((CFG_MONITOR_BASE & CPLB_PAGE_MASK) != ((CFG_MONITOR_BASE + CFG_MONITOR_LEN) & CPLB_PAGE_MASK)) {
+               icplb_add((CFG_MONITOR_BASE + CFG_MONITOR_LEN) & CPLB_PAGE_MASK, SDRAM_IKERNEL);
+               dcplb_add((CFG_MONITOR_BASE + CFG_MONITOR_LEN) & CPLB_PAGE_MASK, SDRAM_DKERNEL);
+               ++i;
        }
-#else
-       dcplb_table[j][0] = 0x20000000;
-       dcplb_table[j][1] = SDRAM_EBIU;
+
+       icplb_add(0x20000000, SDRAM_INON_CHBL);
+       dcplb_add(0x20000000, SDRAM_EBIU);
+       ++i;
+
+       /* Add entries for the rest of external RAM up to the bootrom */
+       extern_memory = 0;
+
+#ifdef CONFIG_DEBUG_NULL_PTR
+       icplb_add(extern_memory, (SDRAM_IKERNEL & ~PAGE_SIZE_MASK) | PAGE_SIZE_1KB);
+       dcplb_add(extern_memory, (SDRAM_DKERNEL & ~PAGE_SIZE_MASK) | PAGE_SIZE_1KB);
+       ++i;
+       icplb_add(extern_memory, SDRAM_IKERNEL);
+       dcplb_add(extern_memory, SDRAM_DKERNEL);
+       extern_memory += CPLB_PAGE_SIZE;
+       ++i;
 #endif
+
+       while (i < 16 && extern_memory < (CFG_MONITOR_BASE & CPLB_PAGE_MASK)) {
+               icplb_add(extern_memory, SDRAM_IGENERIC);
+               dcplb_add(extern_memory, SDRAM_DGENERIC);
+               extern_memory += CPLB_PAGE_SIZE;
+               ++i;
+       }
+       while (i < 16) {
+               icplb_add(0, 0);
+               dcplb_add(0, 0);
+               ++i;
+       }
 }
 
 /*
@@ -253,14 +248,37 @@ void init_cplbtables(void)
  * "continue" and != 0 means "fatal error, hang the system".
  */
 
+extern int exception_init(void);
+extern int irq_init(void);
+extern int rtc_init(void);
+extern int timer_init(void);
+
 void board_init_f(ulong bootflag)
 {
        ulong addr;
        bd_t *bd;
-       int i;
 
+#ifdef CONFIG_BOARD_EARLY_INIT_F
+       serial_early_puts("Board early init flash\n");
+       board_early_init_f();
+#endif
+
+       serial_early_puts("Init CPLB tables\n");
        init_cplbtables();
 
+       serial_early_puts("Exceptions setup\n");
+       exception_init();
+
+#ifndef CONFIG_ICACHE_OFF
+       serial_early_puts("Turn on ICACHE\n");
+       icache_enable();
+#endif
+#ifndef CONFIG_DCACHE_OFF
+       serial_early_puts("Turn on DCACHE\n");
+       dcache_enable();
+#endif
+
+       serial_early_puts("Init global data\n");
        gd = (gd_t *) (CFG_GBL_DATA_ADDR);
        memset((void *)gd, 0, sizeof(gd_t));
 
@@ -273,41 +291,44 @@ void board_init_f(ulong bootflag)
        gd->bd = bd;
        memset((void *)bd, 0, sizeof(bd_t));
 
+       bd->bi_r_version = version_string;
+       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();
+       bd->bi_sclk = get_sclk();
+
        /* Initialize */
-       init_IRQ();
-       env_init();             /* initialize environment */
-       init_baudrate();        /* initialze baudrate settings */
-       serial_init();          /* serial communications setup */
+       serial_early_puts("IRQ init\n");
+       irq_init();
+       serial_early_puts("Environment init\n");
+       env_init();
+       serial_early_puts("Baudrate init\n");
+       init_baudrate();
+       serial_early_puts("Serial init\n");
+       serial_init();
+       serial_early_puts("Console init flash\n");
        console_init_f();
-#ifdef CONFIG_ICACHE_ON
-       icache_enable();
-#endif
-#ifdef CONFIG_DCACHE_ON
-       dcache_enable();
-#endif
-       display_banner();       /* say that we are here */
-
-       for (i = 0; i < page_descriptor_table_size; i++) {
-               debug
-                   ("data (%02i)= 0x%08x : 0x%08x    intr = 0x%08x : 0x%08x\n",
-                    i, dcplb_table[i][0], dcplb_table[i][1], icplb_table[i][0],
-                    icplb_table[i][1]);
-       }
+       serial_early_puts("End of early debugging\n");
+       display_banner();
 
        checkboard();
-#if defined(CONFIG_RTC_BF533) && defined(CONFIG_CMD_DATE)
+#if defined(CONFIG_RTC_BFIN) && defined(CONFIG_CMD_DATE)
        rtc_init();
 #endif
        timer_init();
+
        printf("Clock: VCO: %lu MHz, Core: %lu MHz, System: %lu MHz\n",
               get_vco() / 1000000, get_cclk() / 1000000, get_sclk() / 1000000);
-       printf("SDRAM: ");
+
+       printf("RAM:   ");
        print_size(initdram(0), "\n");
-#if defined(CONFIG_BF537)&&defined(CONFIG_POST)
+#if defined(CONFIG_POST)
        post_init_f();
        post_bootmode_init();
        post_run(NULL, POST_ROM | post_bootmode_get(0));
 #endif
+
        board_init_r((gd_t *) gd, 0x20000010);
 }
 
@@ -323,25 +344,25 @@ static int init_func_i2c(void)
 
 void board_init_r(gd_t * id, ulong dest_addr)
 {
-       ulong size;
        extern void malloc_bin_reloc(void);
-       char *s, *e;
+       char *s;
        bd_t *bd;
-       int i;
        gd = id;
        gd->flags |= GD_FLG_RELOC;      /* tell others: relocation done */
        bd = gd->bd;
 
-#if    defined(CONFIG_BF537) && defined(CONFIG_POST)
+#if defined(CONFIG_POST)
        post_output_backlog();
        post_reloc();
 #endif
 
-#if    (CONFIG_STAMP || CONFIG_BF537 || CONFIG_EZKIT561) && !defined(CFG_NO_FLASH)
+#if    !defined(CFG_NO_FLASH)
        /* There are some other pointer constants we must deal with */
        /* configure available FLASH banks */
-       size = flash_init();
-       display_flash_config(size);
+       extern flash_info_t flash_info[];
+       ulong size = flash_init();
+       puts("Flash: ");
+       print_size(size, "\n");
        flash_protect(FLAG_PROTECT_SET, CFG_FLASH_BASE,
                      CFG_FLASH_BASE + 0x1ffff, &flash_info[0]);
        bd->bi_flashstart = CFG_FLASH_BASE;
@@ -366,16 +387,34 @@ void board_init_r(gd_t * id, ulong dest_addr)
        /* relocate environment function pointers etc. */
        env_relocate();
 
+#ifdef CONFIG_CMD_NET
        /* board MAC address */
        s = getenv("ethaddr");
-       for (i = 0; i < 6; ++i) {
-               bd->bi_enetaddr[i] = s ? simple_strtoul(s, &e, 16) : 0;
-               if (s)
+       if (s == NULL) {
+# ifndef CONFIG_ETHADDR
+#  if 0
+               if (!board_get_enetaddr(bd->bi_enetaddr)) {
+                       char nid[20];
+                       sprintf(nid, "%02X:%02X:%02X:%02X:%02X:%02X",
+                               bd->bi_enetaddr[0], bd->bi_enetaddr[1],
+                               bd->bi_enetaddr[2], bd->bi_enetaddr[3],
+                               bd->bi_enetaddr[4], bd->bi_enetaddr[5]);
+                       setenv("ethaddr", nid);
+               }
+#  endif
+# endif
+       } else {
+               int i;
+               char *e;
+               for (i = 0; i < 6; ++i) {
+                       bd->bi_enetaddr[i] = simple_strtoul(s, &e, 16);
                        s = (*e) ? e + 1 : e;
+               }
        }
 
        /* IP Address */
        bd->bi_ip_addr = getenv_IPaddr("ipaddr");
+#endif
 
        /* Initialize devices */
        devices_init();
@@ -385,16 +424,14 @@ void board_init_r(gd_t * id, ulong dest_addr)
        console_init_r();
 
        /* Initialize from environment */
-       if ((s = getenv("loadaddr")) != NULL) {
+       if ((s = getenv("loadaddr")) != NULL)
                load_addr = simple_strtoul(s, NULL, 16);
-       }
-#if defined(CONFIG_CMD_NET)
-       if ((s = getenv("bootfile")) != NULL) {
+#ifdef CONFIG_CMD_NET
+       if ((s = getenv("bootfile")) != NULL)
                copy_filename(BootFile, s, sizeof(BootFile));
-       }
 #endif
 
-#if defined(CONFIG_CMD_NAND)
+#ifdef CONFIG_CMD_NAND
        puts("NAND:  ");
        nand_init();            /* go init the NAND */
 #endif
@@ -404,48 +441,37 @@ void board_init_r(gd_t * id, ulong dest_addr)
        misc_init_r();
 #endif
 
-#if ((BFIN_CPU == ADSP_BF537) || (BFIN_CPU == ADSP_BF536))
-       printf("Net:    ");
-       eth_initialize(bd);
-#endif
-
-#ifdef CONFIG_DRIVER_SMC91111
-#ifdef SHARED_RESOURCES
-       /* Switch to Ethernet */
-       swap_to(ETHERNET);
+#ifdef CONFIG_CMD_NET
+       printf("Net:   ");
+       eth_initialize(gd->bd);
+       if (getenv("ethaddr"))
+               printf("MAC:   %02X:%02X:%02X:%02X:%02X:%02X\n",
+                       bd->bi_enetaddr[0], bd->bi_enetaddr[1], bd->bi_enetaddr[2],
+                       bd->bi_enetaddr[3], bd->bi_enetaddr[4], bd->bi_enetaddr[5]);
 #endif
-       if ((SMC_inw(BANK_SELECT) & UPPER_BYTE_MASK) != SMC_IDENT) {
-               printf("ERROR: Can't find SMC91111 at address %x\n",
-                      SMC_BASE_ADDRESS);
-       } else {
-               printf("Net:   SMC91111 at 0x%08X\n", SMC_BASE_ADDRESS);
-       }
 
-#ifdef SHARED_RESOURCES
-       swap_to(FLASH);
-#endif
-#endif
 #if defined(CONFIG_SOFT_I2C) || defined(CONFIG_HARD_I2C)
        init_func_i2c();
 #endif
 
-#ifdef DEBUG
        display_global_data();
-#endif
 
-#if defined(CONFIG_BF537) && defined(CONFIG_POST)
+#if defined(CONFIG_POST)
        if (post_flag)
                post_run(NULL, POST_RAM | post_bootmode_get(0));
 #endif
 
        /* main_loop() can return to retry autoboot, if so just run it again. */
-       for (;;) {
+       for (;;)
                main_loop();
-       }
 }
 
 void hang(void)
 {
        puts("### ERROR ### Please RESET the board ###\n");
-       for (;;) ;
+       while (1)
+               /* If a JTAG emulator is hooked up, we'll automatically trigger
+                * a breakpoint in it.  If one isn't, this is just a NOP.
+                */
+               asm("emuexcpt;");
 }
diff --git a/lib_blackfin/bootm.c b/lib_blackfin/bootm.c
new file mode 100644 (file)
index 0000000..ef4b112
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * U-boot - bootm.c - misc boot helper functions
+ *
+ * Copyright (c) 2005-2008 Analog Devices Inc.
+ *
+ * (C) Copyright 2000-2004
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#include <common.h>
+#include <command.h>
+#include <image.h>
+#include <asm/blackfin.h>
+
+extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+
+#ifdef SHARED_RESOURCES
+extern void swap_to(int device_id);
+#endif
+
+static char *make_command_line(void)
+{
+       char *dest = (char *)CMD_LINE_ADDR;
+       char *bootargs = getenv("bootargs");
+
+       if (bootargs == NULL)
+               return NULL;
+
+       strncpy(dest, bootargs, 0x1000);
+       dest[0xfff] = 0;
+       return dest;
+}
+
+void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
+                   bootm_headers_t *images)
+{
+       int     (*appl) (char *cmdline);
+       char    *cmdline;
+       ulong   ep = 0;
+
+       if (!images->autostart)
+               return;
+
+#ifdef SHARED_RESOURCES
+       swap_to(FLASH);
+#endif
+
+       /* find kernel entry point */
+       if (images->legacy_hdr_valid) {
+               ep = image_get_ep (&images->legacy_hdr_os_copy);
+#if defined(CONFIG_FIT)
+       } else if (images->fit_uname_os) {
+               int ret = fit_image_get_entry (images->fit_hdr_os,
+                               images->fit_noffset_os, &ep);
+               if (ret) {
+                       puts ("Can't get entry point property!\n");
+                       goto error;
+               }
+#endif
+       } else {
+               puts ("Could not find kernel entry point!\n");
+               goto error;
+       }
+       appl = (int (*)(char *))ep;
+
+       printf("Starting Kernel at = %x\n", appl);
+       cmdline = make_command_line();
+       icache_disable();
+       dcache_disable();
+       (*appl) (cmdline);
+       /* does not return */
+       return;
+
+ error:
+       if (images->autostart)
+               do_reset (cmdtp, flag, argc, argv);
+}
index 6fc4983..c2f6e28 100644 (file)
@@ -1,45 +1,26 @@
 /*
  * U-boot - cache.c
  *
- * Copyright (c) 2005-2007 Analog Devices Inc.
+ * 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
+ * Licensed under the GPL-2 or later.
  */
 
-/* for now: just dummy functions to satisfy the linker */
-#include <config.h>
 #include <common.h>
 #include <asm/blackfin.h>
-#include "cache.h"
 
-void flush_cache(unsigned long dummy1, unsigned long dummy2)
+void flush_cache(unsigned long addr, unsigned long size)
 {
-       if (dummy1 >= 0xE0000000)
+       /* no need to flush stuff in on chip memory (L1/L2/etc...) */
+       if (addr >= 0xE0000000)
                return;
 
        if (icache_status())
-               blackfin_icache_flush_range((void*)dummy1, (void*)(dummy1 + dummy2));
-       if (dcache_status())
-               blackfin_dcache_flush_range((void*)dummy1, (void*)(dummy1 + dummy2));
+               blackfin_icache_flush_range((void *)addr, (void *)(addr + size));
 
-       return;
+       if (dcache_status())
+               blackfin_dcache_flush_range((void *)addr, (void *)(addr + size));
 }
diff --git a/lib_blackfin/cache.h b/lib_blackfin/cache.h
deleted file mode 100644 (file)
index 3ea6809..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * U-boot - prototypes for cache handling functions.
- *
- * Copyright (c) 2005-2007 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, see the file COPYING, or write
- * to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#ifndef _LIB_BLACKFIN_CACHE_H_
-#define _LIB_BLACKFIN_CACHE_H_
-
-extern void blackfin_icache_flush_range(const void *, const void *);
-extern void blackfin_dcache_flush_range(const void *, const void *);
-extern void blackfin_dcache_invalidate_range(const void *, const void *);
-
-#endif
index 9b58832..6c834a7 100644 (file)
@@ -31,6 +31,7 @@
  */
 
 .globl _memcmp;
+.type _memcmp, STT_FUNC;
 _memcmp:
        I1 = P3;
        P0 = R0;                        /* P0 = s1 address */
@@ -98,3 +99,5 @@ _memcmp:
        R0 = 0;
        P3 = I1;
        RTS;
+
+.size _memcmp, .-_memcmp
index 24577be..e6b359a 100644 (file)
@@ -23,6 +23,7 @@
 .align 2
 
 .globl _memcpy_ASM;
+.type _memcpy_ASM, STT_FUNC;
 _memcpy_ASM:
        CC = R2 <=  0;  /* length not positive?*/
        IF CC JUMP  .L_P1L2147483647;   /* Nothing to do */
@@ -112,3 +113,5 @@ _memcpy_ASM:
        B[P0--] = R1;
 
        RTS;
+
+.size _memcpy_ASM, .-_memcpy_ASM
index 46f79ed..e385c4f 100644 (file)
@@ -31,6 +31,7 @@
  */
 
 .globl _memmove;
+.type _memmove, STT_FUNC;
 _memmove:
        I1 = P3;
        P0 = R0;                  /* P0 = To address */
@@ -91,3 +92,5 @@ _memmove:
 .Lno_loop: B[P0] = R1;
        P3 = I1;
        RTS;
+
+.size _memmove, .-_memmove
index c33c551..26f63cd 100644 (file)
@@ -31,6 +31,7 @@
  */
 
 .globl _memset;
+.type _memset, STT_FUNC;
 _memset:
        P0 = R0 ;              /* P0 = address */
        P2 = R2 ;              /* P2 = count   */
@@ -91,3 +92,5 @@ _memset:
        B[P0++] = R1;
        B[P0++] = R1;
        JUMP .Laligned;
+
+.size _memset, .-_memset
diff --git a/lib_blackfin/string.c b/lib_blackfin/string.c
new file mode 100644 (file)
index 0000000..6887c93
--- /dev/null
@@ -0,0 +1,203 @@
+/*
+ * U-boot - string.c Contains library routines.
+ *
+ * Copyright (c) 2005-2007 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/io.h>
+#include <asm/mach-common/bits/dma.h>
+
+char *strcpy(char *dest, const char *src)
+{
+       char *xdest = dest;
+       char temp = 0;
+
+       __asm__ __volatile__ (
+               "1:\t%2 = B [%1++] (Z);\n\t"
+               "B [%0++] = %2;\n\t"
+               "CC = %2;\n\t"
+               "if cc jump 1b (bp);\n"
+               : "=a"(dest), "=a"(src), "=d"(temp)
+               : "0"(dest), "1"(src), "2"(temp)
+               : "memory");
+
+       return xdest;
+}
+
+char *strncpy(char *dest, const char *src, size_t n)
+{
+       char *xdest = dest;
+       char temp = 0;
+
+       if (n == 0)
+               return xdest;
+
+       __asm__ __volatile__ (
+               "1:\t%3 = B [%1++] (Z);\n\t"
+               "B [%0++] = %3;\n\t"
+               "CC = %3;\n\t"
+               "if ! cc jump 2f;\n\t"
+               "%2 += -1;\n\t"
+               "CC = %2 == 0;\n\t"
+               "if ! cc jump 1b (bp);\n"
+               "2:\n"
+               : "=a"(dest), "=a"(src), "=da"(n), "=d"(temp)
+               : "0"(dest), "1"(src), "2"(n), "3"(temp)
+               : "memory");
+
+       return xdest;
+}
+
+int strcmp(const char *cs, const char *ct)
+{
+       char __res1, __res2;
+
+       __asm__ (
+               "1:\t%2 = B[%0++] (Z);\n\t"     /* get *cs */
+               "%3 = B[%1++] (Z);\n\t" /* get *ct */
+               "CC = %2 == %3;\n\t"    /* compare a byte */
+               "if ! cc jump 2f;\n\t"  /* not equal, break out */
+               "CC = %2;\n\t"  /* at end of cs? */
+               "if cc jump 1b (bp);\n\t"       /* no, keep going */
+               "jump.s 3f;\n"  /* strings are equal */
+               "2:\t%2 = %2 - %3;\n"   /* *cs - *ct */
+               "3:\n"
+               : "=a"(cs), "=a"(ct), "=d"(__res1), "=d"(__res2)
+               : "0"(cs), "1"(ct));
+
+       return __res1;
+}
+
+int strncmp(const char *cs, const char *ct, size_t count)
+{
+       char __res1, __res2;
+
+       if (!count)
+               return 0;
+
+       __asm__(
+               "1:\t%3 = B[%0++] (Z);\n\t"     /* get *cs */
+               "%4 = B[%1++] (Z);\n\t" /* get *ct */
+               "CC = %3 == %4;\n\t"    /* compare a byte */
+               "if ! cc jump 3f;\n\t"  /* not equal, break out */
+               "CC = %3;\n\t"  /* at end of cs? */
+               "if ! cc jump 4f;\n\t"  /* yes, all done */
+               "%2 += -1;\n\t" /* no, adjust count */
+               "CC = %2 == 0;\n\t" "if ! cc jump 1b;\n"        /* more to do, keep going */
+               "2:\t%3 = 0;\n\t"       /* strings are equal */
+               "jump.s    4f;\n" "3:\t%3 = %3 - %4;\n" /* *cs - *ct */
+               "4:"
+               : "=a"(cs), "=a"(ct), "=da"(count), "=d"(__res1), "=d"(__res2)
+               : "0"(cs), "1"(ct), "2"(count));
+
+       return __res1;
+}
+
+#ifdef bfin_write_MDMA1_D0_IRQ_STATUS
+# define bfin_write_MDMA_D0_IRQ_STATUS bfin_write_MDMA1_D0_IRQ_STATUS
+# define bfin_write_MDMA_D0_START_ADDR bfin_write_MDMA1_D0_START_ADDR
+# define bfin_write_MDMA_D0_X_COUNT    bfin_write_MDMA1_D0_X_COUNT
+# define bfin_write_MDMA_D0_X_MODIFY   bfin_write_MDMA1_D0_X_MODIFY
+# define bfin_write_MDMA_D0_CONFIG     bfin_write_MDMA1_D0_CONFIG
+# define bfin_write_MDMA_S0_START_ADDR bfin_write_MDMA1_S0_START_ADDR
+# define bfin_write_MDMA_S0_X_COUNT    bfin_write_MDMA1_S0_X_COUNT
+# define bfin_write_MDMA_S0_X_MODIFY   bfin_write_MDMA1_S0_X_MODIFY
+# define bfin_write_MDMA_S0_CONFIG     bfin_write_MDMA1_S0_CONFIG
+# define bfin_write_MDMA_D0_IRQ_STATUS bfin_write_MDMA1_D0_IRQ_STATUS
+# define bfin_read_MDMA_D0_IRQ_STATUS  bfin_read_MDMA1_D0_IRQ_STATUS
+#endif
+static void *dma_memcpy(void *dst, const void *src, size_t count)
+{
+       if (dcache_status())
+               blackfin_dcache_flush_range(src, src + count);
+
+       bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
+
+       /* Copy sram functions from sdram to sram */
+       /* Setup destination start address */
+       bfin_write_MDMA_D0_START_ADDR(dst);
+       /* Setup destination xcount */
+       bfin_write_MDMA_D0_X_COUNT(count);
+       /* Setup destination xmodify */
+       bfin_write_MDMA_D0_X_MODIFY(1);
+
+       /* Setup Source start address */
+       bfin_write_MDMA_S0_START_ADDR(src);
+       /* Setup Source xcount */
+       bfin_write_MDMA_S0_X_COUNT(count);
+       /* Setup Source xmodify */
+       bfin_write_MDMA_S0_X_MODIFY(1);
+
+       /* Enable source DMA */
+       bfin_write_MDMA_S0_CONFIG(DMAEN);
+       SSYNC();
+
+       bfin_write_MDMA_D0_CONFIG(WNR | DMAEN);
+
+       while (bfin_read_MDMA_D0_IRQ_STATUS() & DMA_RUN)
+               bfin_write_MDMA_D0_IRQ_STATUS(bfin_read_MDMA_D0_IRQ_STATUS() | DMA_DONE | DMA_ERR);
+       bfin_write_MDMA_D0_IRQ_STATUS(bfin_read_MDMA_D0_IRQ_STATUS() | DMA_DONE | DMA_ERR);
+
+       if (icache_status())
+               blackfin_icache_flush_range(dst, dst + count);
+
+       if (dcache_status())
+               blackfin_dcache_invalidate_range(dst, dst + count);
+
+       return dst;
+}
+
+/*
+ * memcpy - Copy one area of memory to another
+ * @dest: Where to copy to
+ * @src: Where to copy from
+ * @count: The size of the area.
+ *
+ * We need to have this wrapper in memcpy() as common code may call memcpy()
+ * to load up L1 regions.  Consider loading an ELF which has sections with
+ * LMA's pointing to L1.  The common code ELF loader will simply use memcpy()
+ * to move the ELF's sections into the right place.  We need to catch that
+ * here and redirect to dma_memcpy().
+ */
+extern void *memcpy_ASM(void *dst, const void *src, size_t count);
+void *memcpy(void *dst, const void *src, size_t count)
+{
+       if (!count)
+               return dst;
+
+       if (addr_bfin_on_chip_mem(dst)) {
+               /* L1 is the destination */
+               return dma_memcpy(dst, src, count);
+
+       } else if (addr_bfin_on_chip_mem(src)) {
+               /* L1 is the source */
+               return dma_memcpy(dst, src, count);
+
+       } else
+               /* No L1 is involved, so just call regular memcpy */
+               return memcpy_ASM(dst, src, count);
+}
index 9713353..abee19a 100644 (file)
@@ -34,7 +34,9 @@ COBJS-y += crc32.o
 COBJS-y += ctype.o
 COBJS-y += display_options.o
 COBJS-y += div64.o
+COBJS-y += lmb.o
 COBJS-y += ldiv.o
+COBJS-$(CONFIG_MD5) += md5.o
 COBJS-y += sha1.o
 COBJS-y += string.o
 COBJS-y += vsprintf.o
index 87e6a6e..0d3f9c2 100644 (file)
@@ -1592,6 +1592,10 @@ const char * BZ_API(BZ2_bzerror) (BZFILE *b, int *errnum)
 }
 #endif
 
+void bz_internal_error(int errcode)
+{
+       printf ("BZIP2 internal error %d\n", errcode);
+}
 
 /*-------------------------------------------------------------*/
 /*--- end                                           bzlib.c ---*/
index df0dbca..58cd22e 100644 (file)
 
 #ifndef USE_HOSTCC     /* Shut down "ANSI does not permit..." warnings */
 #include <common.h>
+#else
+#include <stdint.h>
 #endif
 
 #include "zlib.h"
 
 #define local static
 #define ZEXPORT        /* empty */
-unsigned long crc32 (unsigned long, const unsigned char *, unsigned int);
 
 #ifdef DYNAMIC_CRC_TABLE
 
 local int crc_table_empty = 1;
-local uLongf crc_table[256];
+local uint32_t crc_table[256];
 local void make_crc_table OF((void));
 
 /*
@@ -50,7 +51,7 @@ local void make_crc_table OF((void));
 */
 local void make_crc_table()
 {
-  uLong c;
+  uint32_t c;
   int n, k;
   uLong poly;            /* polynomial exclusive-or pattern */
   /* terms of polynomial defining this crc (except x^32): */
@@ -74,7 +75,7 @@ local void make_crc_table()
 /* ========================================================================
  * Table of CRC-32's of all single-byte values (made by make_crc_table)
  */
-local const uLongf crc_table[256] = {
+local const uint32_t crc_table[256] = {
   0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L,
   0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L,
   0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L,
@@ -134,12 +135,12 @@ local const uLongf crc_table[256] = {
 /* =========================================================================
  * This function can be used by asm versions of crc32()
  */
-const uLongf * ZEXPORT get_crc_table()
+const uint32_t * ZEXPORT get_crc_table()
 {
 #ifdef DYNAMIC_CRC_TABLE
   if (crc_table_empty) make_crc_table();
 #endif
-  return (const uLongf *)crc_table;
+  return (const uint32_t *)crc_table;
 }
 #endif
 
@@ -150,8 +151,8 @@ const uLongf * ZEXPORT get_crc_table()
 #define DO8(buf)  DO4(buf); DO4(buf);
 
 /* ========================================================================= */
-uLong ZEXPORT crc32(crc, buf, len)
-    uLong crc;
+uint32_t ZEXPORT crc32(crc, buf, len)
+    uint32_t crc;
     const Bytef *buf;
     uInt len;
 {
@@ -178,7 +179,7 @@ uLong ZEXPORT crc32(crc, buf, len)
 /* No ones complement version. JFFS2 (and other things ?)
  * don't use ones compliment in their CRC calculations.
  */
-uLong ZEXPORT crc32_no_comp(uLong crc, const Bytef *buf, uInt len)
+uint32_t ZEXPORT crc32_no_comp(uint32_t crc, const Bytef *buf, uInt len)
 {
 #ifdef DYNAMIC_CRC_TABLE
     if (crc_table_empty)
@@ -197,3 +198,30 @@ uLong ZEXPORT crc32_no_comp(uLong crc, const Bytef *buf, uInt len)
 }
 
 #endif
+
+/*
+ * Calculate the crc32 checksum triggering the watchdog every 'chunk_sz' bytes
+ * of input.
+ */
+ulong crc32_wd (ulong crc, const unsigned char *buf, uint len, uint chunk_sz)
+{
+#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+       const unsigned char *end, *curr;
+       int chunk;
+
+       curr = buf;
+       end = buf + len;
+       while (curr < end) {
+               chunk = end - curr;
+               if (chunk > chunk_sz)
+                       chunk = chunk_sz;
+               crc = crc32 (crc, curr, chunk);
+               curr += chunk;
+               WATCHDOG_RESET ();
+       }
+#else
+        crc = crc32 (crc, buf, len);
+#endif
+
+       return crc;
+}
diff --git a/lib_generic/lmb.c b/lib_generic/lmb.c
new file mode 100644 (file)
index 0000000..3b8c805
--- /dev/null
@@ -0,0 +1,280 @@
+/*
+ * Procedures for maintaining information about logical memory blocks.
+ *
+ * Peter Bergner, IBM Corp.    June 2001.
+ * Copyright (C) 2001 Peter Bergner.
+ *
+ *      This program is free software; you can redistribute it and/or
+ *      modify it under the terms of the 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 <lmb.h>
+
+#define LMB_ALLOC_ANYWHERE     0
+
+void lmb_dump_all(struct lmb *lmb)
+{
+#ifdef DEBUG
+       unsigned long i;
+
+       debug("lmb_dump_all:\n");
+       debug("    memory.cnt              = 0x%lx\n", lmb->memory.cnt);
+       debug("    memory.size             = 0x%08x\n", lmb->memory.size);
+       for (i=0; i < lmb->memory.cnt ;i++) {
+               debug("    memory.reg[0x%x].base   = 0x%08x\n", i,
+                       lmb->memory.region[i].base);
+               debug("            .size   = 0x%08x\n",
+                       lmb->memory.region[i].size);
+       }
+
+       debug("\n    reserved.cnt          = 0x%lx\n", lmb->reserved.cnt);
+       debug("    reserved.size           = 0x%08x\n", lmb->reserved.size);
+       for (i=0; i < lmb->reserved.cnt ;i++) {
+               debug("    reserved.reg[0x%x].base = 0x%08x\n", i,
+                       lmb->reserved.region[i].base);
+               debug("              .size = 0x%08x\n",
+                       lmb->reserved.region[i].size);
+       }
+#endif /* DEBUG */
+}
+
+static unsigned long lmb_addrs_overlap(ulong base1,
+               ulong size1, ulong base2, ulong size2)
+{
+       return ((base1 < (base2+size2)) && (base2 < (base1+size1)));
+}
+
+static long lmb_addrs_adjacent(ulong base1, ulong size1,
+               ulong base2, ulong size2)
+{
+       if (base2 == base1 + size1)
+               return 1;
+       else if (base1 == base2 + size2)
+               return -1;
+
+       return 0;
+}
+
+static long lmb_regions_adjacent(struct lmb_region *rgn,
+               unsigned long r1, unsigned long r2)
+{
+       ulong base1 = rgn->region[r1].base;
+       ulong size1 = rgn->region[r1].size;
+       ulong base2 = rgn->region[r2].base;
+       ulong size2 = rgn->region[r2].size;
+
+       return lmb_addrs_adjacent(base1, size1, base2, size2);
+}
+
+static void lmb_remove_region(struct lmb_region *rgn, unsigned long r)
+{
+       unsigned long i;
+
+       for (i = r; i < rgn->cnt - 1; i++) {
+               rgn->region[i].base = rgn->region[i + 1].base;
+               rgn->region[i].size = rgn->region[i + 1].size;
+       }
+       rgn->cnt--;
+}
+
+/* Assumption: base addr of region 1 < base addr of region 2 */
+static void lmb_coalesce_regions(struct lmb_region *rgn,
+               unsigned long r1, unsigned long r2)
+{
+       rgn->region[r1].size += rgn->region[r2].size;
+       lmb_remove_region(rgn, r2);
+}
+
+void lmb_init(struct lmb *lmb)
+{
+       /* Create a dummy zero size LMB which will get coalesced away later.
+        * This simplifies the lmb_add() code below...
+        */
+       lmb->memory.region[0].base = 0;
+       lmb->memory.region[0].size = 0;
+       lmb->memory.cnt = 1;
+       lmb->memory.size = 0;
+
+       /* Ditto. */
+       lmb->reserved.region[0].base = 0;
+       lmb->reserved.region[0].size = 0;
+       lmb->reserved.cnt = 1;
+       lmb->reserved.size = 0;
+}
+
+/* This routine called with relocation disabled. */
+static long lmb_add_region(struct lmb_region *rgn, ulong base, ulong size)
+{
+       unsigned long coalesced = 0;
+       long adjacent, i;
+
+       if ((rgn->cnt == 1) && (rgn->region[0].size == 0)) {
+               rgn->region[0].base = base;
+               rgn->region[0].size = size;
+               return 0;
+       }
+
+       /* First try and coalesce this LMB with another. */
+       for (i=0; i < rgn->cnt; i++) {
+               ulong rgnbase = rgn->region[i].base;
+               ulong rgnsize = rgn->region[i].size;
+
+               if ((rgnbase == base) && (rgnsize == size))
+                       /* Already have this region, so we're done */
+                       return 0;
+
+               adjacent = lmb_addrs_adjacent(base,size,rgnbase,rgnsize);
+               if ( adjacent > 0 ) {
+                       rgn->region[i].base -= size;
+                       rgn->region[i].size += size;
+                       coalesced++;
+                       break;
+               }
+               else if ( adjacent < 0 ) {
+                       rgn->region[i].size += size;
+                       coalesced++;
+                       break;
+               }
+       }
+
+       if ((i < rgn->cnt-1) && lmb_regions_adjacent(rgn, i, i+1) ) {
+               lmb_coalesce_regions(rgn, i, i+1);
+               coalesced++;
+       }
+
+       if (coalesced)
+               return coalesced;
+       if (rgn->cnt >= MAX_LMB_REGIONS)
+               return -1;
+
+       /* Couldn't coalesce the LMB, so add it to the sorted table. */
+       for (i = rgn->cnt-1; i >= 0; i--) {
+               if (base < rgn->region[i].base) {
+                       rgn->region[i+1].base = rgn->region[i].base;
+                       rgn->region[i+1].size = rgn->region[i].size;
+               } else {
+                       rgn->region[i+1].base = base;
+                       rgn->region[i+1].size = size;
+                       break;
+               }
+       }
+
+       if (base < rgn->region[0].base) {
+               rgn->region[0].base = base;
+               rgn->region[0].size = size;
+       }
+
+       rgn->cnt++;
+
+       return 0;
+}
+
+/* This routine may be called with relocation disabled. */
+long lmb_add(struct lmb *lmb, ulong base, ulong size)
+{
+       struct lmb_region *_rgn = &(lmb->memory);
+
+       return lmb_add_region(_rgn, base, size);
+}
+
+long lmb_reserve(struct lmb *lmb, ulong base, ulong size)
+{
+       struct lmb_region *_rgn = &(lmb->reserved);
+
+       return lmb_add_region(_rgn, base, size);
+}
+
+long lmb_overlaps_region(struct lmb_region *rgn, ulong base,
+                               ulong size)
+{
+       unsigned long i;
+
+       for (i=0; i < rgn->cnt; i++) {
+               ulong rgnbase = rgn->region[i].base;
+               ulong rgnsize = rgn->region[i].size;
+               if ( lmb_addrs_overlap(base,size,rgnbase,rgnsize) ) {
+                       break;
+               }
+       }
+
+       return (i < rgn->cnt) ? i : -1;
+}
+
+ulong lmb_alloc(struct lmb *lmb, ulong size, ulong align)
+{
+       return lmb_alloc_base(lmb, size, align, LMB_ALLOC_ANYWHERE);
+}
+
+ulong lmb_alloc_base(struct lmb *lmb, ulong size, ulong align, ulong max_addr)
+{
+       ulong alloc;
+
+       alloc = __lmb_alloc_base(lmb, size, align, max_addr);
+
+       if (alloc == 0)
+               printf("ERROR: Failed to allocate 0x%lx bytes below 0x%lx.\n",
+                     size, max_addr);
+
+       return alloc;
+}
+
+static ulong lmb_align_down(ulong addr, ulong size)
+{
+       return addr & ~(size - 1);
+}
+
+static ulong lmb_align_up(ulong addr, ulong size)
+{
+       return (addr + (size - 1)) & ~(size - 1);
+}
+
+ulong __lmb_alloc_base(struct lmb *lmb, ulong size, ulong align, ulong max_addr)
+{
+       long i, j;
+       ulong base = 0;
+
+       for (i = lmb->memory.cnt-1; i >= 0; i--) {
+               ulong lmbbase = lmb->memory.region[i].base;
+               ulong lmbsize = lmb->memory.region[i].size;
+
+               if (max_addr == LMB_ALLOC_ANYWHERE)
+                       base = lmb_align_down(lmbbase + lmbsize - size, align);
+               else if (lmbbase < max_addr) {
+                       base = min(lmbbase + lmbsize, max_addr);
+                       base = lmb_align_down(base - size, align);
+               } else
+                       continue;
+
+               while ((lmbbase <= base) &&
+                      ((j = lmb_overlaps_region(&(lmb->reserved), base, size)) >= 0) )
+                       base = lmb_align_down(lmb->reserved.region[j].base - size,
+                                             align);
+
+               if ((base != 0) && (lmbbase <= base))
+                       break;
+       }
+
+       if (i < 0)
+               return 0;
+
+       if (lmb_add_region(&(lmb->reserved), base, lmb_align_up(size, align)) < 0)
+               return 0;
+
+       return base;
+}
+
+int lmb_is_reserved(struct lmb *lmb, ulong addr)
+{
+       int i;
+
+       for (i = 0; i < lmb->reserved.cnt; i++) {
+               ulong upper = lmb->reserved.region[i].base +
+                       lmb->reserved.region[i].size - 1;
+               if ((addr >= lmb->reserved.region[i].base) && (addr <= upper))
+                       return 1;
+       }
+       return 0;
+}
diff --git a/lib_generic/md5.c b/lib_generic/md5.c
new file mode 100644 (file)
index 0000000..20178b8
--- /dev/null
@@ -0,0 +1,310 @@
+/*
+ * This file was transplanted with slight modifications from Linux sources
+ * (fs/cifs/md5.c) into U-Boot by Bartlomiej Sieka <tur@semihalf.com>.
+ */
+
+/*
+ * This code implements the MD5 message-digest algorithm.
+ * The algorithm is due to Ron Rivest.  This code was
+ * written by Colin Plumb in 1993, no copyright is claimed.
+ * This code is in the public domain; do with it what you wish.
+ *
+ * Equivalent code is available from RSA Data Security, Inc.
+ * This code has been tested against that, and is equivalent,
+ * except that you don't need to include two pages of legalese
+ * with every copy.
+ *
+ * To compute the message digest of a chunk of bytes, declare an
+ * MD5Context structure, pass it to MD5Init, call MD5Update as
+ * needed on buffers full of bytes, and then call MD5Final, which
+ * will fill a supplied 16-byte array with the digest.
+ */
+
+/* This code slightly modified to fit into Samba by
+   abartlet@samba.org Jun 2001
+   and to fit the cifs vfs by
+   Steve French sfrench@us.ibm.com */
+
+#include <linux/types.h>
+#include <linux/string.h>
+#include <u-boot/md5.h>
+
+static void
+MD5Transform(__u32 buf[4], __u32 const in[16]);
+
+/*
+ * Note: this code is harmless on little-endian machines.
+ */
+static void
+byteReverse(unsigned char *buf, unsigned longs)
+{
+       __u32 t;
+       do {
+               t = (__u32) ((unsigned) buf[3] << 8 | buf[2]) << 16 |
+                   ((unsigned) buf[1] << 8 | buf[0]);
+               *(__u32 *) buf = t;
+               buf += 4;
+       } while (--longs);
+}
+
+/*
+ * Start MD5 accumulation.  Set bit count to 0 and buffer to mysterious
+ * initialization constants.
+ */
+static void
+MD5Init(struct MD5Context *ctx)
+{
+       ctx->buf[0] = 0x67452301;
+       ctx->buf[1] = 0xefcdab89;
+       ctx->buf[2] = 0x98badcfe;
+       ctx->buf[3] = 0x10325476;
+
+       ctx->bits[0] = 0;
+       ctx->bits[1] = 0;
+}
+
+/*
+ * Update context to reflect the concatenation of another buffer full
+ * of bytes.
+ */
+static void
+MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len)
+{
+       register __u32 t;
+
+       /* Update bitcount */
+
+       t = ctx->bits[0];
+       if ((ctx->bits[0] = t + ((__u32) len << 3)) < t)
+               ctx->bits[1]++; /* Carry from low to high */
+       ctx->bits[1] += len >> 29;
+
+       t = (t >> 3) & 0x3f;    /* Bytes already in shsInfo->data */
+
+       /* Handle any leading odd-sized chunks */
+
+       if (t) {
+               unsigned char *p = (unsigned char *) ctx->in + t;
+
+               t = 64 - t;
+               if (len < t) {
+                       memmove(p, buf, len);
+                       return;
+               }
+               memmove(p, buf, t);
+               byteReverse(ctx->in, 16);
+               MD5Transform(ctx->buf, (__u32 *) ctx->in);
+               buf += t;
+               len -= t;
+       }
+       /* Process data in 64-byte chunks */
+
+       while (len >= 64) {
+               memmove(ctx->in, buf, 64);
+               byteReverse(ctx->in, 16);
+               MD5Transform(ctx->buf, (__u32 *) ctx->in);
+               buf += 64;
+               len -= 64;
+       }
+
+       /* Handle any remaining bytes of data. */
+
+       memmove(ctx->in, buf, len);
+}
+
+/*
+ * Final wrapup - pad to 64-byte boundary with the bit pattern
+ * 1 0* (64-bit count of bits processed, MSB-first)
+ */
+static void
+MD5Final(unsigned char digest[16], struct MD5Context *ctx)
+{
+       unsigned int count;
+       unsigned char *p;
+
+       /* Compute number of bytes mod 64 */
+       count = (ctx->bits[0] >> 3) & 0x3F;
+
+       /* Set the first char of padding to 0x80.  This is safe since there is
+          always at least one byte free */
+       p = ctx->in + count;
+       *p++ = 0x80;
+
+       /* Bytes of padding needed to make 64 bytes */
+       count = 64 - 1 - count;
+
+       /* Pad out to 56 mod 64 */
+       if (count < 8) {
+               /* Two lots of padding:  Pad the first block to 64 bytes */
+               memset(p, 0, count);
+               byteReverse(ctx->in, 16);
+               MD5Transform(ctx->buf, (__u32 *) ctx->in);
+
+               /* Now fill the next block with 56 bytes */
+               memset(ctx->in, 0, 56);
+       } else {
+               /* Pad block to 56 bytes */
+               memset(p, 0, count - 8);
+       }
+       byteReverse(ctx->in, 14);
+
+       /* Append length in bits and transform */
+       ((__u32 *) ctx->in)[14] = ctx->bits[0];
+       ((__u32 *) ctx->in)[15] = ctx->bits[1];
+
+       MD5Transform(ctx->buf, (__u32 *) ctx->in);
+       byteReverse((unsigned char *) ctx->buf, 4);
+       memmove(digest, ctx->buf, 16);
+       memset(ctx, 0, sizeof(*ctx));   /* In case it's sensitive */
+}
+
+/* The four core functions - F1 is optimized somewhat */
+
+/* #define F1(x, y, z) (x & y | ~x & z) */
+#define F1(x, y, z) (z ^ (x & (y ^ z)))
+#define F2(x, y, z) F1(z, x, y)
+#define F3(x, y, z) (x ^ y ^ z)
+#define F4(x, y, z) (y ^ (x | ~z))
+
+/* This is the central step in the MD5 algorithm. */
+#define MD5STEP(f, w, x, y, z, data, s) \
+       ( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
+
+/*
+ * The core of the MD5 algorithm, this alters an existing MD5 hash to
+ * reflect the addition of 16 longwords of new data.  MD5Update blocks
+ * the data and converts bytes into longwords for this routine.
+ */
+static void
+MD5Transform(__u32 buf[4], __u32 const in[16])
+{
+       register __u32 a, b, c, d;
+
+       a = buf[0];
+       b = buf[1];
+       c = buf[2];
+       d = buf[3];
+
+       MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7);
+       MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12);
+       MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17);
+       MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22);
+       MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7);
+       MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12);
+       MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17);
+       MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22);
+       MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7);
+       MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12);
+       MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17);
+       MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22);
+       MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7);
+       MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12);
+       MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17);
+       MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22);
+
+       MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5);
+       MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9);
+       MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14);
+       MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20);
+       MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5);
+       MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9);
+       MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14);
+       MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20);
+       MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5);
+       MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9);
+       MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14);
+       MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20);
+       MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5);
+       MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9);
+       MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14);
+       MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
+
+       MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4);
+       MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11);
+       MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
+       MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23);
+       MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4);
+       MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11);
+       MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16);
+       MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23);
+       MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4);
+       MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11);
+       MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16);
+       MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23);
+       MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4);
+       MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
+       MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
+       MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23);
+
+       MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6);
+       MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10);
+       MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15);
+       MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21);
+       MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6);
+       MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10);
+       MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15);
+       MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21);
+       MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6);
+       MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10);
+       MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15);
+       MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21);
+       MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6);
+       MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10);
+       MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15);
+       MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21);
+
+       buf[0] += a;
+       buf[1] += b;
+       buf[2] += c;
+       buf[3] += d;
+}
+
+/*
+ * Calculate and store in 'output' the MD5 digest of 'len' bytes at
+ * 'input'. 'output' must have enough space to hold 16 bytes.
+ */
+void
+md5 (unsigned char *input, int len, unsigned char output[16])
+{
+       struct MD5Context context;
+
+       MD5Init(&context);
+       MD5Update(&context, input, len);
+       MD5Final(output, &context);
+}
+
+
+/*
+ * Calculate and store in 'output' the MD5 digest of 'len' bytes at 'input'.
+ * 'output' must have enough space to hold 16 bytes. If 'chunk' Trigger the
+ * watchdog every 'chunk_sz' bytes of input processed.
+ */
+void
+md5_wd (unsigned char *input, int len, unsigned char output[16],
+       unsigned int chunk_sz)
+{
+       struct MD5Context context;
+#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+       unsigned char *end, *curr;
+       int chunk;
+#endif
+
+       MD5Init(&context);
+
+#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+       curr = input;
+       end = input + len;
+       while (curr < end) {
+               chunk = end - curr;
+               if (chunk > chunk_sz)
+                       chunk = chunk_sz;
+               MD5Update(&context, curr, chunk);
+               curr += chunk;
+               WATCHDOG_RESET ();
+       }
+#else
+       MD5Update(&context, input, len);
+#endif
+
+       MD5Final(output, &context);
+}
index 08ffa6b..6950659 100644 (file)
@@ -309,6 +309,39 @@ void sha1_csum (unsigned char *input, int ilen, unsigned char output[20])
 }
 
 /*
+ * Output = SHA-1( input buffer ). Trigger the watchdog every 'chunk_sz'
+ * bytes of input processed.
+ */
+void sha1_csum_wd (unsigned char *input, int ilen, unsigned char output[20],
+                       unsigned int chunk_sz)
+{
+       sha1_context ctx;
+#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+       unsigned char *end, *curr;
+       int chunk;
+#endif
+
+       sha1_starts (&ctx);
+
+#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+       curr = input;
+       end = input + ilen;
+       while (curr < end) {
+               chunk = end - curr;
+               if (chunk > chunk_sz)
+                       chunk = chunk_sz;
+               sha1_update (&ctx, curr, chunk);
+               curr += chunk;
+               WATCHDOG_RESET ();
+       }
+#else
+       sha1_update (&ctx, input, ilen);
+#endif
+
+       sha1_finish (&ctx, output);
+}
+
+/*
  * Output = HMAC-SHA-1( input buffer, hmac key )
  */
 void sha1_hmac (unsigned char *key, int keylen,
index e344da5..4cc29f4 100644 (file)
@@ -25,13 +25,22 @@ include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(ARCH).a
 
-SOBJS  = bios.o bios_pci.o realmode_switch.o
-
-COBJS  = board.o bios_setup.o i386_linux.o zimage.o realmode.o \
-         pci_type1.o pci.o video_bios.o video.o
-
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+SOBJS-y        += bios.o
+SOBJS-y        += bios_pci.o
+SOBJS-y        += realmode_switch.o
+
+COBJS-y        += bios_setup.o
+COBJS-y        += board.o
+COBJS-y        += bootm.o
+COBJS-y        += pci.o
+COBJS-y        += pci_type1.o
+COBJS-y        += realmode.o
+COBJS-y        += video_bios.o
+COBJS-y        += video.o
+COBJS-y        += zimage.o
+
+SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
 
 $(LIB):        $(obj).depend $(OBJS)
        $(AR) $(ARFLAGS) $@ $(OBJS)
index 47fbab4..22191e6 100644 (file)
@@ -421,3 +421,11 @@ void hang (void)
        puts ("### ERROR ### Please RESET the board ###\n");
        for (;;);
 }
+
+unsigned long do_go_exec (ulong (*entry)(int, char *[]), int argc, char *argv[])
+{
+       /*
+        * Nios function pointers are address >> 1
+        */
+       return (entry >> 1) (argc, argv);
+}
diff --git a/lib_i386/bootm.c b/lib_i386/bootm.c
new file mode 100644 (file)
index 0000000..107ebaa
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ * (C) Copyright 2002
+ * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
+ * Marius Groeger <mgroeger@sysgo.de>
+ *
+ * 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.
+ *
+ * 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 <image.h>
+#include <zlib.h>
+#include <asm/byteorder.h>
+#include <asm/zimage.h>
+
+/*cmd_boot.c*/
+extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+
+void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
+               bootm_headers_t *images)
+{
+       void            *base_ptr;
+       ulong           os_data, os_len;
+       ulong           initrd_start, initrd_end;
+       ulong           ep;
+       image_header_t  *hdr;
+       int             ret;
+#if defined(CONFIG_FIT)
+       const void      *data;
+       size_t          len;
+#endif
+
+       ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_I386,
+                       &initrd_start, &initrd_end);
+       if (ret)
+               goto error;
+
+       if (images->legacy_hdr_valid) {
+               hdr = images->legacy_hdr_os;
+               if (image_check_type (hdr, IH_TYPE_MULTI)) {
+                       /* if multi-part image, we need to get first subimage */
+                       image_multi_getimg (hdr, 0, &os_data, &os_len);
+               } else {
+                       /* otherwise get image data */
+                       os_data = image_get_data (hdr);
+                       os_len = image_get_data_size (hdr);
+               }
+#if defined(CONFIG_FIT)
+       } else if (images->fit_uname_os) {
+               ret = fit_image_get_data (images->fit_hdr_os,
+                                       images->fit_noffset_os, &data, &len);
+               if (ret) {
+                       puts ("Can't get image data/size!\n");
+                       goto error;
+               }
+               os_data = (ulong)data;
+               os_len = (ulong)len;
+#endif
+       } else {
+               puts ("Could not find kernel image!\n");
+               goto error;
+       }
+
+       base_ptr = load_zimage ((void*)os_data, os_len,
+                       initrd_start, initrd_end - initrd_start, 0);
+
+       if (NULL == base_ptr) {
+               printf ("## Kernel loading failed ...\n");
+               goto error;
+
+       }
+
+       if (!images->autostart)
+               return ;
+
+#ifdef DEBUG
+       printf ("## Transferring control to Linux (at address %08x) ...\n",
+               (u32)base_ptr);
+#endif
+
+       /* we assume that the kernel is in place */
+       printf("\nStarting kernel ...\n\n");
+
+       boot_zimage(base_ptr);
+       /* does not return */
+       return;
+
+error:
+       if (images->autostart)
+               do_reset (cmdtp, flag, argc, argv);
+       return;
+}
diff --git a/lib_i386/i386_linux.c b/lib_i386/i386_linux.c
deleted file mode 100644 (file)
index b4a6f5a..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * (C) Copyright 2002
- * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
- * Marius Groeger <mgroeger@sysgo.de>
- *
- * 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.
- *
- * 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 <image.h>
-#include <zlib.h>
-#include <asm/byteorder.h>
-#include <asm/zimage.h>
-
-/*cmd_boot.c*/
-extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
-
-extern image_header_t header;           /* from cmd_bootm.c */
-
-
-image_header_t *fake_header(image_header_t *hdr, void *ptr, int size)
-{
-       /* try each supported image type in order */
-       if (NULL != fake_zimage_header(hdr, ptr, size)) {
-               return hdr;
-       }
-
-       return NULL;
-}
-
-
-void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
-               ulong addr, ulong *len_ptr, int   verify)
-{
-       void *base_ptr;
-
-       ulong len = 0, checksum;
-       ulong initrd_start, initrd_end;
-       ulong data;
-       image_header_t *hdr = &header;
-
-       /*
-        * Check if there is an initrd image
-        */
-       if (argc >= 3) {
-               addr = simple_strtoul(argv[2], NULL, 16);
-
-               printf ("## Loading Ramdisk Image at %08lx ...\n", addr);
-
-               /* Copy header so we can blank CRC field for re-calculation */
-               memcpy (&header, (char *)addr, sizeof(image_header_t));
-
-               if (ntohl(hdr->ih_magic) != IH_MAGIC) {
-                       printf ("Bad Magic Number\n");
-                       do_reset (cmdtp, flag, argc, argv);
-               }
-
-               data = (ulong)&header;
-               len  = sizeof(image_header_t);
-
-               checksum = ntohl(hdr->ih_hcrc);
-               hdr->ih_hcrc = 0;
-
-               if (crc32 (0, (char *)data, len) != checksum) {
-                       printf ("Bad Header Checksum\n");
-                       do_reset (cmdtp, flag, argc, argv);
-               }
-
-               print_image_hdr (hdr);
-
-               data = addr + sizeof(image_header_t);
-               len  = ntohl(hdr->ih_size);
-
-               if (verify) {
-                       ulong csum = 0;
-
-                       printf ("   Verifying Checksum ... ");
-                       csum = crc32 (0, (char *)data, len);
-                       if (csum != ntohl(hdr->ih_dcrc)) {
-                               printf ("Bad Data CRC\n");
-                               do_reset (cmdtp, flag, argc, argv);
-                       }
-                       printf ("OK\n");
-               }
-
-               if ((hdr->ih_os   != IH_OS_LINUX)       ||
-                   (hdr->ih_arch != IH_CPU_I386)       ||
-                   (hdr->ih_type != IH_TYPE_RAMDISK)   ) {
-                       printf ("No Linux i386 Ramdisk Image\n");
-                       do_reset (cmdtp, flag, argc, argv);
-               }
-
-               /*
-                * Now check if we have a multifile image
-                */
-       } else if ((hdr->ih_type==IH_TYPE_MULTI) && (len_ptr[1])) {
-               ulong tail    = ntohl(len_ptr[0]) % 4;
-               int i;
-
-               /* skip kernel length and terminator */
-               data = (ulong)(&len_ptr[2]);
-               /* skip any additional image length fields */
-               for (i=1; len_ptr[i]; ++i)
-                       data += 4;
-               /* add kernel length, and align */
-               data += ntohl(len_ptr[0]);
-               if (tail) {
-                       data += 4 - tail;
-               }
-
-               len   = ntohl(len_ptr[1]);
-
-       } else {
-               /*
-                * no initrd image
-                */
-               data = 0;
-       }
-
-#ifdef DEBUG
-       if (!data) {
-               printf ("No initrd\n");
-       }
-#endif
-
-       if (data) {
-               initrd_start = data;
-               initrd_end   = initrd_start + len;
-               printf ("   Loading Ramdisk to %08lx, end %08lx ... ",
-                       initrd_start, initrd_end);
-               memmove ((void *)initrd_start, (void *)data, len);
-               printf ("OK\n");
-       } else {
-               initrd_start = 0;
-               initrd_end = 0;
-       }
-
-       /* if multi-part image, we need to advance base ptr */
-       if ((hdr->ih_type==IH_TYPE_MULTI) && (len_ptr[1])) {
-               int i;
-               for (i=0, addr+=sizeof(int); len_ptr[i++]; addr+=sizeof(int));
-       }
-
-       base_ptr = load_zimage((void*)addr + sizeof(image_header_t), ntohl(hdr->ih_size),
-                              initrd_start, initrd_end-initrd_start, 0);
-
-       if (NULL == base_ptr) {
-               printf ("## Kernel loading failed ...\n");
-               do_reset(cmdtp, flag, argc, argv);
-
-       }
-
-#ifdef DEBUG
-       printf ("## Transferring control to Linux (at address %08x) ...\n",
-               (u32)base_ptr);
-#endif
-
-       /* we assume that the kernel is in place */
-       printf("\nStarting kernel ...\n\n");
-
-       boot_zimage(base_ptr);
-
-}
index 3510f2f..c3b4e59 100644 (file)
@@ -212,7 +212,6 @@ void *load_zimage(char *image, unsigned long kernel_size,
        return setup_base;
 }
 
-
 void boot_zimage(void *setup_base)
 {
        struct pt_regs regs;
@@ -224,52 +223,3 @@ void boot_zimage(void *setup_base)
        regs.eflags = 0;
        enter_realmode(((u32)setup_base+SETUP_START_OFFSET)>>4, 0, &regs, &regs);
 }
-
-
-image_header_t *fake_zimage_header(image_header_t *hdr, void *ptr, int size)
-{
-       /* There is no way to know the size of a zImage ... *
-        * so we assume that 2MB will be enough for now */
-#define ZIMAGE_SIZE 0x200000
-
-       /* load a 1MB, the loaded will have to be moved to its final
-        * position again later... */
-#define ZIMAGE_LOAD 0x100000
-
-       ulong checksum;
-
-       if (KERNEL_MAGIC != *(u16*)(ptr + BOOT_FLAG_OFF)) {
-               /* not a zImage or bzImage */
-               return NULL;
-       }
-
-       if (-1 == size) {
-               size = ZIMAGE_SIZE;
-       }
-#if 0
-       checksum = crc32 (0, ptr, size);
-#else
-       checksum = 0;
-#endif
-       memset(hdr, 0, sizeof(image_header_t));
-
-       /* Build new header */
-       hdr->ih_magic = htonl(IH_MAGIC);
-       hdr->ih_time  = 0;
-       hdr->ih_size  = htonl(size);
-       hdr->ih_load  = htonl(ZIMAGE_LOAD);
-       hdr->ih_ep    = 0;
-       hdr->ih_dcrc  = htonl(checksum);
-       hdr->ih_os    = IH_OS_LINUX;
-       hdr->ih_arch  = IH_CPU_I386;
-       hdr->ih_type  = IH_TYPE_KERNEL;
-       hdr->ih_comp  = IH_COMP_NONE;
-
-       strncpy((char *)hdr->ih_name, "(none)", IH_NMLEN);
-
-       checksum = crc32(0,(const char *)hdr,sizeof(image_header_t));
-
-       hdr->ih_hcrc = htonl(checksum);
-
-       return hdr;
-}
index 03784fd..f6924cd 100644 (file)
@@ -25,12 +25,17 @@ include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(ARCH).a
 
-SOBJS  =
+SOBJS-y        +=
 
-COBJS  = cache.o traps.o time.o interrupts.o board.o m68k_linux.o
+COBJS-y        += board.o
+COBJS-y        += bootm.o
+COBJS-y        += cache.o
+COBJS-y        += interrupts.o
+COBJS-y        += time.o
+COBJS-y        += traps.o
 
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
 
 $(LIB):        $(obj).depend $(OBJS)
        $(AR) $(ARFLAGS) $@ $(OBJS)
diff --git a/lib_m68k/bootm.c b/lib_m68k/bootm.c
new file mode 100644 (file)
index 0000000..61f1a36
--- /dev/null
@@ -0,0 +1,171 @@
+/*
+ * (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 <image.h>
+#include <zlib.h>
+#include <bzlib.h>
+#include <watchdog.h>
+#include <environment.h>
+#include <asm/byteorder.h>
+#ifdef CONFIG_SHOW_BOOT_PROGRESS
+# include <status_led.h>
+#endif
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#define PHYSADDR(x) x
+
+#define LINUX_MAX_ENVS         256
+#define LINUX_MAX_ARGS         256
+
+static ulong get_sp (void);
+static void set_clocks_in_mhz (bd_t *kbd);
+extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+
+void do_bootm_linux(cmd_tbl_t * cmdtp, int flag,
+                   int argc, char *argv[],
+                   bootm_headers_t *images)
+{
+       ulong sp;
+
+       ulong rd_data_start, rd_data_end, rd_len;
+       ulong initrd_start, initrd_end;
+       int ret;
+
+       ulong cmd_start, cmd_end;
+       ulong bootmap_base;
+       bd_t  *kbd;
+       ulong ep = 0;
+       void  (*kernel) (bd_t *, ulong, ulong, ulong, ulong);
+       struct lmb *lmb = images->lmb;
+
+       bootmap_base = getenv_bootm_low();
+
+       /*
+        * Booting a (Linux) kernel image
+        *
+        * Allocate space for command line and board info - the
+        * address should be as high as possible within the reach of
+        * the kernel (see CFG_BOOTMAPSZ settings), but in unused
+        * memory, which means far enough below the current stack
+        * pointer.
+        */
+       sp = get_sp();
+       debug ("## Current stack ends at 0x%08lx ", sp);
+
+       /* adjust sp by 1K to be safe */
+       sp -= 1024;
+       lmb_reserve(lmb, sp, (CFG_SDRAM_BASE + gd->ram_size - sp));
+
+       /* allocate space and init command line */
+       ret = boot_get_cmdline (lmb, &cmd_start, &cmd_end, bootmap_base);
+       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);
+       if (ret) {
+               puts("ERROR with allocation of kernel bd\n");
+               goto error;
+       }
+       set_clocks_in_mhz(kbd);
+
+       /* find kernel entry point */
+       if (images->legacy_hdr_valid) {
+               ep = image_get_ep (&images->legacy_hdr_os_copy);
+#if defined(CONFIG_FIT)
+       } else if (images->fit_uname_os) {
+               ret = fit_image_get_entry (images->fit_hdr_os,
+                               images->fit_noffset_os, &ep);
+               if (ret) {
+                       puts ("Can't get entry point property!\n");
+                       goto error;
+               }
+#endif
+       } else {
+               puts ("Could not find kernel entry point!\n");
+               goto error;
+       }
+       kernel = (void (*)(bd_t *, ulong, ulong, ulong, ulong))ep;
+
+       /* find ramdisk */
+       ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_M68K,
+                       &rd_data_start, &rd_data_end);
+       if (ret)
+               goto error;
+
+       rd_len = rd_data_end - rd_data_start;
+       ret = boot_ramdisk_high (lmb, rd_data_start, rd_len,
+                       &initrd_start, &initrd_end);
+       if (ret)
+               goto error;
+
+       debug("## Transferring control to Linux (at address %08lx) ...\n",
+             (ulong) kernel);
+
+       show_boot_progress (15);
+
+       if (!images->autostart)
+               return;
+       /*
+        * Linux Kernel Parameters (passing board info data):
+        *   r3: ptr to board info data
+        *   r4: initrd_start or 0 if no initrd
+        *   r5: initrd_end - unused if r4 is 0
+        *   r6: Start of command line string
+        *   r7: End   of command line string
+        */
+       (*kernel) (kbd, initrd_start, initrd_end, cmd_start, cmd_end);
+       /* does not return */
+       return ;
+
+error:
+       if (images->autostart)
+               do_reset (cmdtp, flag, argc, argv);
+       return ;
+}
+
+static ulong get_sp (void)
+{
+       ulong sp;
+
+       asm("movel %%a7, %%d0\n"
+           "movel %%d0, %0\n": "=d"(sp): :"%d0");
+
+       return sp;
+}
+
+static void set_clocks_in_mhz (bd_t *kbd)
+{
+       char *s;
+
+       if ((s = getenv("clocks_in_mhz")) != NULL) {
+               /* convert all clock information to MHz */
+               kbd->bi_intfreq /= 1000000L;
+               kbd->bi_busfreq /= 1000000L;
+       }
+}
diff --git a/lib_m68k/m68k_linux.c b/lib_m68k/m68k_linux.c
deleted file mode 100644 (file)
index cc974c2..0000000
+++ /dev/null
@@ -1,340 +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 <image.h>
-#include <zlib.h>
-#include <bzlib.h>
-#include <watchdog.h>
-#include <environment.h>
-#include <asm/byteorder.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-#define PHYSADDR(x) x
-
-#define LINUX_MAX_ENVS         256
-#define LINUX_MAX_ARGS         256
-
-#define CHUNKSZ                        (64 * 1024)
-
-#ifdef CONFIG_SHOW_BOOT_PROGRESS
-# include <status_led.h>
-# define SHOW_BOOT_PROGRESS(arg)       show_boot_progress(arg)
-#else
-# define SHOW_BOOT_PROGRESS(arg)
-#endif
-
-extern image_header_t header;
-
-void do_bootm_linux(cmd_tbl_t * cmdtp, int flag,
-                   int argc, char *argv[],
-                   ulong addr, ulong * len_ptr, int verify)
-{
-       ulong sp;
-       ulong len, checksum;
-       ulong initrd_start, initrd_end;
-       ulong cmd_start, cmd_end;
-       ulong initrd_high;
-       ulong data;
-       int initrd_copy_to_ram = 1;
-       char *cmdline;
-       char *s;
-       bd_t *kbd;
-       void (*kernel) (bd_t *, ulong, ulong, ulong, ulong);
-       image_header_t *hdr = &header;
-
-       if ((s = getenv("initrd_high")) != NULL) {
-               /* a value of "no" or a similar string will act like 0,
-                * turning the "load high" feature off. This is intentional.
-                */
-               initrd_high = simple_strtoul(s, NULL, 16);
-               if (initrd_high == ~0)
-                       initrd_copy_to_ram = 0;
-       } else {                /* not set, no restrictions to load high */
-               initrd_high = ~0;
-       }
-
-#ifdef CONFIG_LOGBUFFER
-       kbd = gd->bd;
-       /* Prevent initrd from overwriting logbuffer */
-       if (initrd_high < (kbd->bi_memsize - LOGBUFF_LEN - LOGBUFF_OVERHEAD))
-               initrd_high = kbd->bi_memsize - LOGBUFF_LEN - LOGBUFF_OVERHEAD;
-       debug("## Logbuffer at 0x%08lX ", kbd->bi_memsize - LOGBUFF_LEN);
-#endif
-
-       /*
-        * Booting a (Linux) kernel image
-        *
-        * Allocate space for command line and board info - the
-        * address should be as high as possible within the reach of
-        * the kernel (see CFG_BOOTMAPSZ settings), but in unused
-        * memory, which means far enough below the current stack
-        * pointer.
-        */
-       asm("movel %%a7, %%d0\n"
-           "movel %%d0, %0\n": "=d"(sp): :"%d0");
-
-       debug("## Current stack ends at 0x%08lX ", sp);
-
-       sp -= 2048;             /* just to be sure */
-       if (sp > CFG_BOOTMAPSZ)
-               sp = CFG_BOOTMAPSZ;
-       sp &= ~0xF;
-
-       debug("=> set upper limit to 0x%08lX\n", sp);
-
-       cmdline = (char *)((sp - CFG_BARGSIZE) & ~0xF);
-       kbd = (bd_t *) (((ulong) cmdline - sizeof(bd_t)) & ~0xF);
-
-       if ((s = getenv("bootargs")) == NULL)
-               s = "";
-
-       strcpy(cmdline, s);
-
-       cmd_start = (ulong) & cmdline[0];
-       cmd_end = cmd_start + strlen(cmdline);
-
-       *kbd = *(gd->bd);
-
-#ifdef DEBUG
-       printf("## cmdline at 0x%08lX ... 0x%08lX\n", cmd_start, cmd_end);
-
-       do_bdinfo(NULL, 0, 0, NULL);
-#endif
-
-       if ((s = getenv("clocks_in_mhz")) != NULL) {
-               /* convert all clock information to MHz */
-               kbd->bi_intfreq /= 1000000L;
-               kbd->bi_busfreq /= 1000000L;
-       }
-
-       kernel =
-           (void (*)(bd_t *, ulong, ulong, ulong, ulong))ntohl(hdr->ih_ep);
-
-       /*
-        * Check if there is an initrd image
-        */
-
-       if (argc >= 3) {
-               debug("Not skipping initrd\n");
-               SHOW_BOOT_PROGRESS(9);
-
-               addr = simple_strtoul(argv[2], NULL, 16);
-
-               printf("## Loading RAMDisk Image at %08lx ...\n", addr);
-
-               /* Copy header so we can blank CRC field for re-calculation */
-               memmove(&header, (char *)addr, sizeof(image_header_t));
-
-               if (ntohl(hdr->ih_magic) != IH_MAGIC) {
-                       puts("Bad Magic Number\n");
-                       SHOW_BOOT_PROGRESS(-10);
-                       do_reset(cmdtp, flag, argc, argv);
-               }
-
-               data = (ulong) & header;
-               len = sizeof(image_header_t);
-
-               checksum = ntohl(hdr->ih_hcrc);
-               hdr->ih_hcrc = 0;
-
-               if (crc32(0, (uchar *) data, len) != checksum) {
-                       puts("Bad Header Checksum\n");
-                       SHOW_BOOT_PROGRESS(-11);
-                       do_reset(cmdtp, flag, argc, argv);
-               }
-
-               SHOW_BOOT_PROGRESS(10);
-
-               print_image_hdr(hdr);
-
-               data = addr + sizeof(image_header_t);
-               len = ntohl(hdr->ih_size);
-
-               if (verify) {
-                       ulong csum = 0;
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
-                       ulong cdata = data, edata = cdata + len;
-#endif                         /* CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG */
-
-                       puts("   Verifying Checksum ... ");
-
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
-
-                       while (cdata < edata) {
-                               ulong chunk = edata - cdata;
-
-                               if (chunk > CHUNKSZ)
-                                       chunk = CHUNKSZ;
-                               csum = crc32(csum, (uchar *) cdata, chunk);
-                               cdata += chunk;
-
-                               WATCHDOG_RESET();
-                       }
-#else                          /* !(CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG) */
-                       csum = crc32(0, (uchar *) data, len);
-#endif                         /* CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG */
-
-                       if (csum != ntohl(hdr->ih_dcrc)) {
-                               puts("Bad Data CRC\n");
-                               SHOW_BOOT_PROGRESS(-12);
-                               do_reset(cmdtp, flag, argc, argv);
-                       }
-                       puts("OK\n");
-               }
-
-               SHOW_BOOT_PROGRESS(11);
-
-               if ((hdr->ih_os != IH_OS_LINUX) ||
-                   (hdr->ih_arch != IH_CPU_M68K) ||
-                   (hdr->ih_type != IH_TYPE_RAMDISK)) {
-                       puts("No Linux ColdFire Ramdisk Image\n");
-                       SHOW_BOOT_PROGRESS(-13);
-                       do_reset(cmdtp, flag, argc, argv);
-               }
-
-               /*
-                * Now check if we have a multifile image
-                */
-       } else if ((hdr->ih_type == IH_TYPE_MULTI) && (len_ptr[1])) {
-               u_long tail = ntohl(len_ptr[0]) % 4;
-               int i;
-
-               SHOW_BOOT_PROGRESS(13);
-
-               /* skip kernel length and terminator */
-               data = (ulong) (&len_ptr[2]);
-               /* skip any additional image length fields */
-               for (i = 1; len_ptr[i]; ++i)
-                       data += 4;
-               /* add kernel length, and align */
-               data += ntohl(len_ptr[0]);
-               if (tail) {
-                       data += 4 - tail;
-               }
-
-               len = ntohl(len_ptr[1]);
-
-       } else {
-               /*
-                * no initrd image
-                */
-               SHOW_BOOT_PROGRESS(14);
-
-               len = data = 0;
-       }
-
-       if (!data) {
-               debug("No initrd\n");
-       }
-
-       if (data) {
-               if (!initrd_copy_to_ram) {      /* zero-copy ramdisk support */
-                       initrd_start = data;
-                       initrd_end = initrd_start + len;
-               } else {
-                       initrd_start = (ulong) kbd - len;
-                       initrd_start &= ~(4096 - 1);    /* align on page */
-
-                       if (initrd_high) {
-                               ulong nsp;
-
-                               /*
-                                * the inital ramdisk does not need to be within
-                                * CFG_BOOTMAPSZ as it is not accessed until after
-                                * the mm system is initialised.
-                                *
-                                * do the stack bottom calculation again and see if
-                                * the initrd will fit just below the monitor stack
-                                * bottom without overwriting the area allocated
-                                * above for command line args and board info.
-                                */
-                               asm("movel %%a7, %%d0\n"
-                                   "movel %%d0, %0\n": "=d"(nsp): :"%d0");
-
-                               nsp -= 2048;    /* just to be sure */
-                               nsp &= ~0xF;
-
-                               if (nsp > initrd_high)  /* limit as specified */
-                                       nsp = initrd_high;
-
-                                       nsp -= len;
-                               nsp &= ~(4096 - 1);     /* align on page */
-
-                               if (nsp >= sp)
-                                       initrd_start = nsp;
-                       }
-
-                       SHOW_BOOT_PROGRESS(12);
-
-                       debug
-                           ("## initrd at 0x%08lX ... 0x%08lX (len=%ld=0x%lX)\n",
-                            data, data + len - 1, len, len);
-
-                       initrd_end = initrd_start + len;
-                       printf("   Loading Ramdisk to %08lx, end %08lx ... ",
-                              initrd_start, initrd_end);
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
-                       {
-                               size_t l = len;
-                               void *to = (void *)initrd_start;
-                               void *from = (void *)data;
-
-                               while (l > 0) {
-                                       size_t tail =
-                                           (l > CHUNKSZ) ? CHUNKSZ : l;
-                                       WATCHDOG_RESET();
-                                       memmove(to, from, tail);
-                                       to += tail;
-                                       from += tail;
-                                       l -= tail;
-                               }
-                       }
-#else                          /* !(CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG) */
-                       memmove((void *)initrd_start, (void *)data, len);
-#endif                         /* CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG */
-                       puts("OK\n");
-               }
-       } else {
-               initrd_start = 0;
-               initrd_end = 0;
-       }
-
-       debug("## Transferring control to Linux (at address %08lx) ...\n",
-             (ulong) kernel);
-
-       SHOW_BOOT_PROGRESS(15);
-
-       /*
-        * Linux Kernel Parameters (passing board info data):
-        *   r3: ptr to board info data
-        *   r4: initrd_start or 0 if no initrd
-        *   r5: initrd_end - unused if r4 is 0
-        *   r6: Start of command line string
-        *   r7: End   of command line string
-        */
-       (*kernel) (kbd, initrd_start, initrd_end, cmd_start, cmd_end);
-       /* does not return */
-}
index 82b7bea..141b082 100644 (file)
@@ -25,12 +25,15 @@ include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(ARCH).a
 
-SOBJS  =
+SOBJS-y        +=
 
-COBJS  = board.o microblaze_linux.o time.o cache.o
+COBJS-y        += board.o
+COBJS-y        += bootm.o
+COBJS-y        += cache.o
+COBJS-y        += time.o
 
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
 
 $(LIB):        $(obj).depend $(OBJS)
        $(AR) $(ARFLAGS) $@ $(OBJS)
diff --git a/lib_microblaze/bootm.c b/lib_microblaze/bootm.c
new file mode 100644 (file)
index 0000000..30a03ef
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * (C) Copyright 2007 Michal Simek
+ * (C) Copyright 2004 Atmark Techno, Inc.
+ *
+ * Michal  SIMEK <monstr@monstr.eu>
+ * Yasushi SHOJI <yashi@atmark-techno.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 <command.h>
+#include <image.h>
+#include <zlib.h>
+#include <asm/byteorder.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+
+void do_bootm_linux (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[],
+                    bootm_headers_t *images)
+{
+       /* First parameter is mapped to $r5 for kernel boot args */
+       void    (*theKernel) (char *);
+       char    *commandline = getenv ("bootargs");
+       ulong   ep = 0;
+
+       /* find kernel entry point */
+       if (images->legacy_hdr_valid) {
+               ep = image_get_ep (&images->legacy_hdr_os_copy);
+#if defined(CONFIG_FIT)
+       } else if (images->fit_uname_os) {
+               int ret = fit_image_get_entry (images->fit_hdr_os,
+                               images->fit_noffset_os, &ep);
+               if (ret) {
+                       puts ("Can't get entry point property!\n");
+                       goto error;
+               }
+#endif
+       } else {
+               puts ("Could not find kernel entry point!\n");
+               goto error;
+       }
+       theKernel = (void (*)(char *))ep;
+
+       show_boot_progress (15);
+
+#ifdef DEBUG
+       printf ("## Transferring control to Linux (at address %08lx) ...\n",
+               (ulong) theKernel);
+#endif
+
+       if (!images->autostart)
+               return ;
+
+       theKernel (commandline);
+       /* does not return */
+       return;
+
+error:
+       if (images->autostart)
+               do_reset (cmdtp, flag, argc, argv);
+       return;
+}
diff --git a/lib_microblaze/microblaze_linux.c b/lib_microblaze/microblaze_linux.c
deleted file mode 100644 (file)
index 68b58d4..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * (C) Copyright 2007 Michal Simek
- * (C) Copyright 2004 Atmark Techno, Inc.
- *
- * Michal  SIMEK <monstr@monstr.eu>
- * Yasushi SHOJI <yashi@atmark-techno.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 <command.h>
-#include <image.h>
-#include <zlib.h>
-#include <asm/byteorder.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-extern image_header_t header;  /* from cmd_bootm.c */
-/*cmd_boot.c*/
-extern int do_reset (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]);
-
-void do_bootm_linux (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[],
-                    ulong addr, ulong * len_ptr, int verify)
-{
-       ulong len = 0, checksum;
-       ulong initrd_start, initrd_end;
-       ulong data;
-       /* First parameter is mapped to $r5 for kernel boot args */
-       void (*theKernel) (char *);
-       image_header_t *hdr = &header;
-       char *commandline = getenv ("bootargs");
-       int i;
-
-       theKernel = (void (*)(char *))ntohl (hdr->ih_ep);
-
-       /* Check if there is an initrd image */
-       if (argc >= 3) {
-               show_boot_progress (9);
-
-               addr = simple_strtoul (argv[2], NULL, 16);
-
-               printf ("## Loading Ramdisk Image at %08lx ...\n", addr);
-
-               /* Copy header so we can blank CRC field for re-calculation */
-               memcpy (&header, (char *)addr, sizeof (image_header_t));
-
-               if (ntohl (hdr->ih_magic) != IH_MAGIC) {
-                       printf ("Bad Magic Number\n");
-                       show_boot_progress (-10);
-                       do_reset (cmdtp, flag, argc, argv);
-               }
-
-               data = (ulong) & header;
-               len = sizeof (image_header_t);
-
-               checksum = ntohl (hdr->ih_hcrc);
-               hdr->ih_hcrc = 0;
-
-               if (crc32 (0, (char *)data, len) != checksum) {
-                       printf ("Bad Header Checksum\n");
-                       show_boot_progress (-11);
-                       do_reset (cmdtp, flag, argc, argv);
-               }
-
-               show_boot_progress (10);
-
-               print_image_hdr (hdr);
-
-               data = addr + sizeof (image_header_t);
-               len = ntohl (hdr->ih_size);
-
-               if (verify) {
-                       ulong csum = 0;
-
-                       printf ("   Verifying Checksum ... ");
-                       csum = crc32 (0, (char *)data, len);
-                       if (csum != ntohl (hdr->ih_dcrc)) {
-                               printf ("Bad Data CRC\n");
-                               show_boot_progress (-12);
-                               do_reset (cmdtp, flag, argc, argv);
-                       }
-                       printf ("OK\n");
-               }
-
-               show_boot_progress (11);
-
-               if ((hdr->ih_os != IH_OS_LINUX) ||
-                   (hdr->ih_arch != IH_CPU_MICROBLAZE) ||
-                   (hdr->ih_type != IH_TYPE_RAMDISK)) {
-                       printf ("No Linux Microblaze Ramdisk Image\n");
-                       show_boot_progress (-13);
-                       do_reset (cmdtp, flag, argc, argv);
-               }
-
-               /*
-                * Now check if we have a multifile image
-                */
-       } else if ((hdr->ih_type == IH_TYPE_MULTI) && (len_ptr[1])) {
-               ulong tail = ntohl (len_ptr[0]) % 4;
-
-               show_boot_progress (13);
-
-               /* skip kernel length and terminator */
-               data = (ulong) (&len_ptr[2]);
-               /* skip any additional image length fields */
-               for (i = 1; len_ptr[i]; ++i)
-                       data += 4;
-               /* add kernel length, and align */
-               data += ntohl (len_ptr[0]);
-               if (tail) {
-                       data += 4 - tail;
-               }
-
-               len = ntohl (len_ptr[1]);
-
-       } else {
-               /*
-                * no initrd image
-                */
-               show_boot_progress (14);
-
-               data = 0;
-       }
-
-#ifdef  DEBUG
-       if (!data) {
-               printf ("No initrd\n");
-       }
-#endif
-
-       if (data) {
-               initrd_start = data;
-               initrd_end = initrd_start + len;
-       } else {
-               initrd_start = 0;
-               initrd_end = 0;
-       }
-
-       show_boot_progress (15);
-
-#ifdef DEBUG
-       printf ("## Transferring control to Linux (at address %08lx) ...\n",
-               (ulong) theKernel);
-#endif
-
-       theKernel (commandline);
-}
index 3163f00..799eaf2 100644 (file)
@@ -25,12 +25,14 @@ include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(ARCH).a
 
-SOBJS  =
+SOBJS-y        +=
 
-COBJS  = board.o time.o mips_linux.o
+COBJS-y        += board.o
+COBJS-y        += bootm.o
+COBJS-y        += time.o
 
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
 
 $(LIB):        $(obj).depend $(OBJS)
        $(AR) $(ARFLAGS) $@ $(OBJS)
similarity index 61%
rename from lib_mips/mips_linux.c
rename to lib_mips/bootm.c
index 556b180..f813fc5 100644 (file)
@@ -33,10 +33,6 @@ DECLARE_GLOBAL_DATA_PTR;
 #define        LINUX_MAX_ENVS          256
 #define        LINUX_MAX_ARGS          256
 
-extern image_header_t header;           /* from cmd_bootm.c */
-
-extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
-
 static int     linux_argc;
 static char ** linux_argv;
 
@@ -47,126 +43,40 @@ static int linux_env_idx;
 static void linux_params_init (ulong start, char * commandline);
 static void linux_env_set (char * env_name, char * env_val);
 
+extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 
 void do_bootm_linux (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[],
-                    ulong addr, ulong * len_ptr, int verify)
+                    bootm_headers_t *images)
 {
-       ulong len = 0, checksum;
-       ulong initrd_start, initrd_end;
-       ulong data;
-       void (*theKernel) (int, char **, char **, int *);
-       image_header_t *hdr = &header;
-       char *commandline = getenv ("bootargs");
-       char env_buf[12];
-
-       theKernel =
-               (void (*)(int, char **, char **, int *)) ntohl (hdr->ih_ep);
-
-       /*
-        * Check if there is an initrd image
-        */
-       if (argc >= 3) {
-               show_boot_progress (9);
-
-               addr = simple_strtoul (argv[2], NULL, 16);
-
-               printf ("## Loading Ramdisk Image at %08lx ...\n", addr);
-
-               /* Copy header so we can blank CRC field for re-calculation */
-               memcpy (&header, (char *) addr, sizeof (image_header_t));
-
-               if (ntohl (hdr->ih_magic) != IH_MAGIC) {
-                       printf ("Bad Magic Number\n");
-                       show_boot_progress (-10);
-                       do_reset (cmdtp, flag, argc, argv);
-               }
-
-               data = (ulong) & header;
-               len = sizeof (image_header_t);
-
-               checksum = ntohl (hdr->ih_hcrc);
-               hdr->ih_hcrc = 0;
-
-               if (crc32 (0, (uchar *) data, len) != checksum) {
-                       printf ("Bad Header Checksum\n");
-                       show_boot_progress (-11);
-                       do_reset (cmdtp, flag, argc, argv);
+       ulong   initrd_start, initrd_end;
+       ulong   ep = 0;
+       void    (*theKernel) (int, char **, char **, int *);
+       char    *commandline = getenv ("bootargs");
+       char    env_buf[12];
+       int     ret;
+
+       /* find kernel entry point */
+       if (images->legacy_hdr_valid) {
+               ep = image_get_ep (&images->legacy_hdr_os_copy);
+#if defined(CONFIG_FIT)
+       } else if (images->fit_uname_os) {
+               ret = fit_image_get_entry (images->fit_hdr_os,
+                               images->fit_noffset_os, &ep);
+               if (ret) {
+                       puts ("Can't get entry point property!\n");
+                       goto error;
                }
-
-               show_boot_progress (10);
-
-               print_image_hdr (hdr);
-
-               data = addr + sizeof (image_header_t);
-               len = ntohl (hdr->ih_size);
-
-               if (verify) {
-                       ulong csum = 0;
-
-                       printf ("   Verifying Checksum ... ");
-                       csum = crc32 (0, (uchar *) data, len);
-                       if (csum != ntohl (hdr->ih_dcrc)) {
-                               printf ("Bad Data CRC\n");
-                               show_boot_progress (-12);
-                               do_reset (cmdtp, flag, argc, argv);
-                       }
-                       printf ("OK\n");
-               }
-
-               show_boot_progress (11);
-
-               if ((hdr->ih_os != IH_OS_LINUX) ||
-                   (hdr->ih_arch != IH_CPU_MIPS) ||
-                   (hdr->ih_type != IH_TYPE_RAMDISK)) {
-                       printf ("No Linux MIPS Ramdisk Image\n");
-                       show_boot_progress (-13);
-                       do_reset (cmdtp, flag, argc, argv);
-               }
-
-               /*
-                * Now check if we have a multifile image
-                */
-       } else if ((hdr->ih_type == IH_TYPE_MULTI) && (len_ptr[1])) {
-               ulong tail = ntohl (len_ptr[0]) % 4;
-               int i;
-
-               show_boot_progress (13);
-
-               /* skip kernel length and terminator */
-               data = (ulong) (&len_ptr[2]);
-               /* skip any additional image length fields */
-               for (i = 1; len_ptr[i]; ++i)
-                       data += 4;
-               /* add kernel length, and align */
-               data += ntohl (len_ptr[0]);
-               if (tail) {
-                       data += 4 - tail;
-               }
-
-               len = ntohl (len_ptr[1]);
-
-       } else {
-               /*
-                * no initrd image
-                */
-               show_boot_progress (14);
-
-               data = 0;
-       }
-
-#ifdef DEBUG
-       if (!data) {
-               printf ("No initrd\n");
-       }
 #endif
-
-       if (data) {
-               initrd_start = data;
-               initrd_end = initrd_start + len;
        } else {
-               initrd_start = 0;
-               initrd_end = 0;
+               puts ("Could not find kernel entry point!\n");
+               goto error;
        }
+       theKernel = (void (*)(int, char **, char **, int *))ep;
+
+       ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_MIPS,
+                       &initrd_start, &initrd_end);
+       if (ret)
+               goto error;
 
        show_boot_progress (15);
 
@@ -203,10 +113,20 @@ void do_bootm_linux (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[],
        sprintf (env_buf, "0x%X", (uint) (gd->bd->bi_flashsize));
        linux_env_set ("flash_size", env_buf);
 
+       if (!images->autostart)
+               return ;
+
        /* we assume that the kernel is in place */
        printf ("\nStarting kernel ...\n\n");
 
        theKernel (linux_argc, linux_argv, linux_env, 0);
+       /* does not return */
+       return;
+
+error:
+       if (images->autostart)
+               do_reset (cmdtp, flag, argc, argv);
+       return;
 }
 
 static void linux_params_init (ulong start, char *line)
index 7c9d62c..c41d981 100644 (file)
@@ -25,12 +25,17 @@ include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(ARCH).a
 
-SOBJS  =
+SOBJS-y        +=
 
-COBJS  = board.o cache.o divmod.o nios_linux.o mult.o time.o
+COBJS-y        += board.o
+COBJS-y        += bootm.o
+COBJS-y        += cache.o
+COBJS-y        += divmod.o
+COBJS-y        += mult.o
+COBJS-y        += time.o
 
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
 
 $(LIB):        $(obj).depend $(OBJS)
        $(AR) $(ARFLAGS) $@ $(OBJS)
index 0a0d2e3..cdaf753 100644 (file)
@@ -190,3 +190,13 @@ void hang (void)
        puts("### ERROR ### Please reset board ###\n");
        for (;;);
 }
+
+unsigned long do_go_exec (ulong (*entry)(int, char *[]), int argc, char *argv[])
+{
+       /*
+        * x86 does not use a dedicated register to pass the pointer
+        * to the global_data
+        */
+       argv[-1] = (char *)gd;
+       return entry (argc, argv);
+}
similarity index 96%
rename from lib_nios/nios_linux.c
rename to lib_nios/bootm.c
index eef1757..fb2e9b5 100644 (file)
@@ -29,6 +29,6 @@
  *
  */
 void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
-               ulong addr, ulong *len_ptr, int   verify)
+               bootm_headers_t *images)
 {
 }
index 1ff2f29..717aa9b 100644 (file)
@@ -25,12 +25,16 @@ include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(ARCH).a
 
-SOBJS  = cache.o
+SOBJS-y        += cache.o
 
-COBJS  = board.o divmod.o nios_linux.o mult.o time.o
+COBJS-y        += board.o
+COBJS-y        += bootm.o
+COBJS-y        += divmod.o
+COBJS-y        += mult.o
+COBJS-y        += time.o
 
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
 
 $(LIB):        $(obj).depend $(OBJS)
        $(AR) $(ARFLAGS) $@ $(OBJS)
diff --git a/lib_nios2/bootm.c b/lib_nios2/bootm.c
new file mode 100644 (file)
index 0000000..01f4e87
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * (C) Copyright 2003, Psyent Corporation <www.psyent.com>
+ * Scott McNutt <smcnutt@psyent.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 <command.h>
+#include <asm/byteorder.h>
+
+extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+
+void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
+               bootm_headers_t *images)
+{
+       ulong   ep = 0;
+
+       /* find kernel entry point */
+       if (images->legacy_hdr_valid) {
+               ep = image_get_ep (&images->legacy_hdr_os_copy);
+#if defined(CONFIG_FIT)
+       } else if (images->fit_uname_os) {
+               int ret = fit_image_get_entry (images->fit_hdr_os,
+                               images->fit_noffset_os, &ep);
+               if (ret) {
+                       puts ("Can't get entry point property!\n");
+                       goto error;
+               }
+#endif
+       } else {
+               puts ("Could not find kernel entry point!\n");
+               goto error;
+       }
+       void (*kernel)(void) = (void (*)(void))ep;
+
+       if (!images->autostart)
+               return ;
+
+       /* For now we assume the Microtronix linux ... which only
+        * needs to be called ;-)
+        */
+       kernel ();
+       /* does not return */
+       return;
+
+error:
+       if (images->autostart)
+               do_reset (cmdtp, flag, argc, argv);
+       return;
+}
index afbd5ca..3d76b70 100644 (file)
@@ -25,13 +25,21 @@ include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(ARCH).a
 
-SOBJS  = ppccache.o ppcstring.o ticks.o
-
-COBJS  = board.o \
-         bat_rw.o cache.o extable.o kgdb.o time.o interrupts.o
-
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+SOBJS-y        += ppccache.o
+SOBJS-y        += ppcstring.o
+SOBJS-y        += ticks.o
+
+COBJS-y        += bat_rw.o
+COBJS-y        += board.o
+COBJS-y        += bootm.o
+COBJS-y        += cache.o
+COBJS-y        += extable.o
+COBJS-y        += interrupts.o
+COBJS-y        += kgdb.o
+COBJS-y        += time.o
+
+SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
 
 $(LIB):        $(obj).depend $(OBJS)
        $(AR) $(ARFLAGS) $@ $(OBJS)
index ee0213e..1b8a872 100644 (file)
@@ -38,6 +38,9 @@
 #if defined(CONFIG_CMD_IDE)
 #include <ide.h>
 #endif
+#if defined(CONFIG_CMD_SATA)
+#include <sata.h>
+#endif
 #if defined(CONFIG_CMD_SCSI)
 #include <scsi.h>
 #endif
@@ -117,6 +120,10 @@ DECLARE_GLOBAL_DATA_PTR;
 #define        TOTAL_MALLOC_LEN        CFG_MALLOC_LEN
 #endif
 
+#if !defined(CFG_MEM_TOP_HIDE)
+#define CFG_MEM_TOP_HIDE       0
+#endif
+
 extern ulong __init_end;
 extern ulong _end;
 ulong monitor_flash_len;
@@ -425,6 +432,7 @@ void board_init_f (ulong bootflag)
         * relocate the code and continue running from DRAM.
         *
         * Reserve memory at end of RAM for (top down in that order):
+        *  - area that won't get touched by U-Boot and Linux (optional)
         *  - kernel log buffer
         *  - protected RAM
         *  - LCD framebuffer
@@ -433,7 +441,30 @@ void board_init_f (ulong bootflag)
         */
        len = (ulong)&_end - CFG_MONITOR_BASE;
 
+       /*
+        * Subtract specified amount of memory to hide so that it won't
+        * get "touched" at all by U-Boot. By fixing up gd->ram_size
+        * the Linux kernel should now get passed the now "corrected"
+        * memory size and won't touch it either. This should work
+        * for arch/ppc and arch/powerpc. Only Linux board ports in
+        * arch/powerpc with bootwrapper support, that recalculate the
+        * memory size from the SDRAM controller setup will have to
+        * get fixed.
+        */
+       gd->ram_size -= CFG_MEM_TOP_HIDE;
+
+#ifndef CONFIG_MAX_MEM_MAPPED
+#define CONFIG_MAX_MEM_MAPPED (256 << 20)
+#endif
+
+#ifndef        CONFIG_VERY_BIG_RAM
        addr = CFG_SDRAM_BASE + get_effective_memsize();
+#else
+       /* only allow stack below 256M */
+       addr = CFG_SDRAM_BASE +
+               (gd->ram_size > CONFIG_MAX_MEM_MAPPED) ?
+               CONFIG_MAX_MEM_MAPPED : get_effective_memsize();
+#endif
 
 #ifdef CONFIG_LOGBUFFER
 #ifndef CONFIG_ALT_LB_ADDR
@@ -862,7 +893,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
        sc3_read_eeprom();
 #endif
 
-#ifdef CFG_ID_EEPROM
+#if defined (CFG_ID_EEPROM) || defined (CFG_I2C_MAC_OFFSET)
        mac_read_from_eeprom();
 #endif
 
@@ -1093,6 +1124,11 @@ void board_init_r (gd_t *id, ulong dest_addr)
 #endif
 #endif
 
+#if defined(CONFIG_CMD_SATA)
+       puts ("SATA:  ");
+       sata_initialize ();
+#endif
+
 #ifdef CONFIG_LAST_STAGE_INIT
        WATCHDOG_RESET ();
        /*
diff --git a/lib_ppc/bootm.c b/lib_ppc/bootm.c
new file mode 100644 (file)
index 0000000..0328bad
--- /dev/null
@@ -0,0 +1,762 @@
+/*
+ * (C) Copyright 2008 Semihalf
+ *
+ * (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 <common.h>
+#include <watchdog.h>
+#include <command.h>
+#include <image.h>
+#include <malloc.h>
+#include <zlib.h>
+#include <bzlib.h>
+#include <environment.h>
+#include <asm/byteorder.h>
+
+#if defined(CONFIG_OF_LIBFDT)
+#include <fdt.h>
+#include <libfdt.h>
+#include <fdt_support.h>
+
+static void fdt_error (const char *msg);
+static int boot_get_fdt (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
+               bootm_headers_t *images, char **of_flat_tree, ulong *of_size);
+static int boot_relocate_fdt (struct lmb *lmb, ulong bootmap_base,
+               cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
+               char **of_flat_tree, ulong *of_size);
+#endif
+
+#ifdef CFG_INIT_RAM_LOCK
+#include <asm/cache.h>
+#endif
+
+DECLARE_GLOBAL_DATA_PTR;
+
+extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+extern ulong get_effective_memsize(void);
+static ulong get_sp (void);
+static void set_clocks_in_mhz (bd_t *kbd);
+
+#ifndef CFG_LINUX_LOWMEM_MAX_SIZE
+#define CFG_LINUX_LOWMEM_MAX_SIZE      (768*1024*1024)
+#endif
+
+void  __attribute__((noinline))
+do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
+               bootm_headers_t *images)
+{
+       ulong   sp;
+
+       ulong   initrd_start, initrd_end;
+       ulong   rd_data_start, rd_data_end, rd_len;
+       ulong   size;
+
+       ulong   cmd_start, cmd_end, bootmap_base;
+       bd_t    *kbd;
+       ulong   ep = 0;
+       void    (*kernel)(bd_t *, ulong, ulong, ulong, ulong);
+       int     ret;
+       ulong   of_size = 0;
+       struct lmb *lmb = images->lmb;
+
+#if defined(CONFIG_OF_LIBFDT)
+       char    *of_flat_tree = NULL;
+#endif
+
+       bootmap_base = getenv_bootm_low();
+       size = getenv_bootm_size();
+
+#ifdef DEBUG
+       if (((u64)bootmap_base + size) > (CFG_SDRAM_BASE + (u64)gd->ram_size))
+               puts("WARNING: bootm_low + bootm_size exceed total memory\n");
+       if ((bootmap_base + size) > get_effective_memsize())
+               puts("WARNING: bootm_low + bootm_size exceed eff. memory\n");
+#endif
+
+       size = min(size, get_effective_memsize());
+       size = min(size, CFG_LINUX_LOWMEM_MAX_SIZE);
+
+       if (size < getenv_bootm_size()) {
+               ulong base = bootmap_base + size;
+               printf("WARNING: adjusting available memory to %x\n", size);
+               lmb_reserve(lmb, base, getenv_bootm_size() - size);
+       }
+
+       /*
+        * Booting a (Linux) kernel image
+        *
+        * Allocate space for command line and board info - the
+        * address should be as high as possible within the reach of
+        * the kernel (see CFG_BOOTMAPSZ settings), but in unused
+        * memory, which means far enough below the current stack
+        * pointer.
+        */
+       sp = get_sp();
+       debug ("## Current stack ends at 0x%08lx\n", sp);
+
+       /* adjust sp by 1K to be safe */
+       sp -= 1024;
+       lmb_reserve(lmb, sp, (CFG_SDRAM_BASE + get_effective_memsize() - sp));
+
+#if defined(CONFIG_OF_LIBFDT)
+       /* find flattened device tree */
+       ret = boot_get_fdt (cmdtp, flag, argc, argv, images, &of_flat_tree, &of_size);
+
+       if (ret)
+               goto error;
+#endif
+
+       if (!of_size) {
+               /* allocate space and init command line */
+               ret = boot_get_cmdline (lmb, &cmd_start, &cmd_end, bootmap_base);
+               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);
+               if (ret) {
+                       puts("ERROR with allocation of kernel bd\n");
+                       goto error;
+               }
+               set_clocks_in_mhz(kbd);
+       }
+
+       /* find kernel entry point */
+       if (images->legacy_hdr_valid) {
+               ep = image_get_ep (&images->legacy_hdr_os_copy);
+#if defined(CONFIG_FIT)
+       } else if (images->fit_uname_os) {
+               ret = fit_image_get_entry (images->fit_hdr_os,
+                               images->fit_noffset_os, &ep);
+               if (ret) {
+                       puts ("Can't get entry point property!\n");
+                       goto error;
+               }
+#endif
+       } else {
+               puts ("Could not find kernel entry point!\n");
+               goto error;
+       }
+       kernel = (void (*)(bd_t *, ulong, ulong, ulong, ulong))ep;
+
+       /* find ramdisk */
+       ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_PPC,
+                       &rd_data_start, &rd_data_end);
+       if (ret)
+               goto error;
+
+       rd_len = rd_data_end - rd_data_start;
+
+#if defined(CONFIG_OF_LIBFDT)
+       ret = boot_relocate_fdt (lmb, bootmap_base,
+               cmdtp, flag, argc, argv, &of_flat_tree, &of_size);
+
+       /*
+        * Add the chosen node if it doesn't exist, add the env and bd_t
+        * if the user wants it (the logic is in the subroutines).
+        */
+       if (of_size) {
+               /* pass in dummy initrd info, we'll fix up later */
+               if (fdt_chosen(of_flat_tree, rd_data_start, rd_data_end, 0) < 0) {
+                       fdt_error ("/chosen node create failed");
+                       goto error;
+               }
+#ifdef CONFIG_OF_BOARD_SETUP
+               /* Call the board-specific fixup routine */
+               ft_board_setup(of_flat_tree, gd->bd);
+#endif
+       }
+#endif /* CONFIG_OF_LIBFDT */
+
+       ret = boot_ramdisk_high (lmb, rd_data_start, rd_len, &initrd_start, &initrd_end);
+       if (ret)
+               goto error;
+
+#if defined(CONFIG_OF_LIBFDT)
+       /* fixup the initrd now that we know where it should be */
+       if ((of_flat_tree) && (initrd_start && initrd_end)) {
+               uint64_t addr, size;
+               int  total = fdt_num_mem_rsv(of_flat_tree);
+               int  j;
+
+               /* Look for the dummy entry and delete it */
+               for (j = 0; j < total; j++) {
+                       fdt_get_mem_rsv(of_flat_tree, j, &addr, &size);
+                       if (addr == rd_data_start) {
+                               fdt_del_mem_rsv(of_flat_tree, j);
+                               break;
+                       }
+               }
+
+               ret = fdt_add_mem_rsv(of_flat_tree, initrd_start,
+                                       initrd_end - initrd_start + 1);
+               if (ret < 0) {
+                       printf("fdt_chosen: %s\n", fdt_strerror(ret));
+                       goto error;
+               }
+
+               do_fixup_by_path_u32(of_flat_tree, "/chosen",
+                                       "linux,initrd-start", initrd_start, 0);
+               do_fixup_by_path_u32(of_flat_tree, "/chosen",
+                                       "linux,initrd-end", initrd_end, 0);
+       }
+#endif
+       debug ("## Transferring control to Linux (at address %08lx) ...\n",
+               (ulong)kernel);
+
+       show_boot_progress (15);
+
+#if defined(CFG_INIT_RAM_LOCK) && !defined(CONFIG_E500)
+       unlock_ram_in_cache();
+#endif
+       if (!images->autostart)
+               return ;
+
+#if defined(CONFIG_OF_LIBFDT)
+       if (of_flat_tree) {     /* device tree; boot new style */
+               /*
+                * Linux Kernel Parameters (passing device tree):
+                *   r3: pointer to the fdt, followed by the board info data
+                *   r4: physical pointer to the kernel itself
+                *   r5: NULL
+                *   r6: NULL
+                *   r7: NULL
+                */
+               debug ("   Booting using OF flat tree...\n");
+               (*kernel) ((bd_t *)of_flat_tree, (ulong)kernel, 0, 0, 0);
+               /* does not return */
+       } else
+#endif
+       {
+               /*
+                * Linux Kernel Parameters (passing board info data):
+                *   r3: ptr to board info data
+                *   r4: initrd_start or 0 if no initrd
+                *   r5: initrd_end - unused if r4 is 0
+                *   r6: Start of command line string
+                *   r7: End   of command line string
+                */
+               debug ("   Booting using board info...\n");
+               (*kernel) (kbd, initrd_start, initrd_end, cmd_start, cmd_end);
+               /* does not return */
+       }
+       return ;
+
+error:
+       if (images->autostart)
+               do_reset (cmdtp, flag, argc, argv);
+       return ;
+}
+
+static ulong get_sp (void)
+{
+       ulong sp;
+
+       asm( "mr %0,1": "=r"(sp) : );
+       return sp;
+}
+
+static void set_clocks_in_mhz (bd_t *kbd)
+{
+       char    *s;
+
+       if ((s = getenv ("clocks_in_mhz")) != NULL) {
+               /* convert all clock information to MHz */
+               kbd->bi_intfreq /= 1000000L;
+               kbd->bi_busfreq /= 1000000L;
+#if defined(CONFIG_MPC8220)
+               kbd->bi_inpfreq /= 1000000L;
+               kbd->bi_pcifreq /= 1000000L;
+               kbd->bi_pevfreq /= 1000000L;
+               kbd->bi_flbfreq /= 1000000L;
+               kbd->bi_vcofreq /= 1000000L;
+#endif
+#if defined(CONFIG_CPM2)
+               kbd->bi_cpmfreq /= 1000000L;
+               kbd->bi_brgfreq /= 1000000L;
+               kbd->bi_sccfreq /= 1000000L;
+               kbd->bi_vco     /= 1000000L;
+#endif
+#if defined(CONFIG_MPC5xxx)
+               kbd->bi_ipbfreq /= 1000000L;
+               kbd->bi_pcifreq /= 1000000L;
+#endif /* CONFIG_MPC5xxx */
+       }
+}
+
+#if defined(CONFIG_OF_LIBFDT)
+static void fdt_error (const char *msg)
+{
+       puts ("ERROR: ");
+       puts (msg);
+       puts (" - must RESET the board to recover.\n");
+}
+
+static image_header_t *image_get_fdt (ulong fdt_addr)
+{
+       image_header_t *fdt_hdr = (image_header_t *)fdt_addr;
+
+       image_print_contents (fdt_hdr);
+
+       puts ("   Verifying Checksum ... ");
+       if (!image_check_hcrc (fdt_hdr)) {
+               fdt_error ("fdt header checksum invalid");
+               return NULL;
+       }
+
+       if (!image_check_dcrc (fdt_hdr)) {
+               fdt_error ("fdt checksum invalid");
+               return NULL;
+       }
+       puts ("OK\n");
+
+       if (!image_check_type (fdt_hdr, IH_TYPE_FLATDT)) {
+               fdt_error ("uImage is not a fdt");
+               return NULL;
+       }
+       if (image_get_comp (fdt_hdr) != IH_COMP_NONE) {
+               fdt_error ("uImage is compressed");
+               return NULL;
+       }
+       if (fdt_check_header ((char *)image_get_data (fdt_hdr)) != 0) {
+               fdt_error ("uImage data is not a fdt");
+               return NULL;
+       }
+       return fdt_hdr;
+}
+
+/**
+ * fit_check_fdt - verify FIT format FDT subimage
+ * @fit_hdr: pointer to the FIT  header
+ * fdt_noffset: FDT subimage node offset within FIT image
+ * @verify: data CRC verification flag
+ *
+ * fit_check_fdt() verifies integrity of the FDT subimage and from
+ * specified FIT image.
+ *
+ * returns:
+ *     1, on success
+ *     0, on failure
+ */
+#if defined(CONFIG_FIT)
+static int fit_check_fdt (const void *fit, int fdt_noffset, int verify)
+{
+       fit_image_print (fit, fdt_noffset, "   ");
+
+       if (verify) {
+               puts ("   Verifying Hash Integrity ... ");
+               if (!fit_image_check_hashes (fit, fdt_noffset)) {
+                       fdt_error ("Bad Data Hash");
+                       return 0;
+               }
+               puts ("OK\n");
+       }
+
+       if (!fit_image_check_type (fit, fdt_noffset, IH_TYPE_FLATDT)) {
+               fdt_error ("Not a FDT image");
+               return 0;
+       }
+
+       if (!fit_image_check_comp (fit, fdt_noffset, IH_COMP_NONE)) {
+               fdt_error ("FDT image is compressed");
+               return 0;
+       }
+
+       return 1;
+}
+#endif /* CONFIG_FIT */
+
+static int boot_get_fdt (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
+               bootm_headers_t *images, char **of_flat_tree, ulong *of_size)
+{
+       ulong           fdt_addr;
+       image_header_t  *fdt_hdr;
+       char            *fdt_blob = NULL;
+       ulong           image_start, image_end;
+       ulong           load_start, load_end;
+#if defined(CONFIG_FIT)
+       void            *fit_hdr;
+       const char      *fit_uname_config = NULL;
+       const char      *fit_uname_fdt = NULL;
+       ulong           default_addr;
+       int             cfg_noffset;
+       int             fdt_noffset;
+       const void      *data;
+       size_t          size;
+#endif
+
+       *of_flat_tree = NULL;
+       *of_size = 0;
+
+       if (argc > 3 || genimg_has_config (images)) {
+#if defined(CONFIG_FIT)
+               if (argc > 3) {
+                       /*
+                        * If the FDT blob comes from the FIT image and the
+                        * FIT image address is omitted in the command line
+                        * argument, try to use ramdisk or os FIT image
+                        * address or default load address.
+                        */
+                       if (images->fit_uname_rd)
+                               default_addr = (ulong)images->fit_hdr_rd;
+                       else if (images->fit_uname_os)
+                               default_addr = (ulong)images->fit_hdr_os;
+                       else
+                               default_addr = load_addr;
+
+                       if (fit_parse_conf (argv[3], default_addr,
+                                               &fdt_addr, &fit_uname_config)) {
+                               debug ("*  fdt: config '%s' from image at 0x%08lx\n",
+                                               fit_uname_config, fdt_addr);
+                       } else if (fit_parse_subimage (argv[3], default_addr,
+                                               &fdt_addr, &fit_uname_fdt)) {
+                               debug ("*  fdt: subimage '%s' from image at 0x%08lx\n",
+                                               fit_uname_fdt, fdt_addr);
+                       } else
+#endif
+                       {
+                               fdt_addr = simple_strtoul(argv[3], NULL, 16);
+                               debug ("*  fdt: cmdline image address = 0x%08lx\n",
+                                               fdt_addr);
+                       }
+#if defined(CONFIG_FIT)
+               } else {
+                       /* use FIT configuration provided in first bootm
+                        * command argument
+                        */
+                       fdt_addr = (ulong)images->fit_hdr_os;
+                       fit_uname_config = images->fit_uname_cfg;
+                       debug ("*  fdt: using config '%s' from image at 0x%08lx\n",
+                                       fit_uname_config, fdt_addr);
+
+                       /*
+                        * Check whether configuration has FDT blob defined,
+                        * if not quit silently.
+                        */
+                       fit_hdr = (void *)fdt_addr;
+                       cfg_noffset = fit_conf_get_node (fit_hdr,
+                                       fit_uname_config);
+                       if (cfg_noffset < 0) {
+                               debug ("*  fdt: no such config\n");
+                               return 0;
+                       }
+
+                       fdt_noffset = fit_conf_get_fdt_node (fit_hdr,
+                                       cfg_noffset);
+                       if (fdt_noffset < 0) {
+                               debug ("*  fdt: no fdt in config\n");
+                               return 0;
+                       }
+               }
+#endif
+
+               debug ("## Checking for 'FDT'/'FDT Image' at %08lx\n",
+                               fdt_addr);
+
+               /* copy from dataflash if needed */
+               fdt_addr = genimg_get_image (fdt_addr);
+
+               /*
+                * Check if there is an FDT image at the
+                * address provided in the second bootm argument
+                * check image type, for FIT images get a FIT node.
+                */
+               switch (genimg_get_format ((void *)fdt_addr)) {
+               case IMAGE_FORMAT_LEGACY:
+                       /* verify fdt_addr points to a valid image header */
+                       printf ("## Flattened Device Tree from Legacy Image at %08lx\n",
+                                       fdt_addr);
+                       fdt_hdr = image_get_fdt (fdt_addr);
+                       if (!fdt_hdr)
+                               goto error;
+
+                       /*
+                        * move image data to the load address,
+                        * make sure we don't overwrite initial image
+                        */
+                       image_start = (ulong)fdt_hdr;
+                       image_end = image_get_image_end (fdt_hdr);
+
+                       load_start = image_get_load (fdt_hdr);
+                       load_end = load_start + image_get_data_size (fdt_hdr);
+
+                       if ((load_start < image_end) && (load_end > image_start)) {
+                               fdt_error ("fdt overwritten");
+                               goto error;
+                       }
+
+                       debug ("   Loading FDT from 0x%08lx to 0x%08lx\n",
+                                       image_get_data (fdt_hdr), load_start);
+
+                       memmove ((void *)load_start,
+                                       (void *)image_get_data (fdt_hdr),
+                                       image_get_data_size (fdt_hdr));
+
+                       fdt_blob = (char *)load_start;
+                       break;
+               case IMAGE_FORMAT_FIT:
+                       /*
+                        * This case will catch both: new uImage format
+                        * (libfdt based) and raw FDT blob (also libfdt
+                        * based).
+                        */
+#if defined(CONFIG_FIT)
+                       /* check FDT blob vs FIT blob */
+                       if (fit_check_format ((const void *)fdt_addr)) {
+                               /*
+                                * FIT image
+                                */
+                               fit_hdr = (void *)fdt_addr;
+                               printf ("## Flattened Device Tree from FIT Image at %08lx\n",
+                                               fdt_addr);
+
+                               if (!fit_uname_fdt) {
+                                       /*
+                                        * no FDT blob image node unit name,
+                                        * try to get config node first. If
+                                        * config unit node name is NULL
+                                        * fit_conf_get_node() will try to
+                                        * find default config node
+                                        */
+                                       cfg_noffset = fit_conf_get_node (fit_hdr,
+                                                       fit_uname_config);
+
+                                       if (cfg_noffset < 0) {
+                                               fdt_error ("Could not find configuration node\n");
+                                               goto error;
+                                       }
+
+                                       fit_uname_config = fdt_get_name (fit_hdr,
+                                                       cfg_noffset, NULL);
+                                       printf ("   Using '%s' configuration\n",
+                                                       fit_uname_config);
+
+                                       fdt_noffset = fit_conf_get_fdt_node (fit_hdr,
+                                                       cfg_noffset);
+                                       fit_uname_fdt = fit_get_name (fit_hdr,
+                                                       fdt_noffset, NULL);
+                               } else {
+                                       /* get FDT component image node offset */
+                                       fdt_noffset = fit_image_get_node (fit_hdr,
+                                                       fit_uname_fdt);
+                               }
+                               if (fdt_noffset < 0) {
+                                       fdt_error ("Could not find subimage node\n");
+                                       goto error;
+                               }
+
+                               printf ("   Trying '%s' FDT blob subimage\n",
+                                               fit_uname_fdt);
+
+                               if (!fit_check_fdt (fit_hdr, fdt_noffset,
+                                                       images->verify))
+                                       goto error;
+
+                               /* get ramdisk image data address and length */
+                               if (fit_image_get_data (fit_hdr, fdt_noffset,
+                                                       &data, &size)) {
+                                       fdt_error ("Could not find FDT subimage data");
+                                       goto error;
+                               }
+
+                               /* verift that image data is a proper FDT blob */
+                               if (fdt_check_header ((char *)data) != 0) {
+                                       fdt_error ("Subimage data is not a FTD");
+                                       goto error;
+                               }
+
+                               /*
+                                * move image data to the load address,
+                                * make sure we don't overwrite initial image
+                                */
+                               image_start = (ulong)fit_hdr;
+                               image_end = fit_get_end (fit_hdr);
+
+                               if (fit_image_get_load (fit_hdr, fdt_noffset,
+                                                       &load_start) == 0) {
+                                       load_end = load_start + size;
+
+                                       if ((load_start < image_end) &&
+                                                       (load_end > image_start)) {
+                                               fdt_error ("FDT overwritten");
+                                               goto error;
+                                       }
+
+                                       printf ("   Loading FDT from 0x%08lx to 0x%08lx\n",
+                                                       (ulong)data, load_start);
+
+                                       memmove ((void *)load_start,
+                                                       (void *)data, size);
+
+                                       fdt_blob = (char *)load_start;
+                               } else {
+                                       fdt_blob = (char *)data;
+                               }
+
+                               images->fit_hdr_fdt = fit_hdr;
+                               images->fit_uname_fdt = fit_uname_fdt;
+                               images->fit_noffset_fdt = fdt_noffset;
+                               break;
+                       } else
+#endif
+                       {
+                               /*
+                                * FDT blob
+                                */
+                               fdt_blob = (char *)fdt_addr;
+                               debug ("*  fdt: raw FDT blob\n");
+                               printf ("## Flattened Device Tree blob at %08lx\n", fdt_blob);
+                       }
+                       break;
+               default:
+                       fdt_error ("Did not find a cmdline Flattened Device Tree");
+                       goto error;
+               }
+
+               printf ("   Booting using the fdt blob at 0x%x\n", fdt_blob);
+
+       } else if (images->legacy_hdr_valid &&
+                       image_check_type (&images->legacy_hdr_os_copy, IH_TYPE_MULTI)) {
+
+               ulong fdt_data, fdt_len;
+
+               /*
+                * Now check if we have a legacy multi-component image,
+                * get second entry data start address and len.
+                */
+               printf ("## Flattened Device Tree from multi "
+                       "component Image at %08lX\n",
+                       (ulong)images->legacy_hdr_os);
+
+               image_multi_getimg (images->legacy_hdr_os, 2, &fdt_data, &fdt_len);
+               if (fdt_len) {
+
+                       fdt_blob = (char *)fdt_data;
+                       printf ("   Booting using the fdt at 0x%x\n", fdt_blob);
+
+                       if (fdt_check_header (fdt_blob) != 0) {
+                               fdt_error ("image is not a fdt");
+                               goto error;
+                       }
+
+                       if (be32_to_cpu (fdt_totalsize (fdt_blob)) != fdt_len) {
+                               fdt_error ("fdt size != image size");
+                               goto error;
+                       }
+               } else {
+                       fdt_error ("Did not find a Flattened Device Tree "
+                               "in a legacy multi-component image");
+                       goto error;
+               }
+       } else {
+               debug ("## No Flattened Device Tree\n");
+               return 0;
+       }
+
+       *of_flat_tree = fdt_blob;
+       *of_size = be32_to_cpu (fdt_totalsize (fdt_blob));
+       debug ("   of_flat_tree at 0x%08lx size 0x%08lx\n",
+                       *of_flat_tree, *of_size);
+
+       return 0;
+
+error:
+       do_reset (cmdtp, flag, argc, argv);
+       return 1;
+}
+
+static int boot_relocate_fdt (struct lmb *lmb, ulong bootmap_base,
+               cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
+               char **of_flat_tree, ulong *of_size)
+{
+       char    *fdt_blob = *of_flat_tree;
+       ulong   relocate = 0;
+       ulong   of_len = 0;
+
+       /* nothing to do */
+       if (*of_size == 0)
+               return 0;
+
+       if (fdt_check_header (fdt_blob) != 0) {
+               fdt_error ("image is not a fdt");
+               goto error;
+       }
+
+#ifndef CFG_NO_FLASH
+       /* move the blob if it is in flash (set relocate) */
+       if (addr2info ((ulong)fdt_blob) != NULL)
+               relocate = 1;
+#endif
+
+       /*
+        * The blob must be within CFG_BOOTMAPSZ,
+        * so we flag it to be copied if it is not.
+        */
+       if (fdt_blob >= (char *)CFG_BOOTMAPSZ)
+               relocate = 1;
+
+       of_len = be32_to_cpu (fdt_totalsize (fdt_blob));
+
+       /* move flattend device tree if needed */
+       if (relocate) {
+               int err;
+               ulong of_start;
+
+               /* position on a 4K boundary before the alloc_current */
+               of_start = lmb_alloc_base(lmb, of_len, 0x1000,
+                                        (CFG_BOOTMAPSZ + bootmap_base));
+
+               if (of_start == 0) {
+                       puts("device tree - allocation error\n");
+                       goto error;
+               }
+
+               debug ("## device tree at 0x%08lX ... 0x%08lX (len=%ld=0x%lX)\n",
+                       (ulong)fdt_blob, (ulong)fdt_blob + of_len - 1,
+                       of_len, of_len);
+
+               printf ("   Loading Device Tree to %08lx, end %08lx ... ",
+                       of_start, of_start + of_len - 1);
+
+               err = fdt_open_into (fdt_blob, (void *)of_start, of_len);
+               if (err != 0) {
+                       fdt_error ("fdt move failed");
+                       goto error;
+               }
+               puts ("OK\n");
+
+               *of_flat_tree = (char *)of_start;
+       } else {
+               *of_flat_tree = fdt_blob;
+               lmb_reserve(lmb, (ulong)fdt, of_len);
+       }
+
+       return 0;
+
+error:
+       return 1;
+}
+#endif
index cf127a8..a5772a0 100644 (file)
@@ -22,12 +22,14 @@ include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(ARCH).a
 
-SOBJS  =
+SOBJS-y        +=
 
-COBJS  = board.o sh_linux.o # time.o
+COBJS-y        += board.o
+COBJS-y        += bootm.o
+#COBJS-y       += time.o
 
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
 
 $(LIB):        $(obj).depend $(OBJS)
        $(AR) $(ARFLAGS) $@ $(OBJS)
index 2cd60d7..883c381 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007
+ * Copyright (C) 2007,2008
  * Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
  *
  * This program is free software; you can redistribute it and/or
@@ -95,6 +95,14 @@ static int sh_marubun_init(void)
 }
 #endif /* (CONFIG_CMD_IDE) */
 
+#if defined(CONFIG_PCI)
+static int sh_pci_init(void)
+{
+       pci_init();
+       return 0;
+}
+#endif /* CONFIG_PCI */
+
 static int sh_mem_env_init(void)
 {
        mem_malloc_init();
@@ -141,6 +149,9 @@ init_fnc_t *init_sequence[] =
 #if defined(CONFIG_CMD_NAND)
        sh_nand_init,           /* Flash memory (NAND) init */
 #endif
+#if defined(CONFIG_PCI)
+       sh_pci_init,            /* PCI Init */
+#endif
        devices_init,
        console_init_r,
        interrupt_init,
similarity index 69%
rename from lib_sh/sh_linux.c
rename to lib_sh/bootm.c
index 14b6815..dd32a3e 100644 (file)
 #include <command.h>
 #include <asm/byteorder.h>
 
-extern image_header_t header;  /* common/cmd_bootm.c */
-
 /* The SH kernel reads arguments from the empty zero page at location
  * 0 at the start of SDRAM. The following are copied from
  * arch/sh/kernel/setup.c and may require tweaking if the kernel sources
  * change.
  */
-#define PARAM   ((unsigned char *)CFG_SDRAM_BASE + 0x1000)
+#define PARAM  ((unsigned char *)CFG_SDRAM_BASE + 0x1000)
 
 #define MOUNT_ROOT_RDONLY (*(unsigned long *) (PARAM+0x000))
 #define RAMDISK_FLAGS (*(unsigned long *) (PARAM+0x004))
@@ -43,7 +41,9 @@ extern image_header_t header; /* common/cmd_bootm.c */
 /* ... */
 #define COMMAND_LINE ((char *) (PARAM+0x100))
 
-#define RAMDISK_IMAGE_START_MASK        0x07FF
+#define RAMDISK_IMAGE_START_MASK       0x07FF
+
+extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 
 #ifdef CFG_DEBUG
 static void hexdump (unsigned char *buf, int len)
@@ -60,15 +60,42 @@ static void hexdump (unsigned char *buf, int len)
 #endif
 
 void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
-                    ulong addr, ulong *len_ptr, int verify)
+                    bootm_headers_t *images)
 {
-       image_header_t *hdr = &header;
-       char *bootargs = getenv("bootargs");
-       void (*kernel) (void) = (void (*)(void)) ntohl (hdr->ih_ep);
+       ulong   ep = 0;
+       char    *bootargs = getenv("bootargs");
+
+       /* find kernel entry point */
+       if (images->legacy_hdr_valid) {
+               ep = image_get_ep (&images->legacy_hdr_os_copy);
+#if defined(CONFIG_FIT)
+       } else if (images->fit_uname_os) {
+               int ret = fit_image_get_entry (images->fit_hdr_os,
+                               images->fit_noffset_os, &ep);
+               if (ret) {
+                       puts ("Can't get entry point property!\n");
+                       goto error;
+               }
+#endif
+       } else {
+               puts ("Could not find kernel entry point!\n");
+               goto error;
+       }
+       void (*kernel) (void) = (void (*)(void))ep;
+
+       if (!images->autostart)
+               return ;
 
        /* Setup parameters */
        memset(PARAM, 0, 0x1000);       /* Clear zero page */
        strcpy(COMMAND_LINE, bootargs);
 
        kernel();
+       /* does not return */
+       return;
+
+error:
+       if (images->autostart)
+               do_reset (cmdtp, flag, argc, argv);
+       return;
 }
diff --git a/lib_sparc/Makefile b/lib_sparc/Makefile
new file mode 100644 (file)
index 0000000..1a354b6
--- /dev/null
@@ -0,0 +1,45 @@
+#
+# (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$(ARCH).a
+
+SOBJS  =
+
+COBJS  = board.o cache.o interrupts.o time.o bootm.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
+       $(AR) $(ARFLAGS) $@ $(OBJS)
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/lib_sparc/board.c b/lib_sparc/board.c
new file mode 100644 (file)
index 0000000..af301c0
--- /dev/null
@@ -0,0 +1,521 @@
+/* SPARC Board initialization
+ *
+ * (C) Copyright 2000-2006
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * (C) Copyright 2007
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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 <command.h>
+#include <malloc.h>
+#include <devices.h>
+#include <config.h>
+#if defined(CONFIG_CMD_IDE)
+#include <ide.h>
+#endif
+#ifdef CONFIG_STATUS_LED
+#include <status_led.h>
+#endif
+#include <net.h>
+#include <serial.h>
+#include <version.h>
+#if defined(CONFIG_POST)
+#include <post.h>
+#endif
+#ifdef CONFIG_PS2KBD
+#include <keyboard.h>
+#endif
+#ifdef CONFIG_CMD_AMBAPP
+#include <ambapp.h>
+#endif
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/* Debug options
+#define DEBUG_INIT_SEQUENCE
+#define DEBUG_MEM_LAYOUT
+#define DEBUG_COMMANDS
+*/
+
+extern void timer_interrupt_init(void);
+extern void malloc_bin_reloc(void);
+extern int do_ambapp_print(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]);
+extern int prom_init(void);
+
+#if defined(CONFIG__CMD_DOC)
+void doc_init(void);
+#endif
+
+#if !defined(CFG_NO_FLASH)
+static char *failed = "*** failed ***\n";
+#endif
+
+#include <environment.h>
+
+ulong monitor_flash_len;
+
+/*
+ * Begin and End of memory area for malloc(), and current "brk"
+ */
+static ulong mem_malloc_start = 0;
+static ulong mem_malloc_end = 0;
+static ulong mem_malloc_brk = 0;
+
+/************************************************************************
+ * Utilities                                                           *
+ ************************************************************************
+ */
+
+/*
+ * The Malloc area is immediately below the monitor copy in RAM
+ */
+static void mem_malloc_init(void)
+{
+       mem_malloc_start = CFG_MALLOC_BASE;
+       mem_malloc_end = CFG_MALLOC_END;
+       mem_malloc_brk = mem_malloc_start;
+       memset((void *)mem_malloc_start, 0, mem_malloc_end - mem_malloc_start);
+}
+
+void *sbrk(ptrdiff_t increment)
+{
+       ulong old = mem_malloc_brk;
+       ulong new = old + increment;
+
+       if ((new < mem_malloc_start) || (new > mem_malloc_end)) {
+               return (NULL);
+       }
+       mem_malloc_brk = new;
+       return ((void *)old);
+}
+
+/***********************************************************************/
+
+/************************************************************************
+ * Init Utilities                                                      *
+ ************************************************************************
+ * Some of this code should be moved into the core functions,
+ * but let's get it working (again) first...
+ */
+
+static int init_baudrate(void)
+{
+       char tmp[64];           /* long enough for environment variables */
+       int i = getenv_r("baudrate", tmp, sizeof(tmp));
+
+       gd->baudrate = (i > 0)
+           ? (int)simple_strtoul(tmp, NULL, 10)
+           : CONFIG_BAUDRATE;
+       return (0);
+}
+
+/***********************************************************************/
+
+/*
+ * All attempts to come up with a "common" initialization sequence
+ * that works for all boards and architectures failed: some of the
+ * requirements are just _too_ different. To get rid of the resulting
+ * mess of board dependend #ifdef'ed code we now make the whole
+ * initialization sequence configurable to the user.
+ *
+ * The requirements for any new initalization function is simple: it
+ * receives a pointer to the "global data" structure as it's only
+ * argument, and returns an integer return code, where 0 means
+ * "continue" and != 0 means "fatal error, hang the system".
+ */
+typedef int (init_fnc_t) (void);
+
+#define WATCHDOG_RESET(x)
+
+/************************************************************************
+ * Initialization sequence                                             *
+ ************************************************************************
+ */
+
+init_fnc_t *init_sequence[] = {
+
+#if defined(CONFIG_BOARD_EARLY_INIT_F)
+       board_early_init_f,
+#endif
+       serial_init,
+
+       init_timebase,
+
+#if defined(CONFIG_CMD_AMBAPP)
+       ambapp_init_reloc,
+#endif
+
+       env_init,
+
+       init_baudrate,
+
+       console_init_f,
+       display_options,
+
+       checkcpu,
+       checkboard,
+#if defined(CONFIG_MISC_INIT_F)
+       misc_init_f,
+#endif
+
+#ifdef CONFIG_POST
+       post_init_f,
+#endif
+
+       NULL,                   /* Terminate this list,
+                                * beware: this list will be relocated
+                                * which means that NULL will become
+                                * NULL+RELOC_OFFSET. We simply make
+                                * NULL be -RELOC_OFFSET instead.
+                                */
+};
+
+/************************************************************************
+ *
+ * This is the SPARC board initialization routine, running from RAM.
+ *
+ ************************************************************************
+ */
+#ifdef DEBUG_INIT_SEQUENCE
+char *str_init_seq = "INIT_SEQ 00\n";
+char *str_init_seq_done = "\n\rInit sequence done...\r\n\r\n";
+#endif
+
+void board_init_f(ulong bootflag)
+{
+       cmd_tbl_t *cmdtp;
+       bd_t *bd;
+       unsigned char *s;
+       init_fnc_t **init_fnc_ptr;
+       int j;
+       int i;
+       char *e;
+
+#ifndef CFG_NO_FLASH
+       ulong flash_size;
+#endif
+
+       gd = (gd_t *) (CFG_GBL_DATA_OFFSET);
+
+       /* Clear initial global data */
+       memset((void *)gd, 0, sizeof(gd_t));
+
+       gd->bd = (bd_t *) (gd + 1);     /* At end of global data */
+       gd->baudrate = CONFIG_BAUDRATE;
+       gd->cpu_clk = CONFIG_SYS_CLK_FREQ;
+
+       bd = gd->bd;
+       bd->bi_memstart = CFG_RAM_BASE;
+       bd->bi_memsize = CFG_RAM_SIZE;
+       bd->bi_flashstart = CFG_FLASH_BASE;
+#if    defined(CFG_SRAM_BASE) && defined(CFG_SRAM_SIZE)
+       bd->bi_sramstart = CFG_SRAM_BASE;
+       bd->bi_sramsize = CFG_SRAM_SIZE;
+#endif
+       bd->bi_baudrate = CONFIG_BAUDRATE;
+       bd->bi_bootflags = bootflag;    /* boot / reboot flag (for LynxOS)    */
+
+       gd->flags |= GD_FLG_RELOC;      /* tell others: relocation done */
+       gd->reloc_off = CFG_RELOC_MONITOR_BASE - CFG_MONITOR_BASE;
+
+       for (init_fnc_ptr = init_sequence, j = 0; *init_fnc_ptr;
+            ++init_fnc_ptr, j++) {
+#ifdef DEBUG_INIT_SEQUENCE
+               if (j > 9)
+                       str_init_seq[9] = '0' + (j / 10);
+               str_init_seq[10] = '0' + (j - (j / 10) * 10);
+               serial_puts(str_init_seq);
+#endif
+               if ((*init_fnc_ptr + gd->reloc_off) () != 0) {
+                       hang();
+               }
+       }
+#ifdef DEBUG_INIT_SEQUENCE
+       serial_puts(str_init_seq_done);
+#endif
+
+       /*
+        * Now that we have DRAM mapped and working, we can
+        * relocate the code and continue running from DRAM.
+        *
+        * Reserve memory at end of RAM for (top down in that order):
+        *  - kernel log buffer
+        *  - protected RAM
+        *  - LCD framebuffer
+        *  - monitor code
+        *  - board info struct
+        */
+#ifdef DEBUG_MEM_LAYOUT
+       printf("CFG_MONITOR_BASE:       0x%lx\n", CFG_MONITOR_BASE);
+       printf("CFG_ENV_ADDR:           0x%lx\n", CFG_ENV_ADDR);
+       printf("CFG_RELOC_MONITOR_BASE: 0x%lx (%d)\n", CFG_RELOC_MONITOR_BASE,
+              CFG_MONITOR_LEN);
+       printf("CFG_MALLOC_BASE:        0x%lx (%d)\n", CFG_MALLOC_BASE,
+              CFG_MALLOC_LEN);
+       printf("CFG_INIT_SP_OFFSET:     0x%lx (%d)\n", CFG_INIT_SP_OFFSET,
+              CFG_STACK_SIZE);
+       printf("CFG_PROM_OFFSET:        0x%lx (%d)\n", CFG_PROM_OFFSET,
+              CFG_PROM_SIZE);
+       printf("CFG_GBL_DATA_OFFSET:    0x%lx (%d)\n", CFG_GBL_DATA_OFFSET,
+              CFG_GBL_DATA_SIZE);
+#endif
+
+#ifdef CONFIG_POST
+       post_bootmode_init();
+       post_run(NULL, POST_ROM | post_bootmode_get(0));
+#endif
+
+       /*
+        * We have to relocate the command table manually
+        */
+       for (cmdtp = &__u_boot_cmd_start; cmdtp != &__u_boot_cmd_end; cmdtp++) {
+               ulong addr;
+               addr = (ulong) (cmdtp->cmd) + gd->reloc_off;
+#if DEBUG_COMMANDS
+               printf("Command \"%s\": 0x%08lx => 0x%08lx\n",
+                      cmdtp->name, (ulong) (cmdtp->cmd), addr);
+#endif
+               cmdtp->cmd =
+                   (int (*)(struct cmd_tbl_s *, int, int, char *[]))addr;
+
+               addr = (ulong) (cmdtp->name) + gd->reloc_off;
+               cmdtp->name = (char *)addr;
+
+               if (cmdtp->usage) {
+                       addr = (ulong) (cmdtp->usage) + gd->reloc_off;
+                       cmdtp->usage = (char *)addr;
+               }
+#ifdef CFG_LONGHELP
+               if (cmdtp->help) {
+                       addr = (ulong) (cmdtp->help) + gd->reloc_off;
+                       cmdtp->help = (char *)addr;
+               }
+#endif
+       }
+
+#if defined(CONFIG_CMD_AMBAPP) && defined(CFG_AMBAPP_PRINT_ON_STARTUP)
+       puts("AMBA:\n");
+       do_ambapp_print(NULL, 0, 0, NULL);
+#endif
+
+       /* initialize higher level parts of CPU like time base and timers */
+       cpu_init_r();
+
+       /* start timer */
+       timer_interrupt_init();
+
+       /*
+        * Enable Interrupts before any calls to udelay,
+        * the flash driver may use udelay resulting in
+        * a hang if not timer0 IRQ is enabled.
+        */
+       interrupt_init();
+
+#if !defined(CFG_NO_FLASH)
+       puts("FLASH: ");
+
+       if ((flash_size = flash_init()) > 0) {
+# ifdef CFG_FLASH_CHECKSUM
+               print_size(flash_size, "");
+               /*
+                * Compute and print flash CRC if flashchecksum is set to 'y'
+                *
+                * NOTE: Maybe we should add some WATCHDOG_RESET()? XXX
+                */
+               s = getenv("flashchecksum");
+               if (s && (*s == 'y')) {
+                       printf("  CRC: %08lX",
+                              crc32(0, (const unsigned char *)CFG_FLASH_BASE,
+                                    flash_size)
+                           );
+               }
+               putc('\n');
+# else                         /* !CFG_FLASH_CHECKSUM */
+               print_size(flash_size, "\n");
+# endif                                /* CFG_FLASH_CHECKSUM */
+       } else {
+               puts(failed);
+               hang();
+       }
+
+       bd->bi_flashstart = CFG_FLASH_BASE;     /* update start of FLASH memory    */
+       bd->bi_flashsize = flash_size;  /* size of FLASH memory (final value) */
+#if CFG_MONITOR_BASE == CFG_FLASH_BASE
+       bd->bi_flashoffset = monitor_flash_len; /* reserved area for startup monitor  */
+#else
+       bd->bi_flashoffset = 0;
+#endif
+#else                          /* CFG_NO_FLASH */
+       bd->bi_flashsize = 0;
+       bd->bi_flashstart = 0;
+       bd->bi_flashoffset = 0;
+#endif                         /* !CFG_NO_FLASH */
+
+       /* initialize malloc() area */
+       mem_malloc_init();
+
+       malloc_bin_reloc();
+
+#ifdef CONFIG_SPI
+# if !defined(CFG_ENV_IS_IN_EEPROM)
+       spi_init_f();
+# endif
+       spi_init_r();
+#endif
+
+       /* relocate environment function pointers etc. */
+       env_relocate();
+
+#if defined(CONFIG_BOARD_LATE_INIT)
+       board_late_init();
+#endif
+
+       s = getenv("ethaddr");
+       for (i = 0; i < 6; ++i) {
+               bd->bi_enetaddr[i] = s ? simple_strtoul(s, &e, 16) : 0;
+               if (s)
+                       s = (*e) ? e + 1 : e;
+       }
+
+#ifdef CONFIG_HAS_ETH1
+       /* handle the 2nd ethernet address */
+
+       s = getenv("eth1addr");
+
+       for (i = 0; i < 6; ++i) {
+               bd->bi_enet1addr[i] = s ? simple_strtoul(s, &e, 16) : 0;
+               if (s)
+                       s = (*e) ? e + 1 : e;
+       }
+#endif
+
+#ifdef CFG_ID_EEPROM
+       mac_read_from_eeprom();
+#endif
+
+       /* IP Address */
+       bd->bi_ip_addr = getenv_IPaddr("ipaddr");
+#if defined(CONFIG_PCI)
+       /*
+        * Do pci configuration
+        */
+       pci_init();
+#endif
+
+       /* Initialize devices */
+       devices_init();
+
+       /* Initialize the jump table for applications */
+       jumptable_init();
+
+       /* Initialize the console (after the relocation and devices init) */
+       console_init_r();
+
+#ifdef CONFIG_SERIAL_SOFTWARE_FIFO
+       serial_buffered_init();
+#endif
+
+#ifdef CONFIG_STATUS_LED
+       status_led_set(STATUS_LED_BOOT, STATUS_LED_BLINKING);
+#endif
+
+       udelay(20);
+
+       set_timer(0);
+
+       /* Initialize from environment */
+       if ((s = getenv("loadaddr")) != NULL) {
+               load_addr = simple_strtoul(s, NULL, 16);
+       }
+#if defined(CONFIG_CMD_NET)
+       if ((s = getenv("bootfile")) != NULL) {
+               copy_filename(BootFile, s, sizeof(BootFile));
+       }
+#endif                         /* CFG_CMD_NET */
+
+       WATCHDOG_RESET();
+
+#if defined(CONFIG_CMD_DOC)
+       WATCHDOG_RESET();
+       puts("DOC:   ");
+       doc_init();
+#endif
+
+#if defined(CONFIG_CMD_NET)
+#if defined(CONFIG_NET_MULTI)
+       WATCHDOG_RESET();
+       puts("Net:   ");
+#endif
+       eth_initialize(bd);
+#endif
+
+#if defined(CONFIG_CMD_NET) && defined(CONFIG_RESET_PHY_R)
+       WATCHDOG_RESET();
+       debug("Reset Ethernet PHY\n");
+       reset_phy();
+#endif
+
+#ifdef CONFIG_POST
+       post_run(NULL, POST_RAM | post_bootmode_get(0));
+#endif
+
+#if defined(CONFIG_CMD_IDE)
+       WATCHDOG_RESET();
+       puts("IDE:   ");
+       ide_init();
+#endif                         /* CFG_CMD_IDE */
+
+#ifdef CONFIG_LAST_STAGE_INIT
+       WATCHDOG_RESET();
+       /*
+        * Some parts can be only initialized if all others (like
+        * Interrupts) are up and running (i.e. the PC-style ISA
+        * keyboard).
+        */
+       last_stage_init();
+#endif
+
+#ifdef CONFIG_PS2KBD
+       puts("PS/2:  ");
+       kbd_init();
+#endif
+       prom_init();
+
+       /* main_loop */
+       for (;;) {
+               WATCHDOG_RESET();
+               main_loop();
+       }
+
+}
+
+void hang(void)
+{
+       puts("### ERROR ### Please RESET the board ###\n");
+#ifdef CONFIG_SHOW_BOOT_PROGRESS
+       show_boot_progress(-30);
+#endif
+       for (;;) ;
+}
+
+/************************************************************************/
diff --git a/lib_sparc/bootm.c b/lib_sparc/bootm.c
new file mode 100644 (file)
index 0000000..8900b2e
--- /dev/null
@@ -0,0 +1,226 @@
+/* SPARC code for booting linux 2.6
+ *
+ * (C) Copyright 2007
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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 <command.h>
+#include <asm/byteorder.h>
+#include <asm/prom.h>
+#include <asm/cache.h>
+
+#define PRINT_KERNEL_HEADER
+
+extern image_header_t header;
+extern void srmmu_init_cpu(unsigned int entry);
+extern void prepare_bootargs(char *bootargs);
+extern int do_reset(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]);
+
+#ifdef CONFIG_USB_UHCI
+extern int usb_lowlevel_stop(void);
+#endif
+
+/* sparc kernel argument (the ROM vector) */
+struct linux_romvec *kernel_arg_promvec;
+
+/* page szie is 4k */
+#define PAGE_SIZE 0x1000
+#define RAMDISK_IMAGE_START_MASK       0x07FF
+#define RAMDISK_PROMPT_FLAG            0x8000
+#define RAMDISK_LOAD_FLAG              0x4000
+struct __attribute__ ((packed)) {
+       char traptable[PAGE_SIZE];
+       char swapper_pg_dir[PAGE_SIZE];
+       char pg0[PAGE_SIZE];
+       char pg1[PAGE_SIZE];
+       char pg2[PAGE_SIZE];
+       char pg3[PAGE_SIZE];
+       char empty_bad_page[PAGE_SIZE];
+       char empty_bad_page_table[PAGE_SIZE];
+       char empty_zero_page[PAGE_SIZE];
+       unsigned char hdr[4];   /* ascii "HdrS" */
+       /* 00.02.06.0b is for Linux kernel 2.6.11 */
+       unsigned char linuxver_mega_major;
+       unsigned char linuxver_major;
+       unsigned char linuxver_minor;
+       unsigned char linuxver_revision;
+       /* header version 0x0203 */
+       unsigned short hdr_ver;
+       union __attribute__ ((packed)) {
+               struct __attribute__ ((packed)) {
+                       unsigned short root_flags;
+                       unsigned short root_dev;
+                       unsigned short ram_flags;
+                       unsigned int sparc_ramdisk_image;
+                       unsigned int sparc_ramdisk_size;
+                       unsigned int reboot_command;
+                       unsigned int resv[3];
+                       unsigned int end;
+               } ver_0203;
+       } hdr_input;
+} *linux_hdr;
+
+/* temporary initrd image holder */
+image_header_t ihdr;
+
+/* boot the linux kernel */
+void do_bootm_linux(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[],
+                   bootm_headers_t * images)
+{
+       char *bootargs;
+       ulong ep, load;
+       ulong initrd_start, initrd_end;
+       ulong rd_data_start, rd_data_end, rd_len;
+       unsigned int data, len, checksum;
+       unsigned int initrd_addr, kernend;
+       void (*kernel) (struct linux_romvec *, void *);
+       struct lmb *lmb = images->lmb;
+       int ret;
+
+       if (images->legacy_hdr_valid) {
+               ep = image_get_ep(images->legacy_hdr_os);
+               load = image_get_load(images->legacy_hdr_os);
+#if defined(CONFIG_FIT)
+       } else if (images->fit_uname_os) {
+               int ret = fit_image_get_entry(images->fit_hdr_os,
+                                             images->fit_noffset_os, &ep);
+               if (ret) {
+                       puts("Can't get entry point property!\n");
+                       goto error;
+               }
+
+               ret = fit_image_get_load(images->fit_hdr_os,
+                                        images->fit_noffset_os, &load);
+               if (ret) {
+                       puts("Can't get load address property!\n");
+                       goto error;
+               }
+#endif
+       } else {
+               puts("Could not find kernel entry point!\n");
+               goto error;
+       }
+
+       /* Get virtual address of kernel start */
+       linux_hdr = (void *)load;
+
+       /* */
+       kernel = (void (*)(struct linux_romvec *, void *))ep;
+
+       /* check for a SPARC kernel */
+       if ((linux_hdr->hdr[0] != 'H') ||
+           (linux_hdr->hdr[1] != 'd') ||
+           (linux_hdr->hdr[2] != 'r') || (linux_hdr->hdr[3] != 'S')) {
+               puts("Error reading header of SPARC Linux kernel, aborting\n");
+               goto error;
+       }
+#ifdef PRINT_KERNEL_HEADER
+       printf("## Found SPARC Linux kernel %d.%d.%d ...\n",
+              linux_hdr->linuxver_major,
+              linux_hdr->linuxver_minor, linux_hdr->linuxver_revision);
+#endif
+
+#ifdef CONFIG_USB_UHCI
+       usb_lowlevel_stop();
+#endif
+
+       /* set basic boot params in kernel header now that it has been
+        * extracted and is writeable.
+        */
+
+       /*
+        * Are we going to use an initrd image?
+        */
+       ret = boot_get_ramdisk(argc, argv, images, IH_ARCH_SPARC,
+                              &rd_data_start, &rd_data_end);
+       if (ret) {
+               /* RAM disk found but was corrupt */
+               puts("RAM Disk corrupt\n");
+               goto error;
+       }
+
+       /* Calc length of RAM disk, if zero no ramdisk available */
+       rd_len = rd_data_end - rd_data_start;
+
+       if (rd_len) {
+
+               /* Reserve the space used by PROM and stack. This is done
+                * to avoid that the RAM image is copied over stack or
+                * PROM.
+                */
+               lmb_reserve(lmb, CFG_RELOC_MONITOR_BASE, CFG_RAM_END);
+
+               ret = boot_ramdisk_high(lmb, rd_data_start, rd_len,
+                                       &initrd_start, &initrd_end);
+               if (ret) {
+                       puts("### Failed to relocate RAM disk\n");
+                       goto error;
+               }
+
+               /* Update SPARC kernel header so that Linux knows
+                * what is going on and where to find RAM disk.
+                *
+                * Set INITRD Image address relative to RAM Start
+                */
+               linux_hdr->hdr_input.ver_0203.sparc_ramdisk_image =
+                   initrd_start - CFG_RAM_BASE;
+               linux_hdr->hdr_input.ver_0203.sparc_ramdisk_size = rd_len;
+               /* Clear READ ONLY flag if set to non-zero */
+               linux_hdr->hdr_input.ver_0203.root_flags = 1;
+               /* Set root device to: Root_RAM0 */
+               linux_hdr->hdr_input.ver_0203.root_dev = 0x100;
+               linux_hdr->hdr_input.ver_0203.ram_flags = 0;
+       } else {
+               /* NOT using RAMDISK image, overwriting kernel defaults */
+               linux_hdr->hdr_input.ver_0203.sparc_ramdisk_image = 0;
+               linux_hdr->hdr_input.ver_0203.sparc_ramdisk_size = 0;
+               /* Leave to kernel defaults
+                  linux_hdr->hdr_input.ver_0203.root_flags = 1;
+                  linux_hdr->hdr_input.ver_0203.root_dev = 0;
+                  linux_hdr->hdr_input.ver_0203.ram_flags = 0;
+                */
+       }
+
+       /* Copy bootargs from bootargs variable to kernel readable area */
+       bootargs = getenv("bootargs");
+       prepare_bootargs(bootargs);
+
+       if (!images->autostart)
+               return;
+
+       /* turn on mmu & setup context table & page table for process 0 (kernel) */
+       srmmu_init_cpu((unsigned int)kernel);
+
+       /* Enter SPARC Linux kernel
+        * From now on the only code in u-boot that will be
+        * executed is the PROM code.
+        */
+       kernel(kernel_arg_promvec, (void *)ep);
+
+       /* It will never come to this... */
+       while (1) ;
+
+      error:
+       if (images->autostart)
+               do_reset(cmdtp, flag, argc, argv);
+       return;
+}
diff --git a/lib_sparc/cache.c b/lib_sparc/cache.c
new file mode 100644 (file)
index 0000000..59d9bbe
--- /dev/null
@@ -0,0 +1,33 @@
+/* Sparc cache library
+ *
+ * (C) Copyright 2007
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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/processor.h>
+
+void flush_cache(ulong start_addr, ulong size)
+{
+       /* Flush All Cache */
+       sparc_dcache_flush_all();
+       sparc_icache_flush_all();
+}
diff --git a/lib_sparc/interrupts.c b/lib_sparc/interrupts.c
new file mode 100644 (file)
index 0000000..4c73b82
--- /dev/null
@@ -0,0 +1,122 @@
+/*
+ * (C) Copyright 2000-2002
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * (C) Copyright 2003
+ * Gleb Natapov <gnatapov@mrv.com>
+ *
+ * (C) Copyright 2007
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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/processor.h>
+#include <asm/irq.h>
+
+/* Implemented by SPARC CPUs */
+extern int interrupt_init_cpu(void);
+extern void timer_interrupt_cpu(void *arg);
+extern int timer_interrupt_init_cpu(void);
+
+int intLock(void)
+{
+       unsigned int pil;
+
+       pil = get_pil();
+
+       /* set PIL to 15 ==> no pending interrupts will interrupt CPU */
+       set_pil(15);
+
+       return pil;
+}
+
+void intUnlock(int oldLevel)
+{
+       set_pil(oldLevel);
+}
+
+void enable_interrupts(void)
+{
+       set_pil(0);             /* enable all interrupts */
+}
+
+int disable_interrupts(void)
+{
+       return intLock();
+}
+
+int interrupt_init(void)
+{
+       int ret;
+
+       /* call cpu specific function from $(CPU)/interrupts.c */
+       ret = interrupt_init_cpu();
+
+       /* enable global interrupts */
+       enable_interrupts();
+
+       return ret;
+}
+
+/* timer interrupt/overflow counter */
+static volatile ulong timestamp = 0;
+
+/* regs can not be used here! regs is actually the pointer given in
+ * irq_install_handler
+ */
+void timer_interrupt(struct pt_regs *regs)
+{
+       /* call cpu specific function from $(CPU)/interrupts.c */
+       timer_interrupt_cpu((void *)regs);
+
+       timestamp++;
+}
+
+void reset_timer(void)
+{
+       timestamp = 0;
+}
+
+ulong get_timer(ulong base)
+{
+       return (timestamp - base);
+}
+
+void set_timer(ulong t)
+{
+       timestamp = t;
+}
+
+void timer_interrupt_init(void)
+{
+       int irq;
+
+       reset_timer();
+
+       irq = timer_interrupt_init_cpu();
+
+       if (irq < 0) {
+               /* cpu specific code handled the interrupt registration it self */
+               return;
+       }
+       /* register interrupt handler for timer */
+       irq_install_handler(irq, (void (*)(void *))timer_interrupt, NULL);
+}
diff --git a/lib_sparc/time.c b/lib_sparc/time.c
new file mode 100644 (file)
index 0000000..433f3eb
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * (C) Copyright 2000, 2001
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * (C) Copyright 2007
+ * Daniel Hellstrom, Gaisler Research, daniel@gaisler.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>
+
+/* Implemented by SPARC CPUs */
+extern void cpu_wait_ticks(unsigned long ticks);
+extern unsigned long cpu_usec2ticks(unsigned long usec);
+extern unsigned long cpu_ticks2usec(unsigned long ticks);
+
+/* ------------------------------------------------------------------------- */
+
+void wait_ticks(unsigned long ticks)
+{
+       cpu_wait_ticks(ticks);
+}
+
+/*
+ * This function is intended for SHORT delays only.
+ */
+unsigned long usec2ticks(unsigned long usec)
+{
+       return cpu_usec2ticks(usec);
+}
+
+/* ------------------------------------------------------------------------- */
+
+/*
+ * We implement the delay by converting the delay (the number of
+ * microseconds to wait) into a number of time base ticks; then we
+ * watch the time base until it has incremented by that amount.
+ */
+void udelay(unsigned long usec)
+{
+       ulong ticks = usec2ticks(usec);
+
+       wait_ticks(ticks);
+}
+
+/* ------------------------------------------------------------------------- */
+
+unsigned long ticks2usec(unsigned long ticks)
+{
+       return cpu_ticks2usec(ticks);
+}
+
+/* ------------------------------------------------------------------------- */
+
+int init_timebase(void)
+{
+
+       return (0);
+}
+
+/* ------------------------------------------------------------------------- */
index 586a361..cfa1989 100644 (file)
  */
 #include "libfdt_env.h"
 
+#ifndef USE_HOSTCC
 #include <fdt.h>
 #include <libfdt.h>
+#else
+#include "fdt_host.h"
+#endif
 
 #include "libfdt_internal.h"
 
@@ -129,6 +133,47 @@ uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset)
        return tag;
 }
 
+int fdt_next_node(const void *fdt, int offset, int *depth)
+{
+       int nextoffset = 0;
+       uint32_t tag;
+
+       if (offset >= 0) {
+               tag = fdt_next_tag(fdt, offset, &nextoffset);
+               if (tag != FDT_BEGIN_NODE)
+                       return -FDT_ERR_BADOFFSET;
+       }
+
+       do {
+               offset = nextoffset;
+               tag = fdt_next_tag(fdt, offset, &nextoffset);
+
+               switch (tag) {
+               case FDT_PROP:
+               case FDT_NOP:
+                       break;
+
+               case FDT_BEGIN_NODE:
+                       if (depth)
+                               (*depth)++;
+                       break;
+
+               case FDT_END_NODE:
+                       if (depth)
+                               (*depth)--;
+                       break;
+
+               case FDT_END:
+                       return -FDT_ERR_NOTFOUND;
+
+               default:
+                       return -FDT_ERR_BADSTRUCTURE;
+               }
+       } while (tag != FDT_BEGIN_NODE);
+
+       return offset;
+}
+
 const char *_fdt_find_string(const char *strtab, int tabsize, const char *s)
 {
        int len = strlen(s) + 1;
@@ -143,10 +188,7 @@ const char *_fdt_find_string(const char *strtab, int tabsize, const char *s)
 
 int fdt_move(const void *fdt, void *buf, int bufsize)
 {
-       int err = fdt_check_header(fdt);
-
-       if (err)
-               return err;
+       CHECK_HEADER(fdt);
 
        if (fdt_totalsize(fdt) > bufsize)
                return -FDT_ERR_NOSPACE;
index 12a37d5..11d80d2 100644 (file)
  */
 #include "libfdt_env.h"
 
+#ifndef USE_HOSTCC
 #include <fdt.h>
 #include <libfdt.h>
+#else
+#include "fdt_host.h"
+#endif
 
 #include "libfdt_internal.h"
 
-#define CHECK_HEADER(fdt) \
-       { \
-               int err; \
-               if ((err = fdt_check_header(fdt)) != 0) \
-                       return err; \
-       }
-
 static int nodename_eq(const void *fdt, int offset,
                       const char *s, int len)
 {
-       const char *p = fdt_offset_ptr(fdt, offset, len+1);
+       const char *p = fdt_offset_ptr(fdt, offset + FDT_TAGSIZE, len+1);
 
        if (! p)
                /* short match */
@@ -104,50 +101,24 @@ int fdt_num_mem_rsv(const void *fdt)
        return i;
 }
 
-int fdt_subnode_offset_namelen(const void *fdt, int parentoffset,
+int fdt_subnode_offset_namelen(const void *fdt, int offset,
                               const char *name, int namelen)
 {
-       int level = 0;
-       uint32_t tag;
-       int offset, nextoffset;
+       int depth;
 
        CHECK_HEADER(fdt);
 
-       tag = fdt_next_tag(fdt, parentoffset, &nextoffset);
-       if (tag != FDT_BEGIN_NODE)
-               return -FDT_ERR_BADOFFSET;
-
-       do {
-               offset = nextoffset;
-               tag = fdt_next_tag(fdt, offset, &nextoffset);
-
-               switch (tag) {
-               case FDT_END:
-                       return -FDT_ERR_TRUNCATED;
-
-               case FDT_BEGIN_NODE:
-                       level++;
-                       if (level != 1)
-                               continue;
-                       if (nodename_eq(fdt, offset+FDT_TAGSIZE, name, namelen))
-                               /* Found it! */
-                               return offset;
-                       break;
-
-               case FDT_END_NODE:
-                       level--;
-                       break;
-
-               case FDT_PROP:
-               case FDT_NOP:
-                       break;
-
-               default:
-                       return -FDT_ERR_BADSTRUCTURE;
-               }
-       } while (level >= 0);
+       for (depth = 0;
+            offset >= 0;
+            offset = fdt_next_node(fdt, offset, &depth)) {
+               if (depth < 0)
+                       return -FDT_ERR_NOTFOUND;
+               else if ((depth == 1)
+                        && nodename_eq(fdt, offset, name, namelen))
+                       return offset;
+       }
 
-       return -FDT_ERR_NOTFOUND;
+       return offset; /* error */
 }
 
 int fdt_subnode_offset(const void *fdt, int parentoffset,
@@ -307,76 +278,61 @@ uint32_t fdt_get_phandle(const void *fdt, int nodeoffset)
 
 int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen)
 {
-       uint32_t tag;
-       int p = 0, overflow = 0;
-       int offset, nextoffset, namelen;
+       int pdepth = 0, p = 0;
+       int offset, depth, namelen;
        const char *name;
 
        CHECK_HEADER(fdt);
 
-       tag = fdt_next_tag(fdt, 0, &nextoffset);
-       if (tag != FDT_BEGIN_NODE)
-               return -FDT_ERR_BADSTRUCTURE;
-
        if (buflen < 2)
                return -FDT_ERR_NOSPACE;
-       buf[0] = '/';
-       p = 1;
 
-       while (nextoffset <= nodeoffset) {
-               offset = nextoffset;
-               tag = fdt_next_tag(fdt, offset, &nextoffset);
-               switch (tag) {
-               case FDT_END:
-                       return -FDT_ERR_BADOFFSET;
+       for (offset = 0, depth = 0;
+            (offset >= 0) && (offset <= nodeoffset);
+            offset = fdt_next_node(fdt, offset, &depth)) {
+               if (pdepth < depth)
+                       continue; /* overflowed buffer */
 
-               case FDT_BEGIN_NODE:
-                       name = fdt_get_name(fdt, offset, &namelen);
-                       if (!name)
-                               return namelen;
-                       if (overflow || ((p + namelen + 1) > buflen)) {
-                               overflow++;
-                               break;
-                       }
+               while (pdepth > depth) {
+                       do {
+                               p--;
+                       } while (buf[p-1] != '/');
+                       pdepth--;
+               }
+
+               name = fdt_get_name(fdt, offset, &namelen);
+               if (!name)
+                       return namelen;
+               if ((p + namelen + 1) <= buflen) {
                        memcpy(buf + p, name, namelen);
                        p += namelen;
                        buf[p++] = '/';
-                       break;
-
-               case FDT_END_NODE:
-                       if (overflow) {
-                               overflow--;
-                               break;
-                       }
-                       do {
-                               p--;
-                       } while  (buf[p-1] != '/');
-                       break;
+                       pdepth++;
+               }
 
-               case FDT_PROP:
-               case FDT_NOP:
-                       break;
+               if (offset == nodeoffset) {
+                       if (pdepth < (depth + 1))
+                               return -FDT_ERR_NOSPACE;
 
-               default:
-                       return -FDT_ERR_BADSTRUCTURE;
+                       if (p > 1) /* special case so that root path is "/", not "" */
+                               p--;
+                       buf[p] = '\0';
+                       return p;
                }
        }
 
-       if (overflow)
-               return -FDT_ERR_NOSPACE;
+       if ((offset == -FDT_ERR_NOTFOUND) || (offset >= 0))
+               return -FDT_ERR_BADOFFSET;
+       else if (offset == -FDT_ERR_BADOFFSET)
+               return -FDT_ERR_BADSTRUCTURE;
 
-       if (p > 1) /* special case so that root path is "/", not "" */
-               p--;
-       buf[p] = '\0';
-       return p;
+       return offset; /* error from fdt_next_node() */
 }
 
 int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset,
                                 int supernodedepth, int *nodedepth)
 {
-       int level = -1;
-       uint32_t tag;
-       int offset, nextoffset = 0;
+       int offset, depth;
        int supernodeoffset = -FDT_ERR_INTERNAL;
 
        CHECK_HEADER(fdt);
@@ -384,38 +340,29 @@ int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset,
        if (supernodedepth < 0)
                return -FDT_ERR_NOTFOUND;
 
-       do {
-               offset = nextoffset;
-               tag = fdt_next_tag(fdt, offset, &nextoffset);
-               switch (tag) {
-               case FDT_END:
-                       return -FDT_ERR_BADOFFSET;
-
-               case FDT_BEGIN_NODE:
-                       level++;
-                       if (level == supernodedepth)
-                               supernodeoffset = offset;
-                       break;
-
-               case FDT_END_NODE:
-                       level--;
-                       break;
+       for (offset = 0, depth = 0;
+            (offset >= 0) && (offset <= nodeoffset);
+            offset = fdt_next_node(fdt, offset, &depth)) {
+               if (depth == supernodedepth)
+                       supernodeoffset = offset;
 
-               case FDT_PROP:
-               case FDT_NOP:
-                       break;
+               if (offset == nodeoffset) {
+                       if (nodedepth)
+                               *nodedepth = depth;
 
-               default:
-                       return -FDT_ERR_BADSTRUCTURE;
+                       if (supernodedepth > depth)
+                               return -FDT_ERR_NOTFOUND;
+                       else
+                               return supernodeoffset;
                }
-       } while (offset < nodeoffset);
+       }
 
-       if (nodedepth)
-               *nodedepth = level;
+       if ((offset == -FDT_ERR_NOTFOUND) || (offset >= 0))
+               return -FDT_ERR_BADOFFSET;
+       else if (offset == -FDT_ERR_BADOFFSET)
+               return -FDT_ERR_BADSTRUCTURE;
 
-       if (supernodedepth > level)
-               return -FDT_ERR_NOTFOUND;
-       return supernodeoffset;
+       return offset; /* error from fdt_next_node() */
 }
 
 int fdt_node_depth(const void *fdt, int nodeoffset)
@@ -443,51 +390,27 @@ int fdt_node_offset_by_prop_value(const void *fdt, int startoffset,
                                  const char *propname,
                                  const void *propval, int proplen)
 {
-       uint32_t tag;
-       int offset, nextoffset;
+       int offset;
        const void *val;
        int len;
 
        CHECK_HEADER(fdt);
 
-       if (startoffset >= 0) {
-               tag = fdt_next_tag(fdt, startoffset, &nextoffset);
-               if (tag != FDT_BEGIN_NODE)
-                       return -FDT_ERR_BADOFFSET;
-       } else {
-               nextoffset = 0;
-       }
-
        /* FIXME: The algorithm here is pretty horrible: we scan each
         * property of a node in fdt_getprop(), then if that didn't
         * find what we want, we scan over them again making our way
         * to the next node.  Still it's the easiest to implement
         * approach; performance can come later. */
-       do {
-               offset = nextoffset;
-               tag = fdt_next_tag(fdt, offset, &nextoffset);
-
-               switch (tag) {
-               case FDT_BEGIN_NODE:
-                       val = fdt_getprop(fdt, offset, propname, &len);
-                       if (val
-                           && (len == proplen)
-                           && (memcmp(val, propval, len) == 0))
-                               return offset;
-                       break;
-
-               case FDT_PROP:
-               case FDT_END:
-               case FDT_END_NODE:
-               case FDT_NOP:
-                       break;
-
-               default:
-                       return -FDT_ERR_BADSTRUCTURE;
-               }
-       } while (tag != FDT_END);
+       for (offset = fdt_next_node(fdt, startoffset, NULL);
+            offset >= 0;
+            offset = fdt_next_node(fdt, offset, NULL)) {
+               val = fdt_getprop(fdt, offset, propname, &len);
+               if (val && (len == proplen)
+                   && (memcmp(val, propval, len) == 0))
+                       return offset;
+       }
 
-       return -FDT_ERR_NOTFOUND;
+       return offset; /* error from fdt_next_node() */
 }
 
 int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle)
@@ -534,50 +457,24 @@ int fdt_node_check_compatible(const void *fdt, int nodeoffset,
 int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
                                  const char *compatible)
 {
-       uint32_t tag;
-       int offset, nextoffset;
-       int err;
+       int offset, err;
 
        CHECK_HEADER(fdt);
 
-       if (startoffset >= 0) {
-               tag = fdt_next_tag(fdt, startoffset, &nextoffset);
-               if (tag != FDT_BEGIN_NODE)
-                       return -FDT_ERR_BADOFFSET;
-       } else {
-               nextoffset = 0;
-       }
-
        /* FIXME: The algorithm here is pretty horrible: we scan each
         * property of a node in fdt_node_check_compatible(), then if
         * that didn't find what we want, we scan over them again
         * making our way to the next node.  Still it's the easiest to
         * implement approach; performance can come later. */
-       do {
-               offset = nextoffset;
-               tag = fdt_next_tag(fdt, offset, &nextoffset);
-
-               switch (tag) {
-               case FDT_BEGIN_NODE:
-                       err = fdt_node_check_compatible(fdt, offset,
-                                                       compatible);
-                       if ((err < 0)
-                           && (err != -FDT_ERR_NOTFOUND))
-                               return err;
-                       else if (err == 0)
-                               return offset;
-                       break;
-
-               case FDT_PROP:
-               case FDT_END:
-               case FDT_END_NODE:
-               case FDT_NOP:
-                       break;
-
-               default:
-                       return -FDT_ERR_BADSTRUCTURE;
-               }
-       } while (tag != FDT_END);
+       for (offset = fdt_next_node(fdt, startoffset, NULL);
+            offset >= 0;
+            offset = fdt_next_node(fdt, offset, NULL)) {
+               err = fdt_node_check_compatible(fdt, offset, compatible);
+               if ((err < 0) && (err != -FDT_ERR_NOTFOUND))
+                       return err;
+               else if (err == 0)
+                       return offset;
+       }
 
-       return -FDT_ERR_NOTFOUND;
+       return offset; /* error from fdt_next_node() */
 }
index 6673f8e..8609fa7 100644 (file)
  */
 #include "libfdt_env.h"
 
+#ifndef USE_HOSTCC
 #include <fdt.h>
 #include <libfdt.h>
+#else
+#include "fdt_host.h"
+#endif
 
 #include "libfdt_internal.h"
 
@@ -69,10 +73,8 @@ static int _blocks_misordered(const void *fdt,
 
 static int rw_check_header(void *fdt)
 {
-       int err;
+       CHECK_HEADER(fdt);
 
-       if ((err = fdt_check_header(fdt)))
-               return err;
        if (fdt_version(fdt) < 17)
                return -FDT_ERR_BADVERSION;
        if (_blocks_misordered(fdt, sizeof(struct fdt_reserve_entry),
@@ -252,6 +254,30 @@ static int _add_property(void *fdt, int nodeoffset, const char *name, int len,
        return 0;
 }
 
+int fdt_set_name(void *fdt, int nodeoffset, const char *name)
+{
+       char *namep;
+       int oldlen, newlen;
+       int err;
+
+       if ((err = rw_check_header(fdt)))
+               return err;
+
+       namep = (char *)fdt_get_name(fdt, nodeoffset, &oldlen);
+       if (!namep)
+               return oldlen;
+
+       newlen = strlen(name);
+
+       err = _blob_splice_struct(fdt, namep, ALIGN(oldlen+1, FDT_TAGSIZE),
+                                 ALIGN(newlen+1, FDT_TAGSIZE));
+       if (err)
+               return err;
+
+       memcpy(namep, name, newlen+1);
+       return 0;
+}
+
 int fdt_setprop(void *fdt, int nodeoffset, const char *name,
                const void *val, int len)
 {
@@ -309,7 +335,7 @@ int fdt_add_subnode_namelen(void *fdt, int parentoffset,
        do {
                offset = nextoffset;
                tag = fdt_next_tag(fdt, offset, &nextoffset);
-       } while (tag == FDT_PROP);
+       } while ((tag == FDT_PROP) || (tag == FDT_NOP));
 
        nh = _fdt_offset_ptr_w(fdt, offset);
        nodelen = sizeof(*nh) + ALIGN(namelen+1, FDT_TAGSIZE) + FDT_TAGSIZE;
@@ -375,9 +401,7 @@ int fdt_open_into(const void *fdt, void *buf, int bufsize)
        int newsize;
        void *tmp;
 
-       err = fdt_check_header(fdt);
-       if (err)
-               return err;
+       CHECK_HEADER(fdt);
 
        mem_rsv_size = (fdt_num_mem_rsv(fdt)+1)
                * sizeof(struct fdt_reserve_entry);
index f9d32ef..abf792e 100644 (file)
  */
 #include "libfdt_env.h"
 
+#ifndef USE_HOSTCC
 #include <fdt.h>
 #include <libfdt.h>
+#else
+#include "fdt_host.h"
+#endif
 
 #include "libfdt_internal.h"
 
index 88e24b8..24e1724 100644 (file)
  */
 #include "libfdt_env.h"
 
+#ifndef USE_HOSTCC
 #include <fdt.h>
 #include <libfdt.h>
+#else
+#include "fdt_host.h"
+#endif
 
 #include "libfdt_internal.h"
 
index 1e60936..52e1b8d 100644 (file)
 #define memeq(p, q, n) (memcmp((p), (q), (n)) == 0)
 #define streq(p, q)    (strcmp((p), (q)) == 0)
 
+#define CHECK_HEADER(fdt) \
+       { \
+               int err; \
+               if ((err = fdt_check_header(fdt)) != 0) \
+                       return err; \
+       }
+
 uint32_t _fdt_next_tag(const void *fdt, int startoffset, int *nextoffset);
 const char *_fdt_find_string(const char *strtab, int tabsize, const char *s);
 int _fdt_node_end_offset(void *fdt, int nodeoffset);
index 06ddefa..e44c79e 100644 (file)
@@ -1,6 +1,8 @@
 #
-# (C) Copyright 2004 Atmark Techno, Inc.
+# (C) Copyright 2007-2008 Michal Simek
+# Michal SIMEK <monstr@monstr.eu>
 #
+# (C) Copyright 2004 Atmark Techno, Inc.
 # Yasushi SHOJI <yashi@atmark-techno.com>
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 PLATFORM_CPPFLAGS += -ffixed-r31 -D__microblaze__
-
-ifdef CONFIG_MICROBLAZE_HARD_MULT
-PLATFORM_CPPFLAGS += -mno-xl-soft-mul
-endif
-
-ifdef CONFIG_MICROBLAZE_HARD_DIV
-PLATFORM_CPPFLAGS += -mno-xl-soft-div
-endif
-
-ifdef CONFIG_MICROBLAZE_HARD_BARREL
-PLATFORM_CPPFLAGS += -mxl-barrel-shift
-endif
index 6dad876..c8d7c23 100644 (file)
@@ -34,9 +34,9 @@
 #
 TEXT_BASE = 0xE3003000
 
-# PAD_TO used to generate a 16kByte binary needed for the combined image
-# -> PAD_TO = TEXT_BASE + 0x4000
-PAD_TO = 0xE3007000
+# PAD_TO used to generate a 128kByte binary needed for the combined image
+# -> PAD_TO = TEXT_BASE + 0x20000
+PAD_TO = 0xE3023000
 
 PLATFORM_CPPFLAGS += -DCONFIG_440=1
 
index 48708a8..79f3b0f 100644 (file)
@@ -49,11 +49,11 @@ long int initdram(int board_type)
         * enabled. This will only work for the same memory
         * configuration as used here:
         *
-        * Crucial CT3264AC53E.4FD - 256MB SO-DIMM
+        * Crucial CT6464AC53E.4FE - 512MB SO-DIMM
         *
         */
        mtsdram(SDRAM_MCOPT2, 0x00000000);
-       mtsdram(SDRAM_MCOPT1, 0x05122000);
+       mtsdram(SDRAM_MCOPT1, 0x05322000);
        mtsdram(SDRAM_MODT0, 0x01000000);
        mtsdram(SDRAM_CODT, 0x00800021);
        mtsdram(SDRAM_WRDTR, 0x82000823);
@@ -62,7 +62,7 @@ long int initdram(int board_type)
        mtsdram(SDRAM_RTR, 0x06180000);
        mtsdram(SDRAM_SDTR1, 0x80201000);
        mtsdram(SDRAM_SDTR2, 0x42103243);
-       mtsdram(SDRAM_SDTR3, 0x0A0D0D16);
+       mtsdram(SDRAM_SDTR3, 0x0A0D0D1A);
        mtsdram(SDRAM_MMODE, 0x00000632);
        mtsdram(SDRAM_MEMODE, 0x00000040);
        mtsdram(SDRAM_INITPLR0, 0xB5380000);
@@ -86,7 +86,7 @@ long int initdram(int board_type)
 
        wait_init_complete();
 
-       mtdcr(SDRAM_R0BAS, 0x0000F800);         /* MQ0_B0BAS */
+       mtdcr(SDRAM_R0BAS, 0x0000F000);         /* MQ0_B0BAS */
 
        mtsdram(SDRAM_RDCC, 0x40000000);
        mtsdram(SDRAM_RQDC, 0x80000038);
index e2147cb..bc57725 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2006-2007
+ * (C) Copyright 2006-2008
  * Stefan Roese, DENX Software Engineering, sr@denx.de.
  *
  * This program is free software; you can redistribute it and/or
@@ -28,6 +28,10 @@ static int nand_ecc_pos[] = CFG_NAND_ECCPOS;
 
 extern void board_nand_init(struct nand_chip *nand);
 
+#if (CFG_NAND_PAGE_SIZE <= 512)
+/*
+ * NAND command for small page NAND devices (512)
+ */
 static int nand_command(struct mtd_info *mtd, int block, int page, int offs, u8 cmd)
 {
        struct nand_chip *this = mtd->priv;
@@ -65,6 +69,64 @@ static int nand_command(struct mtd_info *mtd, int block, int page, int offs, u8
 
        return 0;
 }
+#else
+/*
+ * NAND command for large page NAND devices (2k)
+ */
+static int nand_command(struct mtd_info *mtd, int block, int page, int offs, u8 cmd)
+{
+       struct nand_chip *this = mtd->priv;
+       int page_offs = offs;
+       int page_addr = page + block * CFG_NAND_PAGE_COUNT;
+
+       if (this->dev_ready)
+               this->dev_ready(mtd);
+       else
+               CFG_NAND_READ_DELAY;
+
+       /* Emulate NAND_CMD_READOOB */
+       if (cmd == NAND_CMD_READOOB) {
+               page_offs += CFG_NAND_PAGE_SIZE;
+               cmd = NAND_CMD_READ0;
+       }
+
+       /* Begin command latch cycle */
+       this->hwcontrol(mtd, NAND_CTL_SETCLE);
+       this->write_byte(mtd, cmd);
+       /* Set ALE and clear CLE to start address cycle */
+       this->hwcontrol(mtd, NAND_CTL_CLRCLE);
+       this->hwcontrol(mtd, NAND_CTL_SETALE);
+       /* Column address */
+       this->write_byte(mtd, page_offs & 0xff);                        /* A[7:0] */
+       this->write_byte(mtd, (uchar)((page_offs >> 8) & 0xff));        /* A[11:9] */
+       /* Row address */
+       this->write_byte(mtd, (uchar)(page_addr & 0xff));               /* A[19:12] */
+       this->write_byte(mtd, (uchar)((page_addr >> 8) & 0xff));        /* A[27:20] */
+#ifdef CFG_NAND_5_ADDR_CYCLE
+       /* One more address cycle for devices > 128MiB */
+       this->write_byte(mtd, (uchar)((page_addr >> 16) & 0x0f));       /* A[xx:28] */
+#endif
+       /* Latch in address */
+       this->hwcontrol(mtd, NAND_CTL_CLRALE);
+
+       /* Begin command latch cycle */
+       this->hwcontrol(mtd, NAND_CTL_SETCLE);
+       /* Write out the start read command */
+       this->write_byte(mtd, NAND_CMD_READSTART);
+       /* End command latch cycle */
+       this->hwcontrol(mtd, NAND_CTL_CLRCLE);
+
+       /*
+        * Wait a while for the data to be ready
+        */
+       if (this->dev_ready)
+               this->dev_ready(mtd);
+       else
+               CFG_NAND_READ_DELAY;
+
+       return 0;
+}
+#endif
 
 static int nand_is_bad_block(struct mtd_info *mtd, int block)
 {
index 89e30d2..3c0614c 100644 (file)
@@ -163,21 +163,21 @@ static void BootpVendorFieldProcess (u8 * ext)
 
        switch (*ext) {
                /* Fixed length fields */
-       case 1:                 /* Subnet mask                                  */
+       case 1:                 /* Subnet mask                                  */
                if (NetOurSubnetMask == 0)
                        NetCopyIP (&NetOurSubnetMask, (IPaddr_t *) (ext + 2));
                break;
-       case 2:                 /* Time offset - Not yet supported              */
+       case 2:                 /* Time offset - Not yet supported              */
                break;
                /* Variable length fields */
-       case 3:                 /* Gateways list                                */
+       case 3:                 /* Gateways list                                */
                if (NetOurGatewayIP == 0) {
                        NetCopyIP (&NetOurGatewayIP, (IPaddr_t *) (ext + 2));
                }
                break;
-       case 4:                 /* Time server - Not yet supported              */
+       case 4:                 /* Time server - Not yet supported              */
                break;
-       case 5:                 /* IEN-116 name server - Not yet supported      */
+       case 5:                 /* IEN-116 name server - Not yet supported      */
                break;
        case 6:
                if (NetOurDNSIP == 0) {
@@ -189,43 +189,43 @@ static void BootpVendorFieldProcess (u8 * ext)
                }
 #endif
                break;
-       case 7:                 /* Log server - Not yet supported               */
+       case 7:                 /* Log server - Not yet supported               */
                break;
-       case 8:                 /* Cookie/Quote server - Not yet supported      */
+       case 8:                 /* Cookie/Quote server - Not yet supported      */
                break;
-       case 9:                 /* LPR server - Not yet supported               */
+       case 9:                 /* LPR server - Not yet supported               */
                break;
-       case 10:                /* Impress server - Not yet supported           */
+       case 10:                /* Impress server - Not yet supported           */
                break;
-       case 11:                /* RPL server - Not yet supported               */
+       case 11:                /* RPL server - Not yet supported               */
                break;
-       case 12:                /* Host name                                    */
+       case 12:                /* Host name                                    */
                if (NetOurHostName[0] == 0) {
                        size = truncate_sz ("Host Name", sizeof (NetOurHostName), size);
                        memcpy (&NetOurHostName, ext + 2, size);
                        NetOurHostName[size] = 0;
                }
                break;
-       case 13:                /* Boot file size                               */
+       case 13:                /* Boot file size                               */
                if (size == 2)
                        NetBootFileSize = ntohs (*(ushort *) (ext + 2));
                else if (size == 4)
                        NetBootFileSize = ntohl (*(ulong *) (ext + 2));
                break;
-       case 14:                /* Merit dump file - Not yet supported          */
+       case 14:                /* Merit dump file - Not yet supported          */
                break;
-       case 15:                /* Domain name - Not yet supported              */
+       case 15:                /* Domain name - Not yet supported              */
                break;
-       case 16:                /* Swap server - Not yet supported              */
+       case 16:                /* Swap server - Not yet supported              */
                break;
-       case 17:                /* Root path                                    */
+       case 17:                /* Root path                                    */
                if (NetOurRootPath[0] == 0) {
                        size = truncate_sz ("Root Path", sizeof (NetOurRootPath), size);
                        memcpy (&NetOurRootPath, ext + 2, size);
                        NetOurRootPath[size] = 0;
                }
                break;
-       case 18:                /* Extension path - Not yet supported           */
+       case 18:                /* Extension path - Not yet supported           */
                /*
                 * This can be used to send the information of the
                 * vendor area in another file that the client can
@@ -233,7 +233,7 @@ static void BootpVendorFieldProcess (u8 * ext)
                 */
                break;
                /* IP host layer fields */
-       case 40:                /* NIS Domain name                              */
+       case 40:                /* NIS Domain name                              */
                if (NetOurNISDomain[0] == 0) {
                        size = truncate_sz ("NIS Domain Name", sizeof (NetOurNISDomain), size);
                        memcpy (&NetOurNISDomain, ext + 2, size);
@@ -241,7 +241,7 @@ static void BootpVendorFieldProcess (u8 * ext)
                }
                break;
                /* Application layer fields */
-       case 43:                /* Vendor specific info - Not yet supported     */
+       case 43:                /* Vendor specific info - Not yet supported     */
                /*
                 * Binary information to exchange specific
                 * product information.
@@ -880,6 +880,9 @@ static void DhcpSendRequestPkt(Bootp_t *bp_offer)
        NetSetIP(iphdr, 0xFFFFFFFFL, PORT_BOOTPS, PORT_BOOTPC, iplen);
 
        debug ("Transmitting DHCPREQUEST packet: len = %d\n", pktlen);
+#ifdef CONFIG_BOOTP_DHCP_REQUEST_DELAY
+       udelay(CONFIG_BOOTP_DHCP_REQUEST_DELAY);
+#endif /* CONFIG_BOOTP_DHCP_REQUEST_DELAY */
        NetSendPacket(NetTxPacket, pktlen);
 }
 
index 16a6dcb..c4f24c6 100644 (file)
--- a/net/eth.c
+++ b/net/eth.c
@@ -60,10 +60,11 @@ extern int npe_initialize(bd_t *);
 extern int uec_initialize(int);
 extern int bfin_EMAC_initialize(bd_t *);
 extern int atstk1000_eth_initialize(bd_t *);
+extern int greth_initialize(bd_t *);
 extern int atngw100_eth_initialize(bd_t *);
 extern int mcffec_initialize(bd_t*);
 extern int mcdmafec_initialize(bd_t*);
-extern int at91cap9_eth_initialize(bd_t *);
+extern int at91sam9_eth_initialize(bd_t *);
 
 #ifdef CONFIG_API
 extern void (*push_packet)(volatile void *, int);
@@ -275,6 +276,9 @@ int eth_initialize(bd_t *bis)
 #if defined(CONFIG_ATSTK1000)
        atstk1000_eth_initialize(bis);
 #endif
+#if defined(CONFIG_GRETH)
+       greth_initialize(bis);
+#endif
 #if defined(CONFIG_ATNGW100)
        atngw100_eth_initialize(bis);
 #endif
@@ -284,8 +288,8 @@ int eth_initialize(bd_t *bis)
 #if defined(CONFIG_FSLDMAFEC)
        mcdmafec_initialize(bis);
 #endif
-#if defined(CONFIG_AT91CAP9)
-       at91cap9_eth_initialize(bis);
+#if defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260)
+       at91sam9_eth_initialize(bis);
 #endif
 
        if (!eth_devices) {
index 66a0959..f10ed02 100644 (file)
@@ -9,7 +9,7 @@ AFLAGS  += -DCONFIG_ONENAND_IPL
 CFLAGS += -DCONFIG_ONENAND_IPL
 OBJCLFAGS += --gap-fill=0x00
 
-SOBJS  = start.o low_levelinit.o # _memcpy32.o
+SOBJS  = start.o low_levelinit.o
 COBJS  = apollon.o onenand_read.o onenand_boot.o
 
 SRCS   := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
@@ -19,13 +19,16 @@ LNDIR       := $(OBJTREE)/onenand_ipl/board/$(BOARDDIR)
 
 onenandobj     := $(OBJTREE)/onenand_ipl/
 
-ALL    = $(onenandobj)onenand-ipl $(onenandobj)onenand-ipl.bin $(onenandobj)onenand-ipl-2k.bin
+ALL    = $(onenandobj)onenand-ipl $(onenandobj)onenand-ipl.bin $(onenandobj)onenand-ipl-2k.bin $(onenandobj)onenand-ipl-4k.bin
 
 all:   $(obj).depend $(ALL)
 
 $(onenandobj)onenand-ipl-2k.bin:       $(onenandobj)onenand-ipl
        $(OBJCOPY) ${OBJCFLAGS} --pad-to=0x800 -O binary $< $@
 
+$(onenandobj)onenand-ipl-4k.bin:       $(onenandobj)onenand-ipl
+       $(OBJCOPY) ${OBJCFLAGS} --pad-to=0x1000 -O binary $< $@
+
 $(onenandobj)onenand-ipl.bin:  $(onenandobj)onenand-ipl
        $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
 
index f30deae..35668ac 100644 (file)
@@ -60,7 +60,7 @@ void start_oneboot(void)
 
        buf = (uchar *) CFG_LOAD_ADDR;
 
-       if (!onenand_read_block(buf, ONENAND_START_BLOCK))
+       if (!onenand_read_block0(buf))
                buf += ONENAND_BLOCK_SIZE;
 
        if (buf == (uchar *)CFG_LOAD_ADDR)
index b9c6669..9188b96 100644 (file)
@@ -23,7 +23,6 @@
 
 #include <linux/mtd/onenand_regs.h>
 
-#define ONENAND_START_BLOCK             0
 #define ONENAND_BLOCK_SIZE              2048
 
 #ifndef CFG_PRINTF
@@ -40,5 +39,5 @@
 
 #define ONENAND_PAGE_SIZE                       2048
 
-extern int onenand_read_block(unsigned char *buf, ulong block);
+extern int onenand_read_block0(unsigned char *buf);
 #endif
index f553220..669b1ef 100644 (file)
 #define onenand_buffer_address()               ((1 << 3) << 8)
 #define onenand_bufferram_address(block)       (0)
 
+#ifdef __HAVE_ARCH_MEMCPY32
+extern void *memcpy32(void *dest, void *src, int size);
+#endif
+
 /* read a page with ECC */
-static inline int onenand_read_page(ulong block, ulong page, u_char *buf)
+static inline int onenand_read_page(ulong block, ulong page,
+                               u_char * buf, int pagesize)
 {
        unsigned long *base;
 
@@ -46,15 +51,15 @@ static inline int onenand_read_page(ulong block, ulong page, u_char *buf)
        onenand_writew(onenand_block_address(block),
                THIS_ONENAND(ONENAND_REG_START_ADDRESS1));
 
+       onenand_writew(onenand_bufferram_address(block),
+               THIS_ONENAND(ONENAND_REG_START_ADDRESS2));
+
        onenand_writew(onenand_sector_address(page),
                THIS_ONENAND(ONENAND_REG_START_ADDRESS8));
 
        onenand_writew(onenand_buffer_address(),
                THIS_ONENAND(ONENAND_REG_START_BUFFER));
 
-       onenand_writew(onenand_bufferram_address(block),
-               THIS_ONENAND(ONENAND_REG_START_ADDRESS2));
-
        onenand_writew(ONENAND_INT_CLEAR, THIS_ONENAND(ONENAND_REG_INTERRUPT));
 
        onenand_writew(ONENAND_CMD_READ, THIS_ONENAND(ONENAND_REG_COMMAND));
@@ -69,9 +74,9 @@ static inline int onenand_read_page(ulong block, ulong page, u_char *buf)
 
 #ifdef __HAVE_ARCH_MEMCPY32
        /* 32 bytes boundary memory copy */
-       memcpy32(buf, base, ONENAND_PAGE_SIZE);
+       memcpy32(buf, base, pagesize);
 #else
-       for (offset = 0; offset < (ONENAND_PAGE_SIZE >> 2); offset++) {
+       for (offset = 0; offset < (pagesize >> 2); offset++) {
                value = *(base + offset);
                *p++ = value;
        }
@@ -87,18 +92,22 @@ static inline int onenand_read_page(ulong block, ulong page, u_char *buf)
  * onenand_read_block - Read a block data to buf
  * @return 0 on success
  */
-int onenand_read_block(unsigned char *buf, ulong block)
+int onenand_read_block0(unsigned char *buf)
 {
        int page, offset = 0;
+       int pagesize = ONENAND_PAGE_SIZE;
+
+       /* MLC OneNAND has 4KiB page size */
+       if (onenand_readw(THIS_ONENAND(ONENAND_REG_TECHNOLOGY)))
+               pagesize <<= 1;
 
        /* NOTE: you must read page from page 1 of block 0 */
        /* read the block page by page*/
        for (page = ONENAND_START_PAGE;
            page < ONENAND_PAGES_PER_BLOCK; page++) {
 
-               onenand_read_page(block, page, buf + offset);
-
-               offset += ONENAND_PAGE_SIZE;
+               onenand_read_page(0, page, buf + offset, pagesize);
+               offset += pagesize;
        }
 
        return 0;
index 699266b..16c01be 100644 (file)
@@ -124,5 +124,4 @@ int lwmon5_watchdog_post_test(int flags)
        return -1;
 }
 
-
 #endif /* CONFIG_POST & CFG_POST_WATCHDOG */
index 4afe8e6..66e5265 100644 (file)
@@ -28,6 +28,8 @@
  *
  * The Real Time Clock (RTC) operation is verified by this test.
  * The following features are verified:
+ *   o) RTC Power Fault
+ *     This is verified by analyzing the rtc_get() return status.
  *   o) Time uniformity
  *      This is verified by reading RTC in polling within
  *      a short period of time.
@@ -94,6 +96,10 @@ int rtc_post_test (int flags)
        unsigned int ynl = 1999;
        unsigned int yl = 2000;
        unsigned int skipped = 0;
+       int reliable;
+
+       /* Time reliability */
+       reliable = rtc_get (&svtm);
 
        /* Time uniformity */
        if (rtc_post_skip (&diff) != 0) {
@@ -174,6 +180,15 @@ int rtc_post_test (int flags)
        }
        rtc_post_restore (&svtm, skipped);
 
+       /* If come here, then RTC operates correcty, check the correctness
+        * of the time it reports.
+        */
+       if (reliable < 0) {
+               post_log ("RTC Time is not reliable! Power fault? \n");
+
+               return -1;
+       }
+
        return 0;
 }
 
diff --git a/sparc_config.mk b/sparc_config.mk
new file mode 100644 (file)
index 0000000..87f745f
--- /dev/null
@@ -0,0 +1,24 @@
+#
+# (C) Copyright 2007
+# Daniel Hellstrom, Gaisler Research, daniel@gaisler.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
+#
+
+PLATFORM_CPPFLAGS += -DCONFIG_SPARC -D__sparc__
index c33679a..979f2da 100644 (file)
@@ -4,6 +4,14 @@
 /environment.c
 /gen_eth_addr
 /img2srec
+/md5.c
 /mkimage
 /sha1.c
 /ubsha1
+/image.c
+/fdt.c
+/fdt_ro.c
+/fdt_rw.c
+/fdt_strerror.c
+/fdt_wip.c
+/libfdt_internal.h
index af0de47..b897923 100644 (file)
@@ -23,7 +23,7 @@
 
 BIN_FILES      = img2srec$(SFX) mkimage$(SFX) envcrc$(SFX) ubsha1$(SFX) gen_eth_addr$(SFX) bmp_logo$(SFX)
 
-OBJ_LINKS      = environment.o crc32.o sha1.o
+OBJ_LINKS      = environment.o crc32.o md5.o sha1.o image.o
 OBJ_FILES      = img2srec.o mkimage.o envcrc.o ubsha1.o gen_eth_addr.o bmp_logo.o
 
 ifeq ($(ARCH),mips)
@@ -37,6 +37,8 @@ endif
 #OBJ_FILES     += mpc86x_clk.o
 #endif
 
+LIBFDT_OBJ_FILES       = $(obj)fdt.o $(obj)fdt_ro.o $(obj)fdt_rw.o $(obj)fdt_strerror.o $(obj)fdt_wip.o
+
 LOGO_H = $(OBJTREE)/include/bmp_logo.h
 
 ifeq ($(LOGO_BMP),)
@@ -120,6 +122,10 @@ CPPFLAGS   = -idirafter $(SRCTREE)/include \
                -idirafter $(OBJTREE)/include \
                -DTEXT_BASE=$(TEXT_BASE) -DUSE_HOSTCC
 CFLAGS     = $(HOST_CFLAGS) $(CPPFLAGS) -O
+
+# No -pedantic switch to avoid libfdt compilation warnings
+FIT_CFLAGS = -Wall $(CPPFLAGS) -O
+
 AFLAGS    = -D__ASSEMBLY__ $(CPPFLAGS)
 CC        = $(HOSTCC)
 STRIP     = $(HOSTSTRIP)
@@ -137,7 +143,7 @@ $(obj)img2srec$(SFX):       $(obj)img2srec.o
                $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^
                $(STRIP) $@
 
-$(obj)mkimage$(SFX):   $(obj)mkimage.o $(obj)crc32.o
+$(obj)mkimage$(SFX):   $(obj)mkimage.o $(obj)crc32.o $(obj)image.o $(obj)md5.o $(obj)sha1.o $(LIBFDT_OBJ_FILES)
                $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^
                $(STRIP) $@
 
@@ -170,11 +176,17 @@ $(obj)ubsha1.o:   $(src)ubsha1.c
 $(obj)crc32.o: $(obj)crc32.c
                $(CC) -g $(CFLAGS) -c -o $@ $<
 
+$(obj)md5.o:   $(obj)md5.c
+               $(CC) -g $(CFLAGS) -c -o $@ $<
+
 $(obj)sha1.o:  $(obj)sha1.c
                $(CC) -g $(CFLAGS) -c -o $@ $<
 
+$(obj)image.o: $(obj)image.c
+               $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
+
 $(obj)mkimage.o:       $(src)mkimage.c
-               $(CC) -g $(CFLAGS) -c -o $@ $<
+               $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
 
 $(obj)ncb.o:           $(src)ncb.c
                $(CC) -g $(CFLAGS) -c -o $@ $<
@@ -188,6 +200,21 @@ $(obj)inca-swap-bytes.o:   $(src)inca-swap-bytes.c
 $(obj)mpc86x_clk.o:    $(src)mpc86x_clk.c
                $(CC) -g $(CFLAGS) -c -o $@ $<
 
+$(obj)fdt.o:   $(obj)fdt.c
+               $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
+
+$(obj)fdt_ro.o:        $(obj)fdt_ro.c
+               $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
+
+$(obj)fdt_rw.o:        $(obj)fdt_rw.c
+               $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
+
+$(obj)fdt_strerror.o:  $(obj)fdt_strerror.c
+               $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
+
+$(obj)fdt_wip.o:       $(obj)fdt_wip.c
+               $(CC) -g $(FIT_CFLAGS) -c -o $@ $<
+
 subdirs:
 ifeq ($(TOOLSUBDIRS),)
                @:
@@ -209,14 +236,56 @@ $(obj)environment.c:
 $(obj)environment.o:   $(obj)environment.c
                $(CC) -g $(HOST_ENVIRO_CFLAGS) $(CPPFLAGS) -c -o $@ $<
 
-$(obj)crc32.c:
+$(obj)zlib.h:
+               @rm -f $@
+               ln -s $(src)../include/zlib.h $@
+
+$(obj)crc32.c: $(obj)zlib.h
                @rm -f $(obj)crc32.c
                ln -s $(src)../lib_generic/crc32.c $(obj)crc32.c
 
+$(obj)md5.c:
+               @rm -f $(obj)md5.c
+               ln -s $(src)../lib_generic/md5.c $(obj)md5.c
+
 $(obj)sha1.c:
                @rm -f $(obj)sha1.c
                ln -s $(src)../lib_generic/sha1.c $(obj)sha1.c
 
+$(obj)image.c:
+               @rm -f $(obj)image.c
+               ln -s $(src)../common/image.c $(obj)image.c
+               if [ ! -f $(obj)mkimage.h ] ; then \
+                       ln -s $(src)../tools/mkimage.h $(obj)mkimage.h; \
+               fi
+               if [ ! -f $(obj)fdt_host.h ] ; then \
+                       ln -s $(src)../tools/fdt_host.h $(obj)fdt_host.h; \
+               fi
+
+$(obj)fdt.c:   $(obj)libfdt_internal.h
+               @rm -f $(obj)fdt.c
+               ln -s $(src)../libfdt/fdt.c $(obj)fdt.c
+
+$(obj)fdt_ro.c:        $(obj)libfdt_internal.h
+               @rm -f $(obj)fdt_ro.c
+               ln -s $(src)../libfdt/fdt_ro.c $(obj)fdt_ro.c
+
+$(obj)fdt_rw.c:        $(obj)libfdt_internal.h
+               @rm -f $(obj)fdt_rw.c
+               ln -s $(src)../libfdt/fdt_rw.c $(obj)fdt_rw.c
+
+$(obj)fdt_strerror.c:  $(obj)libfdt_internal.h
+               @rm -f $(obj)fdt_strerror.c
+               ln -s $(src)../libfdt/fdt_strerror.c $(obj)fdt_strerror.c
+
+$(obj)fdt_wip.c:       $(obj)libfdt_internal.h
+               @rm -f $(obj)fdt_wip.c
+               ln -s $(src)../libfdt/fdt_wip.c $(obj)fdt_wip.c
+
+$(obj)libfdt_internal.h:
+               @rm -f $(obj)libfdt_internal.h
+               ln -s $(src)../libfdt/libfdt_internal.h $(obj)libfdt_internal.h
+
 $(LOGO_H):     $(obj)bmp_logo $(LOGO_BMP)
                $(obj)./bmp_logo $(LOGO_BMP) >$@
 
index 7b77183..550cf82 100644 (file)
@@ -22,6 +22,7 @@
  */
 
 #include <stdio.h>
+#include <stdint.h>
 #include <stdlib.h>
 #include <unistd.h>
 
 #endif /* CFG_ENV_IS_IN_FLASH */
 
 #ifdef CFG_REDUNDAND_ENVIRONMENT
-# define ENV_HEADER_SIZE       (sizeof(unsigned long) + 1)
+# define ENV_HEADER_SIZE       (sizeof(uint32_t) + 1)
 #else
-# define ENV_HEADER_SIZE       (sizeof(unsigned long))
+# define ENV_HEADER_SIZE       (sizeof(uint32_t))
 #endif
 
 #define ENV_SIZE (CFG_ENV_SIZE - ENV_HEADER_SIZE)
 
 
-extern unsigned long crc32 (unsigned long, const unsigned char *, unsigned int);
+extern uint32_t crc32 (uint32_t, const unsigned char *, unsigned int);
 
 #ifdef ENV_IS_EMBEDDED
 extern unsigned int env_size;
@@ -76,7 +77,7 @@ extern unsigned char environment;
 int main (int argc, char **argv)
 {
 #ifdef ENV_IS_EMBEDDED
-       int crc;
+       uint32_t crc;
        unsigned char *envptr = &environment,
                *dataptr = envptr + ENV_HEADER_SIZE;
        unsigned int datasize = ENV_SIZE;
diff --git a/tools/fdt_host.h b/tools/fdt_host.h
new file mode 100644 (file)
index 0000000..085013e
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * (C) Copyright 2008 Semihalf
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the 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 __FDT_HOST_H__
+#define __FDT_HOST_H__
+
+/* Make sure to include u-boot version of libfdt include files */
+#include "../include/fdt.h"
+#include "../include/libfdt.h"
+#include "../include/fdt_support.h"
+
+#endif /* __FDT_HOST_H__ */
index 2125130..ea7a826 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * (C) Copyright 2008 Semihalf
+ *
  * (C) Copyright 2000-2004
  * DENX Software Engineering
  * Wolfgang Denk, wd@denx.de
  * MA 02111-1307 USA
  */
 
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#ifndef __WIN32__
-#include <netinet/in.h>                /* for host / network byte order conversions    */
-#endif
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <time.h>
-#include <unistd.h>
-
-#if defined(__BEOS__) || defined(__NetBSD__) || defined(__APPLE__)
-#include <inttypes.h>
-#endif
-
-#ifdef __WIN32__
-typedef unsigned int __u32;
-
-#define SWAP_LONG(x) \
-       ((__u32)( \
-               (((__u32)(x) & (__u32)0x000000ffUL) << 24) | \
-               (((__u32)(x) & (__u32)0x0000ff00UL) <<  8) | \
-               (((__u32)(x) & (__u32)0x00ff0000UL) >>  8) | \
-               (((__u32)(x) & (__u32)0xff000000UL) >> 24) ))
-typedef                unsigned char   uint8_t;
-typedef                unsigned short  uint16_t;
-typedef                unsigned int    uint32_t;
-
-#define     ntohl(a)   SWAP_LONG(a)
-#define     htonl(a)   SWAP_LONG(a)
-#endif /* __WIN32__ */
-
-#ifndef        O_BINARY                /* should be define'd on __WIN32__ */
-#define O_BINARY       0
-#endif
-
+#include "mkimage.h"
 #include <image.h>
 
 extern int errno;
@@ -66,110 +31,27 @@ extern int errno;
 #define MAP_FAILED (-1)
 #endif
 
-char *cmdname;
-
-extern unsigned long crc32 (unsigned long crc, const char *buf, unsigned int len);
-
-typedef struct table_entry {
-       int     val;            /* as defined in image.h        */
-       char    *sname;         /* short (input) name           */
-       char    *lname;         /* long (output) name           */
-} table_entry_t;
-
-table_entry_t arch_name[] = {
-    {  IH_CPU_INVALID,         NULL,           "Invalid CPU",  },
-    {  IH_CPU_ALPHA,           "alpha",        "Alpha",        },
-    {  IH_CPU_ARM,             "arm",          "ARM",          },
-    {  IH_CPU_I386,            "x86",          "Intel x86",    },
-    {  IH_CPU_IA64,            "ia64",         "IA64",         },
-    {  IH_CPU_M68K,            "m68k",         "MC68000",      },
-    {  IH_CPU_MICROBLAZE,      "microblaze",   "MicroBlaze",   },
-    {  IH_CPU_MIPS,            "mips",         "MIPS",         },
-    {  IH_CPU_MIPS64,          "mips64",       "MIPS 64 Bit",  },
-    {  IH_CPU_NIOS,            "nios",         "NIOS",         },
-    {  IH_CPU_NIOS2,           "nios2",        "NIOS II",      },
-    {  IH_CPU_PPC,             "ppc",          "PowerPC",      },
-    {  IH_CPU_S390,            "s390",         "IBM S390",     },
-    {  IH_CPU_SH,              "sh",           "SuperH",       },
-    {  IH_CPU_SPARC,           "sparc",        "SPARC",        },
-    {  IH_CPU_SPARC64,         "sparc64",      "SPARC 64 Bit", },
-    {  IH_CPU_BLACKFIN,        "blackfin",     "Blackfin",     },
-    {  IH_CPU_AVR32,           "avr32",        "AVR32",        },
-    {  -1,                     "",             "",             },
-};
-
-table_entry_t os_name[] = {
-    {  IH_OS_INVALID,  NULL,           "Invalid OS",           },
-    {  IH_OS_4_4BSD,   "4_4bsd",       "4_4BSD",               },
-    {  IH_OS_ARTOS,    "artos",        "ARTOS",                },
-    {  IH_OS_DELL,     "dell",         "Dell",                 },
-    {  IH_OS_ESIX,     "esix",         "Esix",                 },
-    {  IH_OS_FREEBSD,  "freebsd",      "FreeBSD",              },
-    {  IH_OS_IRIX,     "irix",         "Irix",                 },
-    {  IH_OS_LINUX,    "linux",        "Linux",                },
-    {  IH_OS_LYNXOS,   "lynxos",       "LynxOS",               },
-    {  IH_OS_NCR,      "ncr",          "NCR",                  },
-    {  IH_OS_NETBSD,   "netbsd",       "NetBSD",               },
-    {  IH_OS_OPENBSD,  "openbsd",      "OpenBSD",              },
-    {  IH_OS_PSOS,     "psos",         "pSOS",                 },
-    {  IH_OS_QNX,      "qnx",          "QNX",                  },
-    {  IH_OS_RTEMS,    "rtems",        "RTEMS",                },
-    {  IH_OS_SCO,      "sco",          "SCO",                  },
-    {  IH_OS_SOLARIS,  "solaris",      "Solaris",              },
-    {  IH_OS_SVR4,     "svr4",         "SVR4",                 },
-    {  IH_OS_U_BOOT,   "u-boot",       "U-Boot",               },
-    {  IH_OS_VXWORKS,  "vxworks",      "VxWorks",              },
-    {  -1,             "",             "",                     },
-};
-
-table_entry_t type_name[] = {
-    {  IH_TYPE_INVALID,    NULL,         "Invalid Image",      },
-    {  IH_TYPE_FILESYSTEM, "filesystem", "Filesystem Image",   },
-    {  IH_TYPE_FIRMWARE,   "firmware",   "Firmware",           },
-    {  IH_TYPE_KERNEL,     "kernel",     "Kernel Image",       },
-    {  IH_TYPE_MULTI,      "multi",      "Multi-File Image",   },
-    {  IH_TYPE_RAMDISK,    "ramdisk",    "RAMDisk Image",      },
-    {  IH_TYPE_SCRIPT,     "script",     "Script",             },
-    {  IH_TYPE_STANDALONE, "standalone", "Standalone Program", },
-    {  IH_TYPE_FLATDT,     "flat_dt",    "Flat Device Tree",   },
-    {  -1,                 "",           "",                   },
-};
-
-table_entry_t comp_name[] = {
-    {  IH_COMP_NONE,   "none",         "uncompressed",         },
-    {  IH_COMP_BZIP2,  "bzip2",        "bzip2 compressed",     },
-    {  IH_COMP_GZIP,   "gzip",         "gzip compressed",      },
-    {  -1,             "",             "",                     },
-};
-
-static void    copy_file (int, const char *, int);
-static void    usage   (void);
-static void    print_header (image_header_t *);
-static void    print_type (image_header_t *);
-static char    *put_table_entry (table_entry_t *, char *, int);
-static char    *put_arch (int);
-static char    *put_type (int);
-static char    *put_os   (int);
-static char    *put_comp (int);
-static int     get_table_entry (table_entry_t *, char *, char *);
-static int     get_arch(char *);
-static int     get_comp(char *);
-static int     get_os  (char *);
-static int     get_type(char *);
-
+extern unsigned long   crc32 (unsigned long crc, const char *buf, unsigned int len);
+static void            copy_file (int, const char *, int);
+static void            usage (void);
+static void            image_verify_header (char *, int);
+static void            fit_handle_file (void);
 
 char   *datafile;
 char   *imagefile;
+char   *cmdname;
 
 int dflag    = 0;
 int eflag    = 0;
+int fflag    = 0;
 int lflag    = 0;
 int vflag    = 0;
 int xflag    = 0;
 int opt_os   = IH_OS_LINUX;
-int opt_arch = IH_CPU_PPC;
+int opt_arch = IH_ARCH_PPC;
 int opt_type = IH_TYPE_KERNEL;
 int opt_comp = IH_COMP_GZIP;
+char *opt_dtc = MKIMAGE_DEFAULT_DTC_OPTIONS;
 
 image_header_t header;
 image_header_t *hdr = &header;
@@ -177,7 +59,7 @@ image_header_t *hdr = &header;
 int
 main (int argc, char **argv)
 {
-       int ifd;
+       int ifd = -1;
        uint32_t checksum;
        uint32_t addr;
        uint32_t ep;
@@ -197,22 +79,28 @@ main (int argc, char **argv)
                                break;
                        case 'A':
                                if ((--argc <= 0) ||
-                                   (opt_arch = get_arch(*++argv)) < 0)
+                                   (opt_arch = genimg_get_arch_id (*++argv)) < 0)
                                        usage ();
                                goto NXTARG;
                        case 'C':
                                if ((--argc <= 0) ||
-                                   (opt_comp = get_comp(*++argv)) < 0)
+                                   (opt_comp = genimg_get_comp_id (*++argv)) < 0)
+                                       usage ();
+                               goto NXTARG;
+                       case 'D':
+                               if (--argc <= 0)
                                        usage ();
+                               opt_dtc = *++argv;
                                goto NXTARG;
+
                        case 'O':
                                if ((--argc <= 0) ||
-                                   (opt_os = get_os(*++argv)) < 0)
+                                   (opt_os = genimg_get_os_id (*++argv)) < 0)
                                        usage ();
                                goto NXTARG;
                        case 'T':
                                if ((--argc <= 0) ||
-                                   (opt_type = get_type(*++argv)) < 0)
+                                   (opt_type = genimg_get_type_id (*++argv)) < 0)
                                        usage ();
                                goto NXTARG;
 
@@ -245,6 +133,12 @@ main (int argc, char **argv)
                                }
                                eflag = 1;
                                goto NXTARG;
+                       case 'f':
+                               if (--argc <= 0)
+                                       usage ();
+                               datafile = *++argv;
+                               fflag = 1;
+                               goto NXTARG;
                        case 'n':
                                if (--argc <= 0)
                                        usage ();
@@ -263,14 +157,17 @@ main (int argc, char **argv)
 NXTARG:                ;
        }
 
-       if ((argc != 1) || ((lflag ^ dflag) == 0))
+       if ((argc != 1) ||
+               (dflag && (fflag || lflag)) ||
+               (fflag && (dflag || lflag)) ||
+               (lflag && (dflag || fflag)))
                usage();
 
        if (!eflag) {
                ep = addr;
                /* If XIP, entry point must be after the U-Boot header */
                if (xflag)
-                       ep += sizeof(image_header_t);
+                       ep += image_get_header_size ();
        }
 
        /*
@@ -278,32 +175,33 @@ NXTARG:           ;
         * the size of the U-Boot header.
         */
        if (xflag) {
-               if (ep != addr + sizeof(image_header_t)) {
+               if (ep != addr + image_get_header_size ()) {
                        fprintf (stderr,
                                "%s: For XIP, the entry point must be the load addr + %lu\n",
                                cmdname,
-                               (unsigned long)sizeof(image_header_t));
+                               (unsigned long)image_get_header_size ());
                        exit (EXIT_FAILURE);
                }
        }
 
        imagefile = *argv;
 
-       if (lflag) {
-               ifd = open(imagefile, O_RDONLY|O_BINARY);
-       } else {
-               ifd = open(imagefile, O_RDWR|O_CREAT|O_TRUNC|O_BINARY, 0666);
-       }
+       if (!fflag){
+               if (lflag) {
+                       ifd = open (imagefile, O_RDONLY|O_BINARY);
+               } else {
+                       ifd = open (imagefile,
+                               O_RDWR|O_CREAT|O_TRUNC|O_BINARY, 0666);
+               }
 
-       if (ifd < 0) {
-               fprintf (stderr, "%s: Can't open %s: %s\n",
-                       cmdname, imagefile, strerror(errno));
-               exit (EXIT_FAILURE);
+               if (ifd < 0) {
+                       fprintf (stderr, "%s: Can't open %s: %s\n",
+                               cmdname, imagefile, strerror(errno));
+                       exit (EXIT_FAILURE);
+               }
        }
 
        if (lflag) {
-               int len;
-               char *data;
                /*
                 * list header information of existing image
                 */
@@ -313,7 +211,7 @@ NXTARG:             ;
                        exit (EXIT_FAILURE);
                }
 
-               if ((unsigned)sbuf.st_size < sizeof(image_header_t)) {
+               if ((unsigned)sbuf.st_size < image_get_header_size ()) {
                        fprintf (stderr,
                                "%s: Bad size: \"%s\" is no valid image\n",
                                cmdname, imagefile);
@@ -328,50 +226,24 @@ NXTARG:           ;
                        exit (EXIT_FAILURE);
                }
 
-               /*
-                * create copy of header so that we can blank out the
-                * checksum field for checking - this can't be done
-                * on the PROT_READ mapped data.
-                */
-               memcpy (hdr, ptr, sizeof(image_header_t));
-
-               if (ntohl(hdr->ih_magic) != IH_MAGIC) {
-                       fprintf (stderr,
-                               "%s: Bad Magic Number: \"%s\" is no valid image\n",
-                               cmdname, imagefile);
-                       exit (EXIT_FAILURE);
-               }
-
-               data = (char *)hdr;
-               len  = sizeof(image_header_t);
-
-               checksum = ntohl(hdr->ih_hcrc);
-               hdr->ih_hcrc = htonl(0);        /* clear for re-calculation */
-
-               if (crc32 (0, data, len) != checksum) {
-                       fprintf (stderr,
-                               "%s: ERROR: \"%s\" has bad header checksum!\n",
-                               cmdname, imagefile);
-                       exit (EXIT_FAILURE);
+               if (fdt_check_header (ptr)) {
+                       /* old-style image */
+                       image_verify_header ((char *)ptr, sbuf.st_size);
+                       image_print_contents ((image_header_t *)ptr);
+               } else {
+                       /* FIT image */
+                       fit_print_contents (ptr);
                }
 
-               data = (char *)(ptr + sizeof(image_header_t));
-               len  = sbuf.st_size - sizeof(image_header_t) ;
-
-               if (crc32 (0, data, len) != ntohl(hdr->ih_dcrc)) {
-                       fprintf (stderr,
-                               "%s: ERROR: \"%s\" has corrupted data!\n",
-                               cmdname, imagefile);
-                       exit (EXIT_FAILURE);
-               }
-
-               /* for multi-file images we need the data part, too */
-               print_header ((image_header_t *)ptr);
-
                (void) munmap((void *)ptr, sbuf.st_size);
                (void) close (ifd);
 
                exit (EXIT_SUCCESS);
+       } else if (fflag) {
+               /* Flattened Image Tree (FIT) format  handling */
+               debug ("FIT format handling\n");
+               fit_handle_file ();
+               exit (EXIT_SUCCESS);
        }
 
        /*
@@ -379,9 +251,9 @@ NXTARG:             ;
         *
         * write dummy header, to be fixed later
         */
-       memset (hdr, 0, sizeof(image_header_t));
+       memset (hdr, 0, image_get_header_size ());
 
-       if (write(ifd, hdr, sizeof(image_header_t)) != sizeof(image_header_t)) {
+       if (write(ifd, hdr, image_get_header_size ()) != image_get_header_size ()) {
                fprintf (stderr, "%s: Write error on %s: %s\n",
                        cmdname, imagefile, strerror(errno));
                exit (EXIT_FAILURE);
@@ -404,7 +276,7 @@ NXTARG:             ;
                                                cmdname, file, strerror(errno));
                                        exit (EXIT_FAILURE);
                                }
-                               size = htonl(sbuf.st_size);
+                               size = cpu_to_uimage (sbuf.st_size);
                        } else {
                                size = 0;
                        }
@@ -469,29 +341,29 @@ NXTARG:           ;
        hdr = (image_header_t *)ptr;
 
        checksum = crc32 (0,
-                         (const char *)(ptr + sizeof(image_header_t)),
-                         sbuf.st_size - sizeof(image_header_t)
+                         (const char *)(ptr + image_get_header_size ()),
+                         sbuf.st_size - image_get_header_size ()
                         );
 
        /* Build new header */
-       hdr->ih_magic = htonl(IH_MAGIC);
-       hdr->ih_time  = htonl(sbuf.st_mtime);
-       hdr->ih_size  = htonl(sbuf.st_size - sizeof(image_header_t));
-       hdr->ih_load  = htonl(addr);
-       hdr->ih_ep    = htonl(ep);
-       hdr->ih_dcrc  = htonl(checksum);
-       hdr->ih_os    = opt_os;
-       hdr->ih_arch  = opt_arch;
-       hdr->ih_type  = opt_type;
-       hdr->ih_comp  = opt_comp;
+       image_set_magic (hdr, IH_MAGIC);
+       image_set_time (hdr, sbuf.st_mtime);
+       image_set_size (hdr, sbuf.st_size - image_get_header_size ());
+       image_set_load (hdr, addr);
+       image_set_ep (hdr, ep);
+       image_set_dcrc (hdr, checksum);
+       image_set_os (hdr, opt_os);
+       image_set_arch (hdr, opt_arch);
+       image_set_type (hdr, opt_type);
+       image_set_comp (hdr, opt_comp);
 
-       strncpy((char *)hdr->ih_name, name, IH_NMLEN);
+       image_set_name (hdr, name);
 
-       checksum = crc32(0,(const char *)hdr,sizeof(image_header_t));
+       checksum = crc32 (0, (const char *)hdr, image_get_header_size ());
 
-       hdr->ih_hcrc = htonl(checksum);
+       image_set_hcrc (hdr, checksum);
 
-       print_header (hdr);
+       image_print_contents (hdr);
 
        (void) munmap((void *)ptr, sbuf.st_size);
 
@@ -554,14 +426,14 @@ copy_file (int ifd, const char *datafile, int pad)
                 * reserved for it.
                 */
 
-               if ((unsigned)sbuf.st_size < sizeof(image_header_t)) {
+               if ((unsigned)sbuf.st_size < image_get_header_size ()) {
                        fprintf (stderr,
                                "%s: Bad size: \"%s\" is too small for XIP\n",
                                cmdname, datafile);
                        exit (EXIT_FAILURE);
                }
 
-               for (p=ptr; p < ptr+sizeof(image_header_t); p++) {
+               for (p = ptr; p < ptr + image_get_header_size (); p++) {
                        if ( *p != 0xff ) {
                                fprintf (stderr,
                                        "%s: Bad file: \"%s\" has invalid buffer for XIP\n",
@@ -570,7 +442,7 @@ copy_file (int ifd, const char *datafile, int pad)
                        }
                }
 
-               offset = sizeof(image_header_t);
+               offset = image_get_header_size ();
        }
 
        size = sbuf.st_size - offset;
@@ -597,11 +469,11 @@ void
 usage ()
 {
        fprintf (stderr, "Usage: %s -l image\n"
-                        "          -l ==> list image header information\n"
-                        "       %s [-x] -A arch -O os -T type -C comp "
-                        "-a addr -e ep -n name -d data_file[:data_file...] image\n",
-               cmdname, cmdname);
-       fprintf (stderr, "          -A ==> set architecture to 'arch'\n"
+                        "          -l ==> list image header information\n",
+               cmdname);
+       fprintf (stderr, "       %s [-x] -A arch -O os -T type -C comp "
+                        "-a addr -e ep -n name -d data_file[:data_file...] image\n"
+                        "          -A ==> set architecture to 'arch'\n"
                         "          -O ==> set operating system to 'os'\n"
                         "          -T ==> set image type to 'type'\n"
                         "          -C ==> set compression type 'comp'\n"
@@ -609,143 +481,158 @@ usage ()
                         "          -e ==> set entry point to 'ep' (hex)\n"
                         "          -n ==> set image name to 'name'\n"
                         "          -d ==> use image data from 'datafile'\n"
-                        "          -x ==> set XIP (execute in place)\n"
-               );
+                        "          -x ==> set XIP (execute in place)\n",
+               cmdname);
+       fprintf (stderr, "       %s [-D dtc_options] -f fit-image.its fit-image\n",
+               cmdname);
+
        exit (EXIT_FAILURE);
 }
 
 static void
-print_header (image_header_t *hdr)
+image_verify_header (char *ptr, int image_size)
 {
-       time_t timestamp;
-       uint32_t size;
-
-       timestamp = (time_t)ntohl(hdr->ih_time);
-       size = ntohl(hdr->ih_size);
-
-       printf ("Image Name:   %.*s\n", IH_NMLEN, hdr->ih_name);
-       printf ("Created:      %s", ctime(&timestamp));
-       printf ("Image Type:   "); print_type(hdr);
-       printf ("Data Size:    %d Bytes = %.2f kB = %.2f MB\n",
-               size, (double)size / 1.024e3, (double)size / 1.048576e6 );
-       printf ("Load Address: 0x%08X\n", ntohl(hdr->ih_load));
-       printf ("Entry Point:  0x%08X\n", ntohl(hdr->ih_ep));
-
-       if (hdr->ih_type == IH_TYPE_MULTI || hdr->ih_type == IH_TYPE_SCRIPT) {
-               int i, ptrs;
-               uint32_t pos;
-               uint32_t *len_ptr = (uint32_t *) (
-                                       (unsigned long)hdr + sizeof(image_header_t)
-                               );
-
-               /* determine number of images first (to calculate image offsets) */
-               for (i=0; len_ptr[i]; ++i)      /* null pointer terminates list */
-                       ;
-               ptrs = i;               /* null pointer terminates list */
-
-               pos = sizeof(image_header_t) + ptrs * sizeof(long);
-               printf ("Contents:\n");
-               for (i=0; len_ptr[i]; ++i) {
-                       size = ntohl(len_ptr[i]);
-
-                       printf ("   Image %d: %8d Bytes = %4d kB = %d MB\n",
-                               i, size, size>>10, size>>20);
-                       if (hdr->ih_type == IH_TYPE_SCRIPT && i > 0) {
-                               /*
-                                * the user may need to know offsets
-                                * if planning to do something with
-                                * multiple files
-                                */
-                               printf ("    Offset = %08X\n", pos);
-                       }
-                       /* copy_file() will pad the first files to even word align */
-                       size += 3;
-                       size &= ~3;
-                       pos += size;
-               }
-       }
-}
+       int len;
+       char *data;
+       uint32_t checksum;
+       image_header_t header;
+       image_header_t *hdr = &header;
 
+       /*
+        * create copy of header so that we can blank out the
+        * checksum field for checking - this can't be done
+        * on the PROT_READ mapped data.
+        */
+       memcpy (hdr, ptr, sizeof(image_header_t));
 
-static void
-print_type (image_header_t *hdr)
-{
-       printf ("%s %s %s (%s)\n",
-               put_arch (hdr->ih_arch),
-               put_os   (hdr->ih_os  ),
-               put_type (hdr->ih_type),
-               put_comp (hdr->ih_comp)
-       );
-}
+       if (ntohl(hdr->ih_magic) != IH_MAGIC) {
+               fprintf (stderr,
+                       "%s: Bad Magic Number: \"%s\" is no valid image\n",
+                       cmdname, imagefile);
+               exit (EXIT_FAILURE);
+       }
 
-static char *put_arch (int arch)
-{
-       return (put_table_entry(arch_name, "Unknown Architecture", arch));
-}
+       data = (char *)hdr;
+       len  = sizeof(image_header_t);
 
-static char *put_os (int os)
-{
-       return (put_table_entry(os_name, "Unknown OS", os));
-}
+       checksum = ntohl(hdr->ih_hcrc);
+       hdr->ih_hcrc = htonl(0);        /* clear for re-calculation */
 
-static char *put_type (int type)
-{
-       return (put_table_entry(type_name, "Unknown Image", type));
-}
+       if (crc32 (0, data, len) != checksum) {
+               fprintf (stderr,
+                       "%s: ERROR: \"%s\" has bad header checksum!\n",
+                       cmdname, imagefile);
+               exit (EXIT_FAILURE);
+       }
 
-static char *put_comp (int comp)
-{
-       return (put_table_entry(comp_name, "Unknown Compression", comp));
-}
+       data = ptr + sizeof(image_header_t);
+       len  = image_size - sizeof(image_header_t) ;
 
-static char *put_table_entry (table_entry_t *table, char *msg, int type)
-{
-       for (; table->val>=0; ++table) {
-               if (table->val == type)
-                       return (table->lname);
+       if (crc32 (0, data, len) != ntohl(hdr->ih_dcrc)) {
+               fprintf (stderr,
+                       "%s: ERROR: \"%s\" has corrupted data!\n",
+                       cmdname, imagefile);
+               exit (EXIT_FAILURE);
        }
-       return (msg);
 }
 
-static int get_arch(char *name)
+/**
+ * fit_handle_file - main FIT file processing function
+ *
+ * fit_handle_file() runs dtc to convert .its to .itb, includes
+ * binary data, updates timestamp property and calculates hashes.
+ *
+ * datafile  - .its file
+ * imagefile - .itb file
+ *
+ * returns:
+ *     only on success, otherwise calls exit (EXIT_FAILURE);
+ */
+static void fit_handle_file (void)
 {
-       return (get_table_entry(arch_name, "CPU", name));
-}
+       char tmpfile[MKIMAGE_MAX_TMPFILE_LEN];
+       char cmd[MKIMAGE_MAX_DTC_CMDLINE_LEN];
+       int tfd;
+       struct stat sbuf;
+       unsigned char *ptr;
 
+       /* call dtc to include binary properties into the tmp file */
+       if (strlen (imagefile) + strlen (MKIMAGE_TMPFILE_SUFFIX) + 1 >
+               sizeof (tmpfile)) {
+               fprintf (stderr, "%s: Image file name (%s) too long, "
+                               "can't create tmpfile",
+                               imagefile, cmdname);
+               exit (EXIT_FAILURE);
+       }
+       sprintf (tmpfile, "%s%s", imagefile, MKIMAGE_TMPFILE_SUFFIX);
+
+       /* dtc -I dts -O -p 200 datafile > tmpfile */
+       sprintf (cmd, "%s %s %s > %s",
+                       MKIMAGE_DTC, opt_dtc, datafile, tmpfile);
+       debug ("Trying to execute \"%s\"\n", cmd);
+       if (system (cmd) == -1) {
+               fprintf (stderr, "%s: system(%s) failed: %s\n",
+                               cmdname, cmd, strerror(errno));
+               unlink (tmpfile);
+               exit (EXIT_FAILURE);
+       }
 
-static int get_comp(char *name)
-{
-       return (get_table_entry(comp_name, "Compression", name));
-}
+       /* load FIT blob into memory */
+       tfd = open (tmpfile, O_RDWR|O_BINARY);
 
+       if (tfd < 0) {
+               fprintf (stderr, "%s: Can't open %s: %s\n",
+                               cmdname, tmpfile, strerror(errno));
+               unlink (tmpfile);
+               exit (EXIT_FAILURE);
+       }
 
-static int get_os (char *name)
-{
-       return (get_table_entry(os_name, "OS", name));
-}
+       if (fstat (tfd, &sbuf) < 0) {
+               fprintf (stderr, "%s: Can't stat %s: %s\n",
+                               cmdname, tmpfile, strerror(errno));
+               unlink (tmpfile);
+               exit (EXIT_FAILURE);
+       }
 
+       ptr = (unsigned char *)mmap (0, sbuf.st_size,
+                       PROT_READ|PROT_WRITE, MAP_SHARED, tfd, 0);
+       if ((caddr_t)ptr == (caddr_t)-1) {
+               fprintf (stderr, "%s: Can't read %s: %s\n",
+                               cmdname, tmpfile, strerror(errno));
+               unlink (tmpfile);
+               exit (EXIT_FAILURE);
+       }
 
-static int get_type(char *name)
-{
-       return (get_table_entry(type_name, "Image", name));
-}
+       /* check if ptr has a valid blob */
+       if (fdt_check_header (ptr)) {
+               fprintf (stderr, "%s: Invalid FIT blob\n", cmdname);
+               unlink (tmpfile);
+               exit (EXIT_FAILURE);
+       }
 
-static int get_table_entry (table_entry_t *table, char *msg, char *name)
-{
-       table_entry_t *t;
-       int first = 1;
+       /* set hashes for images in the blob */
+       if (fit_set_hashes (ptr)) {
+               fprintf (stderr, "%s Can't add hashes to FIT blob", cmdname);
+               unlink (tmpfile);
+               exit (EXIT_FAILURE);
+       }
 
-       for (t=table; t->val>=0; ++t) {
-               if (t->sname && strcasecmp(t->sname, name)==0)
-                       return (t->val);
+       /* add a timestamp at offset 0 i.e., root  */
+       if (fit_set_timestamp (ptr, 0, sbuf.st_mtime)) {
+               fprintf (stderr, "%s: Can't add image timestamp\n", cmdname);
+               unlink (tmpfile);
+               exit (EXIT_FAILURE);
        }
-       fprintf (stderr, "\nInvalid %s Type - valid names are", msg);
-       for (t=table; t->val>=0; ++t) {
-               if (t->sname == NULL)
-                       continue;
-               fprintf (stderr, "%c %s", (first) ? ':' : ',', t->sname);
-               first = 0;
+       debug ("Added timestamp successfully\n");
+
+       munmap ((void *)ptr, sbuf.st_size);
+       close (tfd);
+
+       if (rename (tmpfile, imagefile) == -1) {
+               fprintf (stderr, "%s: Can't rename %s to %s: %s\n",
+                               cmdname, tmpfile, imagefile, strerror (errno));
+               unlink (tmpfile);
+               unlink (imagefile);
+               exit (EXIT_FAILURE);
        }
-       fprintf (stderr, "\n");
-       return (-1);
 }
diff --git a/tools/mkimage.h b/tools/mkimage.h
new file mode 100644 (file)
index 0000000..a2d5248
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * (C) Copyright 2000-2004
+ * DENX Software Engineering
+ * Wolfgang Denk, wd@denx.de
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifndef __WIN32__
+#include <netinet/in.h>                /* for host / network byte order conversions    */
+#endif
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <time.h>
+#include <unistd.h>
+#include <sha1.h>
+#include "fdt_host.h"
+
+#define MKIMAGE_DEBUG
+
+#ifdef MKIMAGE_DEBUG
+#define debug(fmt,args...)     printf (fmt ,##args)
+#else
+#define debug(fmt,args...)
+#endif /* MKIMAGE_DEBUG */
+
+#define MKIMAGE_TMPFILE_SUFFIX         ".tmp"
+#define MKIMAGE_MAX_TMPFILE_LEN                256
+#define MKIMAGE_DEFAULT_DTC_OPTIONS    "-I dts -O dtb -p 500"
+#define MKIMAGE_MAX_DTC_CMDLINE_LEN    512
+#define MKIMAGE_DTC                    "dtc"   /* assume dtc is in $PATH */
+
+#if defined(__BEOS__) || defined(__NetBSD__) || defined(__APPLE__)
+#include <inttypes.h>
+#endif
+
+#ifdef __WIN32__
+typedef unsigned int __u32;
+
+#define SWAP_LONG(x) \
+       ((__u32)( \
+               (((__u32)(x) & (__u32)0x000000ffUL) << 24) | \
+               (((__u32)(x) & (__u32)0x0000ff00UL) <<  8) | \
+               (((__u32)(x) & (__u32)0x00ff0000UL) >>  8) | \
+               (((__u32)(x) & (__u32)0xff000000UL) >> 24) ))
+typedef                unsigned char   uint8_t;
+typedef                unsigned short  uint16_t;
+typedef                unsigned int    uint32_t;
+
+#define     ntohl(a)   SWAP_LONG(a)
+#define     htonl(a)   SWAP_LONG(a)
+#endif /* __WIN32__ */
+
+#ifndef        O_BINARY                /* should be define'd on __WIN32__ */
+#define O_BINARY       0
+#endif
index 9bbdafd..bbb2ab2 100755 (executable)
@@ -22,4 +22,18 @@ if head=`git rev-parse --verify HEAD 2>/dev/null`; then
            | read dummy; then
                printf '%s' -dirty
        fi
+
+       # Is this git on svn?
+       if git config --get svn-remote.svn.url >/dev/null; then
+               printf -- '-svn%s' "`git-svn find-rev $head`"
+       fi
 fi
+
+# Check for svn and a svn repo.
+if rev=`svn info 2>/dev/null` ; then
+       rev=`echo "${rev}" | grep '^Revision' | awk '{print $NF}'`
+       printf -- '-svn%s' $rev
+fi
+
+# Check for any localversion-* files
+printf '%s' "`cat localversion-* 2>/dev/null`"