<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mtk-20170518/target/linux/ar71xx/image/lzma-loader/src, branch master</title>
<subtitle>MTK 20170518 : Mediatek SDK based on OpenWRT Barrier Breaker</subtitle>
<link rel='alternate' type='text/html' href='http://www.chd.sx/cgit/mtk-20170518/'/>
<entry>
<title>ar71xx: lzma-loader: constify kernel argv array</title>
<updated>2018-06-06T20:25:52+00:00</updated>
<author>
<name>Matthias Schiffer</name>
<email>mschiffer@universe-factory.net</email>
</author>
<published>2018-06-05T22:30:57+00:00</published>
<link rel='alternate' type='text/html' href='http://www.chd.sx/cgit/mtk-20170518/commit/?id=9968dcedb420c19b7639e7f626f1d47f70734d9b'/>
<id>9968dcedb420c19b7639e7f626f1d47f70734d9b</id>
<content type='text'>
By making the kernel argv array const, the .data section can always be
omitted from the laoder binary.

Signed-off-by: Matthias Schiffer &lt;mschiffer@universe-factory.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
By making the kernel argv array const, the .data section can always be
omitted from the laoder binary.

Signed-off-by: Matthias Schiffer &lt;mschiffer@universe-factory.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ar71xx: lzma-loader: set page size to 4KB</title>
<updated>2018-06-06T20:25:52+00:00</updated>
<author>
<name>Matthias Schiffer</name>
<email>mschiffer@universe-factory.net</email>
</author>
<published>2018-06-05T22:27:42+00:00</published>
<link rel='alternate' type='text/html' href='http://www.chd.sx/cgit/mtk-20170518/commit/?id=8d851a95b7f581a844160b892e0e52b9bb5b9a68'/>
<id>8d851a95b7f581a844160b892e0e52b9bb5b9a68</id>
<content type='text'>
The text section in the ELF loader is aligned to the maximum page size,
which defaults to 64KB. Reduce it to the actual page size to avoid wasting
flash space for this alignment.

Signed-off-by: Matthias Schiffer &lt;mschiffer@universe-factory.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The text section in the ELF loader is aligned to the maximum page size,
which defaults to 64KB. Reduce it to the actual page size to avoid wasting
flash space for this alignment.

Signed-off-by: Matthias Schiffer &lt;mschiffer@universe-factory.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ar71xx: lzma-loader: move padding workaround to gzip step</title>
<updated>2018-06-06T20:25:52+00:00</updated>
<author>
<name>Matthias Schiffer</name>
<email>mschiffer@universe-factory.net</email>
</author>
<published>2018-06-06T18:51:05+00:00</published>
<link rel='alternate' type='text/html' href='http://www.chd.sx/cgit/mtk-20170518/commit/?id=a28e46b7cc3da7f7b0f8c20e23fe4563bb8fcc52'/>
<id>a28e46b7cc3da7f7b0f8c20e23fe4563bb8fcc52</id>
<content type='text'>
Some devices (TP-Link TL-WR1043ND v1) don't boot reliably when the
uncompressed loader is too small. This was workarounded in the loader by
adding 512KB of padding to the .data section of the loader binary.

This approach had two issues:

- The padding was only working when .data was non-empty (otherwise the
  section would become NOBITS, omitting it in the binary). .data was only
  empty when no CMDLINE was set, leading to further workarounds like
  fe594bf90d09 ("ath79: fix loader-okli, lzma-loader"), and this
  workaround was only effective because a missing "const" led to the kernel
  argv being stored in .data instead of .rodata
- The padding was not only added to the compressed .gz loader, but also
  uncompressed .bin and .elf loaders. The prevented embedding the kernel
  cmdline in the loader for non-gz loader types.

To fix both issues, move the creation of the padding from the linker script
to the gzip step.

