summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2008-06-03SPI API improvementsHaavard Skinnemoen
This patch gets rid of the spi_chipsel table and adds a handful of new functions that makes the SPI layer cleaner and more flexible. Instead of the spi_chipsel table, each board that wants to use SPI gets to implement three hooks: * spi_cs_activate(): Activates the chipselect for a given slave * spi_cs_deactivate(): Deactivates the chipselect for a given slave * spi_cs_is_valid(): Determines if the given bus/chipselect combination can be activated. Not all drivers may need those extra functions however. If that's the case, the board code may just leave them out (assuming they know what the driver needs) or rely on the linker to strip them out (assuming --gc-sections is being used.) To set up communication parameters for a given slave, the driver needs to call spi_setup_slave(). This returns a pointer to an opaque spi_slave struct which must be passed as a parameter to subsequent SPI calls. This struct can be freed by calling spi_free_slave(), but most driver probably don't want to do this. Before starting one or more SPI transfers, the driver must call spi_claim_bus() to gain exclusive access to the SPI bus and initialize the hardware. When all transfers are done, the driver must call spi_release_bus() to make the bus available to others, and possibly shut down the SPI controller hardware. spi_xfer() behaves mostly the same as before, but it now takes a spi_slave parameter instead of a spi_chipsel function pointer. It also got a new parameter, flags, which is used to specify chip select behaviour. This may be extended with other flags in the future. This patch has been build-tested on all powerpc and arm boards involved. I have not tested NIOS since I don't have a toolchain for it installed, so I expect some breakage there even though I've tried fixing up everything I could find by visual inspection. I have run-time tested this on AVR32 ATNGW100 using the atmel_spi and DataFlash drivers posted as a follow-up. I'd like some help testing other boards that use the existing SPI API. But most of all, I'd like some comments on the new API. Is this stuff usable for everyone? If not, why? Changed in v4: - Build fixes for various boards, drivers and commands - Provide common struct spi_slave definition that can be extended by drivers - Pass a struct spi_slave * to spi_cs_activate and spi_cs_deactivate - Make default bus and mode build-time configurable - Override default SPI bus ID and mode on mx32ads and imx31_litekit. Changed in v3: - Add opaque struct spi_slave for controller-specific data associated with a slave. - Add spi_claim_bus() and spi_release_bus() - Add spi_free_slave() - spi_setup() is now called spi_setup_slave() and returns a struct spi_slave - soft_spi now supports four SPI modes (CPOL|CPHA) - Add bus parameter to spi_setup_slave() - Convert the new i.MX32 SPI driver - Convert the new MC13783 RTC driver Changed in v2: - Convert the mpc8xxx_spi driver and the mpc8349emds board to the new API. Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com> Tested-by: Guennadi Liakhovetski <lg@denx.de>
2008-06-03Move definition of container_of() to common.hHaavard Skinnemoen
AVR32 and AT91SAM9 both have their own identical definitions of container_of() taken from the Linux kernel. Move it to common.h so that all architectures can use it. container_of() is already used by some drivers, and will be used extensively by the new and improved SPI API. Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-06-03Fix warnings from gcc-4.3.0 build on a ppc hostKumar Gala
* The cfi_flash.c memset fix actual allows the board to boot so there is a bit more going on here than just resolving warnings associated with uninitialized variables. * include/asm/bitops.h:302: warning: '__swab32p' is static but used in inline function 'ext2_find_next_zero_bit' which is not static Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2008-06-03Avoid initrd and logbuffer area overlapsMarian Balakowicz
Add logbuffer to reserved LMB areas to prevent initrd allocation from overlaping with it. Make sure to use correct logbuffer base address. Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-06-03PPC: Add print_bats() to lib_ppc/bat_rw.cBecky Bruce
This function prints the values of all the BAT register pairs - I needed this for debug earlier this week; adding it to lib_ppc so others can use it (and add it to reginfo commands if so desired). Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
2008-06-03PPC: Change lib_ppc/bat_rw.c to use high batsBecky Bruce
Currently, this code only deals with BATs 0-3, which makes it useless on systems that support BATs 4-7. Add the support for these registers. Signed-off-by: Becky Bruce <Becky.bruce@freescale.com>
2008-06-03PPC: Create and use CONFIG_HIGH_BATSBecky Bruce
Change all code that conditionally operates on high bat registers (that is, BATs 4-7) to look at CONFIG_HIGH_BATS instead of the myriad ways this is done now. Define the option for every config for which high bats are supported (and enabled by early boot, on parts where they're not always enabled) Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
2008-06-02Merge remote branch 'u-boot-at91/for-1.3.4'Wolfgang Denk
2008-06-02Merge remote branch 'u-boot-avr32/master'Wolfgang Denk
2008-06-02Merge remote branch 'u-boot-nand-flash/master'Wolfgang Denk
2008-06-02Merge remote branch 'u-boot-mips/master'Wolfgang Denk
2008-06-02Merge remote branch 'u-boot-ppc4xx/master'Wolfgang Denk
2008-05-29mips: Add an 'include/asm/errno.h', like all other architecturesJason McMullan
All other u-boot architectures have an include/asm/errno.h, so this change adds it to the mips include/asm-mips headers also. Stolen from Linux 2.6.25. Signed-off-by: Jason McMullan <mcmullan@netapp.com>
2008-05-29[MIPS] <asm/mipsregs.h>: Update coprocessor register access macrosShinya Kuribayashi
Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
2008-05-29[MIPS] <asm/mipsregs.h>: Update register / bit field definitionsShinya Kuribayashi
Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
2008-05-29[MIPS] <asm/mipsregs.h>: CodinygStyle cleanupsShinya Kuribayashi
No functional changes. Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
2008-05-28Make onenand_uboot.h self-sufficient.Scott Wood
Don't assume types are provided by previously included headers. Signed-off-by: Scott Wood <scottwood@freescale.com>
2008-05-28NAND: Provide a sane default for NAND_MAX_CHIPS.Scott Wood
This allows the header to be included regardless of whether a board's config file provides NAND-related defininitions. Signed-off-by: Scott Wood <scottwood@freescale.com>
2008-05-27avr32: Rework SDRAM initialization codeHaavard Skinnemoen
This cleans up the SDRAM initialization and related code a bit, and allows faster booting. * Add definitions for EBI and internal SRAM to asm/arch/memory-map.h * Remove memory test from sdram_init() and make caller responsible for verifying the SDRAM and determining its size. * Remove base_address member from struct sdram_config (was sdram_info) * Add data_bits member to struct sdram_config and kill CFG_SDRAM_16BIT * Add support for a common STK1000 hack: 16MB SDRAM instead of 8. Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-05-27avr32: Rename pm_init() as clk_init() and make SoC-specificHaavard Skinnemoen
pm_init() was always more about clock initialization than anything else. Dealing with PLLs, clock gating and such is also inherently SoC-specific, so move it into a SoC-specific directory. Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-05-27avr32: Clean up the HMATRIX codeHaavard Skinnemoen
Rework the HMATRIX configuration interface so that it becomes easier to configure the HMATRIX for boards with special needs, and add new parts. The HMATRIX header file has been split into a general, chip-independent part with register definitions, etc. and a chip-specific part with SFR bitfield definitions and master/slave identifiers. Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-05-27avr32: Add support for the ATSTK1006 boardHaavard Skinnemoen
This is a replacement for ATSTK1002 with 64MB SDRAM and NAND flash on board. It's currently in production and will be available soon. Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-05-27avr32: Get rid of the .flashprog sectionHaavard Skinnemoen
The .flashprog section was only needed back when we were running directly from flash, and it's even more useless on NGW100 since it uses the CFI flash driver which never used this workaround in the first place. Remove it on STK1000 as well, and get rid of all the associated code and annotations. Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-05-27avr32: Use correct condition around macb clock accessorsHaavard Skinnemoen
get_macb_pclk_rate() and get_macb_hclk_rate() should be available when the chip has a MACB controller, not when it has a USART. Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-05-27avr32: stk1002 and ngw100 convergenceDavid Brownell
Make STK1002 and NGW100 boards act more alike: - STK boards can use as many arguments as NGW - STK boards don't need to manage FPGAs either - NGW commands should match STK ones Also spell U-Boot right in prompts for STK1002 and NGW100. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> [haavard.skinnemoen@atmel.com: update STK100[34] as well] Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-05-27Merge branch 'master' of /home/wd/git/u-boot/custodiansWolfgang Denk
Conflicts: include/configs/socrates.h Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-05-27Socrates: Added USB support.Sergei Poselenov
Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
2008-05-27Socrates: add support for DS75 Digital Thermo Sensor on I2C bus.Sergei Poselenov
Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
2008-05-27Socrates: Config file cleanup.Sergei Poselenov
Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
2008-05-24Merging Stelian Pop AT91 patchesJean-Christophe PLAGNIOL-VILLARD
Merge branch 'testing-V2' Conflicts: board/atmel/at91cap9adk/Makefile Fixing copyright board/atmel/at91sam9260ek/Makefile Fixing copyright board/atmel/at91sam9260ek/u-boot.lds Delete no more needed ld script Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-05-22USB: add support for multiple PCI OHCI controllersSergei Poselenov
Add new configuration variable CONFIG_PCI_OHCI_DEVNO. In case of several PCI USB controllers on a board this variable specifys which controller to use. Also add USB support for sokrates board. See doc/README.generic_usb_ohci for details. Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com> Signed-off-by: Markus Klotzbuecher <mk@denx.de>
2008-05-21Merge branch 'quad100hd'Stefan Roese
2008-05-20Merge branch 'socrates' of /home/wd/git/u-boot/projectsWolfgang Denk
2008-05-20Merge branch 'lwmon5' of /home/wd/git/u-boot/projectsWolfgang Denk
2008-05-20Adding DIU support for Freescale 5121ADSYork Sun
Add DIU and cfb console support to FSL 5121ADS board. Use #define CONFIG_VIDEO in config file to enable fb console. Signed-off-by: York Sun <yorksun@freescale.com>
2008-05-20Big white-space cleanup.Wolfgang Denk
This commit gets rid of a huge amount of silly white-space issues. Especially, all sequences of SPACEs followed by TAB characters get removed (unless they appear in print statements). Also remove all embedded "vim:" and "vi:" statements which hide indentation problems. Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-05-20socrates: fix second TSEC configuration (it is actually TSEC3)Sergei Poselenov
Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
2008-05-20socrates: changes to support FDTSergei Poselenov
Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com> Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-05-20Initial support for "Socrates" boardSergei Poselenov
Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
2008-05-20POST: replace the LOGBUFF_INITIALIZED flag in gd->post_log_word (1 << 31) ↵Yuri Tikhonov
with the GD_FLG_LOGINIT flag in gd->flags. This way we become able to utilize the full post_log_word for POST activities (overwise, POST ECC, which has 0x8000 ID, could be erroneously treated as started in post_output_backlog() even if there was actually no POST ECC run (because of OCM POST failure, for example). Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
2008-05-20POST: add POST_STOP flagYuri Tikhonov
Don't run futher tests in case of a test fails that is marked as POST_STOP. Signed-off-by: Ilya Yanok <yanok@emcraft.com> Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
2008-05-20POST: switch CFG_POST_OCM with CFG_POST_CODEC (workaround)Yuri Tikhonov
Switch the OCM testid with the codec one. The reason is that current implementation requires the POST_ROM testid to fit into lower 16 bits, and the codec test will never run with POST_ROM hopefully. Signed-off-by: Ilya Yanok <yanok@emcraft.com>
2008-05-20lwmon5: enable OCM post test on lwmon5 boardYuri Tikhonov
Signed-off-by: Ilya Yanok <yanok@emcraft.com>
2008-05-20POST: OCM test added.Yuri Tikhonov
Added OCM test to POST layer. This version runs before all other tests but doesn't yet interrupt post sequence on failure. Signed-off-by: Ilya Yanok <yanok@emcraft.com> Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
2008-05-19Fix 8313ERDB board configurationYork Sun
Change LCRR clock ratio from 2 to 4 to commodate VSC7385. Correct TSEC1 vs TSEC2 assignment. Define ETHADDR and ETH1ADDR always. Signed-off-by: York Sun <yorksun@freescale.com> Signed-off-by: Timur Tabi <timur@freescale.com>
2008-05-14environment: fix bug introduced by commit a8409f4f1ac8Wolfgang Denk
env_get_char is not a function, but a pointer to one. Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-05-14Merge branch 'master' of git://www.denx.de/git/u-boot-ppc4xxWolfgang Denk
2008-05-14ppc4xx: QUAD100HD: Allow the environment to be put into flash.Gary Jennejohn
After moving TEXT_BASE the value for CFG_ENV_ADDR was incorrect. Also use a redundant environment. Signed-off-by: Gary Jennejohn <garyj@denx.de>
2008-05-14environment: cleanup prototype declarations of env functions.Wolfgang Denk
Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-05-13Makefile: fix "error: version_autogenerated.h: No such file or directory"Wolfgang Denk
Signed-off-by: Wolfgang Denk <wd@denx.de>