Commit Graph

38620 Commits

Author SHA1 Message Date
Maxime Ripard 05fb87873d vsprintf: Include stdarg for va_list
vsprintf.h doesn't include the stdarg.h file, which means that it relies on
the files that include vsprintf.h to include stdarg.h as well.

Add an explicit include to avoid build errors when simply including that
file.

Acked-by: Simon Glass <sjg@chromium.org>
Acked-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2022-04-26 11:48:23 +02:00
Maxime Ripard bcac8e2fe8 libfdt: Add fdt_path_offset_namelen
Add a namelen variant of fdt_path_offset to retrieve the node offset using
only a fixed number of characters.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2022-04-26 11:45:47 +02:00
Maxime Ripard 1e8e378005 libfdt: Add new headers and defines
The libfdt overlay support introduces a bunch of new includes and
functions.

Make sure we are able to build it by adding the needed glue.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Simon Glass <sjg@chromium.org>
2022-04-26 11:43:00 +02:00
Maxime Ripard 6013007867 libfdt: Add max phandle retrieval function
Add a function to retrieve the highest phandle in a given device tree.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Stefan Agner <stefan@agner.ch>
Acked-by: Simon Glass <sjg@chromium.org>
2022-04-26 11:28:55 +02:00
Maxime Ripard f856baeb27 libfdt: Add fdt_getprop_namelen_w
Add a function to retrieve a writeable property only by the first
characters of its name.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2022-04-26 11:27:16 +02:00
Maxime Ripard b5db892f31 libfdt: Add fdt_setprop_inplace_namelen_partial
Add a function to modify inplace only a portion of a property..

This is especially useful when the property is an array of values, and you
want to update one of them without changing the DT size.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Simon Glass <sjg@chromium.org>
2022-04-26 11:24:10 +02:00
Maxime Ripard 7436c8dedb cmd: fdt: add fdt overlay application subcommand
The device tree overlays are a good way to deal with user-modifyable
boards or boards with some kind of an expansion mechanism where we can
easily plug new board in (like the BBB or the raspberry pi).

However, so far, the usual mechanism to deal with it was to have in Linux
some driver detecting the expansion boards plugged in and then request
these overlays using the firmware interface.

That works in most cases, but in some cases, you might want to have the
overlays applied before the userspace comes in. Either because the new
board requires some kind of an early initialization, or because your root
filesystem is accessed through that expansion board.

The easiest solution in such a case is to simply have the component before
Linux applying that overlay, removing all these drawbacks.

Reviewed-by: Stefan Agner <stefan@agner.ch>
Acked-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2022-04-26 11:22:12 +02:00
Pantelis Antoniou 7911e6414f fdt: Introduce helper method fdt_overlay_apply_verbose()
Introduce fdt_overlay_apply_verbose, a method that applies an
overlay but in the case of an error produces a helpful message.

In addition if a base tree is found to be missing the __symbols__
node the message will point out that the probable reason is that
the base tree was miscompiled without the -@ option.

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Acked-by: Simon Glass <sjg@chromium.org>
2022-04-26 11:15:25 +02:00
Alexandre Bard 54a9a3d78d HW21: Enable libfdt_overlay 2022-04-26 11:13:28 +02:00
Pantelis Antoniou 7b3ff1f3d8 fit: Introduce methods for applying overlays on fit-load
Introduce an overlay based method for constructing a base DT blob
to pass to the kernel.

It is based on a specific method now to get the FDT from a FIT image
named boot_get_fdt_fit().

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Acked-by: Simon Glass <sjg@chromium.org>
2022-04-26 11:13:28 +02:00
Pantelis Antoniou 69fdb417d7 fit: Do not throw away extra configuration on fit_image_load()
fit_image_load() threw away the extra configuration parts when
loading. We need them around for applying extra overlays for
building the boot fdt.

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Acked-by: Simon Glass <sjg@chromium.org>
2022-04-26 11:13:28 +02:00
Pantelis Antoniou 58f9b39ca5 fit: Allow multiple images per property
As part of the fdt overlay support which need it, allow
a list of configurations per property.

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Acked-by: Simon Glass <sjg@chromium.org>
2022-04-26 11:13:28 +02:00
Simon Glass 8554204ea3 libfdt: Bring in upstream stringlist functions
These have now landed upstream. The naming is different and in one case the
function signature has changed. Update the code to match.

This applies the following upstream commits by
Thierry Reding <treding@nvidia.com> :

   604e61e fdt: Add functions to retrieve strings
   8702bd1 fdt: Add a function to get the index of a string
   2218387 fdt: Add a function to count strings

Signed-off-by: Simon Glass <sjg@chromium.org>
2022-04-26 11:11:21 +02:00
Maxime Ripard 20afb734ca libfdt: Add overlay application function
The device tree overlays are a good way to deal with user-modifyable
boards or boards with some kind of an expansion mechanism where we can
easily plug new board in (like the BBB, the Raspberry Pi or the CHIP).

Add a new function to merge overlays with a base device tree.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2022-04-26 11:11:21 +02:00
Maxime Ripard 4bdb47d86d libfdt: Add iterator over properties
Implement a macro based on fdt_first_property_offset and
fdt_next_property_offset that provides a convenience to iterate over all
the properties of a given node.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Simon Glass <sjg@chromium.org>
2022-04-26 11:11:21 +02:00
Alexandre Bard 43707e6a23 Prepare v2016.07
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJXg+z8AAoJEIf59jXTHXZSL5oP/jNMyie/wW9Le92mK5in9QAl
 iMHsZdtC4K4ZCou6V20hjIchMC21G2swyKrQA+T1Da4EgJhHJ7FVPWvgFUiQeQ8u
 Pu+lPsB0ObdX8dcIY3SkdHzKyedhk+L0wGkzE/rgDvqHkVRHtB61pcksu5GA09eW
 jWsbu55RmNXxz9mPyQjAbksflDHVqnmpe5LyaynJFG7TmTNgJ9IZWUlubu0hVAhI
 eFUcEDWAMNMOr6DY3Ot9oS8v8ncNDkUrZzOhr4DsU8WLKfv8XoltohSwYm9Hu3TD
 K57tbgK+uUVYKezVF2d90WY1xeezzQpHcEOTTYPy58E06vENUvwJuEh4s4/2rOWd
 ivR6ETNn/v+tR09i7m0X36jpAFOrfC79uUY4iekyexlfiXAwSl6G43v1bwai7I/c
 Gw68HYRu0kR8iQGvlv5d/kf+nUXSu45nqgeD6Kurw2cHiAsv+wkbS3H8b8Rcuv02
 bsdybOQdFGiTo1LUzMQiglEPycXdu33g+OQhded5SFCMTvU4AoRZkQ9cO3UEMq32
 aJK+0qUdtlzjstsoaUnxi3mZCLdEXyAVu8cmUnRvpL4QU8rmy8QjEgMnypSK/RhV
 SAYw1iu02qdYbp605re9g02H2oA2IslVKacEvG5Ag91JOKf8rJbjYFcx/WDWgBHM
 YV02EcYzCFiwFTesqrvx
 =lX5/
 -----END PGP SIGNATURE-----

Merge tag 'v2016.07' into 2016.05-am335x-netmodule-fdt-overlay

Prepare v2016.07
2022-04-22 16:07:08 +02:00
Alexandre Bard 7b4add1789 nm-boards: Replace all devicetree paths with aliases
This is easier to maintain and should be compatible with any kernel
version as long as the devicetree aliases are maintained.

BugzID: 77112
2022-01-12 13:01:47 +01:00
Alexandre Bard 4832ca022a netmodule boards: Adapt devicetree path to match kernel 5.10
With kernel upgrade to 5.10 the paths of all nodees have changed because
of the way the ti drivers are handled.

These paths must therefore be adaped in u-boot in order to stay
compatible.

This means that u-boot versions before this commit are not 100%
compatible with kernel 5.10, but they should usually be able to boot.

Also after this change, older kernel will not work 100% but should still
boot.

BugzID: 77112
2022-01-11 13:48:54 +01:00
Marc Mattmueller 2fa18965e6 board/nmhw21: keep coding style and replaced magic numbers
BugzID: 75833
Signed-off-by: Marc Mattmueller <marc.mattmueller@netmodule.com>
2021-12-01 11:03:45 +01:00
Lucien Mueller a6b26419bc hw21: introduce cpu watchdog reset reason.
BugzID: 74817

Signed-off-by: Lucien Mueller <lucien.mueller@netmodule.com>
2021-09-16 10:57:47 +02:00
Marc Mattmueller 6cc285809d hw21: clear register completely instead of masking watchdog timeout
With the introduction of the SSF watchdog feature a get and then a
set of the PMIC's CONTROL_D register leads to an activation of the
watchdog and causes a watchdog reset at the time the kernel is
being decompressed.
Currently we disable the watchdog from the bootloader and activate
it only in user space.

BugzID: 74659
Signed-off-by: Marc Mattmueller <marc.mattmueller@netmodule.com>
2021-09-08 09:32:32 +02:00
Rene Straub 3a9ef955c2 hw21/26: mask unwanted wakeup event by default
If events are not masked they lead to an immeditate
restart of the PMIC from powerdown().
2021-03-19 17:32:19 +01:00
Rene Straub a39cba028a hw21/26: enable pullup to set SIM_SW default high 2021-03-14 16:45:57 +01:00
Rene Straub 2997b916c1 hw21/26: add reset/start reason detection (#67)
Co-authored-by: Rene Straub <straub@see5.ch>
Reviewed-on: https://git.netmodule.intranet/nmrouter/u-boot/pulls/67
Co-Authored-By: Rene Straub <rene.straub@netmodule.com>
Co-Committed-By: Rene Straub <rene.straub@netmodule.com>
2021-03-03 15:02:13 +01:00
Rene Straub e8475b4f80 hw25: swap mac addresses to reflect port numbering 2020-12-15 09:28:30 +01:00
Rene Straub 088d4c7ddf hw21/26: remove trailing whitespaces 2020-12-10 15:02:37 +01:00
Rene Straub 3b18df525d hw25: handle gpio variants 2020-12-02 08:25:07 +01:00
Rene Straub 24c0d5539e i2c: omap24xx_i2c: Fix speed settings
Add set_speed function to adapters 2, 3 and 4 as well.
2020-12-01 16:36:25 +01:00
Rene Straub 6ca8df40e6 hw25: use lower (2nd) ethernet port 2020-11-27 19:54:04 +01:00
Rene Straub 6f10e899b1 hw25: fix io pin muxing for 2nd ethernet rmii 2020-11-27 19:49:23 +01:00
Rene Straub e85e9ffa83 hw25: add variant handling
get variant information from product descriptor
configure device-tree accordingly
2020-11-27 15:49:52 +01:00
Rene Straub 0330a6b94f hw25: add start reason detection 2020-11-27 15:46:39 +01:00
Rene Straub 7e9ca6d8fa hw25: add methods for dio/serial PD entries 2020-11-27 15:42:23 +01:00
Rene Straub f5b16d4cf7 hw21, 26: suppress power on with ignition off
power down system in SPL when ignition is not active on a
power-on start.
2020-11-18 16:49:50 +01:00
René Straub f82ac7239a hw21,26: add start/wakeup reason detection logic (#58)
Move detection logic before PMIC rails init

Add detection logic in hw21/26

Detect start events from pmic

Co-authored-by: Rene Straub <rene.straub@netmodule.com>
Reviewed-on: https://git.netmodule.intranet/nmrouter/u-boot/pulls/58
2020-11-09 10:13:45 +01:00
Rene Straub dc6ed546db hw25: take USB/SD converter out of reset 2020-10-20 07:51:47 +02:00
Rene Straub 55332e5582 hw25: change defaultconsole to ttyS0 2020-10-20 07:27:45 +02:00
Rene Straub 1de7ebd031 hw25: enable rx function for IO_IN[0..3] gpios 2020-10-19 16:50:27 +02:00
Rene Straub d3f9300741 hw25: add board type detection 2020-10-19 16:49:35 +02:00
Rene Straub 50dbe9d830 hw25: fix Ethernet phy ids 2020-10-16 21:19:10 +02:00
Rene Straub 820db26639 hw25: remove shieldcmd from boot 2020-10-16 21:17:41 +02:00
Rene Straub 5e1b277281 Fixed C++ comment in header file 2020-10-06 08:54:51 +02:00
Rene Straub 9f0dd0d481 Review, minor changes 2020-10-06 08:49:41 +02:00
Nicolas Gugger c8a4189cd1 hw25: modified comment 2020-09-10 16:33:03 +02:00
Nicolas Gugger 29a9c27aa3 hw25: updated board and mux - ready for review 2020-09-10 15:49:58 +02:00
Nicolas Gugger 14cbc05115 hw25: cleaned up board and mux 2020-09-09 15:40:21 +02:00
Nicolas Gugger 2bc5815cb6 hw25: muxing intermediate save 2020-09-08 16:31:34 +02:00
Nicolas Gugger 13b003ae3b hw25: remove shield support 2020-09-08 14:24:28 +02:00
Nicolas Gugger 1ac538b956 hw25: initial setup based on hw24 2020-09-08 14:07:21 +02:00
Rene Straub f89b5527b7 hw21,26: set hw type in device-tree
- hardware type is stored as string under
  /proc/device-tree/nm,carrierboard,type
2020-08-17 16:57:42 +02:00