public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Mark Jackson <mpfj-list@newflow.co.uk>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 7/7] am335x_evm: Add support to boot from NOR.
Date: Mon, 17 Jun 2013 16:23:33 +0100	[thread overview]
Message-ID: <51BF29F5.90905@newflow.co.uk> (raw)
In-Reply-To: <51BF244E.9020603@newflow.co.uk>

On 17/06/13 15:59, Mark Jackson wrote:
> On 17/06/13 15:49, Tom Rini wrote:
> 
> <snip>
> 
>> Did you copy the parts that setup the pinmuxing in s_init for NOR?
> 
> This bit ?
> 
> #ifdef CONFIG_NOR_BOOT
> 	asm("stmfd      sp!, {r2 - r4}");
> 	asm("movw       r4, #0x8A4");
> 	asm("movw       r3, #0x44E1");
> 	asm("orr        r4, r4, r3, lsl #16");
> 	asm("mov        r2, #9");
> 	asm("mov        r3, #8");
> 	asm("gpmc_mux:  str     r2, [r4], #4");
> 	asm("subs       r3, r3, #1");
> 	asm("bne        gpmc_mux");
> 	asm("ldmfd      sp!, {r2 - r4}");
> #endif
> 
> Yes ... :-)
> 

Below is my entire s_init() routine.

One question ... the SPL code has:-

	...
	gd = &gdata;
	...

But there seems to be no similar assignment when in NOR boot mode.
I'm no expert in the internal workings of u-boot, so I thought I'd
check, just in case !?!

