9
0
Fork 0
Commit Graph

8348 Commits

Author SHA1 Message Date
Wolfram Sang d723373013 nand: mxs: NO_SUBPAGE_WRITE flag was overwritten
It is not the chip, but this controller which cannot do subpage writes.
So, make sure we add the flag at the proper place, so it doesn't get
overwritten by flash detection anymore.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-19 10:27:22 +01:00
Sascha Hauer 885694f827 Merge branch 'pu/efikasb' into for-next/imx 2012-12-17 11:29:20 +01:00
Sascha Hauer 9239281a5e USB ehci: Add powerup fixup for EfikaSB
The EfikaSB has a bug requiring to write to an ULPI register after
powerup. It doesn't seem that this this bug is present on any other
hardware, so add a workaround directly into the driver.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-17 11:27:34 +01:00
Sascha Hauer 40bd757243 Merge branch 'pu/usb' into for-next/imx
Conflicts:
	arch/arm/mach-imx/include/mach/devices-imx31.h
2012-12-17 08:45:49 +01:00
Sascha Hauer da8b72508b ARM: Add defconfig for Efika MX smartbook
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-17 08:42:32 +01:00
Sascha Hauer 3117c6f7bc ARM i.MX51: Add support for the Efika MX Smartbook
The Efika MX Smartbook is a i.MX51 based netbook. This patch adds
nearly full support for it including:

- USB
- SD card slots
- Internal SPI NOR flash
- Internal flash PATA drive
- LEDs

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-17 08:42:32 +01:00
Sascha Hauer 0d8452b599 mfd mc13893: Add register defines
Add register defines for the mc13892.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-17 08:42:32 +01:00
Sascha Hauer de3c258d41 mci i.MX esdhc: Allow to specify devicename from platformdata
For boards which need to have persistent names for the device file.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-17 08:42:32 +01:00
Sascha Hauer 30eb680378 mci: Allow to specify device name
When multiple MMC/SD cards are present in the system we often
have to have persistent names to identify them during runtime.
This patch allows to overwrite the devicename which is used.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-17 08:42:32 +01:00
Sascha Hauer f3468dc387 ata sff: set device pointer in ata port
This was forgotten in the last ata updates and leads to NULL
pointer dereferences.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-17 08:42:32 +01:00
Sascha Hauer 752e56babf USB ULPI: Add more register/bit defines
Make the register defines for ULPI more complete. Also, Add a proper
ULPI_* Namespace to the existing defines.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-17 08:42:13 +01:00
Sascha Hauer aa537feed4 USB ULPI: Add missing ulpi_write function
We currently only have functions to read/modify registers. Add a
function to write registers.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-17 08:42:08 +01:00
Wolfram Sang b6accb5e56 commands: flash: add missing newlines to error messages
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-14 08:43:44 +01:00
Maxime Ripard 2c8272e8f3 ARM: cfa10036: Use the board variant to load a different device tree
The board variant found on the AT24 EEPROM holds the variant ID that we
can use to identify which expansion board we are running on and thus
which device tree to load and pass to the kernel.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-14 08:36:36 +01:00
Maxime Ripard d2c60a65a4 ARM: cfa10036: Retrieve the board variant from the AT24
The AT24 found on the expansion boards store the variant of the board it
is soldered onto.

That means that we are that way able to determine what expansion board
is currently plugged in if any. If we can't communicate with the EEPROM,
we just assume that only the CFA-10036 is there.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-14 08:36:36 +01:00
Maxime Ripard 25fcfb2efa ARM: cfa10036: Add the AT24HC02 I2C EEPROM
This EEPROM is found on the expansion boards available for the 10036
module. Since we won't need to do anything fancy except reading/writing
from it, use bitbanging to communicate with it.

This EEPROM will hold mostly the board_id so that we can determine if
there is an expansion board plugged in and what expansion board it is.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-14 08:36:36 +01:00
Antony Pavlov fbf112a3bc MIPS: qemu-malta_defconfig: use pbl
USAGE

 $ make qemu-malta_defconfig
   ...
 $ make
   ...
 $ qemu-system-mips -nodefaults -M malta -m 256 \
           -nographic -serial stdio -bios ./barebox-flash-image

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-14 08:34:33 +01:00
Antony Pavlov eaa76cc34d MIPS: qemu-malta: add trivial pbl support
Trivial pbl support has no cpu specific setup.
We will add cache setup routines in the future.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-14 08:34:33 +01:00
Antony Pavlov f369f64ed1 MIPS: add pre-bootloader (pbl) image support
This patch is based on ARM pbl support and allows
creating a pre-bootloader binary for compressed image.

For different MIPS SoCs (or even for different boards based
 on the same SoC) the operations carried on in start-pbl.S
can be very different. The additional constraints can be imposed
on the size of the boot code or the special magic labels in
the beginning of the boot code; In some cases it could be
necessary to show CPU is alive as early as possible
(transmit a char via UART or blink a LED).
So the demands for pbl start operation can be very different.

