diff options
author | Wolfgang Denk <wd@denx.de> | 2010-06-30 10:10:32 +0200 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2010-06-30 10:10:32 +0200 |
commit | 39ddd10b046fb791f47281ffb2100be01909ad72 (patch) | |
tree | cec01ecc6502a65cbbbda406dfac23b93c093899 | |
parent | 55357b7846237d12aa5f07aec657c5dbfaf790ed (diff) | |
parent | 0a9463e93537a68e7246714f43fb69eca0b7b214 (diff) | |
download | bootable_bootloader_goldelico_gta04-39ddd10b046fb791f47281ffb2100be01909ad72.zip bootable_bootloader_goldelico_gta04-39ddd10b046fb791f47281ffb2100be01909ad72.tar.gz bootable_bootloader_goldelico_gta04-39ddd10b046fb791f47281ffb2100be01909ad72.tar.bz2 |
Merge branch 'master' of ssh://gemini/home/wd/git/u-boot/master
104 files changed, 1600 insertions, 10714 deletions
@@ -40,7 +40,8 @@ HOSTARCH := $(shell uname -m | \ -e s/sa110/arm/ \ -e s/ppc64/powerpc/ \ -e s/ppc/powerpc/ \ - -e s/macppc/powerpc/) + -e s/macppc/powerpc/\ + -e s/sh.*/sh/) HOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]' | \ sed -e 's/\(cygwin\).*/cygwin/') @@ -467,7 +468,7 @@ CHANGELOG: unexpand -a | sed -e 's/\s\s*$$//' > $@ include/license.h: tools/bin2header COPYING - cat COPYING | gzip -9 -c | ./tools/bin2header license_gzip > include/license.h + cat COPYING | gzip -9 -c | ./tools/bin2header license_gzip > include/license.h ######################################################################### unconfig: @@ -475,42 +476,26 @@ unconfig: $(obj)board/*/config.tmp $(obj)board/*/*/config.tmp \ $(obj)include/autoconf.mk $(obj)include/autoconf.mk.dep -%: %_config - $(MAKE) +%_config:: unconfig + @$(MKCONFIG) -A $(@:_config=) + +##%: %_config +## $(MAKE) + +# +# Functions to generate common board directory names +# +lcname = $(shell echo $(1) | sed -e 's/\(.*\)_config/\L\1/') +ucname = $(shell echo $(1) | sed -e 's/\(.*\)_config/\U\1/') #======================================================================== # PowerPC #======================================================================== ######################################################################### -## MPC5xx Systems -######################################################################### - -canmb_config: unconfig - @$(MKCONFIG) -a canmb powerpc mpc5xxx canmb - -cmi_mpc5xx_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc5xx cmi - -PATI_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc5xx pati mpl - -######################################################################### ## MPC5xxx Systems ######################################################################### -aev_config: unconfig - @$(MKCONFIG) -a aev powerpc mpc5xxx tqm5200 tqc - -BC3450_config: unconfig - @$(MKCONFIG) -a BC3450 powerpc mpc5xxx bc3450 - -cm5200_config: unconfig - @$(MKCONFIG) -a cm5200 powerpc mpc5xxx cm5200 - -cpci5200_config: unconfig - @$(MKCONFIG) -a cpci5200 powerpc mpc5xxx cpci5200 esd - digsy_mtc_config \ digsy_mtc_LOWBOOT_config \ digsy_mtc_RAMBOOT_config: unconfig @@ -518,23 +503,16 @@ digsy_mtc_RAMBOOT_config: unconfig @mkdir -p $(obj)board/digsy_mtc @ >$(obj)include/config.h @[ -z "$(findstring LOWBOOT_,$@)" ] || \ - { echo "TEXT_BASE = 0xFF000000" >$(obj)board/digsy_mtc/config.tmp ; \ - echo "... with LOWBOOT configuration" ; \ - } + echo "TEXT_BASE = 0xFF000000" >$(obj)board/digsy_mtc/config.tmp @[ -z "$(findstring RAMBOOT_,$@)" ] || \ - { echo "TEXT_BASE = 0x00100000" >$(obj)board/digsy_mtc/config.tmp ; \ - echo "... with RAMBOOT configuration" ; \ - } - @$(MKCONFIG) -a digsy_mtc powerpc mpc5xxx digsy_mtc + echo "TEXT_BASE = 0x00100000" >$(obj)board/digsy_mtc/config.tmp + @$(MKCONFIG) -n $@ -a digsy_mtc powerpc mpc5xxx digsy_mtc galaxy5200_LOWBOOT_config \ galaxy5200_config: unconfig @mkdir -p $(obj)include @echo "#define CONFIG_$(@:_config=) 1" >$(obj)include/config.h - @$(MKCONFIG) -a galaxy5200 powerpc mpc5xxx galaxy5200 - -hmi1001_config: unconfig - @$(MKCONFIG) hmi1001 powerpc mpc5xxx hmi1001 + @$(MKCONFIG) -n $@ -a galaxy5200 powerpc mpc5xxx galaxy5200 Lite5200_config \ Lite5200_LOWBOOT_config \ @@ -548,31 +526,15 @@ icecube_5200_DDR_LOWBOOT08_config: unconfig @mkdir -p $(obj)include @mkdir -p $(obj)board/icecube @[ -z "$(findstring LOWBOOT_,$@)" ] || \ - { if [ "$(findstring DDR,$@)" ] ; \ + if [ "$(findstring DDR,$@)" ] ; \ then echo "TEXT_BASE = 0xFF800000" >$(obj)board/icecube/config.tmp ; \ else echo "TEXT_BASE = 0xFF000000" >$(obj)board/icecube/config.tmp ; \ - fi ; \ - $(XECHO) "... with LOWBOOT configuration" ; \ - } + fi @[ -z "$(findstring LOWBOOT08,$@)" ] || \ - { echo "TEXT_BASE = 0xFF800000" >$(obj)board/icecube/config.tmp ; \ - echo "... with 8 MB flash only" ; \ - $(XECHO) "... with LOWBOOT configuration" ; \ - } + echo "TEXT_BASE = 0xFF800000" >$(obj)board/icecube/config.tmp @[ -z "$(findstring DDR,$@)" ] || \ - { echo "#define CONFIG_MPC5200_DDR" >>$(obj)include/config.h ; \ - $(XECHO) "... DDR memory revision" ; \ - } - @$(MKCONFIG) -a IceCube powerpc mpc5xxx icecube - -jupiter_config: unconfig - @$(MKCONFIG) jupiter powerpc mpc5xxx jupiter - -inka4x0_config: unconfig - @$(MKCONFIG) inka4x0 powerpc mpc5xxx inka4x0 - -ipek01_config: unconfig - @$(MKCONFIG) -a ipek01 powerpc mpc5xxx ipek01 + echo "#define CONFIG_MPC5200_DDR" >>$(obj)include/config.h + @$(MKCONFIG) -n $@ -a IceCube powerpc mpc5xxx icecube lite5200b_config \ lite5200b_PM_config \ @@ -580,17 +542,12 @@ lite5200b_LOWBOOT_config: unconfig @mkdir -p $(obj)include @mkdir -p $(obj)board/icecube @ echo "#define CONFIG_MPC5200_DDR" >>$(obj)include/config.h - @ $(XECHO) "... DDR memory revision" @ echo "#define CONFIG_LITE5200B" >>$(obj)include/config.h @[ -z "$(findstring _PM_,$@)" ] || \ - { echo "#define CONFIG_LITE5200B_PM" >>$(obj)include/config.h ; \ - $(XECHO) "... with power management (low-power mode) support" ; \ - } + echo "#define CONFIG_LITE5200B_PM" >>$(obj)include/config.h @[ -z "$(findstring LOWBOOT_,$@)" ] || \ - { echo "TEXT_BASE = 0xFF000000" >$(obj)board/icecube/config.tmp ; \ - $(XECHO) "... with LOWBOOT configuration" ; \ - } - @$(MKCONFIG) -a IceCube powerpc mpc5xxx icecube + echo "TEXT_BASE = 0xFF000000" >$(obj)board/icecube/config.tmp + @$(MKCONFIG) -n $@ -a IceCube powerpc mpc5xxx icecube mcc200_config \ mcc200_SDRAM_config \ @@ -606,80 +563,44 @@ prs200_highboot_config \ prs200_highboot_DDR_config: unconfig @mkdir -p $(obj)include @mkdir -p $(obj)board/mcc200 - @[ -n "$(findstring highboot,$@)" ] || \ - { $(XECHO) "... with lowboot configuration" ; \ - } @[ -z "$(findstring highboot,$@)" ] || \ - { echo "TEXT_BASE = 0xFFF00000" >$(obj)board/mcc200/config.tmp ; \ - $(XECHO) "... with highboot configuration" ; \ - } + echo "TEXT_BASE = 0xFFF00000" >$(obj)board/mcc200/config.tmp @[ -n "$(findstring _SDRAM,$@)" ] || \ - { if [ -n "$(findstring mcc200,$@)" ]; \ - then \ - $(XECHO) "... with DDR" ; \ - else \ - if [ -n "$(findstring _DDR,$@)" ];\ + if [ -n "$(findstring prs200,$@)" ]; \ + then \ + if [ -z "$(findstring _DDR,$@)" ];\ then \ - $(XECHO) "... with DDR" ; \ - else \ echo "#define CONFIG_MCC200_SDRAM" >>$(obj)include/config.h ;\ - $(XECHO) "... with SDRAM" ; \ fi; \ - fi; \ - } + fi @[ -z "$(findstring _SDRAM,$@)" ] || \ - { echo "#define CONFIG_MCC200_SDRAM" >>$(obj)include/config.h ; \ - $(XECHO) "... with SDRAM" ; \ - } + echo "#define CONFIG_MCC200_SDRAM" >>$(obj)include/config.h @[ -z "$(findstring COM12,$@)" ] || \ - { echo "#define CONFIG_CONSOLE_COM12" >>$(obj)include/config.h ; \ - $(XECHO) "... with console on COM12" ; \ - } + echo "#define CONFIG_CONSOLE_COM12" >>$(obj)include/config.h @[ -z "$(findstring prs200,$@)" ] || \ - { echo "#define CONFIG_PRS200" >>$(obj)include/config.h ;\ - } + echo "#define CONFIG_PRS200" >>$(obj)include/config.h @$(MKCONFIG) -n $@ -a mcc200 powerpc mpc5xxx mcc200 -mecp5200_config: unconfig - @$(MKCONFIG) mecp5200 powerpc mpc5xxx mecp5200 esd - -motionpro_config: unconfig - @$(MKCONFIG) motionpro powerpc mpc5xxx motionpro - -mucmc52_config: unconfig - @$(MKCONFIG) mucmc52 powerpc mpc5xxx mucmc52 - -munices_config: unconfig - @$(MKCONFIG) munices powerpc mpc5xxx munices - MVBC_P_config: unconfig @mkdir -p $(obj)include @mkdir -p $(obj)board/mvbc_p @ >$(obj)include/config.h @[ -z "$(findstring MVBC_P,$@)" ] || \ - { echo "#define CONFIG_MVBC_P" >>$(obj)include/config.h; } - @$(MKCONFIG) -n $@ -a MVBC_P powerpc mpc5xxx mvbc_p matrix_vision + echo "#define CONFIG_MVBC_P" >>$(obj)include/config.h + @$(MKCONFIG) -n $@ -a $@ powerpc mpc5xxx mvbc_p matrix_vision MVSMR_config: unconfig @mkdir -p $(obj)include @mkdir -p $(obj)board/matrix_vision/mvsmr - @$(MKCONFIG) $(@:_config=) powerpc mpc5xxx mvsmr matrix_vision - -o2dnt_config: unconfig - @$(MKCONFIG) o2dnt powerpc mpc5xxx o2dnt + @$(MKCONFIG) $@ powerpc mpc5xxx mvsmr matrix_vision pcm030_config \ pcm030_LOWBOOT_config: unconfig @mkdir -p $(obj)include $(obj)board/phytec/pcm030 @ >$(obj)include/config.h @[ -z "$(findstring LOWBOOT_,$@)" ] || \ - { echo "TEXT_BASE = 0xFF000000" >$(obj)board/phytec/pcm030/config.tmp ; \ - echo "... with LOWBOOT configuration" ; \ - } - @$(MKCONFIG) -a pcm030 powerpc mpc5xxx pcm030 phytec - -pf5200_config: unconfig - @$(MKCONFIG) pf5200 powerpc mpc5xxx pf5200 esd + echo "TEXT_BASE = 0xFF000000" >$(obj)board/phytec/pcm030/config.tmp + @$(MKCONFIG) -n $@ -a pcm030 powerpc mpc5xxx pcm030 phytec PM520_config \ PM520_DDR_config \ @@ -687,28 +608,16 @@ PM520_ROMBOOT_config \ PM520_ROMBOOT_DDR_config: unconfig @mkdir -p $(obj)include @[ -z "$(findstring DDR,$@)" ] || \ - { echo "#define CONFIG_MPC5200_DDR" >>$(obj)include/config.h ; \ - $(XECHO) "... DDR memory revision" ; \ - } + echo "#define CONFIG_MPC5200_DDR" >>$(obj)include/config.h @[ -z "$(findstring ROMBOOT,$@)" ] || \ - { echo "#define CONFIG_BOOT_ROM" >>$(obj)include/config.h ; \ - $(XECHO) "... booting from 8-bit flash" ; \ - } - @$(MKCONFIG) -a PM520 powerpc mpc5xxx pm520 - -smmaco4_config: unconfig - @$(MKCONFIG) -a smmaco4 powerpc mpc5xxx tqm5200 tqc - -spieval_config: unconfig - @$(MKCONFIG) -a spieval powerpc mpc5xxx tqm5200 tqc + echo "#define CONFIG_BOOT_ROM" >>$(obj)include/config.h + @$(MKCONFIG) -n $@ -a PM520 powerpc mpc5xxx pm520 TB5200_B_config \ TB5200_config: unconfig @mkdir -p $(obj)include @[ -z "$(findstring _B,$@)" ] || \ - { echo "#define CONFIG_TQM5200_B" >>$(obj)include/config.h ; \ - $(XECHO) "... with MPC5200B processor" ; \ - } + echo "#define CONFIG_TQM5200_B" >>$(obj)include/config.h @$(MKCONFIG) -n $@ -a TB5200 powerpc mpc5xxx tqm5200 tqc MINI5200_config \ @@ -725,18 +634,12 @@ Total5200_Rev2_lowboot_config: unconfig @mkdir -p $(obj)include @mkdir -p $(obj)board/total5200 @[ -n "$(findstring Rev,$@)" ] || \ - { echo "#define CONFIG_TOTAL5200_REV 1" >>$(obj)include/config.h ; \ - $(XECHO) "... revision 1 board" ; \ - } + echo "#define CONFIG_TOTAL5200_REV 1" >>$(obj)include/config.h @[ -z "$(findstring Rev2_,$@)" ] || \ - { echo "#define CONFIG_TOTAL5200_REV 2" >>$(obj)include/config.h ; \ - $(XECHO) "... revision 2 board" ; \ - } + echo "#define CONFIG_TOTAL5200_REV 2" >>$(obj)include/config.h @[ -z "$(findstring lowboot_,$@)" ] || \ - { echo "TEXT_BASE = 0xFE000000" >$(obj)board/total5200/config.tmp ; \ - $(XECHO) "... with lowboot configuration" ; \ - } - @$(MKCONFIG) -a Total5200 powerpc mpc5xxx total5200 + echo "TEXT_BASE = 0xFE000000" >$(obj)board/total5200/config.tmp + @$(MKCONFIG) -n $@ -a Total5200 powerpc mpc5xxx total5200 cam5200_config \ cam5200_niosflash_config \ @@ -751,55 +654,32 @@ TQM5200_STK100_config: unconfig @mkdir -p $(obj)include @mkdir -p $(obj)board/tqc/tqm5200 @[ -z "$(findstring cam5200,$@)" ] || \ - { echo "#define CONFIG_CAM5200" >>$(obj)include/config.h ; \ - echo "#define CONFIG_TQM5200S" >>$(obj)include/config.h ; \ - echo "#define CONFIG_TQM5200_B" >>$(obj)include/config.h ; \ - $(XECHO) "... TQM5200S on Cam5200" ; \ + { echo "#define CONFIG_CAM5200" >>$(obj)include/config.h ; \ + echo "#define CONFIG_TQM5200S" >>$(obj)include/config.h ; \ + echo "#define CONFIG_TQM5200_B" >>$(obj)include/config.h ; \ } @[ -z "$(findstring niosflash,$@)" ] || \ - { echo "#define CONFIG_CAM5200_NIOSFLASH" >>$(obj)include/config.h ; \ - $(XECHO) "... with NIOS flash driver" ; \ - } + echo "#define CONFIG_CAM5200_NIOSFLASH" >>$(obj)include/config.h @[ -z "$(findstring fo300,$@)" ] || \ - { echo "#define CONFIG_FO300" >>$(obj)include/config.h ; \ - $(XECHO) "... TQM5200 on FO300" ; \ - } + echo "#define CONFIG_FO300" >>$(obj)include/config.h @[ -z "$(findstring MiniFAP,$@)" ] || \ - { echo "#define CONFIG_MINIFAP" >>$(obj)include/config.h ; \ - $(XECHO) "... TQM5200_AC on MiniFAP" ; \ - } + echo "#define CONFIG_MINIFAP" >>$(obj)include/config.h @[ -z "$(findstring STK100,$@)" ] || \ - { echo "#define CONFIG_STK52XX_REV100" >>$(obj)include/config.h ; \ - $(XECHO) "... on a STK52XX.100 base board" ; \ - } + echo "#define CONFIG_STK52XX_REV100" >>$(obj)include/config.h @[ -z "$(findstring TQM5200_B,$@)" ] || \ - { echo "#define CONFIG_TQM5200_B" >>$(obj)include/config.h ; \ - } + echo "#define CONFIG_TQM5200_B" >>$(obj)include/config.h @[ -z "$(findstring TQM5200S,$@)" ] || \ - { echo "#define CONFIG_TQM5200S" >>$(obj)include/config.h ; \ - echo "#define CONFIG_TQM5200_B" >>$(obj)include/config.h ; \ + { echo "#define CONFIG_TQM5200S" >>$(obj)include/config.h ; \ + echo "#define CONFIG_TQM5200_B" >>$(obj)include/config.h ; \ } @[ -z "$(findstring HIGHBOOT,$@)" ] || \ - { echo "TEXT_BASE = 0xFFF00000" >$(obj)board/tqm5200/config.tmp ; \ - } + echo "TEXT_BASE = 0xFFF00000" >$(obj)board/tqm5200/config.tmp @$(MKCONFIG) -n $@ -a TQM5200 powerpc mpc5xxx tqm5200 tqc -uc101_config: unconfig - @$(MKCONFIG) uc101 powerpc mpc5xxx uc101 - -v38b_config: unconfig - @$(MKCONFIG) -a v38b powerpc mpc5xxx v38b - ######################################################################### ## MPC512x Systems ######################################################################### -aria_config: unconfig - @$(MKCONFIG) -a aria powerpc mpc512x aria davedenx - -mecp5123_config: unconfig - @$(MKCONFIG) -a mecp5123 powerpc mpc512x mecp5123 esd - mpc5121ads_config \ mpc5121ads_rev2_config \ : unconfig @@ -807,26 +687,21 @@ mpc5121ads_rev2_config \ @if [ "$(findstring rev2,$@)" ] ; then \ echo "#define CONFIG_ADS5121_REV2 1" > $(obj)include/config.h; \ fi - @$(MKCONFIG) -a mpc5121ads powerpc mpc512x mpc5121ads freescale - -pdm360ng_config: unconfig - @$(MKCONFIG) -a pdm360ng powerpc mpc512x pdm360ng + @$(MKCONFIG) -n $@ -a mpc5121ads powerpc mpc512x mpc5121ads freescale ######################################################################### ## MPC8xx Systems ######################################################################### -Adder_config \ Adder87x_config \ AdderII_config \ +AdderUSB_config \ +Adder_config \ : unconfig @mkdir -p $(obj)include $(if $(findstring AdderII,$@), \ - @echo "#define CONFIG_MPC852T" > $(obj)include/config.h) - @$(MKCONFIG) -a Adder powerpc mpc8xx adder - -AdderUSB_config: unconfig - @$(MKCONFIG) -a AdderUSB powerpc mpc8xx adder + @echo "#define CONFIG_MPC852T" > $(obj)include/config.h) + @$(MKCONFIG) -n $@ -a Adder powerpc mpc8xx adder ADS860_config \ FADS823_config \ @@ -834,159 +709,67 @@ FADS850SAR_config \ MPC86xADS_config \ MPC885ADS_config \ FADS860T_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx fads - -AMX860_config : unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx amx860 westel - -c2mon_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx c2mon - -CCM_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx CCM siemens - -cogent_mpc8xx_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx cogent - -ELPT860_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx elpt860 LEOX - -EP88x_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx ep88x - -ESTEEM192E_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx esteem192e - -ETX094_config : unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx etx094 - -FLAGADM_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx flagadm - -xtract_GEN860T = $(subst _SC,,$(subst _config,,$1)) + @$(MKCONFIG) -n $@ $@ powerpc mpc8xx fads GEN860T_SC_config \ GEN860T_config: unconfig @mkdir -p $(obj)include @[ -z "$(findstring _SC,$@)" ] || \ - { echo "#define CONFIG_SC" >>$(obj)include/config.h ; \ - $(XECHO) "With reduced H/W feature set (SC)..." ; \ - } - @$(MKCONFIG) -a $(call xtract_GEN860T,$@) powerpc mpc8xx gen860t - -GENIETV_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx genietv - -GTH_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx gth - -hermes_config : unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx hermes - -HMI10_config : unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx tqm8xx tqc - -IAD210_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx IAD210 siemens - -xtract_ICU862 = $(subst _100MHz,,$(subst _config,,$1)) + echo "#define CONFIG_SC" >>$(obj)include/config.h + @$(MKCONFIG) -n $@ -a GEN860T powerpc mpc8xx gen860t ICU862_100MHz_config \ ICU862_config: unconfig @mkdir -p $(obj)include @[ -z "$(findstring _100MHz,$@)" ] || \ - { echo "#define CONFIG_100MHz" >>$(obj)include/config.h ; \ - $(XECHO) "... with 100MHz system clock" ; \ - } - @$(MKCONFIG) -a $(call xtract_ICU862,$@) powerpc mpc8xx icu862 - -IP860_config : unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx ip860 + echo "#define CONFIG_100MHz" >>$(obj)include/config.h + @$(MKCONFIG) -n $@ -a ICU862 powerpc mpc8xx icu862 IVML24_256_config \ IVML24_128_config \ IVML24_config: unconfig @mkdir -p $(obj)include @[ -z "$(findstring IVML24_config,$@)" ] || \ - { echo "#define CONFIG_IVML24_16M" >>$(obj)include/config.h ; \ - } + echo "#define CONFIG_IVML24_16M" >>$(obj)include/config.h @[ -z "$(findstring IVML24_128_config,$@)" ] || \ - { echo "#define CONFIG_IVML24_32M" >>$(obj)include/config.h ; \ - } + echo "#define CONFIG_IVML24_32M" >>$(obj)include/config.h @[ -z "$(findstring IVML24_256_config,$@)" ] || \ - { echo "#define CONFIG_IVML24_64M" >>$(obj)include/config.h ; \ - } - @$(MKCONFIG) -a IVML24 powerpc mpc8xx ivm + echo "#define CONFIG_IVML24_64M" >>$(obj)include/config.h + @$(MKCONFIG) -n $@ -a IVML24 powerpc mpc8xx ivm IVMS8_256_config \ IVMS8_128_config \ IVMS8_config: unconfig @mkdir -p $(obj)include @[ -z "$(findstring IVMS8_config,$@)" ] || \ - { echo "#define CONFIG_IVMS8_16M" >>$(obj)include/config.h ; \ - } + echo "#define CONFIG_IVMS8_16M" >>$(obj)include/config.h @[ -z "$(findstring IVMS8_128_config,$@)" ] || \ - { echo "#define CONFIG_IVMS8_32M" >>$(obj)include/config.h ; \ - } + echo "#define CONFIG_IVMS8_32M" >>$(obj)include/config.h @[ -z "$(findstring IVMS8_256_config,$@)" ] || \ - { echo "#define CONFIG_IVMS8_64M" >>$(obj)include/config.h ; \ - } - @$(MKCONFIG) -a IVMS8 powerpc mpc8xx ivm - -kmsupx4_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx km8xx keymile - -KUP4K_config : unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx kup4k kup - -KUP4X_config : unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx kup4x kup - -LANTEC_config : unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx lantec - -lwmon_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx lwmon + echo "#define CONFIG_IVMS8_64M" >>$(obj)include/config.h + @$(MKCONFIG) -n $@ -a IVMS8 powerpc mpc8xx ivm MBX_config \ MBX860T_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx mbx8xx - -mgsuvd_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx km8xx keymile - -MHPC_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx mhpc eltec - -xtract_NETVIA = $(subst _V2,,$(subst _config,,$1)) + @$(MKCONFIG) -n $@ $@ powerpc mpc8xx mbx8xx NETVIA_V2_config \ NETVIA_config: unconfig @mkdir -p $(obj)include @[ -z "$(findstring NETVIA_config,$@)" ] || \ - { echo "#define CONFIG_NETVIA_VERSION 1" >>$(obj)include/config.h ; \ - $(XECHO) "... Version 1" ; \ - } + echo "#define CONFIG_NETVIA_VERSION 1" >>$(obj)include/config.h @[ -z "$(findstring NETVIA_V2_config,$@)" ] || \ - { echo "#define CONFIG_NETVIA_VERSION 2" >>$(obj)include/config.h ; \ - $(XECHO) "... Version 2" ; \ - } - @$(MKCONFIG) -a $(call xtract_NETVIA,$@) powerpc mpc8xx netvia - -xtract_NETPHONE = $(subst _V2,,$(subst _config,,$1)) + echo "#define CONFIG_NETVIA_VERSION 2" >>$(obj)include/config.h + @$(MKCONFIG) -n $@ -a NETVIA powerpc mpc8xx netvia NETPHONE_V2_config \ NETPHONE_config: unconfig @mkdir -p $(obj)include @[ -z "$(findstring NETPHONE_config,$@)" ] || \ - { echo "#define CONFIG_NETPHONE_VERSION 1" >>$(obj)include/config.h ; \ - } + echo "#define CONFIG_NETPHONE_VERSION 1" >>$(obj)include/config.h @[ -z "$(findstring NETPHONE_V2_config,$@)" ] || \ - { echo "#define CONFIG_NETPHONE_VERSION 2" >>$(obj)include/config.h ; \ - } - @$(MKCONFIG) -a $(call xtract_NETPHONE,$@) powerpc mpc8xx netphone - -xtract_NETTA = $(subst _SWAPHOOK,,$(subst _6412,,$(subst _ISDN,,$(subst _config,,$1)))) + echo "#define CONFIG_NETPHONE_VERSION 2" >>$(obj)include/config.h + @$(MKCONFIG) -n $@ -a NETPHONE powerpc mpc8xx netphone NETTA_ISDN_6412_SWAPHOOK_config \ NETTA_ISDN_SWAPHOOK_config \ @@ -998,83 +781,43 @@ NETTA_6412_config \ NETTA_config: unconfig @mkdir -p $(obj)include @[ -z "$(findstring ISDN_,$@)" ] || \ - { echo "#define CONFIG_NETTA_ISDN 1" >>$(obj)include/config.h ; \ - } + echo "#define CONFIG_NETTA_ISDN 1" >>$(obj)include/config.h @[ -n "$(findstring ISDN_,$@)" ] || \ - { echo "#undef CONFIG_NETTA_ISDN" >>$(obj)include/config.h ; \ - } + echo "#undef CONFIG_NETTA_ISDN" >>$(obj)include/config.h @[ -z "$(findstring 6412_,$@)" ] || \ - { echo "#define CONFIG_NETTA_6412 1" >>$(obj)include/config.h ; \ - } + echo "#define CONFIG_NETTA_6412 1" >>$(obj)include/config.h @[ -n "$(findstring 6412_,$@)" ] || \ - { echo "#undef CONFIG_NETTA_6412" >>$(obj)include/config.h ; \ - } + echo "#undef CONFIG_NETTA_6412" >>$(obj)include/config.h @[ -z "$(findstring SWAPHOOK_,$@)" ] || \ - { echo "#define CONFIG_NETTA_SWAPHOOK 1" >>$(obj)include/config.h ; \ - } + echo "#define CONFIG_NETTA_SWAPHOOK 1" >>$(obj)include/config.h @[ -n "$(findstring SWAPHOOK_,$@)" ] || \ - { echo "#undef CONFIG_NETTA_SWAPHOOK" >>$(obj)include/config.h ; \ - } - @$(MKCONFIG) -a $(call xtract_NETTA,$@) powerpc mpc8xx netta - -xtract_NETTA2 = $(subst _V2,,$(subst _config,,$1)) + echo "#undef CONFIG_NETTA_SWAPHOOK" >>$(obj)include/config.h + @$(MKCONFIG) -n $@ -a NETTA powerpc mpc8xx netta NETTA2_V2_config \ NETTA2_config: unconfig @mkdir -p $(obj)include @[ -z "$(findstring NETTA2_config,$@)" ] || \ - { echo "#define CONFIG_NETTA2_VERSION 1" >>$(obj)include/config.h ; \ - } + echo "#define CONFIG_NETTA2_VERSION 1" >>$(obj)include/config.h @[ -z "$(findstring NETTA2_V2_config,$@)" ] || \ - { echo "#define CONFIG_NETTA2_VERSION 2" >>$(obj)include/config.h ; \ - } - @$(MKCONFIG) -a $(call xtract_NETTA2,$@) powerpc mpc8xx netta2 + echo "#define CONFIG_NETTA2_VERSION 2" >>$(obj)include/config.h + @$(MKCONFIG) -n $@ -a NETTA2 powerpc mpc8xx netta2 NC650_Rev1_config \ NC650_Rev2_config \ CP850_config: unconfig @mkdir -p $(obj)include @[ -z "$(findstring CP850,$@)" ] || \ - { echo "#define CONFIG_CP850 1" >>$(obj)include/config.h ; \ - echo "#define CONFIG_IDS852_REV2 1" >>$(obj)include/config.h ; \ - } + { echo "#define CONFIG_CP850 1" >>$(obj)include/config.h ; \ + echo "#define CONFIG_IDS852_REV2 1" >>$(obj)include/config.h ; \ + } @[ -z "$(findstring Rev1,$@)" ] || \ - { echo "#define CONFIG_IDS852_REV1 1" >>$(obj)include/config.h ; \ - } + { echo "#define CONFIG_IDS852_REV1 1" >>$(obj)include/config.h ; \ + } @[ -z "$(findstring Rev2,$@)" ] || \ - { echo "#define CONFIG_IDS852_REV2 1" >>$(obj)include/config.h ; \ - } - @$(MKCONFIG) -a NC650 powerpc mpc8xx nc650 - -NX823_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx nx823 - -pcu_e_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx pcu_e siemens - -QS850_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx qs850 snmc - -QS823_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx qs850 snmc - -QS860T_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx qs860t snmc - -quantum_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx quantum - -R360MPI_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx r360mpi - -RBC823_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx rbc823 - -RPXClassic_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx RPXClassic - -RPXlite_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx RPXlite + { echo "#define CONFIG_IDS852_REV2 1" >>$(obj)include/config.h ; \ + } + @$(MKCONFIG) -n $@ -a NC650 powerpc mpc8xx nc650 RPXlite_DW_64_config \ RPXlite_DW_LCD_config \ @@ -1086,25 +829,14 @@ RPXlite_DW_NVRAM_64_LCD_config \ RPXlite_DW_config: unconfig @mkdir -p $(obj)include @[ -z "$(findstring _64,$@)" ] || \ - { echo "#define RPXlite_64MHz" >>$(obj)include/config.h ; \ - $(XECHO) "... with 64MHz system clock ..."; \ - } + echo "#define RPXlite_64MHz" >>$(obj)include/config.h @[ -z "$(findstring _LCD,$@)" ] || \ { echo "#define CONFIG_LCD" >>$(obj)include/config.h ; \ echo "#define CONFIG_NEC_NL6448BC20" >>$(obj)include/config.h ; \ - $(XECHO) "... with LCD display ..."; \ } @[ -z "$(findstring _NVRAM,$@)" ] || \ - { echo "#define CONFIG_ENV_IS_IN_NVRAM" >>$(obj)include/config.h ; \ - $(XECHO) "... with ENV in NVRAM ..."; \ - } - @$(MKCONFIG) -a RPXlite_DW powerpc mpc8xx RPXlite_dw - -rmu_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx rmu - -RRvision_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx RRvision + echo "#define CONFIG_ENV_IS_IN_NVRAM" >>$(obj)include/config.h + @$(MKCONFIG) -n $@ -a RPXlite_DW powerpc mpc8xx RPXlite_dw RRvision_LCD_config: unconfig @mkdir -p $(obj)include @@ -1112,32 +844,16 @@ RRvision_LCD_config: unconfig @echo "#define CONFIG_SHARP_LQ104V7DS01" >>$(obj)include/config.h @$(MKCONFIG) -a RRvision powerpc mpc8xx RRvision -SM850_config : unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx tqm8xx tqc - -spc1920_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx spc1920 - SPD823TS_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx spd8xx - -stxxtc_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx stxxtc stx - -svm_sc8xx_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx svm_sc8xx + @$(MKCONFIG) $@ powerpc mpc8xx spd8xx SXNI855T_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx sixnet - -# EMK MPC8xx based modules -TOP860_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx top860 emk + @$(MKCONFIG) $@ powerpc mpc8xx sixnet # Play some tricks for configuration selection # Only 855 and 860 boards may come with FEC # and only 823 boards may have LCD support -xtract_8xx = $(subst _LCD,,$(subst _config,,$1)) +xtract_8xx = $(subst _LCD,,$1) FPS850L_config \ FPS860L_config \ @@ -1161,9 +877,8 @@ virtlab2_config: unconfig @[ -z "$(findstring _LCD,$@)" ] || \ { echo "#define CONFIG_LCD" >>$(obj)include/config.h ; \ echo "#define CONFIG_NEC_NL6448BC20" >>$(obj)include/config.h ; \ - $(XECHO) "... with LCD display" ; \ } - @$(MKCONFIG) -a $(call xtract_8xx,$@) powerpc mpc8xx tqm8xx tqc + @$(MKCONFIG) -n $@ -a $(call xtract_8xx,$@) powerpc mpc8xx tqm8xx tqc TTTech_config: unconfig @mkdir -p $(obj)include @@ -1171,14 +886,11 @@ TTTech_config: unconfig @echo "#define CONFIG_SHARP_LQ104V7DS01" >>$(obj)include/config.h @$(MKCONFIG) -a TQM823L powerpc mpc8xx tqm8xx tqc -uc100_config : unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx uc100 - v37_config: unconfig @mkdir -p $(obj)include @echo "#define CONFIG_LCD" >$(obj)include/config.h @echo "#define CONFIG_SHARP_LQ084V1DG21" >>$(obj)include/config.h - @$(MKCONFIG) $(@:_config=) powerpc mpc8xx v37 + @$(MKCONFIG) $@ powerpc mpc8xx v37 wtk_config: unconfig @mkdir -p $(obj)include @@ -1189,53 +901,22 @@ wtk_config: unconfig ######################################################################### ## PPC4xx Systems ######################################################################### -xtract_4xx = $(subst _25,,$(subst _33,,$(subst _BA,,$(subst _ME,,$(subst _HI,,$(subst _config,,$1)))))) - -acadia_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx acadia amcc acadia_nand_config: unconfig @mkdir -p $(obj)include $(obj)board/amcc/acadia @mkdir -p $(obj)nand_spl/board/amcc/acadia @echo "#define CONFIG_NAND_U_BOOT" > $(obj)include/config.h - @$(MKCONFIG) -n $@ -a acadia powerpc ppc4xx acadia amcc @echo "TEXT_BASE = 0x01000000" > $(obj)board/amcc/acadia/config.tmp @echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk - -ADCIOP_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx adciop esd - -alpr_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx alpr prodrive - -AP1000_config:unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx ap1000 amirix - -APC405_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx apc405 esd - -AR405_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx ar405 esd - -ASH405_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx ash405 esd - -bamboo_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx bamboo amcc + @$(MKCONFIG) -n $@ -a acadia powerpc ppc4xx acadia amcc bamboo_nand_config: unconfig @mkdir -p $(obj)include $(obj)board/amcc/bamboo @mkdir -p $(obj)nand_spl/board/amcc/bamboo @echo "#define CONFIG_NAND_U_BOOT" > $(obj)include/config.h - @$(MKCONFIG) -n $@ -a bamboo powerpc ppc4xx bamboo amcc @echo "TEXT_BASE = 0x01000000" > $(obj)board/amcc/bamboo/config.tmp @echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk - -bubinga_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx bubinga amcc - -CANBT_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx canbt esd + @$(MKCONFIG) -n $@ -a bamboo powerpc ppc4xx bamboo amcc # Arches, Canyonlands & Glacier use different U-Boot images arches_config \ @@ -1253,71 +934,28 @@ glacier_nand_config: unconfig @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 powerpc ppc4xx canyonlands amcc @echo "TEXT_BASE = 0x01000000" > $(obj)board/amcc/canyonlands/config.tmp @echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk + @$(MKCONFIG) -n $@ -a canyonlands powerpc ppc4xx canyonlands amcc CATcenter_config \ CATcenter_25_config \ CATcenter_33_config: unconfig @mkdir -p $(obj)include - @ echo "/* CATcenter uses PPChameleon Model ME */" > $(obj)include/config.h - @ echo "#define CONFIG_PPCHAMELEON_MODULE_MODEL 1" >> $(obj)include/config.h + @echo "/* CATcenter uses PPChameleon Model ME */" > $(obj)include/config.h + @echo "#define CONFIG_PPCHAMELEON_MODULE_MODEL 1" >> $(obj)include/config.h @[ -z "$(findstring _25,$@)" ] || \ - { echo "#define CONFIG_PPCHAMELEON_CLK_25" >> $(obj)include/config.h ; \ - $(XECHO) "SysClk = 25MHz" ; \ - } + echo "#define CONFIG_PPCHAMELEON_CLK_25" >> $(obj)include/config.h @[ -z "$(findstring _33,$@)" ] || \ - { echo "#define CONFIG_PPCHAMELEON_CLK_33" >> $(obj)include/config.h ; \ - $(XECHO) "SysClk = 33MHz" ; \ - } - @$(MKCONFIG) -a $(call xtract_4xx,$@) powerpc ppc4xx PPChameleonEVB dave - -CMS700_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx cms700 esd - -CPCI2DP_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx cpci2dp esd + echo "#define CONFIG_PPCHAMELEON_CLK_33" >> $(obj)include/config.h + @$(MKCONFIG) -n $@ -a CATcenter powerpc ppc4xx PPChameleonEVB dave CPCI405_config \ CPCI4052_config \ CPCI405DT_config \ CPCI405AB_config: unconfig @mkdir -p $(obj)board/esd/cpci405 - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx cpci405 esd - -CPCIISER4_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx cpciiser4 esd - -CRAYL1_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx L1 cray - -csb272_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx csb272 - -csb472_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx csb472 - -DASA_SIM_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx dasa_sim esd - -dlvision_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx dlvision gdsys - -DP405_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx dp405 esd - -DU405_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx du405 esd - -DU440_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx du440 esd - -ebony_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx ebony amcc - -ERIC_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx eric + @$(MKCONFIG) -n $@ $@ powerpc ppc4xx cpci405 esd fx12mm_flash_config: unconfig @mkdir -p $(obj)include $(obj)board/xilinx/ppc405-generic @@ -1337,29 +975,6 @@ fx12mm_config: unconfig >> $(obj)board/avnet/fx12mm/config.tmp @$(MKCONFIG) fx12mm powerpc ppc4xx fx12mm avnet -G2000_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx g2000 - -gdppc440etx_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx gdppc440etx gdsys - -hcu4_config: unconfig - @mkdir -p $(obj)board/netstal/common - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx hcu4 netstal - -hcu5_config: unconfig - @mkdir -p $(obj)board/netstal/common - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx hcu5 netstal - -HH405_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx hh405 esd - -HUB405_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx hub405 esd - -icon_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx icon mosaixtech - # Compact-Center(codename intip) & DevCon-Center use different U-Boot images intip_config \ devconcenter_config: unconfig @@ -1368,50 +983,25 @@ devconcenter_config: unconfig tr '[:lower:]' '[:upper:]')" >$(obj)include/config.h @$(MKCONFIG) -n $@ -a intip powerpc ppc4xx intip gdsys -JSE_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx jse - -KAREF_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx karef sandburst - -katmai_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx katmai amcc +hcu4_config \ +hcu5_config \ +mcu25_config: unconfig + @mkdir -p $(obj)board/netstal/common + @$(MKCONFIG) $@ powerpc ppc4xx $(call lcname,$@) netstal # Kilauea & Haleakala images are identical (recognized via PVR) kilauea_config \ haleakala_config: unconfig - @$(MKCONFIG) -n $@ -a kilauea powerpc ppc4xx kilauea amcc + @$(MKCONFIG) -n $@ kilauea powerpc ppc4xx kilauea amcc kilauea_nand_config \ haleakala_nand_config: unconfig @mkdir -p $(obj)include $(obj)board/amcc/kilauea @mkdir -p $(obj)nand_spl/board/amcc/kilauea @echo "#define CONFIG_NAND_U_BOOT" > $(obj)include/config.h - @$(MKCONFIG) -n $@ -a kilauea powerpc ppc4xx kilauea amcc @echo "TEXT_BASE = 0x01000000" > $(obj)board/amcc/kilauea/config.tmp @echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk - -korat_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx korat - -luan_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx luan amcc - -lwmon5_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx lwmon5 - -makalu_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx makalu amcc - -mcu25_config: unconfig - @mkdir -p $(obj)board/netstal/common - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx mcu25 netstal - -METROBOX_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx metrobox sandburst - -MIP405_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx mip405 mpl + @$(MKCONFIG) -n $@ -a kilauea powerpc ppc4xx kilauea amcc MIP405T_config: unconfig @mkdir -p $(obj)include @@ -1419,9 +1009,6 @@ MIP405T_config: unconfig @$(XECHO) "Enable subset config for MIP405T" @$(MKCONFIG) -a MIP405 powerpc ppc4xx mip405 mpl -ML2_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx ml2 - ml507_flash_config: unconfig @mkdir -p $(obj)include $(obj)board/xilinx/ppc440-generic @mkdir -p $(obj)include $(obj)board/xilinx/ml507 @@ -1438,41 +1025,11 @@ ml507_config: unconfig > $(obj)board/xilinx/ml507/config.tmp @echo "TEXT_BASE := 0x04000000" \ >> $(obj)board/xilinx/ml507/config.tmp - @$(MKCONFIG) ml507 powerpc ppc4xx ml507 xilinx - -neo_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx neo gdsys - -ocotea_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx ocotea amcc + @$(MKCONFIG) $@ powerpc ppc4xx ml507 xilinx OCRTC_config \ ORSG_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx ocrtc esd - -p3p440_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx p3p440 prodrive - -PCI405_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx pci405 esd - -pcs440ep_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx pcs440ep - -PIP405_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx pip405 mpl - -PLU405_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx plu405 esd - -PMC405_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx pmc405 esd - -PMC405DE_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx pmc405de esd - -PMC440_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx pmc440 esd + @$(MKCONFIG) -n $@ $@ powerpc ppc4xx ocrtc esd PPChameleonEVB_config \ PPChameleonEVB_BA_25_config \ @@ -1483,38 +1040,16 @@ PPChameleonEVB_ME_33_config \ PPChameleonEVB_HI_33_config: unconfig @mkdir -p $(obj)include @[ -z "$(findstring EVB_BA,$@)" ] || \ - { echo "#define CONFIG_PPCHAMELEON_MODULE_MODEL 0" >>$(obj)include/config.h ; \ - $(XECHO) "... BASIC model" ; \ - } + echo "#define CONFIG_PPCHAMELEON_MODULE_MODEL 0" >>$(obj)include/config.h @[ -z "$(findstring EVB_ME,$@)" ] || \ - { echo "#define CONFIG_PPCHAMELEON_MODULE_MODEL 1" >>$(obj)include/config.h ; \ - $(XECHO) "... MEDIUM model" ; \ - } + echo "#define CONFIG_PPCHAMELEON_MODULE_MODEL 1" >>$(obj)include/config.h @[ -z "$(findstring EVB_HI,$@)" ] || \ - { echo "#define CONFIG_PPCHAMELEON_MODULE_MODEL 2" >>$(obj)include/config.h ; \ - $(XECHO) "... HIGH-END model" ; \ - } + echo "#define CONFIG_PPCHAMELEON_MODULE_MODEL 2" >>$(obj)include/config.h @[ -z "$(findstring _25,$@)" ] || \ - { echo "#define CONFIG_PPCHAMELEON_CLK_25" >>$(obj)include/config.h ; \ - $(XECHO) "SysClk = 25MHz" ; \ - } + echo "#define CONFIG_PPCHAMELEON_CLK_25" >>$(obj)include/config.h @[ -z "$(findstring _33,$@)" ] || \ - { echo "#define CONFIG_PPCHAMELEON_CLK_33" >>$(obj)include/config.h ; \ - $(XECHO) "SysClk = 33MHz" ; \ - } - @$(MKCONFIG) -a $(call xtract_4xx,$@) powerpc ppc4xx PPChameleonEVB dave - -quad100hd_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx quad100hd - -redwood_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx redwood amcc - -sbc405_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx sbc405 - -sc3_config:unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx sc3 + echo "#define CONFIG_PPCHAMELEON_CLK_33" >>$(obj)include/config.h + @$(MKCONFIG) -n $@ -a PPChameleonEVB powerpc ppc4xx PPChameleonEVB dave sequoia_config \ rainier_config: unconfig @@ -1530,9 +1065,9 @@ rainier_nand_config: unconfig @echo "#define CONFIG_NAND_U_BOOT" > $(obj)include/config.h @echo "#define CONFIG_$$(echo $(subst ,,$(@:_config=)) | \ tr '[:lower:]' '[:upper:]')" >> $(obj)include/config.h - @$(MKCONFIG) -n $@ -a sequoia powerpc ppc4xx sequoia amcc @echo "TEXT_BASE = 0x01000000" > $(obj)board/amcc/sequoia/config.tmp @echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk + @$(MKCONFIG) -n $@ -a sequoia powerpc ppc4xx sequoia amcc sequoia_ramboot_config \ rainier_ramboot_config: unconfig @@ -1540,16 +1075,10 @@ rainier_ramboot_config: unconfig @echo "#define CONFIG_SYS_RAMBOOT" > $(obj)include/config.h @echo "#define CONFIG_$$(echo $(subst ,,$(@:_config=)) | \ tr '[:lower:]' '[:upper:]')" >> $(obj)include/config.h - @$(MKCONFIG) -n $@ -a sequoia powerpc ppc4xx sequoia amcc @echo "TEXT_BASE = 0x01000000" > $(obj)board/amcc/sequoia/config.tmp @echo "LDSCRIPT = board/amcc/sequoia/u-boot-ram.lds" >> \ $(obj)board/amcc/sequoia/config.tmp - -taihu_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx taihu amcc - -taishan_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx taishan amcc + @$(MKCONFIG) -n $@ -a sequoia powerpc ppc4xx sequoia amcc v5fx30teval_config: unconfig @mkdir -p $(obj)include $(obj)board/xilinx/ppc440-generic @@ -1558,7 +1087,7 @@ v5fx30teval_config: unconfig > $(obj)board/avnet/v5fx30teval/config.tmp @echo "TEXT_BASE := 0x03000000" \ >> $(obj)board/avnet/v5fx30teval/config.tmp - @$(MKCONFIG) v5fx30teval powerpc ppc4xx v5fx30teval avnet + @$(MKCONFIG) $@ powerpc ppc4xx v5fx30teval avnet v5fx30teval_flash_config: unconfig @mkdir -p $(obj)include $(obj)board/xilinx/ppc440-generic @@ -1569,23 +1098,14 @@ v5fx30teval_flash_config: unconfig >> $(obj)board/avnet/v5fx30teval/config.tmp @$(MKCONFIG) v5fx30teval powerpc ppc4xx v5fx30teval avnet -VOH405_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx voh405 esd - -VOM405_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx vom405 esd - W7OLMC_config \ W7OLMG_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx w7o + @$(MKCONFIG) $@ powerpc ppc4xx w7o # Walnut & Sycamore images are identical (recognized via PVR) walnut_config \ sycamore_config: unconfig - @$(MKCONFIG) -n $@ -a walnut powerpc ppc4xx walnut amcc - -WUH405_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx wuh405 esd + @$(MKCONFIG) -n $@ walnut powerpc ppc4xx walnut amcc xilinx-ppc405-generic_flash_config: unconfig @mkdir -p $(obj)include $(obj)board/xilinx/ppc405-generic @@ -1619,9 +1139,6 @@ xilinx-ppc440-generic_config: unconfig >> $(obj)board/xilinx/ppc440-generic/config.tmp @$(MKCONFIG) xilinx-ppc440-generic powerpc ppc4xx ppc440-generic xilinx -XPEDITE1000_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx xpedite1000 xes - yosemite_config \ yellowstone_config: unconfig @mkdir -p $(obj)include @@ -1629,64 +1146,23 @@ yellowstone_config: unconfig tr '[:lower:]' '[:upper:]')" >$(obj)include/config.h @$(MKCONFIG) -n $@ -a yosemite powerpc ppc4xx yosemite amcc -yucca_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx yucca amcc - -zeus_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc ppc4xx zeus - -######################################################################### -## MPC8220 Systems -######################################################################### - -Alaska8220_config \ -Yukon8220_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8220 alaska - -sorcery_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8220 sorcery - ######################################################################### ## MPC824x Systems ######################################################################### -xtract_82xx = $(subst _BIGFLASH,,$(subst _ROMBOOT,,$(subst _L2,,$(subst _266MHz,,$(subst _300MHz,,$(subst _config,,$1)))))) - -A3000_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc824x a3000 -barco_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc824x barco - -BMW_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc824x bmw +eXalion_config: unconfig + @$(MKCONFIG) $(@:_config=) powerpc mpc824x eXalion CPC45_config \ CPC45_ROMBOOT_config: unconfig - @$(MKCONFIG) $(call xtract_82xx,$@) powerpc mpc824x cpc45 - @cd $(obj)include ; \ + @mkdir -p $(obj)include ; \ if [ "$(findstring _ROMBOOT_,$@)" ] ; then \ - echo "CONFIG_BOOT_ROM = y" >> config.mk ; \ - $(XECHO) "... booting from 8-bit flash" ; \ + echo "CONFIG_BOOT_ROM = y" >> $(obj)include/config.mk ; \ else \ - echo "CONFIG_BOOT_ROM = n" >> config.mk ; \ - $(XECHO) "... booting from 64-bit flash" ; \ + echo "CONFIG_BOOT_ROM = n" >> $(obj)include/config.mk ; \ fi; \ - echo "export CONFIG_BOOT_ROM" >> config.mk; - -CU824_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc824x cu824 - -debris_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc824x debris etin - -eXalion_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc824x eXalion - -HIDDEN_DRAGON_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc824x hidden_dragon - -kvme080_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc824x kvme080 etin + echo "export CONFIG_BOOT_ROM" >> $(obj)include/config.mk; + @$(MKCONFIG) -n $@ CPC45 powerpc mpc824x cpc45 # HDLAN is broken ATM. Should be fixed as soon as hardware is available and as # time permits. @@ -1700,90 +1176,44 @@ linkstation_HGLAN_config: unconfig esac @$(MKCONFIG) -n $@ -a linkstation powerpc mpc824x linkstation -MOUSSE_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc824x mousse - -MUSENKI_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc824x musenki - -MVBLUE_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc824x mvblue - -OXC_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc824x oxc - -PN62_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc824x pn62 - Sandpoint8240_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc824x sandpoint + @$(MKCONFIG) $@ powerpc mpc824x sandpoint Sandpoint8245_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc824x sandpoint - -sbc8240_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc824x sbc8240 - -utx8245_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc824x utx8245 + @$(MKCONFIG) $@ powerpc mpc824x sandpoint ######################################################################### ## MPC8260 Systems ######################################################################### -atc_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8260 atc - cogent_mpc8260_config: unconfig @$(MKCONFIG) $(@:_config=) powerpc mpc8260 cogent CPU86_config \ CPU86_ROMBOOT_config: unconfig - @$(MKCONFIG) $(call xtract_82xx,$@) powerpc mpc8260 cpu86 - @cd $(obj)include ; \ + @mkdir -p $(obj)include ; \ if [ "$(findstring _ROMBOOT_,$@)" ] ; then \ - echo "CONFIG_BOOT_ROM = y" >> config.mk ; \ - $(XECHO) "... booting from 8-bit flash" ; \ + echo "CONFIG_BOOT_ROM = y" >> $(obj)include/config.mk ; \ else \ - echo "CONFIG_BOOT_ROM = n" >> config.mk ; \ - $(XECHO) "... booting from 64-bit flash" ; \ + echo "CONFIG_BOOT_ROM = n" >> $(obj)include/config.mk ; \ fi; \ - echo "export CONFIG_BOOT_ROM" >> config.mk; + echo "export CONFIG_BOOT_ROM" >> $(obj)include/config.mk; + @$(MKCONFIG) -n $@ CPU86 powerpc mpc8260 cpu86 CPU87_config \ CPU87_ROMBOOT_config: unconfig - @$(MKCONFIG) $(call xtract_82xx,$@) powerpc mpc8260 cpu87 - @cd $(obj)include ; \ + @mkdir -p $(obj)include ; \ if [ "$(findstring _ROMBOOT_,$@)" ] ; then \ - echo "CONFIG_BOOT_ROM = y" >> config.mk ; \ - $(XECHO) "... booting from 8-bit flash" ; \ + echo "CONFIG_BOOT_ROM = y" >> $(obj)include/config.mk ; \ else \ - echo "CONFIG_BOOT_ROM = n" >> config.mk ; \ - $(XECHO) "... booting from 64-bit flash" ; \ + echo "CONFIG_BOOT_ROM = n" >> $(obj)include/config.mk ; \ fi; \ - echo "export CONFIG_BOOT_ROM" >> config.mk; + echo "export CONFIG_BOOT_ROM" >> $(obj)include/config.mk; + @$(MKCONFIG) -n $@ CPU87 powerpc mpc8260 cpu87 ep8248_config \ ep8248E_config : unconfig - @$(MKCONFIG) ep8248 powerpc mpc8260 ep8248 - -ep8260_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8260 ep8260 - -ep82xxm_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8260 ep82xxm - -gw8260_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8260 gw8260 - -hymod_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8260 hymod - -IDS8247_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8260 ids8247 - -IPHASE4539_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8260 iphase4539 + @$(MKCONFIG) -n $@ ep8248 powerpc mpc8260 ep8248 ISPAN_config \ ISPAN_REVB_config: unconfig @@ -1791,10 +1221,7 @@ ISPAN_REVB_config: unconfig @if [ "$(findstring _REVB_,$@)" ] ; then \ echo "#define CONFIG_SYS_REV_B" > $(obj)include/config.h ; \ fi - @$(MKCONFIG) -a ISPAN powerpc mpc8260 ispan - -mgcoge_config : unconfig - @$(MKCONFIG) mgcoge powerpc mpc8260 mgcoge keymile + @$(MKCONFIG) -n $@ -a ISPAN powerpc mpc8260 ispan MPC8260ADS_config \ MPC8260ADS_lowboot_config \ @@ -1823,13 +1250,8 @@ 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/freescale/mpc8260ads/config.tmp ; \ - $(XECHO) "... with lowboot configuration" ; \ - } - @$(MKCONFIG) -a MPC8260ADS powerpc mpc8260 mpc8260ads freescale - -MPC8266ADS_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8260 mpc8266ads freescale + echo "TEXT_BASE = 0xFF800000" >$(obj)board/freescale/mpc8260ads/config.tmp + @$(MKCONFIG) -n $@ -a MPC8260ADS powerpc mpc8260 mpc8260ads freescale muas3001_dev_config \ muas3001_config : unconfig @@ -1838,7 +1260,7 @@ muas3001_config : unconfig @if [ "$(findstring dev,$@)" ] ; then \ echo "#define CONFIG_MUAS_DEV_BOARD" > $(obj)include/config.h ; \ fi - @$(MKCONFIG) -a muas3001 powerpc mpc8260 muas3001 + @$(MKCONFIG) -n $@ -a muas3001 powerpc mpc8260 muas3001 # PM825/PM826 default configuration: small (= 8 MB) Flash / boot from 64-bit flash PM825_config \ @@ -1857,15 +1279,12 @@ PM826_ROMBOOT_BIGFLASH_config: unconfig >$(obj)include/config.h ; \ fi @if [ "$(findstring _ROMBOOT_,$@)" ] ; then \ - $(XECHO) "... booting from 8-bit flash" ; \ echo "#define CONFIG_BOOT_ROM" >>$(obj)include/config.h ; \ echo "TEXT_BASE = 0xFF800000" >$(obj)board/pm826/config.tmp ; \ if [ "$(findstring _BIGFLASH_,$@)" ] ; then \ - $(XECHO) "... with 32 MB Flash" ; \ echo "#define CONFIG_FLASH_32MB" >>$(obj)include/config.h ; \ fi; \ else \ - $(XECHO) "... booting from 64-bit flash" ; \ if [ "$(findstring _BIGFLASH_,$@)" ] ; then \ $(XECHO) "... with 32 MB Flash" ; \ echo "#define CONFIG_FLASH_32MB" >>$(obj)include/config.h ; \ @@ -1874,7 +1293,7 @@ PM826_ROMBOOT_BIGFLASH_config: unconfig echo "TEXT_BASE = 0xFF000000" >$(obj)board/pm826/config.tmp ; \ fi; \ fi - @$(MKCONFIG) -a PM826 powerpc mpc8260 pm826 + @$(MKCONFIG) -n $@ -a PM826 powerpc mpc8260 pm826 PM828_config \ PM828_PCI_config \ @@ -1884,39 +1303,19 @@ PM828_ROMBOOT_PCI_config: unconfig @mkdir -p $(obj)board/pm826 @if [ "$(findstring _PCI_,$@)" ] ; then \ echo "#define CONFIG_PCI" >>$(obj)include/config.h ; \ - $(XECHO) "... with PCI enabled" ; \ fi @if [ "$(findstring _ROMBOOT_,$@)" ] ; then \ - $(XECHO) "... booting from 8-bit flash" ; \ echo "#define CONFIG_BOOT_ROM" >>$(obj)include/config.h ; \ echo "TEXT_BASE = 0xFF800000" >$(obj)board/pm826/config.tmp ; \ fi - @$(MKCONFIG) -a PM828 powerpc mpc8260 pm828 - -ppmc8260_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8260 ppmc8260 + @$(MKCONFIG) -n $@ -a PM828 powerpc mpc8260 pm828 Rattler8248_config \ Rattler_config: unconfig @mkdir -p $(obj)include $(if $(findstring 8248,$@), \ - @echo "#define CONFIG_MPC8248" > $(obj)include/config.h) - @$(MKCONFIG) -a Rattler powerpc mpc8260 rattler - -RPXsuper_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8260 rpxsuper - -rsdproto_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8260 rsdproto - -sacsng_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8260 sacsng - -sbc8260_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8260 sbc8260 - -SCM_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8260 SCM siemens + @echo "#define CONFIG_MPC8248" > $(obj)include/config.h) + @$(MKCONFIG) -n $@ -a Rattler powerpc mpc8260 rattler TQM8255_AA_config \ TQM8260_AA_config \ @@ -1947,34 +1346,23 @@ TQM8265_AA_config: unconfig echo "#define CONFIG_$${CTYPE}" >>$(obj)include/config.h ; \ fi; \ echo "#define CONFIG_$${CFREQ}MHz" >>$(obj)include/config.h ; \ - echo "... with $${CFREQ}MHz system clock" ; \ if [ "$${CACHE}" = "yes" ] ; then \ echo "#define CONFIG_L2_CACHE" >>$(obj)include/config.h ; \ - $(XECHO) "... with L2 Cache support" ; \ else \ echo "#undef CONFIG_L2_CACHE" >>$(obj)include/config.h ; \ - $(XECHO) "... without L2 Cache support" ; \ fi; \ if [ "$${BMODE}" = "60x" ] ; then \ echo "#define CONFIG_BUSMODE_60x" >>$(obj)include/config.h ; \ - $(XECHO) "... with 60x Bus Mode" ; \ else \ echo "#undef CONFIG_BUSMODE_60x" >>$(obj)include/config.h ; \ - $(XECHO) "... without 60x Bus Mode" ; \ fi - @$(MKCONFIG) -a TQM8260 powerpc mpc8260 tqm8260 tqc - -TQM8272_config: unconfig - @$(MKCONFIG) TQM8272 powerpc mpc8260 tqm8272 tqc + @$(MKCONFIG) -n $@ -a TQM8260 powerpc mpc8260 tqm8260 tqc VoVPN-GW_66MHz_config \ VoVPN-GW_100MHz_config: unconfig @mkdir -p $(obj)include @echo "#define CONFIG_CLKIN_$(word 2,$(subst _, ,$@))" > $(obj)include/config.h - @$(MKCONFIG) -a VoVPN-GW powerpc mpc8260 vovpn-gw funkwerk - -ZPC1900_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc8260 zpc1900 + @$(MKCONFIG) -n $@ -a VoVPN-GW powerpc mpc8260 vovpn-gw funkwerk ######################################################################### ## Coldfire @@ -1982,10 +1370,7 @@ ZPC1900_config: unconfig astro_mcf5373l_config \ astro_mcf5373l_RAM_config : unconfig - @$(MKCONFIG) -t $(@:_config=) astro_mcf5373l m68k mcf532x mcf5373l astro - -M5208EVBE_config : unconfig - @$(MKCONFIG) $(@:_config=) m68k mcf52x2 m5208evbe freescale + @$(MKCONFIG) -n $@ -t $@ astro_mcf5373l m68k mcf532x mcf5373l astro M52277EVB_config \ M52277EVB_spansion_config \ @@ -1999,16 +1384,14 @@ M52277EVB_stmicro_config : unconfig echo "#define CONFIG_SYS_SPANSION_BOOT" >> $(obj)include/config.h ; \ echo "TEXT_BASE = 0x00000000" > $(obj)board/freescale/m52277evb/config.tmp ; \ cp $(obj)board/freescale/m52277evb/u-boot.spa $(obj)board/freescale/m52277evb/u-boot.lds ; \ - $(XECHO) "... with SPANSION boot..." ; \ fi; \ if [ "$${FLASH}" = "STMICRO" ] ; then \ echo "#define CONFIG_CF_SBF" >> $(obj)include/config.h ; \ echo "#define CONFIG_SYS_STMICRO_BOOT" >> $(obj)include/config.h ; \ echo "TEXT_BASE = 0x43E00000" > $(obj)board/freescale/m52277evb/config.tmp ; \ cp $(obj)board/freescale/m52277evb/u-boot.stm $(obj)board/freescale/m52277evb/u-boot.lds ; \ - $(XECHO) "... with ST Micro boot..." ; \ fi - @$(MKCONFIG) -a M52277EVB m68k mcf5227x m52277evb freescale + @$(MKCONFIG) -n $@ -a M52277EVB m68k mcf5227x m52277evb freescale M5235EVB_config \ M5235EVB_Flash16_config \ @@ -2026,52 +1409,22 @@ M5235EVB_Flash32_config: unconfig echo "TEXT_BASE = 0xFFE00000" > $(obj)board/freescale/m5235evb/config.tmp ; \ cp $(obj)board/freescale/m5235evb/u-boot.16 $(obj)board/freescale/m5235evb/u-boot.lds ; \ fi - @$(MKCONFIG) -a M5235EVB m68k mcf523x m5235evb freescale - -M5249EVB_config : unconfig - @$(MKCONFIG) $(@:_config=) m68k mcf52x2 m5249evb freescale - -M5253DEMO_config : unconfig - @$(MKCONFIG) $(@:_config=) m68k mcf52x2 m5253demo freescale - -M5253EVBE_config : unconfig - @$(MKCONFIG) $(@:_config=) m68k mcf52x2 m5253evbe freescale + @$(MKCONFIG) -n $@ -a M5235EVB m68k mcf523x m5235evb freescale cobra5272_config : unconfig - @$(MKCONFIG) $(@:_config=) m68k mcf52x2 cobra5272 + @$(MKCONFIG) $@ m68k mcf52x2 cobra5272 EB+MCF-EV123_config : unconfig @mkdir -p $(obj)include @mkdir -p $(obj)board/BuS/EB+MCF-EV123 @echo "TEXT_BASE = 0xFFE00000"|tee $(obj)board/BuS/EB+MCF-EV123/textbase.mk - @$(MKCONFIG) EB+MCF-EV123 m68k mcf52x2 EB+MCF-EV123 BuS + @$(MKCONFIG) -n $@ EB+MCF-EV123 m68k mcf52x2 EB+MCF-EV123 BuS EB+MCF-EV123_internal_config : unconfig @mkdir -p $(obj)include @mkdir -p $(obj)board/BuS/EB+MCF-EV123 @echo "TEXT_BASE = 0xF0000000"|tee $(obj)board/BuS/EB+MCF-EV123/textbase.mk - @$(MKCONFIG) EB+MCF-EV123 m68k mcf52x2 EB+MCF-EV123 BuS - -EP2500_config: unconfig - @$(MKCONFIG) $(@:_config=) m68k mcf52x2 ep2500 Mercury - -idmr_config : unconfig - @$(MKCONFIG) $(@:_config=) m68k mcf52x2 idmr - -M5271EVB_config : unconfig - @$(MKCONFIG) $(@:_config=) m68k mcf52x2 m5271evb freescale - -M5272C3_config : unconfig - @$(MKCONFIG) $(@:_config=) m68k mcf52x2 m5272c3 freescale - -M5275EVB_config : unconfig - @$(MKCONFIG) $(@:_config=) m68k mcf52x2 m5275evb freescale - -M5282EVB_config : unconfig - @$(MKCONFIG) $(@:_config=) m68k mcf52x2 m5282evb freescale - -M53017EVB_config : unconfig - @$(MKCONFIG) $(@:_config=) m68k mcf532x m53017evb freescale + @$(MKCONFIG) -n $@ EB+MCF-EV123 m68k mcf52x2 EB+MCF-EV123 BuS M5329AFEE_config \ M5329BFEE_config : unconfig @@ -2082,7 +1435,7 @@ M5329BFEE_config : unconfig if [ "$${NAND}" != "0" ] ; then \ echo "#define NANDFLASH_SIZE $${NAND}" > $(obj)include/config.h ; \ fi - @$(MKCONFIG) -a M5329EVB m68k mcf532x m5329evb freescale + @$(MKCONFIG) -n $@ -a M5329EVB m68k mcf532x m5329evb freescale M5373EVB_config : unconfig @case "$@" in \ @@ -2102,17 +1455,15 @@ M54451EVB_stmicro_config : unconfig if [ "$${FLASH}" = "NOR" ] ; then \ echo "TEXT_BASE = 0x00000000" > $(obj)board/freescale/m54451evb/config.tmp ; \ cp $(obj)board/freescale/m54451evb/u-boot.spa $(obj)board/freescale/m54451evb/u-boot.lds ; \ - $(XECHO) "... with NOR boot..." ; \ fi; \ if [ "$${FLASH}" = "STMICRO" ] ; then \ echo "#define CONFIG_CF_SBF" >> $(obj)include/config.h ; \ echo "#define CONFIG_SYS_STMICRO_BOOT" >> $(obj)include/config.h ; \ echo "TEXT_BASE = 0x47E00000" > $(obj)board/freescale/m54451evb/config.tmp ; \ cp $(obj)board/freescale/m54451evb/u-boot.stm $(obj)board/freescale/m54451evb/u-boot.lds ; \ - $(XECHO) "... with ST Micro boot..." ; \ fi; \ echo "#define CONFIG_SYS_INPUT_CLKSRC 24000000" >> $(obj)include/config.h ; - @$(MKCONFIG) -a M54451EVB m68k mcf5445x m54451evb freescale + @$(MKCONFIG) -n $@ -a M54451EVB m68k mcf5445x m54451evb freescale M54455EVB_config \ M54455EVB_atmel_config \ @@ -2136,24 +1487,20 @@ M54455EVB_stm33_config : unconfig echo "#define CONFIG_SYS_INTEL_BOOT" >> $(obj)include/config.h ; \ echo "TEXT_BASE = 0x00000000" > $(obj)board/freescale/m54455evb/config.tmp ; \ cp $(obj)board/freescale/m54455evb/u-boot.int $(obj)board/freescale/m54455evb/u-boot.lds ; \ - $(XECHO) "... with INTEL boot..." ; \ fi; \ if [ "$${FLASH}" = "ATMEL" ] ; then \ echo "#define CONFIG_SYS_ATMEL_BOOT" >> $(obj)include/config.h ; \ echo "TEXT_BASE = 0x04000000" > $(obj)board/freescale/m54455evb/config.tmp ; \ cp $(obj)board/freescale/m54455evb/u-boot.atm $(obj)board/freescale/m54455evb/u-boot.lds ; \ - $(XECHO) "... with ATMEL boot..." ; \ fi; \ if [ "$${FLASH}" = "STMICRO" ] ; then \ echo "#define CONFIG_CF_SBF" >> $(obj)include/config.h ; \ echo "#define CONFIG_SYS_STMICRO_BOOT" >> $(obj)include/config.h ; \ echo "TEXT_BASE = 0x4FE00000" > $(obj)board/freescale/m54455evb/config.tmp ; \ cp $(obj)board/freescale/m54455evb/u-boot.stm $(obj)board/freescale/m54455evb/u-boot.lds ; \ - $(XECHO) "... with ST Micro boot..." ; \ fi; \ echo "#define CONFIG_SYS_INPUT_CLKSRC $${FREQ}" >> $(obj)include/config.h ; \ - $(XECHO) "... with $${FREQ}Hz input clock" - @$(MKCONFIG) -a M54455EVB m68k mcf5445x m54455evb freescale + @$(MKCONFIG) -n $@ -a M54455EVB m68k mcf5445x m54455evb freescale M5475AFE_config \ M5475BFE_config \ @@ -2186,7 +1533,7 @@ M5475GFE_config : unconfig if [ "$${USB}" == "1" ] ; then \ echo "#define CONFIG_SYS_USBCTRL" >> $(obj)include/config.h ; \ fi - @$(MKCONFIG) -a M5475EVB m68k mcf547x_8x m547xevb freescale + @$(MKCONFIG) -n $@ -a M5475EVB m68k mcf547x_8x m547xevb freescale M5485AFE_config \ M5485BFE_config \ @@ -2221,18 +1568,12 @@ M5485HFE_config : unconfig if [ "$${USB}" == "1" ] ; then \ echo "#define CONFIG_SYS_USBCTRL" >> $(obj)include/config.h ; \ fi - @$(MKCONFIG) -a M5485EVB m68k mcf547x_8x m548xevb freescale - -TASREG_config : unconfig - @$(MKCONFIG) $(@:_config=) m68k mcf52x2 tasreg esd + @$(MKCONFIG) -n $@ -a M5485EVB m68k mcf547x_8x m548xevb freescale ######################################################################### ## MPC83xx Systems ######################################################################### -kmeter1_config: unconfig - @$(MKCONFIG) kmeter1 powerpc mpc83xx kmeter1 keymile - MPC8313ERDB_33_config \ MPC8313ERDB_66_config \ MPC8313ERDB_NAND_33_config \ @@ -2240,29 +1581,23 @@ MPC8313ERDB_NAND_66_config: unconfig @mkdir -p $(obj)include @mkdir -p $(obj)board/freescale/mpc8313erdb @if [ "$(findstring _33_,$@)" ] ; then \ - $(XECHO) -n "...33M ..." ; \ echo "#define CONFIG_SYS_33MHZ" >>$(obj)include/config.h ; \ fi ; \ if [ "$(findstring _66_,$@)" ] ; then \ - $(XECHO) -n "...66M..." ; \ echo "#define CONFIG_SYS_66MHZ" >>$(obj)include/config.h ; \ fi ; \ if [ "$(findstring _NAND_,$@)" ] ; then \ - $(XECHO) -n "...NAND..." ; \ echo "TEXT_BASE = 0x00100000" > $(obj)board/freescale/mpc8313erdb/config.tmp ; \ echo "#define CONFIG_NAND_U_BOOT" >>$(obj)include/config.h ; \ fi ; - @$(MKCONFIG) -a MPC8313ERDB powerpc mpc83xx mpc8313erdb freescale @if [ "$(findstring _NAND_,$@)" ] ; then \ echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk ; \ fi ; + @$(MKCONFIG) -n $@ -a MPC8313ERDB powerpc mpc83xx mpc8313erdb freescale MPC8315ERDB_NAND_config \ MPC8315ERDB_config: unconfig - @$(MKCONFIG) -t $(@:_config=) MPC8315ERDB powerpc mpc83xx mpc8315erdb freescale - -MPC8323ERDB_config: unconfig - @$(MKCONFIG) -a MPC8323ERDB powerpc mpc83xx mpc8323erdb freescale + @$(MKCONFIG) -n $@ -t $@ MPC8315ERDB powerpc mpc83xx mpc8315erdb freescale MPC832XEMDS_config \ MPC832XEMDS_HOST_33_config \ @@ -2271,33 +1606,25 @@ MPC832XEMDS_SLAVE_config \ MPC832XEMDS_ATM_config: unconfig @mkdir -p $(obj)include @if [ "$(findstring _HOST_,$@)" ] ; then \ - $(XECHO) -n "... PCI HOST " ; \ echo "#define CONFIG_PCI" >>$(obj)include/config.h ; \ fi ; \ if [ "$(findstring _SLAVE_,$@)" ] ; then \ - $(XECHO) "...PCI SLAVE 66M" ; \ echo "#define CONFIG_PCI" >>$(obj)include/config.h ; \ echo "#define CONFIG_PCISLAVE" >>$(obj)include/config.h ; \ fi ; \ if [ "$(findstring _33_,$@)" ] ; then \ - $(XECHO) -n "...33M ..." ; \ echo "#define PCI_33M" >>$(obj)include/config.h ; \ echo "#define CONFIG_PQ_MDS_PIB 1" >>$(obj)include/config.h ; \ fi ; \ if [ "$(findstring _66_,$@)" ] ; then \ - $(XECHO) -n "...66M..." ; \ echo "#define PCI_66M" >>$(obj)include/config.h ; \ echo "#define CONFIG_PQ_MDS_PIB 1" >>$(obj)include/config.h ; \ fi ; \ if [ "$(findstring _ATM_,$@)" ] ; then \ - $(XECHO) -n "...ATM..." ; \ echo "#define CONFIG_PQ_MDS_PIB 1" >>$(obj)include/config.h ; \ echo "#define CONFIG_PQ_MDS_PIB_ATM 1" >>$(obj)include/config.h ; \ fi ; - @$(MKCONFIG) -a MPC832XEMDS powerpc mpc83xx mpc832xemds freescale - -MPC8349EMDS_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc83xx mpc8349emds freescale + @$(MKCONFIG) -n $@ -a MPC832XEMDS powerpc mpc83xx mpc832xemds freescale MPC8349ITX_config \ MPC8349ITX_LOWBOOT_config \ @@ -2311,7 +1638,7 @@ MPC8349ITXGP_config: unconfig @if [ "$(findstring LOWBOOT,$@)" ] ; then \ echo "TEXT_BASE = 0xFE000000" >$(obj)board/freescale/mpc8349itx/config.tmp ; \ fi - @$(MKCONFIG) -a -n $(@:_config=) MPC8349ITX powerpc mpc83xx mpc8349itx freescale + @$(MKCONFIG) -n $@ -a MPC8349ITX powerpc mpc83xx mpc8349itx freescale MPC8360EMDS_config \ MPC8360EMDS_HOST_33_config \ @@ -2320,178 +1647,126 @@ MPC8360EMDS_SLAVE_config \ MPC8360EMDS_ATM_config: unconfig @mkdir -p $(obj)include @if [ "$(findstring _HOST_,$@)" ] ; then \ - $(XECHO) -n "... PCI HOST " ; \ echo "#define CONFIG_PCI" >>$(obj)include/config.h ; \ fi ; \ if [ "$(findstring _SLAVE_,$@)" ] ; then \ - $(XECHO) "...PCI SLAVE 66M" ; \ echo "#define CONFIG_PCI" >>$(obj)include/config.h ; \ echo "#define CONFIG_PCISLAVE" >>$(obj)include/config.h ; \ fi ; \ if [ "$(findstring _33_,$@)" ] ; then \ - $(XECHO) -n "...33M ..." ; \ echo "#define PCI_33M" >>$(obj)include/config.h ; \ echo "#define CONFIG_PQ_MDS_PIB 1" >>$(obj)include/config.h ; \ fi ; \ if [ "$(findstring _66_,$@)" ] ; then \ - $(XECHO) -n "...66M..." ; \ echo "#define PCI_66M" >>$(obj)include/config.h ; \ echo "#define CONFIG_PQ_MDS_PIB 1" >>$(obj)include/config.h ; \ fi ; \ if [ "$(findstring _ATM_,$@)" ] ; then \ - $(XECHO) -n "...ATM..." ; \ echo "#define CONFIG_PQ_MDS_PIB 1" >>$(obj)include/config.h ; \ echo "#define CONFIG_PQ_MDS_PIB_ATM 1" >>$(obj)include/config.h ; \ fi ; - @$(MKCONFIG) -a MPC8360EMDS powerpc mpc83xx mpc8360emds freescale + @$(MKCONFIG) -n $@ -a MPC8360EMDS powerpc mpc83xx mpc8360emds freescale MPC8360ERDK_33_config \ MPC8360ERDK_66_config \ MPC8360ERDK_config: unconfig @mkdir -p $(obj)include @if [ "$(findstring _33_,$@)" ] ; then \ - $(XECHO) -n "... CLKIN 33MHz " ; \ echo "#define CONFIG_CLKIN_33MHZ" >>$(obj)include/config.h ;\ fi ; - @$(MKCONFIG) -a MPC8360ERDK powerpc mpc83xx mpc8360erdk freescale + @$(MKCONFIG) -n $@ -a MPC8360ERDK powerpc mpc83xx mpc8360erdk freescale MPC837XEMDS_config \ MPC837XEMDS_HOST_config: unconfig @mkdir -p $(obj)include @if [ "$(findstring _HOST_,$@)" ] ; then \ - $(XECHO) -n "... PCI HOST " ; \ echo "#define CONFIG_PCI" >>$(obj)include/config.h ; \ fi ; - @$(MKCONFIG) -a MPC837XEMDS powerpc mpc83xx mpc837xemds freescale - -MPC837XERDB_config: unconfig - @$(MKCONFIG) -a MPC837XERDB powerpc mpc83xx mpc837xerdb freescale - -MVBLM7_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc83xx mvblm7 matrix_vision + @$(MKCONFIG) -n $@ -a MPC837XEMDS powerpc mpc83xx mpc837xemds freescale sbc8349_config \ sbc8349_PCI_33_config \ sbc8349_PCI_66_config: unconfig - @$(MKCONFIG) -t $(@:_config=) sbc8349 powerpc mpc83xx sbc8349 + @$(MKCONFIG) -n $@ -t $@ sbc8349 powerpc mpc83xx sbc8349 SIMPC8313_LP_config \ SIMPC8313_SP_config: unconfig @mkdir -p $(obj)include @mkdir -p $(obj)board/sheldon/simpc8313 @if [ "$(findstring _LP_,$@)" ] ; then \ - $(XECHO) -n "...Large Page NAND..." ; \ echo "#define CONFIG_NAND_LP" >> $(obj)include/config.h ; \ fi ; \ if [ "$(findstring _SP_,$@)" ] ; then \ - $(XECHO) -n "...Small Page NAND..." ; \ echo "#define CONFIG_NAND_SP" >> $(obj)include/config.h ; \ fi ; - @$(MKCONFIG) -a SIMPC8313 powerpc mpc83xx simpc8313 sheldon @echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk - -TQM834x_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc83xx tqm834x tqc + @$(MKCONFIG) -n $@ -a SIMPC8313 powerpc mpc83xx simpc8313 sheldon caddy2_config \ vme8349_config: unconfig - @$(MKCONFIG) -t $(@:_config=) vme8349 powerpc mpc83xx vme8349 esd - -edb9301_config \ -edb9302_config \ -edb9302a_config \ -edb9307_config \ -edb9307a_config \ -edb9312_config \ -edb9315_config \ -edb9315a_config: unconfig - @$(MKCONFIG) -t $(@:_config=) edb93xx arm arm920t edb93xx NULL ep93xx + @$(MKCONFIG) -n $@ -t $@ vme8349 powerpc mpc83xx vme8349 esd ######################################################################### ## MPC85xx Systems ######################################################################### -ATUM8548_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc85xx atum8548 - MPC8536DS_NAND_config \ MPC8536DS_SDCARD_config \ MPC8536DS_SPIFLASH_config \ MPC8536DS_36BIT_config \ MPC8536DS_config: unconfig - @$(MKCONFIG) -t $(@:_config=) MPC8536DS powerpc mpc85xx mpc8536ds freescale - -MPC8540ADS_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc85xx mpc8540ads freescale + @$(MKCONFIG) -n $@ -t $@ MPC8536DS powerpc mpc85xx mpc8536ds freescale MPC8540EVAL_config \ MPC8540EVAL_33_config \ MPC8540EVAL_66_config \ MPC8540EVAL_33_slave_config \ -MPC8540EVAL_66_slave_config: unconfig +MPC8540EVAL_66_slave_config: unconfig @mkdir -p $(obj)include - @if [ "$(findstring _33_,$@)" ] ; then \ - $(XECHO) "... 33 MHz PCI" ; \ - else \ + @if [ -z "$(findstring _33_,$@)" ] ; then \ echo "#define CONFIG_SYSCLK_66M" >>$(obj)include/config.h ; \ - $(XECHO) "... 66 MHz PCI" ; \ fi ; \ if [ "$(findstring _slave_,$@)" ] ; then \ echo "#define CONFIG_PCI_SLAVE" >>$(obj)include/config.h ; \ - $(XECHO) " slave" ; \ - else \ - $(XECHO) " host" ; \ fi - @$(MKCONFIG) -a MPC8540EVAL powerpc mpc85xx mpc8540eval - -MPC8560ADS_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc85xx mpc8560ads freescale + @$(MKCONFIG) -n $@ -a MPC8540EVAL powerpc mpc85xx mpc8540eval MPC8541CDS_legacy_config \ MPC8541CDS_config: unconfig @mkdir -p $(obj)include @if [ "$(findstring _legacy_,$@)" ] ; then \ echo "#define CONFIG_LEGACY" >>$(obj)include/config.h ; \ - $(XECHO) "... legacy" ; \ fi - @$(MKCONFIG) -a MPC8541CDS powerpc mpc85xx mpc8541cds freescale - -MPC8544DS_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc85xx mpc8544ds freescale + @$(MKCONFIG) -n $@ -a MPC8541CDS powerpc mpc85xx mpc8541cds freescale MPC8548CDS_legacy_config \ MPC8548CDS_config: unconfig @mkdir -p $(obj)include @if [ "$(findstring _legacy_,$@)" ] ; then \ echo "#define CONFIG_LEGACY" >>$(obj)include/config.h ; \ - $(XECHO) "... legacy" ; \ fi - @$(MKCONFIG) -a MPC8548CDS powerpc mpc85xx mpc8548cds freescale + @$(MKCONFIG) -n $@ -a MPC8548CDS powerpc mpc85xx mpc8548cds freescale MPC8555CDS_legacy_config \ MPC8555CDS_config: unconfig @mkdir -p $(obj)include @if [ "$(findstring _legacy_,$@)" ] ; then \ echo "#define CONFIG_LEGACY" >>$(obj)include/config.h ; \ - $(XECHO) "... legacy" ; \ fi - @$(MKCONFIG) -a MPC8555CDS powerpc mpc85xx mpc8555cds freescale - -MPC8568MDS_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc85xx mpc8568mds freescale + @$(MKCONFIG) -n $@ -a MPC8555CDS powerpc mpc85xx mpc8555cds freescale MPC8569MDS_ATM_config \ MPC8569MDS_NAND_config \ MPC8569MDS_config: unconfig - @$(MKCONFIG) -t $(@:_config=) MPC8569MDS powerpc mpc85xx mpc8569mds freescale + @$(MKCONFIG) -n $@ -t $@ MPC8569MDS powerpc mpc85xx mpc8569mds freescale MPC8572DS_36BIT_config \ MPC8572DS_config: unconfig - @$(MKCONFIG) -t $(@:_config=) MPC8572DS powerpc mpc85xx mpc8572ds freescale + @$(MKCONFIG) -n $@ -t $@ MPC8572DS powerpc mpc85xx mpc8572ds freescale P2020DS_36BIT_config \ P2020DS_config: unconfig - @$(MKCONFIG) -t $(@:_config=) P2020DS powerpc mpc85xx p2020ds freescale + @$(MKCONFIG) -n $@ -t $@ P2020DS powerpc mpc85xx p2020ds freescale P1011RDB_config \ P1011RDB_NAND_config \ @@ -2509,45 +1784,32 @@ P2020RDB_config \ P2020RDB_NAND_config \ P2020RDB_SDCARD_config \ P2020RDB_SPIFLASH_config: unconfig - @$(MKCONFIG) -t $(@:_config=) P1_P2_RDB powerpc mpc85xx p1_p2_rdb freescale - -PM854_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc85xx pm854 - -PM856_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc85xx pm856 + @$(MKCONFIG) -n $@ -t $@ P1_P2_RDB powerpc mpc85xx p1_p2_rdb freescale sbc8540_config \ sbc8540_33_config \ sbc8540_66_config: unconfig - @$(MKCONFIG) -t $(@:_config=) SBC8540 powerpc mpc85xx sbc8560 + @$(MKCONFIG) -n $@ -t $@ SBC8540 powerpc mpc85xx sbc8560 sbc8548_config \ sbc8548_PCI_33_config \ sbc8548_PCI_66_config \ sbc8548_PCI_33_PCIE_config \ sbc8548_PCI_66_PCIE_config: unconfig - @$(MKCONFIG) -t $(@:_config=) sbc8548 powerpc mpc85xx sbc8548 + @$(MKCONFIG) -n $@ -t $@ sbc8548 powerpc mpc85xx sbc8548 sbc8560_config \ sbc8560_33_config \ sbc8560_66_config: unconfig - @$(MKCONFIG) -t $(@:_config=) sbc8560 powerpc mpc85xx sbc8560 - -socrates_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc85xx socrates - -stxgp3_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc85xx stxgp3 stx + @$(MKCONFIG) -n $@ -t $@ sbc8560 powerpc mpc85xx sbc8560 stxssa_config \ stxssa_4M_config: unconfig @mkdir -p $(obj)include @if [ "$(findstring _4M_,$@)" ] ; then \ echo "#define CONFIG_STXSSA_4M" >>$(obj)include/config.h ; \ - $(XECHO) "... with 4 MiB flash memory" ; \ fi - @$(MKCONFIG) -a stxssa powerpc mpc85xx stxssa stx + @$(MKCONFIG) -n $@ -a stxssa powerpc mpc85xx stxssa stx TQM8540_config \ TQM8541_config \ @@ -2559,73 +1821,32 @@ TQM8560_config: unconfig @mkdir -p $(obj)include @BTYPE=$(@:_config=); \ CTYPE=$(subst TQM,,$(subst _AG,,$(subst _BE,,$(@:_config=)))); \ - $(XECHO) "... "$${BTYPE}" (MPC"$${CTYPE}")"; \ echo "#define CONFIG_MPC$${CTYPE}">>$(obj)include/config.h; \ echo "#define CONFIG_$${BTYPE}">>$(obj)include/config.h; \ echo "#define CONFIG_HOSTNAME tqm$${CTYPE}">>$(obj)include/config.h; \ echo "#define CONFIG_BOARDNAME \"$${BTYPE}\"">>$(obj)include/config.h; - @$(MKCONFIG) -a TQM85xx powerpc mpc85xx tqm85xx tqc @echo "CONFIG_$(@:_config=) = y">>$(obj)include/config.mk; - -XPEDITE5200_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc85xx xpedite5200 xes - -XPEDITE5370_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc85xx xpedite5370 xes + @$(MKCONFIG) -n $@ -a TQM85xx powerpc mpc85xx tqm85xx tqc ######################################################################### ## MPC86xx Systems ######################################################################### -MPC8610HPCD_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc86xx mpc8610hpcd freescale - MPC8641HPCN_36BIT_config \ MPC8641HPCN_config: unconfig @mkdir -p $(obj)include @if [ "$(findstring _36BIT_,$@)" ] ; then \ echo "#define CONFIG_PHYS_64BIT" >>$(obj)include/config.h ; \ - $(XECHO) "... enabling 36-bit physical addressing." ; \ fi - @$(MKCONFIG) -a MPC8641HPCN powerpc mpc86xx mpc8641hpcn freescale - -sbc8641d_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc86xx sbc8641d - -XPEDITE5170_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc mpc86xx xpedite5170 xes + @$(MKCONFIG) -n $@ -a MPC8641HPCN powerpc mpc86xx mpc8641hpcn freescale ######################################################################### ## 74xx/7xx Systems ######################################################################### -AmigaOneG3SE_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc 74xx_7xx AmigaOneG3SE MAI - -BAB7xx_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc 74xx_7xx bab7xx eltec - -CPCI750_config: unconfig - @$(MKCONFIG) CPCI750 powerpc 74xx_7xx cpci750 esd - -DB64360_config: unconfig - @$(MKCONFIG) DB64360 powerpc 74xx_7xx db64360 Marvell - -DB64460_config: unconfig - @$(MKCONFIG) DB64460 powerpc 74xx_7xx db64460 Marvell - -ELPPC_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc 74xx_7xx elppc eltec - EVB64260_config \ EVB64260_750CX_config: unconfig - @$(MKCONFIG) EVB64260 powerpc 74xx_7xx evb64260 - -mpc7448hpc2_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc 74xx_7xx mpc7448hpc2 freescale - -P3G4_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc 74xx_7xx evb64260 + @$(MKCONFIG) -n $@ EVB64260 powerpc 74xx_7xx evb64260 p3m750_config \ p3m7448_config: unconfig @@ -2635,91 +1856,30 @@ p3m7448_config: unconfig else \ echo "#define CONFIG_P3M7448" >>$(obj)include/config.h ; \ fi - @$(MKCONFIG) -a p3mx powerpc 74xx_7xx p3mx prodrive + @$(MKCONFIG) -n $@ -a p3mx powerpc 74xx_7xx p3mx prodrive PCIPPC2_config \ PCIPPC6_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc 74xx_7xx pcippc2 - -ppmc7xx_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc 74xx_7xx ppmc7xx - -ZUMA_config: unconfig - @$(MKCONFIG) $(@:_config=) powerpc 74xx_7xx evb64260 + @$(MKCONFIG) -n $@ $@ powerpc 74xx_7xx pcippc2 #======================================================================== # ARM #======================================================================== -######################################################################### -## StrongARM Systems -######################################################################### - -assabet_config : unconfig - @$(MKCONFIG) $(@:_config=) arm sa1100 assabet - -dnp1110_config : unconfig - @$(MKCONFIG) $(@:_config=) arm sa1100 dnp1110 - -gcplus_config : unconfig - @$(MKCONFIG) $(@:_config=) arm sa1100 gcplus - -lart_config : unconfig - @$(MKCONFIG) $(@:_config=) arm sa1100 lart - -shannon_config : unconfig - @$(MKCONFIG) $(@:_config=) arm sa1100 shannon - -######################################################################### -## ARM92xT Systems -######################################################################### - -a320evb_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm920t a320evb faraday a320 ######################################################################### ## Atmel AT91RM9200 Systems ######################################################################### -at91rm9200dk_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm920t at91rm9200dk atmel at91rm9200 - -at91rm9200ek_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm920t at91rm9200ek atmel at91rm9200 - -cmc_pu2_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm920t cmc_pu2 NULL at91rm9200 - CPUAT91_RAM_config \ CPUAT91_config : unconfig @mkdir -p $(obj)include @echo "#define CONFIG_$(@:_config=) 1" >$(obj)include/config.h - @$(MKCONFIG) -a cpuat91 arm arm920t cpuat91 eukrea at91rm9200 - -csb637_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm920t csb637 NULL at91rm9200 - -eb_cpux9k2_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm920t eb_cpux9k2 BuS at91 - -kb9202_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm920t kb9202 NULL at91rm9200 - -m501sk_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm920t m501sk NULL at91rm9200 - -mp2usb_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm920t mp2usb NULL at91rm9200 + @$(MKCONFIG) -n $@ -a cpuat91 arm arm920t cpuat91 eukrea at91rm9200 ######################################################################### ## ARM926EJ-S Systems ######################################################################### -afeb9260_config: unconfig - @$(MKCONFIG) $(@:_config=) arm arm926ejs afeb9260 NULL at91 - -at91cap9adk_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm926ejs at91cap9adk atmel at91 - at91sam9260ek_nandflash_config \ at91sam9260ek_dataflash_cs0_config \ at91sam9260ek_dataflash_cs1_config \ @@ -2731,21 +1891,17 @@ at91sam9g20ek_config : unconfig @mkdir -p $(obj)include @if [ "$(findstring 9g20,$@)" ] ; then \ echo "#define CONFIG_AT91SAM9G20EK 1" >>$(obj)include/config.h ; \ - $(XECHO) "... 9G20 Variant" ; \ else \ echo "#define CONFIG_AT91SAM9260EK 1" >>$(obj)include/config.h ; \ fi; @if [ "$(findstring _nandflash,$@)" ] ; then \ echo "#define CONFIG_SYS_USE_NANDFLASH 1" >>$(obj)include/config.h ; \ - $(XECHO) "... with environment variable in NAND FLASH" ; \ elif [ "$(findstring dataflash_cs0,$@)" ] ; then \ echo "#define CONFIG_SYS_USE_DATAFLASH_CS0 1" >>$(obj)include/config.h ; \ - $(XECHO) "... with environment variable in SPI DATAFLASH CS0" ; \ else \ echo "#define CONFIG_SYS_USE_DATAFLASH_CS1 1" >>$(obj)include/config.h ; \ - $(XECHO) "... with environment variable in SPI DATAFLASH CS1" ; \ fi; - @$(MKCONFIG) -a at91sam9260ek arm arm926ejs at91sam9260ek atmel at91 + @$(MKCONFIG) -n $@ -a at91sam9260ek arm arm926ejs at91sam9260ek atmel at91 at91sam9xeek_nandflash_config \ at91sam9xeek_dataflash_cs0_config \ @@ -2754,15 +1910,12 @@ at91sam9xeek_config : unconfig @mkdir -p $(obj)include @if [ "$(findstring _nandflash,$@)" ] ; then \ echo "#define CONFIG_SYS_USE_NANDFLASH 1" >>$(obj)include/config.h ; \ - $(XECHO) "... with environment variable in NAND FLASH" ; \ elif [ "$(findstring dataflash_cs0,$@)" ] ; then \ echo "#define CONFIG_SYS_USE_DATAFLASH_CS0 1" >>$(obj)include/config.h ; \ - $(XECHO) "... with environment variable in SPI DATAFLASH CS0" ; \ else \ echo "#define CONFIG_SYS_USE_DATAFLASH_CS1 1" >>$(obj)include/config.h ; \ - $(XECHO) "... with environment variable in SPI DATAFLASH CS1" ; \ fi; - @$(MKCONFIG) -n at91sam9xeek -a at91sam9260ek arm arm926ejs at91sam9260ek atmel at91 + @$(MKCONFIG) -n $@ -a at91sam9260ek arm arm926ejs at91sam9260ek atmel at91 at91sam9261ek_nandflash_config \ at91sam9261ek_dataflash_cs0_config \ @@ -2775,21 +1928,17 @@ at91sam9g10ek_config : unconfig @mkdir -p $(obj)include @if [ "$(findstring 9g10,$@)" ] ; then \ echo "#define CONFIG_AT91SAM9G10EK 1" >>$(obj)include/config.h ; \ - $(XECHO) "... 9G10 Variant" ; \ else \ echo "#define CONFIG_AT91SAM9261EK 1" >>$(obj)include/config.h ; \ fi; @if [ "$(findstring _nandflash,$@)" ] ; then \ echo "#define CONFIG_SYS_USE_NANDFLASH 1" >>$(obj)include/config.h ; \ - $(XECHO) "... with environment variable in NAND FLASH" ; \ elif [ "$(findstring dataflash_cs0,$@)" ] ; then \ echo "#define CONFIG_SYS_USE_DATAFLASH_CS3 1" >>$(obj)include/config.h ; \ - $(XECHO) "... with environment variable in SPI DATAFLASH CS3" ; \ else \ echo "#define CONFIG_SYS_USE_DATAFLASH_CS0 1" >>$(obj)include/config.h ; \ - $(XECHO) "... with environment variable in SPI DATAFLASH CS0" ; \ fi; - @$(MKCONFIG) -a at91sam9261ek arm arm926ejs at91sam9261ek atmel at91 + @$(MKCONFIG) -n $@ -a at91sam9261ek arm arm926ejs at91sam9261ek atmel at91 at91sam9263ek_norflash_config \ at91sam9263ek_norflash_boot_config \ @@ -2800,19 +1949,15 @@ at91sam9263ek_config : unconfig @mkdir -p $(obj)include @if [ "$(findstring _nandflash,$@)" ] ; then \ echo "#define CONFIG_SYS_USE_NANDFLASH 1" >>$(obj)include/config.h ; \ - $(XECHO) "... with environment variable in NAND FLASH" ; \ elif [ "$(findstring norflash,$@)" ] ; then \ echo "#define CONFIG_SYS_USE_NORFLASH 1" >>$(obj)include/config.h ; \ - $(XECHO) "... with environment variable in NOR FLASH" ; \ else \ echo "#define CONFIG_SYS_USE_DATAFLASH 1" >>$(obj)include/config.h ; \ - $(XECHO) "... with environment variable in SPI DATAFLASH CS0" ; \ fi; @if [ "$(findstring norflash_boot,$@)" ] ; then \ echo "#define CONFIG_SYS_USE_BOOT_NORFLASH 1" >>$(obj)include/config.h ; \ - $(XECHO) "... and boot from NOR FLASH" ; \ fi; - @$(MKCONFIG) -a at91sam9263ek arm arm926ejs at91sam9263ek atmel at91 + @$(MKCONFIG) -n $@ -a at91sam9263ek arm arm926ejs at91sam9263ek atmel at91 at91sam9rlek_nandflash_config \ at91sam9rlek_dataflash_config \ @@ -2821,12 +1966,10 @@ at91sam9rlek_config : unconfig @mkdir -p $(obj)include @if [ "$(findstring _nandflash,$@)" ] ; then \ echo "#define CONFIG_SYS_USE_NANDFLASH 1" >>$(obj)include/config.h ; \ - $(XECHO) "... with environment variable in NAND FLASH" ; \ else \ echo "#define CONFIG_SYS_USE_DATAFLASH 1" >>$(obj)include/config.h ; \ - $(XECHO) "... with environment variable in SPI DATAFLASH CS0" ; \ fi; - @$(MKCONFIG) -a at91sam9rlek arm arm926ejs at91sam9rlek atmel at91 + @$(MKCONFIG) -n $@ -a at91sam9rlek arm arm926ejs at91sam9rlek atmel at91 CPU9G20_128M_config \ CPU9G20_config \ @@ -2834,13 +1977,7 @@ CPU9260_128M_config \ CPU9260_config : unconfig @mkdir -p $(obj)include @echo "#define CONFIG_$(@:_config=) 1" >$(obj)include/config.h - @$(MKCONFIG) -a cpu9260 arm arm926ejs cpu9260 eukrea at91 - -meesc_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm926ejs meesc esd at91 - -pm9261_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm926ejs pm9261 ronetix at91 + @$(MKCONFIG) -n $@ -a cpu9260 arm arm926ejs cpu9260 eukrea at91 at91sam9m10g45ek_nandflash_config \ at91sam9m10g45ek_dataflash_config \ @@ -2853,25 +1990,15 @@ at91sam9g45ekes_config : unconfig @mkdir -p $(obj)include @if [ "$(findstring 9m10,$@)" ] ; then \ echo "#define CONFIG_AT91SAM9M10G45EK 1" >>$(obj)include/config.h ; \ - $(XECHO) "... 9M10G45 Variant" ; \ else \ echo "#define CONFIG_AT91SAM9G45EKES 1" >>$(obj)include/config.h ; \ fi; - @if [ "$(findstring _nandflash,$@)" ] ; then \ echo "#define CONFIG_SYS_USE_NANDFLASH 1" >>$(obj)include/config.h ; \ - $(XECHO) "... with environment variable in NAND FLASH" ; \ else \ echo "#define CONFIG_ATMEL_SPI 1" >>$(obj)include/config.h ; \ - $(XECHO) "... with environment variable in SPI DATAFLASH CS0" ; \ fi; - @$(MKCONFIG) -a at91sam9m10g45ek arm arm926ejs at91sam9m10g45ek atmel at91 - -otc570_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm926ejs otc570 esd at91 - -pm9263_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm926ejs pm9263 ronetix at91 + @$(MKCONFIG) -n $@ -a at91sam9m10g45ek arm arm926ejs at91sam9m10g45ek atmel at91 pm9g45_config : unconfig @mkdir -p $(obj)include @@ -2882,7 +2009,7 @@ SBC35_A9G20_EEPROM_config \ SBC35_A9G20_config : unconfig @mkdir -p $(obj)include @echo "#define CONFIG_$(@:_config=) 1" >$(obj)include/config.h - @$(MKCONFIG) -a sbc35_a9g20 arm arm926ejs sbc35_a9g20 calao at91 + @$(MKCONFIG) -n $@ -a sbc35_a9g20 arm arm926ejs sbc35_a9g20 calao at91 TNY_A9G20_NANDFLASH_config \ TNY_A9G20_EEPROM_config \ @@ -2892,7 +2019,7 @@ TNY_A9260_EEPROM_config \ TNY_A9260_config : unconfig @mkdir -p $(obj)include @echo "#define CONFIG_$(@:_config=) 1" >$(obj)include/config.h - @$(MKCONFIG) -a tny_a9260 arm arm926ejs tny_a9260 calao at91 + @$(MKCONFIG) -n $@ -a tny_a9260 arm arm926ejs tny_a9260 calao at91 ######################################################################## ## ARM Integrator boards - see doc/README-integrator for more info. @@ -2920,74 +2047,14 @@ cp922_XA10_config \ cp1026_config: unconfig @board/armltd/integrator/split_by_variant.sh cp $@ -da830evm_config \ -da850evm_config: unconfig - @$(MKCONFIG) $(@:_config=) arm arm926ejs da8xxevm davinci davinci - -davinci_dvevm_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm926ejs dvevm davinci davinci - -davinci_schmoogie_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm926ejs schmoogie davinci davinci - -davinci_sffsdr_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm926ejs sffsdr davinci davinci - -davinci_sonata_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm926ejs sonata davinci davinci - -davinci_dm355evm_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm926ejs dm355evm davinci davinci - -davinci_dm355leopard_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm926ejs dm355leopard davinci davinci - -davinci_dm365evm_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm926ejs dm365evm davinci davinci - -davinci_dm6467evm_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm926ejs dm6467evm davinci davinci - -edminiv2_config: unconfig - @$(MKCONFIG) $(@:_config=) arm arm926ejs $(@:_config=) LaCie orion5x - -guruplug_config: unconfig - @$(MKCONFIG) $(@:_config=) arm arm926ejs $(@:_config=) Marvell kirkwood - -magnesium_config \ -imx27lite_config: unconfig - @$(MKCONFIG) $(@:_config=) arm arm926ejs imx27lite logicpd mx27 - -lpd7a400_config \ -lpd7a404_config: unconfig - @$(MKCONFIG) $(@:_config=) arm lh7a40x lpd7a40x - -mv88f6281gtw_ge_config: unconfig - @$(MKCONFIG) $(@:_config=) arm arm926ejs $(@:_config=) Marvell kirkwood - -mx1ads_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm920t mx1ads NULL imx - -mx1fs2_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm920t mx1fs2 NULL imx - -netstar_config: unconfig - @$(MKCONFIG) $(@:_config=) arm arm925t netstar - nhk8815_config \ nhk8815_onenand_config: unconfig @mkdir -p $(obj)include @ > $(obj)include/config.h @if [ "$(findstring _onenand, $@)" ] ; then \ echo "#define CONFIG_BOOT_ONENAND" >> $(obj)include/config.h; \ - $(XECHO) "... configured to boot from OneNand Flash"; \ - else \ - $(XECHO) "... configured to boot from Nand Flash"; \ fi - @$(MKCONFIG) -a nhk8815 arm arm926ejs nhk8815 st nomadik - -omap1510inn_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm925t omap1510inn ti + @$(MKCONFIG) -n $@ -a nhk8815 arm arm926ejs nhk8815 st nomadik xtract_omap1610xxx = $(subst _cs0boot,,$(subst _cs3boot,,$(subst _cs_autoboot,,$(subst _config,,$1)))) @@ -3002,23 +2069,12 @@ omap1610h2_cs_autoboot_config: unconfig @mkdir -p $(obj)include @if [ "$(findstring _cs0boot_, $@)" ] ; then \ echo "#define CONFIG_CS0_BOOT" >> .$(obj)include/config.h ; \ - $(XECHO) "... configured for CS0 boot"; \ elif [ "$(findstring _cs_autoboot_, $@)" ] ; then \ echo "#define CONFIG_CS_AUTOBOOT" >> $(obj)include/config.h ; \ - $(XECHO) "... configured for CS_AUTO boot"; \ else \ echo "#define CONFIG_CS3_BOOT" >> $(obj)include/config.h ; \ - $(XECHO) "... configured for CS3 boot"; \ fi; - @$(MKCONFIG) -a $(call xtract_omap1610xxx,$@) arm arm926ejs omap1610inn ti omap - -omap5912osk_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm926ejs omap5912osk ti omap - -openrd_base_config: unconfig - @$(MKCONFIG) $(@:_config=) arm arm926ejs $(@:_config=) Marvell kirkwood - -xtract_omap730p2 = $(subst _cs0boot,,$(subst _cs3boot,, $(subst _config,,$1))) + @$(MKCONFIG) -n $@ -a $(call xtract_omap1610xxx,$@) arm arm926ejs omap1610inn ti omap omap730p2_config \ omap730p2_cs0boot_config \ @@ -3026,57 +2082,30 @@ omap730p2_cs3boot_config : unconfig @mkdir -p $(obj)include @if [ "$(findstring _cs0boot_, $@)" ] ; then \ echo "#define CONFIG_CS0_BOOT" >> $(obj)include/config.h ; \ - $(XECHO) "... configured for CS0 boot"; \ else \ echo "#define CONFIG_CS3_BOOT" >> $(obj)include/config.h ; \ - $(XECHO) "... configured for CS3 boot"; \ fi; - @$(MKCONFIG) -a $(call xtract_omap730p2,$@) arm arm926ejs omap730p2 ti omap - -rd6281a_config: unconfig - @$(MKCONFIG) $(@:_config=) arm arm926ejs $(@:_config=) Marvell kirkwood - -sbc2410x_config: unconfig - @$(MKCONFIG) $(@:_config=) arm arm920t sbc2410x NULL s3c24x0 - -scb9328_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm920t scb9328 NULL imx - -sheevaplug_config: unconfig - @$(MKCONFIG) $(@:_config=) arm arm926ejs $(@:_config=) Marvell kirkwood - -smdk2400_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm920t smdk2400 samsung s3c24x0 - -smdk2410_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm920t smdk2410 samsung s3c24x0 + @$(MKCONFIG) -n $@ -a omap730p2 arm arm926ejs omap730p2 ti omap spear300_config \ spear310_config \ spear320_config : unconfig - @$(MKCONFIG) -n $@ -t $(@:_config=) spear3xx arm arm926ejs $(@:_config=) spear spear + @$(MKCONFIG) -n $@ -t $@ spear3xx arm arm926ejs $(@:_config=) spear spear spear600_config : unconfig - @$(MKCONFIG) -n $@ -t $(@:_config=) spear6xx arm arm926ejs $(@:_config=) spear spear - -suen3_config: unconfig - @$(MKCONFIG) $(@:_config=) arm arm926ejs km_arm keymile kirkwood + @$(MKCONFIG) -n $@ -t $@ spear6xx arm arm926ejs $(@:_config=) spear spear SX1_stdout_serial_config \ SX1_config: unconfig @mkdir -p $(obj)include @if [ "$(findstring _stdout_serial_, $@)" ] ; then \ echo "#undef CONFIG_STDOUT_USBTTY" >> $(obj)include/config.h ; \ - $(XECHO) "... configured for stdout serial"; \ else \ echo "#define CONFIG_STDOUT_USBTTY" >> $(obj)include/config.h ; \ - $(XECHO) "... configured for stdout usbtty"; \ fi; - @$(MKCONFIG) SX1 arm arm925t sx1 + @$(MKCONFIG) -n $@ SX1 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 \ @@ -3086,173 +2115,53 @@ trab_old_config: unconfig @[ -z "$(findstring _bigram,$@)" ] || \ { echo "#define CONFIG_FLASH_8MB" >>$(obj)include/config.h ; \ echo "#define CONFIG_RAM_32MB" >>$(obj)include/config.h ; \ - $(XECHO) "... with 8 MB Flash, 32 MB RAM" ; \ } @[ -z "$(findstring _bigflash,$@)" ] || \ { echo "#define CONFIG_FLASH_16MB" >>$(obj)include/config.h ; \ echo "#define CONFIG_RAM_16MB" >>$(obj)include/config.h ; \ - $(XECHO) "... with 16 MB Flash, 16 MB RAM" ; \ echo "TEXT_BASE = 0x0CF40000" >$(obj)board/trab/config.tmp ; \ } @[ -z "$(findstring _old,$@)" ] || \ { echo "#define CONFIG_FLASH_8MB" >>$(obj)include/config.h ; \ echo "#define CONFIG_RAM_16MB" >>$(obj)include/config.h ; \ - $(XECHO) "... with 8 MB Flash, 16 MB RAM" ; \ echo "TEXT_BASE = 0x0CF40000" >$(obj)board/trab/config.tmp ; \ } - @$(MKCONFIG) -a $(call xtract_trab,$@) arm arm920t trab NULL s3c24x0 + @$(MKCONFIG) -n $@ -a trab arm arm920t trab - s3c24x0 tx25_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm926ejs tx25 karo mx25 @echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk + @$(MKCONFIG) $@ arm arm926ejs tx25 karo mx25 -VCMA9_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm920t vcma9 mpl s3c24x0 +edb9301_config \ +edb9302_config \ +edb9302a_config \ +edb9307_config \ +edb9307a_config \ +edb9312_config \ +edb9315_config \ +edb9315a_config: unconfig + @$(MKCONFIG) -n $@ -t $(@:_config=) edb93xx arm arm920t edb93xx - ep93xx ######################################################################### # ARM supplied Versatile development boards ######################################################################### -cm4008_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm920t cm4008 NULL ks8695 - -cm41xx_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm920t cm41xx NULL ks8695 - versatile_config \ versatileab_config \ versatilepb_config : unconfig @board/armltd/versatile/split_by_variant.sh $@ -voiceblue_config: unconfig - @$(MKCONFIG) $(@:_config=) arm arm925t voiceblue - -######################################################################### -## S3C44B0 Systems -######################################################################### - -B2_config : unconfig - @$(MKCONFIG) $(@:_config=) arm s3c44b0 B2 dave - -######################################################################### -## ARM720T Systems -######################################################################### - -armadillo_config: unconfig - @$(MKCONFIG) $(@:_config=) arm arm720t armadillo - -ep7312_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm720t ep7312 - -impa7_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm720t impa7 - -modnet50_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm720t modnet50 - -evb4510_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm720t evb4510 NULL s3c4510b - -lpc2292sodimm_config: unconfig - @$(MKCONFIG) $(@:_config=) arm arm720t lpc2292sodimm NULL lpc2292 - -SMN42_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm720t SMN42 siemens lpc2292 - -######################################################################### -## ARM CORTEX Systems -######################################################################### - -am3517_evm_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm_cortexa8 am3517evm logicpd omap3 - -devkit8000_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm_cortexa8 devkit8000 timll omap3 - -omap3_beagle_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm_cortexa8 beagle ti omap3 - -omap3_overo_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm_cortexa8 overo NULL omap3 - -omap3_evm_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm_cortexa8 evm ti omap3 - -omap3_pandora_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm_cortexa8 pandora NULL omap3 - -omap3_sdp3430_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm_cortexa8 sdp3430 ti omap3 - -omap3_zoom1_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm_cortexa8 zoom1 logicpd omap3 - -omap3_zoom2_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm_cortexa8 zoom2 logicpd omap3 - -s5p_goni_config: unconfig - @$(MKCONFIG) $(@:_config=) arm arm_cortexa8 goni samsung s5pc1xx - -smdkc100_config: unconfig - @$(MKCONFIG) $(@:_config=) arm arm_cortexa8 smdkc100 samsung s5pc1xx - ######################################################################### ## XScale Systems ######################################################################### -actux1_config : unconfig - @$(MKCONFIG) $(@:_config=) arm ixp actux1 - -actux2_config : unconfig - @$(MKCONFIG) $(@:_config=) arm ixp actux2 - -actux3_config : unconfig - @$(MKCONFIG) $(@:_config=) arm ixp actux3 - -actux4_config : unconfig - @$(MKCONFIG) $(@:_config=) arm ixp actux4 - -cerf250_config : unconfig - @$(MKCONFIG) $(@:_config=) arm pxa cerf250 - -cradle_config : unconfig - @$(MKCONFIG) $(@:_config=) arm pxa cradle - -csb226_config : unconfig - @$(MKCONFIG) $(@:_config=) arm pxa csb226 - -delta_config : unconfig - @$(MKCONFIG) $(@:_config=) arm pxa delta - -innokom_config : unconfig - @$(MKCONFIG) $(@:_config=) arm pxa innokom - -ixdp425_config : unconfig - @$(MKCONFIG) $(@:_config=) arm ixp ixdp425 - -ixdpg425_config : unconfig - @$(MKCONFIG) $(@:_config=) arm ixp ixdp425 - -lubbock_config : unconfig - @$(MKCONFIG) $(@:_config=) arm pxa lubbock - -pleb2_config : unconfig - @$(MKCONFIG) $(@:_config=) arm pxa pleb2 - -logodl_config : unconfig - @$(MKCONFIG) $(@:_config=) arm pxa logodl - pdnb3_config \ scpu_config: unconfig @mkdir -p $(obj)include @if [ "$(findstring scpu_,$@)" ] ; then \ echo "#define CONFIG_SCPU" >>$(obj)include/config.h ; \ - $(XECHO) "... on SCPU board variant" ; \ fi - @$(MKCONFIG) -a pdnb3 arm ixp pdnb3 prodrive - -pxa255_idp_config: unconfig - @$(MKCONFIG) $(@:_config=) arm pxa pxa255_idp + @$(MKCONFIG) -n $@ -a pdnb3 arm ixp pdnb3 prodrive polaris_config \ trizepsiv_config : unconfig @@ -3260,22 +2169,7 @@ trizepsiv_config : unconfig @if [ "$(findstring polaris,$@)" ] ; then \ echo "#define CONFIG_POLARIS 1" >>$(obj)include/config.h ; \ fi; - @$(MKCONFIG) -a trizepsiv arm pxa trizepsiv - -wepep250_config : unconfig - @$(MKCONFIG) $(@:_config=) arm pxa wepep250 - -xaeniax_config : unconfig - @$(MKCONFIG) $(@:_config=) arm pxa xaeniax - -xm250_config : unconfig - @$(MKCONFIG) $(@:_config=) arm pxa xm250 - -xsengine_config : unconfig - @$(MKCONFIG) $(@:_config=) arm pxa xsengine - -zylonite_config : - @$(MKCONFIG) $(@:_config=) arm pxa zylonite + @$(MKCONFIG) -n $@ -a trizepsiv arm pxa trizepsiv ######################################################################### ## ARM1136 Systems @@ -3284,11 +2178,8 @@ zylonite_config : apollon_config : unconfig @mkdir -p $(obj)include @echo "#define CONFIG_ONENAND_U_BOOT" > $(obj)include/config.h - @$(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 logicpd mx31 + @$(MKCONFIG) $@ arm arm1136 apollon - omap24xx imx31_phycore_eet_config \ imx31_phycore_config : unconfig @@ -3296,10 +2187,7 @@ imx31_phycore_config : unconfig @if [ -n "$(findstring _eet_,$@)" ]; then \ echo "#define CONFIG_IMX31_PHYCORE_EET" >> $(obj)include/config.h; \ fi - @$(MKCONFIG) -a imx31_phycore arm arm1136 imx31_phycore NULL mx31 - -mx31ads_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm1136 mx31ads freescale mx31 + @$(MKCONFIG) -n $@ -a imx31_phycore arm arm1136 imx31_phycore - mx31 mx31pdk_config \ mx31pdk_nand_config : unconfig @@ -3310,16 +2198,7 @@ mx31pdk_nand_config : unconfig echo "#define CONFIG_SKIP_LOWLEVEL_INIT" >> $(obj)include/config.h; \ echo "#define CONFIG_SKIP_RELOCATE_UBOOT" >> $(obj)include/config.h; \ fi - @$(MKCONFIG) -a mx31pdk arm arm1136 mx31pdk freescale mx31 - -mx51evk_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm_cortexa8 mx51evk freescale mx51 - -omap2420h4_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm1136 omap2420h4 ti omap24xx - -qong_config : unconfig - @$(MKCONFIG) $(@:_config=) arm arm1136 qong davedenx mx31 + @$(MKCONFIG) -n $@ -a mx31pdk arm arm1136 mx31pdk freescale mx31 ######################################################################### ## ARM1176 Systems @@ -3329,36 +2208,15 @@ smdk6400_config : unconfig @mkdir -p $(obj)include $(obj)board/samsung/smdk6400 @mkdir -p $(obj)nand_spl/board/samsung/smdk6400 @echo "#define CONFIG_NAND_U_BOOT" > $(obj)include/config.h + @echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk @if [ -z "$(findstring smdk6400_noUSB_config,$@)" ]; then \ echo "RAM_TEXT = 0x57e00000" >> $(obj)board/samsung/smdk6400/config.tmp;\ - $(MKCONFIG) $(@:_config=) arm arm1176 smdk6400 samsung s3c64xx; \ else \ echo "RAM_TEXT = 0xc7e00000" >> $(obj)board/samsung/smdk6400/config.tmp;\ - $(MKCONFIG) $(@:_noUSB_config=) arm arm1176 smdk6400 samsung s3c64xx; \ fi + @$(MKCONFIG) smdk6400 arm arm1176 smdk6400 samsung s3c64xx @echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk -tnetv107x_evm_config: unconfig - @$(MKCONFIG) $(@:_config=) arm arm1176 tnetv107xevm ti tnetv107x - -#======================================================================== -# i386 -#======================================================================== -######################################################################### -## AMD SC520 CDP -######################################################################### -eNET_config : unconfig - @$(MKCONFIG) $(@:_config=) i386 i386 eNET NULL sc520 - -sc520_cdp_config : unconfig - @$(MKCONFIG) $(@:_config=) i386 i386 sc520_cdp NULL sc520 - -sc520_spunk_config : unconfig - @$(MKCONFIG) $(@:_config=) i386 i386 sc520_spunk NULL sc520 - -sc520_spunk_rel_config : unconfig - @$(MKCONFIG) $(@:_config=) i386 i386 sc520_spunk NULL sc520 - #======================================================================== # MIPS #======================================================================== @@ -3366,29 +2224,18 @@ sc520_spunk_rel_config : unconfig ## MIPS32 4Kc ######################################################################### -xtract_incaip = $(subst _100MHz,,$(subst _133MHz,,$(subst _150MHz,,$(subst _config,,$1)))) - incaip_100MHz_config \ incaip_133MHz_config \ incaip_150MHz_config \ incaip_config: unconfig @mkdir -p $(obj)include @[ -z "$(findstring _100MHz,$@)" ] || \ - { echo "#define CPU_CLOCK_RATE 100000000" >>$(obj)include/config.h ; \ - $(XECHO) "... with 100MHz system clock" ; \ - } + echo "#define CPU_CLOCK_RATE 100000000" >>$(obj)include/config.h @[ -z "$(findstring _133MHz,$@)" ] || \ - { echo "#define CPU_CLOCK_RATE 133000000" >>$(obj)include/config.h ; \ - $(XECHO) "... with 133MHz system clock" ; \ - } + echo "#define CPU_CLOCK_RATE 133000000" >>$(obj)include/config.h @[ -z "$(findstring _150MHz,$@)" ] || \ - { echo "#define CPU_CLOCK_RATE 150000000" >>$(obj)include/config.h ; \ - $(XECHO) "... with 150MHz system clock" ; \ - } - @$(MKCONFIG) -a $(call xtract_incaip,$@) mips mips incaip - -tb0229_config: unconfig - @$(MKCONFIG) $(@:_config=) mips mips tb0229 + echo "#define CPU_CLOCK_RATE 150000000" >>$(obj)include/config.h + @$(MKCONFIG) -n $@ -a incaip mips mips incaip vct_premium_config \ vct_premium_small_config \ @@ -3403,27 +2250,17 @@ vct_platinumavc_small_config \ vct_platinumavc_onenand_config \ vct_platinumavc_onenand_small_config: unconfig @mkdir -p $(obj)include - @if [ "$(findstring _premium,$@)" ] ; then \ - echo "#define CONFIG_VCT_PREMIUM" > $(obj)include/config.h ; \ - $(XECHO) "... on Premium board variant" ; \ - fi - @if [ "$(findstring _platinum_,$@)" ] ; then \ - echo "#define CONFIG_VCT_PLATINUM" > $(obj)include/config.h ; \ - $(XECHO) "... on Platinum board variant" ; \ - fi - @if [ "$(findstring _platinumavc,$@)" ] ; then \ - echo "#define CONFIG_VCT_PLATINUMAVC" > $(obj)include/config.h ; \ - $(XECHO) "... on PlatinumAVC board variant" ; \ - fi - @if [ "$(findstring _onenand,$@)" ] ; then \ - echo "#define CONFIG_VCT_ONENAND" >> $(obj)include/config.h ; \ - $(XECHO) "... on OneNAND board variant" ; \ - fi - @if [ "$(findstring _small,$@)" ] ; then \ - echo "#define CONFIG_VCT_SMALL_IMAGE" >> $(obj)include/config.h ; \ - $(XECHO) "... stripped down image variant" ; \ - fi - @$(MKCONFIG) -a vct mips mips vct micronas + @[ -z "$(findstring _premium,$@)" ] || \ + echo "#define CONFIG_VCT_PREMIUM" > $(obj)include/config.h + @[ -z "$(findstring _platinum_,$@)" ] || \ + echo "#define CONFIG_VCT_PLATINUM" > $(obj)include/config.h + @[ -z "$(findstring _platinumavc,$@)" ] || \ + echo "#define CONFIG_VCT_PLATINUMAVC" > $(obj)include/config.h + @[ -z "$(findstring _onenand,$@)" ] || \ + echo "#define CONFIG_VCT_ONENAND" >> $(obj)include/config.h + @[ -z "$(findstring _small,$@)" ] || \ + echo "#define CONFIG_VCT_SMALL_IMAGE" >> $(obj)include/config.h + @$(MKCONFIG) -n $@ -a vct mips mips vct micronas ######################################################################### ## MIPS32 AU1X00 @@ -3457,7 +2294,7 @@ dbau1550_el_config : unconfig gth2_config : unconfig @mkdir -p $(obj)include @echo "#define CONFIG_GTH2 1" >$(obj)include/config.h - @$(MKCONFIG) -a gth2 mips mips gth2 + @$(MKCONFIG) -a $@ mips mips gth2 pb1000_config : unconfig @mkdir -p $(obj)include @@ -3469,13 +2306,6 @@ qemu_mips_config : unconfig @echo "#define CONFIG_QEMU_MIPS 1" >$(obj)include/config.h @$(MKCONFIG) -a qemu-mips mips mips qemu-mips -######################################################################### -## MIPS64 5Kc -######################################################################### - -purple_config : unconfig - @$(MKCONFIG) $(@:_config=) mips mips purple - #======================================================================== # Nios #======================================================================== @@ -3484,89 +2314,21 @@ purple_config : unconfig ## Nios-II ######################################################################### -EP1C20_config : unconfig - @$(MKCONFIG) EP1C20 nios2 nios2 ep1c20 altera - -EP1S10_config : unconfig - @$(MKCONFIG) EP1S10 nios2 nios2 ep1s10 altera - -EP1S40_config : unconfig - @$(MKCONFIG) EP1S40 nios2 nios2 ep1s40 altera - -PK1C20_config : unconfig - @$(MKCONFIG) PK1C20 nios2 nios2 pk1c20 psyent - -PCI5441_config : unconfig - @$(MKCONFIG) PCI5441 nios2 nios2 pci5441 psyent - # nios2 generic boards NIOS2_GENERIC = nios2-generic $(NIOS2_GENERIC:%=%_config) : unconfig - @$(MKCONFIG) $(@:_config=) nios2 nios2 nios2-generic altera - -#======================================================================== -## Microblaze -#======================================================================== - -microblaze-generic_config: unconfig - @mkdir -p $(obj)include - @$(MKCONFIG) -a $(@:_config=) microblaze microblaze microblaze-generic xilinx + @$(MKCONFIG) $@ nios2 nios2 nios2-generic altera #======================================================================== # Blackfin #======================================================================== -# Analog Devices boards -BFIN_BOARDS = bf518f-ezbrd bf526-ezbrd bf527-ezkit bf533-ezkit bf533-stamp \ - bf537-pnav bf537-stamp bf538f-ezkit bf548-ezkit bf561-ezkit - -# Bluetechnix tinyboards -BFIN_BOARDS += cm-bf527 cm-bf533 cm-bf537e cm-bf537u cm-bf548 cm-bf561 \ - tcm-bf518 tcm-bf537 - -# Misc third party boards -BFIN_BOARDS += bf537-minotaur bf537-srv1 bf561-acvilon blackstamp ip04 - -# I-SYST Micromodule -BFIN_BOARDS += ibf-dsp561 - -$(BFIN_BOARDS:%=%_config) : unconfig - @$(MKCONFIG) $(@:_config=) blackfin blackfin $(@:_config=) - bf527-ezkit-v2_config : unconfig @$(MKCONFIG) -t BF527_EZKIT_REV_2_1 \ bf527-ezkit blackfin blackfin bf527-ezkit #======================================================================== -# AVR32 -#======================================================================== - -atngw100_config : unconfig - @$(MKCONFIG) $(@:_config=) avr32 at32ap atngw100 atmel at32ap700x - -atstk1002_config : unconfig - @$(MKCONFIG) $(@:_config=) avr32 at32ap atstk1000 atmel at32ap700x - -atstk1003_config : unconfig - @$(MKCONFIG) $(@:_config=) avr32 at32ap atstk1000 atmel at32ap700x - -atstk1004_config : unconfig - @$(MKCONFIG) $(@:_config=) avr32 at32ap atstk1000 atmel at32ap700x - -atstk1006_config : unconfig - @$(MKCONFIG) $(@:_config=) avr32 at32ap atstk1000 atmel at32ap700x - -favr-32-ezkit_config : unconfig - @$(MKCONFIG) $(@:_config=) avr32 at32ap favr-32-ezkit earthlcd at32ap700x - -hammerhead_config : unconfig - @$(MKCONFIG) $(@:_config=) avr32 at32ap hammerhead miromico at32ap700x - -mimc200_config : unconfig - @$(MKCONFIG) $(@:_config=) avr32 at32ap mimc200 mimc at32ap700x - -#======================================================================== # SH3 (SuperH) #======================================================================== @@ -3576,7 +2338,7 @@ mimc200_config : unconfig rsk7203_config: unconfig @mkdir -p $(obj)include @echo "#define CONFIG_RSK7203 1" > $(obj)include/config.h - @$(MKCONFIG) -a $(@:_config=) sh sh2 rsk7203 renesas + @$(MKCONFIG) -a $@ sh sh2 rsk7203 renesas ######################################################################### ## sh3 (Renesas SuperH) @@ -3585,12 +2347,12 @@ rsk7203_config: unconfig mpr2_config: unconfig @mkdir -p $(obj)include @echo "#define CONFIG_MPR2 1" > $(obj)include/config.h - @$(MKCONFIG) -a $(@:_config=) sh sh3 mpr2 + @$(MKCONFIG) -a $@ sh sh3 mpr2 ms7720se_config: unconfig @mkdir -p $(obj)include @echo "#define CONFIG_MS7720SE 1" > $(obj)include/config.h - @$(MKCONFIG) -a $(@:_config=) sh sh3 ms7720se + @$(MKCONFIG) -a $@ sh sh3 ms7720se ######################################################################### ## sh4 (Renesas SuperH) @@ -3599,34 +2361,33 @@ ms7720se_config: unconfig MigoR_config : unconfig @mkdir -p $(obj)include @echo "#define CONFIG_MIGO_R 1" > $(obj)include/config.h - @$(MKCONFIG) -a $(@:_config=) sh sh4 MigoR renesas + @$(MKCONFIG) -a $@ sh sh4 MigoR renesas ms7750se_config: unconfig @mkdir -p $(obj)include @echo "#define CONFIG_MS7750SE 1" > $(obj)include/config.h - @$(MKCONFIG) -a $(@:_config=) sh sh4 ms7750se + @$(MKCONFIG) -a $@ sh sh4 ms7750se ms7722se_config : unconfig @mkdir -p $(obj)include @echo "#define CONFIG_MS7722SE 1" > $(obj)include/config.h - @$(MKCONFIG) -a $(@:_config=) sh sh4 ms7722se + @$(MKCONFIG) -a $@ sh sh4 ms7722se r2dplus_config : unconfig @mkdir -p $(obj)include @echo "#define CONFIG_R2DPLUS 1" > $(obj)include/config.h - @$(MKCONFIG) -a $(@:_config=) sh sh4 r2dplus renesas + @$(MKCONFIG) -a $@ sh sh4 r2dplus renesas r7780mp_config: unconfig @mkdir -p $(obj)include @echo "#define CONFIG_R7780MP 1" > $(obj)include/config.h - @$(MKCONFIG) -a $(@:_config=) sh sh4 r7780mp renesas + @$(MKCONFIG) -a $@ sh sh4 r7780mp renesas sh7763rdp_config : unconfig @mkdir -p $(obj)include @echo "#define CONFIG_SH7763RDP 1" > $(obj)include/config.h - @$(MKCONFIG) -a $(@:_config=) sh sh4 sh7763rdp renesas + @$(MKCONFIG) -a $@ sh sh4 sh7763rdp renesas -xtract_sh7785lcr = $(subst _32bit,,$(subst _config,,$1)) sh7785lcr_32bit_config \ sh7785lcr_config : unconfig @mkdir -p $(obj)include @@ -3636,54 +2397,19 @@ sh7785lcr_config : unconfig echo "#define CONFIG_SH_32BIT 1" >> $(obj)include/config.h ; \ echo "TEXT_BASE = 0x8ff80000" > \ $(obj)board/renesas/sh7785lcr/config.tmp ; \ - $(XECHO) " ... enable 32-Bit Address Extended Mode" ; \ fi - @$(MKCONFIG) -a $(call xtract_sh7785lcr,$@) sh sh4 sh7785lcr renesas + @$(MKCONFIG) -n $@ -a sh7785lcr sh sh4 sh7785lcr renesas ap325rxa_config : unconfig @mkdir -p $(obj)include @echo "#define CONFIG_AP325RXA 1" > $(obj)include/config.h - @$(MKCONFIG) -a $(@:_config=) sh sh4 ap325rxa renesas + @$(MKCONFIG) -a $@ sh sh4 ap325rxa renesas espt_config : unconfig @mkdir -p $(obj)include @echo "#define CONFIG_ESPT 1" > $(obj)include/config.h - @$(MKCONFIG) -a $(@:_config=) sh sh4 espt + @$(MKCONFIG) -a $@ sh sh4 espt -#======================================================================== -# 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 - -######################################################################### ######################################################################### ######################################################################### diff --git a/arch/arm/include/asm/arch-davinci/emac_defs.h b/arch/arm/include/asm/arch-davinci/emac_defs.h index b0ec8f5..35a1585 100644 --- a/arch/arm/include/asm/arch-davinci/emac_defs.h +++ b/arch/arm/include/asm/arch-davinci/emac_defs.h @@ -85,7 +85,7 @@ #endif /* PHY mask - set only those phy number bits where phy is/can be connected */ -#define EMAC_MDIO_PHY_NUM 1 +#define EMAC_MDIO_PHY_NUM CONFIG_EMAC_MDIO_PHY_NUM #define EMAC_MDIO_PHY_MASK (1 << EMAC_MDIO_PHY_NUM) /* Ethernet Min/Max packet size */ diff --git a/arch/arm/include/asm/arch-pxa/pxa-regs.h b/arch/arm/include/asm/arch-pxa/pxa-regs.h index a25d4c5..cd7b7f9 100644 --- a/arch/arm/include/asm/arch-pxa/pxa-regs.h +++ b/arch/arm/include/asm/arch-pxa/pxa-regs.h @@ -992,10 +992,6 @@ typedef void (*ExcpHndlr) (void) ; #define UHCHIE __REG(0x4C000068) #define UHCHIT __REG(0x4C00006C) -#if defined(CONFIG_CPU_MONAHANS) -#define UP2OCR __REG(0x40600020) -#endif - #define UHCHR_FSBIR (1<<0) #define UHCHR_FHR (1<<1) #define UHCHR_CGR (1<<2) @@ -1015,6 +1011,24 @@ typedef void (*ExcpHndlr) (void) ; #define UHCHIE_HBAIE (1<<8) #define UHCHIE_RWIE (1<<7) +#if defined(CONFIG_CPU_MONAHANS) || defined(CONFIG_PXA27X) +#define UP2OCR __REG(0x40600020) +#endif + +#define UP2OCR_HXOE (1<<17) +#define UP2OCR_HXS (1<<16) +#define UP2OCR_IDON (1<<10) +#define UP2OCR_EXSUS (1<<9) +#define UP2OCR_EXSP (1<<8) +#define UP2OCR_DMSTATE (1<<7) +#define UP2OCR_VPM (1<<6) +#define UP2OCR_DPSTATE (1<<5) +#define UP2OCR_DPPUE (1<<4) +#define UP2OCR_DMPDE (1<<3) +#define UP2OCR_DPPDE (1<<2) +#define UP2OCR_CPVPE (1<<1) +#define UP2OCR_CPVEN (1<<0) + #endif /* @@ -2407,6 +2421,9 @@ typedef void (*ExcpHndlr) (void) ; #define MDMRS __REG(0x48000040) /* MRS value to be written to SDRAM */ #define BOOT_DEF __REG(0x48000044) /* Read-Only Boot-Time Register. Contains BOOT_SEL and PKG_SEL */ +#define MDREFR_ALTREFA (1 << 31) /* Exiting Alternate Bus Master Mode Refresh Control */ +#define MDREFR_ALTREFB (1 << 30) /* Entering Alternate Bus Master Mode Refresh Control */ +#define MDREFR_K0DB4 (1 << 29) /* SDCLK0 Divide by 4 Control/Status */ #define MDREFR_K2FREE (1 << 25) /* SDRAM Free-Running Control */ #define MDREFR_K1FREE (1 << 24) /* SDRAM Free-Running Control */ #define MDREFR_K0FREE (1 << 23) /* SDRAM Free-Running Control */ diff --git a/arch/avr32/cpu/start.S b/arch/avr32/cpu/start.S index d37a46e..99c9e06 100644 --- a/arch/avr32/cpu/start.S +++ b/arch/avr32/cpu/start.S @@ -27,9 +27,10 @@ #define SYSREG_MMUCR_S_OFFSET 4 #define SR_INIT (SYSREG_BIT(GM) | SYSREG_BIT(EM) | SYSREG_BIT(M0)) -#define CPUCR_INIT (SYSREG_BIT(BI) | SYSREG_BIT(BE) \ - | SYSREG_BIT(FE) | SYSREG_BIT(RE) \ - | SYSREG_BIT(IBE) | SYSREG_BIT(IEE)) +/* due to errata (unreliable branch folding) clear FE bit explicitly */ +#define CPUCR_INIT ((SYSREG_BIT(BI) | SYSREG_BIT(BE) \ + | SYSREG_BIT(RE) | SYSREG_BIT(IBE) \ + | SYSREG_BIT(IEE)) & ~SYSREG_BIT(FE)) /* * To save some space, we use the same entry point for diff --git a/arch/avr32/include/asm/unaligned.h b/arch/avr32/include/asm/unaligned.h new file mode 100644 index 0000000..6cecbbb --- /dev/null +++ b/arch/avr32/include/asm/unaligned.h @@ -0,0 +1 @@ +#include <asm-generic/unaligned.h> diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c index 917ed6c..254aecf 100644 --- a/arch/avr32/lib/board.c +++ b/arch/avr32/lib/board.c @@ -115,8 +115,9 @@ static int init_baudrate(void) static int display_banner (void) { printf ("\n\n%s\n\n", version_string); - printf ("U-Boot code: %p -> %p data: %p -> %p\n", - _text, _etext, _data, _end); + printf ("U-Boot code: %08lx -> %08lx data: %08lx -> %08lx\n", + (unsigned long)_text, (unsigned long)_etext, + (unsigned long)_data, (unsigned long)_end); return 0; } diff --git a/arch/powerpc/cpu/74xx_7xx/cpu.c b/arch/powerpc/cpu/74xx_7xx/cpu.c index 3c17277..14d3ce4 100644 --- a/arch/powerpc/cpu/74xx_7xx/cpu.c +++ b/arch/powerpc/cpu/74xx_7xx/cpu.c @@ -49,11 +49,6 @@ #include <fdt_support.h> #endif -#ifdef CONFIG_AMIGAONEG3SE -#include "../board/MAI/AmigaOneG3SE/via686.h" -#include "../board/MAI/AmigaOneG3SE/memio.h" -#endif - DECLARE_GLOBAL_DATA_PTR; cpu_t @@ -277,19 +272,17 @@ do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) /* * For the 7400 the TB clock runs at 1/4 the cpu bus speed. */ -#if defined(CONFIG_AMIGAONEG3SE) || defined(CONFIG_SYS_CONFIG_BUS_CLK) +#ifndef CONFIG_SYS_BUS_CLK +#define CONFIG_SYS_BUS_CLK gd->bus_clk +#endif + unsigned long get_tbclk(void) { - return (gd->bus_clk / 4); + return CONFIG_SYS_BUS_CLK / 4; } -#else /* ! CONFIG_AMIGAONEG3SE and !CONFIG_SYS_CONFIG_BUS_CLK*/ -unsigned long get_tbclk (void) -{ - return CONFIG_SYS_BUS_HZ / 4; -} -#endif /* CONFIG_AMIGAONEG3SE or CONFIG_SYS_CONFIG_BUS_CLK*/ /* ------------------------------------------------------------------------- */ + #if defined(CONFIG_WATCHDOG) #if !defined(CONFIG_PCIPPC2) && !defined(CONFIG_BAB7xx) void diff --git a/arch/powerpc/cpu/74xx_7xx/interrupts.c b/arch/powerpc/cpu/74xx_7xx/interrupts.c index 0ea1aec..c2856c9 100644 --- a/arch/powerpc/cpu/74xx_7xx/interrupts.c +++ b/arch/powerpc/cpu/74xx_7xx/interrupts.c @@ -34,20 +34,19 @@ int interrupt_init_cpu (unsigned *decrementer_count) { -#if defined(DEBUG) && !defined(CONFIG_AMIGAONEG3SE) - printf("interrupt_init: GT main cause reg: %08x:%08x\n", + debug("interrupt_init: GT main cause reg: %08x:%08x\n", GTREGREAD(LOW_INTERRUPT_CAUSE_REGISTER), GTREGREAD(HIGH_INTERRUPT_CAUSE_REGISTER)); - printf("interrupt_init: ethernet cause regs: %08x %08x %08x\n", + debug("interrupt_init: ethernet cause regs: %08x %08x %08x\n", GTREGREAD(ETHERNET0_INTERRUPT_CAUSE_REGISTER), GTREGREAD(ETHERNET1_INTERRUPT_CAUSE_REGISTER), GTREGREAD(ETHERNET2_INTERRUPT_CAUSE_REGISTER)); - printf("interrupt_init: ethernet mask regs: %08x %08x %08x\n", + debug("interrupt_init: ethernet mask regs: %08x %08x %08x\n", GTREGREAD(ETHERNET0_INTERRUPT_MASK_REGISTER), GTREGREAD(ETHERNET1_INTERRUPT_MASK_REGISTER), GTREGREAD(ETHERNET2_INTERRUPT_MASK_REGISTER)); - puts("interrupt_init: setting decrementer_count\n"); -#endif + debug("interrupt_init: setting decrementer_count\n"); + *decrementer_count = get_tbclk() / CONFIG_SYS_HZ; return (0); diff --git a/arch/powerpc/cpu/74xx_7xx/speed.c b/arch/powerpc/cpu/74xx_7xx/speed.c index f2fdcd5..6450c3c 100644 --- a/arch/powerpc/cpu/74xx_7xx/speed.c +++ b/arch/powerpc/cpu/74xx_7xx/speed.c @@ -25,10 +25,6 @@ #include <74xx_7xx.h> #include <asm/processor.h> -#ifdef CONFIG_AMIGAONEG3SE -#include "../board/MAI/AmigaOneG3SE/via686.h" -#endif - DECLARE_GLOBAL_DATA_PTR; extern unsigned long get_board_bus_clk (void); diff --git a/arch/powerpc/cpu/74xx_7xx/start.S b/arch/powerpc/cpu/74xx_7xx/start.S index 88fdf88..a36af5a 100644 --- a/arch/powerpc/cpu/74xx_7xx/start.S +++ b/arch/powerpc/cpu/74xx_7xx/start.S @@ -745,9 +745,8 @@ in_ram: bne 5b 6: mr r3, r10 /* Destination Address */ -#if defined(CONFIG_AMIGAONEG3SE) || \ - defined(CONFIG_DB64360) || \ - defined(CONFIG_DB64460) || \ +#if defined(CONFIG_DB64360) || \ + defined(CONFIG_DB64460) || \ defined(CONFIG_CPCI750) || \ defined(CONFIG_PPMC7XX) || \ defined(CONFIG_P3Mx) diff --git a/arch/powerpc/cpu/74xx_7xx/traps.c b/arch/powerpc/cpu/74xx_7xx/traps.c index 5073b05..7ae81eb 100644 --- a/arch/powerpc/cpu/74xx_7xx/traps.c +++ b/arch/powerpc/cpu/74xx_7xx/traps.c @@ -37,20 +37,12 @@ #include <kgdb.h> #include <asm/processor.h> -#ifdef CONFIG_AMIGAONEG3SE -DECLARE_GLOBAL_DATA_PTR; -#endif - /* Returns 0 if exception not found and fixup otherwise. */ extern unsigned long search_exception_table(unsigned long); /* THIS NEEDS CHANGING to use the board info structure. */ -#ifdef CONFIG_AMIGAONEG3SE -#define END_OF_MEM (gd->bd->bi_memstart + gd->bd->bi_memsize) -#else #define END_OF_MEM 0x02000000 -#endif /* * Trap & Exception support diff --git a/arch/powerpc/cpu/mpc512x/diu.c b/arch/powerpc/cpu/mpc512x/diu.c index f8d19a0..1cce6a2 100644 --- a/arch/powerpc/cpu/mpc512x/diu.c +++ b/arch/powerpc/cpu/mpc512x/diu.c @@ -179,18 +179,4 @@ void *video_hw_init(void) return (void *)pGD; } -/** - * Set the LUT - * - * @index: color number - * @r: red - * @b: blue - * @g: green - */ -void video_set_lut - (unsigned int index, unsigned char r, unsigned char g, unsigned char b) -{ - return; -} - #endif /* defined(CONFIG_VIDEO) || defined(CONFIG_CFB_CONSOLE) */ diff --git a/arch/powerpc/lib/bootcount.c b/arch/powerpc/lib/bootcount.c index 338c848..07ef28d 100644 --- a/arch/powerpc/lib/bootcount.c +++ b/arch/powerpc/lib/bootcount.c @@ -35,6 +35,11 @@ #define CONFIG_SYS_BOOTCOUNT_SINGLEWORD #endif /* defined(CONFIG_MPC5xxx) */ +#if defined(CONFIG_MPC512X) +#define CONFIG_SYS_BOOTCOUNT_ADDR (&((immap_t *)CONFIG_SYS_IMMR)->clk.bcr) +#define CONFIG_SYS_BOOTCOUNT_SINGLEWORD +#endif /* defined(CONFIG_MPC512X) */ + #if defined(CONFIG_8xx) #define CONFIG_SYS_BOOTCOUNT_ADDR (((immap_t *)CONFIG_SYS_IMMR)->im_cpm.cp_dpmem + \ CPM_BOOTCOUNT_ADDR) diff --git a/arch/sh/cpu/sh2/watchdog.c b/arch/sh/cpu/sh2/watchdog.c index de0254b..0257d8d 100644 --- a/arch/sh/cpu/sh2/watchdog.c +++ b/arch/sh/cpu/sh2/watchdog.c @@ -1,6 +1,6 @@ /* - * Copyright (C) 2008 Nobuhiro Iwamatsu <iwamatsu.nobuhoro@renesas.com> - * Copyright (C) 2008 Renesas Solutions Corp. + * Copyright (C) 2008,2010 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> + * Copyright (C) 2008,2010 Renesas Solutions Corp. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -20,6 +20,7 @@ #include <common.h> #include <asm/processor.h> +#include <asm/system.h> int watchdog_init(void) { @@ -28,6 +29,9 @@ int watchdog_init(void) void reset_cpu(unsigned long ignored) { + /* Address error with SR.BL=1 first. */ + trigger_address_error(); + while (1) ; } diff --git a/arch/sh/cpu/sh3/watchdog.c b/arch/sh/cpu/sh3/watchdog.c index 92bea74..90694f8 100644 --- a/arch/sh/cpu/sh3/watchdog.c +++ b/arch/sh/cpu/sh3/watchdog.c @@ -1,4 +1,7 @@ /* + * (C) Copyright 2010 + * Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> + * * (C) Copyright 2007 * Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> * @@ -20,6 +23,7 @@ #include <common.h> #include <asm/processor.h> +#include <asm/system.h> int watchdog_init(void) { @@ -28,6 +32,9 @@ int watchdog_init(void) void reset_cpu(unsigned long ignored) { + /* Address error with SR.BL=1 first. */ + trigger_address_error(); + while (1) ; } diff --git a/arch/sh/cpu/sh4/watchdog.c b/arch/sh/cpu/sh4/watchdog.c index f692429..d7e1703 100644 --- a/arch/sh/cpu/sh4/watchdog.c +++ b/arch/sh/cpu/sh4/watchdog.c @@ -17,6 +17,7 @@ #include <common.h> #include <asm/processor.h> +#include <asm/system.h> #include <asm/io.h> #define WDT_BASE WTCNT @@ -66,6 +67,9 @@ int watchdog_disable(void) void reset_cpu(unsigned long ignored) { + /* Address error with SR.BL=1 first. */ + trigger_address_error(); + while (1) ; } diff --git a/arch/sh/include/asm/system.h b/arch/sh/include/asm/system.h index a62c422..56fd77a 100644 --- a/arch/sh/include/asm/system.h +++ b/arch/sh/include/asm/system.h @@ -8,7 +8,7 @@ * from linux kernel code. */ -#include <linux/irqflags.h> +#include <asm/irqflags.h> #include <asm/types.h> /* @@ -272,4 +272,14 @@ void enable_hlt(void); #define arch_align_stack(x) (x) +static inline void trigger_address_error(void) +{ + __asm__ __volatile__ ( + "ldc %0, sr\n\t" + "mov.l @%1, %0" + : + : "r" (0x10000000), "r" (0x80000001) + ); +} + #endif diff --git a/arch/sh/lib/time.c b/arch/sh/lib/time.c index 9a8f89a..bc1656f 100644 --- a/arch/sh/lib/time.c +++ b/arch/sh/lib/time.c @@ -2,7 +2,7 @@ * (C) Copyright 2009 * Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> * - * (C) Copyright 2007-2008 + * (C) Copyright 2007-2010 * Nobobuhiro Iwamatsu <iwamatsu@nigauri.org> * * (C) Copyright 2003 @@ -36,6 +36,8 @@ #define TMU_MAX_COUNTER (~0UL) static ulong timer_freq; +static unsigned long last_tcnt; +static unsigned long long overflow_ticks; static inline unsigned long long tick_to_time(unsigned long long tick) { @@ -97,12 +99,26 @@ int timer_init (void) tmu_timer_stop(0); tmu_timer_start(0); + last_tcnt = 0; + overflow_ticks = 0; + return 0; } unsigned long long get_ticks (void) { - return 0 - readl(TCNT0); + unsigned long tcnt = 0 - readl(TCNT0); + unsigned long ticks; + + if (last_tcnt > tcnt) { /* overflow */ + overflow_ticks++; + ticks = (0xffffffff - last_tcnt) + tcnt; + } else { + ticks = tcnt; + } + last_tcnt = tcnt; + + return (overflow_ticks << 32) | tcnt; } void __udelay (unsigned long usec) diff --git a/board/MAI/AmigaOneG3SE/AmigaOneG3SE.c b/board/MAI/AmigaOneG3SE/AmigaOneG3SE.c deleted file mode 100644 index 4d44001..0000000 --- a/board/MAI/AmigaOneG3SE/AmigaOneG3SE.c +++ /dev/null @@ -1,122 +0,0 @@ -/* - * (C) Copyright 2002 - * Hyperion Entertainment, ThomasF@hyperion-entertainment.com - * (C) Copyright 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 <command.h> -#include <pci.h> -#include <netdev.h> -#include "articiaS.h" -#include "memio.h" -#include "via686.h" - -__asm__(" .globl send_kb \n " - "send_kb: \n " - " lis r9, 0xfe00 \n " - " \n " - " li r4, 0x10 # retries \n " - " mtctr r4 \n " - " \n " - "idle: \n " - " lbz r4, 0x64(r9) \n " - " andi. r4, r4, 0x02 \n " - " bne idle \n " - - "ready: \n " - " stb r3, 0x60(r9) \n " - " \n " - "check: \n " - " lbz r4, 0x64(r9) \n " - " andi. r4, r4, 0x01 \n " - " beq check \n " - " \n " - " lbz r4, 0x60(r9) \n " - " cmpwi r4, 0xfa \n " - " beq done \n " - - " bdnz idle \n " - - " li r3, 0 \n " - " blr \n " - - "done: \n " - " li r3, 1 \n " - " blr \n " - - ".globl test_kb \n " - "test_kb: \n " - " mflr r10 \n " - " li r3, 0xed \n " - " bl send_kb \n " - " li r3, 0x01 \n " - " bl send_kb \n " - " mtlr r10 \n " - " blr \n " -); - - -int checkboard (void) -{ - printf ("Board: AmigaOneG3SE\n"); - return 0; -} - -phys_size_t initdram (int board_type) -{ - return articiaS_ram_init (); -} - - -void after_reloc (ulong dest_addr, gd_t *gd) -{ - board_init_r (gd, dest_addr); -} - - -int misc_init_r (void) -{ - extern pci_dev_t video_dev; - extern void drv_video_init (void); - - if (video_dev != ~0) - drv_video_init (); - - return (0); -} - - -void pci_init_board (void) -{ -#ifndef CONFIG_RAMBOOT - articiaS_pci_init (); -#endif -} - -int board_eth_init(bd_t *bis) -{ -#if defined(CONFIG_3COM) - eth_3com_initialize(bis); -#endif - return 0; -} diff --git a/board/MAI/AmigaOneG3SE/Makefile b/board/MAI/AmigaOneG3SE/Makefile deleted file mode 100644 index fa28d3b..0000000 --- a/board/MAI/AmigaOneG3SE/Makefile +++ /dev/null @@ -1,63 +0,0 @@ -# -# (C) Copyright 2002-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 -ifneq ($(OBJTREE),$(SRCTREE)) -$(shell mkdir -p $(obj)../menu) -$(shell mkdir -p $(obj)../bios_emulator) -endif - -LIB = $(obj)lib$(BOARD).a - -COBJS = $(BOARD).o articiaS.o flash.o serial.o smbus.o articiaS_pci.o \ - via686.o i8259.o ../bios_emulator/x86interface.o \ - ../bios_emulator/bios.o ../bios_emulator/glue.o \ - interrupts.o ps2kbd.o video.o usb_uhci.o enet.o \ - ../menu/cmd_menu.o cmd_boota.o nvram.o - -SOBJS = board_asm_init.o memio.o - -EMUDIR = ../bios_emulator/scitech/src/x86emu/ -EMUOBJ = $(EMUDIR)decode.o $(EMUDIR)ops2.o $(EMUDIR)fpu.o $(EMUDIR)prim_ops.o \ - $(EMUDIR)ops.o $(EMUDIR)sys.o -EMUSRC = $(EMUOBJ:.o=.c) - -SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) -OBJS := $(addprefix $(obj),$(COBJS)) -SOBJS := $(addprefix $(obj),$(SOBJS)) -EMUOBJ := $(addprefix $(obj),$(EMUOBJ)) - -$(LIB): $(obj).depend $(OBJS) $(SOBJS) $(EMUSRC) - make $(obj)libx86emu.a -C ../bios_emulator/scitech/src/x86emu -f makefile.uboot CROSS_COMPILE=$(CROSS_COMPILE) - -rm $(LIB) - $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS) $(EMUOBJ) - - -######################################################################### - -# defines $(obj).depend target -include $(SRCTREE)/rules.mk - -sinclude $(obj).depend - -######################################################################### diff --git a/board/MAI/AmigaOneG3SE/articiaS.c b/board/MAI/AmigaOneG3SE/articiaS.c deleted file mode 100644 index 3901b80..0000000 --- a/board/MAI/AmigaOneG3SE/articiaS.c +++ /dev/null @@ -1,704 +0,0 @@ -/* - * (C) Copyright 2002 - * Hyperion Entertainment, ThomasF@hyperion-entertainment.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 <pci.h> -#include <asm/processor.h> -#include "memio.h" -#include "articiaS.h" -#include "smbus.h" -#include "via686.h" - -DECLARE_GLOBAL_DATA_PTR; - -#undef DEBUG - -struct dimm_bank { - uint8 used; /* Bank is populated */ - uint32 rows; /* Number of row addresses */ - uint32 columns; /* Number of column addresses */ - uint8 registered; /* SIMM is registered */ - uint8 ecc; /* SIMM has ecc */ - uint8 burst_len; /* Supported burst lengths */ - uint32 cas_lat; /* Supported CAS latencies */ - uint32 cas_used; /* CAS to use (not set by user) */ - uint32 trcd; /* RAS to CAS latency */ - uint32 trp; /* Precharge latency */ - uint32 tclk_hi; /* SDRAM cycle time (highest CAS latency) */ - uint32 tclk_2hi; /* SDRAM second highest CAS latency */ - uint32 size; /* Size of bank in bytes */ - uint8 auto_refresh; /* Module supports auto refresh */ - uint32 refresh_time; /* Refresh time (in ns) */ -}; - - -/* -** Based in part on the evb64260 code -*/ - -/* - * translate ns.ns/10 coding of SPD timing values - * into 10 ps unit values - */ -static inline unsigned short NS10to10PS (unsigned char spd_byte) -{ - unsigned short ns, ns10; - - /* isolate upper nibble */ - ns = (spd_byte >> 4) & 0x0F; - /* isolate lower nibble */ - ns10 = (spd_byte & 0x0F); - - return (ns * 100 + ns10 * 10); -} - -/* - * translate ns coding of SPD timing values - * into 10 ps unit values - */ -static inline unsigned short NSto10PS (unsigned char spd_byte) -{ - return (spd_byte * 100); -} - - -long detect_sdram (uint8 * rom, int dimmNum, struct dimm_bank *banks) -{ - int dimm_address = (dimmNum == 0) ? SM_DIMM0_ADDR : SM_DIMM1_ADDR; - uint32 busclock = gd->bus_clk; - uint32 memclock = busclock; - uint32 tmemclock = 1000000000 / (memclock / 100); - uint32 datawidth; - - if (sm_get_data (rom, dimm_address) == 0) { - /* Nothing in slot, make both banks empty */ - debug ("Slot %d: vacant\n", dimmNum); - banks[0].used = 0; - banks[1].used = 0; - return 0; - } - - if (rom[2] != 0x04) { - debug ("Slot %d: No SDRAM\n", dimmNum); - banks[0].used = 0; - banks[1].used = 0; - return 0; - } - - /* Determine number of banks/rows */ - if (rom[5] == 1) { - banks[0].used = 1; - banks[1].used = 0; - } else { - banks[0].used = 1; - banks[1].used = 1; - } - - /* Determine number of row addresses */ - if (rom[3] & 0xf0) { - /* Different banks sizes */ - banks[0].rows = rom[3] & 0x0f; - banks[1].rows = (rom[3] & 0xf0) >> 4; - } else { - /* Equal sized banks */ - banks[0].rows = rom[3] & 0x0f; - banks[1].rows = banks[0].rows; - } - - /* Determine number of column addresses */ - if (rom[4] & 0xf0) { - /* Different bank sizes */ - banks[0].columns = rom[4] & 0x0f; - banks[1].columns = (rom[4] & 0xf0) >> 4; - } else { - banks[0].columns = rom[4] & 0x0f; - banks[1].columns = banks[0].columns; - } - - /* Check Jedec revision, and modify row/column accordingly */ - if (rom[62] > 0x10) { - if (banks[0].rows <= 3) - banks[0].rows += 15; - if (banks[1].rows <= 3) - banks[1].rows += 15; - if (banks[0].columns <= 3) - banks[0].columns += 15; - if (banks[0].columns <= 3) - banks[0].columns += 15; - } - - /* Check registered/unregisterd */ - if (rom[21] & 0x12) { - banks[0].registered = 1; - banks[1].registered = 1; - } else { - banks[0].registered = 0; - banks[1].registered = 0; - } - -#ifdef CONFIG_ECC - /* Check parity/ECC */ - banks[0].ecc = (rom[11] == 0x02); - banks[1].ecc = (rom[11] == 0x02); -#endif - - /* Find burst lengths supported */ - banks[0].burst_len = rom[16] & 0x8f; - banks[1].burst_len = rom[16] & 0x8f; - - /* Find possible cas latencies */ - banks[0].cas_lat = rom[18] & 0x7F; - banks[1].cas_lat = rom[18] & 0x7F; - - /* RAS/CAS latency */ - banks[0].trcd = (NSto10PS (rom[29]) + (tmemclock - 1)) / tmemclock; - banks[1].trcd = (NSto10PS (rom[29]) + (tmemclock - 1)) / tmemclock; - - /* Precharge latency */ - banks[0].trp = (NSto10PS (rom[27]) + (tmemclock - 1)) / tmemclock; - banks[1].trp = (NSto10PS (rom[27]) + (tmemclock - 1)) / tmemclock; - - /* highest CAS latency */ - banks[0].tclk_hi = NS10to10PS (rom[9]); - banks[1].tclk_hi = NS10to10PS (rom[9]); - - /* second highest CAS latency */ - banks[0].tclk_2hi = NS10to10PS (rom[23]); - banks[1].tclk_2hi = NS10to10PS (rom[23]); - - /* bank sizes */ - datawidth = rom[13] & 0x7f; - banks[0].size = - (1L << (banks[0].rows + banks[0].columns)) * - /* FIXME datawidth */ 8 * rom[17]; - if (rom[13] & 0x80) - banks[1].size = 2 * banks[0].size; - else - banks[1].size = (1L << (banks[1].rows + banks[1].columns)) * - /* FIXME datawidth */ 8 * rom[17]; - - /* Refresh */ - if (rom[12] & 0x80) { - banks[0].auto_refresh = 1; - banks[1].auto_refresh = 1; - } else { - banks[0].auto_refresh = 0; - banks[1].auto_refresh = 0; - } - - switch (rom[12] & 0x7f) { - case 0: - banks[0].refresh_time = (1562500 + (tmemclock - 1)) / tmemclock; - banks[1].refresh_time = (1562500 + (tmemclock - 1)) / tmemclock; - break; - case 1: - banks[0].refresh_time = (390600 + (tmemclock - 1)) / tmemclock; - banks[1].refresh_time = (390600 + (tmemclock - 1)) / tmemclock; - break; - case 2: - banks[0].refresh_time = (781200 + (tmemclock - 1)) / tmemclock; - banks[1].refresh_time = (781200 + (tmemclock - 1)) / tmemclock; - break; - case 3: - banks[0].refresh_time = (3125000 + (tmemclock - 1)) / tmemclock; - banks[1].refresh_time = (3125000 + (tmemclock - 1)) / tmemclock; - break; - case 4: - banks[0].refresh_time = (6250000 + (tmemclock - 1)) / tmemclock; - banks[1].refresh_time = (6250000 + (tmemclock - 1)) / tmemclock; - break; - case 5: - banks[0].refresh_time = (12500000 + (tmemclock - 1)) / tmemclock; - banks[1].refresh_time = (12500000 + (tmemclock - 1)) / tmemclock; - break; - default: - banks[0].refresh_time = 0x100; /* Default of Articia S */ - banks[1].refresh_time = 0x100; - break; - } - -#ifdef DEBUG - printf ("\nInformation for SIMM bank %ld:\n", dimmNum); - printf ("Number of banks: %ld\n", banks[0].used + banks[1].used); - printf ("Number of row addresses: %ld\n", banks[0].rows); - printf ("Number of coumns addresses: %ld\n", banks[0].columns); - printf ("SIMM is %sregistered\n", - banks[0].registered == 0 ? "not " : ""); -#ifdef CONFIG_ECC - printf ("SIMM %s ECC\n", - banks[0].ecc == 1 ? "supports" : "doesn't support"); -#endif - printf ("Supported burst lenghts: %s %s %s %s %s\n", - banks[0].burst_len & 0x08 ? "8" : " ", - banks[0].burst_len & 0x04 ? "4" : " ", - banks[0].burst_len & 0x02 ? "2" : " ", - banks[0].burst_len & 0x01 ? "1" : " ", - banks[0].burst_len & 0x80 ? "PAGE" : " "); - printf ("Supported CAS latencies: %s %s %s\n", - banks[0].cas_lat & 0x04 ? "CAS 3" : " ", - banks[0].cas_lat & 0x02 ? "CAS 2" : " ", - banks[0].cas_lat & 0x01 ? "CAS 1" : " "); - printf ("RAS to CAS latency: %ld\n", banks[0].trcd); - printf ("Precharge latency: %ld\n", banks[0].trp); - printf ("SDRAM highest CAS latency: %ld\n", banks[0].tclk_hi); - printf ("SDRAM 2nd highest CAS latency: %ld\n", banks[0].tclk_2hi); - printf ("SDRAM data width: %ld\n", datawidth); - printf ("Auto Refresh %ssupported\n", - banks[0].auto_refresh ? "" : "not "); - printf ("Refresh time: %ld clocks\n", banks[0].refresh_time); - if (banks[0].used) - printf ("Bank 0 size: %ld MB\n", banks[0].size / 1024 / 1024); - if (banks[1].used) - printf ("Bank 1 size: %ld MB\n", banks[1].size / 1024 / 1024); - - printf ("\n"); -#endif - - sm_term (); - return 1; -} - -void select_cas (struct dimm_bank *banks, uint8 fast) -{ - if (!banks[0].used) { - banks[0].cas_used = 0; - banks[0].cas_used = 0; - return; - } - - if (fast) { - /* Search for fast CAS */ - uint32 i; - uint32 c = 0x01; - - for (i = 1; i < 5; i++) { - if (banks[0].cas_lat & c) { - banks[0].cas_used = i; - banks[1].cas_used = i; - debug ("Using CAS %d (fast)\n", i); - return; - } - c <<= 1; - } - - /* Default to CAS 3 */ - banks[0].cas_used = 3; - banks[1].cas_used = 3; - debug ("Using CAS 3 (fast)\n"); - - return; - } else { - /* Search for slow cas */ - uint32 i; - uint32 c = 0x08; - - for (i = 4; i > 1; i--) { - if (banks[0].cas_lat & c) { - banks[0].cas_used = i; - banks[1].cas_used = i; - debug ("Using CAS %d (slow)\n", i); - return; - } - c >>= 1; - } - - /* Default to CAS 3 */ - banks[0].cas_used = 3; - banks[1].cas_used = 3; - debug ("Using CAS 3 (slow)\n"); - - return; - } - - banks[0].cas_used = 3; - banks[1].cas_used = 3; - debug ("Using CAS 3\n"); - - return; -} - -uint32 get_reg_setting (uint32 banks, uint32 rows, uint32 columns, uint32 size) -{ - uint32 i; - - struct RowColumnSize { - uint32 banks; - uint32 rows; - uint32 columns; - uint32 size; - uint32 register_value; - }; - - struct RowColumnSize rcs_map[] = { - /* Sbk Radr Cadr MB Value */ - {1, 11, 8, 8, 0x00840f00}, - {1, 11, 9, 16, 0x00925f00}, - {1, 11, 10, 32, 0x00a64f00}, - {2, 12, 8, 32, 0x00c55f00}, - {2, 12, 9, 64, 0x00d66f00}, - {2, 12, 10, 128, 0x00e77f00}, - {2, 12, 11, 256, 0x00ff8f00}, - {2, 13, 11, 512, 0x00ff9f00}, - {0, 0, 0, 0, 0x00000000} - }; - - - i = 0; - - while (rcs_map[i].banks != 0) { - if (rows == rcs_map[i].rows - && columns == rcs_map[i].columns - && (size / 1024 / 1024) == rcs_map[i].size) - return rcs_map[i].register_value; - - i++; - } - - return 0; -} - -uint32 burst_to_len (uint32 support) -{ - if (support & 0x80) - return 0x7; - else if (support & 0x8) - return 0x3; - else if (support & 0x4) - return 0x2; - else if (support & 0x2) - return 0x1; - else if (support & 0x1) - return 0x0; - - return 0; -} - -long articiaS_ram_init (void) -{ - register uint32 i; - register uint32 value1; - register uint32 value2; - uint8 rom[128]; - uint32 burst_len; - uint32 burst_support; - uint32 total_ram = 0; - - struct dimm_bank banks[4]; /* FIXME: Move to initram */ - uint32 busclock = gd->bus_clk; - uint32 memclock = busclock; - uint32 reg32; - uint32 refresh_clocks; - uint8 auto_refresh; - - memset (banks, 0, sizeof (struct dimm_bank) * 4); - - detect_sdram (rom, 0, &banks[0]); - detect_sdram (rom, 1, &banks[2]); - - for (i = 0; i < 4; i++) { - total_ram = total_ram + (banks[i].used * banks[i].size); - } - - pci_write_cfg_long (0, 0, GLOBALINFO0, 0x117430c0); - pci_write_cfg_long (0, 0, HBUSACR0, 0x1f0100b0); - pci_write_cfg_long (0, 0, SRAM_CR, 0x00f12000); /* Note: Might also try 0x00f10000 (original: 0x00f12000) */ - pci_write_cfg_byte (0, 0, DRAM_RAS_CTL0, 0x3f); - pci_write_cfg_byte (0, 0, DRAM_RAS_CTL1, 0x00); /* was: 0x04); */ - pci_write_cfg_word (0, 0, DRAM_ECC0, 0x2020); /* was: 0x2400); No ECC yet */ - - /* FIXME: Move this stuff to seperate function, like setup_dimm_bank */ - if (banks[0].used) { - value1 = get_reg_setting (banks[0].used + banks[1].used, - banks[0].rows, banks[0].columns, - banks[0].size); - } else { - value1 = 0; - } - - if (banks[1].used) { - value2 = get_reg_setting (banks[0].used + banks[1].used, - banks[1].rows, banks[1].columns, - banks[1].size); - } else { - value2 = 0; - } - - pci_write_cfg_long (0, 0, DIMM0_B0_SCR0, value1); - pci_write_cfg_long (0, 0, DIMM0_B1_SCR0, value2); - - debug ("DIMM0_B0_SCR0 = 0x%08x\n", value1); - debug ("DIMM0_B1_SCR0 = 0x%08x\n", value2); - - if (banks[2].used) { - value1 = get_reg_setting (banks[2].used + banks[3].used, - banks[2].rows, banks[2].columns, - banks[2].size); - } else { - value1 = 0; - } - - if (banks[3].used) { - value2 = get_reg_setting (banks[2].used + banks[3].used, - banks[3].rows, banks[3].columns, - banks[3].size); - } else { - value2 = 0; - } - - pci_write_cfg_long (0, 0, DIMM1_B2_SCR0, value1); - pci_write_cfg_long (0, 0, DIMM1_B3_SCR0, value2); - - debug ("DIMM0_B2_SCR0 = 0x%08x\n", value1); - debug ("DIMM0_B3_SCR0 = 0x%08x\n", value2); - - pci_write_cfg_long (0, 0, DIMM2_B4_SCR0, 0); - pci_write_cfg_long (0, 0, DIMM2_B5_SCR0, 0); - pci_write_cfg_long (0, 0, DIMM3_B6_SCR0, 0); - pci_write_cfg_long (0, 0, DIMM3_B7_SCR0, 0); - - /* Determine timing */ - select_cas (&banks[0], 0); - select_cas (&banks[2], 0); - - /* FIXME: What about write recovery */ - /* Auto refresh Precharge */ -#if 0 - reg32 = (0x3 << 13) | (0x7 << 10) | ((banks[0].trp - 2) << 8) | - /* Write recovery CAS Latency */ - (0x1 << 6) | (banks[0].cas_used << 4) | - /* RAS/CAS latency */ - ((banks[0].trcd - 1) << 0); - - reg32 |= ((0x3 << 13) | (0x7 << 10) | ((banks[2].trp - 2) << 8) | - (0x1 << 6) | (banks[2].cas_used << 4) | - ((banks[2].trcd - 1) << 0)) << 16; -#else - if (100000000 == gd->bus_clk) - reg32 = 0x71737173; - else - reg32 = 0x69736973; -#endif - pci_write_cfg_long (0, 0, DIMM0_TCR0, reg32); - debug ("DIMM0_TCR0 = 0x%08x\n", reg32); - - /* Write default in DIMM2/3 (not used on A1) */ - pci_write_cfg_long (0, 0, DIMM2_TCR0, 0x7d737d73); - - - /* Determine buffered/unbuffered mode for each SIMM. Uses first bank as reference (second, if present, uses the same) */ - reg32 = pci_read_cfg_long (0, 0, DRAM_GCR0); - reg32 &= 0xFF00FFFF; - -#if 0 - if (banks[0].used && banks[0].registered) - reg32 |= 0x1 << 16; - - if (banks[2].used && banks[2].registered) - reg32 |= 0x1 << 18; -#else - if (banks[0].registered || banks[2].registered) - reg32 |= 0x55 << 16; -#endif - pci_write_cfg_long (0, 0, DRAM_GCR0, reg32); - debug ("DRAM_GCR0 = 0x%08x\n", reg32); - - /* Determine refresh */ - refresh_clocks = 0xffffffff; - auto_refresh = 1; - - for (i = 0; i < 4; i++) { - if (banks[i].used) { - if (banks[i].auto_refresh == 0) - auto_refresh = 0; - if (banks[i].refresh_time < refresh_clocks) - refresh_clocks = banks[i].refresh_time; - } - } - - -#if 1 - /* It seems this is suggested by the ArticiaS data book */ - if (100000000 == gd->bus_clk) - refresh_clocks = 1561; - else - refresh_clocks = 2083; -#endif - - - debug ("Refresh set to %ld clocks, auto refresh %s\n", - refresh_clocks, auto_refresh ? "on" : "off"); - - pci_write_cfg_long (0, 0, DRAM_REFRESH0, - (1 << 16) | (1 << 15) | (auto_refresh << 12) | - (refresh_clocks)); - debug ("DRAM_REFRESH0 = 0x%08x\n", - (1 << 16) | (1 << 15) | (auto_refresh << 12) | - (refresh_clocks)); - -/* pci_write_cfg_long(0, 0, DRAM_REFRESH0, 0x00019400); */ - - /* Set mode registers */ - /* FIXME: For now, set same burst len for all modules. Dunno if that's necessary */ - /* Find a common burst len */ - burst_support = 0xff; - - if (banks[0].used) - burst_support = banks[0].burst_len; - if (banks[1].used) - burst_support = banks[1].burst_len; - if (banks[2].used) - burst_support = banks[2].burst_len; - if (banks[3].used) - burst_support = banks[3].burst_len; - - /* - ** Mode register: - ** Bits Use - ** 0-2 Burst len - ** 3 Burst type (0 = sequential, 1 = interleave) - ** 4-6 CAS latency - ** 7-8 Operation mode (0 = default, all others invalid) - ** 9 Write burst - ** 10-11 Reserved - ** - ** Mode register burst table: - ** A2 A1 A0 lenght - ** 0 0 0 1 - ** 0 0 1 2 - ** 0 1 0 4 - ** 0 1 1 8 - ** 1 0 0 invalid - ** 1 0 1 invalid - ** 1 1 0 invalid - ** 1 1 1 page (only valid for non-interleaved) - */ - - burst_len = burst_to_len (burst_support); - burst_len = 2; /* FIXME */ - - if (banks[0].used) { - pci_write_cfg_word (0, 0, DRAM_PCR0, - 0x8000 | burst_len | (banks[0].cas_used << 4)); - debug ("Mode bank 0: 0x%08x\n", - 0x8000 | burst_len | (banks[0].cas_used << 4)); - } else { - /* Seems to be needed to disable the bank */ - pci_write_cfg_word (0, 0, DRAM_PCR0, 0x0000 | 0x032); - } - - if (banks[1].used) { - pci_write_cfg_word (0, 0, DRAM_PCR0, - 0x9000 | burst_len | (banks[1].cas_used << 4)); - debug ("Mode bank 1: 0x%08x\n", - 0x8000 | burst_len | (banks[1].cas_used << 4)); - } else { - /* Seems to be needed to disable the bank */ - pci_write_cfg_word (0, 0, DRAM_PCR0, 0x1000 | 0x032); - } - - - if (banks[2].used) { - pci_write_cfg_word (0, 0, DRAM_PCR0, - 0xa000 | burst_len | (banks[2].cas_used << 4)); - debug ("Mode bank 2: 0x%08x\n", - 0x8000 | burst_len | (banks[2].cas_used << 4)); - } else { - /* Seems to be needed to disable the bank */ - pci_write_cfg_word (0, 0, DRAM_PCR0, 0x2000 | 0x032); - } - - - if (banks[3].used) { - pci_write_cfg_word (0, 0, DRAM_PCR0, - 0xb000 | burst_len | (banks[3].cas_used << 4)); - debug ("Mode bank 3: 0x%08x\n", - 0x8000 | burst_len | (banks[3].cas_used << 4)); - } else { - /* Seems to be needed to disable the bank */ - pci_write_cfg_word (0, 0, DRAM_PCR0, 0x3000 | 0x032); - } - - - pci_write_cfg_word (0, 0, 0xba, 0x00); - - return total_ram; -} - -extern int drv_isa_kbd_init (void); - -int last_stage_init (void) -{ - drv_isa_kbd_init (); - return 0; -} - -int overwrite_console (void) -{ - return (0); -} - -#define in_8 read_byte -#define out_8 write_byte - -static __inline__ unsigned long get_msr (void) -{ - unsigned long msr; - - asm volatile ("mfmsr %0":"=r" (msr):); - - return msr; -} - -static __inline__ void set_msr (unsigned long msr) -{ - asm volatile ("mtmsr %0"::"r" (msr)); -} - -int board_early_init_f (void) -{ - unsigned char c_value = 0; - unsigned long msr; - - /* Basic init of PS/2 keyboard (needed for some reason)... */ - /* Ripped from John's code */ - while ((in_8 ((unsigned char *) 0xfe000064) & 0x02) != 0); - out_8 ((unsigned char *) 0xfe000064, 0xaa); - while ((in_8 ((unsigned char *) 0xfe000064) & 0x01) == 0); - c_value = in_8 ((unsigned char *) 0xfe000060); - while ((in_8 ((unsigned char *) 0xfe000064) & 0x02) != 0); - out_8 ((unsigned char *) 0xfe000064, 0xab); - while ((in_8 ((unsigned char *) 0xfe000064) & 0x01) == 0); - c_value = in_8 ((unsigned char *) 0xfe000060); - while ((in_8 ((unsigned char *) 0xfe000064) & 0x02) != 0); - out_8 ((unsigned char *) 0xfe000064, 0xae); -/* while ((in_8((unsigned char *)0xfe000064) & 0x01) == 0); */ -/* c_value = in_8((unsigned char *)0xfe000060); */ - - /* Enable FPU */ - msr = get_msr (); - set_msr (msr | MSR_FP); - - via_calibrate_bus_freq (); - - return 0; -} diff --git a/board/MAI/AmigaOneG3SE/articiaS.h b/board/MAI/AmigaOneG3SE/articiaS.h deleted file mode 100644 index ce20d03..0000000 --- a/board/MAI/AmigaOneG3SE/articiaS.h +++ /dev/null @@ -1,142 +0,0 @@ -#ifndef ARTICIAS_H -#define ARTICIAS_H - -#include "short_types.h" -#include <common.h> - -#define REG_GROUP 0xF0 - -/* ArticiaS registers */ -#define GLOBALINFO0 0x50 -#define GLOBALINFO1 0x51 -#define GLOBALINFO2 0x52 -#define GLOBALINFO3 0x53 -#define GLOBALCTL0 0x54 -#define GLOBALCTL1 0x55 -#define NVRAMCTL 0x56 -#define PCI1ACR0 0x58 -#define PCI1ACR1 0x59 -#define PCI1ACR2 0x5a -#define PCI1ACR3 0x5b -#define HBUSACR0 0x5c -#define HBUSACR1 0x5d -#define HBUSACR2 0x5e -#define HBUSACR3 0x5f -#define HOSTINT0 0x68 -#define HOSTINT1 0x69 -#define HOSTINT2 0x6a -#define HOSTINT3 0x6b -#define HOSTRBCR 0x70 -#define XDBCR 0x74 - -#define LBSBCR2 0xd2 - - -/* Memory controller */ - -#define DIMM0_B0_SCR0 0x90 -#define DIMM0_B1_SCR0 0x94 -#define DIMM1_B2_SCR0 0x98 -#define DIMM1_B3_SCR0 0x9c -#define DIMM2_B4_SCR0 0xa0 -#define DIMM2_B5_SCR0 0xa4 -#define DIMM3_B6_SCR0 0xa8 -#define DIMM3_B7_SCR0 0xac - -#define DIMM0_TCR0 0xb0 -#define DIMM1_TCR0 0xb2 -#define DIMM2_TCR0 0xb4 -#define DIMM3_TCR0 0xb6 - -#define DRAM_REFRESH0 0xb8 -#define DRAM_GCR0 0xc0 -#define DRAM_PCR0 0xc6 -#define DRAM_ECC0 0xc4 -#define SRAM_CR 0xc8 -#define DRAM_RAS_CTL0 0xcc -#define DRAM_RAS_CTL1 0xcd - -/* Bits for REG_GROUP */ -#define REG_GROUP_MULTI (1<<1) -#define REG_GROUP_SPECIAL (1<<3) -#define REG_GROUP_DIAG (0x1<<4) -#define REG_GROUP_POWER (0x2<<4) - - -#define GLOBALINFO0_BO (1<<7) - - -#define GLOBALINFO2_B1ARBITER (1<<6) - - -#define HBUSACR0_CPUAPC (1<<0) -#define HBUSACR0_NUMREQ_2 (0<<1) -#define HBUSACR0_NUMREQ_3 (1<<1) -#define HBUSACR0_NUMREQ_4 (2<<1) -#define HBUSACR0_NUMREQ_MASK (7<<1) -#define HBUSACR0_RAW (1<<6) -#define HBUSACR0_WAIT (1<<7) -#define HBUSACR0_RESERVED (0x30) - - -#define HBUSACR2_BURST (1<<0) -#define HBUSACR2_LAT (1<<1) - - -#define HBUSACR3_LMWC_SM (1<<0) -#define HBUSACR3_LMWC_PCI1 (1<<1) -#define HBUSACR3_LMWC_PCI0 (1<<2) -#define HBUSACR3_PMWC_PCI1 (1<<3) -#define HBUSACR3_PMWC_PCI0 (1<<4) -#define HBUSACR3_FKH (1<<5) -#define HBUSACR3_92H_EN (1<<6) -#define HBUSACR3_60H_64H_EN (1<<7) - - -#define HOSTRBCR_PREFETCH (1<<4) - - -#define XDBCR_HWTOXD (1<<0) -#define XDBCR_KBTOXD (1<<1) -#define XDBCR_RTCTOXD (1<<2) -#define XDBCR_SCALE_1_1 (0x0<<3) -#define XDBCR_SCALE_2_2 (0x1<<3) -#define XDBCR_SCALE_3_2 (0x2<<3) -#define XDBCR_SCALE_4_4 (0x3<<3) -#define XDBCR_SCALE_5_8 (0x4<<3) -#define XDBCR_SCALE_6_8 (0x5<<3) -#define XDBCR_SCALE_8_8 (0x6<<3) -#define XDBCR_SCALE_0_16 (0x7<<3) -#define XDBCR_XDPROM (1<<7) - - -#define LBSBCR2_1_RWAC (1<<2) - - -/* PCI controller */ -#define ARTICIAS_PCI_CFGADDR 0xfec00cf8 -#define ARTICIAS_PCI_CFGDATA 0xfee00cfc - -#define ARTICIAS_PCI_BUS 0x80000000 -#define ARTICIAS_PCI_MAXSIZE 0x7cffffff -#define ARTICIAS_PCI_PHYS 0x80000000 - -#define ARTICIAS_SYS_BUS 0x00000000 -#define ARTICIAS_SYS_MAXSIZE 0x7fffffff -#define ARTICIAS_SYS_PHYS 0x00000000 - -#define ARTICIAS_PCIIO_BUS 0x00800000 -#define ARTICIAS_PCIIO_MAXSIZE 0x003fffff -#define ARTICIAS_PCIIO_PHYS 0xfe800000 - -#define ARTICIAS_ISAIO_BUS 0x00002000 -#define ARTICIAS_ISAIO_MAXSIZE 0x0000d000 -#define ARTICIAS_ISAIO_PHYS 0xfe002000 - - -/* Prototypes */ -long articiaS_ram_init(void); -void articiaS_pci_init(void); - - -#endif diff --git a/board/MAI/AmigaOneG3SE/articiaS_pci.c b/board/MAI/AmigaOneG3SE/articiaS_pci.c deleted file mode 100644 index 371f67f..0000000 --- a/board/MAI/AmigaOneG3SE/articiaS_pci.c +++ /dev/null @@ -1,576 +0,0 @@ -/* - * (C) Copyright 2002 - * Hyperion Entertainment, Hans-JoergF@hyperion-entertainment.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 <pci.h> -#include "memio.h" -#include "articiaS.h" - -DECLARE_GLOBAL_DATA_PTR; - -#undef ARTICIA_PCI_DEBUG - -#ifdef ARTICIA_PCI_DEBUG -#define PRINTF(fmt,args...) printf (fmt ,##args) -#else -#define PRINTF(fmt,args...) -#endif - -struct pci_controller articiaS_hose; - -long irq_alloc(long wanted); - -static pci_dev_t pci_hose_find_class(struct pci_controller *hose, int bus, short find_class, int index); -static int articiaS_init_vga(void); -static void pci_cfgfunc_dummy(struct pci_controller *host, pci_dev_t dev, struct pci_config_table *table); -unsigned char pci_irq_alloc(void); - -extern void via_cfgfunc_via686(struct pci_controller * host, pci_dev_t dev, struct pci_config_table *table); -extern void via_cfgfunc_ide_init(struct pci_controller *host, pci_dev_t dev, struct pci_config_table *table); -extern void via_init_irq_routing(uint8 []); -extern void via_init_afterscan(void); - -#define cfgfunc_via686 1 -#define cfgfunc_dummy 2 -#define cfgfunc_ide_init 3 - -static struct pci_config_table config_table[] = -{ - { - 0x1106, PCI_ANY_ID, PCI_CLASS_BRIDGE_ISA, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, - (void *)cfgfunc_via686, {0, 0, 0} - }, - { - 0x1106, PCI_ANY_ID, PCI_ANY_ID, 0,7,4, - (void *)cfgfunc_dummy, {0,0,0} - }, - { - 0x1106, 0x3068, PCI_ANY_ID, 0, 7, PCI_ANY_ID, - (void *)cfgfunc_dummy, {0,0,0} - }, - { - 0x1106, PCI_ANY_ID, PCI_ANY_ID, 0,7,1, - (void *)cfgfunc_ide_init, {0,0,0} - }, - { - 0, - } -}; - - -void pci_cfgfunc_dummy(struct pci_controller *host, pci_dev_t dev, struct pci_config_table *table) -{ - - -} - -unsigned long irq_penalties[16] = -{ - 1000, /* 0:timer */ - 1000, /* 1:keyboard */ - 1000, /* 2:cascade */ - 50, /* 3:serial (COM2) */ - 50, /* 4:serial (COM1) */ - 4, /* 5:USB2 */ - 100, /* 6:floppy */ - 3, /* 7:parallel */ - 50, /* 8:AC97/MC97 */ - 0, /* 9: */ - 3, /* 10:: */ - 0, /* 11: */ - 3, /* 12: USB1 */ - 0, /* 13: */ - 100, /* 14: ide0 */ - 100, /* 15: ide1 */ -}; - - -/* - * The following defines a hard-coded interrupt mapping for the - * know devices on the board. - * If a device isn't found here, assumed to be a device that's - * plugged into a PCI or AGP slot - * NOTE: This table is machine dependant. - */ - -struct pci_irq_fixup_table -{ - uint8 bus; /* Bus number */ - uint8 device; /* Device number */ - uint8 func; /* Function number */ - uint8 interrupt; /* Interrupt to use (0xff to disable) */ -}; - -struct pci_irq_fixup_table fixuptab [] = -{ - { 0, 0, 0, 0xff}, /* Articia S host bridge */ - { 0, 1, 0, 0xff}, /* Articia S AGP bridge */ -/* { 0, 6, 0, 0x05}, /###* 3COM ethernet */ - { 0, 7, 0, 0xff}, /* VIA southbridge */ - { 0, 7, 1, 0x0e}, /* IDE controller in legacy mode */ -/* { 0, 7, 2, 0x05}, /###* First USB controller */ -/* { 0, 7, 3, 0x0c}, /###* Second USB controller (shares interrupt with ethernet) */ - { 0, 7, 4, 0xff}, /* ACPI Power Management */ -/* { 0, 7, 5, 0x08}, /###* AC97 */ -/* { 0, 7, 6, 0x08}, /###* MC97 */ - { 0xff, 0xff, 0xff, 0xff} -}; - - -/* - * This table maps IRQ's to PCI interrupts - */ - -uint8 pci_intmap[4] = {0, 0, 0, 0}; - -/* - * Map PCI slots to interrupt routings - * This table lists the device number assigned to a card inserted - * into the slot, along with a permutation for the slot's IRQ routing. - * NOTE: This table is machine dependant. - */ - -struct pci_slot_irq_routing -{ - uint8 bus; - uint8 device; - - uint8 ints[4]; -}; - -struct pci_slot_irq_routing amigaone_pci_routing[] = -{ - {0, 8, {0, 1, 2, 3}}, /* Slot 1 (left of riser slot) */ - {0, 9, {1, 2, 3, 0}}, /* Slot 2 (middle slot) */ - {0, 10, {2, 3, 0, 1}}, /* Slot 3 (leftmost slot) */ - {1, 0, {1, 0, 2, 3}}, /* AGP slot (only IRQA and IRQB) */ - {1, 1, {1, 2, 3, 0}}, /* PCI slot on AGP bus */ - {0, 6, {3, 3, 3, 3}}, /* On board ethernet */ - {0, 7, {0, 1, 2, 3}}, /* Southbridge */ - {0xff, 0, {0, 0, 0, 0}} -}; - -void articiaS_pci_irq_init(void) -{ - char *s; - - s = getenv("pci_irqa"); - if (s) - pci_intmap[0] = simple_strtoul (s, NULL, 10); - else - pci_intmap[0] = pci_irq_alloc(); - - s = getenv("pci_irqb"); - if (s) - pci_intmap[1] = simple_strtoul (s, NULL, 10); - else - pci_intmap[1] = pci_irq_alloc(); - - s = getenv("pci_irqc"); - if (s) - pci_intmap[2] = simple_strtoul (s, NULL, 10); - else - pci_intmap[2] = pci_irq_alloc(); - - s = getenv("pci_irqd"); - if (s) - pci_intmap[3] = simple_strtoul (s, NULL, 10); - else - pci_intmap[3] = pci_irq_alloc(); -} - - -unsigned char pci_irq_alloc(void) -{ - int i; - int interrupt = 10; - unsigned long min_penalty = 1000; - - /* Search for the minimal penalty, favoring interrupts at the end */ - for (i = 0; i < 16; i++) - { - if (irq_penalties[i] <= min_penalty) - { - interrupt = i; - min_penalty = irq_penalties[i]; - } - } - - PRINTF("pci_irq_alloc: Minimal penalty is %ld for %d\n", min_penalty, interrupt); - - irq_penalties[interrupt]++; - - return interrupt; -} - - -void articiaS_pci_fixup_irq(struct pci_controller *hose, pci_dev_t dev) -{ - int8 bus, device, func, pin, line; - int i; - - bus = PCI_BUS(dev); - device = PCI_DEV(dev); - func = PCI_FUNC(dev); - - PRINTF("Fixup irq of %d:%d.%d\n", bus, device, func); - - /* Search for the device in the table */ - for (i = 0; fixuptab[i].bus != 0xff; i++) - { - if (bus == fixuptab[i].bus && device == fixuptab[i].device && func == fixuptab[i].func) - { - /* If the device needs an interrupt, write it */ - if (fixuptab[i].interrupt != 0xff) - { - PRINTF("Assigning IRQ %d (fixed)\n", fixuptab[i].interrupt); - pci_write_config_byte(dev, PCI_INTERRUPT_LINE, fixuptab[i].interrupt); - } - else - { - /* Otherwise, see if it wants an interrupt, and disable it if needed */ - pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); - if (pin) - { - PRINTF("Disabling IRQ\n"); - pci_write_config_byte(dev, PCI_INTERRUPT_LINE, 0xff); - } - } - - return; - } - } - - /* If we get here, we have another PCI device in a slot... find the appropriate IRQ */ - - /* Find matching pin */ - pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); - pin--; - - /* Search for it's map */ - for (i = 0; amigaone_pci_routing[i].bus != 0xff; i++) - { - if (bus == amigaone_pci_routing[i].bus && device == amigaone_pci_routing[i].device) - { - line = pci_intmap[amigaone_pci_routing[i].ints[pin]]; - PRINTF("Assigning IRQ %d (pin %d)\n", line, pin); - pci_write_config_byte(dev, PCI_INTERRUPT_LINE, line); - return; - } - } - - PRINTF("Unkonwn PCI device found\n"); -} - -void articiaS_pci_init (void) -{ - int i; - char *s; - - PRINTF("atriciaS_pci_init\n"); - - /* Why aren't these relocated?? */ - for (i=0; config_table[i].config_device; i++) - { - switch((int)config_table[i].config_device) - { - case cfgfunc_via686: config_table[i].config_device = via_cfgfunc_via686; break; - case cfgfunc_dummy: config_table[i].config_device = pci_cfgfunc_dummy; break; - case cfgfunc_ide_init: config_table[i].config_device = via_cfgfunc_ide_init; break; - default: PRINTF("Error: Unknown constant\n"); - } - } - - articiaS_hose.first_busno = 0; - articiaS_hose.last_busno = 0xff; - articiaS_hose.config_table = config_table; - articiaS_hose.fixup_irq = articiaS_pci_fixup_irq; - - articiaS_pci_irq_init(); - - /* System memory */ - pci_set_region(articiaS_hose.regions + 0, - ARTICIAS_SYS_BUS, - ARTICIAS_SYS_PHYS, - ARTICIAS_SYS_MAXSIZE, - PCI_REGION_MEM | PCI_REGION_SYS_MEMORY); - - /* PCI memory space */ - pci_set_region(articiaS_hose.regions + 1, - ARTICIAS_PCI_BUS, - ARTICIAS_PCI_PHYS, - ARTICIAS_PCI_MAXSIZE, - PCI_REGION_MEM); - - /* PCI io space */ - pci_set_region(articiaS_hose.regions + 2, - ARTICIAS_PCIIO_BUS, - ARTICIAS_PCIIO_PHYS, - ARTICIAS_PCIIO_MAXSIZE, - PCI_REGION_IO); - - /* PCI/ISA io space */ - pci_set_region(articiaS_hose.regions + 3, - ARTICIAS_ISAIO_BUS, - ARTICIAS_ISAIO_PHYS, - ARTICIAS_ISAIO_MAXSIZE, - PCI_REGION_IO); - - - articiaS_hose.region_count = 4; - - pci_setup_indirect(&articiaS_hose, ARTICIAS_PCI_CFGADDR, ARTICIAS_PCI_CFGDATA); - PRINTF("Registering articia hose...\n"); - pci_register_hose(&articiaS_hose); - PRINTF("Enabling AGP...\n"); - pci_write_config_byte(PCI_BDF(0,0,0), 0x58, 0x01); - PRINTF("Scanning bus...\n"); - articiaS_hose.last_busno = pci_hose_scan(&articiaS_hose); - - via_init_irq_routing(pci_intmap); - - PRINTF("After-Scan results:\n"); - PRINTF("Bus range: %d - %d\n", articiaS_hose.first_busno , articiaS_hose.last_busno); - - via_init_afterscan(); - - pci_write_config_byte(PCI_BDF(0,1,0), PCI_INTERRUPT_LINE, 0xFF); - - s = getenv("as_irq"); - if (s) - { - pci_write_config_byte(PCI_BDF(0,0,0), PCI_INTERRUPT_LINE, simple_strtoul (s, NULL, 10)); - } - - s = getenv("x86_run_bios"); - if (!s || (s && strcmp(s, "on")==0)) - { - if (articiaS_init_vga() == -1) - { - /* If the VGA didn't init and we have stdout set to VGA, reset to serial */ -/* s = getenv("stdout"); */ -/* if (s && strcmp(s, "vga") == 0) */ -/* { */ -/* setenv("stdout", "serial"); */ -/* } */ - } - } - pci_write_config_byte(PCI_BDF(0,1,0), PCI_INTERRUPT_LINE, 0xFF); - -} - -pci_dev_t pci_hose_find_class(struct pci_controller *hose, int bus, short find_class, int index) -{ - unsigned int sub_bus, found_multi=0; - unsigned short vendor, class; - unsigned char header_type; - pci_dev_t dev; - u8 c1, c2; - - sub_bus = bus; - - for (dev = PCI_BDF(bus,0,0); - dev < PCI_BDF(bus,PCI_MAX_PCI_DEVICES-1,PCI_MAX_PCI_FUNCTIONS-1); - dev += PCI_BDF(0,0,1)) - { - if ( dev == PCI_BDF(hose->first_busno,0,0) ) - continue; - - if (PCI_FUNC(dev) && !found_multi) - continue; - - pci_hose_read_config_byte(hose, dev, PCI_HEADER_TYPE, &header_type); - - pci_hose_read_config_word(hose, dev, PCI_VENDOR_ID, &vendor); - - if (vendor != 0xffff && vendor != 0x0000) - { - - if (!PCI_FUNC(dev)) - found_multi = header_type & 0x80; - pci_hose_read_config_byte(hose, dev, 0x0B, &c1); - pci_hose_read_config_byte(hose, dev, 0x0A, &c2); - class = c1<<8 | c2; - /*printf("At %02x:%02x:%02x: class %x\n", */ - /* PCI_BUS(dev), PCI_DEV(dev), PCI_FUNC(dev), class); */ - if (class == find_class) - { - if (index == 0) - return dev; - else index--; - } - } - } - - return ~0; -} - - -/* - * For a given bus number, find the bridge on this hose that provides this - * bus number. The function scans for bridges and peeks config space offset - * 0x19 (PCI_SECONDARY_BUS). - */ -pci_dev_t pci_find_bridge_for_bus(struct pci_controller *hose, int busnr) -{ - pci_dev_t dev; - int bus; - unsigned int found_multi=0; - unsigned char header_type; - unsigned short vendor; - unsigned char secondary_bus; - - if (hose == NULL) hose = &articiaS_hose; - - if (busnr < hose->first_busno || busnr > hose->last_busno) return PCI_ANY_ID; /* Not in range */ - - /* - * The bridge must be on a lower bus number - */ - for (bus = hose->first_busno; bus < busnr; bus++) - { - for (dev = PCI_BDF(bus,0,0); - dev < PCI_BDF(bus,PCI_MAX_PCI_DEVICES-1,PCI_MAX_PCI_FUNCTIONS-1); - dev += PCI_BDF(0,0,1)) - { - if ( dev == PCI_BDF(hose->first_busno,0,0) ) - continue; - - if (PCI_FUNC(dev) && !found_multi) - continue; - - pci_hose_read_config_byte(hose, dev, PCI_HEADER_TYPE, &header_type); - - pci_hose_read_config_word(hose, dev, PCI_VENDOR_ID, &vendor); - - if (vendor != 0xffff && vendor != 0x0000) - { - - if (!PCI_FUNC(dev)) - found_multi = header_type & 0x80; - if (header_type == 1) /* Bridge device header */ - { - pci_hose_read_config_byte(hose, dev, PCI_SECONDARY_BUS, &secondary_bus); - if ((int)secondary_bus == busnr) return dev; - } - - } - } - } - return PCI_ANY_ID; -} - -static short classes[] = -{ - PCI_CLASS_DISPLAY_VGA, - PCI_CLASS_DISPLAY_XGA, - PCI_CLASS_DISPLAY_3D, - PCI_CLASS_DISPLAY_OTHER, - ~0 -}; - -extern int execute_bios(pci_dev_t gr_dev, void *); - -pci_dev_t video_dev; - -int articiaS_init_vga (void) -{ - extern void shutdown_bios(void); - pci_dev_t dev = ~0; - int busnr = 0; - int classnr = 0; - - video_dev = PCI_ANY_ID; - - printf("VGA: "); - - PRINTF("Trying to initialize x86 VGA Card(s)\n"); - - while (dev == ~0) - { - PRINTF("Searching for class 0x%x on bus %d\n", classes[classnr], busnr); - /* Find the first of this class on this bus */ - dev = pci_hose_find_class(&articiaS_hose, busnr, classes[classnr], 0); - if (dev != ~0) - { - PRINTF("Found VGA Card at %02x:%02x:%02x\n", PCI_BUS(dev), PCI_DEV(dev), PCI_FUNC(dev)); - break; - } - busnr++; - if (busnr > articiaS_hose.last_busno) - { - busnr = 0; - classnr ++; - if (classes[classnr] == ~0) - { - printf("NOT PRESENT\n"); - return -1; - } - } - } - - /* - * If we get here we have found the first graphics card. - * If the bus number is not 0, then it is probably behind a bridge, and the - * bridge needs to be told to forward VGA access. - */ - - if (PCI_BUS(dev) != 0) - { - pci_dev_t bridge; - PRINTF("Behind bridge, looking for bridge\n"); - bridge = pci_find_bridge_for_bus(&articiaS_hose, PCI_BUS(dev)); - if (dev != PCI_ANY_ID) - { - unsigned char agp_control_0; - PRINTF("Got the bridge at %02x:%02x:%02x\n", - PCI_BUS(bridge), PCI_DEV(bridge), PCI_FUNC(bridge)); - pci_hose_read_config_byte(&articiaS_hose, bridge, 0x3E, &agp_control_0); - agp_control_0 |= 0x18; - pci_hose_write_config_byte(&articiaS_hose, bridge, 0x3E, agp_control_0); - PRINTF("Configured for VGA forwarding\n"); - } - } - - /* - * Now try to run the bios - */ - PRINTF("Trying to run bios now\n"); - if (execute_bios(dev, gd->relocaddr)) - { - printf("OK\n"); - video_dev = dev; - } - else - { - printf("ERROR\n"); - } - - PRINTF("Done scanning.\n"); - - shutdown_bios(); - - if (dev == PCI_ANY_ID) return -1; - else return 0; - -} diff --git a/board/MAI/AmigaOneG3SE/board_asm_init.S b/board/MAI/AmigaOneG3SE/board_asm_init.S deleted file mode 100644 index 086b19c..0000000 --- a/board/MAI/AmigaOneG3SE/board_asm_init.S +++ /dev/null @@ -1,156 +0,0 @@ -#include "macros.h" - - -#define GLOBALINFO0 0x50 -#define GLOBALINFO0_BO (1<<7) -#define GLOBALINFO2_B1ARBITER (1<<6) -#define HBUSACR0 0x5c -#define HBUSACR2_BURST (1<<0) -#define HBUSACR2_LAT (1<<1) - -#define RECEIVER_HOLDING 0 -#define TRANSMITTER_HOLDING 0 -#define INTERRUPT_ENABLE 1 -#define INTERRUPT_STATUS 2 -#define FIFO_CONTROL 2 -#define LINE_CONTROL 3 -#define MODEM_CONTROL 4 -#define LINE_STATUS 5 -#define MODEM_STATUS 6 -#define SCRATCH_PAD 7 - -#define DIVISOR_LATCH_LSB 0 -#define DIVISOR_LATCH_MSB 1 -#define PRESCALER_DIVISION 5 - -#define UART(x) (0x3f8+(x)) - -#define GLOBALINFO0 0x50 -#define GLOBALINFO0_BO (1<<7) -#define GLOBALINFO2_B1ARBITER (1<<6) -#define HBUSACR0 0x5c -#define HBUSACR2_BURST (1<<0) -#define HBUSACR2_LAT (1<<1) - -#define SUPERIO_1 ((7 << 3) | (0)) -#define SUPERIO_2 ((7 << 3) | (1)) - - .globl board_asm_init - -board_asm_init: - mflr r29 - /* Set 'Must-set' register */ - li r3, 0 - li r4, 0 - li r5, 0x5e - bl pci_read_cfg_byte - ori r3, r3, (1<<1) - xori r6, r3, (1<<1) - li r3, 0 - bl pci_write_cfg_byte - - li r3, 0 - li r5, 0x52 - bl pci_read_cfg_byte - ori r6, r3, (1<<6) - li r3, 0 - bl pci_write_cfg_byte - - li r3, 0 - li r4, 0x08 - li r5, 0xd2 - bl pci_read_cfg_byte - ori r6, r3, (1<<2) - li r3, 0 - bl pci_write_cfg_byte - - - /* Do PCI reset */ -/* li r3, 0 - li r4, 0x38 - li r5, 0x47 - bl pci_read_cfg_byte - ori r6, r3, 0x01 - li r3, 0 - li r4, 0x38 - li r5, 0x47 - bl pci_write_cfg_byte*/ - - - /* Enable NVRAM for environment */ - li r3, 0 - li r4, 0 - li r5, 0x56 - li r6, 0x0B - bl pci_write_cfg_byte - - - /* Init Super-I/O chips */ - - siowb 0x40, 0x08 - siowb 0x41, 0x01 - siowb 0x45, 0x80 - siowb 0x46, 0x60 - siowb 0x47, 0x20 - siowb 0x48, 0x01 - siowb 0x4a, 0xc4 - siowb 0x50, 0x0e - siowb 0x51, 0x76 - siowb 0x52, 0x34 - siowb 0x54, 0x00 - siowb 0x55, 0x90 - siowb 0x56, 0x99 - siowb 0x57, 0x90 - siowb 0x85, 0x01 - - /* Enable configuration mode for SuperIO */ - li r3, 0 - li r4, (7<<3) - li r5, 0x85 - bl pci_read_cfg_byte - ori r6, r3, 0x02 - mr r31, r6 - li r3,0 - bl pci_write_cfg_byte - - /* COM1 as 3f8 */ - outb 0x3f0, 0xe7 - outb 0x3f1, 0xfe - - /* COM2 as 2f8 */ - outb 0x3f0, 0xe8 - outb 0x3f1, 0xeb - - /* Enable */ - outb 0x3f0, 0xe2 - inb r3, 0x3f1 - ori r3, r3, 0x0c - outb 0x3f0, 0xe2 - outbr 0x3f1, r3 - - /* Disable configuration mode */ - li r3, 0 - li r4, (7<<3) - li r5, 0x85 - mr r6, r31 - bl pci_write_cfg_byte - - /* Set line control */ - outb UART(LINE_CONTROL), 0x83 - outb UART(DIVISOR_LATCH_LSB), 0x0c - outb UART(DIVISOR_LATCH_MSB), 0x00 - outb UART(LINE_CONTROL), 0x3 - - mtlr r29 - blr - - - .globl new_reset - .globl new_reset_end -new_reset: - li r0, 0x100 - oris r0, r0, 0xFFF0 - mtlr r0 - blr - -new_reset_end: diff --git a/board/MAI/AmigaOneG3SE/cmd_boota.c b/board/MAI/AmigaOneG3SE/cmd_boota.c deleted file mode 100644 index 6b955d8..0000000 --- a/board/MAI/AmigaOneG3SE/cmd_boota.c +++ /dev/null @@ -1,128 +0,0 @@ -#include <common.h> -#include <command.h> -#include "../disk/part_amiga.h" -#include <asm/cache.h> - -DECLARE_GLOBAL_DATA_PTR; - -#undef BOOTA_DEBUG - -#ifdef BOOTA_DEBUG -#define PRINTF(fmt,args...) printf (fmt ,##args) -#else -#define PRINTF(fmt,args...) -#endif - -struct block_header { - u32 id; - u32 summed_longs; - s32 chk_sum; -}; - -extern block_dev_desc_t *ide_get_dev (int dev); -extern struct bootcode_block *get_bootcode (block_dev_desc_t * dev_desc); -extern int sum_block (struct block_header *header); - -struct bootcode_block bblk; - -int do_boota (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) -{ - unsigned char *load_address = (unsigned char *) CONFIG_SYS_LOAD_ADDR; - unsigned char *base_address; - unsigned long offset; - - unsigned long part_number = 0; - block_dev_desc_t *boot_disk; - char *s; - struct bootcode_block *boot_code; - - /* Get parameters */ - - switch (argc) { - case 2: - load_address = (unsigned char *) simple_strtol (argv[1], NULL, 16); - part_number = 0; - break; - case 3: - load_address = (unsigned char *) simple_strtol (argv[1], NULL, 16); - part_number = simple_strtol (argv[2], NULL, 16); - break; - } - - base_address = load_address; - - PRINTF ("Loading boot code from disk %d to %p\n", part_number, - load_address); - - /* Find the appropriate disk device */ - boot_disk = ide_get_dev (part_number); - if (!boot_disk) { - PRINTF ("Unknown disk %d\n", part_number); - return 1; - } - - /* Find the bootcode block */ - boot_code = get_bootcode (boot_disk); - if (!boot_code) { - PRINTF ("Not a bootable disk %d\n", part_number); - return 1; - } - - /* Only use the offset from the first block */ - offset = boot_code->load_data[0]; - memcpy (load_address, &boot_code->load_data[1], 122 * 4); - load_address += 122 * 4; - - /* Setup for the loop */ - bblk.next = boot_code->next; - boot_code = &bblk; - - /* Scan the chain, and copy the loader succesively into the destination area */ - while (0xffffffff != boot_code->next) { - PRINTF ("Loading block %d\n", boot_code->next); - - /* Load block */ - if (1 != - boot_disk->block_read (boot_disk->dev, boot_code->next, 1, - (ulong *) & bblk)) { - PRINTF ("Read error\n"); - return 1; - } - - /* check sum */ - if (sum_block ((struct block_header *) (ulong *) & bblk) != 0) { - PRINTF ("Checksum error\n"); - return 1; - } - - /* Ok, concatenate it to the already loaded code */ - memcpy (load_address, boot_code->load_data, 123 * 4); - load_address += 123 * 4; - } - - printf ("Bootcode loaded to %p (size %d)\n", base_address, - load_address - base_address); - printf ("Entry point at %p\n", base_address + offset); - - flush_cache (base_address, load_address - base_address); - - - s = getenv ("autostart"); - if (s && strcmp (s, "yes") == 0) { - void (*boot) (bd_t *, char *, block_dev_desc_t *); - char *args; - - boot = (void (*)(bd_t *, char *, block_dev_desc_t *)) (base_address + offset); - boot (gd->bd, getenv ("amiga_bootargs"), boot_disk); - } - - - return 0; -} -#if defined(CONFIG_AMIGAONEG3SE) && defined(CONFIG_CMD_BSP) -U_BOOT_CMD( - boota, 3, 1, do_boota, - "boot an Amiga kernel", - "address disk" -); -#endif /* _CMD_BOOTA_H */ diff --git a/board/MAI/AmigaOneG3SE/config.mk b/board/MAI/AmigaOneG3SE/config.mk deleted file mode 100644 index 930a793..0000000 --- a/board/MAI/AmigaOneG3SE/config.mk +++ /dev/null @@ -1,32 +0,0 @@ -# -# (C) Copyright 2002 -# Wolfgang Denk, DENX Software Engineering, wd@denx.de. -# -# See file CREDITS for list of people who contributed to this -# project. -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, -# MA 02111-1307 USA -# - -# -# AmigaOneG3SE boards -# - -X86EMU = -I../bios_emulator/scitech/include -I../bios_emulator/scitech/src/x86emu - -TEXT_BASE = 0xfff00000 - -PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -Wa,-mregnames -DEASTEREGG $(X86EMU) -Dprintk=printf #-DDEBUG diff --git a/board/MAI/AmigaOneG3SE/enet.c b/board/MAI/AmigaOneG3SE/enet.c deleted file mode 100644 index b9df55c..0000000 --- a/board/MAI/AmigaOneG3SE/enet.c +++ /dev/null @@ -1,840 +0,0 @@ -/* - * (C) Copyright 2002 - * Adam Kowalczyk, ACK Software Controls Inc. akowalczyk@cogeco.ca - * - * Some portions taken from 3c59x.c Written 1996-1999 by Donald Becker. - * - * Outline of the program based on eepro100.c which is - * - * (C) Copyright 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 - */ - -#include <common.h> -#include <malloc.h> -#include <net.h> -#include <netdev.h> -#include <asm/io.h> -#include <pci.h> - -#include "articiaS.h" -#include "memio.h" - -/* 3Com Ethernet PCI definitions*/ - -/* #define PCI_VENDOR_ID_3COM 0x10B7 */ -#define PCI_DEVICE_ID_3COM_3C905C 0x9200 - -/* 3Com Commands, top 5 bits are command and bottom 11 bits are parameters */ - -#define TotalReset (0<<11) -#define SelectWindow (1<<11) -#define StartCoax (2<<11) -#define RxDisable (3<<11) -#define RxEnable (4<<11) -#define RxReset (5<<11) -#define UpStall (6<<11) -#define UpUnstall (6<<11)+1 -#define DownStall (6<<11)+2 -#define DownUnstall (6<<11)+3 -#define RxDiscard (8<<11) -#define TxEnable (9<<11) -#define TxDisable (10<<11) -#define TxReset (11<<11) -#define FakeIntr (12<<11) -#define AckIntr (13<<11) -#define SetIntrEnb (14<<11) -#define SetStatusEnb (15<<11) -#define SetRxFilter (16<<11) -#define SetRxThreshold (17<<11) -#define SetTxThreshold (18<<11) -#define SetTxStart (19<<11) -#define StartDMAUp (20<<11) -#define StartDMADown (20<<11)+1 -#define StatsEnable (21<<11) -#define StatsDisable (22<<11) -#define StopCoax (23<<11) -#define SetFilterBit (25<<11) - -/* The SetRxFilter command accepts the following classes */ - -#define RxStation 1 -#define RxMulticast 2 -#define RxBroadcast 4 -#define RxProm 8 - -/* 3Com status word defnitions */ - -#define IntLatch 0x0001 -#define HostError 0x0002 -#define TxComplete 0x0004 -#define TxAvailable 0x0008 -#define RxComplete 0x0010 -#define RxEarly 0x0020 -#define IntReq 0x0040 -#define StatsFull 0x0080 -#define DMADone (1<<8) -#define DownComplete (1<<9) -#define UpComplete (1<<10) -#define DMAInProgress (1<<11) /* DMA controller is still busy.*/ -#define CmdInProgress (1<<12) /* EL3_CMD is still busy.*/ - -/* Polling Registers */ - -#define DnPoll 0x2d -#define UpPoll 0x3d - -/* Register window 0 offets */ - -#define Wn0EepromCmd 10 /* Window 0: EEPROM command register. */ -#define Wn0EepromData 12 /* Window 0: EEPROM results register. */ -#define IntrStatus 0x0E /* Valid in all windows. */ - -/* Register window 0 EEPROM bits */ - -#define EEPROM_Read 0x80 -#define EEPROM_WRITE 0x40 -#define EEPROM_ERASE 0xC0 -#define EEPROM_EWENB 0x30 /* Enable erasing/writing for 10 msec. */ -#define EEPROM_EWDIS 0x00 /* Disable EWENB before 10 msec timeout. */ - -/* EEPROM locations. */ - -#define PhysAddr01 0 -#define PhysAddr23 1 -#define PhysAddr45 2 -#define ModelID 3 -#define EtherLink3ID 7 -#define IFXcvrIO 8 -#define IRQLine 9 -#define NodeAddr01 10 -#define NodeAddr23 11 -#define NodeAddr45 12 -#define DriverTune 13 -#define Checksum 15 - -/* Register window 1 offsets, the window used in normal operation */ - -#define TX_FIFO 0x10 -#define RX_FIFOa 0x10 -#define RxErrors 0x14 -#define RxStatus 0x18 -#define Timer 0x1A -#define TxStatus 0x1B -#define TxFree 0x1C /* Remaining free bytes in Tx buffer. */ - -/* Register Window 2 */ - -#define Wn2_ResetOptions 12 - -/* Register Window 3: MAC/config bits */ - -#define Wn3_Config 0 /* Internal Configuration */ -#define Wn3_MAC_Ctrl 6 -#define Wn3_Options 8 - -#define BFEXT(value, offset, bitcount) \ - ((((unsigned long)(value)) >> (offset)) & ((1 << (bitcount)) - 1)) - -#define BFINS(lhs, rhs, offset, bitcount) \ - (((lhs) & ~((((1 << (bitcount)) - 1)) << (offset))) | \ - (((rhs) & ((1 << (bitcount)) - 1)) << (offset))) - -#define RAM_SIZE(v) BFEXT(v, 0, 3) -#define RAM_WIDTH(v) BFEXT(v, 3, 1) -#define RAM_SPEED(v) BFEXT(v, 4, 2) -#define ROM_SIZE(v) BFEXT(v, 6, 2) -#define RAM_SPLIT(v) BFEXT(v, 16, 2) -#define XCVR(v) BFEXT(v, 20, 4) -#define AUTOSELECT(v) BFEXT(v, 24, 1) - -/* Register Window 4: Xcvr/media bits */ - -#define Wn4_FIFODiag 4 -#define Wn4_NetDiag 6 -#define Wn4_PhysicalMgmt 8 -#define Wn4_Media 10 - -#define Media_SQE 0x0008 /* Enable SQE error counting for AUI. */ -#define Media_10TP 0x00C0 /* Enable link beat and jabber for 10baseT. */ -#define Media_Lnk 0x0080 /* Enable just link beat for 100TX/100FX. */ -#define Media_LnkBeat 0x0800 - -/* Register Window 7: Bus Master control */ - -#define Wn7_MasterAddr 0 -#define Wn7_MasterLen 6 -#define Wn7_MasterStatus 12 - -/* Boomerang bus master control registers. */ - -#define PktStatus 0x20 -#define DownListPtr 0x24 -#define FragAddr 0x28 -#define FragLen 0x2c -#define TxFreeThreshold 0x2f -#define UpPktStatus 0x30 -#define UpListPtr 0x38 - -/* The Rx and Tx descriptor lists. */ - -#define LAST_FRAG 0x80000000 /* Last Addr/Len pair in descriptor. */ -#define DN_COMPLETE 0x00010000 /* This packet has been downloaded */ - -struct rx_desc_3com { - u32 next; /* Last entry points to 0 */ - u32 status; /* FSH -> Frame Start Header */ - u32 addr; /* Up to 63 addr/len pairs possible */ - u32 length; /* Set LAST_FRAG to indicate last pair */ -}; - -/* Values for the Rx status entry. */ - -#define RxDComplete 0x00008000 -#define RxDError 0x4000 -#define IPChksumErr (1<<25) -#define TCPChksumErr (1<<26) -#define UDPChksumErr (1<<27) -#define IPChksumValid (1<<29) -#define TCPChksumValid (1<<30) -#define UDPChksumValid (1<<31) - -struct tx_desc_3com { - u32 next; /* Last entry points to 0 */ - u32 status; /* bits 0:12 length, others see below */ - u32 addr; - u32 length; -}; - -/* Values for the Tx status entry. */ - -#define CRCDisable 0x2000 -#define TxDComplete 0x8000 -#define AddIPChksum 0x02000000 -#define AddTCPChksum 0x04000000 -#define AddUDPChksum 0x08000000 -#define TxIntrUploaded 0x80000000 /* IRQ when in FIFO, but maybe not sent. */ - -/* XCVR Types */ - -#define XCVR_10baseT 0 -#define XCVR_AUI 1 -#define XCVR_10baseTOnly 2 -#define XCVR_10base2 3 -#define XCVR_100baseTx 4 -#define XCVR_100baseFx 5 -#define XCVR_MII 6 -#define XCVR_NWAY 8 -#define XCVR_ExtMII 9 -#define XCVR_Default 10 /* I don't think this is correct -> should have been 0x10 if Auto Negotiate */ - -struct descriptor { /* A generic descriptor. */ - u32 next; /* Last entry points to 0 */ - u32 status; /* FSH -> Frame Start Header */ - u32 addr; /* Up to 63 addr/len pairs possible */ - u32 length; /* Set LAST_FRAG to indicate last pair */ -}; - -/* Misc. definitions */ - -#define NUM_RX_DESC PKTBUFSRX * 10 -#define NUM_TX_DESC 1 /* Number of TX descriptors */ - -#define TOUT_LOOP 1000000 - -#define ETH_ALEN 6 - -#define EL3WINDOW(dev, win_num) ETH_OUTW(dev, SelectWindow + (win_num), EL3_CMD) -#define EL3_CMD 0x0e -#define EL3_STATUS 0x0e - - -#undef ETH_DEBUG - -#ifdef ETH_DEBUG -#define PRINTF(fmt,args...) printf (fmt ,##args) -#else -#define PRINTF(fmt,args...) -#endif - - -static struct rx_desc_3com *rx_ring; /* RX descriptor ring */ -static struct tx_desc_3com *tx_ring; /* TX descriptor ring */ -static u8 rx_buffer[NUM_RX_DESC][PKTSIZE_ALIGN];/* storage for the incoming messages */ -static int rx_next = 0; /* RX descriptor ring pointer */ -static int tx_next = 0; /* TX descriptor ring pointer */ -static int tx_threshold; - -static void init_rx_ring(struct eth_device* dev); -static void purge_tx_ring(struct eth_device* dev); - -static void read_hw_addr(struct eth_device* dev, bd_t * bis); - -static int eth_3com_init(struct eth_device* dev, bd_t *bis); -static int eth_3com_send(struct eth_device* dev, volatile void *packet, int length); -static int eth_3com_recv(struct eth_device* dev); -static void eth_3com_halt(struct eth_device* dev); - -#define io_to_phys(a) pci_io_to_phys((pci_dev_t)dev->priv, a) -#define phys_to_io(a) pci_phys_to_io((pci_dev_t)dev->priv, a) -#define mem_to_phys(a) pci_mem_to_phys((pci_dev_t)dev->priv, a) -#define phys_to_mem(a) pci_phys_to_mem((pci_dev_t)dev->priv, a) - -static inline int ETH_INL(struct eth_device* dev, u_long addr) -{ - __asm__ volatile ("eieio"); - return le32_to_cpu(*(volatile u32 *)io_to_phys(addr + dev->iobase)); -} - -static inline int ETH_INW(struct eth_device* dev, u_long addr) -{ - __asm__ volatile ("eieio"); - return le16_to_cpu(*(volatile u16 *)io_to_phys(addr + dev->iobase)); -} - -static inline int ETH_INB(struct eth_device* dev, u_long addr) -{ - __asm__ volatile ("eieio"); - return *(volatile u8 *)io_to_phys(addr + dev->iobase); -} - -static inline void ETH_OUTB(struct eth_device* dev, int command, u_long addr) -{ - *(volatile u8 *)io_to_phys(addr + dev->iobase) = command; - __asm__ volatile ("eieio"); -} - -static inline void ETH_OUTW(struct eth_device* dev, int command, u_long addr) -{ - *(volatile u16 *)io_to_phys(addr + dev->iobase) = cpu_to_le16(command); - __asm__ volatile ("eieio"); -} - -static inline void ETH_OUTL(struct eth_device* dev, int command, u_long addr) -{ - *(volatile u32 *)io_to_phys(addr + dev->iobase) = cpu_to_le32(command); - __asm__ volatile ("eieio"); -} - -static inline int ETH_STATUS(struct eth_device* dev) -{ - __asm__ volatile ("eieio"); - return le16_to_cpu(*(volatile u16 *)io_to_phys(EL3_STATUS + dev->iobase)); -} - -static inline void ETH_CMD(struct eth_device* dev, int command) -{ - *(volatile u16 *)io_to_phys(EL3_CMD + dev->iobase) = cpu_to_le16(command); - __asm__ volatile ("eieio"); -} - -/* Command register is always in the same spot in all the register windows */ -/* This function issues a command and waits for it so complete by checking the CmdInProgress bit */ - -static int issue_and_wait(struct eth_device* dev, int command) -{ - - int i, status; - - ETH_CMD(dev, command); - for (i = 0; i < 2000; i++) { - status = ETH_STATUS(dev); - /*printf ("Issue: status 0x%4x.\n", status); */ - if (!(status & CmdInProgress)) - return 1; - } - - /* OK, that didn't work. Do it the slow way. One second */ - for (i = 0; i < 100000; i++) { - status = ETH_STATUS(dev); - /*printf ("Issue: status 0x%4x.\n", status); */ - return 1; - udelay(10); - } - PRINTF("Ethernet command: 0x%4x did not complete! Status: 0x%4x\n", command, ETH_STATUS(dev) ); - return 0; -} - -/* Determine network media type and set up 3com accordingly */ -/* I think I'm going to start with something known first like 10baseT */ - -static int auto_negotiate (struct eth_device *dev) -{ - int i; - - EL3WINDOW (dev, 1); - - /* Wait for Auto negotiation to complete */ - for (i = 0; i <= 1000; i++) { - if (ETH_INW (dev, 2) & 0x04) - break; - udelay (100); - - if (i == 1000) { - PRINTF ("Error: Auto negotiation failed\n"); - return 0; - } - } - - - return 1; -} - -void eth_interrupt (struct eth_device *dev) -{ - u16 status = ETH_STATUS (dev); - - printf ("eth0: status = 0x%04x\n", status); - - if (!(status & IntLatch)) - return; - - if (status & (1 << 6)) { - ETH_CMD (dev, AckIntr | (1 << 6)); - printf ("Acknowledged Interrupt command\n"); - } - - if (status & DownComplete) { - ETH_CMD (dev, AckIntr | DownComplete); - printf ("Acknowledged DownComplete\n"); - } - - if (status & UpComplete) { - ETH_CMD (dev, AckIntr | UpComplete); - printf ("Acknowledged UpComplete\n"); - } - - ETH_CMD (dev, AckIntr | IntLatch); - printf ("Acknowledged IntLatch\n"); -} - -int eth_3com_initialize (bd_t * bis) -{ - u32 eth_iobase = 0, status; - int card_number = 0, ret; - struct eth_device *dev; - pci_dev_t devno; - char *s; - - s = getenv ("3com_base"); - - /* Find ethernet controller on the PCI bus */ - - if ((devno = - pci_find_device (PCI_VENDOR_ID_3COM, PCI_DEVICE_ID_3COM_3C905C, - 0)) < 0) { - PRINTF ("Error: Cannot find the ethernet device on the PCI bus\n"); - goto Done; - } - - if (s) { - unsigned long base = atoi (s); - - pci_write_config_dword (devno, PCI_BASE_ADDRESS_0, - base | 0x01); - } - - ret = pci_read_config_dword (devno, PCI_BASE_ADDRESS_0, ð_iobase); - eth_iobase &= ~0xf; - - PRINTF ("eth: 3Com Found at Address: 0x%x\n", eth_iobase); - - pci_write_config_dword (devno, PCI_COMMAND, - PCI_COMMAND_IO | PCI_COMMAND_MEMORY | - PCI_COMMAND_MASTER); - - /* Check if I/O accesses and Bus Mastering are enabled */ - - ret = pci_read_config_dword (devno, PCI_COMMAND, &status); - - if (!(status & PCI_COMMAND_IO)) { - printf ("Error: Cannot enable IO access.\n"); - goto Done; - } - - if (!(status & PCI_COMMAND_MEMORY)) { - printf ("Error: Cannot enable MEMORY access.\n"); - goto Done; - } - - if (!(status & PCI_COMMAND_MASTER)) { - printf ("Error: Cannot enable Bus Mastering.\n"); - goto Done; - } - - dev = (struct eth_device *) malloc (sizeof (*dev)); /*struct eth_device)); */ - - sprintf (dev->name, "3Com 3c920c#%d", card_number); - dev->iobase = eth_iobase; - dev->priv = (void *) devno; - dev->init = eth_3com_init; - dev->halt = eth_3com_halt; - dev->send = eth_3com_send; - dev->recv = eth_3com_recv; - - eth_register (dev); - -/* { */ -/* char interrupt; */ -/* devno = pci_find_device(PCI_VENDOR_ID_3COM, PCI_DEVICE_ID_3COM_3C905C, 0); */ -/* pci_read_config_byte(devno, PCI_INTERRUPT_LINE, &interrupt); */ - -/* printf("Installing eth0 interrupt handler to %d\n", interrupt); */ -/* irq_install_handler(interrupt, eth_interrupt, dev); */ -/* } */ - - card_number++; - - /* Set the latency timer for value */ - s = getenv ("3com_latency"); - if (s) { - ret = pci_write_config_byte (devno, PCI_LATENCY_TIMER, - (unsigned char) atoi (s)); - } else - ret = pci_write_config_byte (devno, PCI_LATENCY_TIMER, 0x0a); - - read_hw_addr (dev, bis); /* get the MAC address from Window 2 */ - - /* Reset the ethernet controller */ - - PRINTF ("Issuing reset command....\n"); - if (!issue_and_wait (dev, TotalReset)) { - printf ("Error: Cannot reset ethernet controller.\n"); - goto Done; - } else - PRINTF ("Ethernet controller reset.\n"); - - /* allocate memory for rx and tx rings */ - - if (!(rx_ring = memalign (sizeof (struct rx_desc_3com) * NUM_RX_DESC, 16))) { - PRINTF ("Cannot allocate memory for RX_RING.....\n"); - goto Done; - } - - if (!(tx_ring = memalign (sizeof (struct tx_desc_3com) * NUM_TX_DESC, 16))) { - PRINTF ("Cannot allocate memory for TX_RING.....\n"); - goto Done; - } - -Done: - return status; -} - - -static int eth_3com_init (struct eth_device *dev, bd_t * bis) -{ - int i, status = 0; - int tx_cur, loop; - u16 status_enable, intr_enable; - struct descriptor *ias_cmd; - - /* Determine what type of network the machine is connected to */ - /* presently drops the connect to 10Mbps */ - - if (!auto_negotiate (dev)) { - printf ("Error: Cannot determine network media.\n"); - goto Done; - } - - issue_and_wait (dev, TxReset); - issue_and_wait (dev, RxReset | 0x04); - - /* Switch to register set 7 for normal use. */ - EL3WINDOW (dev, 7); - - /* Initialize Rx and Tx rings */ - - init_rx_ring (dev); - purge_tx_ring (dev); - - ETH_CMD (dev, SetRxFilter | RxStation | RxBroadcast | RxProm); - - issue_and_wait (dev, SetTxStart | 0x07ff); - - /* Below sets which indication bits to be seen. */ - - status_enable = - SetStatusEnb | HostError | DownComplete | UpComplete | (1 << - 6); - ETH_CMD (dev, status_enable); - - /* Below sets no bits are to cause an interrupt since this is just polling */ - - intr_enable = SetIntrEnb; -/* intr_enable = SetIntrEnb | (1<<9) | (1<<10) | (1<<6); */ - ETH_CMD (dev, intr_enable); - ETH_OUTB (dev, 127, UpPoll); - - /* Ack all pending events, and set active indicator mask */ - - ETH_CMD (dev, AckIntr | IntLatch | TxAvailable | RxEarly | IntReq); - ETH_CMD (dev, intr_enable); - - /* Tell the adapter where the RX ring is located */ - - issue_and_wait (dev, UpStall); /* Stall and set the UplistPtr */ - ETH_OUTL (dev, (u32) & rx_ring[rx_next], UpListPtr); - ETH_CMD (dev, RxEnable); /* Enable the receiver. */ - issue_and_wait (dev, UpUnstall); - - /* Send the Individual Address Setup frame */ - - tx_cur = tx_next; - tx_next = ((tx_next + 1) % NUM_TX_DESC); - - ias_cmd = (struct descriptor *) &tx_ring[tx_cur]; - ias_cmd->status = cpu_to_le32 (1 << 31); /* set DnIndicate bit. */ - ias_cmd->next = 0; - ias_cmd->addr = cpu_to_le32 ((u32) dev->enetaddr); - ias_cmd->length = cpu_to_le32 (6 | LAST_FRAG); - - /* Tell the adapter where the TX ring is located */ - - ETH_CMD (dev, TxEnable); /* Enable transmitter. */ - issue_and_wait (dev, DownStall); /* Stall and set the DownListPtr. */ - ETH_OUTL (dev, (u32) & tx_ring[tx_cur], DownListPtr); - issue_and_wait (dev, DownUnstall); - for (i = 0; !(ETH_STATUS (dev) & DownComplete); i++) { - if (i >= TOUT_LOOP) { - PRINTF ("TX Ring status (Init): 0x%4x\n", - le32_to_cpu (tx_ring[tx_cur].status)); - PRINTF ("ETH_STATUS: 0x%x\n", ETH_STATUS (dev)); - goto Done; - } - } - if (ETH_STATUS (dev) & DownComplete) { /* If DownLoad Complete ACK the bit */ - ETH_CMD (dev, AckIntr | DownComplete); /* acknowledge the indication bit */ - issue_and_wait (dev, DownStall); /* stall and clear DownListPtr */ - ETH_OUTL (dev, 0, DownListPtr); - issue_and_wait (dev, DownUnstall); - } - status = 1; -Done: - return status; -} - -int eth_3com_send (struct eth_device *dev, volatile void *packet, int length) -{ - int i, status = 0; - int tx_cur; - - if (length <= 0) { - PRINTF ("eth: bad packet size: %d\n", length); - goto Done; - } - - tx_cur = tx_next; - tx_next = (tx_next + 1) % NUM_TX_DESC; - - tx_ring[tx_cur].status = cpu_to_le32 (1 << 31); /* set DnIndicate bit */ - tx_ring[tx_cur].next = 0; - tx_ring[tx_cur].addr = cpu_to_le32 (((u32) packet)); - tx_ring[tx_cur].length = cpu_to_le32 (length | LAST_FRAG); - - /* Send the packet */ - - issue_and_wait (dev, DownStall); /* stall and set the DownListPtr */ - ETH_OUTL (dev, (u32) & tx_ring[tx_cur], DownListPtr); - issue_and_wait (dev, DownUnstall); - - for (i = 0; !(ETH_STATUS (dev) & DownComplete); i++) { - if (i >= TOUT_LOOP) { - PRINTF ("TX Ring status (send): 0x%4x\n", - le32_to_cpu (tx_ring[tx_cur].status)); - goto Done; - } - } - if (ETH_STATUS (dev) & DownComplete) { /* If DownLoad Complete ACK the bit */ - ETH_CMD (dev, AckIntr | DownComplete); /* acknowledge the indication bit */ - issue_and_wait (dev, DownStall); /* stall and clear DownListPtr */ - ETH_OUTL (dev, 0, DownListPtr); - issue_and_wait (dev, DownUnstall); - } - status = 1; -Done: - return status; -} - -void PrintPacket (uchar * packet, int length) -{ - int loop; - uchar *ptr; - - printf ("Printing packet of length %x.\n\n", length); - ptr = packet; - for (loop = 1; loop <= length; loop++) { - printf ("%2x ", *ptr++); - if ((loop % 40) == 0) - printf ("\n"); - } -} - -int eth_3com_recv (struct eth_device *dev) -{ - u16 stat = 0; - u32 status; - int rx_prev, length = 0; - - while (!(ETH_STATUS (dev) & UpComplete)) /* wait on receipt of packet */ - ; - - status = le32_to_cpu (rx_ring[rx_next].status); /* packet status */ - - while (status & (1 << 15)) { - /* A packet has been received */ - - if (status & (1 << 15)) { - /* A valid frame received */ - - length = le32_to_cpu (rx_ring[rx_next].status) & 0x1fff; /* length is in bits 0 - 12 */ - - /* Pass the packet up to the protocol layers */ - - NetReceive ((uchar *) - le32_to_cpu (rx_ring[rx_next].addr), - length); - rx_ring[rx_next].status = 0; /* clear the status word */ - ETH_CMD (dev, AckIntr | UpComplete); - issue_and_wait (dev, UpUnstall); - } else if (stat & HostError) { - /* There was an error */ - - printf ("Rx error status: 0x%4x\n", stat); - init_rx_ring (dev); - goto Done; - } - - rx_prev = rx_next; - rx_next = (rx_next + 1) % NUM_RX_DESC; - stat = ETH_STATUS (dev); /* register status */ - status = le32_to_cpu (rx_ring[rx_next].status); /* packet status */ - } -Done: - return length; -} - -void eth_3com_halt (struct eth_device *dev) -{ - if (!(dev->iobase)) { - goto Done; - } - - issue_and_wait (dev, DownStall); /* shut down transmit and receive */ - issue_and_wait (dev, UpStall); - issue_and_wait (dev, RxDisable); - issue_and_wait (dev, TxDisable); - -/* free(tx_ring); /###* release memory allocated to the DPD and UPD rings */ -/* free(rx_ring); */ - -Done: - return; -} - -static void init_rx_ring (struct eth_device *dev) -{ - int i; - - PRINTF ("Initializing rx_ring. rx_buffer = %p\n", rx_buffer); - issue_and_wait (dev, UpStall); - - for (i = 0; i < NUM_RX_DESC; i++) { - rx_ring[i].next = - cpu_to_le32 (((u32) & - rx_ring[(i + 1) % NUM_RX_DESC])); - rx_ring[i].status = 0; - rx_ring[i].addr = cpu_to_le32 (((u32) & rx_buffer[i][0])); - rx_ring[i].length = cpu_to_le32 (PKTSIZE_ALIGN | LAST_FRAG); - } - rx_next = 0; -} - -static void purge_tx_ring (struct eth_device *dev) -{ - int i; - - PRINTF ("Purging tx_ring.\n"); - - tx_next = 0; - - for (i = 0; i < NUM_TX_DESC; i++) { - tx_ring[i].next = 0; - tx_ring[i].status = 0; - tx_ring[i].addr = 0; - tx_ring[i].length = 0; - } -} - -static void read_hw_addr (struct eth_device *dev, bd_t * bis) -{ - u8 hw_addr[ETH_ALEN]; - unsigned int eeprom[0x40]; - unsigned int checksum = 0; - int i, j, timer; - - /* First, try the env ... if that works, we're all done! */ - if (eth_getenv_enetaddr("ethaddr", hw_addr)) - goto Done; - - /* Read the station address from the EEPROM. */ - - EL3WINDOW (dev, 0); - for (i = 0; i < 0x40; i++) { - ETH_OUTW (dev, EEPROM_Read + i, Wn0EepromCmd); - /* Pause for at least 162 us. for the read to take place. */ - for (timer = 10; timer >= 0; timer--) { - udelay (162); - if ((ETH_INW (dev, Wn0EepromCmd) & 0x8000) == 0) - break; - } - eeprom[i] = ETH_INW (dev, Wn0EepromData); - } - - /* Checksum calculation. I'm not sure about this part and there seems to be a bug on the 3com side of things */ - - for (i = 0; i < 0x21; i++) - checksum ^= eeprom[i]; - checksum = (checksum ^ (checksum >> 8)) & 0xff; - - if (checksum != 0xbb) - printf (" *** INVALID EEPROM CHECKSUM %4.4x *** \n", - checksum); - - for (i = 0, j = 0; i < 3; i++) { - hw_addr[j++] = (u8) ((eeprom[i + 10] >> 8) & 0xff); - hw_addr[j++] = (u8) (eeprom[i + 10] & 0xff); - } - - /* MAC Address is in window 2, write value from EEPROM to window 2 */ - - EL3WINDOW (dev, 2); - for (i = 0; i < 6; i++) - ETH_OUTB (dev, hw_addr[i], i); - - for (j = 0; j < ETH_ALEN; j += 2) { - hw_addr[j] = (u8) (ETH_INW (dev, j) & 0xff); - hw_addr[j + 1] = (u8) ((ETH_INW (dev, j) >> 8) & 0xff); - } - - /* Save the result in the environment */ - eth_setenv_enetaddr("ethaddr", hw_addr); - -Done: - memcpy(dev->enetaddr, hw_addr, 6); - return; -} diff --git a/board/MAI/AmigaOneG3SE/flash.c b/board/MAI/AmigaOneG3SE/flash.c deleted file mode 100644 index a96d5ba..0000000 --- a/board/MAI/AmigaOneG3SE/flash.c +++ /dev/null @@ -1,35 +0,0 @@ -#include <common.h> -#include <flash.h> - -flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS]; - - -unsigned long flash_init(void) -{ - int i; - - for (i = 0; i < CONFIG_SYS_MAX_FLASH_BANKS; i++) - { - flash_info[i].flash_id = FLASH_UNKNOWN; - flash_info[i].sector_count = 0; - flash_info[i].size = 0; - } - - - return 1; -} - -int flash_erase(flash_info_t *info, int s_first, int s_last) -{ - return 1; -} - -void flash_print_info(flash_info_t *info) -{ - printf("No flashrom installed\n"); -} - -int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt) -{ - return 0; -} diff --git a/board/MAI/AmigaOneG3SE/flash_new.c b/board/MAI/AmigaOneG3SE/flash_new.c deleted file mode 100644 index 9beb048..0000000 --- a/board/MAI/AmigaOneG3SE/flash_new.c +++ /dev/null @@ -1,651 +0,0 @@ -/* - * (C) Copyright 2001 - * Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc. - * - * (C) Copyright 2002 - * Wolfgang Denk, DENX Software Engineering, wd@denx.de. - * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - */ - -#include <common.h> -#include <flash.h> -#include <asm/io.h> -#include "memio.h" - -/*---------------------------------------------------------------------*/ -#undef DEBUG_FLASH - -#ifdef DEBUG_FLASH -#define DEBUGF(fmt,args...) printf(fmt ,##args) -#else -#define DEBUGF(fmt,args...) -#endif -/*---------------------------------------------------------------------*/ - -flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS]; - -static ulong flash_get_size (ulong addr, flash_info_t *info); -static int flash_get_offsets (ulong base, flash_info_t *info); -static int write_word (flash_info_t *info, ulong dest, ulong data); -static void flash_reset (ulong addr); - -int flash_xd_nest; - -static void flash_to_xd(void) -{ - unsigned char x; - - flash_xd_nest ++; - - if (flash_xd_nest == 1) - { - DEBUGF("Flash on XD\n"); - x = pci_read_cfg_byte(0, 0, 0x74); - pci_write_cfg_byte(0, 0, 0x74, x|1); - } -} - -static void flash_to_mem(void) -{ - unsigned char x; - - flash_xd_nest --; - - if (flash_xd_nest == 0) - { - DEBUGF("Flash on memory bus\n"); - x = pci_read_cfg_byte(0, 0, 0x74); - pci_write_cfg_byte(0, 0, 0x74, x&0xFE); - } -} - -unsigned long flash_init_old(void) -{ - int i; - - for (i = 0; i < CONFIG_SYS_MAX_FLASH_BANKS; i++) - { - flash_info[i].flash_id = FLASH_UNKNOWN; - flash_info[i].sector_count = 0; - flash_info[i].size = 0; - } - - - return 1; -} - -unsigned long flash_init (void) -{ - unsigned int i; - unsigned long flash_size = 0; - - flash_xd_nest = 0; - - flash_to_xd(); - - /* Init: no FLASHes known */ - for (i=0; i<CONFIG_SYS_MAX_FLASH_BANKS; ++i) { - flash_info[i].flash_id = FLASH_UNKNOWN; - flash_info[i].sector_count = 0; - flash_info[i].size = 0; - } - - DEBUGF("\n## Get flash size @ 0x%08x\n", CONFIG_SYS_FLASH_BASE); - - flash_size = flash_get_size (CONFIG_SYS_FLASH_BASE, flash_info); - - DEBUGF("## Flash bank size: %08lx\n", flash_size); - - if (flash_size) { -#if CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH_BASE && \ - CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE + CONFIG_SYS_FLASH_MAX_SIZE - /* monitor protection ON by default */ - flash_protect(FLAG_PROTECT_SET, - CONFIG_SYS_MONITOR_BASE, - CONFIG_SYS_MONITOR_BASE + monitor_flash_len - 1, - &flash_info[0]); -#endif - -#ifdef CONFIG_ENV_IS_IN_FLASH - /* ENV protection ON by default */ - flash_protect(FLAG_PROTECT_SET, - CONFIG_ENV_ADDR, - CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE - 1, - &flash_info[0]); -#endif - - } else { - puts ("Warning: the BOOT Flash is not initialised !"); - } - - flash_to_mem(); - - return flash_size; -} - -/* - * The following code cannot be run from FLASH! - */ -static ulong flash_get_size (ulong addr, flash_info_t *info) -{ - short i; - uchar value; - uchar *x = (uchar *)addr; - - flash_to_xd(); - - /* Write auto select command: read Manufacturer ID */ - x[0x0555] = 0xAA; - __asm__ volatile ("sync\n eieio"); - x[0x02AA] = 0x55; - __asm__ volatile ("sync\n eieio"); - x[0x0555] = 0x90; - __asm__ volatile ("sync\n eieio"); - - value = x[0]; - __asm__ volatile ("sync\n eieio"); - - DEBUGF("Manuf. ID @ 0x%08lx: 0x%08x\n", (ulong)addr, value); - - switch (value | (value << 16)) { - case AMD_MANUFACT: - info->flash_id = FLASH_MAN_AMD; - break; - - case FUJ_MANUFACT: - info->flash_id = FLASH_MAN_FUJ; - break; - - case STM_MANUFACT: - info->flash_id = FLASH_MAN_STM; - break; - - default: - info->flash_id = FLASH_UNKNOWN; - info->sector_count = 0; - info->size = 0; - flash_reset (addr); - return 0; - } - - value = x[1]; - __asm__ volatile ("sync\n eieio"); - - DEBUGF("Device ID @ 0x%08lx: 0x%08x\n", addr+1, value); - - switch (value) { - case AMD_ID_F040B: - DEBUGF("Am29F040B\n"); - info->flash_id += FLASH_AM040; - info->sector_count = 8; - info->size = 0x00080000; - break; /* => 512 kB */ - - case AMD_ID_LV040B: - DEBUGF("Am29LV040B\n"); - info->flash_id += FLASH_AM040; - info->sector_count = 8; - info->size = 0x00080000; - break; /* => 512 kB */ - - case AMD_ID_LV400T: - DEBUGF("Am29LV400T\n"); - info->flash_id += FLASH_AM400T; - info->sector_count = 11; - info->size = 0x00100000; - break; /* => 1 MB */ - - case AMD_ID_LV400B: - DEBUGF("Am29LV400B\n"); - info->flash_id += FLASH_AM400B; - info->sector_count = 11; - info->size = 0x00100000; - break; /* => 1 MB */ - - case AMD_ID_LV800T: - DEBUGF("Am29LV800T\n"); - info->flash_id += FLASH_AM800T; - info->sector_count = 19; - info->size = 0x00200000; - break; /* => 2 MB */ - - case AMD_ID_LV800B: - DEBUGF("Am29LV400B\n"); - info->flash_id += FLASH_AM800B; - info->sector_count = 19; - info->size = 0x00200000; - break; /* => 2 MB */ - - case AMD_ID_LV160T: - DEBUGF("Am29LV160T\n"); - info->flash_id += FLASH_AM160T; - info->sector_count = 35; - info->size = 0x00400000; - break; /* => 4 MB */ - - case AMD_ID_LV160B: - DEBUGF("Am29LV160B\n"); - info->flash_id += FLASH_AM160B; - info->sector_count = 35; - info->size = 0x00400000; - break; /* => 4 MB */ - - case AMD_ID_LV320T: - DEBUGF("Am29LV320T\n"); - info->flash_id += FLASH_AM320T; - info->sector_count = 67; - info->size = 0x00800000; - break; /* => 8 MB */ - -#if 0 - /* Has the same ID as AMD_ID_LV320T, to be fixed */ - case AMD_ID_LV320B: - DEBUGF("Am29LV320B\n"); - info->flash_id += FLASH_AM320B; - info->sector_count = 67; - info->size = 0x00800000; - break; /* => 8 MB */ -#endif - - case AMD_ID_LV033C: - DEBUGF("Am29LV033C\n"); - info->flash_id += FLASH_AM033C; - info->sector_count = 64; - info->size = 0x01000000; - break; /* => 16Mb */ - - case STM_ID_F040B: - DEBUGF("M29F040B\n"); - info->flash_id += FLASH_AM040; - info->sector_count = 8; - info->size = 0x00080000; - break; /* => 512 kB */ - - default: - info->flash_id = FLASH_UNKNOWN; - flash_reset (addr); - flash_to_mem(); - return (0); /* => no or unknown flash */ - - } - - if (info->sector_count > CONFIG_SYS_MAX_FLASH_SECT) { - printf ("** ERROR: sector count %d > max (%d) **\n", - info->sector_count, CONFIG_SYS_MAX_FLASH_SECT); - info->sector_count = CONFIG_SYS_MAX_FLASH_SECT; - } - - if (! flash_get_offsets (addr, info)) { - flash_reset (addr); - flash_to_mem(); - return 0; - } - - /* check for protected sectors */ - for (i = 0; i < info->sector_count; i++) { - /* read sector protection at sector address, (A7 .. A0) = 0x02 */ - /* D0 = 1 if protected */ - value = in8(info->start[i] + 2); - iobarrier_rw(); - info->protect[i] = (value & 1) != 0; - } - - /* - * Reset bank to read mode - */ - flash_reset (addr); - - flash_to_mem(); - - return (info->size); -} - -static int flash_get_offsets (ulong base, flash_info_t *info) -{ - unsigned int i; - - switch (info->flash_id & FLASH_TYPEMASK) { - case FLASH_AM040: - /* set sector offsets for uniform sector type */ - for (i = 0; i < info->sector_count; i++) { - info->start[i] = base + i * info->size / - info->sector_count; - } - break; - default: - return 0; - } - - return 1; -} - -int flash_erase (flash_info_t *info, int s_first, int s_last) -{ - volatile ulong addr = info->start[0]; - int flag, prot, sect, l_sect; - ulong start, now, last; - - flash_to_xd(); - - if (s_first < 0 || s_first > s_last) { - if (info->flash_id == FLASH_UNKNOWN) { - printf ("- missing\n"); - } else { - printf ("- no sectors to erase\n"); - } - flash_to_mem(); - return 1; - } - - if (info->flash_id == FLASH_UNKNOWN) { - printf ("Can't erase unknown flash type %08lx - aborted\n", - info->flash_id); - flash_to_mem(); - 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"); - } - - l_sect = -1; - - /* Disable interrupts which might cause a timeout here */ - flag = disable_interrupts(); - - out8(addr + 0x555, 0xAA); - iobarrier_rw(); - out8(addr + 0x2AA, 0x55); - iobarrier_rw(); - out8(addr + 0x555, 0x80); - iobarrier_rw(); - out8(addr + 0x555, 0xAA); - iobarrier_rw(); - out8(addr + 0x2AA, 0x55); - iobarrier_rw(); - - /* Start erase on unprotected sectors */ - for (sect = s_first; sect<=s_last; sect++) { - if (info->protect[sect] == 0) { /* not protected */ - addr = info->start[sect]; - out8(addr, 0x30); - iobarrier_rw(); - l_sect = sect; - } - } - - /* re-enable interrupts if necessary */ - if (flag) - enable_interrupts(); - - /* wait at least 80us - let's wait 1 ms */ - udelay (1000); - - /* - * We wait for the last triggered sector - */ - if (l_sect < 0) - goto DONE; - - start = get_timer (0); - last = start; - addr = info->start[l_sect]; - - DEBUGF ("Start erase timeout: %d\n", CONFIG_SYS_FLASH_ERASE_TOUT); - - while ((in8(addr) & 0x80) != 0x80) { - if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) { - printf ("Timeout\n"); - flash_reset (info->start[0]); - flash_to_mem(); - return 1; - } - /* show that we're waiting */ - if ((now - last) > 1000) { /* every second */ - putc ('.'); - last = now; - } - iobarrier_rw(); - } - -DONE: - /* reset to read mode */ - flash_reset (info->start[0]); - flash_to_mem(); - - printf (" done\n"); - return 0; -} - -/* - * Copy memory to flash, returns: - * 0 - OK - * 1 - write timeout - * 2 - Flash not erased - */ -int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt) -{ - ulong cp, wp, data; - int i, l, rc; - - flash_to_xd(); - - wp = (addr & ~3); /* get lower word aligned address */ - - /* - * handle unaligned start bytes - */ - if ((l = addr - wp) != 0) { - data = 0; - for (i=0, cp=wp; i<l; ++i, ++cp) { - data = (data << 8) | (*(uchar *)cp); - } - for (; i<4 && cnt>0; ++i) { - data = (data << 8) | *src++; - --cnt; - ++cp; - } - for (; cnt==0 && i<4; ++i, ++cp) { - data = (data << 8) | (*(uchar *)cp); - } - - if ((rc = write_word(info, wp, data)) != 0) { - flash_to_mem(); - return (rc); - } - wp += 4; - } - - /* - * handle word aligned part - */ - while (cnt >= 4) { - data = 0; - for (i=0; i<4; ++i) { - data = (data << 8) | *src++; - } - if ((rc = write_word(info, wp, data)) != 0) { - flash_to_mem(); - return (rc); - } - wp += 4; - cnt -= 4; - } - - if (cnt == 0) { - flash_to_mem(); - return (0); - } - - /* - * handle unaligned tail bytes - */ - data = 0; - for (i=0, cp=wp; i<4 && cnt>0; ++i, ++cp) { - data = (data << 8) | *src++; - --cnt; - } - for (; i<4; ++i, ++cp) { - data = (data << 8) | (*(uchar *)cp); - } - - - flash_to_mem(); - return (write_word(info, wp, data)); -} - -/* - * Write a word to Flash, returns: - * 0 - OK - * 1 - write timeout - * 2 - Flash not erased - */ -static int write_word (flash_info_t *info, ulong dest, ulong data) -{ - volatile ulong addr = info->start[0]; - ulong start; - int i; - - flash_to_xd(); - - /* Check if Flash is (sufficiently) erased */ - if ((in32(dest) & data) != data) { - flash_to_mem(); - return (2); - } - - /* write each byte out */ - for (i = 0; i < 4; i++) { - char *data_ch = (char *)&data; - int flag = disable_interrupts(); - - out8(addr + 0x555, 0xAA); - iobarrier_rw(); - out8(addr + 0x2AA, 0x55); - iobarrier_rw(); - out8(addr + 0x555, 0xA0); - iobarrier_rw(); - out8(dest+i, data_ch[i]); - iobarrier_rw(); - - /* re-enable interrupts if necessary */ - if (flag) - enable_interrupts(); - - /* data polling for D7 */ - start = get_timer (0); - while ((in8(dest+i) & 0x80) != (data_ch[i] & 0x80)) { - if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) { - flash_reset (addr); - flash_to_mem(); - return (1); - } - iobarrier_rw(); - } - } - - flash_reset (addr); - flash_to_mem(); - return (0); -} - -/* - * Reset bank to read mode - */ -static void flash_reset (ulong addr) -{ - flash_to_xd(); - out8(addr, 0xF0); /* reset bank */ - iobarrier_rw(); - flash_to_mem(); -} - -void flash_print_info (flash_info_t *info) -{ - int i; - - if (info->flash_id == FLASH_UNKNOWN) { - printf ("missing or unknown FLASH type\n"); - return; - } - - switch (info->flash_id & FLASH_VENDMASK) { - case FLASH_MAN_AMD: printf ("AMD "); break; - case FLASH_MAN_FUJ: printf ("FUJITSU "); break; - case FLASH_MAN_BM: printf ("BRIGHT MICRO "); break; - case FLASH_MAN_STM: printf ("SGS THOMSON "); break; - default: printf ("Unknown Vendor "); break; - } - - switch (info->flash_id & FLASH_TYPEMASK) { - case FLASH_AM040: printf ("29F040 or 29LV040 (4 Mbit, uniform sectors)\n"); - break; - case FLASH_AM400B: printf ("AM29LV400B (4 Mbit, bottom boot sect)\n"); - break; - case FLASH_AM400T: printf ("AM29LV400T (4 Mbit, top boot sector)\n"); - break; - case FLASH_AM800B: printf ("AM29LV800B (8 Mbit, bottom boot sect)\n"); - break; - case FLASH_AM800T: printf ("AM29LV800T (8 Mbit, top boot sector)\n"); - break; - case FLASH_AM160B: printf ("AM29LV160B (16 Mbit, bottom boot sect)\n"); - break; - case FLASH_AM160T: printf ("AM29LV160T (16 Mbit, top boot sector)\n"); - break; - case FLASH_AM320B: printf ("AM29LV320B (32 Mbit, bottom boot sect)\n"); - break; - case FLASH_AM320T: printf ("AM29LV320T (32 Mbit, top boot sector)\n"); - break; - default: printf ("Unknown Chip Type\n"); - break; - } - - if (info->size % 0x100000 == 0) { - printf (" Size: %ld MB in %d Sectors\n", - info->size / 0x100000, info->sector_count); - } else if (info->size % 0x400 == 0) { - printf (" Size: %ld KB in %d Sectors\n", - info->size / 0x400, info->sector_count); - } else { - printf (" Size: %ld B in %d Sectors\n", - info->size, info->sector_count); - } - - printf (" Sector Start Addresses:"); - for (i=0; i<info->sector_count; ++i) { - if ((i % 5) == 0) - printf ("\n "); - printf (" %08lX%s", - info->start[i], - info->protect[i] ? " (RO)" : " " - ); - } - printf ("\n"); -} diff --git a/board/MAI/AmigaOneG3SE/i8259.c b/board/MAI/AmigaOneG3SE/i8259.c deleted file mode 100644 index 34f489f..0000000 --- a/board/MAI/AmigaOneG3SE/i8259.c +++ /dev/null @@ -1,230 +0,0 @@ -/* - * (C) Copyright 2002 - * John W. Linville, linville@tuxdriver.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 "i8259.h" - -#undef IRQ_DEBUG - -#ifdef IRQ_DEBUG -#define PRINTF(fmt,args...) printf (fmt ,##args) -#else -#define PRINTF(fmt,args...) -#endif - -static inline unsigned char read_byte(volatile unsigned char* from) -{ - int x; - asm volatile ("lbz %0,%1\n eieio" : "=r" (x) : "m" (*from)); - return (unsigned char)x; -} - -static inline void write_byte(volatile unsigned char *to, int x) -{ - asm volatile ("stb %1,%0\n eieio" : "=m" (*to) : "r" (x)); -} - -static inline unsigned long read_long_little(volatile unsigned long *from) -{ - unsigned long x; - asm volatile ("lwbrx %0,0,%1\n eieio\n sync" : "=r" (x) : "r" (from), "m"(*from)); - return (unsigned long)x; -} - -#ifdef out8 -#undef out8 -#endif - -#ifdef in8 -#undef in8 -#endif - -#define out8(addr, byte) write_byte(0xFE000000 | addr, byte) -#define in8(addr) read_byte(0xFE000000 | addr) - -/* - * This contains the irq mask for both 8259A irq controllers, - */ -static char cached_imr[2] = {0xff, 0xff}; - -#define cached_imr1 (cached_imr[0]) -#define cached_imr2 (cached_imr[1]) - -void i8259_init(void) -{ - char dummy; - PRINTF("Initializing Interrupt controller\n"); - /* init master interrupt controller */ - out8(0x20, 0x11); /* 0x19); /###* Start init sequence */ - out8(0x21, 0x00); /* Vector base */ - out8(0x21, 0x04); /* edge tiggered, Cascade (slave) on IRQ2 */ - out8(0x21, 0x11); /* was: 0x01); /###* Select 8086 mode */ - - /* init slave interrupt controller */ - out8(0xA0, 0x11); /* 0x19); /###* Start init sequence */ - out8(0xA1, 0x08); /* Vector base */ - out8(0xA1, 0x02); /* edge triggered, Cascade (slave) on IRQ2 */ - out8(0xA1, 0x11); /* was: 0x01); /###* Select 8086 mode */ - - /* always read ISR */ - out8(0x20, 0x0B); - dummy = in8(ISR_1); - out8(0xA0, 0x0B); - dummy = in8(ISR_2); - -/* out8(0x43, 0x30); */ -/* out8(0x40, 0); */ -/* out8(0x40, 0); */ -/* out8(0x43, 0x70); */ -/* out8(0x41, 0); */ -/* out8(0x41, 0); */ -/* out8(0x43, 0xb0); */ -/* out8(0x42, 0); */ -/* out8(0x42, 0); */ - - /* Mask all interrupts */ - out8(IMR_2, cached_imr2); - out8(IMR_1, cached_imr1); - - i8259_unmask_irq(2); -#if 0 - { - int i; - for (i=0; i<16; i++) - { - i8259_unmask_irq(i); - } - } -#endif -} - -static volatile char *pci_intack = (void *)0xFEF00000; - -int i8259_irq(void) -{ - int irq; - - irq = read_long_little(pci_intack) & 0xff; - if (irq==7) { - /* - * This may be a spurious interrupt. - * - * Read the interrupt status register (ISR). If the most - * significant bit is not set then there is no valid - * interrupt. - */ - if(~in8(0x20)&0x80) { - irq = -1; - } - } - - return irq; -} -int i8259_get_irq(struct pt_regs *regs) -{ - unsigned char irq; - - /* - * Perform an interrupt acknowledge cycle on controller 1 - */ - out8(OCW3_1, 0x0C); /* prepare for poll */ - irq = in8(IPL_1) & 7; - if (irq == 2) { - /* - * Interrupt is cascaded so perform interrupt - * acknowledge on controller 2 - */ - out8(OCW3_2, 0x0C); /* prepare for poll */ - irq = (in8(IPL_2) & 7) + 8; - if (irq == 15) { - /* - * This may be a spurious interrupt - * - * Read the interrupt status register. If the most - * significant bit is not set then there is no valid - * interrupt - */ - out8(OCW3_2, 0x0b); - if (~(in8(ISR_2) & 0x80)) { - return -1; - } - } - } else if (irq == 7) { - /* - * This may be a spurious interrupt - * - * Read the interrupt status register. If the most - * significant bit is not set then there is no valid - * interrupt - */ - out8(OCW3_1, 0x0b); - if (~(in8(ISR_1) & 0x80)) { - return -1; - } - } - return irq; -} - -/* - * Careful! The 8259A is a fragile beast, it pretty - * much _has_ to be done exactly like this (mask it - * first, _then_ send the EOI, and the order of EOI - * to the two 8259s is important! - */ -void i8259_mask_and_ack(int irq) -{ - if (irq > 7) { - cached_imr2 |= (1 << (irq - 8)); - in8(IMR_2); /* DUMMY */ - out8(IMR_2, cached_imr2); - out8(OCW2_2, 0x20); /* Non-specific EOI */ - out8(OCW2_1, 0x20); /* Non-specific EOI to cascade */ - } else { - cached_imr1 |= (1 << irq); - in8(IMR_1); /* DUMMY */ - out8(IMR_1, cached_imr1); - out8(OCW2_1, 0x20); /* Non-specific EOI */ - } -} - -void i8259_mask_irq(int irq) -{ - if (irq & 8) { - cached_imr2 |= (1 << (irq & 7)); - out8(IMR_2, cached_imr2); - } else { - cached_imr1 |= (1 << irq); - out8(IMR_1, cached_imr1); - } -} - -void i8259_unmask_irq(int irq) -{ - if (irq & 8) { - cached_imr2 &= ~(1 << (irq & 7)); - out8(IMR_2, cached_imr2); - } else { - cached_imr1 &= ~(1 << irq); - out8(IMR_1, cached_imr1); - } -} diff --git a/board/MAI/AmigaOneG3SE/i8259.h b/board/MAI/AmigaOneG3SE/i8259.h deleted file mode 100644 index eb08e13..0000000 --- a/board/MAI/AmigaOneG3SE/i8259.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * (C) Copyright 2002 - * John W. Linville, linville@tuxdriver.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 ICW1_1 CONFIG_SYS_ISA_IO_BASE_ADDRESS + ISA_INT1_ICW1 -#define ICW1_2 CONFIG_SYS_ISA_IO_BASE_ADDRESS + ISA_INT2_ICW1 -#define ICW2_1 CONFIG_SYS_ISA_IO_BASE_ADDRESS + ISA_INT1_ICW2 -#define ICW2_2 CONFIG_SYS_ISA_IO_BASE_ADDRESS + ISA_INT2_ICW2 -#define ICW3_1 CONFIG_SYS_ISA_IO_BASE_ADDRESS + ISA_INT1_ICW3 -#define ICW3_2 CONFIG_SYS_ISA_IO_BASE_ADDRESS + ISA_INT2_ICW3 -#define ICW4_1 CONFIG_SYS_ISA_IO_BASE_ADDRESS + ISA_INT1_ICW4 -#define ICW4_2 CONFIG_SYS_ISA_IO_BASE_ADDRESS + ISA_INT2_ICW4 -#define OCW1_1 CONFIG_SYS_ISA_IO_BASE_ADDRESS + ISA_INT1_OCW1 -#define OCW1_2 CONFIG_SYS_ISA_IO_BASE_ADDRESS + ISA_INT2_OCW1 -#define OCW2_1 CONFIG_SYS_ISA_IO_BASE_ADDRESS + ISA_INT1_OCW2 -#define OCW2_2 CONFIG_SYS_ISA_IO_BASE_ADDRESS + ISA_INT2_OCW2 -#define OCW3_1 CONFIG_SYS_ISA_IO_BASE_ADDRESS + ISA_INT1_OCW3 -#define OCW3_2 CONFIG_SYS_ISA_IO_BASE_ADDRESS + ISA_INT2_OCW3 - -#define IMR_1 OCW1_1 -#define IMR_2 OCW1_2 - -#define ISR_1 ICW1_1 -#define ISR_2 ICW1_2 - -#define IPL_1 ICW1_1 -#define IPL_2 ICW1_2 - -extern void i8259_init(void); - -extern int i8259_get_irq(struct pt_regs *regs); - -extern void i8259_mask_and_ack(int irq); - -extern void i8259_mask_irq(int irq); - -extern void i8259_unmask_irq(int irq); diff --git a/board/MAI/AmigaOneG3SE/interrupts.c b/board/MAI/AmigaOneG3SE/interrupts.c deleted file mode 100644 index de46d6e..0000000 --- a/board/MAI/AmigaOneG3SE/interrupts.c +++ /dev/null @@ -1,266 +0,0 @@ -/* - * (C) Copyright 2002 - * John W. Linville <linville@tuxdriver.com> - * - * Copied and modified from original code by Josh Huber. Original - * copyright notice preserved below. - * - * (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 - */ - -/* - * interrupts.c - just enough support for the decrementer/timer - */ - -#include <common.h> -#include <asm/processor.h> -#include <command.h> -#include "i8259.h" - -#undef DEBUG -#ifdef DEBUG -#define PRINTF(fmt,args...) printf (fmt ,##args) -#else -#define PRINTF(fmt,args...) -#endif -#define NR_IRQS 16 - -void irq_alloc_init(void); -long irq_alloc(long wanted); - -/****************************************************************************/ - -unsigned decrementer_count; /* count value for 1e6/HZ microseconds */ - -struct irq_action { - interrupt_handler_t *handler; - void *arg; - ulong count; -}; - -static struct irq_action irq_handlers[NR_IRQS]; - -/****************************************************************************/ - -static __inline__ unsigned long -get_msr(void) -{ - unsigned long msr; - - asm volatile("mfmsr %0" : "=r" (msr) :); - return msr; -} - -static __inline__ void -set_msr(unsigned long msr) -{ - asm volatile("mtmsr %0" : : "r" (msr)); -} - -static __inline__ unsigned long -get_dec(void) -{ - unsigned long val; - - asm volatile("mfdec %0" : "=r" (val) :); - return val; -} - - -static __inline__ void -set_dec(unsigned long val) -{ - asm volatile("mtdec %0" : : "r" (val)); -} - - -void -enable_interrupts(void) -{ - set_msr (get_msr() | MSR_EE); -} - -/* returns flag if MSR_EE was set before */ -int -disable_interrupts(void) -{ - ulong msr; - - msr = get_msr(); - set_msr (msr & ~MSR_EE); - return ((msr & MSR_EE) != 0); -} - -/****************************************************************************/ - -int interrupt_init (void) -{ - extern void new_reset(void); - extern void new_reset_end(void); -#ifdef DEBUG - puts("interrupt_init: setting decrementer_count\n"); -#endif - decrementer_count = get_tbclk() / CONFIG_SYS_HZ; - -#ifdef DEBUG - puts("interrupt_init: setting actual decremter\n"); -#endif - set_dec (get_tbclk() / CONFIG_SYS_HZ); - -#ifdef DEBUG - puts("interrupt_init: clearing external interrupt table\n"); -#endif - /* clear external interrupt table here */ - memset(irq_handlers, 0, sizeof(irq_handlers)); - -#ifdef DEBUG - puts("interrupt_init: initializing interrupt controller\n"); -#endif - i8259_init(); - -#ifdef DEBUG - puts("Copying reset trampoline\n"); -#endif - /* WARNING: Assmues that the first megabyte is CACHEINHIBIT! */ - memcpy((void *)0x100, new_reset, new_reset_end - new_reset); - -#ifdef DEBUG - PRINTF("interrupt_init: enabling interrupts (msr = %08x)\n", - get_msr()); -#endif - set_msr (get_msr() | MSR_EE); - -#ifdef DEBUG - PRINTF("interrupt_init: done. (msr = %08x)\n", get_msr()); -#endif - -} - -/****************************************************************************/ - -/* - * Handle external interrupts - */ -void -external_interrupt(struct pt_regs *regs) -{ - extern int i8259_irq(void); - - int irq, unmask = 1; - - irq = i8259_irq(); /*i8259_get_irq(regs); */ -/* printf("irq = %d, handler at %p ack=%d\n", irq, irq_handlers[irq].handler, *(volatile unsigned char *)0xFEF00000); */ - i8259_mask_and_ack(irq); - - if (irq_handlers[irq].handler != NULL) - (*irq_handlers[irq].handler)(irq_handlers[irq].arg); - else { - PRINTF ("\nBogus External Interrupt IRQ %d\n", irq); - /* - * turn off the bogus interrupt, otherwise it - * might repeat forever - */ - unmask = 0; - } - - if (unmask) i8259_unmask_irq(irq); -} - -volatile ulong timestamp = 0; - -/* - * timer_interrupt - gets called when the decrementer overflows, - * with interrupts disabled. - * Trivial implementation - no need to be really accurate. - */ -void -timer_interrupt(struct pt_regs *regs) -{ - set_dec(decrementer_count); - timestamp++; -} - -/****************************************************************************/ - -void -reset_timer(void) -{ - timestamp = 0; -} - -ulong -get_timer(ulong base) -{ - return (timestamp - base); -} - -void -set_timer(ulong t) -{ - timestamp = t; -} - -/****************************************************************************/ - -/* - * 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); - - irq_handlers[irq].handler = handler; - irq_handlers[irq].arg = arg; - - i8259_unmask_irq(irq); -} - -void -irq_free_handler(int irq) -{ - if (irq < 0 || irq >= NR_IRQS) { - PRINTF("irq_free_handler: bad irq number %d\n", irq); - return; - } - - i8259_mask_irq(irq); - - irq_handlers[irq].handler = NULL; - irq_handlers[irq].arg = NULL; -} - -/****************************************************************************/ - -void -do_irqinfo(cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[]) -{ - puts("IRQ related functions are unimplemented currently.\n"); -} diff --git a/board/MAI/AmigaOneG3SE/macros.h b/board/MAI/AmigaOneG3SE/macros.h deleted file mode 100644 index 6020d7e..0000000 --- a/board/MAI/AmigaOneG3SE/macros.h +++ /dev/null @@ -1,84 +0,0 @@ - -#ifndef _MACROS_H -#define _MACROS_H - - /* - ** Load a long integer into a register - */ - .macro liw reg, value - lis \reg, \value@h - ori \reg, \reg, \value@l - .endm - - - /* - ** Generate config_addr request - ** This macro expects the values in registers: - ** r3 - bus - ** r4 - devfn - ** r5 - offset - */ - .macro config_addr - rlwinm r9, r5, 24, 0, 6 - rlwinm r8, r4, 16, 0, 31 - rlwinm r7, r3, 8, 0, 31 - or r9, r8, r9 - or r9, r7, r9 - ori r9, r9, 0x80 - liw r10, 0xfec00cf8 - stw r9, 0(r10) - eieio - sync - .endm - - - /* - ** Generate config_data address - */ - .macro config_data mask - andi. r9, r5, \mask - addi r9, r9, 0xcfc - oris r9, r9, 0xfee0 - .endm - - - /* - ** Write a byte value to an output port - */ - .macro outb port, value - lis r2, 0xfe00 - li r0, \value - stb r0, \port(r2) - .endm - - - /* - ** Write a register byte value to an output port - */ - .macro outbr port, value - lis r2, 0xfe00 - stb \value, \port(r2) - .endm - - - /* - ** Read a byte value from a port into a specified register - */ - .macro inb reg, port - lis r2, 0xfe00 - lbz \reg, \port(r2) - .endm - - - /* - ** Write a byte to the SuperIO config area - */ - .macro siowb offset, value - li r3, 0 - li r4, (7<<3) - li r5, \offset - li r6, \value - bl pci_write_cfg_byte - .endm - -#endif diff --git a/board/MAI/AmigaOneG3SE/memio.S b/board/MAI/AmigaOneG3SE/memio.S deleted file mode 100644 index 980d343..0000000 --- a/board/MAI/AmigaOneG3SE/memio.S +++ /dev/null @@ -1,67 +0,0 @@ -#include "macros.h" - - - .globl pci_read_cfg_byte - -pci_read_cfg_byte: - config_addr - config_data 3 - eieio - sync - lbz r3, 0(r9) - blr - - - .globl pci_write_cfg_byte - -pci_write_cfg_byte: - config_addr - config_data 3 - stb r6, 0(r9) - eieio - sync - blr - - - .globl pci_read_cfg_word - -pci_read_cfg_word: - config_addr - config_data 2 - lhbrx r3, 0, r9 - eieio - sync - blr - - - .globl pci_write_cfg_word - -pci_write_cfg_word: - config_addr - config_data 2 - sthbrx r6, 0, r9 - eieio - sync - blr - - - .globl pci_read_cfg_long - -pci_read_cfg_long: - config_addr - config_data 0 - lwbrx r3, 0, r9 - eieio - sync - blr - - - .globl pci_write_cfg_long - -pci_write_cfg_long: - config_addr - config_data 0 - stwbrx r6, 0, r9 - eieio - sync - blr diff --git a/board/MAI/AmigaOneG3SE/memio.h b/board/MAI/AmigaOneG3SE/memio.h deleted file mode 100644 index f5ce303..0000000 --- a/board/MAI/AmigaOneG3SE/memio.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Memory mapped IO - * - * (C) Copyright 2002 - * Hyperion Entertainment, ThomasF@hyperion-entertainment.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. - * You may also use this under a BSD license. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - */ - -#ifndef _MEMIO_H -#define _MEMIO_H - -#include "short_types.h" - -#define IOBASE 0xFE000000 - -#define in_byte(from) read_byte( (uint8 *)(IOBASE | (from))) -#define in_word(from) read_word_little((uint16 *)(IOBASE | (from))) -#define in_long(from) read_long_little((uint32 *)(IOBASE | (from))) -#define out_byte(to, val) write_byte((uint8 *)(IOBASE | (to)), val) -#define out_word(to, val) write_word_little((uint16 *)(IOBASE | (to)), val) -#define out_long(to, val) write_long_little((uint32 *)(IOBASE | (to)), val) - - -static inline uint8 read_byte(volatile uint8 *from) -{ - int x; - asm volatile ("lbz %0,%1\n eieio\n sync" : "=r" (x) : "m" (*from)); - return (uint8)x; -} - - -static inline void write_byte(volatile uint8 *to, uint8 x) -{ - asm volatile ("stb %1,%0\n eieio\n sync" : "=m" (*to) : "r" (x)); -} - -static inline uint16 read_word_little(volatile uint16 *from) -{ - int x; - asm volatile ("lhbrx %0,0,%1\n eieio\n sync" : "=r" (x) : "r" (from), "m" (*from)); - return (uint16)x; -} - -static inline uint16 read_word_big(volatile uint16 *from) -{ - int x; - asm volatile ("lhz %0,%1\n eieio\n sync" : "=r" (x) : "m" (*from)); - return (uint16)x; -} - -static inline void write_word_little(volatile uint16 *to, int x) -{ - asm volatile ("sthbrx %1,0,%2\n eieio\n sync" : "=m" (*to) : "r" (x), "r" (to)); -} - -static inline void write_word_big(volatile uint16 *to, int x) -{ - asm volatile ("sth %1,%0\n eieio\n sync" : "=m" (*to) : "r" (x)); -} - -static inline uint32 read_long_little(volatile uint32 *from) -{ - unsigned long x; - asm volatile ("lwbrx %0,0,%1\n eieio\n sync" : "=r" (x) : "r" (from), "m"(*from)); - return (uint32)x; -} - -static inline uint32 read_long_big(volatile uint32 *from) -{ - unsigned long x; - asm volatile ("lwz %0,%1\n eieio\n sync" : "=r" (x) : "m" (*from)); - return (uint32)x; -} - -static inline void write_long_little(volatile uint32 *to, uint32 x) -{ - asm volatile ("stwbrx %1,0,%2\n eieio\n sync" : "=m" (*to) : "r" (x), "r" (to)); -} - -static inline void write_long_big(volatile uint32 *to, uint32 x) -{ - asm volatile ("stw %1,%0\n eieio\n sync" : "=m" (*to) : "r" (x)); -} - -#define CONFIG_ADDR(bus, devfn, offset) \ - write_long_big((uint32 *)0xFEC00CF8, \ - ((offset & 0xFC)<<24) | (devfn << 16) \ - | (bus<<8) | 0x80); -#define CONFIG_DATA(offset,mask) ((void *)(0xFEE00CFC+(offset & mask))) - - -uint8 pci_read_cfg_byte(int32 bus, int32 devfn, int32 offset); -void pci_write_cfg_byte(int32 bus, int32 devfn, int32 offset, uint8 x); -uint16 pci_read_cfg_word(int32 bus, int32 devfn, int32 offset); -void pci_write_cfg_word(int32 bus, int32 devfn, int32 offset, uint16 x); -uint32 pci_read_cfg_long(int32 bus, int32 devfn, int32 offset); -void pci_write_cfg_long(int32 bus, int32 devfn, int32 offset, uint32 x); - - -#endif diff --git a/board/MAI/AmigaOneG3SE/memory_dump b/board/MAI/AmigaOneG3SE/memory_dump deleted file mode 100644 index 65e7936..0000000 --- a/board/MAI/AmigaOneG3SE/memory_dump +++ /dev/null @@ -1,30 +0,0 @@ -64 MB: -0x00: 80 08 04 0c 09 01 40 00 01 a0 60 00 80 08 00 01 -0x10: 8f 04 04 01 01 00 06 a0 60 00 00 14 10 14 2d 10 -0x20: 20 10 20 10 00 00 00 00 00 00 00 00 00 00 00 00 -0x30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 12 f2 -0x40: 7f 61 00 00 00 00 00 00 46 04 00 ff ff ff ff ff -0x50: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff -0x60: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff -0x70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff 64 f4 - -512 MB: -0x00: 80 08 04 0d 0a 02 40 00 01 75 54 00 82 08 00 01 -0x10: 8f 04 04 01 01 00 0f 00 00 00 00 14 0f 14 2d 40 -0x20: 15 08 15 08 00 00 00 00 00 00 00 00 00 00 00 00 -0x30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 12 d2 -0x40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 64 fd - -256 MB: -0x00: 80 08 04 0c 0a 02 40 00 01 75 54 00 80 08 00 01 -0x10: 8f 04 06 01 01 00 0e a0 60 00 00 14 0f 14 2d 20 -0x20: 15 08 15 08 00 00 00 00 00 00 00 00 00 00 00 00 -0x30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 12 b0 -0x40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -0x70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 64 f6 - diff --git a/board/MAI/AmigaOneG3SE/nvram.c b/board/MAI/AmigaOneG3SE/nvram.c deleted file mode 100644 index d37eec1..0000000 --- a/board/MAI/AmigaOneG3SE/nvram.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * (C) Copyright 2002 - * Thomas Frieden, Hyperion Entertainment - * ThomasF@hyperion-entertainment.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 "memio.h" - -void enable_nvram(void) -{ - pci_write_cfg_byte(0, 0, 0x56, 0x0b); -} - -void disable_nvram(void) -{ - pci_write_cfg_byte(0, 0, 0x56, 0x0); -} diff --git a/board/MAI/AmigaOneG3SE/ps2kbd.c b/board/MAI/AmigaOneG3SE/ps2kbd.c deleted file mode 100644 index aa164b0..0000000 --- a/board/MAI/AmigaOneG3SE/ps2kbd.c +++ /dev/null @@ -1,685 +0,0 @@ -/* - * (C) Copyright 2002 - * John W. Linville, linville@tuxdriver.com - * - * Modified from code for support of MIP405 and PIP405 boards. Previous - * copyright follows. - * - * (C) Copyright 2001 - * Denis Peter, MPL AG Switzerland, d.peter@mpl.ch - * - * 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 - * - * - * Source partly derived from: - * linux/drivers/char/pc_keyb.c - * - * - */ -#include <common.h> -#include <asm/processor.h> -#include <stdio_dev.h> -#include "ps2kbd.h" - - -unsigned char kbd_read_status(void); -unsigned char kbd_read_input(void); -void kbd_send_data(unsigned char data); -void i8259_mask_irq(unsigned int irq); -void i8259_unmask_irq(unsigned int irq); - -/* used only by send_data - set by keyboard_interrupt */ - - -#undef KBG_DEBUG - -#ifdef KBG_DEBUG -#define PRINTF(fmt,args...) printf (fmt ,##args) -#else -#define PRINTF(fmt,args...) -#endif - -#define KBD_STAT_KOBF 0x01 -#define KBD_STAT_IBF 0x02 -#define KBD_STAT_SYS 0x04 -#define KBD_STAT_CD 0x08 -#define KBD_STAT_LOCK 0x10 -#define KBD_STAT_MOBF 0x20 -#define KBD_STAT_TI_OUT 0x40 -#define KBD_STAT_PARERR 0x80 - -#define KBD_INIT_TIMEOUT 2000 /* Timeout in ms for initializing the keyboard */ -#define KBC_TIMEOUT 250 /* Timeout in ms for sending to keyboard controller */ -#define KBD_TIMEOUT 2000 /* Timeout in ms for keyboard command acknowledge */ -/* - * Keyboard Controller Commands - */ - -#define KBD_CCMD_READ_MODE 0x20 /* Read mode bits */ -#define KBD_CCMD_WRITE_MODE 0x60 /* Write mode bits */ -#define KBD_CCMD_GET_VERSION 0xA1 /* Get controller version */ -#define KBD_CCMD_MOUSE_DISABLE 0xA7 /* Disable mouse interface */ -#define KBD_CCMD_MOUSE_ENABLE 0xA8 /* Enable mouse interface */ -#define KBD_CCMD_TEST_MOUSE 0xA9 /* Mouse interface test */ -#define KBD_CCMD_SELF_TEST 0xAA /* Controller self test */ -#define KBD_CCMD_KBD_TEST 0xAB /* Keyboard interface test */ -#define KBD_CCMD_KBD_DISABLE 0xAD /* Keyboard interface disable */ -#define KBD_CCMD_KBD_ENABLE 0xAE /* Keyboard interface enable */ -#define KBD_CCMD_WRITE_AUX_OBUF 0xD3 /* Write to output buffer as if - initiated by the auxiliary device */ -#define KBD_CCMD_WRITE_MOUSE 0xD4 /* Write the following byte to the mouse */ - -/* - * Keyboard Commands - */ - -#define KBD_CMD_SET_LEDS 0xED /* Set keyboard leds */ -#define KBD_CMD_SET_RATE 0xF3 /* Set typematic rate */ -#define KBD_CMD_ENABLE 0xF4 /* Enable scanning */ -#define KBD_CMD_DISABLE 0xF5 /* Disable scanning */ -#define KBD_CMD_RESET 0xFF /* Reset */ - -/* - * Keyboard Replies - */ - -#define KBD_REPLY_POR 0xAA /* Power on reset */ -#define KBD_REPLY_ACK 0xFA /* Command ACK */ -#define KBD_REPLY_RESEND 0xFE /* Command NACK, send the cmd again */ - -/* - * Status Register Bits - */ - -#define KBD_STAT_OBF 0x01 /* Keyboard output buffer full */ -#define KBD_STAT_IBF 0x02 /* Keyboard input buffer full */ -#define KBD_STAT_SELFTEST 0x04 /* Self test successful */ -#define KBD_STAT_CMD 0x08 /* Last write was a command write (0=data) */ -#define KBD_STAT_UNLOCKED 0x10 /* Zero if keyboard locked */ -#define KBD_STAT_MOUSE_OBF 0x20 /* Mouse output buffer full */ -#define KBD_STAT_GTO 0x40 /* General receive/xmit timeout */ -#define KBD_STAT_PERR 0x80 /* Parity error */ - -#define AUX_STAT_OBF (KBD_STAT_OBF | KBD_STAT_MOUSE_OBF) - -/* - * Controller Mode Register Bits - */ - -#define KBD_MODE_KBD_INT 0x01 /* Keyboard data generate IRQ1 */ -#define KBD_MODE_MOUSE_INT 0x02 /* Mouse data generate IRQ12 */ -#define KBD_MODE_SYS 0x04 /* The system flag (?) */ -#define KBD_MODE_NO_KEYLOCK 0x08 /* The keylock doesn't affect the keyboard if set */ -#define KBD_MODE_DISABLE_KBD 0x10 /* Disable keyboard interface */ -#define KBD_MODE_DISABLE_MOUSE 0x20 /* Disable mouse interface */ -#define KBD_MODE_KCC 0x40 /* Scan code conversion to PC format */ -#define KBD_MODE_RFU 0x80 - - -#define KDB_DATA_PORT 0x60 -#define KDB_COMMAND_PORT 0x64 - -#define LED_SCR 0x01 /* scroll lock led */ -#define LED_CAP 0x04 /* caps lock led */ -#define LED_NUM 0x02 /* num lock led */ - -#define KBD_BUFFER_LEN 0x20 /* size of the keyboardbuffer */ - - -static volatile char kbd_buffer[KBD_BUFFER_LEN]; -static volatile int in_pointer = 0; -static volatile int out_pointer = 0; - - -static unsigned char num_lock = 0; -static unsigned char caps_lock = 0; -static unsigned char scroll_lock = 0; -static unsigned char shift = 0; -static unsigned char ctrl = 0; -static unsigned char alt = 0; -static unsigned char e0 = 0; -static unsigned char leds = 0; - -#define DEVNAME "ps2kbd" - -/* Simple translation table for the keys */ - -static unsigned char kbd_plain_xlate[] = { - 0xff,0x1b, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=','\b','\t', /* 0x00 - 0x0f */ - 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']','\r',0xff, 'a', 's', /* 0x10 - 0x1f */ - 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';','\'', '`',0xff,'\\', 'z', 'x', 'c', 'v', /* 0x20 - 0x2f */ - 'b', 'n', 'm', ',', '.', '/',0xff,0xff,0xff, ' ',0xff,0xff,0xff,0xff,0xff,0xff, /* 0x30 - 0x3f */ - 0xff,0xff,0xff,0xff,0xff,0xff,0xff, '7', '8', '9', '-', '4', '5', '6', '+', '1', /* 0x40 - 0x4f */ - '2', '3', '0', '.',0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, /* 0x50 - 0x5F */ - '\r',0xff,0xff - }; - -static unsigned char kbd_shift_xlate[] = { - 0xff,0x1b, '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+','\b','\t', /* 0x00 - 0x0f */ - 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '{', '}','\r',0xff, 'A', 'S', /* 0x10 - 0x1f */ - 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', '"', '~',0xff, '|', 'Z', 'X', 'C', 'V', /* 0x20 - 0x2f */ - 'B', 'N', 'M', '<', '>', '?',0xff,0xff,0xff, ' ',0xff,0xff,0xff,0xff,0xff,0xff, /* 0x30 - 0x3f */ - 0xff,0xff,0xff,0xff,0xff,0xff,0xff, '7', '8', '9', '-', '4', '5', '6', '+', '1', /* 0x40 - 0x4f */ - '2', '3', '0', '.',0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, /* 0x50 - 0x5F */ - '\r',0xff,0xff - }; - -static unsigned char kbd_ctrl_xlate[] = { - 0xff,0x1b, '1',0x00, '3', '4', '5',0x1E, '7', '8', '9', '0',0x1F, '=','\b','\t', /* 0x00 - 0x0f */ - 0x11,0x17,0x05,0x12,0x14,0x18,0x15,0x09,0x0f,0x10,0x1b,0x1d,'\n',0xff,0x01,0x13, /* 0x10 - 0x1f */ - 0x04,0x06,0x08,0x09,0x0a,0x0b,0x0c, ';','\'', '~',0x00,0x1c,0x1a,0x18,0x03,0x16, /* 0x20 - 0x2f */ - 0x02,0x0e,0x0d, '<', '>', '?',0xff,0xff,0xff,0x00,0xff,0xff,0xff,0xff,0xff,0xff, /* 0x30 - 0x3f */ - 0xff,0xff,0xff,0xff,0xff,0xff,0xff, '7', '8', '9', '-', '4', '5', '6', '+', '1', /* 0x40 - 0x4f */ - '2', '3', '0', '.',0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, /* 0x50 - 0x5F */ - '\r',0xff,0xff - }; - -/****************************************************************** - * Init - ******************************************************************/ - -int isa_kbd_init (void) -{ - char *result; - - result = kbd_initialize (); - if (result != NULL) { - result = kbd_initialize (); - } - if (result == NULL) { - printf ("AT Keyboard initialized\n"); - irq_install_handler (KBD_INTERRUPT, - (interrupt_handler_t *) kbd_interrupt, - NULL); - return (1); - } else { - printf ("%s\n", result); - return (-1); - } -} - -#ifdef CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE -extern int overwrite_console (void); -#else -int overwrite_console (void) -{ - return (0); -} -#endif - -int drv_isa_kbd_init (void) -{ - int error; - struct stdio_dev kbddev ; - char *stdinname = getenv ("stdin"); - - if(isa_kbd_init() == -1) - return -1; - memset (&kbddev, 0, sizeof(kbddev)); - strcpy(kbddev.name, DEVNAME); - kbddev.flags = DEV_FLAGS_INPUT | DEV_FLAGS_SYSTEM; - kbddev.putc = NULL ; - kbddev.puts = NULL ; - kbddev.getc = kbd_getc ; - kbddev.tstc = kbd_testc ; - - error = stdio_register (&kbddev); - if(error==0) { - /* check if this is the standard input device */ - if(strcmp(stdinname,DEVNAME)==0) { - /* reassign the console */ - if(overwrite_console()) { - return 1; - } - error=console_assign(stdin,DEVNAME); - if(error==0) - return 1; - else - return error; - } - return 1; - } - return error; -} - -/****************************************************************** - * Queue handling - ******************************************************************/ -/* puts character in the queue and sets up the in and out pointer */ -void kbd_put_queue(char data) -{ - if((in_pointer+1)==KBD_BUFFER_LEN) { - if(out_pointer==0) { - return; /* buffer full */ - } else{ - in_pointer=0; - } - } else { - if((in_pointer+1)==out_pointer) - return; /* buffer full */ - in_pointer++; - } - kbd_buffer[in_pointer]=data; - return; -} - -/* test if a character is in the queue */ -int kbd_testc(void) -{ - if(in_pointer==out_pointer) - return(0); /* no data */ - else - return(1); -} -/* gets the character from the queue */ -int kbd_getc(void) -{ - char c; - - while(in_pointer==out_pointer); - if((out_pointer+1)==KBD_BUFFER_LEN) - out_pointer=0; - else - out_pointer++; - c=kbd_buffer[out_pointer]; - return (int)c; - -} - -/* set LEDs */ - -void kbd_set_leds(void) -{ - if(caps_lock==0) - leds&=~LED_CAP; /* switch caps_lock off */ - else - leds|=LED_CAP; /* switch on LED */ - if(num_lock==0) - leds&=~LED_NUM; /* switch LED off */ - else - leds|=LED_NUM; /* switch on LED */ - if(scroll_lock==0) - leds&=~LED_SCR; /* switch LED off */ - else - leds|=LED_SCR; /* switch on LED */ - kbd_send_data(KBD_CMD_SET_LEDS); - kbd_send_data(leds); -} - -void handle_keyboard_event (unsigned char scancode) -{ - unsigned char keycode; - - /* Convert scancode to keycode */ - PRINTF ("scancode %x\n", scancode); - if (scancode == 0xe0) { - e0 = 1; /* special charakters */ - return; - } - if (e0 == 1) { - e0 = 0; /* delete flag */ - if (!(((scancode & 0x7F) == 0x38) || /* the right ctrl key */ - ((scancode & 0x7F) == 0x1D) || /* the right alt key */ - ((scancode & 0x7F) == 0x35) || /* the right '/' key */ - ((scancode & 0x7F) == 0x1C) || /* the right enter key */ - ((scancode) == 0x48) || /* arrow up */ - ((scancode) == 0x50) || /* arrow down */ - ((scancode) == 0x4b) || /* arrow left */ - ((scancode) == 0x4d))) - /* arrow right */ - /* we swallow unknown e0 codes */ - return; - } - /* special cntrl keys */ - switch (scancode) { - case 0x48: - kbd_put_queue (27); - kbd_put_queue (91); - kbd_put_queue ('A'); - return; - case 0x50: - kbd_put_queue (27); - kbd_put_queue (91); - kbd_put_queue ('B'); - return; - case 0x4b: - kbd_put_queue (27); - kbd_put_queue (91); - kbd_put_queue ('D'); - return; - case 0x4D: - kbd_put_queue (27); - kbd_put_queue (91); - kbd_put_queue ('C'); - return; - case 0x58: /* F12 key */ - if (ctrl == 1) { - extern int console_changed; - - setenv ("stdin", DEVNAME); - setenv ("stdout", "vga"); - console_changed = 1; - } - return; - case 0x2A: - case 0x36: /* shift pressed */ - shift = 1; - return; /* do nothing else */ - case 0xAA: - case 0xB6: /* shift released */ - shift = 0; - return; /* do nothing else */ - case 0x38: /* alt pressed */ - alt = 1; - return; /* do nothing else */ - case 0xB8: /* alt released */ - alt = 0; - return; /* do nothing else */ - case 0x1d: /* ctrl pressed */ - ctrl = 1; - return; /* do nothing else */ - case 0x9d: /* ctrl released */ - ctrl = 0; - return; /* do nothing else */ - case 0x46: /* scrollock pressed */ - scroll_lock = ~scroll_lock; - kbd_set_leds (); - return; /* do nothing else */ - case 0x3A: /* capslock pressed */ - caps_lock = ~caps_lock; - kbd_set_leds (); - return; - case 0x45: /* numlock pressed */ - num_lock = ~num_lock; - kbd_set_leds (); - return; - case 0xC6: /* scroll lock released */ - case 0xC5: /* num lock released */ - case 0xBA: /* caps lock released */ - return; /* just swallow */ - } - if ((scancode & 0x80) == 0x80) /* key released */ - return; - /* now, decide which table we need */ - if (scancode > (sizeof (kbd_plain_xlate) / sizeof (kbd_plain_xlate[0]))) { /* scancode not in list */ - PRINTF ("unkown scancode %X\n", scancode); - return; /* swallow it */ - } - /* setup plain code first */ - keycode = kbd_plain_xlate[scancode]; - if (caps_lock == 1) { /* caps_lock is pressed, overwrite plain code */ - if (scancode > (sizeof (kbd_shift_xlate) / sizeof (kbd_shift_xlate[0]))) { /* scancode not in list */ - PRINTF ("unkown caps-locked scancode %X\n", scancode); - return; /* swallow it */ - } - keycode = kbd_shift_xlate[scancode]; - if (keycode < 'A') { /* we only want the alphas capital */ - keycode = kbd_plain_xlate[scancode]; - } - } - if (shift == 1) { /* shift overwrites caps_lock */ - if (scancode > (sizeof (kbd_shift_xlate) / sizeof (kbd_shift_xlate[0]))) { /* scancode not in list */ - PRINTF ("unkown shifted scancode %X\n", scancode); - return; /* swallow it */ - } - keycode = kbd_shift_xlate[scancode]; - } - if (ctrl == 1) { /* ctrl overwrites caps_lock and shift */ - if (scancode > (sizeof (kbd_ctrl_xlate) / sizeof (kbd_ctrl_xlate[0]))) { /* scancode not in list */ - PRINTF ("unkown ctrl scancode %X\n", scancode); - return; /* swallow it */ - } - keycode = kbd_ctrl_xlate[scancode]; - } - /* check if valid keycode */ - if (keycode == 0xff) { - PRINTF ("unkown scancode %X\n", scancode); - return; /* swallow unknown codes */ - } - - kbd_put_queue (keycode); - PRINTF ("%x\n", keycode); -} - -/* - * This reads the keyboard status port, and does the - * appropriate action. - * - */ -unsigned char handle_kbd_event (void) -{ - unsigned char status = kbd_read_status (); - unsigned int work = 10000; - - while ((--work > 0) && (status & KBD_STAT_OBF)) { - unsigned char scancode; - - scancode = kbd_read_input (); - - /* Error bytes must be ignored to make the - Synaptics touchpads compaq use work */ - /* Ignore error bytes */ - if (!(status & (KBD_STAT_GTO | KBD_STAT_PERR))) { - if (status & KBD_STAT_MOUSE_OBF); /* not supported: handle_mouse_event(scancode); */ - else - handle_keyboard_event (scancode); - } - status = kbd_read_status (); - } - if (!work) - PRINTF ("pc_keyb: controller jammed (0x%02X).\n", status); - return status; -} - -/****************************************************************************** - * Lowlevel Part of keyboard section - */ -unsigned char kbd_read_status(void) -{ - return(in8(CONFIG_SYS_ISA_IO_BASE_ADDRESS + KDB_COMMAND_PORT)); -} - -unsigned char kbd_read_input(void) -{ - return(in8(CONFIG_SYS_ISA_IO_BASE_ADDRESS + KDB_DATA_PORT)); -} - -void kbd_write_command(unsigned char cmd) -{ - out8(CONFIG_SYS_ISA_IO_BASE_ADDRESS + KDB_COMMAND_PORT,cmd); -} - -void kbd_write_output(unsigned char data) -{ - out8(CONFIG_SYS_ISA_IO_BASE_ADDRESS + KDB_DATA_PORT, data); -} - -int kbd_read_data(void) -{ - int val; - unsigned char status; - - val = -1; - status = kbd_read_status(); - if (status & KBD_STAT_OBF) { - val = kbd_read_input(); - if (status & (KBD_STAT_GTO | KBD_STAT_PERR)) - val = -2; - } - return val; -} - -int kbd_wait_for_input (void) -{ - unsigned long timeout; - int val; - - timeout = KBD_TIMEOUT; - val = kbd_read_data (); - while (val < 0) { - if (timeout-- == 0) - return -1; - udelay (1000); - val = kbd_read_data (); - } - return val; -} - - -int kb_wait (void) -{ - unsigned long timeout = KBC_TIMEOUT * 10; - - do { - unsigned char status = handle_kbd_event (); - - if (!(status & KBD_STAT_IBF)) - return 0; /* ok */ - udelay (1000); - timeout--; - } while (timeout); - return 1; -} - -void kbd_write_command_w (int data) -{ - if (kb_wait ()) - PRINTF ("timeout in kbd_write_command_w\n"); - kbd_write_command (data); -} - -void kbd_write_output_w (int data) -{ - if (kb_wait ()) - PRINTF ("timeout in kbd_write_output_w\n"); - kbd_write_output (data); -} - -void kbd_send_data (unsigned char data) -{ - unsigned char status; - - i8259_mask_irq (KBD_INTERRUPT); /* disable interrupt */ - kbd_write_output_w (data); - status = kbd_wait_for_input (); - if (status == KBD_REPLY_ACK) - i8259_unmask_irq (KBD_INTERRUPT); /* enable interrupt */ -} - - -char *kbd_initialize (void) -{ - int status; - - in_pointer = 0; /* delete in Buffer */ - out_pointer = 0; - /* - * Test the keyboard interface. - * This seems to be the only way to get it going. - * If the test is successful a x55 is placed in the input buffer. - */ - kbd_write_command_w (KBD_CCMD_SELF_TEST); - if (kbd_wait_for_input () != 0x55) - return "Kbd: failed self test"; - /* - * Perform a keyboard interface test. This causes the controller - * to test the keyboard clock and data lines. The results of the - * test are placed in the input buffer. - */ - kbd_write_command_w (KBD_CCMD_KBD_TEST); - if (kbd_wait_for_input () != 0x00) - return "Kbd: interface failed self test"; - /* - * Enable the keyboard by allowing the keyboard clock to run. - */ - kbd_write_command_w (KBD_CCMD_KBD_ENABLE); - status = kbd_wait_for_input (); - /* - * Reset keyboard. If the read times out - * then the assumption is that no keyboard is - * plugged into the machine. - * This defaults the keyboard to scan-code set 2. - * - * Set up to try again if the keyboard asks for RESEND. - */ - do { - kbd_write_output_w (KBD_CMD_RESET); - status = kbd_wait_for_input (); - if (status == KBD_REPLY_ACK) - break; - if (status != KBD_REPLY_RESEND) { - PRINTF ("status: %X\n", status); - return "Kbd: reset failed, no ACK"; - } - } while (1); - if (kbd_wait_for_input () != KBD_REPLY_POR) - return "Kbd: reset failed, no POR"; - - /* - * Set keyboard controller mode. During this, the keyboard should be - * in the disabled state. - * - * Set up to try again if the keyboard asks for RESEND. - */ - do { - kbd_write_output_w (KBD_CMD_DISABLE); - status = kbd_wait_for_input (); - if (status == KBD_REPLY_ACK) - break; - if (status != KBD_REPLY_RESEND) - return "Kbd: disable keyboard: no ACK"; - } while (1); - - kbd_write_command_w (KBD_CCMD_WRITE_MODE); - kbd_write_output_w (KBD_MODE_KBD_INT - | KBD_MODE_SYS - | KBD_MODE_DISABLE_MOUSE | KBD_MODE_KCC); - - /* AMCC powerpc portables need this to use scan-code set 1 -- Cort */ - kbd_write_command_w (KBD_CCMD_READ_MODE); - if (!(kbd_wait_for_input () & KBD_MODE_KCC)) { - /* - * If the controller does not support conversion, - * Set the keyboard to scan-code set 1. - */ - kbd_write_output_w (0xF0); - kbd_wait_for_input (); - kbd_write_output_w (0x01); - kbd_wait_for_input (); - } - kbd_write_output_w (KBD_CMD_ENABLE); - if (kbd_wait_for_input () != KBD_REPLY_ACK) - return "Kbd: enable keyboard: no ACK"; - - /* - * Finally, set the typematic rate to maximum. - */ - kbd_write_output_w (KBD_CMD_SET_RATE); - if (kbd_wait_for_input () != KBD_REPLY_ACK) - return "Kbd: Set rate: no ACK"; - kbd_write_output_w (0x00); - if (kbd_wait_for_input () != KBD_REPLY_ACK) - return "Kbd: Set rate: no ACK"; - return NULL; -} - -void kbd_interrupt(void) -{ - handle_kbd_event(); -} diff --git a/board/MAI/AmigaOneG3SE/ps2kbd.h b/board/MAI/AmigaOneG3SE/ps2kbd.h deleted file mode 100644 index fc5c422..0000000 --- a/board/MAI/AmigaOneG3SE/ps2kbd.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * (C) Copyright 2002 - * John W. Linville, linville@tuxdriver.com - * - * Modified from code for support of MIP405 and PIP405 boards. Previous - * copyright follows. - * - * (C) Copyright 2001 - * Denis Peter, MPL AG Switzerland, d.peter@mpl.ch - * - * 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 _KBD_H_ -#define _KBD_H_ - -extern int kbd_testc(void); -extern int kbd_getc(void); -extern void kbd_interrupt(void); -extern char *kbd_initialize(void); - -unsigned char kbd_is_init(void); -#define KBD_INTERRUPT 1 -#endif diff --git a/board/MAI/AmigaOneG3SE/serial.c b/board/MAI/AmigaOneG3SE/serial.c deleted file mode 100644 index 84a913e..0000000 --- a/board/MAI/AmigaOneG3SE/serial.c +++ /dev/null @@ -1,245 +0,0 @@ -#include <common.h> -#include <ns16550.h> -#include "short_types.h" -#include "memio.h" -#include "articiaS.h" - -DECLARE_GLOBAL_DATA_PTR; - -#ifndef CONFIG_SYS_NS16550 -static uint32 ComPort1; - -uint16 SerialEcho = 1; - - -#define RECEIVER_HOLDING 0 -#define TRANSMITTER_HOLDING 0 -#define INTERRUPT_ENABLE 1 -#define INTERRUPT_STATUS 2 -#define FIFO_CONTROL 2 -#define LINE_CONTROL 3 -#define MODEM_CONTROL 4 -#define LINE_STATUS 5 -#define MODEM_STATUS 6 -#define SCRATCH_PAD 7 - -#define DIVISOR_LATCH_LSB 0 -#define DIVISOR_LATCH_MSB 1 -#define PRESCALER_DIVISION 5 - -#define COM_WRITE_BYTE(reg, byte) out_byte((ComPort1+reg), byte) -#define COM_READ_BYTE(reg) in_byte((ComPort1+reg)) - -static int serial_init_done = 0; - -void serial_init (void) -{ -#if 0 - uint32 clock_divisor = 115200 / baudrate; - uint8 cfg; - uint8 a; - uint16 devfn = 7 << 3; - - if (serial_init_done) - return; - - /* Enter configuration mode */ - cfg = pci_read_cfg_byte (0, devfn, 0x85); - pci_write_cfg_byte (0, devfn, 0x85, cfg | 0x02); - - /* Set serial port COM1 as 3F8 */ - out_byte (0x3F0, 0xE7); - out_byte (0x3f1, 0xfe); - - /* Set serial port COM2 as 2F8 */ - out_byte (0x3f0, 0xe8); - out_byte (0x3f1, 0xeb); - - /* Enable */ - out_byte (0x3f0, 0xe2); - a = in_byte (0x3f1); - a |= 0xc; - out_byte (0x3f0, 0xe2); - out_byte (0x3f1, a); - - /* Reset the configuration mode */ - pci_write_cfg_byte (0, devfn, 0x85, cfg); -#endif - - ComPort1 = 0x3F8; - - /* Disable interrupts */ - COM_WRITE_BYTE (INTERRUPT_ENABLE, 0x00); - - /* Set baud rate */ - /* COM_WRITE_BYTE(LINE_CONTROL, 0x83); */ - /* COM_WRITE_BYTE(DIVISOR_LATCH_LSB, (uint8)(clock_divisor & 0xFF)); */ - /* COM_WRITE_BYTE(DIVISOR_LATCH_MSB, (uint8)(clock_divisor >> 8)); */ - /* __asm__("eieio"); */ - - /* Set 8-N-1 */ - COM_WRITE_BYTE (LINE_CONTROL, 0x03); - __asm__ ("eieio"); - - /* Disable FIFO */ - COM_WRITE_BYTE (MODEM_CONTROL, 0x03); - COM_WRITE_BYTE (FIFO_CONTROL, 0x07); - - __asm__ ("eieio"); - serial_init_done = 1; -} - -extern int console_changed; - -void serial_putc (const char sendme) -{ - if (sendme == '\n') { - while ((in_byte (0x3FD) & 0x40) == 0); - out_byte (0x3f8, 0x0D); - } - - while ((in_byte (0x3FD) & 0x40) == 0); - out_byte (0x3f8, sendme); -} - -int serial_getc (void) -{ -#if 0 - uint8 c; - - for (;;) { - uint8 x = in_byte (0x3FD); - - if (x & 0x01) - break; - - if (x & 0x0C) - out_byte (0x3fd, 0x0c); - } - - c = in_byte (0x3F8); - - return c; -#else - while ((in_byte (0x3FD) & 0x01) == 0) { - if (console_changed != 0) { - printf ("Console changed\n"); - console_changed = 0; - return 0; - } - } - return in_byte (0x3F8); -#endif -} - -int serial_tstc (void) -{ - return (in_byte (0x03FD) & 0x01) != 0; -} - -void serial_debug_putc (int c) -{ - serial_puts ("DBG"); - serial_putc (c); - serial_putc (0x0d); - serial_putc (0x0A); -} - -#else - -const NS16550_t Com0 = (NS16550_t) CONFIG_SYS_NS16550_COM1; -const NS16550_t Com1 = (NS16550_t) CONFIG_SYS_NS16550_COM2; - -int serial_init (void) -{ - uint32 clock_divisor = 115200 / gd->baudrate; - - NS16550_init (Com0, clock_divisor); - /* NS16550_reinit(Com1, clock_divisor); */ - /* serial_puts("COM1: 3F8h initalized"); */ - - return (0); -} - -#if 0 -void serial_putc (const char c) -{ - NS16550_putc (Com0, c); - if (c == '\n') - NS16550_putc (Com0, 0x0D); -} - -int serial_getc (void) -{ - return (int) NS16550_getc (Com0); -} - -int serial_tstc (void) -{ - return NS16550_tstc (Com0); -} -#else -void serial_putc (const char sendme) -{ - if (sendme == '\n') { - while ((in_byte (0x3FD) & 0x40) == 0); - out_byte (0x3f8, 0x0D); - } - - while ((in_byte (0x3FD) & 0x40) == 0); - out_byte (0x3f8, sendme); -} - - -extern int console_changed; - -int serial_getc (void) -{ -#if 0 - uint8 c; - - for (;;) { - uint8 x = in_byte (0x3FD); - - if (x & 0x01) - break; - - if (x & 0x0C) - out_byte (0x3fd, 0x0c); - } - - c = in_byte (0x3F8); - - return c; -#else - while ((in_byte (0x3FD) & 0x01) == 0) { - if (console_changed != 0) { - console_changed = 0; - return 0; - } - } - - return in_byte (0x3F8); -#endif -} - -int serial_tstc (void) -{ - return (in_byte (0x03FD) & 0x01) != 0; -} -#endif - -#endif - -void serial_puts (const char *string) -{ - while (*string) - serial_putc (*string++); -} - -void serial_setbrg (void) -{ - uint32 clock_divisor = 115200 / gd->baudrate; - - NS16550_init (Com0, clock_divisor); -} diff --git a/board/MAI/AmigaOneG3SE/short_types.h b/board/MAI/AmigaOneG3SE/short_types.h deleted file mode 100644 index 1840d28..0000000 --- a/board/MAI/AmigaOneG3SE/short_types.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * short type names - * - * (C) Copyright 2002 - * Hyperion Entertainment, ThomasF@hyperion-entertainment.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 _SHORT_TYPES_H -#define _SHORT_TYPES_H - -typedef unsigned long uint32; -typedef long int32; -typedef unsigned short uint16; -typedef short int16; -typedef unsigned char uint8; -typedef signed char int8; - -#endif diff --git a/board/MAI/AmigaOneG3SE/smbus.c b/board/MAI/AmigaOneG3SE/smbus.c deleted file mode 100644 index de13977..0000000 --- a/board/MAI/AmigaOneG3SE/smbus.c +++ /dev/null @@ -1,206 +0,0 @@ -#include "memio.h" -#include "articiaS.h" - -#ifndef FALSE -#define FALSE 0 -#endif - -#ifndef TRUE -#define TRUE 1 -#endif - - -void sm_write_mode(void) -{ - out_byte(0xA539, 0x00); - out_byte(0xA53A, 0x03); -} - -void sm_read_mode(void) -{ - out_byte(0xA53A, 0x02); - out_byte(0xA539, 0x02); -} - -void sm_write_byte(uint8 writeme) -{ - int i; - int level; - - out_byte(0xA539, 0x00); - - level = 0; - - for (i=0; i<8; i++) - { - if ((writeme & 0x80) == (level<<7)) - { - /* Bit did not change, rewrite strobe */ - out_byte(0xA539, level | 0x02); - out_byte(0xA539, level); - } - else - { - /* Bit changed, set bit, then strobe */ - level = (writeme & 0x80) >> 7; - out_byte(0xA539, level); - out_byte(0xA539, level | 0x02); - out_byte(0xA539, level); - } - writeme <<= 1; - } - out_byte(0xA539, 0x00); -} - -uint8 sm_read_byte(void) -{ - uint8 retme, r; - int i; - - retme = 0; - for (i=0; i<8; i++) - { - retme <<= 1; - out_byte(0xA539, 0x00); - out_byte(0xA539, 0x02); - r = in_byte(0xA538) & 0x01; - retme |= r; - } - - return retme; -} - -int sm_get_ack(void) -{ - uint8 r; - r = in_byte(0xA538); - if ((r&0x01) == 0) return TRUE; - else return FALSE; -} - -void sm_write_ack(void) -{ - out_byte(0xA539, 0x00); - out_byte(0xA539, 0x02); - out_byte(0xA539, 0x00); -} - -void sm_write_nack(void) -{ - out_byte(0xA539, 0x01); - out_byte(0xA539, 0x03); - out_byte(0xA539, 0x01); -} - -void sm_send_start(void) -{ - out_byte(0xA539, 0x03); - out_byte(0xA539, 0x02); -} - -void sm_send_stop(void) -{ - out_byte(0xA539, 0x02); - out_byte(0xA539, 0x03); -} - -int sm_read_byte_from_device(uint8 addr, uint8 reg, uint8 *storage) -{ - /* S Addr Wr */ - sm_write_mode(); - sm_send_start(); - sm_write_byte((addr<<1)); - - /* [A] */ - sm_read_mode(); - if (sm_get_ack() == FALSE) return FALSE; - - /* Comm */ - sm_write_mode(); - sm_write_byte(reg); - - /* [A] */ - sm_read_mode(); - if (sm_get_ack() == FALSE) return FALSE; - - /* S Addr Rd */ - sm_write_mode(); - sm_send_start(); - sm_write_byte((addr<<1)|1); - - /* [A] */ - sm_read_mode(); - if (sm_get_ack() == FALSE) return FALSE; - - /* [Data] */ - *storage = sm_read_byte(); - - /* NA */ - sm_write_mode(); - sm_write_nack(); - sm_send_stop(); - - return TRUE; -} - -void sm_init(void) -{ - /* Switch to PMC mode */ - pci_write_cfg_byte(0, 0, REG_GROUP, (uint8)(REG_GROUP_SPECIAL|REG_GROUP_POWER)); - - /* Set GPIO Base */ - pci_write_cfg_long(0, 0, 0x40, 0xa500); - - /* Enable GPIO */ - pci_write_cfg_byte(0, 0, 0x44, 0x11); - - /* Set both GPIO 0 and 1 as output */ - out_byte(0xA53A, 0x03); -} - - -void sm_term(void) -{ - /* Switch to normal mode */ - pci_write_cfg_byte(0, 0, REG_GROUP, 0); -} - - -int sm_get_data(uint8 *DataArray, int dimm_socket) -{ - int j; - -#if 0 - /* Switch to PMC mode */ - pci_write_cfg_byte(0, 0, REG_GROUP, (uint8)(REG_GROUP_SPECIAL|REG_GROUP_POWER)); - - /* Set GPIO Base */ - pci_write_cfg_long(0, 0, 0x40, 0xa500); - - /* Enable GPIO */ - pci_write_cfg_byte(0, 0, 0x44, 0x11); - - /* Set both GPIO 0 and 1 as output */ - out_byte(0xA53A, 0x03); -#endif - - sm_init(); - /* Start reading the rom */ - - j = 0; - - do - { - if (sm_read_byte_from_device(dimm_socket, (uint8)j, DataArray) == FALSE) - { - sm_term(); - return FALSE; - } - - DataArray++; - j++; - } while (j < 128); - - sm_term(); - return TRUE; -} diff --git a/board/MAI/AmigaOneG3SE/smbus.h b/board/MAI/AmigaOneG3SE/smbus.h deleted file mode 100644 index beeb6a0..0000000 --- a/board/MAI/AmigaOneG3SE/smbus.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef _SMBUS_H_ -#define _SMBUS_H_ - -#include "short_types.h" - -#define SM_DIMM0_ADDR 0x51 -#define SM_DIMM1_ADDR 0x52 - -void sm_write_mode(void); -void sm_read_mode(void); -void sm_write_byte(uint8 writeme); -uint8 sm_read_byte(void); -int sm_get_ack(void); -void sm_write_ack(void); -void sm_write_nack(void); -void sm_send_start(void); -void sm_send_stop(void); -int sm_read_byte_from_device(uint8 addr, uint8 reg, uint8 *storage); -int sm_get_data(uint8 *DataArray, int dimm_socket); -void sm_init(void); -void sm_term(void); -#endif diff --git a/board/MAI/AmigaOneG3SE/start.txt b/board/MAI/AmigaOneG3SE/start.txt deleted file mode 100644 index 2526ed2..0000000 --- a/board/MAI/AmigaOneG3SE/start.txt +++ /dev/null @@ -1,198 +0,0 @@ - - /*------------------------------------------------------*/ - /* TERON Articia / SDRAM Init */ - /*------------------------------------------------------*/ - -* XD_CTL = 0x81000000 (0x74) - -* HBUS_ACC_CTL_0 &= 0xFFFFFDFF (0x5c) - /* host bus access ctl reg 2(5e) */ - /* set - CPU read from memory data one clock after data is latched */ - -* GLOBL_INFO_0 |= 0x00004000 (0x50) - /* global info register 2 (52), AGP/PCI bus 1 arbiter is addressed in Articia S */ - - PCI_1_SB_CONFIG_0 |= 0x00000400 (0x80d0) - /* PCI1 side band config reg 2 (d2), enable read acces while write buffer not empty */ - - MEM_RAS_CTL_0 |= 0x3f000000 (0xcc) - &= 0x3fffffff - /* RAS park control reg 0(cc), park access enable is set */ - - HOST_RDBUF_CTL |= 0x10000000 (0x70) - &= 0x10ffffff - /* host read buffer control reg, enable prefetch for CPU read from DRAM control */ - - HBUS_ACC_CTL_0 |= 0x0100001f (0x5c) - &= 0xf1ffffff - /* host bus access control register, enable CPU address bus pipe control */ - /* two outstanding requests, *** changed to 2 from 3 */ - /* enable line merge write control for CPU write to system memory, PCI 1 */ - /* and PCI 0 bus memory; enable page merge write control for write to */ - /* PCI bus 0 & bus 1 memory */ - - SRAM_CTL |= 0x00004000 (0xc8) - &= 0xffbff7ff - /* DRAM detail timing control register 1 (ca), bit 3 set to 0 */ - /* DRAM start access latency control - wait for one clock */ - /* ff9f changed to ffbf */ - - DIM0_TIM_CTL_0 = 0x737d737d (0xc9) - /* DRAM timing control for dimm0 & dimm1; set wait one clock */ - /* cycle for next data access */ - - DIM2_TIM_CTL_0 = 0x737d737d (0xca) - /* DRAM timing control for dimm2 & dimm3; set wait one clock */ - /* cycle for next data access */ - - DIM0_BNK0_CTL_0 = BNK0_RAM_SIZ_128MB (0x90) - /* set dimm0 bank0 for 128 MB */ - - DIM0_BNK1_CTL_0 = BNK1_RAM_SIZ_128MB (0x94) - /* set dimm0 for bank1 */ - - DIM0_TIM_CTL_0 = 0xf3bf0000 (0xc9) - /* dimm0 timing control register; RAS - CAS latency - 4 clock */ - /* CAS access latency - 3 wait; pre-charge latency - 3 wait */ - /* pre-charge command period control - 5 clock; wait one clock */ - /* cycle for next data access; read to write access latency control */ - /* - 2 clock cycles */ - - DRAM_GBL_CTL_0 |= 0x00000100 (0xc0) - &= 0xffff01ff - /* memory global control register - support buffer sdram on bank 0 */ - - DRAM_ECC_CTL_0 |= 0x00260000 (0xc4) - &= 0xff26ffff - /* enable ECC; enable read, modify, write control */ - - DRAM_REF_CTL_0 = DRAM_REF_DATA (0xb8) - /* set DRAM refresh parameters *** changed to 00940100 */ - - nop - nop - nop - nop - nop - - DRAM_ECC_CTL_0 |= 0x20243280 (0xc4) - /* turn off ecc */ - /* for SDRAM bank 0 */ - - DRAM_ECC_CTL_0 |= 0x20243290 (0xc4) ? - /* for SDRAM bank 1 */ - - -/* Additional Stuff...*/ - - GLOBL_CTRL |= 0x20000b00 (0x54) - - PCI_0_SB_CONFIG |= 0x04100007 (0xd0) - /* PCI 0 Side band config reg*/ - - 0x8000083c |= 0x00080000 - /* Disable VGA decode on PCI Bus 1 */ - - -/*End Additional Stuff..*/ - - /*--------------------------------------------------------------*/ - /* TERON serial port initialization code */ - /*--------------------------------------------------------------*/ - - 0x84380080 |= 0x00030000 - /* enable super IO configuration VIA chip Register 85 */ - /* Enable super I/O config mode */ - - 0xfe0003f0 = 0xe2 - bl delay1 - - 0xfe0003f1 = 0x0f - bl delay1 - /* enable com1 & com2, parallel port disabled */ - - 0xfe0003f0 = 0xe7 - bl delay1 - /* let's make com1 base as 0x3f8 */ - - 0xfe0003f1 = 0xfe - bl delay1 - - 0xfe0003f0 = 0xe8 - bl delay1 - /* let's make com2 base as 0x2f8 */ - - 0xfe0003f1 = 0xbe - - 0x84380080 &= 0xfffdffff - /* closing super IO configuration VIA chip Register 85 */ - - -/* -------------------------------*/ - - 0xfe0003fb = 0x83 - bl delay1 - /*latch enable word length -8 bit */ /* set mslab bit */ - 0xfe0003f8 = 0x0c - bl delay1 - /* set baud rate lsb for 9600 baud */ - 0xfe0003f9 = 0x0 - bl delay1 - /* set baud rate msb for 9600 baud */ - 0xfe0003fb = 0x03 - bl delay1 - /* reset mslab */ - - /*--------------------------------------------------------------*/ - /* END TERON Serial Port Initialization Code */ - /*--------------------------------------------------------------*/ - - - /*--------------------------------------------------------------*/ - /* END TERON Articia / SDRAM Initialization code */ - /*--------------------------------------------------------------*/ - -Proposed from Documentation: - -write dmem 0xfec00cf8 0x50000080 -write dmem 0xfee00cfc 0xc0305411 - - Writes to index 0x50-0x53. - 0x50: Global Information Register 0 - 0xC0 = Little Endian CPU, Sequential order Burst - 0x51: Global Information Register 1 - Read only, 0x30 = Provides PowerPC and X86 support - 0x52: Global Information Register 2 - 0x05 = 64/128 bit CPU bus support - 0x53: Global Information Register 3 - 0x80 = PCI Bus 0 grant active time is 1 clock after REQ# deasserted - -write dmem 0xfec00cf8 0x5c000080 -write dmem 0xfee00cfc 0xb300011F - -write dmem 0xfec00cf8 0xc8000080 -write dmem 0xfee00cfc 0x0020f100 - -write dmem 0xfec00cf8 0x90000080 -write dmem 0xfee00cfc 0x007fe700 - -write dmem 0xfec00cf8 0x9400080 -write dmem 0xfee00cfc 0x007fe700 - -write dmem 0xfec00cf8 0xb0000080 -write dmem 0xfee00cfc 0x737d737d - -write dmem 0xfec00cf8 0xb4000080 -write dmem 0xfee00cfc 0x737d737d - -write dmem 0xfec00cf8 0xc0000080 -write dmem 0xfee00cfc 0x40005500 - -write dmem 0xfec00cf8 0xb8000080 -write dmem 0xfee00cfc 0x00940100 - -write dmem 0xfec00cf8 0xc4000080 -write dmem 0xfee00cfc 0x00003280 - -write dmem 0xfec00cf8 0xc4000080 -write dmem 0xfee00cfc 0x00003290 diff --git a/board/MAI/AmigaOneG3SE/todo.txt b/board/MAI/AmigaOneG3SE/todo.txt deleted file mode 100644 index df25e3d..0000000 --- a/board/MAI/AmigaOneG3SE/todo.txt +++ /dev/null @@ -1,3 +0,0 @@ -- Init interrupt controller -- init sdram -- init ide controller
\ No newline at end of file diff --git a/board/MAI/AmigaOneG3SE/u-boot.lds b/board/MAI/AmigaOneG3SE/u-boot.lds deleted file mode 100644 index e86ac56..0000000 --- a/board/MAI/AmigaOneG3SE/u-boot.lds +++ /dev/null @@ -1,136 +0,0 @@ -/* - * (C) Copyright 2001 - * Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc. - * - * (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 - */ - -/* - * u-boot.lds - linker script for U-Boot on the AmigaOneG3SE Board. - */ - -OUTPUT_ARCH(powerpc) -/* Do we need any of these for elf? - __DYNAMIC = 0; */ -SECTIONS -{ - /* Read-only sections, merged into text segment: */ - . = + SIZEOF_HEADERS; - .interp : { *(.interp) } - .hash : { *(.hash) } - .dynsym : { *(.dynsym) } - .dynstr : { *(.dynstr) } - .rel.text : { *(.rel.text) } - .rela.text : { *(.rela.text) } - .rel.data : { *(.rel.data) } - .rela.data : { *(.rela.data) } - .rel.rodata : { *(.rel.rodata) } - .rela.rodata : { *(.rela.rodata) } - .rel.got : { *(.rel.got) } - .rela.got : { *(.rela.got) } - .rel.ctors : { *(.rel.ctors) } - .rela.ctors : { *(.rela.ctors) } - .rel.dtors : { *(.rel.dtors) } - .rela.dtors : { *(.rela.dtors) } - .rel.bss : { *(.rel.bss) } - .rela.bss : { *(.rela.bss) } - .rel.plt : { *(.rel.plt) } - .rela.plt : { *(.rela.plt) } - .init : { *(.init) } - .plt : { *(.plt) } - .text : - { - arch/powerpc/cpu/74xx_7xx/start.o (.text) -/* store the environment in a seperate sector in the boot flash */ -/* . = env_offset; */ - common/env_embedded.o(.text) - - *(.text) - *(.got1) - } - _etext = .; - PROVIDE (etext = .); - .rodata : - { - *(.eh_frame) - *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) - } - .fini : { *(.fini) } =0 - .ctors : { *(.ctors) } - .dtors : { *(.dtors) } - - /* Read-write section, merged into data segment: */ - . = (. + 0x00FF) & 0xFFFFFF00; - _erotext = .; - PROVIDE (erotext = .); - .reloc : - { - *(.got) - _GOT2_TABLE_ = .; - *(.got2) - _FIXUP_TABLE_ = .; - *(.fixup) - } - __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2; - __fixup_entries = (. - _FIXUP_TABLE_)>>2; - - .data : - { - *(.data) - *(.data1) - *(.sdata) - *(.sdata2) - *(.dynamic) - CONSTRUCTORS - } - _edata = .; - PROVIDE (edata = .); - - . = .; - __u_boot_cmd_start = .; - .u_boot_cmd : { *(.u_boot_cmd) } - __u_boot_cmd_end = .; - - - . = .; - __start___ex_table = .; - __ex_table : { *(__ex_table) } - __stop___ex_table = .; - - . = ALIGN(256); - __init_begin = .; - .text.init : { *(.text.init) } - .data.init : { *(.data.init) } - . = ALIGN(256); - __init_end = .; - - __bss_start = .; - .bss (NOLOAD) : - { - *(.sbss) *(.scommon) - *(.dynbss) - *(.bss) - *(COMMON) - } - _end = ALIGN(4) /*.*/ ; - PROVIDE (end = ALIGN(4) /*.*/); -} diff --git a/board/MAI/AmigaOneG3SE/usb_uhci.c b/board/MAI/AmigaOneG3SE/usb_uhci.c deleted file mode 100644 index 857ab3e..0000000 --- a/board/MAI/AmigaOneG3SE/usb_uhci.c +++ /dev/null @@ -1,1178 +0,0 @@ -/* - * (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 - * - */ - -/********************************************************************** - * 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 <pci.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 */ - - -/*#define USB_UHCI_DEBUG */ - -#ifdef USB_UHCI_DEBUG -#define USB_UHCI_PRINTF(fmt,args...) printf (fmt ,##args) -#else -#define USB_UHCI_PRINTF(fmt,args...) -#endif - - -static int irqvec = -1; /* irq vector, if -1 uhci is stopped / reseted */ -unsigned int usb_base_addr; /* base address */ - -static uhci_td_t td_int[8]; /* Interrupt Transfer descriptors */ -static uhci_qh_t qh_cntrl; /* control Queue Head */ -static uhci_qh_t qh_bulk; /* bulk Queue Head */ -static uhci_qh_t qh_end; /* end Queue Head */ -static uhci_td_t td_last; /* last TD (linked with end chain) */ - -/* temporary tds */ -static uhci_td_t tmp_td[USB_MAX_TEMP_TD]; /* temporary bulk/control td's */ -static uhci_td_t tmp_int_td[USB_MAX_TEMP_INT_TD]; /* 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); - 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)mytd->status); - stat=usb_uhci_td_stat(temp); - info=swap_32((unsigned long)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)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 - *-------------------------------------------------------------------*/ - -/* 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); -#if 0 - { - 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 */ - 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; -} - -#if 0 -void uhci_show_temp_int_td(void) -{ - int i; - for(i=0;i<USB_MAX_TEMP_INT_TD;i++) { - if((tmp_int_td[i].dev_ptr&0x01)!=0x1L) /* no device assigned -> free TD */ - printf("temp_td %d is assigned to dev %lx\n",i,tmp_int_td[i].dev_ptr); - } - printf("all others temp_tds are free\n"); -} -#endif -/*------------------------------------------------------------------- - * 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 ,0,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,0,0,0L); - temp=(unsigned long)&td_int[0]; - for(n=1; n<8; n++) - usb_fill_td(&td_int[n],temp,0,0,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; - 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; - 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(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(td->link) & UHCI_PTR_QH))) - { - /* check if a device is assigned with this td */ - status=swap_32(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=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(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; - - /* - * 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&0x20) && ((in16r(usb_base_addr+USBCMD) && USBCMD_RS)==0)) { - out16r(usb_base_addr + USBCMD, USBCMD_RS | in16r(usb_base_addr + USBCMD)); - } - } - 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; - int busdevfunc; -/* - * HJF - configure IRQ and base from variables optionally. - */ - char *s; - - - busdevfunc=pci_find_device(USB_UHCI_VEND_ID,USB_UHCI_DEV_ID,0); /* get PCI Device ID */ - if(busdevfunc == -1) { - printf("Error USB UHCI (%04X,%04X) not found\n",USB_UHCI_VEND_ID,USB_UHCI_DEV_ID); - return -1; - } - -#if 1 - s = getenv("usb_irq"); - if (s) - { - temp = atoi(s); - pci_write_config_byte(busdevfunc, PCI_INTERRUPT_LINE, temp); - } - else -#endif - pci_read_config_byte(busdevfunc,PCI_INTERRUPT_LINE,&temp); - - s = getenv("usb_base"); - if (s) - { - unsigned long temp2; - temp2 = atoi(s); - pci_write_config_dword(busdevfunc, PCI_BASE_ADDRESS_4, temp2|0x01); - } - - irqvec = temp; - irq_free_handler(irqvec); - USB_UHCI_PRINTF("Interrupt Line = %d\n",irqvec); - pci_read_config_byte(busdevfunc,PCI_INTERRUPT_PIN,&temp); - USB_UHCI_PRINTF("Interrupt Pin = %ld\n",temp); - pci_read_config_dword(busdevfunc,PCI_BASE_ADDRESS_4,&usb_base_addr); - USB_UHCI_PRINTF("IO Base Address = 0x%lx\n",usb_base_addr); - usb_base_addr&=0xFFFFFFF0; - usb_base_addr+=CONFIG_SYS_ISA_IO_BASE_ADDRESS; - rh.devnum = 0; - usb_init_skel(); - reset_hc(); - start_hc(); - irq_install_handler(irqvec, (interrupt_handler_t *)handle_usb_interrupt, NULL); - irq_install_handler(0, (interrupt_handler_t *)handle_usb_interrupt, NULL); - - return 0; -} - -/* stop uhci - */ -int usb_lowlevel_stop(void) -{ - if(irqvec == -1) - return 1; - irq_free_handler(irqvec); - irq_free_handler(0); - reset_hc(); - irqvec = -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 (usb_pipeint(pipe)) { - printf("Root-Hub submit IRQ: NOT implemented\n"); -#if 0 - uhci->rh.urb = urb; - uhci->rh.send = 1; - uhci->rh.interval = urb->interval; - rh_init_int_timer (urb); -#endif - 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(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(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(td->info); - printf(" MaxLen 0x%lX\n",((tmp>>21)&0x7FF)); - printf(" %s Endpoint 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(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++])); - } -} - - -#endif -#endif /* CONFIG_USB_UHCI */ - -/* EOF */ diff --git a/board/MAI/AmigaOneG3SE/usb_uhci.h b/board/MAI/AmigaOneG3SE/usb_uhci.h deleted file mode 100644 index 3387157..0000000 --- a/board/MAI/AmigaOneG3SE/usb_uhci.h +++ /dev/null @@ -1,192 +0,0 @@ -/* - * (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_ - -#undef USB_UHCI_VEND_ID -#define USB_UHCI_VEND_ID PCI_VENDOR_ID_VIA -#undef USB_UHCI_DEV_ID -#define USB_UHCI_DEV_ID 0x3038 - -/* 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_ */ diff --git a/board/MAI/AmigaOneG3SE/via686.c b/board/MAI/AmigaOneG3SE/via686.c deleted file mode 100644 index 752a464..0000000 --- a/board/MAI/AmigaOneG3SE/via686.c +++ /dev/null @@ -1,299 +0,0 @@ -/* - * (C) Copyright 2002 - * Hyperion Entertainment, Hans-JoergF@hyperion-entertainment.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 <pci.h> -#include <ata.h> -#include "memio.h" -#include "articiaS.h" -#include "via686.h" -#include "i8259.h" - -DECLARE_GLOBAL_DATA_PTR; - -#undef VIA_DEBUG - -#ifdef VIA_DEBUG -#define PRINTF(fmt,args...) printf (fmt ,##args) -#else -#define PRINTF(fmt,args...) -#endif - - -/* Setup the ISA-to-PCI host bridge */ -void via_isa_init(pci_dev_t dev, struct pci_config_table *table) -{ - char regval; - if (PCI_FUNC(dev) == 0) - { - PRINTF("... PCI-to-ISA bridge, dev=0x%X\n", dev); - - /* Enable I/O Recovery time */ - pci_write_config_byte(dev, 0x40, 0x08); - - /* Enable ISA refresh */ - pci_write_config_byte(dev, 0x41, 0x41); /* was 01 */ - - /* Enable ISA line buffer */ - pci_write_config_byte(dev, 0x45, 0x80); - - /* Gate INTR, and flush line buffer */ - pci_write_config_byte(dev, 0x46, 0x60); - - /* Enable EISA ports 4D0/4D1. Do we need this ? */ - pci_write_config_byte(dev, 0x47, 0xe6); /* was 20 */ - - /* 512 K PCI Decode */ - pci_write_config_byte(dev, 0x48, 0x01); - - /* Wait for PGNT before grant to ISA Master/DMA */ - /* ports 0-FF to SDBus */ - /* IRQ 14 and 15 for ide 0/1 */ - pci_write_config_byte(dev, 0x4a, 0x04); /* Was c4 */ - - /* Plug'n'Play */ - /* Parallel DRQ 3, Floppy DRQ 2 (default) */ - pci_write_config_byte(dev, 0x50, 0x0e); - - /* IRQ Routing for Floppy and Parallel port */ - /* IRQ 6 for floppy, IRQ 7 for parallel port */ - pci_write_config_byte(dev, 0x51, 0x76); - - /* IRQ Routing for serial ports (take IRQ 3 and 4) */ - pci_write_config_byte(dev, 0x52, 0x34); - - /* All IRQ's level triggered. */ - pci_write_config_byte(dev, 0x54, 0x00); - - /* PCI IRQ's all at IRQ 9 */ - pci_write_config_byte(dev, 0x55, 0x90); - pci_write_config_byte(dev, 0x56, 0x99); - pci_write_config_byte(dev, 0x57, 0x90); - - /* Enable Keyboard */ - pci_read_config_byte(dev, 0x5A, ®val); - regval |= 0x01; - pci_write_config_byte(dev, 0x5A, regval); - - pci_write_config_byte(dev, 0x80, 0); - pci_write_config_byte(dev, 0x85, 0x01); - -/* pci_write_config_byte(dev, 0x77, 0x00); */ - } -} - -/* - * Initialize PNP irq routing - */ - -void via_init_irq_routing(uint8 irq_map[]) -{ - char *s; - uint8 level_edge_bits = 0xf; - - /* Set irq routings */ - pci_write_cfg_byte(0, 7<<3, 0x55, irq_map[0]<<4); - pci_write_cfg_byte(0, 7<<3, 0x56, irq_map[1] | irq_map[2]<<4); - pci_write_cfg_byte(0, 7<<3, 0x57, irq_map[3]<<4); - - /* - * Gather level/edge bits - * Default is to assume level triggered - */ - - s = getenv("pci_irqa_select"); - if (s && strcmp(s, "level") == 0) - level_edge_bits &= ~0x01; - - s = getenv("pci_irqb_select"); - if (s && strcmp(s, "level") == 0) - level_edge_bits &= ~0x02; - - s = getenv("pci_irqc_select"); - if (s && strcmp(s, "level") == 0) - level_edge_bits &= ~0x04; - - s = getenv("pci_irqd_select"); - if (s && strcmp(s, "level") == 0) - level_edge_bits &= ~0x08; - - PRINTF("IRQ map\n"); - PRINTF("%d: %s\n", irq_map[0], level_edge_bits&0x1 ? "edge" : "level"); - PRINTF("%d: %s\n", irq_map[1], level_edge_bits&0x2 ? "edge" : "level"); - PRINTF("%d: %s\n", irq_map[2], level_edge_bits&0x4 ? "edge" : "level"); - PRINTF("%d: %s\n", irq_map[3], level_edge_bits&0x8 ? "edge" : "level"); - pci_write_cfg_byte(0, 7<<3, 0x54, level_edge_bits); - - PRINTF("%02x %02x %02x %02x\n", pci_read_cfg_byte(0, 7<<3, 0x54), - pci_read_cfg_byte(0, 7<<3, 0x55), pci_read_cfg_byte(0, 7<<3, 0x56), - pci_read_cfg_byte(0, 7<<3, 0x57)); -} - - -/* Setup the IDE controller. This doesn't seem to work yet. I/O to an IDE controller port */ -/* always return the last character output on the serial port (!) */ -/* This function is called by the pnp-library when it encounters 0:7:1 */ -void via_cfgfunc_ide_init(struct pci_controller *host, pci_dev_t dev, struct pci_config_table *table) -{ - PRINTF("... IDE controller, dev=0x%X\n", dev); - - /* Enable both IDE channels. */ - pci_write_config_byte(dev, 0x40, 0x03); - /* udelay(10000); */ - /* udelay(10000); */ - - /* Enable IO Space */ - pci_write_config_word(dev, 0x04, 0x03); - - /* Set to compatibility mode */ - pci_write_config_byte(dev, 0x09, 0x8A); /* WAS: 0x8f); */ - - /* Set to legacy interrupt mode */ - pci_write_config_byte(dev, 0x3d, 0x00); /* WAS: 0x01); */ - -} - - -/* Set the base address of the floppy controller to 0x3F0 */ -void via_fdc_init(pci_dev_t dev) -{ - unsigned char c; - /* Enable Configuration mode */ - pci_read_config_byte(dev, 0x85, &c); - c |= 0x02; - pci_write_config_byte(dev, 0x85, c); - - /* Set floppy controller port to 0x3F0. */ - SIO_WRITE_CONFIG(0xE3, (0x3F<<2)); - - /* Enable floppy controller */ - SIO_READ_CONFIG(0xE2, c); - c |= 0x10; - SIO_WRITE_CONFIG(0xE2, c); - - /* Switch of configuration mode */ - pci_read_config_byte(dev, 0x85, &c); - c &= ~0x02; - pci_write_config_byte(dev, 0x85, c); -} - -/* Init function 0 of the via southbridge. Called by the pnp-library */ -void via_cfgfunc_via686(struct pci_controller *host, pci_dev_t dev, struct pci_config_table *table) -{ - if (PCI_FUNC(dev) == 0) - { - /* FIXME: Try to generate a PCI reset */ - /* unsigned char c; */ - /* pci_read_config_byte(dev, 0x47, &c); */ - /* pci_write_config_byte(dev, 0x47, c | 0x01); */ - - via_isa_init(dev, table); - via_fdc_init(dev); - } -} - -__asm__ (" .globl via_calibrate_time_base \n" - "via_calibrate_time_base: \n" - " lis 9, 0xfe00 \n" - " li 0, 0x00 \n" - " mttbu 0 \n" - " mttbl 0 \n" - "ctb_loop: \n" - " lbz 0, 0x61(9) \n" - " eieio \n" - " andi. 0, 0, 0x20 \n" - " beq ctb_loop \n" - "ctb_done: \n" - " mftb 3 \n" - " blr"); - -extern unsigned long via_calibrate_time_base(void); - -void via_calibrate_bus_freq (void) -{ - unsigned long tb; - - /* This is 20 microseconds */ -#define CALIBRATE_TIME 28636 - - /* Enable the timer (and disable speaker) */ - unsigned char c; - - c = in_byte (0x61); - out_byte (0x61, ((c & ~0x02) | 0x01)); - - /* Set timer 2 to low/high writing */ - out_byte (0x43, 0xb0); - out_byte (0x42, CALIBRATE_TIME & 0xff); - out_byte (0x42, CALIBRATE_TIME >> 8); - - /* Read the time base */ - tb = via_calibrate_time_base (); - - if (tb >= 700000) - gd->bus_clk = 133333333; - else - gd->bus_clk = 100000000; - -} - - -void ide_led(uchar led, uchar status) -{ -/* unsigned char c = in_byte(0x92); */ - -/* if (!status) */ -/* out_byte(0x92, c | 0xC0); */ -/* else */ -/* out_byte(0x92, c & ~0xC0); */ -} - - -void via_init_afterscan(void) -{ - /* Modify IDE controller setup */ - pci_write_cfg_byte(0, 7<<3|1, PCI_LATENCY_TIMER, 0x20); - pci_write_cfg_byte(0, 7<<3|1, PCI_COMMAND, PCI_COMMAND_IO|PCI_COMMAND_MEMORY|PCI_COMMAND_MASTER); - pci_write_cfg_byte(0, 7<<3|1, PCI_INTERRUPT_LINE, 0xff); - pci_write_cfg_byte(0, 7<<3|1, 0x40, 0x0b); /* FIXME: Might depend on drives connected */ - pci_write_cfg_byte(0, 7<<3|1, 0x41, 0x42); /* FIXME: Might depend on drives connected */ - pci_write_cfg_byte(0, 7<<3|1, 0x43, 0x05); - pci_write_cfg_byte(0, 7<<3|1, 0x44, 0x18); - pci_write_cfg_byte(0, 7<<3|1, 0x45, 0x10); - pci_write_cfg_byte(0, 7<<3|1, 0x4e, 0x22); /* FIXME: Not documented, but set in PC bios */ - pci_write_cfg_byte(0, 7<<3|1, 0x4f, 0x20); /* FIXME: Not documented */ - - /* Modify some values in the USB controller */ - pci_write_cfg_byte(0, 7<<3|2, 0x05, 0x17); - pci_write_cfg_byte(0, 7<<3|2, 0x06, 0x01); - pci_write_cfg_byte(0, 7<<3|2, 0x41, 0x12); - pci_write_cfg_byte(0, 7<<3|2, 0x42, 0x03); - pci_write_cfg_byte(0, 7<<3|2, PCI_LATENCY_TIMER, 0x40); - - pci_write_cfg_byte(0, 7<<3|3, 0x05, 0x17); - pci_write_cfg_byte(0, 7<<3|3, 0x06, 0x01); - pci_write_cfg_byte(0, 7<<3|3, 0x41, 0x12); - pci_write_cfg_byte(0, 7<<3|3, 0x42, 0x03); - pci_write_cfg_byte(0, 7<<3|3, PCI_LATENCY_TIMER, 0x40); - - -} diff --git a/board/MAI/AmigaOneG3SE/via686.h b/board/MAI/AmigaOneG3SE/via686.h deleted file mode 100644 index 2a06a05..0000000 --- a/board/MAI/AmigaOneG3SE/via686.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef VIA686_H_ -#define VIA686_H_ - - -#define CMOS_ADDR 0x70 -#define CMOS_DATA 0x71 - -#define I8259_MASTER_CONTROL 0x20 -#define I8259_MASTER_MASK 0x21 - -#define I8259_SLAVE_CONTROL 0xA0 -#define I8259_SLAVE_MASK 0xA1 - -#define SIO_CONFIG_ADDR 0x3F0 -#define SIO_CONFIG_DATA 0x3F1 - -#define SIO_WRITE_CONFIG(addr, byte) \ - out_byte(SIO_CONFIG_ADDR, addr); \ - out_byte(SIO_CONFIG_DATA, byte); - -#define SIO_READ_CONFIG(addr, byte) \ - out_byte(SIO_CONFIG_ADDR, addr); \ - byte = in_byte(SIO_CONFIG_DATA); - -void via_init(void); - -void via_calibrate_bus_freq(void); - -#endif diff --git a/board/MAI/AmigaOneG3SE/video.c b/board/MAI/AmigaOneG3SE/video.c deleted file mode 100644 index e24e28b..0000000 --- a/board/MAI/AmigaOneG3SE/video.c +++ /dev/null @@ -1,541 +0,0 @@ -/* - * (C) Copyright 2002 - * Hyperion Entertainment, Hans-JoergF@hyperion-entertainment.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 <stdio_dev.h> -#include "memio.h" -#include <part.h> - -DECLARE_GLOBAL_DATA_PTR; - -unsigned char *cursor_position; -unsigned int cursor_row; -unsigned int cursor_col; - -unsigned char current_attr; - -unsigned int video_numrows = 25; -unsigned int video_numcols = 80; -unsigned int video_scrolls = 0; - -#define VIDEO_BASE (unsigned char *)0xFD0B8000 -#define VIDEO_ROWS video_numrows -#define VIDEO_COLS video_numcols -#define VIDEO_PITCH (2 * video_numcols) -#define VIDEO_SIZE (video_numrows * video_numcols * 2) -#define VIDEO_NAME "vga" - -void video_test(void); -void video_putc(char ch); -void video_puts(char *string); -void video_scroll(int rows); -void video_banner(void); -int video_init(void); -int video_start(void); -int video_rows(void); -int video_cols(void); - -char *prompt_string = "=>"; -unsigned char video_get_attr(void); - -void video_set_color(unsigned char attr) -{ - unsigned char *fb = (unsigned char *)VIDEO_BASE; - int i; - - current_attr = video_get_attr(); - - for (i=0; i<VIDEO_SIZE; i+=2) - { - *(fb+i+1) = current_attr; - } -} - -unsigned char video_get_attr(void) -{ - char *s; - unsigned char attr; - - attr = 0x0f; - - s = getenv("vga_fg_color"); - if (s) - { - attr = atoi(s); - } - - s = getenv("vga_bg_color"); - if (s) - { - attr |= atoi(s)<<4; - } - - return attr; -} - -int video_inited = 0; - -int drv_video_init(void) -{ - int error, devices = 1 ; - struct stdio_dev vgadev ; - if (video_inited) return 1; - video_inited = 1; - video_init(); - memset (&vgadev, 0, sizeof(vgadev)); - - strcpy(vgadev.name, VIDEO_NAME); - vgadev.flags = DEV_FLAGS_OUTPUT | DEV_FLAGS_SYSTEM; - vgadev.putc = video_putc; - vgadev.puts = video_puts; - vgadev.getc = NULL; - vgadev.tstc = NULL; - vgadev.start = video_start; - - error = stdio_register (&vgadev); - - if (error == 0) - { - char *s = getenv("stdout"); - if (s && strcmp(s, VIDEO_NAME)==0) - { - if (overwrite_console()) return 1; - error = console_assign(stdout, VIDEO_NAME); - if (error == 0) return 1; - else return error; - } - return 1; - } - - return error; -} - -int video_init(void) -{ - cursor_position = VIDEO_BASE; /* Color text display base */ - cursor_row = 0; - cursor_col = 0; - current_attr = video_get_attr(); /* Currently selected value for attribute. */ -/* video_test(); */ - video_set_color(current_attr); - - return 0; -} - -void video_set_cursor(int line, int column) -{ - unsigned short offset = line*video_numcols + column; - cursor_position = VIDEO_BASE + line*VIDEO_PITCH + column*2; - out_byte(0x3D4, 0x0E); - out_byte(0x3D5, offset/256); - out_byte(0x3D4, 0x0F); - out_byte(0x3D5, offset%256); -} - -void video_write_char(int character) -{ - *cursor_position = character; - *(cursor_position+1) = current_attr; -} - -void video_test(void) -{ - -} - -void video_putc(char ch) -{ - switch(ch) - { - case '\n': - cursor_col = 0; - cursor_row += 1; - break; - case '\r': - cursor_col = 0; - break; - case '\b': - if (cursor_col) cursor_col--; - else return; - break; - case '\t': - cursor_col = (cursor_col/8+1)*8; - break; - default: - video_write_char(ch); - cursor_col++; - if (cursor_col > VIDEO_COLS-1) - { - cursor_row++; - cursor_col=0; - } - } - - if (cursor_row > VIDEO_ROWS-1) - video_scroll(1); - video_set_cursor(cursor_row, cursor_col); -} - -void video_scroll(int rows) -{ - unsigned short clear = ((unsigned short)current_attr) | (' '<<8); - unsigned short* addr16 = &((unsigned short *)VIDEO_BASE)[(VIDEO_ROWS-rows)*VIDEO_COLS]; - int i; - char *s; - - s = getenv("vga_askscroll"); - video_scrolls += rows; - - if (video_scrolls >= video_numrows) - { - if (s && strcmp(s, "yes")) - { - while (-1 == tstc()); - } - - video_scrolls = 0; - } - - - memcpy(VIDEO_BASE, VIDEO_BASE+rows*(VIDEO_COLS*2), (VIDEO_ROWS-rows)*(VIDEO_COLS*2)); - for (i = 0 ; i < rows * VIDEO_COLS ; i++) - addr16[i] = clear; - cursor_row-=rows; - cursor_col=0; -} - -void video_puts(char *string) -{ - while (*string) - { - video_putc(*string); - string++; - } -} - -int video_start(void) -{ - return 0; -} - -unsigned char video_single_box[] = -{ - 218, 196, 191, - 179, 179, - 192, 196, 217 -}; - -unsigned char video_double_box[] = -{ - 201, 205, 187, - 186, 186, - 200, 205, 188 -}; - -unsigned char video_single_title[] = -{ - 195, 196, 180, 180, 195 -}; - -unsigned char video_double_title[] = -{ - 204, 205, 185, 181, 198 -}; - -#define SINGLE_BOX 0 -#define DOUBLE_BOX 1 - -unsigned char *video_addr(int x, int y) -{ - return VIDEO_BASE + 2*(VIDEO_COLS*y) + 2*x; -} - -void video_bios_print_string(char *s, int x, int y, int attr, int count) -{ - int cattr = current_attr; - if (attr != -1) current_attr = attr; - video_set_cursor(x,y); - while (count) - { - char c = *s++; - if (attr == -1) current_attr = *s++; - video_putc(c); - count--; - } -} - -void video_draw_box(int style, int attr, char *title, int separate, int x, int y, int w, int h) -{ - unsigned char *fb, *fb2; - unsigned char *st = (style == SINGLE_BOX)?video_single_box : video_double_box; - unsigned char *ti = (style == SINGLE_BOX)?video_single_title : video_double_title; - int i; - - fb = video_addr(x,y); - *(fb) = st[0]; - *(fb+1) = attr; - fb += 2; - - fb2 = video_addr(x,y+h-1); - *(fb2) = st[5]; - *(fb2+1) = attr; - fb2 += 2; - - for (i=0; i<w-2;i++) - { - *fb = st[1]; - fb++; - *fb = attr; - fb++; - - *fb2 = st[6]; - fb2++; - *fb2 = attr; - fb2++; - - } - *fb = st[2]; - *(fb+1) = attr; - - *fb2 = st[7]; - *(fb2+1) = attr; - - fb = video_addr(x, y+1); - fb2 = video_addr(x+w-1, y+1); - for (i=0; i<h-2; i++) - { - *fb = st[3]; - *(fb+1) = attr; fb += 2*VIDEO_COLS; - - *fb2 = st[4]; - *(fb2+1) = attr; fb2 += 2*VIDEO_COLS; - } - - /* Draw title */ - if (title) - { - if (separate == 0) - { - fb = video_addr(x+1, y); - *fb = ti[3]; - fb += 2; - *fb = ' '; - fb += 2; - while (*title) - { - *fb = *title; - fb ++; - *fb = attr; - fb++; title++; - } - *fb = ' '; - fb += 2; - *fb = ti[4]; - } - else - { - fb = video_addr(x, y+2); - *fb = ti[0]; - fb += 2; - for (i=0; i<w-2; i++) - { - *fb = ti[1]; - *(fb+1) = attr; - fb += 2; - } - *fb = ti[2]; - *(fb+1) = attr; - fb = video_addr(x+1, y+1); - for (i=0; i<w-2; i++) - { - *fb = ' '; - *(fb+1) = attr; - fb += 2; - } - fb = video_addr(x+2, y+1); - - while (*title) - { - *fb = *title; - *(fb+1) = attr; - fb += 2; - title++; - } - } - } - -} - -void video_draw_text(int x, int y, int attr, char *text) -{ - unsigned char *fb = video_addr(x,y); - while (*text) - { - *fb++ = *text++; - *fb++ = attr; - } -} - -void video_save_rect(int x, int y, int w, int h, void *save_area, int clearchar, int clearattr) -{ - unsigned char *save = (unsigned char *)save_area; - unsigned char *fb = video_addr(x,y); - int i,j; - for (i=0; i<h; i++) - { - unsigned char *fbb = fb; - for (j=0; j<w; j++) - { - *save ++ = *fb; - if (clearchar > 0) *fb = clearchar; - fb ++; - *save ++ = *fb; - if (clearattr > 0) *fb = clearattr; - } - fb = fbb + 2*VIDEO_COLS; - } -} - -void video_restore_rect(int x, int y, int w, int h, void *save_area) -{ - unsigned char *save = (unsigned char *)save_area; - unsigned char *fb = video_addr(x,y); - int i,j; - for (i=0; i<h; i++) - { - unsigned char *fbb = fb; - for (j=0; j<w; j++) - { - *fb ++ = *save ++; - *fb ++ = *save ++; - } - fb = fbb + 2*VIDEO_COLS; - } - -} - -int video_rows(void) -{ - return VIDEO_ROWS; -} - -int video_cols(void) -{ - return VIDEO_COLS; -} - -void video_size(int cols, int rows) -{ - video_numrows = rows; - video_numcols = cols; -} - -void video_clear(void) -{ - unsigned short *fbb = (unsigned short *)0xFD0B8000; - int i,j; - unsigned short val = 0x2000 | current_attr; - - for (i=0; i<video_rows(); i++) - { - for (j=0; j<video_cols(); j++) - { - *fbb++ = val; - } - } - video_set_cursor(0,0); - cursor_row = 0; - cursor_col = 0; -} - -#ifdef EASTEREGG -int video_easteregg_active = 0; - -void video_easteregg(void) -{ - video_easteregg_active = 1; -} -#endif - -extern block_dev_desc_t * ide_get_dev(int dev); -extern char version_string[]; - -void video_banner(void) -{ - block_dev_desc_t *ide; - int i; - char *s; - int maxdev; - - - if (video_inited == 0) return; -#ifdef EASTEREGG - if (video_easteregg_active) - { - prompt_string=""; - video_clear(); - printf("\n"); - printf(" **** COMMODORE 64 BASIC X2 ****\n\n"); - printf(" 64K RAM SYSTEM 38911 BASIC BYTES FREE\n\n"); - printf("READY\n"); - } - else - { -#endif - s = getenv("ide_maxbus"); - if (s) - maxdev = atoi(s) * 2; - else - maxdev = 4; - - s = getenv("stdout"); - if (s && strcmp(s, "serial") == 0) - return; - - video_clear(); - printf("%s\n\nCPU: ", version_string); - checkcpu(); - printf("DRAM: %ld MB\n", gd->bd->bi_memsize/(1024*1024)); - printf("FSB: %ld MHz\n", gd->bd->bi_busfreq/1000000); - - printf("\n---- Disk summary ----\n"); - for (i = 0; i < maxdev; i++) - { - ide = ide_get_dev(i); - printf("Device %d: ", i); - dev_print(ide); - } - -/* - video_draw_box(SINGLE_BOX, 0x0F, "Test 1", 0, 0,18, 72, 4); - video_draw_box(DOUBLE_BOX, 0x0F, "Test 2", 1, 4,10, 50, 6); - video_draw_box(DOUBLE_BOX, 0x0F, "Test 3", 0, 40, 3, 20, 5); - - video_draw_text(1, 4, 0x2F, "Highlighted options"); - video_draw_text(1, 5, 0x0F, "Non-selected option"); - video_draw_text(1, 6, 0x07, "disabled option"); -*/ -#ifdef EASTEREGG - } -#endif -} diff --git a/board/MAI/menu/cmd_menu.c b/board/MAI/menu/cmd_menu.c deleted file mode 100644 index 2b97d23..0000000 --- a/board/MAI/menu/cmd_menu.c +++ /dev/null @@ -1,16 +0,0 @@ -#include <common.h> -#include <command.h> - -int do_menu( cmd_tbl_t *cmdtp, /*bd_t *bd,*/ int flag, int argc, char *argv[] ) -{ -/* printf("<NOT YET IMPLEMENTED>\n"); */ - return 0; -} - -#if defined(CONFIG_AMIGAONEG3SE) && defined(CONFIG_CMD_BSP) -U_BOOT_CMD( - menu, 1, 1, do_menu, - "display BIOS setup menu", - "" -); -#endif diff --git a/board/Marvell/db64360/sdram_init.c b/board/Marvell/db64360/sdram_init.c index d0817d7..d52d3f0 100644 --- a/board/Marvell/db64360/sdram_init.c +++ b/board/Marvell/db64360/sdram_init.c @@ -1290,37 +1290,37 @@ int setup_sdram (AUX_MEM_DIMM_INFO * info) case 0x0: case 0x80: /* refresh period is 15.625 usec */ sdram_config_reg = - (unsigned int) (((float) 15.625 * (float) CONFIG_SYS_BUS_HZ) + (unsigned int) (((float) 15.625 * (float) CONFIG_SYS_BUS_CLK) / (float) 1000000.0); break; case 0x1: case 0x81: /* refresh period is 3.9 usec */ sdram_config_reg = - (unsigned int) (((float) 3.9 * (float) CONFIG_SYS_BUS_HZ) / + (unsigned int) (((float) 3.9 * (float) CONFIG_SYS_BUS_CLK) / (float) 1000000.0); break; case 0x2: case 0x82: /* refresh period is 7.8 usec */ sdram_config_reg = - (unsigned int) (((float) 7.8 * (float) CONFIG_SYS_BUS_HZ) / + (unsigned int) (((float) 7.8 * (float) CONFIG_SYS_BUS_CLK) / (float) 1000000.0); break; case 0x3: case 0x83: /* refresh period is 31.3 usec */ sdram_config_reg = - (unsigned int) (((float) 31.3 * (float) CONFIG_SYS_BUS_HZ) / + (unsigned int) (((float) 31.3 * (float) CONFIG_SYS_BUS_CLK) / (float) 1000000.0); break; case 0x4: case 0x84: /* refresh period is 62.5 usec */ sdram_config_reg = - (unsigned int) (((float) 62.5 * (float) CONFIG_SYS_BUS_HZ) / + (unsigned int) (((float) 62.5 * (float) CONFIG_SYS_BUS_CLK) / (float) 1000000.0); break; case 0x5: case 0x85: /* refresh period is 125 usec */ sdram_config_reg = - (unsigned int) (((float) 125 * (float) CONFIG_SYS_BUS_HZ) / + (unsigned int) (((float) 125 * (float) CONFIG_SYS_BUS_CLK) / (float) 1000000.0); break; default: /* refresh period undefined */ diff --git a/board/Marvell/db64460/sdram_init.c b/board/Marvell/db64460/sdram_init.c index 6d6b126..e328d8f 100644 --- a/board/Marvell/db64460/sdram_init.c +++ b/board/Marvell/db64460/sdram_init.c @@ -1289,37 +1289,37 @@ int setup_sdram (AUX_MEM_DIMM_INFO * info) case 0x0: case 0x80: /* refresh period is 15.625 usec */ sdram_config_reg = - (unsigned int) (((float) 15.625 * (float) CONFIG_SYS_BUS_HZ) + (unsigned int) (((float) 15.625 * (float) CONFIG_SYS_BUS_CLK) / (float) 1000000.0); break; case 0x1: case 0x81: /* refresh period is 3.9 usec */ sdram_config_reg = - (unsigned int) (((float) 3.9 * (float) CONFIG_SYS_BUS_HZ) / + (unsigned int) (((float) 3.9 * (float) CONFIG_SYS_BUS_CLK) / (float) 1000000.0); break; case 0x2: case 0x82: /* refresh period is 7.8 usec */ sdram_config_reg = - (unsigned int) (((float) 7.8 * (float) CONFIG_SYS_BUS_HZ) / + (unsigned int) (((float) 7.8 * (float) CONFIG_SYS_BUS_CLK) / (float) 1000000.0); break; case 0x3: case 0x83: /* refresh period is 31.3 usec */ sdram_config_reg = - (unsigned int) (((float) 31.3 * (float) CONFIG_SYS_BUS_HZ) / + (unsigned int) (((float) 31.3 * (float) CONFIG_SYS_BUS_CLK) / (float) 1000000.0); break; case 0x4: case 0x84: /* refresh period is 62.5 usec */ sdram_config_reg = - (unsigned int) (((float) 62.5 * (float) CONFIG_SYS_BUS_HZ) / + (unsigned int) (((float) 62.5 * (float) CONFIG_SYS_BUS_CLK) / (float) 1000000.0); break; case 0x5: case 0x85: /* refresh period is 125 usec */ sdram_config_reg = - (unsigned int) (((float) 125 * (float) CONFIG_SYS_BUS_HZ) / + (unsigned int) (((float) 125 * (float) CONFIG_SYS_BUS_CLK) / (float) 1000000.0); break; default: /* refresh period undefined */ diff --git a/board/atmel/atstk1000/config.mk b/board/atmel/atstk1000/config.mk index ec3618d..40e55fe 100644 --- a/board/atmel/atstk1000/config.mk +++ b/board/atmel/atstk1000/config.mk @@ -1,4 +1,4 @@ PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections PLATFORM_LDFLAGS += --gc-sections TEXT_BASE = 0x00000000 -LDSCRIPT = $(obj)board/atmel/atstk1000/u-boot.lds +LDSCRIPT = $(src)board/atmel/atstk1000/u-boot.lds diff --git a/board/earthlcd/favr-32-ezkit/config.mk b/board/earthlcd/favr-32-ezkit/config.mk index 2337d62..5c919cd 100644 --- a/board/earthlcd/favr-32-ezkit/config.mk +++ b/board/earthlcd/favr-32-ezkit/config.mk @@ -1,4 +1,4 @@ PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections PLATFORM_LDFLAGS += --gc-sections TEXT_BASE = 0x00000000 -LDSCRIPT = $(obj)board/earthlcd/favr-32-ezkit/u-boot.lds +LDSCRIPT = $(src)board/earthlcd/favr-32-ezkit/u-boot.lds diff --git a/board/evb64260/mpsc.c b/board/evb64260/mpsc.c index 3164967..f3dc20b 100644 --- a/board/evb64260/mpsc.c +++ b/board/evb64260/mpsc.c @@ -390,7 +390,7 @@ galbrg_set_baudrate(int channel, int rate) #if defined(CONFIG_ZUMA_V2) || defined(CONFIG_P3G4) /* from tclk */ - clock = (CONFIG_SYS_BUS_HZ/(16*rate)) - 1; + clock = (CONFIG_SYS_BUS_CLK/(16*rate)) - 1; #else clock = (3686400/(16*rate)) - 1; #endif diff --git a/board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c b/board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c index 94fb1eb..a7b7f45 100644 --- a/board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c +++ b/board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c @@ -183,15 +183,6 @@ void *video_hw_init(void) return (void *)pGD; } -void video_set_lut (unsigned int index, /* color number */ - unsigned char r, /* red */ - unsigned char g, /* green */ - unsigned char b /* blue */ - ) -{ - return; -} - #endif /* defined(CONFIG_VIDEO) || defined(CONFIG_CFB_CONSOLE) */ #endif /* CONFIG_FSL_DIU_FB */ diff --git a/board/mosaixtech/icon/icon.c b/board/mosaixtech/icon/icon.c index fbace9e..ecea1ee 100644 --- a/board/mosaixtech/icon/icon.c +++ b/board/mosaixtech/icon/icon.c @@ -317,3 +317,72 @@ int board_pcie_last(void) /* Only 2 PCIe ports used on ICON, so the last one is 1 */ return 1; } + +/* + * Video + */ +#ifdef CONFIG_VIDEO_SM501 +#include <sm501.h> + +#define DISPLAY_WIDTH 640 +#define DISPLAY_HEIGHT 480 + +static const SMI_REGS sm502_init_regs[] = { + {0x00004, 0x0}, + {0x00040, 0x00021847}, + {0x00044, 0x091a0a01}, /* 24 MHz pixclk */ + {0x00054, 0x0}, + {0x00048, 0x00021847}, + {0x0004C, 0x091a0a01}, + {0x00054, 0x1}, + {0x80004, 0xc428bb17}, + {0x8000C, 0x00000000}, + {0x80010, 0x0a000a00}, + {0x80014, 0x02800000}, + {0x80018, 0x01e00000}, + {0x8001C, 0x00000000}, + {0x80020, 0x01e00280}, + {0x80024, 0x02fa027f}, + {0x80028, 0x004a0280}, + {0x8002C, 0x020c01df}, + {0x80030, 0x000201e7}, + {0x80200, 0x00010000}, + {0x00008, 0x20000000}, /* gpio29 is pwm0, LED_PWM */ + {0x0000C, 0x3f000000}, /* gpio56 - gpio61 as flat panel data pins */ + {0x10020, 0x25725728}, /* 20 kHz pwm0, 50 % duty cycle, disabled */ + {0x80000, 0x0f010106}, /* vsync & hsync pos, disp on */ + {0, 0} +}; + +/* + * Return a pointer to the register initialization table. + */ +const SMI_REGS *board_get_regs(void) +{ + return sm502_init_regs; +} + +int board_get_width(void) +{ + return DISPLAY_WIDTH; +} + +int board_get_height(void) +{ + return DISPLAY_HEIGHT; +} + +#ifdef CONFIG_CONSOLE_EXTRA_INFO +/* + * Return text to be printed besides the logo. + */ +void video_get_info_str(int line_number, char *info) +{ + if (line_number == 1) + strcpy(info, " Board: ICON"); + else + info[0] = '\0'; +} +#endif + +#endif /* CONFIG_VIDEO_SM501 */ diff --git a/boards.cfg b/boards.cfg new file mode 100644 index 0000000..1a5cfb1 --- /dev/null +++ b/boards.cfg @@ -0,0 +1,367 @@ +# +# List of boards +# +# Syntax: +# white-space separated list of entries; +# each entry has the following fields: +# +# Targetname Architecture CPU Boardname Vendor SoC +# +# Unused fields can be specified as "-", or omitted if they +# are the last field on the line. +# +# Lines starting with '#' are comments. +# Blank lines are ignored. +# +# To keep the list sorted, use something like +# +# :.,$! sort -f -k2,2 -k3,3 -k6,6 -k5,5 -k1,1 +# +# Target ARCH CPU Board name Vendor SoC +########################################################################### + +qong arm arm1136 - davedenx mx31 +mx31ads arm arm1136 - freescale mx31 +ep7312 arm arm720t +impa7 arm arm720t +SMN42 arm arm720t - siemens lpc2292 +evb4510 arm arm720t - - s3c4510b +a320evb arm arm920t - faraday a320 +cmc_pu2 arm arm920t - - at91rm9200 +csb637 arm arm920t - - at91rm9200 +kb9202 arm arm920t - - at91rm9200 +m501sk arm arm920t - - at91rm9200 +mp2usb arm arm920t - - at91rm9200 +mx1ads arm arm920t - - imx +mx1fs2 arm arm920t - - imx +scb9328 arm arm920t - - imx +cm4008 arm arm920t - - ks8695 +cm41xx arm arm920t - - ks8695 +VCMA9 arm arm920t vcma9 mpl s3c24x0 +netstar arm arm925t +meesc arm arm926ejs - esd at91 +otc570 arm arm926ejs - esd at91 +pm9261 arm arm926ejs - ronetix at91 +pm9263 arm arm926ejs - ronetix at91 +suen3 arm arm926ejs km_arm keymile kirkwood +rd6281a arm arm926ejs - Marvell kirkwood +mx51evk arm arm_cortexa8 mx51evk freescale mx51 +actux1 arm ixp +actux2 arm ixp +actux3 arm ixp +actux4 arm ixp +ixdp425 arm ixp +cerf250 arm pxa +cradle arm pxa +csb226 arm pxa +delta arm pxa +innokom arm pxa +logodl arm pxa +lubbock arm pxa +pleb2 arm pxa +xaeniax arm pxa +xm250 arm pxa +B2 arm s3c44b0 - dave +assabet arm sa1100 +dnp1110 arm sa1100 +gcplus arm sa1100 +lart arm sa1100 +shannon arm sa1100 +mimc200 avr32 at32ap - mimc at32ap700x +eNET i386 i386 - - sc520 +idmr m68k mcf52x2 +TASREG m68k mcf52x2 tasreg esd +M5272C3 m68k mcf52x2 m5272c3 freescale +EP2500 m68k mcf52x2 ep2500 Mercury +purple mips mips +tb0229 mips mips +EP1C20 nios2 nios2 ep1c20 altera +EP1S10 nios2 nios2 ep1s10 altera +EP1S40 nios2 nios2 ep1s40 altera +PCI5441 nios2 nios2 pci5441 psyent +PK1C20 nios2 nios2 pk1c20 psyent +P3G4 powerpc 74xx_7xx evb64260 +ppmc7xx powerpc 74xx_7xx +ZUMA powerpc 74xx_7xx evb64260 +BAB7xx powerpc 74xx_7xx bab7xx eltec +ELPPC powerpc 74xx_7xx elppc eltec +CPCI750 powerpc 74xx_7xx cpci750 esd +DB64360 powerpc 74xx_7xx db64360 Marvell +DB64460 powerpc 74xx_7xx db64460 Marvell +aria powerpc mpc512x - davedenx +PATI powerpc mpc5xx pati mpl +BC3450 powerpc mpc5xxx bc3450 +canmb powerpc mpc5xxx +cm5200 powerpc mpc5xxx +hmi1001 powerpc mpc5xxx +inka4x0 powerpc mpc5xxx +ipek01 powerpc mpc5xxx +jupiter powerpc mpc5xxx +mucmc52 powerpc mpc5xxx +munices powerpc mpc5xxx +o2dnt powerpc mpc5xxx +uc101 powerpc mpc5xxx +v38b powerpc mpc5xxx +pf5200 powerpc mpc5xxx - esd +aev powerpc mpc5xxx tqm5200 tqc +smmaco4 powerpc mpc5xxx tqm5200 tqc +spieval powerpc mpc5xxx tqm5200 tqc +sorcery powerpc mpc8220 +A3000 powerpc mpc824x a3000 +barco powerpc mpc824x +BMW powerpc mpc824x bmw +CU824 powerpc mpc824x cu824 +MOUSSE powerpc mpc824x mousse +MUSENKI powerpc mpc824x musenki +MVBLUE powerpc mpc824x mvblue +OXC powerpc mpc824x oxc +PN62 powerpc mpc824x pn62 +sbc8240 powerpc mpc824x +utx8245 powerpc mpc824x +debris powerpc mpc824x - etin +kvme080 powerpc mpc824x - etin +atc powerpc mpc8260 +ep8260 powerpc mpc8260 +ep82xxm powerpc mpc8260 +gw8260 powerpc mpc8260 +hymod powerpc mpc8260 +IDS8247 powerpc mpc8260 ids8247 +sacsng powerpc mpc8260 +sbc8260 powerpc mpc8260 +ZPC1900 powerpc mpc8260 zpc1900 +mgcoge powerpc mpc8260 - keymile +SCM powerpc mpc8260 - siemens +TQM8272 powerpc mpc8260 tqm8272 tqc +kmeter1 powerpc mpc83xx kmeter1 keymile +MVBLM7 powerpc mpc83xx mvblm7 matrix_vision +TQM834x powerpc mpc83xx tqm834x tqc +PM854 powerpc mpc85xx pm854 +PM856 powerpc mpc85xx pm856 +stxgp3 powerpc mpc85xx stxgp3 stx +c2mon powerpc mpc8xx +EP88x powerpc mpc8xx ep88x +ETX094 powerpc mpc8xx etx094 +FLAGADM powerpc mpc8xx flagadm +GENIETV powerpc mpc8xx genietv +GTH powerpc mpc8xx gth +hermes powerpc mpc8xx +IP860 powerpc mpc8xx ip860 +LANTEC powerpc mpc8xx lantec +lwmon powerpc mpc8xx +NX823 powerpc mpc8xx nx823 +quantum powerpc mpc8xx +R360MPI powerpc mpc8xx r360mpi +RBC823 powerpc mpc8xx rbc823 +rmu powerpc mpc8xx +RPXlite powerpc mpc8xx +spc1920 powerpc mpc8xx +uc100 powerpc mpc8xx +MHPC powerpc mpc8xx mhpc eltec +TOP860 powerpc mpc8xx top860 emk +kmsupx4 powerpc mpc8xx km8xx keymile +mgsuvd powerpc mpc8xx km8xx keymile +KUP4K powerpc mpc8xx kup4k kup +KUP4X powerpc mpc8xx kup4k kup +ELPT860 powerpc mpc8xx elpt860 LEOX +CCM powerpc mpc8xx - siemens +IAD210 powerpc mpc8xx - siemens +pcu_e powerpc mpc8xx - siemens +QS823 powerpc mpc8xx qs850 snmc +QS850 powerpc mpc8xx qs850 snmc +QS860T powerpc mpc8xx qs860t snmc +stxxtc powerpc mpc8xx stxxtc stx +HMI10 powerpc mpc8xx tqm8xx tqc +SM850 powerpc mpc8xx tqm8xx tqc +AMX860 powerpc mpc8xx amx860 westel +csb272 powerpc ppc4xx +csb472 powerpc ppc4xx +ERIC powerpc ppc4xx eric +G2000 powerpc ppc4xx g2000 +JSE powerpc ppc4xx jse +korat powerpc ppc4xx +lwmon5 powerpc ppc4xx +ML2 powerpc ppc4xx +sbc405 powerpc ppc4xx +sc3 powerpc ppc4xx +zeus powerpc ppc4xx +acadia powerpc ppc4xx - amcc +bamboo powerpc ppc4xx - amcc +bubinga powerpc ppc4xx - amcc +ebony powerpc ppc4xx - amcc +katmai powerpc ppc4xx - amcc +luan powerpc ppc4xx - amcc +makalu powerpc ppc4xx - amcc +ocotea powerpc ppc4xx - amcc +redwood powerpc ppc4xx - amcc +taihu powerpc ppc4xx - amcc +taishan powerpc ppc4xx - amcc +yucca powerpc ppc4xx - amcc +AP1000 powerpc ppc4xx ap1000 amirix +CRAYL1 powerpc ppc4xx L1 cray +ADCIOP powerpc ppc4xx adciop esd +APC405 powerpc ppc4xx apc405 esd +AR405 powerpc ppc4xx ar405 esd +ASH405 powerpc ppc4xx ash405 esd +CANBT powerpc ppc4xx canbt esd +CMS700 powerpc ppc4xx cms700 esd +CPCI2DP powerpc ppc4xx cpci2dp esd +DP405 powerpc ppc4xx dp405 esd +DU405 powerpc ppc4xx du405 esd +DU440 powerpc ppc4xx du440 esd +HH405 powerpc ppc4xx hh405 esd +HUB405 powerpc ppc4xx hub405 esd +PCI405 powerpc ppc4xx pci405 esd +PLU405 powerpc ppc4xx plu405 esd +PMC405 powerpc ppc4xx pmc405 esd +PMC440 powerpc ppc4xx pmc440 esd +VOH405 powerpc ppc4xx voh405 esd +VOM405 powerpc ppc4xx vom405 esd +WUH405 powerpc ppc4xx wuh405 esd +neo powerpc ppc4xx - gdsys +icon powerpc ppc4xx - mosaixtech +MIP405 powerpc ppc4xx mip405 mpl +PIP405 powerpc ppc4xx pip405 mpl +alpr powerpc ppc4xx - prodrive +p3p440 powerpc ppc4xx - prodrive +KAREF powerpc ppc4xx karef sandburst +grsim sparc leon3 - gaisler +imx31_litekit arm arm1136 - logicpd mx31 +omap2420h4 arm arm1136 - ti omap24xx +tnetv107x_evm arm arm1176 tnetv107xevm ti tnetv107x +armadillo arm arm720t +modnet50 arm arm720t +lpc2292sodimm arm arm720t - - lpc2292 +eb_cpux9k2 arm arm920t - BuS at91 +at91rm9200dk arm arm920t - atmel at91rm9200 +at91rm9200ek arm arm920t - atmel at91rm9200 +sbc2410x arm arm920t - - s3c24x0 +smdk2400 arm arm920t - samsung s3c24x0 +smdk2410 arm arm920t - samsung s3c24x0 +voiceblue arm arm925t +omap1510inn arm arm925t - ti +afeb9260 arm arm926ejs - - at91 +at91cap9adk arm arm926ejs - atmel at91 +davinci_dvevm arm arm926ejs dvevm davinci davinci +davinci_sffsdr arm arm926ejs sffsdr davinci davinci +davinci_sonata arm arm926ejs sonata davinci davinci +da830evm arm arm926ejs da8xxevm davinci davinci +da850evm arm arm926ejs da8xxevm davinci davinci +guruplug arm arm926ejs - Marvell kirkwood +mv88f6281gtw_ge arm arm926ejs - Marvell kirkwood +openrd_base arm arm926ejs - Marvell kirkwood +sheevaplug arm arm926ejs - Marvell kirkwood +imx27lite arm arm926ejs imx27lite logicpd mx27 +magnesium arm arm926ejs imx27lite logicpd mx27 +omap5912osk arm arm926ejs - ti omap +edminiv2 arm arm926ejs - LaCie orion5x +omap3_overo arm arm_cortexa8 overo - omap3 +omap3_pandora arm arm_cortexa8 pandora - omap3 +omap3_zoom1 arm arm_cortexa8 zoom1 logicpd omap3 +omap3_zoom2 arm arm_cortexa8 zoom2 logicpd omap3 +omap3_beagle arm arm_cortexa8 beagle ti omap3 +omap3_evm arm arm_cortexa8 evm ti omap3 +omap3_sdp3430 arm arm_cortexa8 sdp3430 ti omap3 +devkit8000 arm arm_cortexa8 devkit8000 timll omap3 +smdkc100 arm arm_cortexa8 smdkc100 samsung s5pc1xx +ixdpg425 arm ixp +lpd7a400 arm lh7a40x lpd7a40x +lpd7a404 arm lh7a40x lpd7a40x +pxa255_idp arm pxa +wepep250 arm pxa +xsengine arm pxa +zylonite arm pxa +atngw100 avr32 at32ap - atmel at32ap700x +atstk1002 avr32 at32ap atstk1000 atmel at32ap700x +atstk1003 avr32 at32ap atstk1000 atmel at32ap700x +atstk1004 avr32 at32ap atstk1000 atmel at32ap700x +atstk1006 avr32 at32ap atstk1000 atmel at32ap700x +favr-32-ezkit avr32 at32ap - earthlcd at32ap700x +hammerhead avr32 at32ap - miromico at32ap700x +bf518f-ezbrd blackfin blackfin +bf526-ezbrd blackfin blackfin +bf527-ezkit blackfin blackfin +bf533-ezkit blackfin blackfin +bf533-stamp blackfin blackfin +bf537-minotaur blackfin blackfin +bf537-pnav blackfin blackfin +bf537-srv1 blackfin blackfin +bf537-stamp blackfin blackfin +bf538f-ezkit blackfin blackfin +bf548-ezkit blackfin blackfin +bf561-acvilon blackfin blackfin +bf561-ezkit blackfin blackfin +blackstamp blackfin blackfin +cm-bf527 blackfin blackfin +cm-bf533 blackfin blackfin +cm-bf537e blackfin blackfin +cm-bf537u blackfin blackfin +cm-bf548 blackfin blackfin +cm-bf561 blackfin blackfin +ibf-dsp561 blackfin blackfin +ip04 blackfin blackfin +tcm-bf518 blackfin blackfin +tcm-bf537 blackfin blackfin +sc520_cdp i386 i386 - - sc520 +sc520_spunk i386 i386 - - sc520 +sc520_spunk_rel i386 i386 sc520_spunk_rel - sc520 +M5208EVBE m68k mcf52x2 m5208evbe freescale +M5249EVB m68k mcf52x2 m5249evb freescale +M5253DEMO m68k mcf52x2 m5253demo freescale +M5253EVBE m68k mcf52x2 m5253evbe freescale +M5271EVB m68k mcf52x2 m5271evb freescale +M5275EVB m68k mcf52x2 m5275evb freescale +M5282EVB m68k mcf52x2 m5282evb freescale +M53017EVB m68k mcf52x2 m53017evb freescale +microblaze-generic microblaze microblaze microblaze-generic xilinx +mpc7448hpc2 powerpc 74xx_7xx mpc7448hpc2 freescale +pdm360ng powerpc mpc512x +mecp5123 powerpc mpc512x - esd +cmi_mpc5xx powerpc mpc5xx cmi +motionpro powerpc mpc5xxx +cpci5200 powerpc mpc5xxx - esd +mecp5200 powerpc mpc5xxx - esd +Alaska8220 powerpc mpc8220 alaska +Yukon8220 powerpc mpc8220 alaska +HIDDEN_DRAGON powerpc mpc824x hidden_dragon +IPHASE4539 powerpc mpc8260 iphase4539 +ppmc8260 powerpc mpc8260 +RPXsuper powerpc mpc8260 rpxsuper +rsdproto powerpc mpc8260 +MPC8266ADS powerpc mpc8260 mpc8266ads freescale +MPC8323ERDB powerpc mpc83xx mpc8323erdb freescale +MPC8349EMDS powerpc mpc83xx mpc8349emds freescale +MPC837XERDB powerpc mpc83xx mpc837xerdb freescale +ATUM8548 powerpc mpc85xx atum8548 +socrates powerpc mpc85xx socrates +MPC8540ADS powerpc mpc85xx mpc8540ads freescale +MPC8544DS powerpc mpc85xx mpc8544ds freescale +MPC8560ADS powerpc mpc85xx mpc8560ads freescale +MPC8568MDS powerpc mpc85xx mpc8568mds freescale +XPEDITE5200 powerpc mpc85xx xpedite5200 xes +XPEDITE5370 powerpc mpc85xx xpedite5370 xes +sbc8641d powerpc mpc86xx +MPC8610HPCD powerpc mpc86xx mpc8610hpcd freescale +XPEDITE5170 powerpc mpc86xx xpedite5170 xes +cogent_mpc8xx powerpc mpc8xx cogent +ESTEEM192E powerpc mpc8xx esteem192e +RPXClassic powerpc mpc8xx +RRvision powerpc mpc8xx +svm_sc8xx powerpc mpc8xx +pcs440ep powerpc ppc4xx +quad100hd powerpc ppc4xx +dlvision powerpc ppc4xx - gdsys +gdppc440etx powerpc ppc4xx - gdsys +CPCIISER4 powerpc ppc4xx cpciiser4 esd +DASA_SIM powerpc ppc4xx dasa_sim esd +PMC405DE powerpc ppc4xx pmc405de esd +METROBOX powerpc ppc4xx metrobox sandburst +XPEDITE1000 powerpc ppc4xx xpedite1000 xes +grsim_leon2 sparc leon2 - gaisler +gr_cpci_ax2000 sparc leon3 - gaisler +gr_ep2s60 sparc leon3 - gaisler +gr_xc3s_1500 sparc leon3 - gaisler +davinci_dm355evm arm arm926ejs dm355evm davinci davinci +davinci_dm365evm arm arm926ejs dm365evm davinci davinci +davinci_dm6467evm arm arm926ejs dm6467evm davinci davinci +davinci_schmoogie arm arm926ejs schmoogie davinci davinci +davinci_dm355leopard arm arm926ejs dm355leopard davinci davinci diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index a0f7998..710abdf 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -37,8 +37,9 @@ static void print_eth(int idx); #ifndef CONFIG_ARM /* PowerPC and other */ static void print_lnum(const char *, u64); +#endif -#ifdef CONFIG_PPC +#if defined(CONFIG_PPC) static void print_str(const char *, const char *); int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) @@ -119,7 +120,7 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return 0; } -#elif defined(CONFIG_NIOS2) /* Nios-II */ +#elif defined(CONFIG_NIOS2) int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { @@ -145,7 +146,8 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return 0; } -#elif defined(CONFIG_MICROBLAZE) /* ! PPC, which leaves Microblaze */ + +#elif defined(CONFIG_MICROBLAZE) int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { @@ -167,7 +169,8 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return 0; } -#elif defined(CONFIG_SPARC) /* SPARC */ +#elif defined(CONFIG_SPARC) + int do_bdinfo(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) { bd_t *bd = gd->bd; @@ -199,7 +202,8 @@ int do_bdinfo(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) return 0; } -#elif defined(CONFIG_M68K) /* M68K */ +#elif defined(CONFIG_M68K) + static void print_str(const char *, const char *); int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) @@ -249,6 +253,7 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) } #elif defined(CONFIG_BLACKFIN) + static void print_str(const char *, const char *); int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) @@ -277,7 +282,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return 0; } -#else /* ! PPC, which leaves MIPS */ +#elif defined(CONFIG_MIPS) int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { @@ -296,9 +301,28 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return 0; } -#endif /* MIPS */ -#else /* ARM */ +#elif defined(CONFIG_AVR32) + +int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +{ + bd_t *bd = gd->bd; + + print_num ("boot_params", (ulong)bd->bi_boot_params); + print_num ("memstart", (ulong)bd->bi_memstart); + print_lnum ("memsize", (u64)bd->bi_memsize); + print_num ("flashstart", (ulong)bd->bi_flashstart); + print_num ("flashsize", (ulong)bd->bi_flashsize); + print_num ("flashoffset", (ulong)bd->bi_flashoffset); + + print_eth(0); + printf ("ip_addr = %pI4\n", &bd->bi_ip_addr); + printf ("baudrate = %lu bps\n", bd->bi_baudrate); + + return 0; +} + +#elif defined(CONFIG_ARM) int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { @@ -324,7 +348,9 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return 0; } -#endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */ +#else + #error "a case for this architecture does not exist!" +#endif static void print_num(const char *name, ulong value) { diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 8803202..74ff205 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -635,15 +635,6 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) usb_stop(); #endif -#ifdef CONFIG_AMIGAONEG3SE - /* - * We've possible left the caches enabled during - * bios emulation, so turn them off again - */ - icache_disable(); - dcache_disable(); -#endif - ret = bootm_load_os(images.os, &load_end, 1); if (ret < 0) { diff --git a/common/cmd_fdc.c b/common/cmd_fdc.c index 8e18c71..4c16d19 100644 --- a/common/cmd_fdc.c +++ b/common/cmd_fdc.c @@ -183,31 +183,6 @@ static FDC_COMMAND_STRUCT cmd; /* global command struct */ #define CONFIG_SYS_ISA_IO_OFFSET 0 #endif - -#ifdef CONFIG_AMIGAONEG3SE -unsigned char INT6_Status; - -void fdc_interrupt(void) -{ - INT6_Status = 0x80; -} - -/* waits for an interrupt (polling) */ -int wait_for_fdc_int(void) -{ - unsigned long timeout; - timeout = FDC_TIME_OUT; - while(((volatile)INT6_Status & 0x80) == 0) { - timeout--; - udelay(10); - if(timeout == 0) /* timeout occured */ - return FALSE; - } - INT6_Status = 0; - return TRUE; -} -#endif - /* Supporting Functions */ /* reads a Register of the FDC */ unsigned char read_fdc_reg(unsigned int addr) @@ -230,7 +205,6 @@ void write_fdc_reg(unsigned int addr, unsigned char val) tmp[0]=val; } -#ifndef CONFIG_AMIGAONEG3SE /* waits for an interrupt (polling) */ int wait_for_fdc_int(void) { @@ -245,8 +219,6 @@ int wait_for_fdc_int(void) return TRUE; } -#endif - /* reads a byte from the FIFO of the FDC and checks direction and RQM bit of the MSR. returns -1 if timeout, or byte if ok */ int read_fdc_byte(void) @@ -438,7 +410,6 @@ int fdc_seek(FDC_COMMAND_STRUCT *pCMD,FD_GEO_STRUCT *pFG) return(fdc_issue_cmd(pCMD,pFG)); } -#ifndef CONFIG_AMIGAONEG3SE /* terminates current command, by not servicing the FIFO * waits for interrupt and fills in the result bytes */ int fdc_terminate(FDC_COMMAND_STRUCT *pCMD) @@ -452,27 +423,6 @@ int fdc_terminate(FDC_COMMAND_STRUCT *pCMD) } return TRUE; } -#endif -#ifdef CONFIG_AMIGAONEG3SE -int fdc_terminate(FDC_COMMAND_STRUCT *pCMD) -{ - int i; - for(i=0;i<100;i++) - udelay(500); /* wait 500usec for fifo overrun */ - while((INT6_Status&0x80)==0x00); /* wait as long as no int has occured */ - for(i=0;i<7;i++) { - pCMD->result[i]=(unsigned char)read_fdc_byte(); - } - INT6_Status = 0; - return TRUE; -} - -#endif - -#ifdef CONFIG_AMIGAONEG3SE -#define disable_interrupts() 0 -#define enable_interrupts() (void)0 -#endif /* reads data from FDC, seek commands are issued automatic */ int fdc_read_data(unsigned char *buffer, unsigned long blocks,FDC_COMMAND_STRUCT *pCMD, FD_GEO_STRUCT *pFG) @@ -593,11 +543,6 @@ retrycal: return TRUE; } -#ifdef CONFIG_AMIGAONEG3SE -#undef disable_interrupts() -#undef enable_interrupts() -#endif - /* Scan all drives and check if drive is present and disk is inserted */ int fdc_check_drive(FDC_COMMAND_STRUCT *pCMD, FD_GEO_STRUCT *pFG) { @@ -647,11 +592,6 @@ int fdc_setup(int drive, FDC_COMMAND_STRUCT *pCMD, FD_GEO_STRUCT *pFG) { int i; -#ifdef CONFIG_AMIGAONEG3SE - irq_install_handler(6, (interrupt_handler_t *)fdc_interrupt, NULL); - i8259_unmask_irq(6); -#endif - #ifdef CONFIG_SYS_FDC_HW_INIT fdc_hw_init (); #endif diff --git a/common/cmd_ide.c b/common/cmd_ide.c index 093ca9f..8bd8920 100644 --- a/common/cmd_ide.c +++ b/common/cmd_ide.c @@ -119,31 +119,22 @@ ulong ide_bus_offset[CONFIG_SYS_IDE_MAXBUS] = { }; -#ifndef CONFIG_AMIGAONEG3SE static int ide_bus_ok[CONFIG_SYS_IDE_MAXBUS]; -#else -static int ide_bus_ok[CONFIG_SYS_IDE_MAXBUS] = {0,}; -#endif block_dev_desc_t ide_dev_desc[CONFIG_SYS_IDE_MAXDEVICE]; /* ------------------------------------------------------------------------- */ #ifdef CONFIG_IDE_LED -#if !defined(CONFIG_KUP4K) && !defined(CONFIG_KUP4X) &&!defined(CONFIG_BMS2003) &&!defined(CONFIG_CPC45) +# if !defined(CONFIG_BMS2003) && \ + !defined(CONFIG_CPC45) && \ + !defined(CONFIG_KUP4K) && \ + !defined(CONFIG_KUP4X) static void ide_led (uchar led, uchar status); #else extern void ide_led (uchar led, uchar status); #endif #else -#ifndef CONFIG_AMIGAONEG3SE #define ide_led(a,b) /* dummy */ -#else -extern void ide_led(uchar led, uchar status); -#define LED_IDE1 1 -#define LED_IDE2 2 -#define CONFIG_IDE_LED 1 -#define DEVICE_LED(x) 1 -#endif #endif #ifdef CONFIG_IDE_RESET @@ -562,13 +553,10 @@ void ide_init (void) #endif unsigned char c; int i, bus; -#if defined(CONFIG_AMIGAONEG3SE) || defined(CONFIG_SC3) +#if defined(CONFIG_SC3) unsigned int ata_reset_time = ATA_RESET_TIME; char *s; #endif -#ifdef CONFIG_AMIGAONEG3SE - unsigned int max_bus_scan; -#endif #ifdef CONFIG_IDE_8xx_PCCARD extern int pcmcia_on (void); extern int ide_devices_found; /* Initialized in check_ide_device() */ @@ -638,19 +626,8 @@ void ide_init (void) * Wait for IDE to get ready. * According to spec, this can take up to 31 seconds! */ -#ifndef CONFIG_AMIGAONEG3SE for (bus=0; bus<CONFIG_SYS_IDE_MAXBUS; ++bus) { int dev = bus * (CONFIG_SYS_IDE_MAXDEVICE / CONFIG_SYS_IDE_MAXBUS); -#else - s = getenv("ide_maxbus"); - if (s) - max_bus_scan = simple_strtol(s, NULL, 10); - else - max_bus_scan = CONFIG_SYS_IDE_MAXBUS; - - for (bus=0; bus<max_bus_scan; ++bus) { - int dev = bus * (CONFIG_SYS_IDE_MAXDEVICE / max_bus_scan); -#endif #ifdef CONFIG_IDE_8xx_PCCARD /* Skip non-ide devices from probing */ @@ -668,30 +645,19 @@ void ide_init (void) udelay (100000); /* 100 ms */ ide_outb (dev, ATA_DEV_HD, ATA_LBA | ATA_DEVICE(dev)); udelay (100000); /* 100 ms */ -#if defined(CONFIG_AMIGAONEG3SE) || defined(CONFIG_SC3) - if ((s = getenv("ide_reset_timeout")) != NULL) - ata_reset_time = simple_strtol(s, NULL, 10); -#endif i = 0; do { udelay (10000); /* 10 ms */ c = ide_inb (dev, ATA_STATUS); i++; -#if defined(CONFIG_AMIGAONEG3SE) || defined(CONFIG_SC3) +#if defined(CONFIG_SC3) if (i > (ata_reset_time * 100)) { #else if (i > (ATA_RESET_TIME * 100)) { #endif puts ("** Timeout **\n"); ide_led ((LED_IDE1 | LED_IDE2), 0); /* LED's off */ -#ifdef CONFIG_AMIGAONEG3SE - /* If this is the second bus, the first one was OK */ - if (bus != 0) { - ide_bus_ok[bus] = 0; - goto skip_bus; - } -#endif return; } if ((i >= 100) && ((i%100)==0)) { @@ -714,9 +680,6 @@ void ide_init (void) WATCHDOG_RESET(); } -#ifdef CONFIG_AMIGAONEG3SE - skip_bus: -#endif putc ('\n'); ide_led ((LED_IDE1 | LED_IDE2), 0); /* LED's off */ @@ -1010,10 +973,6 @@ static void ide_ident (block_dev_desc_t *dev_desc) unsigned char c; hd_driveid_t *iop = (hd_driveid_t *)iobuf; -#ifdef CONFIG_AMIGAONEG3SE - int max_bus_scan; - char *s; -#endif #ifdef CONFIG_ATAPI int retries = 0; int do_retry = 0; @@ -1030,19 +989,6 @@ static void ide_ident (block_dev_desc_t *dev_desc) device=dev_desc->dev; printf (" Device %d: ", device); -#ifdef CONFIG_AMIGAONEG3SE - s = getenv("ide_maxbus"); - if (s) { - max_bus_scan = simple_strtol(s, NULL, 10); - } else { - max_bus_scan = CONFIG_SYS_IDE_MAXBUS; - } - if (device >= max_bus_scan*2) { - dev_desc->type=DEV_TYPE_UNKNOWN; - return; - } -#endif - ide_led (DEVICE_LED(device), 1); /* LED on */ /* Select device */ @@ -1086,10 +1032,6 @@ static void ide_ident (block_dev_desc_t *dev_desc) if (((c & ATA_STAT_DRQ) == 0) || ((c & (ATA_STAT_FAULT|ATA_STAT_ERR)) != 0) ) { #ifdef CONFIG_ATAPI -#ifdef CONFIG_AMIGAONEG3SE - s = getenv("ide_doreset"); - if (s && strcmp(s, "on") == 0) -#endif { /* Need to soft reset the device in case it's an ATAPI... */ debug ("Retrying...\n"); @@ -1601,7 +1543,6 @@ static void ide_reset (void) /* ------------------------------------------------------------------------- */ #if defined(CONFIG_IDE_LED) && \ - !defined(CONFIG_AMIGAONEG3SE)&& \ !defined(CONFIG_CPC45) && \ !defined(CONFIG_HMI10) && \ !defined(CONFIG_KUP4K) && \ @@ -1758,9 +1699,6 @@ unsigned char atapi_issue(int device,unsigned char* ccb,int ccblen, unsigned cha */ mask = ATA_STAT_BUSY|ATA_STAT_DRQ; res = 0; -#ifdef CONFIG_AMIGAONEG3SE -# warning THF: Removed LBA mode ??? -#endif ide_outb (device, ATA_DEV_HD, ATA_LBA | ATA_DEVICE(device)); c = atapi_wait_mask(device,ATAPI_TIME_OUT,mask,res); if ((c & mask) != res) { @@ -1774,9 +1712,6 @@ unsigned char atapi_issue(int device,unsigned char* ccb,int ccblen, unsigned cha ide_outb (device, ATA_SECT_NUM, 0); ide_outb (device, ATA_CYL_LOW, (unsigned char)(buflen & 0xFF)); ide_outb (device, ATA_CYL_HIGH, (unsigned char)((buflen>>8) & 0xFF)); -#ifdef CONFIG_AMIGAONEG3SE -# warning THF: Removed LBA mode ??? -#endif ide_outb (device, ATA_DEV_HD, ATA_LBA | ATA_DEVICE(device)); ide_outb (device, ATA_COMMAND, ATAPI_CMD_PACKET); @@ -1875,16 +1810,6 @@ unsigned char atapi_issue_autoreq (int device, unsigned char res,key,asc,ascq; int notready,unitattn; -#ifdef CONFIG_AMIGAONEG3SE - char *s; - unsigned int timeout, retrycnt; - - s = getenv("ide_cd_timeout"); - timeout = s ? (simple_strtol(s, NULL, 10)*1000000)/5 : 0; - - retrycnt = 0; -#endif - unitattn=ATAPI_UNIT_ATTN; notready=ATAPI_DRIVE_NOT_READY; @@ -1939,25 +1864,6 @@ retry: goto error; } -#ifdef CONFIG_AMIGAONEG3SE - if ((sense_data[2]&0xF)==0x0B) { - debug ("ABORTED COMMAND...retry\n"); - if (retrycnt++ < 4) - goto retry; - return (0xFF); - } - - if ((sense_data[2]&0xf) == 0x02 && - sense_data[12] == 0x04 && - sense_data[13] == 0x01 ) { - debug ("Waiting for unit to become active\n"); - udelay(timeout); - if (retrycnt++ < 4) - goto retry; - return 0xFF; - } -#endif /* CONFIG_AMIGAONEG3SE */ - printf ("ERROR: Unknown Sense key %02X ASC %02X ASCQ %02X\n",key,asc,ascq); error: debug ("ERROR Sense key %02X ASC %02X ASCQ %02X\n",key,asc,ascq); diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index eb89e9e..d2ef217 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -385,18 +385,6 @@ int _do_setenv (int flag, int argc, char *argv[]) return 0; } #endif - -#ifdef CONFIG_AMIGAONEG3SE - if (strcmp(argv[1], "vga_fg_color") == 0 || - strcmp(argv[1], "vga_bg_color") == 0 ) { - extern void video_set_color(unsigned char attr); - extern unsigned char video_get_attr(void); - - video_set_color(video_get_attr()); - return 0; - } -#endif /* CONFIG_AMIGAONEG3SE */ - return 0; } diff --git a/common/console.c b/common/console.c index 51c6fb6..b09b7d1 100644 --- a/common/console.c +++ b/common/console.c @@ -29,10 +29,6 @@ DECLARE_GLOBAL_DATA_PTR; -#ifdef CONFIG_AMIGAONEG3SE -int console_changed = 0; -#endif - #ifdef CONFIG_SYS_CONSOLE_IS_IN_ENV /* * if overwrite_console returns 1, the stdin, stderr and stdout diff --git a/common/env_common.c b/common/env_common.c index 439a4a9..82e4936 100644 --- a/common/env_common.c +++ b/common/env_common.c @@ -32,11 +32,6 @@ DECLARE_GLOBAL_DATA_PTR; -#ifdef CONFIG_AMIGAONEG3SE - extern void enable_nvram(void); - extern void disable_nvram(void); -#endif - #undef DEBUG_ENV #ifdef DEBUG_ENV #define DEBUGF(fmt,args...) printf(fmt ,##args) @@ -159,20 +154,6 @@ static uchar env_get_char_init (int index) return (c); } -#ifdef CONFIG_AMIGAONEG3SE -uchar env_get_char_memory (int index) -{ - uchar retval; - enable_nvram(); - if (gd->env_valid) { - retval = ( *((uchar *)(gd->env_addr + index)) ); - } else { - retval = ( default_environment[index] ); - } - disable_nvram(); - return retval; -} -#else uchar env_get_char_memory (int index) { if (gd->env_valid) { @@ -181,7 +162,6 @@ uchar env_get_char_memory (int index) return ( default_environment[index] ); } } -#endif uchar env_get_char (int index) { @@ -229,10 +209,6 @@ void env_relocate (void) gd->reloc_off); #endif -#ifdef CONFIG_AMIGAONEG3SE - enable_nvram(); -#endif - #ifdef ENV_IS_EMBEDDED /* * The environment buffer is embedded with the text segment, @@ -263,10 +239,6 @@ void env_relocate (void) env_relocate_spec (); } gd->env_addr = (ulong)&(env_ptr->data); - -#ifdef CONFIG_AMIGAONEG3SE - disable_nvram(); -#endif } #ifdef CONFIG_AUTO_COMPLETE diff --git a/common/env_nvram.c b/common/env_nvram.c index 2628fe4..7c7cf98 100644 --- a/common/env_nvram.c +++ b/common/env_nvram.c @@ -59,24 +59,6 @@ char * env_name_spec = "NVRAM"; extern uchar default_environment[]; -#ifdef CONFIG_AMIGAONEG3SE -uchar env_get_char_spec (int index) -{ -#ifdef CONFIG_SYS_NVRAM_ACCESS_ROUTINE - uchar c; - - nvram_read(&c, CONFIG_ENV_ADDR+index, 1); - - return c; -#else - uchar retval; - enable_nvram(); - retval = *((uchar *)(gd->env_addr + index)); - disable_nvram(); - return retval; -#endif -} -#else uchar env_get_char_spec (int index) { #ifdef CONFIG_SYS_NVRAM_ACCESS_ROUTINE @@ -89,7 +71,6 @@ uchar env_get_char_spec (int index) return *((uchar *)(gd->env_addr + index)); #endif } -#endif void env_relocate_spec (void) { @@ -103,19 +84,12 @@ void env_relocate_spec (void) int saveenv (void) { int rcode = 0; -#ifdef CONFIG_AMIGAONEG3SE - enable_nvram(); -#endif #ifdef CONFIG_SYS_NVRAM_ACCESS_ROUTINE nvram_write(CONFIG_ENV_ADDR, env_ptr, CONFIG_ENV_SIZE); #else if (memcpy ((char *)CONFIG_ENV_ADDR, env_ptr, CONFIG_ENV_SIZE) == NULL) rcode = 1 ; #endif -#ifdef CONFIG_AMIGAONEG3SE - udelay(10000); - disable_nvram(); -#endif return rcode; } @@ -127,9 +101,6 @@ int saveenv (void) */ int env_init (void) { -#ifdef CONFIG_AMIGAONEG3SE - enable_nvram(); -#endif #if defined(CONFIG_SYS_NVRAM_ACCESS_ROUTINE) ulong crc; uchar data[ENV_SIZE]; @@ -147,8 +118,5 @@ int env_init (void) gd->env_addr = (ulong)&default_environment[0]; gd->env_valid = 0; } -#ifdef CONFIG_AMIGAONEG3SE - disable_nvram(); -#endif return (0); } diff --git a/common/hwconfig.c b/common/hwconfig.c index e5c60ba..1f9f4a0 100644 --- a/common/hwconfig.c +++ b/common/hwconfig.c @@ -11,15 +11,23 @@ * the License, or (at your option) any later version. */ +#ifndef HWCONFIG_TEST #include <config.h> #include <common.h> #include <exports.h> #include <hwconfig.h> #include <linux/types.h> #include <linux/string.h> +#else +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <assert.h> +#define min(a, b) (((a) < (b)) ? (a) : (b)) +#endif /* HWCONFIG_TEST */ static const char *hwconfig_parse(const char *opts, size_t maxlen, - const char *opt, char stopch, char eqch, + const char *opt, char *stopchs, char eqch, size_t *arglen) { size_t optlen = strlen(opt); @@ -33,8 +41,9 @@ next: if (end - start > maxlen) return NULL; - if (str && (str == opts || str[-1] == stopch) && - (*end == stopch || *end == eqch || *end == '\0')) { + if (str && (str == opts || strpbrk(str - 1, stopchs) == str - 1) && + (strpbrk(end, stopchs) == end || *end == eqch || + *end == '\0')) { const char *arg_end; if (!arglen) @@ -43,7 +52,7 @@ next: if (*end != eqch) return NULL; - arg_end = strchr(str, stopch); + arg_end = strpbrk(str, stopchs); if (!arg_end) *arglen = min(maxlen, strlen(str)) - optlen - 1; else @@ -66,15 +75,15 @@ static const char *__hwconfig(const char *opt, size_t *arglen) if (env_hwconfig) return hwconfig_parse(env_hwconfig, strlen(env_hwconfig), - opt, ';', ':', arglen); + opt, ";", ':', arglen); if (board_hwconfig) return hwconfig_parse(board_hwconfig, strlen(board_hwconfig), - opt, ';', ':', arglen); + opt, ";", ':', arglen); if (cpu_hwconfig) return hwconfig_parse(cpu_hwconfig, strlen(cpu_hwconfig), - opt, ';', ':', arglen); + opt, ";", ':', arglen); return NULL; } @@ -164,7 +173,7 @@ int hwconfig_sub(const char *opt, const char *subopt) arg = __hwconfig(opt, &arglen); if (!arg) return 0; - return !!hwconfig_parse(arg, arglen, subopt, ',', '=', NULL); + return !!hwconfig_parse(arg, arglen, subopt, ",;", '=', NULL); } /* @@ -185,7 +194,7 @@ const char *hwconfig_subarg(const char *opt, const char *subopt, arg = __hwconfig(opt, &arglen); if (!arg) return NULL; - return hwconfig_parse(arg, arglen, subopt, ',', '=', subarglen); + return hwconfig_parse(arg, arglen, subopt, ",;", '=', subarglen); } /* @@ -208,3 +217,50 @@ int hwconfig_subarg_cmp(const char *opt, const char *subopt, const char *subarg) return !strncmp(argstr, subarg, arglen); } + +#ifdef HWCONFIG_TEST +int main() +{ + const char *ret; + size_t len; + + setenv("hwconfig", "key1:subkey1=value1,subkey2=value2;key2:value3;;;;" + "key3;:,:=;key4", 1); + + ret = hwconfig_arg("key1", &len); + printf("%zd %.*s\n", len, (int)len, ret); + assert(len == 29); + assert(hwconfig_arg_cmp("key1", "subkey1=value1,subkey2=value2")); + assert(!strncmp(ret, "subkey1=value1,subkey2=value2", len)); + + ret = hwconfig_subarg("key1", "subkey1", &len); + printf("%zd %.*s\n", len, (int)len, ret); + assert(len == 6); + assert(hwconfig_subarg_cmp("key1", "subkey1", "value1")); + assert(!strncmp(ret, "value1", len)); + + ret = hwconfig_subarg("key1", "subkey2", &len); + printf("%zd %.*s\n", len, (int)len, ret); + assert(len == 6); + assert(hwconfig_subarg_cmp("key1", "subkey2", "value2")); + assert(!strncmp(ret, "value2", len)); + + ret = hwconfig_arg("key2", &len); + printf("%zd %.*s\n", len, (int)len, ret); + assert(len == 6); + assert(hwconfig_arg_cmp("key2", "value3")); + assert(!strncmp(ret, "value3", len)); + + assert(hwconfig("key3")); + assert(hwconfig_arg("key4", &len) == NULL); + assert(hwconfig_arg("bogus", &len) == NULL); + + unsetenv("hwconfig"); + + assert(hwconfig(NULL) == 0); + assert(hwconfig("") == 0); + assert(hwconfig("key3") == 0); + + return 0; +} +#endif /* HWCONFIG_TEST */ diff --git a/common/main.c b/common/main.c index f7e7c1c..3760ba3 100644 --- a/common/main.c +++ b/common/main.c @@ -427,14 +427,7 @@ void main_loop (void) } } #endif /* CONFIG_MENUKEY */ -#endif /* CONFIG_BOOTDELAY */ - -#ifdef CONFIG_AMIGAONEG3SE - { - extern void video_banner(void); - video_banner(); - } -#endif +#endif /* CONFIG_BOOTDELAY */ /* * Main Loop for Monitor Command Processing diff --git a/drivers/mmc/pxa_mmc.c b/drivers/mmc/pxa_mmc.c index 8225235..8776903 100644 --- a/drivers/mmc/pxa_mmc.c +++ b/drivers/mmc/pxa_mmc.c @@ -126,7 +126,7 @@ mmc_block_read(uchar * dst, ulong src, ulong len) MMC_I_MASK = ~MMC_I_MASK_RXFIFO_RD_REQ; while (len) { if (MMC_I_REG & MMC_I_REG_RXFIFO_RD_REQ) { -#ifdef CONFIG_PXA27X +#if defined(CONFIG_PXA27X) || defined(CONFIG_CPU_MONAHANS) int i; for (i = min(len, 32); i; i--) { *dst++ = *((volatile uchar *)&MMC_RXFIFO); @@ -558,8 +558,11 @@ mmc_legacy_init(int verbose) set_GPIO_mode(GPIO6_MMCCLK_MD); set_GPIO_mode(GPIO8_MMCCS0_MD); #endif +#ifdef CONFIG_CPU_MONAHANS /* pxa3xx */ + CKENA |= CKENA_12_MMC0 | CKENA_13_MMC1; +#else /* pxa2xx */ CKEN |= CKEN12_MMC; /* enable MMC unit clock */ - +#endif MMC_CLKRT = MMC_CLKRT_0_3125MHZ; MMC_RESTO = MMC_RES_TO_MAX; MMC_SPI = MMC_SPI_DISABLE; @@ -584,11 +587,7 @@ mmc_legacy_init(int verbose) debug("Detected SD card\n"); break; } -#ifdef CONFIG_PXA27X - udelay(10000); -#else udelay(200000); -#endif } if (retries <= 0 || !(IF_TYPE_SD == mmc_dev.if_type)) { @@ -598,11 +597,7 @@ mmc_legacy_init(int verbose) retries = 10; while (retries-- && resp && !(resp[0] & 0x80000000)) { -#ifdef CONFIG_PXA27X - udelay(10000); -#else udelay(200000); -#endif resp = mmc_cmd(MMC_CMD_SEND_OP_COND, 0x00ff, 0x8000, MMC_CMDAT_R3); @@ -632,7 +627,7 @@ mmc_legacy_init(int verbose) MMC_CLKRT = 0; /* 20 MHz */ resp = mmc_cmd(MMC_CMD_SELECT_CARD, rca, 0, MMC_CMDAT_R1); -#ifdef CONFIG_PXA27X +#if defined(CONFIG_PXA27X) || defined(CONFIG_CPU_MONAHANS) if (IF_TYPE_SD == mmc_dev.if_type) { resp = mmc_cmd(MMC_CMD_APP_CMD, rca, 0, MMC_CMDAT_R1); resp = mmc_cmd(SD_CMD_APP_SET_BUS_WIDTH, 0, 2, MMC_CMDAT_R1); diff --git a/drivers/rtc/mc146818.c b/drivers/rtc/mc146818.c index d68b438..ac4eb6a 100644 --- a/drivers/rtc/mc146818.c +++ b/drivers/rtc/mc146818.c @@ -67,9 +67,6 @@ int rtc_get (struct rtc_time *tmp) wday = rtc_read (RTC_DAY_OF_WEEK); mon = rtc_read (RTC_MONTH); year = rtc_read (RTC_YEAR); -#ifdef CONFIG_AMIGAONEG3SE - wday -= 1; /* VIA 686 stores Sunday = 1, Monday = 2, ... */ -#endif #ifdef RTC_DEBUG printf ( "Get RTC year: %02x mon/cent: %02x mday: %02x wday: %02x " "hr: %02x min: %02x sec: %02x\n", @@ -114,11 +111,7 @@ int rtc_set (struct rtc_time *tmp) rtc_write (RTC_YEAR, bin2bcd(tmp->tm_year % 100)); rtc_write (RTC_MONTH, bin2bcd(tmp->tm_mon)); -#ifdef CONFIG_AMIGAONEG3SE - rtc_write (RTC_DAY_OF_WEEK, bin2bcd(tmp->tm_wday)+1); -#else rtc_write (RTC_DAY_OF_WEEK, bin2bcd(tmp->tm_wday)); -#endif rtc_write (RTC_DATE_OF_MONTH, bin2bcd(tmp->tm_mday)); rtc_write (RTC_HOURS, bin2bcd(tmp->tm_hour)); rtc_write (RTC_MINUTES, bin2bcd(tmp->tm_min )); diff --git a/drivers/rtc/mk48t59.c b/drivers/rtc/mk48t59.c index b176882..e285823 100644 --- a/drivers/rtc/mk48t59.c +++ b/drivers/rtc/mk48t59.c @@ -63,24 +63,6 @@ static void rtc_write (short reg, uchar val) out8(RTC(reg),val); } -#elif defined(CONFIG_AMIGAONEG3SE) - -#include "../board/MAI/AmigaOneG3SE/via686.h" -#include "../board/MAI/AmigaOneG3SE/memio.h" - - -static uchar rtc_read (short reg) -{ - out_byte(CMOS_ADDR, (uint8)reg); - return in_byte(CMOS_DATA); -} - -static void rtc_write (short reg, uchar val) -{ - out_byte(CMOS_ADDR, (uint8)reg); - out_byte(CMOS_DATA, (uint8)val); -} - #elif defined(CONFIG_EVAL5200) static uchar rtc_read (short reg) diff --git a/drivers/spi/davinci_spi.c b/drivers/spi/davinci_spi.c index 08f837b..4518ecb 100644 --- a/drivers/spi/davinci_spi.c +++ b/drivers/spi/davinci_spi.c @@ -66,7 +66,7 @@ void spi_free_slave(struct spi_slave *slave) int spi_claim_bus(struct spi_slave *slave) { struct davinci_spi_slave *ds = to_davinci_spi(slave); - unsigned int scalar, data1_reg_val = 0; + unsigned int scalar; /* Enable the SPI hardware */ writel(SPIGCR0_SPIRST_MASK, &ds->regs->gcr0); @@ -93,11 +93,6 @@ int spi_claim_bus(struct spi_slave *slave) writel(8 | (scalar << SPIFMT_PRESCALE_SHIFT) | (1 << SPIFMT_PHASE_SHIFT), &ds->regs->fmt0); - /* hold cs active at end of transfer until explicitly de-asserted */ - data1_reg_val = (1 << SPIDAT1_CSHOLD_SHIFT) | - (slave->cs << SPIDAT1_CSNR_SHIFT); - writel(data1_reg_val, &ds->regs->dat1); - /* * Including a minor delay. No science here. Should be good even with * no delay @@ -113,8 +108,7 @@ int spi_claim_bus(struct spi_slave *slave) writel(0, &ds->regs->lvl); /* enable SPI */ - writel((readl(&ds->regs->gcr1) | - SPIGCR1_SPIENA_MASK), &ds->regs->gcr1); + writel((readl(&ds->regs->gcr1) | SPIGCR1_SPIENA_MASK), &ds->regs->gcr1); return 0; } @@ -127,14 +121,125 @@ void spi_release_bus(struct spi_slave *slave) writel(SPIGCR0_SPIRST_MASK, &ds->regs->gcr0); } +/* + * This functions needs to act like a macro to avoid pipeline reloads in the + * loops below. Use always_inline. This gains us about 160KiB/s and the bloat + * appears to be zero bytes (da830). + */ +__attribute__((always_inline)) +static inline u32 davinci_spi_xfer_data(struct davinci_spi_slave *ds, u32 data) +{ + u32 buf_reg_val; + + /* send out data */ + writel(data, &ds->regs->dat1); + + /* wait for the data to clock in/out */ + while ((buf_reg_val = readl(&ds->regs->buf)) & SPIBUF_RXEMPTY_MASK) + ; + + return buf_reg_val; +} + +static int davinci_spi_read(struct spi_slave *slave, unsigned int len, + u8 *rxp, unsigned long flags) +{ + struct davinci_spi_slave *ds = to_davinci_spi(slave); + unsigned int data1_reg_val; + + /* enable CS hold, CS[n] and clear the data bits */ + data1_reg_val = ((1 << SPIDAT1_CSHOLD_SHIFT) | + (slave->cs << SPIDAT1_CSNR_SHIFT)); + + /* wait till TXFULL is deasserted */ + while (readl(&ds->regs->buf) & SPIBUF_TXFULL_MASK) + ; + + /* preload the TX buffer to avoid clock starvation */ + writel(data1_reg_val, &ds->regs->dat1); + + /* keep reading 1 byte until only 1 byte left */ + while ((len--) > 1) + *rxp++ = davinci_spi_xfer_data(ds, data1_reg_val); + + /* clear CS hold when we reach the end */ + if (flags & SPI_XFER_END) + data1_reg_val &= ~(1 << SPIDAT1_CSHOLD_SHIFT); + + /* read the last byte */ + *rxp = davinci_spi_xfer_data(ds, data1_reg_val); + + return 0; +} + +static int davinci_spi_write(struct spi_slave *slave, unsigned int len, + const u8 *txp, unsigned long flags) +{ + struct davinci_spi_slave *ds = to_davinci_spi(slave); + unsigned int data1_reg_val; + + /* enable CS hold and clear the data bits */ + data1_reg_val = ((1 << SPIDAT1_CSHOLD_SHIFT) | + (slave->cs << SPIDAT1_CSNR_SHIFT)); + + /* wait till TXFULL is deasserted */ + while (readl(&ds->regs->buf) & SPIBUF_TXFULL_MASK) + ; + + /* preload the TX buffer to avoid clock starvation */ + if (len > 2) { + writel(data1_reg_val | *txp++, &ds->regs->dat1); + len--; + } + + /* keep writing 1 byte until only 1 byte left */ + while ((len--) > 1) + davinci_spi_xfer_data(ds, data1_reg_val | *txp++); + + /* clear CS hold when we reach the end */ + if (flags & SPI_XFER_END) + data1_reg_val &= ~(1 << SPIDAT1_CSHOLD_SHIFT); + + /* write the last byte */ + davinci_spi_xfer_data(ds, data1_reg_val | *txp); + + return 0; +} + +#ifndef CONFIG_SPI_HALF_DUPLEX +static int davinci_spi_read_write(struct spi_slave *slave, unsigned int len, + u8 *rxp, const u8 *txp, unsigned long flags) +{ + struct davinci_spi_slave *ds = to_davinci_spi(slave); + unsigned int data1_reg_val; + + /* enable CS hold and clear the data bits */ + data1_reg_val = ((1 << SPIDAT1_CSHOLD_SHIFT) | + (slave->cs << SPIDAT1_CSNR_SHIFT)); + + /* wait till TXFULL is deasserted */ + while (readl(&ds->regs->buf) & SPIBUF_TXFULL_MASK) + ; + + /* keep reading and writing 1 byte until only 1 byte left */ + while ((len--) > 1) + *rxp++ = davinci_spi_xfer_data(ds, data1_reg_val | *txp++); + + /* clear CS hold when we reach the end */ + if (flags & SPI_XFER_END) + data1_reg_val &= ~(1 << SPIDAT1_CSHOLD_SHIFT); + + /* read and write the last byte */ + *rxp = davinci_spi_xfer_data(ds, data1_reg_val | *txp); + + return 0; +} +#endif + int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout, void *din, unsigned long flags) { - struct davinci_spi_slave *ds = to_davinci_spi(slave); - unsigned int len, data1_reg_val = readl(&ds->regs->dat1); - unsigned int i_cnt = 0, o_cnt = 0, buf_reg_val; - const u8 *txp = dout; /* dout can be NULL for read operation */ - u8 *rxp = din; /* din can be NULL for write operation */ + unsigned int len; if (bitlen == 0) /* Finish any previously submitted transfers */ @@ -154,63 +259,19 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, len = bitlen / 8; - /* do an empty read to clear the current contents */ - readl(&ds->regs->buf); - - /* keep writing and reading 1 byte until done */ - while ((i_cnt < len) || (o_cnt < len)) { - /* read RX buffer and flags */ - buf_reg_val = readl(&ds->regs->buf); - - /* if data is available */ - if ((i_cnt < len) && - (buf_reg_val & SPIBUF_RXEMPTY_MASK) == 0) { - /* - * If there is no read buffer simply - * ignore the read character - */ - if (rxp) - *rxp++ = buf_reg_val & 0xFF; - /* increment read words count */ - i_cnt++; - } - - /* - * if the tx buffer is empty and there - * is still data to transmit - */ - if ((o_cnt < len) && - ((buf_reg_val & SPIBUF_TXFULL_MASK) == 0)) { - /* write the data */ - data1_reg_val &= ~0xFFFF; - if (txp) - data1_reg_val |= *txp++; - /* - * Write to DAT1 is required to keep - * the serial transfer going. - * We just terminate when we reach the end. - */ - if ((o_cnt == (len - 1)) && (flags & SPI_XFER_END)) { - /* clear CS hold */ - writel(data1_reg_val & - ~(1 << SPIDAT1_CSHOLD_SHIFT), - &ds->regs->dat1); - } else { - /* enable CS hold and write TX register */ - data1_reg_val |= ((1 << SPIDAT1_CSHOLD_SHIFT) | - (slave->cs << SPIDAT1_CSNR_SHIFT)); - writel(data1_reg_val, &ds->regs->dat1); - } - /* increment written words count */ - o_cnt++; - } - } - return 0; + if (!dout) + return davinci_spi_read(slave, len, din, flags); + else if (!din) + return davinci_spi_write(slave, len, dout, flags); +#ifndef CONFIG_SPI_HALF_DUPLEX + else + return davinci_spi_read_write(slave, len, din, dout, flags); +#endif out: if (flags & SPI_XFER_END) { - writel(data1_reg_val & - ~(1 << SPIDAT1_CSHOLD_SHIFT), &ds->regs->dat1); + u8 dummy = 0; + davinci_spi_write(slave, 1, &dummy, flags); } return 0; } diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c index d1f47c9..96d52fb 100644 --- a/drivers/video/cfb_console.c +++ b/drivers/video/cfb_console.c @@ -749,6 +749,18 @@ void video_puts (const char *s) /*****************************************************************************/ +/* + * Do not enforce drivers (or board code) to provide empty + * video_set_lut() if they do not support 8 bpp format. + * Implement weak default function instead. + */ +void __video_set_lut (unsigned int index, unsigned char r, + unsigned char g, unsigned char b) +{ +} +void video_set_lut (unsigned int, unsigned char, unsigned char, unsigned char) + __attribute__((weak, alias("__video_set_lut"))); + #if defined(CONFIG_CMD_BMP) || defined(CONFIG_SPLASH_SCREEN) #define FILL_8BIT_332RGB(r,g,b) { \ diff --git a/drivers/video/sm501.c b/drivers/video/sm501.c index 283d2d9..6a1e010 100644 --- a/drivers/video/sm501.c +++ b/drivers/video/sm501.c @@ -31,6 +31,7 @@ #include <common.h> +#include <asm/io.h> #include <video_fb.h> #include <sm501.h> @@ -54,6 +55,18 @@ GraphicDevice sm501; +void write_be32(int off, unsigned int val) +{ + out_be32((unsigned __iomem *)(sm501.isaBase + off), val); +} + +void write_le32(int off, unsigned int val) +{ + out_le32((unsigned __iomem *)(sm501.isaBase + off), val); +} + +void (*write_reg32)(int off, unsigned int val) = write_be32; + /*----------------------------------------------------------------------------- * SmiSetRegs -- *----------------------------------------------------------------------------- @@ -66,7 +79,7 @@ static void SmiSetRegs (void) */ const SMI_REGS *preg = board_get_regs (); while (preg->Index) { - write32 (preg->Index, preg->Value); + write_reg32 (preg->Index, preg->Value); /* * Insert a delay between */ @@ -75,26 +88,120 @@ static void SmiSetRegs (void) } } +#ifdef CONFIG_VIDEO_SM501_PCI +static struct pci_device_id sm501_pci_tbl[] = { + { PCI_VENDOR_ID_SMI, PCI_DEVICE_ID_SMI_501 }, + {} +}; +#endif + +/* + * We do not enforce board code to provide empty/unused + * functions for this driver and define weak default + * functions here. + */ +unsigned int __board_video_init (void) +{ + return 0; +} + +unsigned int board_video_init (void) + __attribute__((weak, alias("__board_video_init"))); + +unsigned int __board_video_get_fb (void) +{ + return 0; +} + +unsigned int board_video_get_fb (void) + __attribute__((weak, alias("__board_video_get_fb"))); + +void __board_validate_screen (unsigned int base) +{ +} + +void board_validate_screen (unsigned int base) + __attribute__((weak, alias("__board_validate_screen"))); + /*----------------------------------------------------------------------------- * video_hw_init -- *----------------------------------------------------------------------------- */ void *video_hw_init (void) { +#ifdef CONFIG_VIDEO_SM501_PCI + unsigned int pci_mem_base, pci_mmio_base; + unsigned int id; + unsigned short device_id; + pci_dev_t devbusfn; + int mem; +#endif unsigned int *vm, i; memset (&sm501, 0, sizeof (GraphicDevice)); +#ifdef CONFIG_VIDEO_SM501_PCI + printf("Video: "); + + /* Look for SM501/SM502 chips */ + devbusfn = pci_find_devices(sm501_pci_tbl, 0); + if (devbusfn < 0) { + printf ("PCI Controller not found.\n"); + goto not_pci; + } + + /* Setup */ + pci_write_config_dword (devbusfn, PCI_COMMAND, + (PCI_COMMAND_MEMORY | PCI_COMMAND_IO)); + pci_read_config_word (devbusfn, PCI_DEVICE_ID, &device_id); + pci_read_config_dword (devbusfn, PCI_REVISION_ID, &id); + pci_read_config_dword (devbusfn, PCI_BASE_ADDRESS_0, &pci_mem_base); + pci_read_config_dword (devbusfn, PCI_BASE_ADDRESS_1, &pci_mmio_base); + sm501.frameAdrs = pci_mem_to_phys (devbusfn, pci_mem_base); + sm501.isaBase = pci_mem_to_phys (devbusfn, pci_mmio_base); + + if (sm501.isaBase) + write_reg32 = write_le32; + + mem = in_le32 ((unsigned __iomem *)(sm501.isaBase + 0x10)); + mem = (mem & 0x0000e000) >> 13; + switch (mem) { + case 1: + mem = 8; + break; + case 2: + mem = 16; + break; + case 3: + mem = 32; + break; + case 4: + mem = 64; + break; + case 5: + mem = 2; + break; + case 0: + default: + mem = 4; + } + printf ("PCI SM50%d %d MB\n", ((id & 0xff) == 0xC0) ? 2 : 1, mem); +not_pci: +#endif /* * Initialization of the access to the graphic chipset Retreive base * address of the chipset (see board/RPXClassic/eccx.c) */ - if ((sm501.isaBase = board_video_init ()) == 0) { - return (NULL); + if (!sm501.isaBase) { + sm501.isaBase = board_video_init (); + if (!sm501.isaBase) + return NULL; } - if ((sm501.frameAdrs = board_video_get_fb ()) == 0) { - return (NULL); + if (!sm501.frameAdrs) { + sm501.frameAdrs = board_video_get_fb (); + if (!sm501.frameAdrs) + return NULL; } sm501.winSizeX = board_get_width (); @@ -131,16 +238,3 @@ void *video_hw_init (void) return (&sm501); } - -/*----------------------------------------------------------------------------- - * video_set_lut -- - *----------------------------------------------------------------------------- - */ -void video_set_lut ( - unsigned int index, /* color number */ - unsigned char r, /* red */ - unsigned char g, /* green */ - unsigned char b /* blue */ - ) -{ -} diff --git a/examples/standalone/Makefile b/examples/standalone/Makefile index 6ea3b93..5f1f800 100644 --- a/examples/standalone/Makefile +++ b/examples/standalone/Makefile @@ -72,6 +72,16 @@ gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`) CPPFLAGS += -I.. +# For PowerPC there's no need to compile standalone applications as a +# relocatable executable. The relocation data is not needed, and +# also causes the entry point of the standalone application to be +# inconsistent. +ifeq ($(ARCH),powerpc) +AFLAGS := $(filter-out $(RELFLAGS),$(AFLAGS)) +CFLAGS := $(filter-out $(RELFLAGS),$(CFLAGS)) +CPPFLAGS := $(filter-out $(RELFLAGS),$(CPPFLAGS)) +endif + all: $(obj).depend $(OBJS) $(LIB) $(SREC) $(BIN) $(ELF) ######################################################################### diff --git a/include/configs/AmigaOneG3SE.h b/include/configs/AmigaOneG3SE.h deleted file mode 100644 index 0dfb23b..0000000 --- a/include/configs/AmigaOneG3SE.h +++ /dev/null @@ -1,404 +0,0 @@ -/* - * (C) Copyright 2002 - * Wolfgang Denk, DENX Software Engineering, wd@denx.de. - * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - */ - -/* - * - * Configuration settings for the AmigaOneG3SE board. - * - */ - -/* ------------------------------------------------------------------------- */ - -/* - * board/config.h - configuration options, board specific - */ - -#ifndef __CONFIG_H -#define __CONFIG_H - -/* - * High Level Configuration Options - * (easy to change) - */ - -#define CONFIG_AMIGAONEG3SE 1 - -#define CONFIG_BOARD_EARLY_INIT_F 1 -#define CONFIG_MISC_INIT_R 1 - -#define CONFIG_VERY_BIG_RAM 1 - -#define CONFIG_CONS_INDEX 1 -#define CONFIG_BAUDRATE 9600 -#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 } - -#undef CONFIG_CLOCKS_IN_MHZ /* clocks passed to Linux in Hz */ - -#define CONFIG_BOOTARGS "root=/dev/ram rw ramdisk_size=4096" - -/* - * BOOTP options - */ -#define CONFIG_BOOTP_SUBNETMASK -#define CONFIG_BOOTP_GATEWAY -#define CONFIG_BOOTP_HOSTNAME -#define CONFIG_BOOTP_BOOTPATH -#define CONFIG_BOOTP_BOOTFILESIZE - - -#define CONFIG_MAC_PARTITION -#define CONFIG_DOS_PARTITION -#define CONFIG_AMIGA_PARTITION - - -/* - * Command line configuration. - */ -#include <config_cmd_default.h> - -#define CONFIG_CMD_ASKENV -#define CONFIG_CMD_BSP -#define CONFIG_CMD_DATE -#define CONFIG_CMD_DHCP -#define CONFIG_CMD_ELF -#define CONFIG_CMD_NET -#define CONFIG_CMD_IDE -#define CONFIG_CMD_FDC -#define CONFIG_CMD_CACHE -#define CONFIG_CMD_CONSOLE -#define CONFIG_CMD_USB -#define CONFIG_CMD_BSP -#define CONFIG_CMD_PCI - - -#define CONFIG_PCI 1 -/* #define CONFIG_PCI_SCAN_SHOW 1 */ -#define CONFIG_PCI_PNP 1 /* PCI plug-and-play */ - -#define atoi(x) simple_strtoul(x,NULL,10) - -/* - * Miscellaneous configurable options - */ -#define CONFIG_SYS_LONGHELP /* undef to save memory */ -#define CONFIG_SYS_PROMPT "] " /* Monitor Command Prompt */ - -#define CONFIG_SYS_HUSH_PARSER 1 /* use "hush" command parser */ -/* #undef CONFIG_SYS_HUSH_PARSER */ -#ifdef CONFIG_SYS_HUSH_PARSER -#define CONFIG_SYS_PROMPT_HUSH_PS2 "> " -#endif -#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */ - -/* Print Buffer Size - */ -#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) - -#define CONFIG_SYS_MAXARGS 64 /* max number of command args */ -#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Argument Buffer Size */ -#define CONFIG_SYS_LOAD_ADDR 0x00500000 /* Default load address */ - -/*----------------------------------------------------------------------- - * Start addresses for the final memory configuration - * (Set up by the startup code) - * Please note that CONFIG_SYS_SDRAM_BASE _must_ start at 0 - */ -#define CONFIG_SYS_SDRAM_BASE 0x00000000 -#define CONFIG_SYS_FLASH_BASE 0xFFF00000 -#define CONFIG_SYS_FLASH_MAX_SIZE 0x00080000 -/* Maximum amount of RAM. - */ -#define CONFIG_SYS_MAX_RAM_SIZE 0x80000000 /* 2G */ - -#define CONFIG_SYS_RESET_ADDRESS 0xFFF00100 - -#define CONFIG_SYS_MONITOR_BASE TEXT_BASE - -#define CONFIG_SYS_MONITOR_LEN (768 << 10) /* Reserve 512 kB for Monitor */ -#define CONFIG_SYS_MALLOC_LEN (2500 << 10) /* Reserve 128 kB for malloc() */ - -#if CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_SDRAM_BASE && \ - CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_MAX_RAM_SIZE -#define CONFIG_SYS_RAMBOOT -#else -#undef CONFIG_SYS_RAMBOOT -#endif - -#define CONFIG_SYS_MEMTEST_START 0x00004000 /* memtest works on */ -#define CONFIG_SYS_MEMTEST_END 0x02000000 /* 0 ... 32 MB in DRAM */ - -/*----------------------------------------------------------------------- - * Definitions for initial stack pointer and data area - */ - -/* Size in bytes reserved for initial data - */ -/* HJF: used to be 0x400000 */ -#define CONFIG_SYS_INIT_RAM_ADDR 0x40000000 -#define CONFIG_SYS_INIT_RAM_END 0x8000 -#define CONFIG_SYS_GBL_DATA_SIZE 128 -#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE) -#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET - -#define CONFIG_SYS_INIT_RAM_LOCK - -/* - * Temporary buffer for serial data until the real serial driver - * is initialised (memtest will destroy this buffer) - */ -#define CONFIG_SYS_SCONSOLE_ADDR CONFIG_SYS_INIT_RAM_ADDR -#define CONFIG_SYS_SCONSOLE_SIZE 0x0002000 - -/* SDRAM 0 - 256MB - */ - -/*HJF: #define CONFIG_SYS_IBAT0L (CONFIG_SYS_SDRAM_BASE | BATL_PP_RW | BATL_CACHEINHIBIT) -#define CONFIG_SYS_IBAT0U (CONFIG_SYS_SDRAM_BASE | BATU_BL_4M | BATU_VS | BATU_VP) -#define CONFIG_SYS_DBAT0L (CONFIG_SYS_SDRAM_BASE | BATL_PP_RW | BATL_CACHEINHIBIT) -#define CONFIG_SYS_DBAT0U CONFIG_SYS_IBAT0U*/ - -#define CONFIG_SYS_DBAT0L (CONFIG_SYS_SDRAM_BASE | BATL_PP_10 | BATL_MEMCOHERENCE) -#define CONFIG_SYS_DBAT0U (CONFIG_SYS_SDRAM_BASE | BATU_BL_256M | BATU_VS | BATU_VP) -#define CONFIG_SYS_IBAT0L (CONFIG_SYS_SDRAM_BASE | BATL_PP_10 | BATL_MEMCOHERENCE) -#define CONFIG_SYS_IBAT0U (CONFIG_SYS_SDRAM_BASE | BATU_BL_256M | BATU_VS | BATU_VP) -/* PCI Range - */ -#define CONFIG_SYS_DBAT1L (0x80000000 | BATL_PP_RW | BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE) -#define CONFIG_SYS_DBAT1U (0x80000000 | BATU_BL_256M | BATU_VS | BATU_VP) -#define CONFIG_SYS_IBAT1L (0x80000000 | BATL_PP_RW | BATL_CACHEINHIBIT) -#define CONFIG_SYS_IBAT1U (0x80000000 | BATU_BL_256M | BATU_VS | BATU_VP) -/* HJF: -#define CONFIG_SYS_IBAT1L ((CONFIG_SYS_SDRAM_BASE+CONFIG_SYS_INIT_RAM_ADDR) | BATL_PP_RW) -#define CONFIG_SYS_IBAT1U ((CONFIG_SYS_SDRAM_BASE+CONFIG_SYS_INIT_RAM_ADDR) | BATU_BL_256M | BATU_VS | BATU_VP) -#define CONFIG_SYS_DBAT1L ((CONFIG_SYS_SDRAM_BASE+CONFIG_SYS_INIT_RAM_ADDR + 0x20000) | BATL_PP_RW ) -#define CONFIG_SYS_DBAT1U ((CONFIG_SYS_SDRAM_BASE+CONFIG_SYS_INIT_RAM_ADDR + 0x20000) | BATU_BL_256M | BATU_VS | BATU_VP) -*/ - -/* Init RAM in the CPU DCache (no backing memory) - */ -#define CONFIG_SYS_DBAT2L (CONFIG_SYS_INIT_RAM_ADDR | BATL_PP_RW | BATL_MEMCOHERENCE) -#define CONFIG_SYS_DBAT2U (CONFIG_SYS_INIT_RAM_ADDR | BATU_BL_128K | BATU_VS | BATU_VP) -/* This used to be commented out */ -#define CONFIG_SYS_IBAT2L CONFIG_SYS_DBAT2L -/* This here too */ -#define CONFIG_SYS_IBAT2U CONFIG_SYS_DBAT2U - - -/* I/O and PCI memory at 0xf0000000 - */ -#define CONFIG_SYS_DBAT3L (0xf0000000 | BATL_PP_RW | BATL_CACHEINHIBIT | BATL_GUARDEDSTORAGE) -#define CONFIG_SYS_DBAT3U (0xf0000000 | BATU_BL_256M | BATU_VS | BATU_VP) - -#define CONFIG_SYS_IBAT3L (0xf0000000 | BATL_PP_RW | BATL_CACHEINHIBIT) -#define CONFIG_SYS_IBAT3U (0xf0000000 | BATU_BL_256M | BATU_VS | BATU_VP) - -/* - * Low Level Configuration Settings - * (address mappings, register initial values, etc.) - */ -#define CONFIG_SYS_HZ 1000 -#define CONFIG_SYS_BUS_HZ 133000000 /* bus speed - 100 mhz */ -#define CONFIG_SYS_CPU_CLK 133000000 -#define CONFIG_SYS_BUS_CLK 133000000 - -/* - * For booting Linux, the board info and command line data - * have to be in the first 8 MB of memory, since this is - * the maximum mapped by the Linux kernel during initialization. - */ -#define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */ - -/*----------------------------------------------------------------------- - * FLASH organization - */ -#define CONFIG_SYS_MAX_FLASH_BANKS 1 /* Max number of flash banks */ -#define CONFIG_SYS_MAX_FLASH_SECT 8 /* Max number of sectors in one bank */ - -#define CONFIG_SYS_FLASH_ERASE_TOUT 120000 /* Timeout for Flash Erase (in ms) */ -#define CONFIG_SYS_FLASH_WRITE_TOUT 1000 /* Timeout for Flash Write (in ms) */ - -/* - * Environment is stored in NVRAM. - */ -#define CONFIG_ENV_IS_IN_NVRAM 1 -#define CONFIG_ENV_ADDR 0xFD0E0000 /* This should be 0xFD0E0000, but we skip bytes to - * protect softex's settings for now. - * Original 768 bytes where not enough. - */ -#define CONFIG_ENV_SIZE 0x8000 /* Size of the Environment. See comment above */ - -#define CONFIG_SYS_CONSOLE_IS_IN_ENV 1 /* stdin/stdout/stderr are in environment */ -#define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE 1 -#define CONFIG_ENV_OVERWRITE 1 - -/*----------------------------------------------------------------------- - * Cache Configuration - */ -#define CONFIG_SYS_CACHELINE_SIZE 32 -#if defined(CONFIG_CMD_KGDB) -# define CONFIG_SYS_CACHELINE_SHIFT 5 /* log base 2 of the above value */ -#endif - -/* - * L2 cache - */ -#define CONFIG_SYS_L2 -#define L2_INIT (L2CR_L2SIZ_2M | L2CR_L2CLK_3 | L2CR_L2RAM_BURST | \ - L2CR_L2OH_5 | L2CR_L2CTL | L2CR_L2WT) -#define L2_ENABLE (L2_INIT | L2CR_L2E) - -/* - * Internal Definitions - * - * Boot Flags - */ -#define BOOTFLAG_COLD 0x01 /* Normal Power-On: Boot from FLASH */ -#define BOOTFLAG_WARM 0x02 /* Software reboot */ - - -/*----------------------------------------------------------------------- - * IDE ATAPI Configuration - */ - -#define CONFIG_ATAPI 1 -#define CONFIG_SYS_IDE_MAXBUS 2 -#define CONFIG_SYS_IDE_MAXDEVICE 4 -#define CONFIG_ISO_PARTITION 1 - -#define CONFIG_SYS_ATA_BASE_ADDR 0xFE000000 /* was: via_get_base_addr() */ -#define CONFIG_SYS_ATA_IDE0_OFFSET 0x1F0 -#define CONFIG_SYS_ATA_IDE1_OFFSET 0x170 - -#define CONFIG_SYS_ATA_REG_OFFSET 0 -#define CONFIG_SYS_ATA_DATA_OFFSET 0 -#define CONFIG_SYS_ATA_ALT_OFFSET 0x0200 - -/*----------------------------------------------------------------------- - * Disk-On-Chip configuration - */ - -#define CONFIG_SYS_MAX_DOC_DEVICE 1 /* Max number of DOC devices */ - -#define CONFIG_SYS_DOC_SUPPORT_2000 -#undef CONFIG_SYS_DOC_SUPPORT_MILLENNIUM - -/*----------------------------------------------------------------------- - RTC -*/ -#define CONFIG_RTC_MC146818 - -/*----------------------------------------------------------------------- - * NS16550 Configuration - */ - -#define CONFIG_SYS_NS16550 - -#define CONFIG_SYS_NS16550_COM1 0xFE0003F8 -#define CONFIG_SYS_NS16550_COM2 0xFE0002F8 - -#define CONFIG_SYS_NS16550_REG_SIZE 1 - -/* base address for ISA I/O - */ -#define CONFIG_SYS_ISA_IO_BASE_ADDRESS 0xFE000000 - -/* ISA Interrupt stuff (taken from JWL) */ - -#define ISA_INT1_OCW1 0x21 -#define ISA_INT2_OCW1 0xA1 -#define ISA_INT1_OCW2 0x20 -#define ISA_INT2_OCW2 0xA0 -#define ISA_INT1_OCW3 0x20 -#define ISA_INT2_OCW3 0xA0 - -#define ISA_INT1_ICW1 0x20 -#define ISA_INT2_ICW1 0xA0 -#define ISA_INT1_ICW2 0x21 -#define ISA_INT2_ICW2 0xA1 -#define ISA_INT1_ICW3 0x21 -#define ISA_INT2_ICW3 0xA1 -#define ISA_INT1_ICW4 0x21 -#define ISA_INT2_ICW4 0xA1 - - -/* - * misc - */ - -#define CONFIG_NET_MULTI -#define CONFIG_SYS_BOARD_ASM_INIT -#define CONFIG_LAST_STAGE_INIT - -/* #define CONFIG_ETHADDR 00:09:D2:10:00:76 */ -/* #define CONFIG_IPADDR 192.168.0.2 */ -/* #define CONFIG_NETMASK 255.255.255.240 */ -/* #define CONFIG_GATEWAYIP 192.168.0.3 */ - -#define CONFIG_3COM -/* #define CONFIG_BOOTP_RANDOM_DELAY */ - -/* - * USB configuration - */ -#define CONFIG_USB_UHCI 1 -#define CONFIG_USB_STORAGE 1 -#define CONFIG_USB_KEYBOARD 1 -#define CONFIG_SYS_STDIO_DEREGISTER 1 /* needed by CONFIG_USB_KEYBOARD */ - -/* - * Autoboot stuff - */ -#define CONFIG_BOOTDELAY 5 /* Boot automatically after five seconds */ -#define CONFIG_PREBOOT "" -#define CONFIG_BOOTCOMMAND "fdcboot; diskboot" -#define CONFIG_MENUPROMPT \ - "Press any key to interrupt autoboot: %2d ", bootdelay -#define CONFIG_MENUKEY ' ' -#define CONFIG_MENUCOMMAND "menu" -/* #define CONFIG_AUTOBOOT_KEYED */ - -/* - * Extra ENV stuff - */ -#define CONFIG_EXTRA_ENV_SETTINGS \ - "stdout=vga\0" \ - "stdin=ps2kbd\0" \ - "ide_doreset=on\0" \ - "ide_maxbus=2\0" \ - "ide_cd_timeout=30\0" \ - "menucmd=menu\0" \ - "pci_irqa=9\0" \ - "pci_irqa_select=edge\0" \ - "pci_irqb=10\0" \ - "pci_irqb_select=edge\0" \ - "pci_irqc=11\0" \ - "pci_irqc_select=edge\0" \ - "pci_irqd=7\0" \ - "pci_irqd_select=edge\0" - - -/* #define CONFIG_MII 1 */ -/* #define CONFIG_BITBANGMII 1 */ - - -#endif /* __CONFIG_H */ diff --git a/include/configs/BAB7xx.h b/include/configs/BAB7xx.h index 40a1c40..4d83786 100644 --- a/include/configs/BAB7xx.h +++ b/include/configs/BAB7xx.h @@ -436,9 +436,8 @@ extern unsigned char scsi_sym53c8xx_ccf; extern unsigned long bab7xx_get_bus_freq (void); extern unsigned long bab7xx_get_gclk_freq (void); #endif -#define CONFIG_SYS_BUS_HZ bab7xx_get_bus_freq() -#define CONFIG_SYS_BUS_CLK CONFIG_SYS_BUS_HZ -#define CONFIG_SYS_CPU_CLK bab7xx_get_gclk_freq() +#define CONFIG_SYS_BUS_CLK bab7xx_get_bus_freq() +#define CONFIG_SYS_CPU_CLK bab7xx_get_gclk_freq() /* * For booting Linux, the board info and command line data diff --git a/include/configs/CPCI750.h b/include/configs/CPCI750.h index 1c8c68b..f2d51f7 100644 --- a/include/configs/CPCI750.h +++ b/include/configs/CPCI750.h @@ -234,8 +234,7 @@ #define CONFIG_SYS_LOAD_ADDR 0x00300000 /* default load address */ #define CONFIG_SYS_HZ 1000 /* decr freq: 1ms ticks */ -#define CONFIG_SYS_BUS_HZ 133000000 /* 133 MHz (CPU = 5*Bus = 666MHz) */ -#define CONFIG_SYS_BUS_CLK CONFIG_SYS_BUS_HZ +#define CONFIG_SYS_BUS_CLK 133000000 /* 133 MHz (CPU = 5*Bus = 666MHz) */ #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 } diff --git a/include/configs/DB64360.h b/include/configs/DB64360.h index 160871b..910933a 100644 --- a/include/configs/DB64360.h +++ b/include/configs/DB64360.h @@ -318,8 +318,7 @@ ip=${ipaddr}:${serverip}${bootargs_end}; bootm 0x400000;\0" #define CONFIG_SYS_HZ 1000 /* decr freq: 1ms ticks */ /*ronen - this the Sys clock (cpu bus,internal dram and SDRAM) */ -#define CONFIG_SYS_BUS_HZ 133000000 /* 133 MHz (CPU = 5*Bus = 666MHz) */ -#define CONFIG_SYS_BUS_CLK CONFIG_SYS_BUS_HZ +#define CONFIG_SYS_BUS_CLK 133000000 /* 133 MHz (CPU = 5*Bus = 666MHz) */ #define CONFIG_SYS_DDR_SDRAM_CYCLE_COUNT_LOP 7 /* define the SDRAM cycle count */ #define CONFIG_SYS_DDR_SDRAM_CYCLE_COUNT_ROP 50 /* for 400MHZ -> 5.0 ns, for 133MHZ -> 7.50 ns */ diff --git a/include/configs/DB64460.h b/include/configs/DB64460.h index 06fd157..765eaaf 100644 --- a/include/configs/DB64460.h +++ b/include/configs/DB64460.h @@ -256,8 +256,7 @@ ip=${ipaddr}:${serverip}${bootargs_end}; bootm 0x400000;\0" #define CONFIG_SYS_HZ 1000 /* decr freq: 1ms ticks */ /*ronen - this the Sys clock (cpu bus,internal dram and SDRAM) */ -#define CONFIG_SYS_BUS_HZ 133000000 /* 133 MHz (CPU = 5*Bus = 666MHz) */ -#define CONFIG_SYS_BUS_CLK CONFIG_SYS_BUS_HZ +#define CONFIG_SYS_BUS_CLK 133000000 /* 133 MHz (CPU = 5*Bus = 666MHz) */ #define CONFIG_SYS_DDR_SDRAM_CYCLE_COUNT_LOP 7 /* define the SDRAM cycle count */ #define CONFIG_SYS_DDR_SDRAM_CYCLE_COUNT_ROP 50 /* for 200MHZ -> 5.0 ns, 166MHZ -> 6.0, 133MHZ -> 7.50 ns */ diff --git a/include/configs/ELPPC.h b/include/configs/ELPPC.h index d2aa8b9..84d27b6 100644 --- a/include/configs/ELPPC.h +++ b/include/configs/ELPPC.h @@ -314,9 +314,8 @@ /* * Speed settings are board specific */ -#define CONFIG_SYS_BUS_HZ 100000000 -#define CONFIG_SYS_CPU_CLK 400000000 -#define CONFIG_SYS_BUS_CLK CONFIG_SYS_BUS_HZ +#define CONFIG_SYS_BUS_CLK 100000000 +#define CONFIG_SYS_CPU_CLK 400000000 /* * For booting Linux, the board info and command line data diff --git a/include/configs/EVB64260.h b/include/configs/EVB64260.h index bf41c13..0903536 100644 --- a/include/configs/EVB64260.h +++ b/include/configs/EVB64260.h @@ -141,8 +141,7 @@ #define CONFIG_SYS_LOAD_ADDR 0x00300000 /* default load address */ #define CONFIG_SYS_HZ 1000 /* decr freq: 1ms ticks */ -#define CONFIG_SYS_BUS_HZ 100000000 /* 100 MHz */ -#define CONFIG_SYS_BUS_CLK CONFIG_SYS_BUS_HZ +#define CONFIG_SYS_BUS_CLK 100000000 /* 100 MHz */ #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 } diff --git a/include/configs/P3G4.h b/include/configs/P3G4.h index 971338a..890170d 100644 --- a/include/configs/P3G4.h +++ b/include/configs/P3G4.h @@ -168,8 +168,7 @@ #define CONFIG_SYS_LOAD_ADDR 0x00300000 /* default load address */ #define CONFIG_SYS_HZ 1000 /* decr freq: 1ms ticks */ -#define CONFIG_SYS_BUS_HZ 133000000 /* 133 MHz */ -#define CONFIG_SYS_BUS_CLK CONFIG_SYS_BUS_HZ +#define CONFIG_SYS_BUS_CLK 133000000 /* 133 MHz */ #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 } diff --git a/include/configs/PCIPPC2.h b/include/configs/PCIPPC2.h index 99a8c4a..c30ac78 100644 --- a/include/configs/PCIPPC2.h +++ b/include/configs/PCIPPC2.h @@ -194,9 +194,8 @@ * For the detail description refer to the PCIPPC2 user's manual. */ #define CONFIG_SYS_HZ 1000 -#define CONFIG_SYS_BUS_HZ 100000000 /* bus speed - 100 mhz */ +#define CONFIG_SYS_BUS_CLK 100000000 /* bus speed - 100 mhz */ #define CONFIG_SYS_CPU_CLK 300000000 -#define CONFIG_SYS_BUS_CLK 100000000 /* * For booting Linux, the board info and command line data diff --git a/include/configs/PCIPPC6.h b/include/configs/PCIPPC6.h index 66e6d24..bc67480 100644 --- a/include/configs/PCIPPC6.h +++ b/include/configs/PCIPPC6.h @@ -196,9 +196,8 @@ * For the detail description refer to the PCIPPC2 user's manual. */ #define CONFIG_SYS_HZ 1000 -#define CONFIG_SYS_BUS_HZ 100000000 /* bus speed - 100 mhz */ +#define CONFIG_SYS_BUS_CLK 100000000 /* bus speed - 100 mhz */ #define CONFIG_SYS_CPU_CLK 300000000 -#define CONFIG_SYS_BUS_CLK 100000000 /* * For booting Linux, the board info and command line data diff --git a/include/configs/ZUMA.h b/include/configs/ZUMA.h index b73aaa8..fcc47a9 100644 --- a/include/configs/ZUMA.h +++ b/include/configs/ZUMA.h @@ -164,9 +164,7 @@ #define CONFIG_SYS_HZ 1000 /* decr freq: 1ms ticks */ -#define CONFIG_SYS_BUS_HZ 133000000 /* 133 MHz */ - -#define CONFIG_SYS_BUS_CLK CONFIG_SYS_BUS_HZ +#define CONFIG_SYS_BUS_CLK 133000000 /* 133 MHz */ #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 } diff --git a/include/configs/da830evm.h b/include/configs/da830evm.h index 0f58e11..160ece2 100644 --- a/include/configs/da830evm.h +++ b/include/configs/da830evm.h @@ -87,6 +87,7 @@ * Network & Ethernet Configuration */ #ifdef CONFIG_DRIVER_TI_EMAC +#define CONFIG_EMAC_MDIO_PHY_NUM 1 #define CONFIG_MII #define CONFIG_BOOTP_DEFAULT #define CONFIG_BOOTP_DNS diff --git a/include/configs/davinci_dm365evm.h b/include/configs/davinci_dm365evm.h index 6f99ae0..2c3d88d 100644 --- a/include/configs/davinci_dm365evm.h +++ b/include/configs/davinci_dm365evm.h @@ -58,6 +58,7 @@ /* Network Configuration */ #define CONFIG_DRIVER_TI_EMAC +#define CONFIG_EMAC_MDIO_PHY_NUM 0 #define CONFIG_MII #define CONFIG_BOOTP_DEFAULT #define CONFIG_BOOTP_DNS diff --git a/include/configs/davinci_dvevm.h b/include/configs/davinci_dvevm.h index 5774df5..aab2afa 100644 --- a/include/configs/davinci_dvevm.h +++ b/include/configs/davinci_dvevm.h @@ -102,6 +102,7 @@ /* Network & Ethernet Configuration */ /*==================================*/ #define CONFIG_DRIVER_TI_EMAC +#define CONFIG_EMAC_MDIO_PHY_NUM 1 #define CONFIG_MII #define CONFIG_BOOTP_DEFAULT #define CONFIG_BOOTP_DNS diff --git a/include/configs/davinci_schmoogie.h b/include/configs/davinci_schmoogie.h index 3972ebc..875dda4 100644 --- a/include/configs/davinci_schmoogie.h +++ b/include/configs/davinci_schmoogie.h @@ -69,6 +69,7 @@ /* Network & Ethernet Configuration */ /*==================================*/ #define CONFIG_DRIVER_TI_EMAC +#define CONFIG_EMAC_MDIO_PHY_NUM 1 #define CONFIG_MII #define CONFIG_BOOTP_DEFAULT #define CONFIG_BOOTP_DNS diff --git a/include/configs/davinci_sffsdr.h b/include/configs/davinci_sffsdr.h index 94be9dc..f4e17f8 100644 --- a/include/configs/davinci_sffsdr.h +++ b/include/configs/davinci_sffsdr.h @@ -66,6 +66,7 @@ #define CONFIG_SYS_I2C_SLAVE 10 /* Bogus, master-only in U-Boot */ /* Network & Ethernet Configuration */ #define CONFIG_DRIVER_TI_EMAC +#define CONFIG_EMAC_MDIO_PHY_NUM 1 #define CONFIG_MII #define CONFIG_BOOTP_DEFAULT #define CONFIG_BOOTP_DNS diff --git a/include/configs/davinci_sonata.h b/include/configs/davinci_sonata.h index 490821a..4c01844 100644 --- a/include/configs/davinci_sonata.h +++ b/include/configs/davinci_sonata.h @@ -102,6 +102,7 @@ /* Network & Ethernet Configuration */ /*==================================*/ #define CONFIG_DRIVER_TI_EMAC +#define CONFIG_EMAC_MDIO_PHY_NUM 1 #define CONFIG_MII #define CONFIG_BOOTP_DEFAULT #define CONFIG_BOOTP_DNS diff --git a/include/configs/icon.h b/include/configs/icon.h index 3a57d69..7a4e60c 100644 --- a/include/configs/icon.h +++ b/include/configs/icon.h @@ -143,6 +143,26 @@ #define CONFIG_SYS_M41T11_BASE_YEAR 1900 /* play along with linux */ /* + * Video options + */ +#define CONFIG_VIDEO + +#ifdef CONFIG_VIDEO +#define CONFIG_VIDEO_SM501 +#define CONFIG_VIDEO_SM501_32BPP +#define CONFIG_VIDEO_SM501_PCI +#define VIDEO_FB_LITTLE_ENDIAN +#define CONFIG_CFB_CONSOLE +#define CONFIG_VIDEO_LOGO +#define CONFIG_CONSOLE_EXTRA_INFO +#define CONFIG_VGA_AS_SINGLE_DEVICE +#define CONFIG_VIDEO_SW_CURSOR +#define CONFIG_VIDEO_BMP_RLE8 +#define CONFIG_SPLASH_SCREEN +#define CFG_CONSOLE_IS_IN_ENV +#endif + +/* * Environment */ #define CONFIG_ENV_IS_IN_FLASH 1 /* Environment uses flash */ @@ -171,6 +191,9 @@ #define CONFIG_CMD_PCI #define CONFIG_CMD_SDRAM #define CONFIG_CMD_SNTP +#ifdef CONFIG_VIDEO +#define CONFIG_CMD_BMP +#endif #define CONFIG_IBM_EMAC4_V4 /* 440SPe has this EMAC version */ #define CONFIG_PHY_ADDR 1 /* PHY address, See schematics */ diff --git a/include/configs/mpc7448hpc2.h b/include/configs/mpc7448hpc2.h index be12186..497ea42 100644 --- a/include/configs/mpc7448hpc2.h +++ b/include/configs/mpc7448hpc2.h @@ -46,7 +46,7 @@ #define CONFIG_IDENT_STRING " Freescale MPC7448 HPC II" #define CONFIG_SYS_OCN_CLK 133000000 /* 133 MHz */ -#define CONFIG_SYS_CONFIG_BUS_CLK 133000000 +#define CONFIG_SYS_BUS_CLK 133000000 #define CONFIG_SYS_CLK_SPREAD /* Enable Spread-Spectrum Clock generation */ diff --git a/include/configs/p3mx.h b/include/configs/p3mx.h index 0749037..17ec08f 100644 --- a/include/configs/p3mx.h +++ b/include/configs/p3mx.h @@ -44,14 +44,12 @@ #define CONFIG_750FX /* 750GL/GX/FX */ #define CONFIG_HIGH_BATS /* High BATs supported */ #define CONFIG_SYS_BOARD_NAME "P3M750" -#define CONFIG_SYS_BUS_HZ 100000000 -#define CONFIG_SYS_BUS_CLK CONFIG_SYS_BUS_HZ +#define CONFIG_SYS_BUS_CLK 100000000 #define CONFIG_SYS_TCLK 100000000 #elif defined (CONFIG_P3M7448) #define CONFIG_74xx #define CONFIG_SYS_BOARD_NAME "P3M7448" -#define CONFIG_SYS_BUS_HZ 133333333 -#define CONFIG_SYS_BUS_CLK CONFIG_SYS_BUS_HZ +#define CONFIG_SYS_BUS_CLK 133333333 #define CONFIG_SYS_TCLK 133333333 #endif #define CONFIG_SYS_GT_DUAL_CPU /* also for JTAG even with one cpu */ diff --git a/include/configs/ppmc7xx.h b/include/configs/ppmc7xx.h index 0fd8635..04779c4 100644 --- a/include/configs/ppmc7xx.h +++ b/include/configs/ppmc7xx.h @@ -355,12 +355,10 @@ /* * Clocks config * - * CONFIG_SYS_BUS_HZ - Bus clock frequency in Hz - * CONFIG_SYS_BUS_CLK - As above (?) + * CONFIG_SYS_BUS_CLK - Bus clock frequency in Hz * CONFIG_SYS_HZ - Decrementer freq in Hz */ -#define CONFIG_SYS_BUS_HZ CONFIG_BUS_CLK #define CONFIG_SYS_BUS_CLK CONFIG_BUS_CLK #define CONFIG_SYS_HZ 1000 diff --git a/include/image.h b/include/image.h index 294eba5..366b622 100644 --- a/include/image.h +++ b/include/image.h @@ -362,23 +362,23 @@ static inline uint32_t image_get_header_size (void) { \ return uimage_to_cpu (hdr->ih_##f); \ } -image_get_hdr_l (magic); /* image_get_magic */ -image_get_hdr_l (hcrc); /* image_get_hcrc */ -image_get_hdr_l (time); /* image_get_time */ -image_get_hdr_l (size); /* image_get_size */ -image_get_hdr_l (load); /* image_get_load */ -image_get_hdr_l (ep); /* image_get_ep */ -image_get_hdr_l (dcrc); /* image_get_dcrc */ +image_get_hdr_l (magic) /* image_get_magic */ +image_get_hdr_l (hcrc) /* image_get_hcrc */ +image_get_hdr_l (time) /* image_get_time */ +image_get_hdr_l (size) /* image_get_size */ +image_get_hdr_l (load) /* image_get_load */ +image_get_hdr_l (ep) /* image_get_ep */ +image_get_hdr_l (dcrc) /* image_get_dcrc */ #define image_get_hdr_b(f) \ static inline uint8_t image_get_##f(const image_header_t *hdr) \ { \ return hdr->ih_##f; \ } -image_get_hdr_b (os); /* image_get_os */ -image_get_hdr_b (arch); /* image_get_arch */ -image_get_hdr_b (type); /* image_get_type */ -image_get_hdr_b (comp); /* image_get_comp */ +image_get_hdr_b (os) /* image_get_os */ +image_get_hdr_b (arch) /* image_get_arch */ +image_get_hdr_b (type) /* image_get_type */ +image_get_hdr_b (comp) /* image_get_comp */ static inline char *image_get_name (const image_header_t *hdr) { @@ -420,23 +420,23 @@ static inline ulong image_get_image_end (const image_header_t *hdr) { \ hdr->ih_##f = cpu_to_uimage (val); \ } -image_set_hdr_l (magic); /* image_set_magic */ -image_set_hdr_l (hcrc); /* image_set_hcrc */ -image_set_hdr_l (time); /* image_set_time */ -image_set_hdr_l (size); /* image_set_size */ -image_set_hdr_l (load); /* image_set_load */ -image_set_hdr_l (ep); /* image_set_ep */ -image_set_hdr_l (dcrc); /* image_set_dcrc */ +image_set_hdr_l (magic) /* image_set_magic */ +image_set_hdr_l (hcrc) /* image_set_hcrc */ +image_set_hdr_l (time) /* image_set_time */ +image_set_hdr_l (size) /* image_set_size */ +image_set_hdr_l (load) /* image_set_load */ +image_set_hdr_l (ep) /* image_set_ep */ +image_set_hdr_l (dcrc) /* image_set_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_os */ -image_set_hdr_b (arch); /* image_set_arch */ -image_set_hdr_b (type); /* image_set_type */ -image_set_hdr_b (comp); /* image_set_comp */ +image_set_hdr_b (os) /* image_set_os */ +image_set_hdr_b (arch) /* image_set_arch */ +image_set_hdr_b (type) /* image_set_type */ +image_set_hdr_b (comp) /* image_set_comp */ static inline void image_set_name (image_header_t *hdr, const char *name) { diff --git a/include/pci_ids.h b/include/pci_ids.h index edfdc1e..dcc381d 100644 --- a/include/pci_ids.h +++ b/include/pci_ids.h @@ -1454,6 +1454,7 @@ #define PCI_DEVICE_ID_SMI_710 0x0710 #define PCI_DEVICE_ID_SMI_712 0x0712 #define PCI_DEVICE_ID_SMI_810 0x0810 +#define PCI_DEVICE_ID_SMI_501 0x0501 #define PCI_VENDOR_ID_HUGHES 0x1273 #define PCI_DEVICE_ID_HUGHES_DIRECPC 0x0002 @@ -12,23 +12,53 @@ APPEND=no # Default: Create new config file BOARD_NAME="" # Name to print in make output TARGETS="" +arch="" +cpu="" +board="" +vendor="" +soc="" + +if [ \( $# -eq 2 \) -a \( "$1" = "-A" \) ] ; then + # Automatic mode + line=`egrep -i "^[[:space:]]*${2}[[:space:]]" boards.cfg` || { + echo "make: *** No rule to make target \`$2_config'. Stop." >&2 + exit 1 + } + + set ${line} + # add default board name if needed + [ $# = 3 ] && set ${line} ${1} +fi + while [ $# -gt 0 ] ; do case "$1" in --) shift ; break ;; -a) shift ; APPEND=yes ;; - -n) shift ; BOARD_NAME="${1%%_config}" ; shift ;; + -n) shift ; BOARD_NAME="${1%_config}" ; shift ;; -t) shift ; TARGETS="`echo $1 | sed 's:_: :g'` ${TARGETS}" ; shift ;; *) break ;; esac done -[ "${BOARD_NAME}" ] || BOARD_NAME="$1" - [ $# -lt 4 ] && exit 1 [ $# -gt 6 ] && exit 1 -if [ "${ARCH}" -a "${ARCH}" != "$2" ]; then - echo "Failed: \$ARCH=${ARCH}, should be '$2' for ${BOARD_NAME}" 1>&2 +CONFIG_NAME="${1%_config}" + +[ "${BOARD_NAME}" ] || BOARD_NAME="${CONFIG_NAME}" + +arch="$2" +cpu="$3" +if [ "$4" = "-" ] ; then + board=${BOARD_NAME} +else + board="$4" +fi +[ $# -gt 4 ] && [ "$5" != "-" ] && vendor="$5" +[ $# -gt 5 ] && [ "$6" != "-" ] && soc="$6" + +if [ "${ARCH}" -a "${ARCH}" != "${arch}" ]; then + echo "Failed: \$ARCH=${ARCH}, should be '${arch}' for ${BOARD_NAME}" 1>&2 exit 1 fi @@ -42,26 +72,26 @@ if [ "$SRCTREE" != "$OBJTREE" ] ; then mkdir -p ${OBJTREE}/include2 cd ${OBJTREE}/include2 rm -f asm - ln -s ${SRCTREE}/arch/$2/include/asm asm - LNPREFIX=${SRCTREE}/arch/$2/include/asm/ + ln -s ${SRCTREE}/arch/${arch}/include/asm asm + LNPREFIX=${SRCTREE}/arch/${arch}/include/asm/ cd ../include rm -f asm - ln -s ${SRCTREE}/arch/$2/include/asm asm + ln -s ${SRCTREE}/arch/${arch}/include/asm asm else cd ./include rm -f asm - ln -s ../arch/$2/include/asm asm + ln -s ../arch/${arch}/include/asm asm fi rm -f asm/arch -if [ -z "$6" -o "$6" = "NULL" ] ; then - ln -s ${LNPREFIX}arch-$3 asm/arch +if [ -z "${soc}" ] ; then + ln -s ${LNPREFIX}arch-${cpu} asm/arch else - ln -s ${LNPREFIX}arch-$6 asm/arch + ln -s ${LNPREFIX}arch-${soc} asm/arch fi -if [ "$2" = "arm" ] ; then +if [ "${arch}" = "arm" ] ; then rm -f asm/proc ln -s ${LNPREFIX}proc-armv asm/proc fi @@ -69,19 +99,19 @@ fi # # Create include file for Make # -echo "ARCH = $2" > config.mk -echo "CPU = $3" >> config.mk -echo "BOARD = $4" >> config.mk +echo "ARCH = ${arch}" > config.mk +echo "CPU = ${cpu}" >> config.mk +echo "BOARD = ${board}" >> config.mk -[ "$5" ] && [ "$5" != "NULL" ] && echo "VENDOR = $5" >> config.mk +[ "${vendor}" ] && echo "VENDOR = ${vendor}" >> config.mk -[ "$6" ] && [ "$6" != "NULL" ] && echo "SOC = $6" >> config.mk +[ "${soc}" ] && echo "SOC = ${soc}" >> config.mk # Assign board directory to BOARDIR variable -if [ -z "$5" -o "$5" = "NULL" ] ; then - BOARDDIR=$4 +if [ -z "${vendor}" ] ; then + BOARDDIR=${board} else - BOARDDIR=$5/$4 + BOARDDIR=${vendor}/${board} fi # @@ -102,7 +132,7 @@ done cat << EOF >> config.h #define CONFIG_BOARDDIR board/$BOARDDIR #include <config_defaults.h> -#include <configs/$1.h> +#include <configs/${CONFIG_NAME}.h> #include <asm/config.h> EOF diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index a46205d..04f3bf0 100644 --- a/tools/env/fw_env.c +++ b/tools/env/fw_env.c @@ -45,8 +45,7 @@ #include "fw_env.h" -#define CMD_GETENV "fw_printenv" -#define CMD_SETENV "fw_setenv" +#define WHITESPACE(c) ((c == '\t') || (c == ' ')) #define min(x, y) ({ \ typeof(x) _min1 = (x); \ @@ -210,7 +209,6 @@ static char default_environment[] = { static int flash_io (int mode); static char *envmatch (char * s1, char * s2); -static int env_init (void); static int parse_config (void); #if defined(CONFIG_FILE) @@ -225,6 +223,22 @@ static inline ulong getenvsize (void) return rc; } +static char *fw_string_blank(char *s, int noblank) +{ + int i; + int len = strlen(s); + + for (i = 0; i < len; i++, s++) { + if ((noblank && !WHITESPACE(*s)) || + (!noblank && WHITESPACE(*s))) + break; + } + if (i == len) + return NULL; + + return s; +} + /* * Search the environment for a variable. * Return the value, if found, or NULL, if not found. @@ -233,7 +247,7 @@ char *fw_getenv (char *name) { char *env, *nxt; - if (env_init ()) + if (fw_env_open()) return NULL; for (env = environment.data; *env; env = nxt + 1) { @@ -264,7 +278,7 @@ int fw_printenv (int argc, char *argv[]) int i, n_flag; int rc = 0; - if (env_init ()) + if (fw_env_open()) return -1; if (argc == 1) { /* Print all env variables */ @@ -327,30 +341,34 @@ int fw_printenv (int argc, char *argv[]) return rc; } -/* - * Deletes or sets environment variables. Returns -1 and sets errno error codes: - * 0 - OK - * EINVAL - need at least 1 argument - * EROFS - certain variables ("ethaddr", "serial#") cannot be - * modified or deleted - * - */ -int fw_setenv (int argc, char *argv[]) +int fw_env_close(void) { - int i, len; - char *env, *nxt; - char *oldval = NULL; - char *name; + /* + * Update CRC + */ + *environment.crc = crc32(0, (uint8_t *) environment.data, ENV_SIZE); - if (argc < 2) { - errno = EINVAL; - return -1; + /* write environment back to flash */ + if (flash_io(O_RDWR)) { + fprintf(stderr, + "Error: can't write fw_env to flash\n"); + return -1; } - if (env_init ()) - return -1; + return 0; +} - name = argv[1]; + +/* + * Set/Clear a single variable in the environment. + * This is called in sequence to update the environment + * in RAM without updating the copy in flash after each set + */ +int fw_env_write(char *name, char *value) +{ + int len; + char *env, *nxt; + char *oldval = NULL; /* * search if variable with this name already exists @@ -358,7 +376,7 @@ int fw_setenv (int argc, char *argv[]) for (nxt = env = environment.data; *env; env = nxt + 1) { for (nxt = env; *nxt; ++nxt) { if (nxt >= &environment.data[ENV_SIZE]) { - fprintf (stderr, "## Error: " + fprintf(stderr, "## Error: " "environment not terminated\n"); errno = EINVAL; return -1; @@ -396,8 +414,8 @@ int fw_setenv (int argc, char *argv[]) } /* Delete only ? */ - if (argc < 3) - goto WRITE_FLASH; + if (!value || !strlen(value)) + return 0; /* * Append new definition at the end @@ -411,41 +429,202 @@ int fw_setenv (int argc, char *argv[]) */ len = strlen (name) + 2; /* add '=' for first arg, ' ' for all others */ - for (i = 2; i < argc; ++i) { - len += strlen (argv[i]) + 1; - } + len += strlen(value) + 1; + if (len > (&environment.data[ENV_SIZE] - env)) { fprintf (stderr, "Error: environment overflow, \"%s\" deleted\n", name); return -1; } + while ((*env = *name++) != '\0') env++; + *env = '='; + while ((*++env = *value++) != '\0') + ; + + /* end is marked with double '\0' */ + *++env = '\0'; + + return 0; +} + +/* + * Deletes or sets environment variables. Returns -1 and sets errno error codes: + * 0 - OK + * EINVAL - need at least 1 argument + * EROFS - certain variables ("ethaddr", "serial#") cannot be + * modified or deleted + * + */ +int fw_setenv(int argc, char *argv[]) +{ + int i, len; + char *name; + char *value = NULL; + char *tmpval = NULL; + + if (argc < 2) { + errno = EINVAL; + return -1; + } + + if (fw_env_open()) { + fprintf(stderr, "Error: environment not initialized\n"); + return -1; + } + + name = argv[1]; + + len = strlen(name) + 2; + for (i = 2; i < argc; ++i) + len += strlen(argv[i]) + 1; + + /* Allocate enough place to the data string */ for (i = 2; i < argc; ++i) { char *val = argv[i]; - - *env = (i == 2) ? '=' : ' '; - while ((*++env = *val++) != '\0'); + if (!value) { + value = (char *)malloc(len - strlen(name)); + if (!value) { + fprintf(stderr, + "Cannot malloc %u bytes: %s\n", + len - strlen(name), strerror(errno)); + return -1; + } + memset(value, 0, len - strlen(name)); + tmpval = value; + } + if (i != 2) + *tmpval++ = ' '; + while (*val != '\0') + *tmpval++ = *val++; } - /* end is marked with double '\0' */ - *++env = '\0'; + fw_env_write(name, value); - WRITE_FLASH: + if (value) + free(value); - /* - * Update CRC - */ - *environment.crc = crc32 (0, (uint8_t *) environment.data, ENV_SIZE); + return fw_env_close(); +} - /* write environment back to flash */ - if (flash_io (O_RDWR)) { - fprintf (stderr, "Error: can't write fw_env to flash\n"); +/* + * Parse a file and configure the u-boot variables. + * The script file has a very simple format, as follows: + * + * Each line has a couple with name, value: + * <white spaces>variable_name<white spaces>variable_value + * + * Both variable_name and variable_value are interpreted as strings. + * Any character after <white spaces> and before ending \r\n is interpreted + * as variable's value (no comment allowed on these lines !) + * + * Comments are allowed if the first character in the line is # + * + * Returns -1 and sets errno error codes: + * 0 - OK + * -1 - Error + */ +int fw_parse_script(char *fname) +{ + FILE *fp; + char dump[1024]; /* Maximum line length in the file */ + char *name; + char *val; + int lineno = 0; + int len; + int ret = 0; + + if (fw_env_open()) { + fprintf(stderr, "Error: environment not initialized\n"); return -1; } - return 0; + if (strcmp(fname, "-") == 0) + fp = stdin; + else { + fp = fopen(fname, "r"); + if (fp == NULL) { + fprintf(stderr, "I cannot open %s for reading\n", + fname); + return -1; + } + } + + while (fgets(dump, sizeof(dump), fp)) { + lineno++; + len = strlen(dump); + + /* + * Read a whole line from the file. If the line is too long + * or is not terminated, reports an error and exit. + */ + if (dump[len - 1] != '\n') { + fprintf(stderr, + "Line %d not corrected terminated or too long\n", + lineno); + ret = -1; + break; + } + + /* Drop ending line feed / carriage return */ + while (len > 0 && (dump[len - 1] == '\n' || + dump[len - 1] == '\r')) { + dump[len - 1] = '\0'; + len--; + } + + /* Skip comment or empty lines */ + if ((len == 0) || dump[0] == '#') + continue; + + /* + * Search for variable's name, + * remove leading whitespaces + */ + name = fw_string_blank(dump, 1); + if (!name) + continue; + + /* The first white space is the end of variable name */ + val = fw_string_blank(name, 0); + len = strlen(name); + if (val) { + *val++ = '\0'; + if ((val - name) < len) + val = fw_string_blank(val, 1); + else + val = NULL; + } + +#ifdef DEBUG + fprintf(stderr, "Setting %s : %s\n", + name, val ? val : " removed"); +#endif + + /* + * If there is an error setting a variable, + * try to save the environment and returns an error + */ + if (fw_env_write(name, val)) { + fprintf(stderr, + "fw_env_write returns with error : %s\n", + strerror(errno)); + ret = -1; + break; + } + + } + + /* Close file if not stdin */ + if (strcmp(fname, "-") != 0) + fclose(fp); + + ret |= fw_env_close(); + + return ret; + } /* @@ -880,7 +1059,7 @@ static char *envmatch (char * s1, char * s2) /* * Prevent confusion if running from erased flash memory */ -static int env_init (void) +int fw_env_open(void) { int crc0, crc0_ok; char flag0; diff --git a/tools/env/fw_env.h b/tools/env/fw_env.h index c04da54..8130fa1 100644 --- a/tools/env/fw_env.h +++ b/tools/env/fw_env.h @@ -50,5 +50,9 @@ extern int fw_printenv(int argc, char *argv[]); extern char *fw_getenv (char *name); extern int fw_setenv (int argc, char *argv[]); +extern int fw_parse_script(char *fname); +extern int fw_env_open(void); +extern int fw_env_write(char *name, char *value); +extern int fw_env_close(void); extern unsigned long crc32 (unsigned long, const unsigned char *, unsigned); diff --git a/tools/env/fw_env_main.c b/tools/env/fw_env_main.c index 7f631c4..82116b4 100644 --- a/tools/env/fw_env_main.c +++ b/tools/env/fw_env_main.c @@ -42,34 +42,87 @@ #include <stdio.h> #include <string.h> #include <stdlib.h> +#include <getopt.h> #include "fw_env.h" #define CMD_PRINTENV "fw_printenv" #define CMD_SETENV "fw_setenv" +static struct option long_options[] = { + {"script", required_argument, NULL, 's'}, + {"help", no_argument, NULL, 'h'}, + {NULL, 0, NULL, 0} +}; + +void usage(void) +{ + + fprintf(stderr, "fw_printenv/fw_setenv, " + "a command line interface to U-Boot environment\n\n" + "usage:\tfw_printenv\n" + "\tfw_setenv [variable name] [variable value]\n" + "\tfw_setenv -s [ file ]\n" + "\tfw_setenv -s - < [ file ]\n\n" + "The file passed as argument contains only pairs " + "name / value\n" + "Example:\n" + "# Any line starting with # is treated as comment\n" + "\n" + "\t netdev eth0\n" + "\t kernel_addr 400000\n" + "\t var1\n" + "\t var2 The quick brown fox jumps over the " + "lazy dog\n" + "\n" + "A variable without value will be dropped. It is possible\n" + "to put any number of spaces between the fields, but any\n" + "space inside the value is treated as part of the value " + "itself.\n\n" + ); +} + int main(int argc, char *argv[]) { char *p; char *cmdname = *argv; + char *script_file = NULL; + int c; if ((p = strrchr (cmdname, '/')) != NULL) { cmdname = p + 1; } + while ((c = getopt_long (argc, argv, "s:h", + long_options, NULL)) != EOF) { + switch (c) { + case 's': + script_file = optarg; + break; + case 'h': + usage(); + return EXIT_SUCCESS; + } + } + + if (strcmp(cmdname, CMD_PRINTENV) == 0) { if (fw_printenv (argc, argv) != 0) - return (EXIT_FAILURE); + return EXIT_FAILURE; - return (EXIT_SUCCESS); + return EXIT_SUCCESS; } else if (strcmp(cmdname, CMD_SETENV) == 0) { + if (!script_file) { + if (fw_setenv(argc, argv) != 0) + return EXIT_FAILURE; + } else { + if (fw_parse_script(script_file) != 0) + return EXIT_FAILURE; + } - if (fw_setenv (argc, argv) != 0) - return (EXIT_FAILURE); - - return (EXIT_SUCCESS); + return EXIT_SUCCESS; } @@ -77,5 +130,5 @@ main(int argc, char *argv[]) "Identity crisis - may be called as `" CMD_PRINTENV "' or as `" CMD_SETENV "' but not as `%s'\n", cmdname); - return (EXIT_FAILURE); + return EXIT_FAILURE; } |