Returning other values causes problems for client code which wants to
perform calculations with the returned value.
Signed-off-by: Jan Luebbe <jluebbe@debian.org>
state must be loaded after the nand driver, otherwise it fails because the
backend is missing. For similar reasons bootstate must come after state.
Move them to the late stage until barebox can do deferred probing.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
UBI devices used to show up with a dynamically assigned number
which is bad for scripting. After a 'ubiattach' a script cannot
know the number of the ubi to continue with. Change this to use
the parent mtd name and extend it with ".ubi".
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The ubi number is a dynamically assigned number, so once multiple
ubis are attached, scripts cannot know the ubi number they want
to detach anymore. Convert the ubidetach command to take the mtd
device file instead which is the same argument that was previously
passed to ubiattach.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
When bootloader spec is used to boot devices it is often desirable
to boot the same image from different media. Since the fs images
need to contain the root= parameters to tell Linux where to boot
from the images can't be identical on different media.
This patch changes this by introducing a 'appendroot' option for
bootloader spec. If set to true, barebox will construct a Linux
commandline option for the device the bootloader spec entry is found
on.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Support for default/once entries was lost earlier. This fixes this
and also looks for default/once entries in the loader directory instead
of the loader parent directory. This keeps the bootloader spec files
together under a common loader directory.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
We have to start searching for the mtd node starting in the given root node not
the defaukt (= barebox internal) one. This means the internal DT is always
fixed up. This leads to booting not fixed up DT when using external DTs.
This patch fixes the problem.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Applied-Upstream: v2015.06.0, commit:6da925f87c66cd9132018b4b08a84fa98c382aa7
The length of the data must fit into the remaining available space until the
next copy of the data.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This patch factors out the state_backend_raw_file_get_size() into a separate
function and adds some ifdefs to make this code work under Linux aswell.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This patch makes it easier to share the code with linux, on Linux the ease and
write size have to be aligned. Use stride (which is already aligned to erase
block size) during erase, align size_full to writesize and use it while
writing.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This patch renames the member "step" of the struct state_backend_raw to
"stride" and tries to clarifies its meaning.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Although there is the define RAW_BACKEND_COPIES, the state_backend_raw_save()
function silently assumes exactly two copies. This patch removes that assumtion
by looping over all copies, but saving the one we're read from at the end.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This patch registeres a DT fixup, that copies the statate nodes from the active
to the kernel DT. The backend reference will be a phandles.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
[ukl: add call to of_unregister_fixup]
This patch improves the backend property, it can be either a phandle or a
of_path. During probe() of the state driver the backend property is
dereferenced and the resulting of_path is saved in the state context. In a
later patch it will be used to generate a phandle reference to the backend
during DT fixup.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This patch adds the functionality to export the description of the state, but
not the contents of the variables to a DT node. This will be used in a later
patch to "copy" the state description to the kernel device tree during DT
fixup.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This function is needed when a device that already registered a fixup in
the probe routine fails later to probe completely. Without unregistering
the fixup the function might later be called with invalid data.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Forwarded: id:1431771149-27265-1-git-send-email-u.kleine-koenig@pengutronix.de
Otherwise compilation may fail with:
include/fdt.h:11:15: error: unknown type name 'uint64_t'
static inline uint64_t fdt64_to_cpu(uint64_t x)
include/of.h:22:19: error: field 'list' has incomplete type
struct list_head list;
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Applied-Upstream: v2015.06.0, commit:9e69a04222ee88c51bd5ca4f802b5fa5ad42b0f8
As expected, we would need deferred probing sooner or later. This is
a first approach to allow devices to return -EPROBE_DEFER and get
sorted into a list of deferred devices that will be re-probed later.
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Origin: v2015.06.0, commit:ab3da15bc14cc5297b2da27eb3dcd8d70dac41df
This fixes: 80264a8 driver: Call bus->remove instead of driver->remove
On mvebu it happens that:
Upon device shutdown, when iterating through the active device list,
the phy0 device is removed before mdio-mvebu. Then, when the mdio bus
device is removed, the phy0 device is removed again, here:
mdio_bus_remove(on mdio-mvebu)
mvebu_mdio_remove
mdiobus_unregister
unregister_device
mdio_bus_remove(on phy0)
Fix this by setting the mdio busses phy_map[phy->addr] to NULL when
unregistering the phy device, so that mdiobus_unregister no longer
finds a valid phy_device when iterating over the busses device list.
Reported-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Tested-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
This was erroneously left uninitialzed as nothing was using it.
The i.MX6 PCI driver needs this to be filled properly to decide
if a config space access is allowed for a specific devfn.
This fixes PCI enumeration on the Gateworks GW54xx board.
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The bridge device needs to be registered and activated before
the scanning can proceed, as the bridge is the parent for other
devices.
This fixes a NULL ptr derefernce when scanning PCI hierarchies
with bridges behind bridges.
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The e1000 driver uses the dma coherent functions
and thus can only be build for architectures implementing them.
Here is mips malta build error log:
drivers/built-in.o: In function `e1000_transmit':
drivers/net/e1000.c:(.text.e1000_transmit+0x80): undefined reference to
`dma_sync_single_for_device'
drivers/built-in.o: In function `e1000_poll':
drivers/net/e1000.c:(.text.e1000_poll+0x60): undefined reference to
`dma_sync_single_for_cpu'
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
To get the number of address cells and size cells we have to use
the newly created partition node, not the parent device node. The
parent device node returns the address/size cells of the controller
node, not the partition node.
On an am335x machine this fixes the device tree passed to Linux.
The situation there is:
...
gpmc@50000000 {
...
#address-cells = <0x2>;
#size-cells = <0x1>;
ranges = <0x0 0x0 0x8000000 0x10000000>;
...
nand@0,0 {
reg = <0x0 0x0 0x0>;
#address-cells = <0x1>;
#size-cells = <0x1>;
...
partition@7 {
label = "system";
reg = <0x220000 0x7de0000>;
};
};
};
and without this patch barebox passes three bytes for
partition@7's reg property instead of only two which naturally
confuses Linux and yields to the system partition to start at 0
with a size of 0x220000.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tested-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
The board code uses quite a few OF functions and it doesn't seem
reasonable to run this board without DT support.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
When working with non-coherent transfer buffers, we have to sync
device and cpu for outgoing and incoming buffers. Fix the driver where
non-coherent buffers are used in device context.
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>