9
0
Fork 0
Commit Graph

13037 Commits

Author SHA1 Message Date
Marc Kleine-Budde 74840ebe98 state: add functionality to export state description
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>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-15 07:01:49 +02:00
Marc Kleine-Budde 0f56f0c5a1 state: make state_release() non static
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-15 07:01:49 +02:00
Marc Kleine-Budde 142afe0e30 state: print proper error message, if reg property is not found
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-15 07:01:49 +02:00
Marc Kleine-Budde 47056c8cd0 state: print name of property of size mismatch is detected
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-15 07:01:49 +02:00
Sascha Hauer 1ec907c701 mtd: nand: Fix format specifier
'count' is of type size_t, so use %zx.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-15 07:01:43 +02:00
Sascha Hauer 16c6e37a7f mtd: Fix function prototype
mtd_op_protect must return int instead of size_t.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-15 07:01:43 +02:00
Sascha Hauer e2d8e8c24c mem: Fix memcpy_sz variable types
- Drop usage of 'ulong', use unsigned long
- remove unnecessary intermediate casting to unsigned long
- Use proper u8/u16/u32 types. Fixes 64bit systems on which ulong is 64bit

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-15 07:01:42 +02:00
Sascha Hauer 3dc08c3056 i2c: Use correct format specifier
'count' is of type u16, not size_t.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-15 07:01:42 +02:00
Sascha Hauer 34afdd06de xfuncs: remove debugging output
Adding debug statements to this code path does not make much sense
since when enabled it will massively spam the console.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-15 07:01:42 +02:00
Sascha Hauer c82d18f0f6 console: use regular malloc for log messages
Using xfunctions to allocate log messages is not a good idea. Should
we be out of memory the xfunctions will panic which will cause another
allocation, so we deadlock the system with no message going out.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-15 07:01:42 +02:00
Robert Schwebel 74a96ab007 Documentation: booting linux: improve doc text
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-15 07:01:42 +02:00
Sascha Hauer 041b2bd31f startup: introduce postenvironment_initcall
To allow init code that depends on the environment being loaded.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-15 07:01:42 +02:00
Marc Kleine-Budde 55c8ed306f watchdog: add static inline no-ops if WD is disabled
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-15 07:01:42 +02:00
Marc Kleine-Budde 6778286639 fdt: of_unflatten_dtb(): remove left over "root" argument from inline doc
In commit

    d384b5639f of: Drop devicetree merge support

the signature of of_unflatten_dtb() was changed, but the inline documentation
was forgotten to adjust. This patch removes the left over "root" argument from
the doc.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-15 07:01:41 +02:00
Marc Kleine-Budde 880fe656f8 state: state_new_from_fdt(): remove unused function
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-15 07:01:25 +02:00
Marc Kleine-Budde b5e65942e5 state: state_uint32_create: use %u to print unsigned variable
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-15 07:01:20 +02:00
Marc Kleine-Budde d600c8d980 state: documentation: add anchor so that state can be referenced later
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-15 07:01:14 +02:00
Sascha Hauer d5ff2f5b71 dts: update to v4.1-rc3
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-13 10:56:04 +02:00
Antony Pavlov 2bd7bb8972 update dlink-dir-320_defconfig
Just 'make defconfig && mv defconfig arch/mips/configs/dlink-dir-320_defconfig'.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-13 08:23:59 +02:00
Antony Pavlov 4d8be8f01c MIPS: bcm47xx: use PUTC_LL() from common debug_ll_ns16550.h header
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-13 08:23:59 +02:00
Sascha Hauer 11856798bd mci: imx-esdhc: Replace printf with dev_*
This replaces printf with dev_* since a struct device_d * is
available.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-13 08:19:01 +02:00
Sascha Hauer 284a1657e6 mci: imx-esdhc: Check for errors in esdhc_pio_read_write
esdhc_pio_read_write can fail, so let it return an error code
rather than void.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-13 08:18:05 +02:00
Sascha Hauer 320ae02a3a mci: imx-esdhc: Use IS_ENABLED() instead of #ifdef
To get rid of some #ifdefery.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-13 08:15:30 +02:00
Antony Pavlov 0f610910e4 MIPS: img-ci20_defconfig: enable network stuff
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-12 08:22:20 +02:00
Antony Pavlov 343bdbf2ad MIPS: img-ci20: enable dm9000 ethernet controller
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-12 08:22:19 +02:00
Antony Pavlov 92f9b36fc0 net: dm9k: fix reset routine
Based on Linux's commit:

    commit 09ee9f87d02e779e4fc3f5c29212c733d6d6e349
    Author: Michael Abbott <michael.abbott@diamond.ac.uk>
    Date:   Wed Oct 16 11:41:33 2013 +0300

        dm9000: Implement full reset of DM9000 network device

        A Davicom application note for the DM9000 network device recommends
        performing software reset twice to correctly initialise the device.
        Without this reset some devices fail to initialise correctly on
        system startup.

