All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] sunxi: Add a bootcmd_old to the default environment to boot old kernels
Date: Sun, 11 Oct 2015 12:38:33 +0200	[thread overview]
Message-ID: <561A3C29.2020403@redhat.com> (raw)
In-Reply-To: <1444554728.16876.21.camel@hellion.org.uk>

Hi,

On 11-10-15 11:12, Ian Campbell wrote:
> On Fri, 2015-10-09 at 18:15 +0200, Hans de Goede wrote:
>> Add a bootcmd_old value to the default environment when building with
>> CONFIG_OLD_SUNXI_KERNEL_COMPAT, this way people who occasionally want
>> to boot an old kernel can do so by simply typing "run bootcmd_old"
>> rather then needing to have 2 separe setups / sdcards for old and
>
> "separate"?

Yep, my bad.

> "old" is a bit non-specific (e.g. there are also old mainline kernels).
> Perhaps bootcmd_sunxi_compat? It's a bit of a mouthful but it will tab
> complete b<tab>sun<tab> or close to that.

Ok, bootcmd_sunxi_compat it is.

>> +#ifdef CONFIG_OLD_SUNXI_KERNEL_COMPAT
>> +#define BOOTCMD_OLD \
>> +	"root=/dev/mmcblk0p3 rootwait\0" \
>
> Does something other than the below setenv bootargs rely on this? It'd
> be better not to pollute the default env with such a generically named
> thing. I suggest following the naming of the command, so
> root_sunxi_compat.
>
> If it is important to have root= present e.g. for script.bin or
> uEnv.txt then perhaps put setenv root ${root_sunxi_compat} at the start
> of the command?

Right, we need this because it is typically set from uEnv.txt, using
setenv before importing uEnv.txt is a good idea though. And there
is no need for the root_sunxi_compat indirection there IMHO.

Patch v2 with all this fixed coming up.

>
>> +	"bootcmd_old=" \
>> +		"if ext2load mmc 0 0x44000000 uEnv.txt; then " \
>> +			"echo Loaded environment from uEnv.txt; " \
>> +			"env import -t 0x44000000 ${filesize}; " \
>> +		"fi; " \
>> +		"setenv bootargs console=${console} root=${root}
>> ${extraargs}; " \
>> +		"ext2load mmc 0 0x43000000 script.bin && " \
>> +		"ext2load mmc 0 0x48000000 uImage && " \
>> +		"bootm 0x48000000\0"
>> +#else
>> +#define BOOTCMD_OLD
>> +#endif
>> +
>>   #include <config_distro_bootcmd.h>
>>
>>   #ifdef CONFIG_USB_KEYBOARD
>> @@ -495,6 +511,7 @@ extern int soft_i2c_gpio_scl;
>>   	MTD_ENV_SETTINGS \
>>   	"fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
>>   	"console=ttyS0,115200\0" \
>> +	BOOTCMD_OLD \
>>   	BOOTENV
>>
>>   #else /* ifndef CONFIG_SPL_BUILD */

Regards,

Hans

      reply	other threads:[~2015-10-11 10:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-09 16:15 [U-Boot] [PATCH] sunxi: Add a bootcmd_old to the default environment to boot old kernels Hans de Goede
2015-10-11  9:12 ` Ian Campbell
2015-10-11 10:38   ` Hans de Goede [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=561A3C29.2020403@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.