All of lore.kernel.org
 help / color / mirror / Atom feed
From: Magnus Damm <magnus.damm@gmail.com>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 4/4 v4] mmc, ARM: Add zboot from eSD support for SuperH
Date: Wed, 16 Mar 2011 00:37:50 +0000	[thread overview]
Message-ID: <AANLkTimgwpP-WTGF-E=KO3TAXDX7FP4WnW3XQiHi0Ton@mail.gmail.com> (raw)
In-Reply-To: <20110315222738.GA23288@verge.net.au>

Hi Simon,

Thanks for your work on this!

On Wed, Mar 16, 2011 at 7:27 AM, Simon Horman <horms@verge.net.au> wrote:
> This allows a ROM-able zImage to be written to eSD and for SuperH Mobile
> ARM to boot directly from the SDHI hardware block.
>
> This is achieved by the MaskROM loading the first portion of the image into
> MERAM and then jumping to it.  This portion contains loader code which
> copies the entire image to SDRAM and jumps to it. From there the zImage
> boot code proceeds as normal, uncompressing the image into its final
> location and then jumping to it.
>
> Cc: Paul Mundt <lethal@linux-sh.org>
> Cc: Magnus Damm <magnus.damm@gmail.com>
> Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> Signed-off-by: Simon Horman <horms@verge.net.au>
>
> ---
>
> This patch is based on the for-next branch of
> Russell King's linux-2.6-arm tree
>
> v2
> * Consistently use __raw_readw(). As pointed out by Paul Mundt
>
> v3
> * Remove mmcif_update_progress2(), it was for debugging during development
> * Move CPU specific code into mach/sdhi.h
>  As requested by Magnus Damm
> * Use linux/mmc/tmio.h now that it exists
> * Remove SDHI_EXT_SWAP, it is unused
> * Replace use of MMCIF_PROGRESS_* with MMC_PROGRESS_*
> * Don't include linux/mmc/sh_mmcif.h
>  + Replace use of MMCIF_CE_RESP_CMD12 with RESP_CMD12
>  + Include linux/io.h
>
> v4
> * Move definition of SDHI_BASE into CPU-specific code.
>  Thanks to Magnus Damm.
> ---

> +asmlinkage void mmc_loader(unsigned short *buf, unsigned long len)
> +{
> +       int high_capacity;
> +
> +       mmc_init_progress();
> +
> +       mmc_update_progress(MMC_PROGRESS_ENTER);
> +       sdhi_boot_enter();
> +
> +       /* setup SDHI hardware */
> +       mmc_update_progress(MMC_PROGRESS_INIT);
> +       high_capacity = sdhi_boot_init(SDHI_BASE);
> +       if (high_capacity < 0)
> +               goto err;
> +
> +       mmc_update_progress(MMC_PROGRESS_LOAD);
> +       /* load kernel */
> +       if (sdhi_boot_do_read(SDHI_BASE, high_capacity,
> +                             0, /* Kernel is at block 1 */
> +                             (len + TMIO_BBS - 1) / TMIO_BBS, buf))
> +               goto err;
> +
> +       sdhi_boot_cleanup();
> +
> +       mmc_update_progress(MMC_PROGRESS_DONE);
> +
> +       return;
> +err:
> +       __raw_writel(__raw_readl(PORTR031_000DR) | 1, PORTR031_000DR);
> +       for(;;);
> +
> +}

Sorry for not catching this earlier, but this __raw_writel() to
PORTR031_000DR is cpu specific as well. So please move that to the CPU
specific code.

Not sure if it makes sense at this point, but perhaps it's a good idea
to move the mmc_loader() function into the CPU specific portion. As
you know, the CPU itself has multiple SDHI hardware blocks, and
because of that we want the common SDHI loader to be written to
support any SDHI hardware block instance.

Right now the SDHI_BASE variable is limiting the shared SDHI loader
code to a fixed hardware block instance. That's fine because we only
boot from a single SDHI hardware block instance on sh7372, but future
processors most likely support selecting boot SDHI hardware block
instance.

Apart from those minor bits I think the code is getting into a really
good shape!

Thanks,

/ magnus

WARNING: multiple messages have this Message-ID (diff)
From: Magnus Damm <magnus.damm@gmail.com>
To: Simon Horman <horms@verge.net.au>
Cc: linux-sh@vger.kernel.org, linux-mmc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
	Chris Ball <cjb@laptop.org>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	Paul Mundt <lethal@linux-sh.org>