Signed-off-by: Matthias Schiffer &lt;mschiffer@universe-factory.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some devices (TP-Link TL-WR1043ND v1) don't boot reliably when the
uncompressed loader is too small. This was workarounded in the loader by
adding 512KB of padding to the .data section of the loader binary.

This approach had two issues:

- The padding was only working when .data was non-empty (otherwise the
  section would become NOBITS, omitting it in the binary). .data was only
  empty when no CMDLINE was set, leading to further workarounds like
  fe594bf90d09 ("ath79: fix loader-okli, lzma-loader"), and this
  workaround was only effective because a missing "const" led to the kernel
  argv being stored in .data instead of .rodata
- The padding was not only added to the compressed .gz loader, but also
  uncompressed .bin and .elf loaders. The prevented embedding the kernel
  cmdline in the loader for non-gz loader types.

To fix both issues, move the creation of the padding from the linker script
to the gzip step.

Signed-off-by: Matthias Schiffer &lt;mschiffer@universe-factory.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ar71xx: fix lzma-loader build with glibc</title>
<updated>2017-12-13T10:34:51+00:00</updated>
<author>
<name>Jonas Gorski</name>
<email>jonas.gorski@gmail.com</email>
</author>
<published>2017-12-13T10:12:11+00:00</published>
<link rel='alternate' type='text/html' href='http://www.chd.sx/cgit/mtk-20170518/commit/?id=eeeee885fb497bb07041575b78fca4063145edb9'/>
<id>eeeee885fb497bb07041575b78fca4063145edb9</id>
<content type='text'>
For an unknown reason gcc tries to link in crti.o when building with a
glibc toolchain (this does not happen with other targets). Prevent this
by telling gcc explicitly to not do that.

Fixes the following build error:

/home/jonas/git/lede/staging_dir/toolchain-mips_24kc_gcc-5.5.0_glibc/lib/gcc/mips-openwrt-linux-gnu/5.5.0/../../../../mips-openwrt-linux-gnu/lib/crti.o: In function `_init':
(.init+0x18): relocation truncated to fit: R_MIPS_GOT16 against `__gmon_start__'
/home/jonas/git/lede/staging_dir/toolchain-mips_24kc_gcc-5.5.0_glibc/lib/gcc/mips-openwrt-linux-gnu/5.5.0/../../../../mips-openwrt-linux-gnu/lib/crti.o: In function `_init':
(.init+0x28): relocation truncated to fit: R_MIPS_CALL16 against `__gmon_start__'
collect2: error: ld returned 1 exit status

Signed-off-by: Jonas Gorski &lt;jonas.gorski@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For an unknown reason gcc tries to link in crti.o when building with a
glibc toolchain (this does not happen with other targets). Prevent this
by telling gcc explicitly to not do that.

Fixes the following build error:

/home/jonas/git/lede/staging_dir/toolchain-mips_24kc_gcc-5.5.0_glibc/lib/gcc/mips-openwrt-linux-gnu/5.5.0/../../../../mips-openwrt-linux-gnu/lib/crti.o: In function `_init':
(.init+0x18): relocation truncated to fit: R_MIPS_GOT16 against `__gmon_start__'
/home/jonas/git/lede/staging_dir/toolchain-mips_24kc_gcc-5.5.0_glibc/lib/gcc/mips-openwrt-linux-gnu/5.5.0/../../../../mips-openwrt-linux-gnu/lib/crti.o: In function `_init':
(.init+0x28): relocation truncated to fit: R_MIPS_CALL16 against `__gmon_start__'
collect2: error: ld returned 1 exit status

Signed-off-by: Jonas Gorski &lt;jonas.gorski@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ar71xx: lzma loader use LTO</title>
<updated>2017-10-24T11:24:04+00:00</updated>
<author>
<name>Julien Dusser</name>
<email>julien.dusser@free.fr</email>
</author>
<published>2017-07-19T13:45:08+00:00</published>
<link rel='alternate' type='text/html' href='http://www.chd.sx/cgit/mtk-20170518/commit/?id=8d9ff6b6f7b2ba0c3dcba926099f819af871e0a8'/>
<id>8d9ff6b6f7b2ba0c3dcba926099f819af871e0a8</id>
<content type='text'>
Change the Makefile to use LTO for better code optimisations. Gains are
very low, only 270 bytes saved, but it's only Makefile changes.

