<feed xmlns='http://www.w3.org/2005/Atom'>
<title>bcm63xx/u-boot/arch/sandbox/cpu/os.c, branch master</title>
<subtitle>Broadcom-s U-Boot</subtitle>
<id>https://git.openwrt.org/project/bcm63xx/u-boot/atom?h=master</id>
<link rel='self' href='https://git.openwrt.org/project/bcm63xx/u-boot/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/bcm63xx/u-boot/'/>
<updated>2019-04-24T02:26:43Z</updated>
<entry>
<title>sandbox: Correct maths in allocation routines</title>
<updated>2019-04-24T02:26:43Z</updated>
<author>
<name>Simon Glass</name>
</author>
<published>2019-04-08T19:20:42Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/bcm63xx/u-boot/commit/?id=4a6409b74cc09b150f234ba3ab7d75ba6358270a'/>
<id>urn:sha1:4a6409b74cc09b150f234ba3ab7d75ba6358270a</id>
<content type='text'>
Allocation routines were adjusted to ensure that the returned addresses
are a multiple of the page size, but the header code was not updated to
take account of this. These routines assume that the header size is the
same as the page size which is unlikely.

At present os_realloc() does not work correctly due to this bug. The only
user is the hostfs 'ls' command, and only if the directory contains a
unusually long filename, which likely explains why this bug was not
caught earlier.

Fix this by doing the calculations using the obtained page size.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>sandbox: Improve debugging in initcall_run_list()</title>
<updated>2019-04-24T02:26:43Z</updated>
<author>
<name>Simon Glass</name>
</author>
<published>2019-04-08T19:20:41Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/bcm63xx/u-boot/commit/?id=001d1885f0012dbedef44bd828f91ba048029261'/>
<id>urn:sha1:001d1885f0012dbedef44bd828f91ba048029261</id>
<content type='text'>
At present if one of the initcalls fails on sandbox the address printing
is not help, e.g.:

  initcall sequence 0000557678967c80 failed at call 00005576709dfe1f (err=-96)

This is because U-Boot gets relocated high into memory and the relocation
offset (gd-&gt;reloc_off) does not work correctly for sandbox.

Add support for finding the base address of the text region (at least on
Linux) and use that to set the relocation offset. This makes the output
better:

  initcall sequence 0000560775957c80 failed at call 0000000000048134 (err=-96)

Then you use can use grep to see which init call failed, e.g.:

   $ grep 0000000000048134 u-boot.map
   stdio_add_devices

Of course another option is to run it with a debugger such as gdb:

   $ gdb u-boot
   ...
   (gdb) br initcall.h:41
   Breakpoint 1 at 0x4db9d: initcall.h:41. (2 locations)

Note that two locations are reported, since this function is used in both
board_init_f() and board_init_r().

   (gdb) r
   Starting program: /tmp/b/sandbox/u-boot
   [Thread debugging using libthread_db enabled]
   Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

   U-Boot 2018.09-00264-ge0c2ba9814-dirty (Sep 22 2018 - 12:21:46 -0600)

   DRAM:  128 MiB
   MMC:

Breakpoint 1, initcall_run_list (init_sequence=0x5555559619e0 &lt;init_sequence_f&gt;)
    at /scratch/sglass/cosarm/src/third_party/u-boot/files/include/initcall.h:41