Subject: Re: [PATCH 4/4 v4] mmc, ARM: Add zboot from eSD support for SuperH Mobile ARM
Date: Wed, 16 Mar 2011 09:37:50 +0900	[thread overview]
Message-ID: <AANLkTimgwpP-WTGF-E=KO3TAXDX7FP4WnW3XQiHi0Ton@mail.gmail.com> (raw)
In-Reply-To: <20110315222738.GA23288@verge.net.au>

Hi Simon,

Thanks for your work on this!

On Wed, Mar 16, 2011 at 7:27 AM, Simon Horman <horms@verge.net.au> wrote:
> This allows a ROM-able zImage to be written to eSD and for SuperH Mobile
> ARM to boot directly from the SDHI hardware block.
>
> This is achieved by the MaskROM loading the first portion of the image into
> MERAM and then jumping to it.  This portion contains loader code which
> copies the entire image to SDRAM and jumps to it. From there the zImage
> boot code proceeds as normal, uncompressing the image into its final
> location and then jumping to it.
>
> Cc: Paul Mundt <lethal@linux-sh.org>
> Cc: Magnus Damm <magnus.damm@gmail.com>
> Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> Signed-off-by: Simon Horman <horms@verge.net.au>
>
> ---
>
> This patch is based on the for-next branch of
> Russell King's linux-2.6-arm tree
>
> v2
> * Consistently use __raw_readw(). As pointed out by Paul Mundt
>
> v3
> * Remove mmcif_update_progress2(), it was for debugging during development
> * Move CPU specific code into mach/sdhi.h
>  As requested by Magnus Damm
> * Use linux/mmc/tmio.h now that it exists
> * Remove SDHI_EXT_SWAP, it is unused
> * Replace use of MMCIF_PROGRESS_* with MMC_PROGRESS_*
> * Don't include linux/mmc/sh_mmcif.h
>  + Replace use of MMCIF_CE_RESP_CMD12 with RESP_CMD12
>  + Include linux/io.h
>
> v4
> * Move definition of SDHI_BASE into CPU-specific code.
>  Thanks to Magnus Damm.
> ---

> +asmlinkage void mmc_loader(unsigned short *buf, unsigned long len)
> +{
> +       int high_capacity;
> +
> +       mmc_init_progress();
> +
> +       mmc_update_progress(MMC_PROGRESS_ENTER);
> +       sdhi_boot_enter();
> +
> +       /* setup SDHI hardware */
> +       mmc_update_progress(MMC_PROGRESS_INIT);
> +       high_capacity = sdhi_boot_init(SDHI_BASE);
> +       if (high_capacity < 0)
> +               goto err;
> +
> +       mmc_update_progress(MMC_PROGRESS_LOAD);
> +       /* load kernel */
> +       if (sdhi_boot_do_read(SDHI_BASE, high_capacity,
> +                             0, /* Kernel is at block 1 */
> +                             (len + TMIO_BBS - 1) / TMIO_BBS, buf))
> +               goto err;
> +
> +       sdhi_boot_cleanup();
> +
> +       mmc_update_progress(MMC_PROGRESS_DONE);
> +
> +       return;
> +err:
> +       __raw_writel(__raw_readl(PORTR031_000DR) | 1, PORTR031_000DR);
> +       for(;;);
> +
> +}

Sorry for not catching this earlier, but this __raw_writel() to
PORTR031_000DR is cpu specific as well. So please move that to the CPU
specific code.

Not sure if it makes sense at this point, but perhaps it's a good idea
to move the mmc_loader() function into the CPU specific portion. As
you know, the CPU itself has multiple SDHI hardware blocks, and
because of that we want the common SDHI loader to be written to
support any SDHI hardware block instance.

Right now the SDHI_BASE variable is limiting the shared SDHI loader
code to a fixed hardware block instance. That's fine because we only
boot from a single SDHI hardware block instance on sh7372, but future
processors most likely support selecting boot SDHI hardware block
instance.

Apart from those minor bits I think the code is getting into a really
good shape!

Thanks,

/ magnus

WARNING: multiple messages have this Message-ID (diff)
From: magnus.damm@gmail.com (Magnus Damm)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/4 v4] mmc, ARM: Add zboot from eSD support for SuperH Mobile ARM
Date: Wed, 16 Mar 2011 09:37:50 +0900	[thread overview]
Message-ID: <AANLkTimgwpP-WTGF-E=KO3TAXDX7FP4WnW3XQiHi0Ton@mail.gmail.com> (raw)
In-Reply-To: <20110315222738.GA23288@verge.net.au>