N.B. DM9000B on MIPS Creator CI20 board needs additional workaround
(see the 'Make all GPIO pins outputs' and 'Power internal PHY' lines).

This workaround was taken from this U-boot's commit:

    commit fbcb7ece0ea1e364180f1cf963e0fa0ce7f6560d
    Author: Remy Bohmer <linux@bohmer.net>
    Date:   Tue Jun 3 15:26:24 2008 +0200

        DM9000: Improve eth_reset() routine

        According to the application notes of the DM9000 v1.22 chapter 5.2 bullet 2, the
        reset procedure must be done twice to properly reset the DM9000 by means of software.
        This errata is not needed anymore for the DM9000A, but it does not bother it.

        This change has been tested with DM9000A, DM9000E, DM9000EP.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-12 08:22:19 +02:00
Antony Pavlov d818f02639 net: dm9k: add device tree support
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-12 08:22:19 +02:00
Antony Pavlov d9c4042ef4 net: dm9k: show only one phy on miibus
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-12 08:22:19 +02:00
Markus Pargmann a665962824 imx6: lowlevel_init: Fix workaround for new i.MX6s chips
This errata workaround was introduced for i.MX6Q, i.MX6D and i.MX6SL.
Old revisions of i.MX6s chips had no problems with the PFD resets.

In a newer i.MX6s revision I had issues with this code when booting in
internal boot mode from NAND or in serial downloader mode. FUSE mode
worked fine although it jumped directly to serial downloader mode.