Signed-off-by: Julien Dusser &lt;julien.dusser@free.fr&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change the Makefile to use LTO for better code optimisations. Gains are
very low, only 270 bytes saved, but it's only Makefile changes.

Signed-off-by: Julien Dusser &lt;julien.dusser@free.fr&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ar71xx: fix lzma loader performance issues</title>
<updated>2017-10-24T11:24:04+00:00</updated>
<author>
<name>Julien Dusser</name>
<email>julien.dusser@free.fr</email>
</author>
<published>2017-07-19T12:52:35+00:00</published>
<link rel='alternate' type='text/html' href='http://www.chd.sx/cgit/mtk-20170518/commit/?id=8c5702f2a07cebfbee6f9e628b63d88b8806ca1b'/>
<id>8c5702f2a07cebfbee6f9e628b63d88b8806ca1b</id>
<content type='text'>
Some bootloaders set a cache cohenrency to a very slow mode. Use code from
Linux kernel to set it to "Cacheable, noncoherent, write-back, write
allocate".

Perfomance impact is significant on TP-Link EAP245 board, kernel
decompression time fall from 33 seconds to less than 1.

Signed-off-by: Julien Dusser &lt;julien.dusser@free.fr&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some bootloaders set a cache cohenrency to a very slow mode. Use code from
Linux kernel to set it to "Cacheable, noncoherent, write-back, write
allocate".

Perfomance impact is significant on TP-Link EAP245 board, kernel
decompression time fall from 33 seconds to less than 1.

Signed-off-by: Julien Dusser &lt;julien.dusser@free.fr&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ar71xx/lzma-loader: fix O32 ABI conformance</title>
<updated>2016-01-17T15:29:03+00:00</updated>
<author>
<name>Gabor Juhos</name>
<email>juhosg@openwrt.org</email>
</author>
<published>2016-01-17T15:29:03+00:00</published>
<link rel='alternate' type='text/html' href='http://www.chd.sx/cgit/mtk-20170518/commit/?id=55b0e261a41bb6b27c2df8669c3708e8c1ab70a4'/>
<id>55b0e261a41bb6b27c2df8669c3708e8c1ab70a4</id>
<content type='text'>
According to the calling convention of the o32 ABI the caller
function must reserve stack space for $a0-$a3 registers in case
the callee needs to save its arguments.

The assembly code of the loader does not reserve stack space for
these registers thus when the 'loader_main' function needs to save
its arguments, those will be stored in the 'workspace' area instead
of the stack.

Because the workspace area is also used by other part of the code, the
saved register values gets overwritten and this often leads to failed
kernel boots.

Fix the code to reserve stack space for the registers to avoid this
error.

Signed-off-by: Gabor Juhos &lt;juhosg@openwrt.org&gt;

SVN-Revision: 48279
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
According to the calling convention of the o32 ABI the caller
function must reserve stack space for $a0-$a3 registers in case
the callee needs to save its arguments.

The assembly code of the loader does not reserve stack space for
these registers thus when the 'loader_main' function needs to save
its arguments, those will be stored in the 'workspace' area instead
of the stack.

Because the workspace area is also used by other part of the code, the
saved register values gets overwritten and this often leads to failed
kernel boots.

Fix the code to reserve stack space for the registers to avoid this
error.

Signed-off-by: Gabor Juhos &lt;juhosg@openwrt.org&gt;