Hi Simon,

Thanks for your work on this!

On Wed, Mar 16, 2011 at 7:27 AM, Simon Horman <horms@verge.net.au> wrote:
> This allows a ROM-able zImage to be written to eSD and for SuperH Mobile
> ARM to boot directly from the SDHI hardware block.
>
> This is achieved by the MaskROM loading the first portion of the image into
> MERAM and then jumping to it. ?This portion contains loader code which
> copies the entire image to SDRAM and jumps to it. From there the zImage
> boot code proceeds as normal, uncompressing the image into its final
> location and then jumping to it.
>
> Cc: Paul Mundt <lethal@linux-sh.org>
> Cc: Magnus Damm <magnus.damm@gmail.com>
> Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> Signed-off-by: Simon Horman <horms@verge.net.au>
>
> ---
>
> This patch is based on the for-next branch of
> Russell King's linux-2.6-arm tree
>
> v2
> * Consistently use __raw_readw(). As pointed out by Paul Mundt
>
> v3
> * Remove mmcif_update_progress2(), it was for debugging during development
> * Move CPU specific code into mach/sdhi.h
> ?As requested by Magnus Damm
> * Use linux/mmc/tmio.h now that it exists
> * Remove SDHI_EXT_SWAP, it is unused
> * Replace use of MMCIF_PROGRESS_* with MMC_PROGRESS_*
> * Don't include linux/mmc/sh_mmcif.h
> ?+ Replace use of MMCIF_CE_RESP_CMD12 with RESP_CMD12
> ?+ Include linux/io.h
>
> v4
> * Move definition of SDHI_BASE into CPU-specific code.
> ?Thanks to Magnus Damm.
> ---

> +asmlinkage void mmc_loader(unsigned short *buf, unsigned long len)
> +{
> + ? ? ? int high_capacity;
> +
> + ? ? ? mmc_init_progress();
> +
> + ? ? ? mmc_update_progress(MMC_PROGRESS_ENTER);
> + ? ? ? sdhi_boot_enter();
> +
> + ? ? ? /* setup SDHI hardware */
> + ? ? ? mmc_update_progress(MMC_PROGRESS_INIT);
> + ? ? ? high_capacity = sdhi_boot_init(SDHI_BASE);
> + ? ? ? if (high_capacity < 0)
> + ? ? ? ? ? ? ? goto err;
> +
> + ? ? ? mmc_update_progress(MMC_PROGRESS_LOAD);
> + ? ? ? /* load kernel */
> + ? ? ? if (sdhi_boot_do_read(SDHI_BASE, high_capacity,
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0, /* Kernel is at block 1 */
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? (len + TMIO_BBS - 1) / TMIO_BBS, buf))
> + ? ? ? ? ? ? ? goto err;
> +
> + ? ? ? sdhi_boot_cleanup();
> +
> + ? ? ? mmc_update_progress(MMC_PROGRESS_DONE);
> +
> + ? ? ? return;
> +err:
> + ? ? ? __raw_writel(__raw_readl(PORTR031_000DR) | 1, PORTR031_000DR);
> + ? ? ? for(;;);
> +
> +}

Sorry for not catching this earlier, but this __raw_writel() to
PORTR031_000DR is cpu specific as well. So please move that to the CPU
specific code.

Not sure if it makes sense at this point, but perhaps it's a good idea
to move the mmc_loader() function into the CPU specific portion. As
you know, the CPU itself has multiple SDHI hardware blocks, and
because of that we want the common SDHI loader to be written to
support any SDHI hardware block instance.

Right now the SDHI_BASE variable is limiting the shared SDHI loader
code to a fixed hardware block instance. That's fine because we only
boot from a single SDHI hardware block instance on sh7372, but future
processors most likely support selecting boot SDHI hardware block
instance.

Apart from those minor bits I think the code is getting into a really
good shape!

Thanks,

