aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-10-30log: Add filter flag to match greater than a log levelSean Anderson2-7/+15
This is the complement of the existing behavior to match only messages with a log level less than a threshold. This is primarily useful in conjunction with LOGFF_DENY. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-10-30test: Add tests for LOGFF_DENYSean Anderson1-0/+67
This adds some tests for log filters which deny if they match. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-10-30test: log: Give tests names instead of numbersSean Anderson1-24/+24
Now that the log test command is no more, we can give the log tests proper names. Signed-off-by: Sean Anderson <seanga2@gmail.com>
2020-10-30test: log: Convert log_test from python to CSean Anderson5-297/+257
When rebasing this series I had to renumber all my log tests because someone made another log test in the meantime. This involved updaing a number in several places (C and python), and it wasn't checked by the compiler. So I though "how hard could it be to just rewrite in C?" And though it wasn't hard, it *was* tedious. Tests are numbered the same as before to allow for easier review. A note that if a test fails, everything after it will probably also fail. This is because that test won't clean up its filters. There's no easy way to do the cleanup, except perhaps removing all filters in a wrapper function. Signed-off-by: Sean Anderson <seanga2@gmail.com>
2020-10-30log: Add filter flag to deny on matchSean Anderson2-3/+20
Without this flag, log filters can only explicitly accept messages. Allowing denial makes it easier to filter certain subsystems. Unlike allow-ing filters, deny-ing filters are added to the beginning of the filter list. This should do the Right Thing most of the time, but it's less-universal than allowing filters to be inserted anywhere. If this becomes a problem, then perhaps log_filter_add* should take a filter number to insert before/after. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-10-30log: Add function to create a filter with flagsSean Anderson2-4/+31
This function exposes a way to specify flags when creating a filter. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-10-30log: Expose some helper functionsSean Anderson2-20/+34
These functions are required by "cmd: log: Add commands to manipulate filters" and "test: Add a test for log filter-*". Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-10-30log: Use CONFIG_IS_ENABLED() for LOG_TESTSean Anderson1-2/+2
Checkpatch complains about using #ifdef for CONFIG variables. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-10-30log: Add additional const qualifier to arraysSean Anderson1-2/+2
Both these arrays and their members are const. Fixes checkpatch complaint. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-10-30log: Fix incorrect documentation of log_filter.cat_listSean Anderson1-2/+2
Logging category lists are terminated by LOGC_END, not LOGC_NONE. Fixes: e9c8d49d54 ("log: Add an implementation of logging") Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-10-30log: Fix missing negation of ENOMEMSean Anderson1-1/+1
Errors returned should be negative. Fixes: 45fac9fc18 ("log: Correct missing free() on error in log_add_filter()") Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-10-30imx6: enable early spi environment access on aristainetos boardsHeiko Schocher4-0/+4
On aristianetos boards the display type is detected through "panel" environment variable. Dependend on the display type we detect the board type and this decides which DTB we have to use for the board. So we need early spi environment access. Signed-off-by: Heiko Schocher <hs@denx.de>
2020-10-30env: Access Environment in SPI flashes before relocationHeiko Schocher2-3/+105
Enable the new Kconfig option ENV_SPI_EARLY if you want to use Environment in SPI flash before relocation. Call env_init() and than you can use env_get_f() for accessing Environment variables. Signed-off-by: Heiko Schocher <hs@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-10-30env: split env_import_redund() into 2 functionsHeiko Schocher2-10/+50
split from env_import_redund() the part which checks which Environment is valid into a separate function called env_check_redund() and call it from env_import_redund(). So env_check_redund() can be used from places which also need to do this checks. Signed-off-by: Heiko Schocher <hs@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-10-30test: unit test for efi_create_indexed_name()Heinrich Schuchardt1-0/+19
Provide a unit test for function efi_create_indexed_name(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-10-30efi_loader: add efi_create_indexed_name()AKASHI Takahiro3-0/+40
This function will be used from several places in UEFI subsystem to generate some specific form of utf-16 variable name. For example, L"Capsule0001" Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Move function to separate module. Use char * as argument instead of u16 *. Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-10-30efi_loader: add option to initialise EFI subsystem earlyAKASHI Takahiro2-0/+10
If this option, CONFIG_EFI_SETUP_EARLY, is enabled, the initialisation of UEFI subsystem will be done as part of U-Boot initialisation. Please note that this option won't be enabled explicitly by users, instead, should be enabled implicitly by other configuration options. Specifically, this feature will be utilised in implementing capsule-on-disk feature. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-10-30dfu: add dfu_write_by_alt()AKASHI Takahiro2-1/+72
This function is a variant of dfu_write_by_name() and takes a DFU alt setting number for dfu configuration. It will be utilised to implement UEFI capsule management protocol for raw image in a later commit. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2020-10-30dfu: export dfu_listAKASHI Takahiro2-1/+4
This variable will be utilized to enumerate all dfu entities for UEFI capsule firmware update in a later commit. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2020-10-30common: update: add a generic interface for FIT imageAKASHI Takahiro5-2/+100
The main purpose of this patch is to separate a generic interface for updating firmware using DFU drivers from "auto-update" via tftp. This function will also be used in implementing UEFI capsule update in a later commit. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2020-10-30dfu: modify an argument type for an addressAKASHI Takahiro3-6/+7
The range of an addressable pointer can go beyond 'integer'. So change the argument type to a void pointer. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Tom Rini <trini@konsulko.com>
2020-10-30dfu: rename dfu_tftp_write() to dfu_write_by_name()AKASHI Takahiro5-22/+41
This function is essentially independent from tftp, and will also be utilised in implementing UEFI capsule update in a later commit. So just give it a more generic name. In addition, a new configuration option, CONFIG_DFU_WRITE_ALT, was introduced so that the file will be compiled with different options, particularly one added in a later commit. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2020-10-30efi_loader: typo in function description of u16_strnlenHeinrich Schuchardt1-1/+1
%/u16_strlen/u16_strnlen()/ Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-10-30rtc: initialize emulated RTC from environment variableHeinrich Schuchardt2-8/+21
Up to now the emulated RTC is initialized using the U-Boot build time. With this patch the environment variable 'rtc_emul_epoch' can be used to provide a better initial time. The variable is a decimal string with the number of seconds since 1970-01-01. Here is an example where the RTC had not been probed yet: => setenv rtc_emul_epoch 1610109000 => date Date: 2021-01-08 (Friday) Time: 12:30:00 If the variable does not exist, the U-Boot build time is used as fallback. The environment variable may be set when shutting down the operating system if the U-Boot environment is exposed to the OS (cf. ENV_IS_IN_FAT and ENV_IS_IN_EXT4). Suggested-by: Pablo Sebastián Greco <pgreco@centosproject.org> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-10-30rtc: use probe() to initialize emulated RTCHeinrich Schuchardt1-6/+12
Currently the emulated RTC is initialized in the emul_rtc_get() get function. This does not match the design of the driver model. Move the initialization of the emulated RTC to the probe() function. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-10-30efi_loader: fix DisconnectController() for sole childHeinrich Schuchardt1-8/+11
If ChildHandle indicates the sole child of the driver, disconnect the driver. This fixes the test results for UEFI SCT 2.6 A sub-tests 5.1.3.12.43, 5.1.3.12.44, 5.1.3.12.45. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-10-30video: rockchip: Add missing dpcd_write() call to link_train_ce()Alper Nebi Yasak1-0/+6
Found this by comparing it to the coreboot driver, a form of this call was introduced there in their commit b9a7877568cf ("rockchip/*: refactor edp driver"). This is copy-pasted from U-Boot's link_train_cr() slightly above it. Without this on a gru-kevin chromebook, I have: clock recovery at voltage 0 pre-emphasis 0 requested signal parameters: lane 0 voltage 0.4V pre_emph 3.5dB requested signal parameters: lane 1 voltage 0.4V pre_emph 3.5dB requested signal parameters: lane 2 voltage 0.4V pre_emph 3.5dB requested signal parameters: lane 3 voltage 0.4V pre_emph 3.5dB using signal parameters: voltage 0.4V pre_emph 3.5dB requested signal parameters: lane 0 voltage 0.4V pre_emph 3.5dB requested signal parameters: lane 1 voltage 0.4V pre_emph 3.5dB requested signal parameters: lane 2 voltage 0.4V pre_emph 3.5dB requested signal parameters: lane 3 voltage 0.4V pre_emph 3.5dB using signal parameters: voltage 0.4V pre_emph 3.5dB requested signal parameters: lane 0 voltage 0.4V pre_emph 3.5dB requested signal parameters: lane 1 voltage 0.4V pre_emph 3.5dB requested signal parameters: lane 2 voltage 0.4V pre_emph 3.5dB requested signal parameters: lane 3 voltage 0.4V pre_emph 3.5dB using signal parameters: voltage 0.4V pre_emph 3.5dB requested signal parameters: lane 0 voltage 0.4V pre_emph 3.5dB requested signal parameters: lane 1 voltage 0.4V pre_emph 3.5dB requested signal parameters: lane 2 voltage 0.4V pre_emph 3.5dB requested signal parameters: lane 3 voltage 0.4V pre_emph 3.5dB using signal parameters: voltage 0.4V pre_emph 3.5dB requested signal parameters: lane 0 voltage 0.4V pre_emph 3.5dB requested signal parameters: lane 1 voltage 0.4V pre_emph 3.5dB requested signal parameters: lane 2 voltage 0.4V pre_emph 3.5dB requested signal parameters: lane 3 voltage 0.4V pre_emph 3.5dB using signal parameters: voltage 0.4V pre_emph 3.5dB channel eq failed, ret=-5 link train failed! rk_vop_probe() Device failed: ret=-5 With this, it looks like training succeeds: clock recovery at voltage 0 pre-emphasis 0 requested signal parameters: lane 0 voltage 0.4V pre_emph 3.5dB requested signal parameters: lane 1 voltage 0.4V pre_emph 3.5dB requested signal parameters: lane 2 voltage 0.4V pre_emph 3.5dB requested signal parameters: lane 3 voltage 0.4V pre_emph 3.5dB using signal parameters: voltage 0.4V pre_emph 3.5dB requested signal parameters: lane 0 voltage 0.4V pre_emph 6dB requested signal parameters: lane 1 voltage 0.4V pre_emph 6dB requested signal parameters: lane 2 voltage 0.4V pre_emph 6dB requested signal parameters: lane 3 voltage 0.4V pre_emph 6dB using signal parameters: voltage 0.4V pre_emph 6dB requested signal parameters: lane 0 voltage 0.4V pre_emph 0dB requested signal parameters: lane 1 voltage 0.4V pre_emph 0dB requested signal parameters: lane 2 voltage 0.4V pre_emph 0dB requested signal parameters: lane 3 voltage 0.4V pre_emph 0dB using signal parameters: voltage 0.4V pre_emph 0dB channel eq at voltage 0 pre-emphasis 0 config video failed rk_vop_probe() Device failed: ret=-110 The "config video failed" error also goes away when I disable higher log levels, and it claims to have successfully probed the device. Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Kever Yang<kever.yang@rock-chips.com>
2020-10-30ram: rockchip: px30: add a config-based ddr selectionHeiko Stuebner2-0/+29
The SRAM on the PX30 is not big enough to hold multiple DDR configs so it needs to be selected during build. So far simply the DDR3 config was always selected and getting DDR4 or LPDDR2/3 initialized would require a code modification. So add Kconfig options similar to RK3399 to allow selecting the DDR4 and LPDDR2/3 options instead, while DDR3 stays the default as before. Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com> Reviewed-by: Kever Yang<kever.yang@rock-chips.com>
2020-10-30rockchip: Rock960: fix up USB supportPeter Robinson2-3/+8
Fix up USB config options so keyboards and other USB devices work. Signed-off-by: Peter Robinson <pbrobinson@gmail.com> Reviewed-by: Kever Yang<kever.yang@rock-chips.com> Change-Id: I34b0696e0ac7303186f20c83278dde340399b690
2020-10-30rockchip: dts: tinker: remove unnecessary nodeStefan Agner1-4/+0
The property reg-shift with the same value is present in the base device tree already. Remove unnecessary node from rk3288-tinker.dts. Signed-off-by: Stefan Agner <stefan@agner.ch> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2020-10-30rockchip: dts: tinker: move i2c node to shared device treeStefan Agner2-7/+7
The I2C EEPROM is present on Tinker Board S as well. Move the i2c node to the shared, U-Boot specific rk3288-tinker-u-boot.dtsi device tree. Cc: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Stefan Agner <stefan@agner.ch> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2020-10-30clk: rockchip: rk3399: implement getting wdt/alive clocksJack Mitchell1-0/+20
In order to correctly calculate the designware watchdog timeouts, the watchdog clock is required. Implement required clocks to facilitate this. Signed-off-by: Jack Mitchell <ml@embed.me.uk> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2020-10-29binman: Avoid calculated section data repeatedlySimon Glass1-11/+13
Refactor the implementation slightly so that section data is not rebuilt when it is already available. We still have GetData() set up to rebuild the section, since we don't currently track when things change that might affect a section. For example, if a blob is updated within a section, we must rebuild it. Tracking that would be possible but is more complex, so it left for another time. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-29binman: Support compression of sectionsSimon Glass7-0/+323
With the previous changes, it is now possible to compress entire sections. Add some tests to check that compression works correctly, including updating the metadata. Also update the documentation. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-29binman: Use the actual contents in CheckSize()Simon Glass2-8/+5
At present this function adds up the total size of entries to work out the size of a section's contents. With compression this is no-longer enough. We may as well bite the bullet and build the section contents instead. Call _BuildSectionData() to get the (possibly compressed) contents and GetPaddedData() to get the same but with padding added. Note that this is inefficient since the section contents is calculated twice. Future work will improve this. This affects testPackOverlapMap() since the error is reported with a different section size now (enough to hold the contents). Update that at the same time. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-29binman: Update CheckEntries() for compressed sectionsSimon Glass1-2/+4
At present this function assumes that the size of a section is at least as large as its contents. With compression this is often not the case. Relax this constraint by using the uncompressed size, if available. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-29binman: Drop CheckEntries()Simon Glass3-14/+13
This method introduces a separation between packing and checking that is different for sections. In order to handle compression properly, we need to be able to deal with a section's size being smaller than the uncompressed size of its contents. It is easier to make this work if everything happens in the Pack() method. The only real user of CheckEntries() is entry_Section and it can call it directly. Drop the call from 'control' and handle it locally. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-29binman: Call CheckSize() from the section's Pack() methodSimon Glass1-1/+4
At present CheckSize() is called from the function that packs the entries. Move it up to the main Pack() function so that _PackEntries() can just do the packing. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-29binman: Drop the Entry.CheckSize() methodSimon Glass2-12/+10
This is only used by entry_Section and that class already calls it. Avoid calling it twice. Also drop it from the documentation. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-29binman: Move sort and expand to the main Pack() functionSimon Glass1-3/+4
At present sorting and expanding entries are side-effects of the CheckEntries() function. This is a bit confusing, as 'checking' would not normally involve making changes. Move these steps into the Pack() function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-29binman: Drop Entry.CheckOffset()Simon Glass2-5/+2
This function just calls CheckEntries() in the only non-trivial implementation. Drop it and use CheckEntries() directly. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-29binman: Avoid reporting image-pos with compressionSimon Glass4-13/+26
When a section is compressed, all entries within it are grouped together into a compressed block of data. This obscures the start of each individual child entry. Avoid reporting bogus 'image-pos' properties in this case, since it is not possible to access the entry at the location provided. The entire section must be decompressed first. CBFS does not support compressing whole sections, only individual files, so needs no special handling here. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-29binman: Set section contents in GetData()Simon Glass3-2/+22
Section contents is not set up when ObtainContents() is called, since packing often changes the layout of the contents. Ensure that the contents are correctly recorded by making this function regenerate the section. It is normally only called by the parent section (when packing) or by the top-level image code, when writing out the image. So the performance impact is fairly small. Now that sections have their contents in their 'data' property, update testSkipAtStartSectionPad() to check it. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-29binman: Store the original data before compressionSimon Glass2-1/+18
When compressing an entry, the original uncompressed data is overwritten. Store it so it is available if needed. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-29binman: Make section padding consistent with other entriesSimon Glass4-2/+86
At present padding of sections is inconsistent with other entry types, in that different pad bytes are used. When a normal entry is padded by its parent, the parent's pad byte is used. But for sections, the section's pad byte is used. Adjust logic to always do this the same way. Note there is still a special case in entry_Section.GetPaddedData() where an image is padded with the pad byte of the top-level section. This is necessary since otherwise there would be no way to set the pad byte of the image, without adding a top-level section to every image. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-29binman: Move section padding to the parentSimon Glass2-12/+12
Each section is padded up to its size, if the contents are not large enough. Move this logic from _BuildSectionData() to GetPaddedDataForEntry() so that all the padding is in one place. With this, the testDual test is working again, so enable it. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-29binman: Refactor _BuildSectionData()Simon Glass2-10/+51
At present this function does the padding needed around an entry. It is easier to understand what is going on if we have a function that returns the contents of an entry, with padding included. Refactor the code accordingly, adding a new GetPaddedData() method. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-29binman: Move section-building code into a functionSimon Glass2-8/+31
Create a new _BuildSectionData() to hold the code that is now in GetData(), so that it is clearly separated from entry.GetData() base function. Separate out the 'pad-before' processing to make this easier to understand. Unfortunately this breaks the testDual test. Rather than squash several patches into an un-reviewable glob, disable the test for now. This also affects testSkipAtStartSectionPad(), although it still not quite what it should be. Update that temporarily for now. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-29binman: Expand docs and test for alignmentSimon Glass3-12/+56
Alignment does form part of the entry once the image is written out, but within binman the entry contents does not include the padding. Add documentation to make this clear, as well as a test. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-29binman: Expand docs and test for paddingSimon Glass3-7/+45
Padding becomes part of the entry once the image is written out, but within binman the entry contents does not include the padding. Add documentation to make this clear, as well as a test. Signed-off-by: Simon Glass <sjg@chromium.org>