This patch executes the PFD workaround only for i.MX6Q and i.MX6D which
fixes the issues I saw.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-11 15:21:48 +02:00
Andrey Smirnov 435aaf6279 bootstrap: Warn if image size in BB header is zero
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-07 09:49:42 +02:00
Andrey Smirnov e5dda9d5e2 bootstrap_read_devfs(): Remove all partitions upon function completion
Bootstrap_read_devfs does not remove the devices it creates during the
course of its execution which might be considered as a resource
leak. Remedy that by adding the code to remove those devices upon
function completion.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-07 09:49:42 +02:00
Andrey Smirnov 835ffe76c4 bootstrap_read_devfs(): Check for errors from dev_add_bb_dev()
Check for errors returned by dev_add_bb_dev() and bail if there
are any.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-07 09:49:41 +02:00
Andrey Smirnov 065d75c341 bootstrap_read_devfs(): Fix potential memory leak
In case of a failure in one of the cdev_* functions original version
of bootstrap_read_devfs would not release memory allocated for barebox
header or memory allocated for the image. This commit fixes this by
adding resource deallocation code.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-07 09:49:41 +02:00
Andrey Smirnov d26ed41fac bootstrap_read_devfs(): Close file after we are done with it
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-07 09:49:41 +02:00
Andrey Smirnov a11d0e04c8 bootstrap_read_devfs(): Check for errors from devfs_add_partition()
Check for errors returned by devfs_add_partition() and bail if there
are any.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-07 09:49:41 +02:00
Andrey Smirnov 49673cfc5f bootstrap: Fix potential memory leak in 'read_image_head'
Original version of 'read_image_head' would not free the memory
allocated for barebox header in cases of any failure. Fix this by
adding a dedicated resourse de-allocation code path.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-07 09:49:41 +02:00
Andrey Smirnov 6f1d94b889 imx-image: Correctly fill image size in prepended header
If called with '-b' option 'imx-image' tool prepends barebox header to
the image, but the tool does not fill the data at image size offset
correctly. Fix that.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-07 09:49:41 +02:00
Andrey Smirnov 903c9477a0 i.MX: Add provisions to boot from IRAM
This commit add a very basic code to allow Barebox to be booted from
IRAM. Given that the amount of IRAM on most i.MX variants is
insufficient to contain a copy of Barebox with any reasonable degree
of functionality this code uses IRAM only as a temporary location and
eventually bootstraps from DRAM. But the presense of the intermediate
IRAM-only stage allows to add provisions to test the area of DRAM that
Barebox would be using to facilitate various testing scenarious.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-07 09:49:41 +02:00
Andrey Smirnov c66574342d Makefile.lib: Make 'check_file_size' more flexible
Make 'check_file_size' more flexible by not hardcoding the file whose
size is going to be checked to '$@'. This way it is possible to use
this subroutine to check the size of files other than the target of
the rule.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-07 09:49:40 +02:00
Andrey Smirnov 059098fe07 i.MX: serial: Distil common clock ungating code
Move all of the common clock ungating code in early UART
initialization into a dedicated subroutine that can be shared by all
of the users.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-07 09:49:40 +02:00
Andrey Smirnov 5b7def7b68 i.MX51: babbage: Implement CONFIG_DEBUG_LL
Implement bits of configuraion needed to configure early debug output
support.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-07 09:49:39 +02:00
Andrey Smirnov 5887b0701b i.MX: serial: Convert i.MX51 and i.MX6 to use 'imx*_uart_setup_ll'
NOTE: Boards 'karo-tx25' and 'tqma53' can benefit from this
refactoring as well, but they were not converted because of the lack
of i.MX25 or i.MX53 based hardware to test on.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-07 09:49:39 +02:00
Andrey Smirnov 95df4587ef i.MX: serial: Convert PUTC_LL to use IOMEM
Convert PUTC_LL to use IOMEM instead of explicit casting to 'void *',
since the former seem to be more appropriate to the situation.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-07 09:49:38 +02:00
Andrey Smirnov 031111d0bc i.MX: serial: Add UART init functions for DEBUG_LL
It appears that all i.MX51 and i.MX6 based boards that support early
debug output inevitably do exactly the same thing with the registers
of the UART peripheral. So to avoid code duplication three new
subroutines are introduced:

  - imx_uart_setup_ll() that allows user to perform aforementioned
    "same thing" on any arbitrary UART at 'uartbase' and clocked at
    'refclock' Hz.

  - imx6_uart_setup_ll() and imx5_uart_setup_ll() that do those
    actions assuming UART to be the one specified in configuration and
    'refclock' to be equal to what it is when SoC comes out of reset.

NOTE: Please note that 'imx*_uart_setup_ll' functions do add a slight
difference in behaviour by dropping the initialization of ONEMS and
UESC registers since those do not seem to be needed for early UART
functionality

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-07 09:49:38 +02:00
Andrey Smirnov 7aca256fac i.MX: serial: Add baud rate calculation convenience functions
Add two functions to calculate values for UBMR and UBIR
registers. This way both early serial initalization code and
serial_imx.c can use them and not duplicate the code.

Singed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-07 09:49:38 +02:00
Andrey Smirnov 18a5a9b969 i.MX: serial: Add constants for UART clock divisor
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-07 09:49:38 +02:00
Andrey Smirnov 089a70dc9c i.MX: Move UART definitions into a separate file
Move UART definitions into a separate file to avoid redefinition in
<mach/debug_ll.h> and magical constants in low level UART
initialization code.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-07 09:49:37 +02:00
Sascha Hauer 97afd89b43 ARM: i.MX5: Add missing CONFIG_ prefix in test
The variable name misses a CONFIG_ prefix to work as expected.

Fixes: 05a1e4b ARM: i.MX5: Do not register fixed clocks twice

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-05-07 09:48:51 +02:00
Sascha Hauer 4de5f732c0 Merge branch 'for-next/of-device-id' 2015-05-06 21:36:13 +02:00
Sascha Hauer 67e4e8c056 Merge branch 'for-next/mvebu' 2015-05-06 21:36:13 +02:00