/ magnus

  reply	other threads:[~2011-03-16  0:37 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-14  2:57 [PATCH 0/4] [rfc v3] mmc, ARM: Add zboot from eSD support for SuperH Mobile ARM Simon Horman
2011-03-14  2:57 ` Simon Horman
2011-03-14  2:57 ` Simon Horman
2011-03-14  2:57 ` [PATCH 1/4] mmc: tmio_mmc: Move some defines into a shared header Simon Horman
2011-03-14  2:57   ` Simon Horman
2011-03-14  2:57   ` Simon Horman
2011-03-24  8:54   ` Guennadi Liakhovetski
2011-03-24  8:54     ` [PATCH 1/4] mmc: tmio_mmc: Move some defines into a shared header (fwd) Guennadi Liakhovetski
2011-03-24  8:54     ` Guennadi Liakhovetski
2011-03-24  9:03     ` [PATCH 1/4] mmc: tmio_mmc: Move some defines into a shared Simon Horman
2011-03-24  9:03       ` [PATCH 1/4] mmc: tmio_mmc: Move some defines into a shared header (fwd) Simon Horman
2011-03-24  9:03       ` Simon Horman
2011-03-14  2:57 ` [PATCH 2/4] mmc, ARM: Rename SuperH Mobile ARM zboot helpers Simon Horman
2011-03-14  2:57   ` Simon Horman
2011-03-14  2:57   ` Simon Horman
2011-03-14  2:57 ` [PATCH 3/4] mmc: Add MMC_PROGRESS_* Simon Horman
2011-03-14  2:57   ` Simon Horman
2011-03-14  2:57   ` Simon Horman
2011-03-14  2:57 ` [PATCH 4/4] mmc, ARM: Add zboot from eSD support for SuperH Mobile ARM Simon Horman
2011-03-14  2:57   ` Simon Horman
2011-03-14  2:57   ` Simon Horman
2011-03-15 22:27   ` [PATCH 4/4 v4] mmc, ARM: Add zboot from eSD support for SuperH Simon Horman
2011-03-15 22:27     ` [PATCH 4/4 v4] mmc, ARM: Add zboot from eSD support for SuperH Mobile ARM Simon Horman
2011-03-15 22:27     ` Simon Horman
2011-03-16  0:37     ` Magnus Damm [this message]
2011-03-16  0:37       ` Magnus Damm
2011-03-16  0:37       ` Magnus Damm
2011-03-16  1:14       ` [PATCH 4/4 v4] mmc, ARM: Add zboot from eSD support for SuperH Simon Horman
2011-03-16  1:14         ` [PATCH 4/4 v4] mmc, ARM: Add zboot from eSD support for SuperH Mobile ARM Simon Horman
2011-03-16  1:14         ` Simon Horman
2011-03-16  2:20         ` [PATCH 4/4 v4] mmc, ARM: Add zboot from eSD support for SuperH Magnus Damm
2011-03-16  2:20           ` [PATCH 4/4 v4] mmc, ARM: Add zboot from eSD support for SuperH Mobile ARM Magnus Damm
2011-03-16  2:20           ` Magnus Damm
2011-03-16  5:16           ` [PATCH 4/4 v4] mmc, ARM: Add zboot from eSD support for SuperH Simon Horman
2011-03-16  5:16             ` [PATCH 4/4 v4] mmc, ARM: Add zboot from eSD support for SuperH Mobile ARM Simon Horman
2011-03-16  5:16             ` Simon Horman
2011-03-16  5:26             ` [PATCH 4/4 v4] mmc, ARM: Add zboot from eSD support for SuperH Magnus Damm
2011-03-16  5:26               ` [PATCH 4/4 v4] mmc, ARM: Add zboot from eSD support for SuperH Mobile ARM Magnus Damm
2011-03-16  5:26               ` Magnus Damm
2011-03-16  5:35               ` [PATCH 4/4 v4] mmc, ARM: Add zboot from eSD support for SuperH Simon Horman
2011-03-16  5:35                 ` [PATCH 4/4 v4] mmc, ARM: Add zboot from eSD support for SuperH Mobile ARM Simon Horman
2011-03-16  5:35                 ` Simon Horman
2011-03-16  7:03                 ` [PATCH 4/4 v5] mmc, ARM: Add zboot from eSD support for SuperH Simon Horman
2011-03-16  7:03                   ` [PATCH 4/4 v5] mmc, ARM: Add zboot from eSD support for SuperH Mobile ARM Simon Horman
2011-03-16  7:03                   ` Simon Horman
2011-03-24  6:57                   ` [PATCH 4/4 v6] mmc, ARM: Add zboot from eSD support for SuperH Simon Horman
2011-03-24  6:57                     ` [PATCH 4/4 v6] mmc, ARM: Add zboot from eSD support for SuperH Mobile ARM Simon Horman
2011-03-24  6:57                     ` Simon Horman

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='AANLkTimgwpP-WTGF-E=KO3TAXDX7FP4WnW3XQiHi0Ton@mail.gmail.com' \
    --to=magnus.damm@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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.