SVN-Revision: 48279
</pre>
</div>
</content>
</entry>
<entry>
<title>ar71xx: fix build of lzma-loader with binutils 2.25.1</title>
<updated>2015-09-12T18:57:37+00:00</updated>
<author>
<name>Hauke Mehrtens</name>
<email>hauke@hauke-m.de</email>
</author>
<published>2015-09-12T18:57:37+00:00</published>
<link rel='alternate' type='text/html' href='http://www.chd.sx/cgit/mtk-20170518/commit/?id=e1ec8b76e9e045695f859a0430daaeba41fb3a04'/>
<id>e1ec8b76e9e045695f859a0430daaeba41fb3a04</id>
<content type='text'>
To make the lzma-loader build with binutils 2.25.1 it is needed to
remove the .MIPS.abiflags section otherwise I get the following compile
error:

mips-openwrt-linux-musl-objcopy -O binary -R .reginfo -R .note -R .comment -R .mdebug -S loader loader.bin
mips-openwrt-linux-musl-objcopy: Warning: Writing section `.text' to huge (ie negative) file offset 0xffffffff80a00000.
mips-openwrt-linux-musl-objcopy:loader.bin[.text]: File truncated

This should close #20487.

Signed-off-by: Hauke Mehrtens &lt;hauke@hauke-m.de&gt;

SVN-Revision: 46893
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
To make the lzma-loader build with binutils 2.25.1 it is needed to
remove the .MIPS.abiflags section otherwise I get the following compile
error:

mips-openwrt-linux-musl-objcopy -O binary -R .reginfo -R .note -R .comment -R .mdebug -S loader loader.bin
mips-openwrt-linux-musl-objcopy: Warning: Writing section `.text' to huge (ie negative) file offset 0xffffffff80a00000.
mips-openwrt-linux-musl-objcopy:loader.bin[.text]: File truncated

This should close #20487.

Signed-off-by: Hauke Mehrtens &lt;hauke@hauke-m.de&gt;

SVN-Revision: 46893
</pre>
</div>
</content>
</entry>
<entry>
<title>ar71xx: fix lzma-loader kernel command line passing</title>
<updated>2015-08-02T15:06:54+00:00</updated>
<author>
<name>Felix Fietkau</name>
<email>nbd@openwrt.org</email>
</author>
<published>2015-08-02T15:06:54+00:00</published>
<link rel='alternate' type='text/html' href='http://www.chd.sx/cgit/mtk-20170518/commit/?id=320aa306092383e7d2eaa37a2ce6fdca03186069'/>
<id>320aa306092383e7d2eaa37a2ce6fdca03186069</id>
<content type='text'>
The generic kernel cmdline parser ignores argv[0], this caused a
regression for all lzma-loader based boards with linux 4.1

Signed-off-by: Felix Fietkau &lt;nbd@openwrt.org&gt;

SVN-Revision: 46544
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The generic kernel cmdline parser ignores argv[0], this caused a
regression for all lzma-loader based boards with linux 4.1

Signed-off-by: Felix Fietkau &lt;nbd@openwrt.org&gt;

SVN-Revision: 46544
</pre>
</div>
</content>
</entry>
<entry>
<title>ar71xx/image: relink loader.elf image to LOADADDR</title>
<updated>2012-11-20T12:17:41+00:00</updated>
<author>
<name>Gabor Juhos</name>
<email>juhosg@openwrt.org</email>
</author>
<published>2012-11-20T12:17:41+00:00</published>
<link rel='alternate' type='text/html' href='http://www.chd.sx/cgit/mtk-20170518/commit/?id=97867f8717abc2b02bbea8c1ef625fe68f05700b'/>
<id>97867f8717abc2b02bbea8c1ef625fe68f05700b</id>
<content type='text'>
This allows to load the resulting image directly
from RouterBOOT.

Signed-off-by: Gabor Juhos &lt;juhosg@openwrt.org&gt;

SVN-Revision: 34271
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This allows to load the resulting image directly
from RouterBOOT.

Signed-off-by: Gabor Juhos &lt;juhosg@openwrt.org&gt;

SVN-Revision: 34271
</pre>
</div>
</content>
</entry>
</feed>
