Use stdout-path instead of linux,stdout-path and use &uart format
instead of writing the full path.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Some USB ports only have one possiblitly for the phy_type and
the type is not specified in the devicetree in this case.
Rely on the reset default instead of failing.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
We do not have usb_get_dev_index() function, so remove this declaration.
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
When loading or saving a devicetree it seems logical to add the
filename to the option specifying the command. This is also slightly
easier to parse.
While at it add missing documentation for the -s option.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
I assume I am the only person knowing that barebox is able to
merge devicetrees. This feature seems broken for a while now since
trying to merge devicetress results in:
unflatten: too many end nodes
Remove this feature to save the complexity.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The oftree command is overloaded. This adds a dedicated command
which only dumps devicetrees to the console so that the corresponding
functionality in the oftree command can be removed in the next step.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Update cpuinfo to display the current CPU implementation
using the VR2 register defined in the architecture specification
v1.0
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The relocation code can now relocate from anywhere to
the RAM.
The old code assumed that the binary was copied to the RAM
by some PBL and then it just relocated the .text section
from the loaded address to the linked address.
Now, it first checks if vectors are somewhere else than the
linked address. If yes, there are copied to address 0 (or
to the exception vector base address if register EVBAR is
present).
Then, the .text section is relocated from its current location
to the RAM.
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The OpenRISC architecture specification v1.0 defines
new SPR registers. This patch adds registers definition
for group 0 and update bit definitions for the CPU
configuration register.
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
It's not always easy to know what is the size of a parition.
This patch adds the size of a memory range in human readable
format. We now have for example:
`---- cfi_flash0
`---- nor0
`---- 0x00000000-0x00ffffff ( 16 MiB): /dev/nor0
`---- 0x00000000-0x0001ffff ( 128 KiB): /dev/env0
`---- 0x00020000-0x0011ffff ( 1 MiB): /dev/fpga0
`---- 0x00120000-0x0019ffff ( 512 KiB): /dev/self0
`---- 0x001a0000-0x00d9ffff ( 12 MiB): /dev/linux
`---- 0x00da0000-0x00ffffff ( 2.4 MiB): /dev/elf
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Even when both the ethernet controller and the phy support certain
features a board may have additional limitations. Allow specifying
it in the devicetree.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
We do not care about releasing the resources in the error
path, but at least check the return value of eth_register
and mdiobus_register.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
When the ethernet device has a device_node then try finding
the associated phy via the phy-handle property.
This makes the phy handling via devicetree transparent to the
ethernet drivers.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
When a mdio bus has a device node attached then register the phys
specified there. This makes it possible to lookup the phys using
phandles later.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The phy_map should be valid once a phy_device is registered. This
allows registering phys outside of mdiobus_scan.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
phy_device_connect combines searching for a phy with actually attaching
it to the ethernet device. Factor out a phy_device_attach function to
have a function for each purpose. This makes the logic of phy_device_connect
simpler.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The driver doesn't use interrupts and Linux driver crashes when emac
interrupts are enabled at boot: keep them disabled.
Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Avoid unneeded delay when waiting for the completion of a mdio
operation and return as soon as possible.
Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The mxs nand driver has a calculation for the ecc strength.
This calculation was not used for some common nands and it
was assumed that 2k page nands always have a ecc strength
of 8. This is not true since there are devices with 224 bytes
of oob instread of 64 bytes. These allow for a greater ecc
strength. Since the kernel relies on the calculation and
we have to be consistent with the kernel use the calculcation
in barebox aswell and just remove our assumptions.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The of_* commands take devicetree nodes as parameters. Add a
devicetree completion function to ease passing nodes to these
commands.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
the command specific complete callbacks only work when no
option is typed already. For example "devinfo <tab><tab>"
correctly completes the devices, but "devinfo -x <tab><tab>"
does nothing. That is because the options are passed to
the input string of the completion handlers. Skip the option
string by finding the last space in the input string. This
is not perfect since "devinfo -f<tab><tab>" still does not
work, but it's better than what we have now.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Some users such as fs/nfs.c just save the pointer to the packet in the
handler and process it after net_poll() returns. This break when more than
one packet is received using the same buffer.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The ARM pbl is linked at (TEXT_BASE - SZ_2M). This conflicts with the temporary
stack used in s3c24x0_nand_boot. Moving the stack to (TEXT_BASE - SZ_2M) fixes
this problem. With this patch a compressed barebox with pbl can boot on
mini2440 from NAND.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
As of v3.15-rc4 these contain NO_PAD_CTRL settings which are not
suitable for an initial setup. Overwrite upstream settings until
these are fixed.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This makes sure the PMIC is initialized once it's available. Move the
initcall to coredevice_initcall to make sure we initialize the PMIC
before the FEC driver is initialized. The ethernet phy needs vgen3
enabled in the PMIC initialization.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The PMIC is often a dependency for other devices, so make sure
it's initialized early. While at it, merge the spi/i2c registration
into a single initcall and use IS_ENABLED instead of ifdefs.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Some boards have to initialize the PMIC before other devices can
be initialized. This requires three levels of initcalls: one level
in which the PMIC is probed, one in which the board can call mc13xxx_get()
and the third one to initialize the PMIC dependent devices.
Allow to register a callback which is called once the PMIC is initialized.
This way mc13xxx_get() is no longer necessary and the number of required
initcalls levels is reduced to two.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
In case of device parameters setting variables may fail. return
the result of set_local_var so that the user has a chance to detect
the failure with $?.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
gcc 4.8.3 throws the following error
include/mfd/syscon.h: In function 'syscon_base_lookup_by_pdevname':
include/mfd/syscon.h:22:1: error: parameter name omitted
static inline void __iomem *syscon_base_lookup_by_pdevname(const char *)
Fix it by adding the name to the function prototype.
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>