41				printf("initcall sequence %p failed at call %p (err=%d)\n",
   (gdb) print *init_fnc_ptr
   $1 = (const init_fnc_t) 0x55555559c114 &lt;stdio_add_devices&gt;
   (gdb)

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>sandbox: Fix up the debug message for the image filename</title>
<updated>2018-12-05T13:01:34Z</updated>
<author>
<name>Simon Glass</name>
</author>
<published>2018-11-24T04:29:24Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/bcm63xx/u-boot/commit/?id=6b5e420137b42f3c23669b07a7b0c6ff5502fcb9'/>
<id>urn:sha1:6b5e420137b42f3c23669b07a7b0c6ff5502fcb9</id>
<content type='text'>
This currently prints out the wrong filename. Fix it.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>sandbox: Use memmove() to move overlapping regions</title>
<updated>2018-11-29T16:30:05Z</updated>
<author>
<name>Simon Glass</name>
</author>
<published>2018-11-13T22:55:20Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/bcm63xx/u-boot/commit/?id=b847c1424318c6a0b7aab14e465d7e253b162d31'/>
<id>urn:sha1:b847c1424318c6a0b7aab14e465d7e253b162d31</id>
<content type='text'>
The use of strcpy() to remove characters at the start of a string is safe
in U-Boot, since we know the implementation. But in os.c we are using the
C library's strcpy() function, where this behaviour is not permitted.

Update the code to use memmove() instead.

Reported-by: Coverity (CID: 173279)
Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reviewed-by: Alexander Graf &lt;agraf@suse.de&gt;
</content>
</entry>
<entry>
<title>sandbox: Boot in U-Boot through the standard call</title>
<updated>2018-11-26T13:25:37Z</updated>
<author>
<name>Simon Glass</name>
</author>
<published>2018-11-16T01:44:08Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/bcm63xx/u-boot/commit/?id=27028f186d17a25507eb7d5c9b852d8555432679'/>
<id>urn:sha1:27028f186d17a25507eb7d5c9b852d8555432679</id>
<content type='text'>
Most architectures use jump_to_image_no_args() to jump from SPL to U-Boot.
At present sandbox is special in that it jumps in its
spl_board_load_image() call. This is not strictly correct, and means that
sandbox misses out some parts of board_init_r(), just as calling
bloblist_finish(), for example.

Change spl_board_load_image() to just identify the filename to boot, and
implement jump_to_image_no_args() to actually jump to it.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>sandbox: Filter arguments when starting U-Boot</title>
<updated>2018-11-26T13:25:37Z</updated>
<author>
<name>Simon Glass</name>
</author>
<published>2018-11-16T01:44:07Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/bcm63xx/u-boot/commit/?id=65f3b1f99274ef876499c082aa66a83f46372d16'/>
<id>urn:sha1:65f3b1f99274ef876499c082aa66a83f46372d16</id>
<content type='text'>
The current method of starting U-Boot from U-Boot adds arguments to pass
the memory file through, so that memory is preserved. This is fine for a
single call, but if we call from TPL -&gt; SPL -&gt; U-Boot the arguments build
up and we have several memory files in the argument list.

Adjust the implementation to filter out arguments that we want to replace
with new ones. Also print a useful error if the exec() call fails.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>sandbox: Use malloc() and free() from os layer</title>
<updated>2018-11-26T13:25:37Z</updated>
<author>
<name>Simon Glass</name>
</author>
<published>2018-11-16T01:44:06Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/bcm63xx/u-boot/commit/?id=fc1f58a4da74a8c123241f42a87200d59ee08e81'/>
<id>urn:sha1:fc1f58a4da74a8c123241f42a87200d59ee08e81</id>
<content type='text'>
At present sandbox calls malloc() from various places in the OS layer and
this results in calls to U-Boot's malloc() implementation. It is better to
use the on in the OS layer, since it does not mix allocations with the
main U-Boot code.

Fix this by replacing calls with malloc() to os_malloc(), etc.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reviewed-by: Joe Hershberger &lt;joe.hershberger@ni.com&gt;
</content>
</entry>
<entry>
<title>sandbox: Refactor code to create os_jump_to_file()</title>
<updated>2018-11-26T13:25:36Z</updated>
<author>
<name>Simon Glass</name>
</author>
<published>2018-11-16T01:44:05Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/bcm63xx/u-boot/commit/?id=7b5ea1452742be72a28f52f4602c986eb342779b'/>
<id>urn:sha1:7b5ea1452742be72a28f52f4602c986eb342779b</id>
<content type='text'>
At present os_jump_to_image() jumps to a given image, and this is written
to a file. But it is useful to be able to jump to a file also.

To avoid duplicating code, split out the implementation of
os_jump_to_image() into a new function that jumps to a file.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>sandbox: Add a function to read a host file</title>
<updated>2018-11-21T02:14:22Z</updated>
<author>
<name>Simon Glass</name>
</author>
<published>2018-11-06T22:21:25Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/bcm63xx/u-boot/commit/?id=566bf3a8698780079196da742c363ca3b627ca31'/>
<id>urn:sha1:566bf3a8698780079196da742c363ca3b627ca31</id>
<content type='text'>
Add a way to read a file from the host filesystem. This can be useful for
reading test data, for example. Also fix up the writing function which was
not the right version, and drop the debugging lines.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>sandbox: Try to start the RAM buffer at a particular address</title>
<updated>2018-11-14T17:16:27Z</updated>
<author>
<name>Simon Glass</name>
</author>
<published>2018-06-17T14:57:43Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/bcm63xx/u-boot/commit/?id=bd8b74551b64e740ca27510406d26bd82ae74c38'/>
<id>urn:sha1:bd8b74551b64e740ca27510406d26bd82ae74c38</id>
<content type='text'>
Use a starting address of 256MB which should be available. This helps to
make sandbox RAM buffers pointers more recognisable.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
</feed>