Cheers
Mark J.
---
void s_init(void)
{
	/*
	 * The ROM will only have set up sufficient pinmux to allow for the
	 * first 4KiB NOR to be read, we must finish doing what we know of
	 * the NOR mux in this space in order to continue.
	 */
#ifdef CONFIG_NOR_BOOT
	asm("stmfd      sp!, {r2 - r4}");
	asm("movw       r4, #0x8A4");
	asm("movw       r3, #0x44E1");
	asm("orr        r4, r4, r3, lsl #16");
	asm("mov        r2, #9");
	asm("mov        r3, #8");
	asm("gpmc_mux:  str     r2, [r4], #4");
	asm("subs       r3, r3, #1");
	asm("bne        gpmc_mux");
	asm("ldmfd      sp!, {r2 - r4}");
#endif

	/*
	 * Save the boot parameters passed from romcode.
	 * We cannot delay the saving further than this,
	 * to prevent overwrites.
	 */
#if defined(CONFIG_SPL_BUILD) || defined(CONFIG_NOR_BOOT)
	save_omap_boot_params();
#endif

	/* WDT1 is already running when the bootloader gets control
	 * Disable it to avoid "random" resets
	 */
	writel(0xAAAA, &wdtimer->wdtwspr);
	while (readl(&wdtimer->wdtwwps) != 0x0)
		;
	writel(0x5555, &wdtimer->wdtwspr);
	while (readl(&wdtimer->wdtwwps) != 0x0)
		;

#if defined(CONFIG_SPL_BUILD) || defined(CONFIG_NOR_BOOT)
	/* Setup the PLLs and the clocks for the peripherals */
	pll_init();

	/* Enable RTC32K clock */
	rtc32k_enable();

	enable_board_pin_mux();

	/* UART softreset */
	u32 regVal;
	regVal = readl(&uart_base->uartsyscfg);
	regVal |= UART_RESET;
	writel(regVal, &uart_base->uartsyscfg);
	while ((readl(&uart_base->uartsyssts) &
		UART_CLK_RUNNING_MASK) != UART_CLK_RUNNING_MASK)
		;

	/* Disable smart idle */
	regVal = readl(&uart_base->uartsyscfg);
	regVal |= UART_SMART_IDLE_EN;
	writel(regVal, &uart_base->uartsyscfg);

#if defined(CONFIG_NOR_BOOT)
	/* We want our console now. */
	gd->baudrate = CONFIG_BAUDRATE;
	serial_init();
	gd->have_console = 1;
	puts("\nU-Boot NOR Boot\n");
#else
	gd = &gdata;

	preloader_console_init();
#endif

	config_ddr(303, MT41J128MJT125_IOCTRL_VALUE, &ddr3_data,
		   &ddr3_cmd_ctrl_data, &ddr3_emif_reg_data, 0);

	i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
#endif /* CONFIG_SPL_BUILD */
}

  parent reply	other threads:[~2013-06-17 15:23 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-13 18:28 [U-Boot] [PATCH v2 1/7] am33xx/omap3: Clean up gpmc_init slightly Tom Rini
2013-05-13 18:28 ` [U-Boot] [PATCH v2 2/7] am335x_evm: Drop useless CONFIG_ENV_IS_NOWHERE Tom Rini
2013-05-13 18:28 ` [U-Boot] [PATCH v2 3/7] am335x_evm: Update SPI_BOOT support, add MTDPARTS info Tom Rini
2013-05-15 20:41   ` Peter Korsgaard
2013-05-13 18:28 ` [U-Boot] [PATCH v2 4/7] am335x_evm: Only set CONFIG_NAND when !CONFIG_SPI_BOOT Tom Rini
2013-05-15 20:42   ` Peter Korsgaard
2013-05-13 18:28 ` [U-Boot] [PATCH v2 5/7] am335x_evm: Rework board_is_foo() checks Tom Rini
2013-05-15 20:43   ` Peter Korsgaard
2013-05-13 18:28 ` [U-Boot] [PATCH v2 6/7] am335x_evm: Add support for the NOR module on the memory cape Tom Rini
2013-05-16 14:32   ` Peter Korsgaard
2013-05-16 14:46     ` Tom Rini
2013-05-16 18:54       ` Peter Korsgaard
2013-05-16 19:27         ` Tom Rini
2013-05-16 19:32           ` Peter Korsgaard
2013-05-13 18:28 ` [U-Boot] [PATCH v2 7/7] am335x_evm: Add support to boot from NOR Tom Rini
2013-05-16 14:36   ` Peter Korsgaard
2013-05-16 14:49     ` Tom Rini
2013-05-16 18:55       ` Peter Korsgaard
2013-05-16 19:30         ` Tom Rini
2013-05-16 19:32           ` Peter Korsgaard
2013-06-17 14:43   ` Mark Jackson
2013-06-17 14:49     ` Tom Rini
2013-06-17 14:59       ` Mark Jackson
2013-06-17 15:01         ` Tom Rini
2013-06-17 15:23           ` Mark Jackson
2013-06-17 15:23         ` Mark Jackson [this message]
2013-06-17 15:29           ` Tom Rini
2013-06-17 16:01           ` Stefan Roese
2013-06-17 16:10             ` Mark Jackson
2013-06-17 17:04               ` Kipisz, Steven
2013-06-17 18:38                 ` Mark Jackson
2013-06-18 12:11     ` Mark Jackson
2013-07-11 13:06       ` Mark Jackson
2013-07-11 13:28         ` Tom Rini
2013-07-11 13:45           ` Mark Jackson
2013-07-11 14:34             ` Albert ARIBAUD
2013-07-11 15:54               ` Tom Rini
2013-07-11 16:08                 ` Albert ARIBAUD
2013-07-11 16:14                   ` Albert ARIBAUD
2013-07-11 16:17                     ` Tom Rini
2013-07-17 12:58         ` Mark Jackson
2013-07-17 13:32           ` Tom Rini
2013-05-15 20:39 ` [U-Boot] [PATCH v2 1/7] am33xx/omap3: Clean up gpmc_init slightly Peter Korsgaard

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=51BF29F5.90905@newflow.co.uk \
    --to=mpfj-list@newflow.co.uk \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox