| Age | Commit message (Collapse) | Author |
|
Using strstr() instead of strnstr() creates a security concern.
Fixes: 1c41a7afaa15 ("net: lwip: build lwIP")
Signed-off-by: Heinrich Schuchardt <[email protected]>
Reviewed-by: Jerome Forissier <[email protected]>
Reviewed-by: Ilias Apalodimas <[email protected]>
Signed-off-by: Jerome Forissier <[email protected]>
|
|
Add unit tests for the library functions.
Signed-off-by: Heinrich Schuchardt <[email protected]>
Acked-by: Ilias Apalodimas <[email protected]>
[jf: drop unwanted change to lib/string.c]
Signed-off-by: Jerome Forissier <[email protected]>
|
|
Implement library function strnstr().
Implement strstr() using strnstr().
Sort the includes.
Signed-off-by: Heinrich Schuchardt <[email protected]>
Reviewed-by: Ilias Apalodimas <[email protected]>
[jf: replace <stdint.h> by <limits.h>, folded from next patch]
Signed-off-by: Jerome Forissier <[email protected]>
|
|
Find_option() is used to retrieve the block size value in an option
acknowledgment in response to a request containing a block size option
according to RFC2348.
The format of an OACK response is described in RFC2347 as
+-------+---~~---+---+---~~---+---+---~~---+---+---~~---+---+
| opc | opt1 | 0 | value1 | 0 | optN | 0 | valueN | 0 |
+-------+---~~---+---+---~~---+---+---~~---+---+---~~---+---+
The current implementation of find_option() only works if
* blksize is the first option
* lwip_strnstr() ignores the length parameter,
i.e. is implemented via strstr()
The OACK messages starts with 0x00 0x06. If 'blksize' is the first option,
strstr() reports a match when the first parameter points to 0x06. Adding
the string length of 'blksize' plus 2 to the location of the 0x06 byte
points to the value.
Find_option() would report a match for option 'blksize' if the response
contained an option called 'foo_blksize_bar'. In this case find_option()
would return 'bar' as the value string.
If 'blksize' were the second option, find_option() would return a pointer
to the second character of the value string.
Furthermore find_option() does not detect if the value string is NUL
terminated. This may lead to a buffer overrun.
Provide an implementation that correctly steps from option to option.
Fixes: 27d7ccda94fa ("net: lwip: tftp: add support of blksize option to client")
Signed-off-by: Heinrich Schuchardt <[email protected]>
Reviewed-by: Jerome Forissier <[email protected]>
Tested-by: Jerome Forissier <[email protected]> (qemu_arm64_lwip)
Signed-off-by: Jerome Forissier <[email protected]>
|
|
Move the initialization of the ethernet devices out of the new_netif()
function. Indeed, new_netif() accepts a struct device argument, which
is expected to be valid and active. The activation and selection of
this device are achieved by eth_init() (on first time the network
stack is used) and eth_set_current(). This is what takes care of the
ethrotate and ethact environment variables. Therefore, move these calls
to a new function: net_lwip_set_current(), and use it whenever a
net-lwip command is run.
This patch hopefully fixes the incorrect net-lwip behavior observed on
boards with multiple ethernet interfaces [1].
Tested on an i.MX8MPlus EVK equipped wih two ethernet ports. The dhcp
command succeeds whether the cable is plugged into the first or second
port.
[1] https://lists.denx.de/pipermail/u-boot/2025-January/576326.html
Reported-by: E Shattow <[email protected]>
Tested-by: E Shattow <[email protected]>
Signed-off-by: Jerome Forissier <[email protected]>
|
|
From reading the S34ML02G1 and the SAM9X60 datasheets again, it seems
like we have to wait tREA after rising RE# before sampling the data.
Thus pulse time must be at least tREA.
Without this fix we got PMECC errors when reading, after switching to
ONFI timing mode 3 on SAM9X60 SoC with S34ML02G1 raw NAND flash chip.
The approach to set timings used before worked on sam9g20 and sama5d2
with the same flash (S34ML02G1), probably because those have a slower
mck clock rate and thus the resolution of the timings setup is not as
tight as with sam9x60.
The approach to fix the issue was carried over from at91bootstrap, and
has been successfully tested in at91bootstrap, U-Boot and Linux.
Link: https://github.com/linux4sam/at91bootstrap/issues/174
Cc: Li Bin <[email protected]>
Signed-off-by: Alexander Dahl <[email protected]>
|
|
Bind missing DSI and MIPI calibration devices.
Signed-off-by: Svyatoslav Ryhel <[email protected]>
|
|
Sync DSI nodes with Linux tree.
Signed-off-by: Svyatoslav Ryhel <[email protected]>
|
|
PLLD2 is a simple clock (controlled by 2 registers) and appears starting
from T30. Primary use of PLLD2 is as main HDMI clock parent.
Signed-off-by: Svyatoslav Ryhel <[email protected]>
|
|
PLLD2 is a simple clock (controlled by 2 registers) and appears starting
from T30. Primary use of PLLD2 is as main HDMI clock parent.
Signed-off-by: Svyatoslav Ryhel <[email protected]>
|
|
Not sure why these files were omitted, but SPL should
be converted to XPL.
Signed-off-by: Svyatoslav Ryhel <[email protected]>
|
|
Pin detection on t20 depends on node name. With recent changes
in node naming, let's remove '_' to be safe about both '_' or
'-' use.
Signed-off-by: Svyatoslav Ryhel <[email protected]>
|
|
Bind SYSRESET child to parent node since it does not have
its own node in the device tree.
Signed-off-by: Svyatoslav Ryhel <[email protected]>
Reviewed-by: Jaehoon Chung <[email protected]>
|
|
Bind GPIO and SYSRESET children to parent node since they
do not have their own nodes in the device tree.
Signed-off-by: Svyatoslav Ryhel <[email protected]>
Reviewed-by: Jaehoon Chung <[email protected]>
|
|
Requesting of PMIC's GPIO child should be done by binding
GPIO driver to PMIC's node is GPIO driver does not have
its own node.
This reverts commit c03cd98d1a163666b4addcdd9a34fc0c77dfd0a5.
Signed-off-by: Svyatoslav Ryhel <[email protected]>
Reviewed-by: Jaehoon Chung <[email protected]>
|
|
The GPIO banks are added as sub nodes or child nodes under the
pinctrl node (as per Linux ABI) and the reg property which points
to an array of controllers physical base address is removed
to align with the Linux devicetree.
Signed-off-by: Charan Pedumuru <[email protected]>
Signed-off-by: Manikandan Muralidharan <[email protected]>
|
|
U-Boot pinctrl driver expects a reg property explicitly unlike linux.
To align the DT of U-boot with the Linux, reg property is also arrvied
from child GPIO bank nodes when configured under the pinctrl node.
Signed-off-by: Manikandan Muralidharan <[email protected]>
|
|
In Linux DT,the pinctrl node acts as parent nodes with all other
gpio banks as child nodes and a single driver in Linux handles both
pinctrl settings and gpio requests.Current U-Boot DT maintains both
pinctrl and gpio nodes as separate nodes and offers two different class
of U-Boot drivers: UCLASS_PINCTRL which handles pin functions and
UCLASS_GPIO which handles gpio requests. In order to align the DT
of U-Boot with the DT of Linux, a hook is been added in the pinctrl
driver to bind the gpio driver with the pinctrl driver so that
when adding gpio nodes as subnodes to pinctrl node (as per the Linux ABI),
the corresponding APIs will be redirected and handled by valid
drivers attached to the pinctrl driver.
Signed-off-by: Manikandan Muralidharan <[email protected]>
|
|
Add the missing properties for the pinctrl node and for its
corresponding GPIO bank nodes to align with the Linux DT.
Signed-off-by: Manikandan Muralidharan <[email protected]>
Reviewed-by: Eugen Hristev <[email protected]>
|
|
Move pinmux nodes defined under the pinctrl node from sam9x60 SoC
DT to its board specific DTS files.
Signed-off-by: Manikandan Muralidharan <[email protected]>
Reviewed-by: Eugen Hristev <[email protected]>
|
|
Define the pinctrl nodes with its label to align with the Linux DT.
Without this change the pinmux nodes are grouped under an additional
'pinctrl' child node which is not identified by the pinctrl driver
when the GPIO banks are made as child nodes of pinctrl node.
Signed-off-by: Balamanikandan Gunasundar <[email protected]>
Signed-off-by: Manikandan Muralidharan <[email protected]>
Reviewed-by: Eugen Hristev <[email protected]>
|
|
Add Advanced Interrupt Controller node and define it as interrupt
parent in sam9x60 SoC DT.
Signed-off-by: Manikandan Muralidharan <[email protected]>
Reviewed-by: Eugen Hristev <[email protected]>
|
|
Report spi clk speed and make use of `log_ret()`.
Signed-off-by: Alexander Dahl <[email protected]>
|
|
The qspi controller on sama5d2 and sam9x60 supports "classic" SPI mode
without spi-mem enhancements and accelerations, very similar to the old
SPI controller on sam9g20 or the modern flexcom controllers of the same
SoC family.
Register interface differs somewhat, especially because only one
hardware controlled CS line is supported. Some fields are missing, some
are in different registers, but in principal it works similar. So code
is very much inspired by the old atmel-spi driver.
Tested on sam9x60 with a non-mainline driver to configure an FPGA.
Signed-off-by: Alexander Dahl <[email protected]>
|
|
Switching between Serial Memory Mode (SMM) and (classic) SPI mode is a
preparation for implementing .xfer() in the future.
Signed-off-by: Alexander Dahl <[email protected]>
|
|
The Serial Memory Mode (SMM) is enabled with atmel_qspi_set_cfg() on
each invocation of atmel_qspi_exec_op(). Setting SMM through
atmel_qspi_init() at probe time is redundant.
Removing the SMM setting at probe time should therefore 1) be safe to do
and 2) allows for setting it to a different value in a future
implementation of .xfer() which needs to disable SMM.
Signed-off-by: Alexander Dahl <[email protected]>
|
|
Port these commits:
- v6.11-rc5-90-g329ca3eed4a9a ("spi: atmel-quadspi: Avoid overwriting delay register settings")
- v6.12-rc1-1-g162d9b5d2308c ("spi: atmel-quadspi: Fix wrong register value written to MR").
- v6.13-rc2-27-gf663898d047a7 ("spi: atmel-quadspi: Factor out switching to Serial Memory Mode to function")
Cc: Csókás Bence <[email protected]>
Signed-off-by: Alexander Dahl <[email protected]>
|
|
Port changes from a 4 piece patch series from Linux kernel v5.10, merged
with v5.10-rc1-83-gc732b7567d869 ("Merge series "spi: atmel-quadspi: Fix
AHB memory accesses" from Tudor Ambarus …").
Port the single fix v5.15-rc1-14-g09134c5322df9 ("spi: Fixed division by
zero warning").
Reduces differences between linux and u-boot driver.
Cc: Tudor Ambarus <[email protected]>
Cc: Yoshitaka Ikeda <[email protected]>
Signed-off-by: Alexander Dahl <[email protected]>
|
|
Most other spi-mem drivers also depend on SPI_MEM. Fixes this build
error:
arm-v5te-linux-gnueabi-ld.bfd: drivers/spi/atmel-quadspi.o: in function `atmel_qspi_supports_op':
/mnt/data/adahl/src/u-boot/drivers/spi/atmel-quadspi.c:460: undefined reference to `spi_mem_default_supports_op'
make[1]: *** [/mnt/data/adahl/src/u-boot/Makefile:1821: u-boot] Error 1
Signed-off-by: Alexander Dahl <[email protected]>
Reviewed-by: Tom Rini <[email protected]>
|
|
This is inside of an 'if DM_SPI' block, and thus always true.
Signed-off-by: Alexander Dahl <[email protected]>
Reviewed-by: Tom Rini <[email protected]>
|
|
Update documentation for how to write tests and the 'ut' command.
Signed-off-by: Simon Glass <[email protected]>
|
|
At present the 'ut' command handles its flags in a strange way, in that
they must come after the subcommand.
So, we must use 'ut bloblist -r2' to run the bloblist tests twice. This
is an artefact of the way tests were run, through subcommands.
It is now possible to correct this, by doing flag-processing before
running the suite.
Update the code to handle this, so that 'ut -r2 bloblist' works. Update
the 'test_suite' test to check the new arguments.
Add a sanity-check for -I while we are here.
Signed-off-by: Simon Glass <[email protected]>
|
|
Move the logic from this function into run_suite(), on the way to having
flag parsing in the top-level 'ut' command instead of its children.
Signed-off-by: Simon Glass <[email protected]>
|
|
Enhance the ut command to accept a comma-separated list of test suites
to run. Report the summary information for these at the end.
Signed-off-by: Simon Glass <[email protected]>
|
|
This file is empty now. Remove it and its uses.
Signed-off-by: Simon Glass <[email protected]>
|
|
This function is not used outside the cmd_ut file anymore, so make it
static.
Signed-off-by: Simon Glass <[email protected]>
|
|
Now that everything is using the new test-suite features, drop support
for running commands.
Fix a missing closing-bracket while we are here.
Signed-off-by: Simon Glass <[email protected]>
|
|
This has nothing to do with commands anymore, so rename the file.
Signed-off-by: Simon Glass <[email protected]>
|
|
Use the new suite-runner to run these tests instead.
Signed-off-by: Simon Glass <[email protected]>
|
|
These tests run three different checks on the nodes, but the logic is
currently all in one tests.
Split the code out into three different tests, which do different setup
and then run the same checks.
Signed-off-by: Simon Glass <[email protected]>
|
|
Rather than having an init function and then running the tests, create a
test-init function to do it. This will allow us to get rid of the
command function.
Fix the comment abotu 'environment' while we are here.
Signed-off-by: Simon Glass <[email protected]>
|
|
Use the new suite-runner to run these tests instead.
Signed-off-by: Simon Glass <[email protected]>
|
|
Rather than having an init function and then running the tests, create a
test-init function to do it. This will allow us to get rid of the
command function.
Signed-off-by: Simon Glass <[email protected]>
|
|
Use the new suite-runner to run these tests instead.
Signed-off-by: Simon Glass <[email protected]>
|
|
Rather than having an init function and then running the tests, create a
test-init function to do it. This will allow us to get rid of the
command function.
Signed-off-by: Simon Glass <[email protected]>
|
|
Use the helpers provided for this purpose, rather than different ones in
this particular test.
Leave fdt_getprop_str() alone as it seems to have more value.
Signed-off-by: Simon Glass <[email protected]>
|
|
Move the init code into a separate function since it is quite large.
Adjust it to use unit-test functions which have become available since
the test was written.
Signed-off-by: Simon Glass <[email protected]>
|
|
Rather than having this condition defined separately for each suite,
bracket all options with 'if UNIT_TEST'.
Signed-off-by: Simon Glass <[email protected]>
|
|
The Makefile rules for tests should be within test/Makefile so move the
'fdt-overlay' rule over.
Signed-off-by: Simon Glass <[email protected]>
|
|
The Makefile rules for tests should be within test/Makefile so move the
'optee' rule over.
Signed-off-by: Simon Glass <[email protected]>
|