E.g. malta board store boot code at the NOR flash mapped
to the MIPS power-on address (0xbfc00000); it is the most
simple case: we need just copy pbl image from direct-mapped
flash to RAM and jump there.

The XBurst-powered boards store boot code in the beginning
of a NAND flash or in the beginning of SD/MMC card.
In this case we must use simple and short NAND or SD/MMC access
routines to copy pbl image to RAM.

To meet so different demands a simple technique is selected:

* MIPS pbl entry point located in file arch/mips/boot/start-pbl.S.

* MIPS pbl code (see start-pbl.S) assumes that every pbl-enabled
board has a arch/mips/boards/<BOARD>/include/board/board_pbl_start.h
header file. This file must contain definition of
the board_pbl_start macro. This macro is used as start of pbl image;

* the most popular asm routines (stack setup, relocation to link
address, NS16550 initialization (WIP) and so on) are containt
in the arch/mips/include/asm/pbl_macros.h header file.
So board pbl macro can use it if necessary.
It is possible to create similar headers with macros for each
specific SoC; so even if we have many different boards based
on the same SoC the board_pbl_start macro for every board
can be short and clear.

* after board-specific initialization the stack pointer
is initialized and pbl C code is started.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-14 08:34:33 +01:00
Sascha Hauer f410a5ed50 ARM i.MX pcm038: Update defconfig for chipidea driver
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-13 22:18:47 +01:00
Sascha Hauer 3be7b966ed pcm038: Stop ongoing ULPI transfers before registering the transceiver
The ULPI lines are normally input to the USB port. In order to configure
the ULPI transceiver properly the ongoing transfers must be stopped. This
can be done by configuring the the STP pin as gpio output and drinving
it high.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-13 22:18:47 +01:00
Sascha Hauer 70f42048a1 ARM i.MX pcm038: switch to chipidea support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-13 22:18:47 +01:00
Sascha Hauer 1690746c3a ARM i.MX31: Add USB device functions
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-13 22:18:47 +01:00
Sascha Hauer 20f2dae6d2 ARM i.MX51: Add USB device functions
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-13 22:18:47 +01:00
Sascha Hauer 9524e95a9b ARM i.MX27: Add USB device functions
Register the USB misc devices and provide convenience wrappers to
register the USB ports for i.MX27.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-13 22:18:47 +01:00
Sascha Hauer a4076ddf65 USB i.MX: Add chipidea driver support
For proper USB function the usbmisc registers have to be initialized.
This patch adds a driver which matches for the usbmisc registers. This
driver is called from a new driver which binds to the USB ports to
configure the misc registers. After that the driver registers the EHCI
driver and an ULPI transceiver if necessary. Currently only host mode
is supported, but device support can be added later.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-13 22:18:46 +01:00
Sascha Hauer 15fd89d0a4 USB ehci: Allow to register independently from device
The EHCI core often is part of a otg core. Allow it to be registered
separately from another driver.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-13 17:47:42 +01:00
Sascha Hauer 0ccb9aebcd Merge branch 'pu/net-link' 2012-12-13 16:26:19 +01:00
Sascha Hauer 2c9ebcb856 Merge branch 'pu/devchild' 2012-12-13 16:24:44 +01:00
Sascha Hauer b44e775eda ARM i.MX31 pcm037: add mmc support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-12 21:53:59 +01:00
Sascha Hauer bce4fecc4e ARM i.MX31: Add mmc register convenience functions
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-12 21:53:59 +01:00
Sascha Hauer 0c546f0309 ARM i.MX31 pcm037: add more iomux pins
Use imx_iomux_setup_multiple_pins to setup the pinmux and add more
pins.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-12 21:53:59 +01:00
Sascha Hauer d74be493f7 ARM i.MX31: sync iomux with kernel
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-12 21:53:58 +01:00
Sascha Hauer 6dbf674089 ARM i.MX31 pcm037: Switch to new environment
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-12 21:53:58 +01:00
Sascha Hauer f05392ac01 ARM i.MX31 pcm037: rewrite lowlevel init code in C
Tested with NOR and NAND boot.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-12 21:53:58 +01:00
Sascha Hauer dfb2f22670 ARM i.MX31 pcm037: remove unused defines
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-12 21:01:56 +01:00
Sascha Hauer 248f795d83 ARM i.MX31 pcm037: make board bootable again
This enables the di in the IPU_CONF register. Otherwise the board
refuses to start.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-12 21:01:42 +01:00
Sascha Hauer ec7faef3ba ARM i.MX31 pcm037: Force internal phy
The smsc911x has a bootstrap pin for detecting an external phy.
Unfortunately this is pulled into the wrong direction on the pcm037
board, so force internal phy with platform data.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-12 21:01:33 +01:00
Sascha Hauer 679f5277ff ARM i.MX31: Fix gpio device names
Has to be imx31-gpio, not imx-gpio.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-12 21:01:21 +01:00
Sascha Hauer a1a50a4654 net phylib: force to wait for link
When starting a network device wait until the link is up. Otherwise
autobooting does not work with little timeout and several attempts
have to be made until the network is finally up.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-12 20:02:44 +01:00
Sascha Hauer 11cb1620fe esdctl: fix reset default bug on i.MX27/31
The i.MX27/31 have the second chip select enabled by reset default.
This can be considered as a hardware bug, because even boards which
need this settings cannot work out of reset because of the missing
initialization sequence. Detect this reset default setting and disable
this chipselect then to be able to properly detect the SDRAM size.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-12 19:59:38 +01:00
Sascha Hauer 1a9e93cc81 drivers/base: fix corrupt device tree
dev_add_child is a very unsafe function. If called multiple times
it allows setting the same device to different parents thus corrupting
the siblings list. This happens regularly since:

| commit c2e568d19c
| Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
| Date:   Sat Nov 3 16:11:05 2012 +0100
|
|    bus: add bus device
|
|    automatically add it as parent of any bus device if none already specified
|
|    we have now a nice output per bus

If for example a FATfs is mounted this nice output per bus often ends with:

>     `---- fat0
>     `---- 0
>          `---- 0x86f0000087020031-0x86f000410df27124: /dev/<NULL>
>          `---- sram00
>               `---- 0x00000000-0xffffffffffffffff: /dev/<NULL>
>               `---- 0x00000000-0xffffffffffffffff: /dev/<NULL>
>               unable to handle NULL pointer dereference at address 0x0000000c
> pc : [<87f08a20>]    lr : [<87f08a04>]
> sp : 86eff8c0  ip : 87f3fbde  fp : ffffffff
> r10: ffffffff  r9 : 00000000  r8 : 00000003
> r7 : 86f075b8  r6 : 00000002  r5 : ffffffec  r4 : 86f07544
> r3 : 00000000  r2 : 43f900b4  r1 : 00000020  r0 : 00000005
> Flags: Nzcv  IRQs off  FIQs off  Mode SVC_32
> [<87f08a20>] (do_devinfo_subtree+0x90/0x130) from [<87f08a90>] (do_devinfo_subtree+0x100/0x130)
>
> [<87f3e070>] (unwind_backtrace+0x0/0x90) from [<87f28514>] (panic+0x28/0x3c)
> [<87f28514>] (panic+0x28/0x3c) from [<87f3e4b8>] (do_exception+0x10/0x14)
> [<87f3e4b8>] (do_exception+0x10/0x14) from [<87f3e544>] (do_data_abort+0x2c/0x38)
> [<87f3e544>] (do_data_abort+0x2c/0x38) from [<87f3e268>] (data_abort+0x48/0x60)

This patch fixes this by adding a device to its parents children list in
register_device so that dev_add_child is no longer needed. This function
is removed from the tree. Now callers of register_device have to clearly
set the parent *before* registering a device.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reported-by: Jan Lübbe <jlu@pengutronix.de>
2012-12-12 15:04:27 +01:00
Sascha Hauer c7c9c88cc2 fs: move dev_add_child before device_register
Biology tells us that the parent is known before the child is born.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-12 14:49:05 +01:00
Sascha Hauer 025d80a05d net phylib: Call phy_update_status when no link is present
We call phy_update_status only once in 5 seconds. This makes
sure we do not have great overhead when using ethernet devices.
However, if phylib tells us the link is down anyway, there won't
be ethernet transfers, so it doesn't hurt to call phy_update_status
in this case. This makes sure we can use the ethernet device when
the link comes up and do not have an additional 5 second penalty
in this case.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-08 17:54:06 +01:00
Sascha Hauer ac48b10467 net phylib: Clear BMCR_PDOWN bit
Some phys come up with this bit set, clear it so that these phys
can work. This has been observed with a ASIX compatible USB ethernet
adapter.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-08 17:52:55 +01:00
Sascha Hauer 039a0e52f8 ARM omap3: Call common_reset
omap3 has a soc specific reset function, make sure it calls common_reset
so that the proper CPU flags are set.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-08 17:51:25 +01:00
Sascha Hauer ab4e9edf86 ARM startup: Ensure CR_A flag is cleared on architectures >= ARMv6
We allow unaligned accesses on ARMv6 onwards, make sure the CR_A
flag is cleared so that unaligned accesses do not trap.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-08 17:50:03 +01:00
Sascha Hauer 8030ab24fa Merge branch 'kconfig' 2012-12-08 12:22:21 +01:00
Alexander Shiyan c209c186e0 Fix wrong Kconfig reference to ARCH_IMX31
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-08 12:22:12 +01:00
Alexander Shiyan f544baed50 Remove bad Kconfig reference to MTD_NAND
Barebox not contain symbol MTD_NAND, so remove all references to it.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-08 12:22:12 +01:00