public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Dirk Behme <dirk.behme@googlemail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 11/13 v5] ARM: OMAP3: Add EVM board
Date: Mon, 10 Nov 2008 20:28:14 +0100	[thread overview]
Message-ID: <49188B4E.1010809@googlemail.com> (raw)
In-Reply-To: <4917eef4.02a1660a.35ee.72f8SMTPIN_ADDED@mx.google.com>

Dear Wolfgang,

Wolfgang Denk wrote:
> Dear Jean-Christophe PLAGNIOL-VILLARD,
> 
> In message <20081109150321.GF25307@game.jcrosoft.org> you wrote:
> 
>>>+	i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
>>>+#endif
>>>+
>>>+#if defined(CONFIG_CMD_NET)
>>>+	setup_net_chip();
>>>+#endif
>>>+
>>>+	return 0;
>>>+}
>>>+
>>>+/******************************************************************************
>>>+ * Routine: set_muxconf_regs
>>>+ * Description: Setting up the configuration Mux registers specific to the
>>>+ *              hardware. Many pins need to be moved from protect to primary
>>>+ *              mode.
>>>+ *****************************************************************************/
>>>+void set_muxconf_regs(void)
>>>+{
>>>+	MUX_EVM();
>>>+}
>>>+
>>>+/******************************************************************************
>>>+ * Routine: setup_net_chip
>>>+ * Description: Setting up the configuration GPMC registers specific to the
>>>+ *              Ethernet hardware. Pin Muxing for the SMC9118 is initialized
>>>+ *              here.
>>>+ *****************************************************************************/
>>>+static int setup_net_chip(void)
>>>+{
>>
>>in this function please add some blank line to make the code more readable
>>
>>>+	int i = 0;
>>>+
>>>+	/* Configure GPMC registers */
>>>+	(*(volatile int *)(OMAP34XX_GPMC_BASE + 0x0150)) = 0x00001000;
>>>+	(*(volatile int *)(OMAP34XX_GPMC_BASE + 0x0154)) = 0x001e1e01;
>>>+	(*(volatile int *)(OMAP34XX_GPMC_BASE + 0x0158)) = 0x00080300;
>>>+	(*(volatile int *)(OMAP34XX_GPMC_BASE + 0x015C)) = 0x1c091c09;
>>>+	(*(volatile int *)(OMAP34XX_GPMC_BASE + 0x0160)) = 0x04181f1f;
>>>+	(*(volatile int *)(OMAP34XX_GPMC_BASE + 0x0164)) = 0x00000FCF;
>>>+	(*(volatile int *)(OMAP34XX_GPMC_BASE + 0x0168)) = 0x00000f6c;
>>>+
>>>+	/* Configure PIN MUX registers */
>>>+	/* Enable GPMC Pin Mux Registers */
>>>+	/* Enable GPMC_CLK Pin in CONTROL_PADCONF_gpmc_ncs7 register */
>>>+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xBC)) |= 0x00180000;
>>>+	/* Enable CS5 Pin in CONTROL_PADCONF_gpmc_ncs5 register */
>>>+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xB8)) |= 0x00000018;
>>>+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xB8)) &= 0xFFFFFFF8;
>>>+	/* Enable offmode for nwe in CONTROL_PADCONF_GPMC_NWE register */
>>>+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xC4)) |= 0x00000F00;
>>>+	/* En off mode for noe and ale in CONTROL_PADCONF_GPMC_NADV_ALE reg */
>>>+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xC0)) |= 0x0E000E00;
>>>+	/* Enable gpmc_nbe0_cle in CONTROL_PADCONF_GPMC_NWE register */
>>>+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xC4)) |= 0x00180000;
>>>+
>>>+	/* Enable gpmc_nbe1 in CONTROL_PADCONF_GPMC_NBE1 register and
>>>+	configuring the mux mode to 0 */
>>>+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xC8)) |= 0x00000018;
>>>+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xC8)) &= 0xFFFFFFF8;
>>>+	/* Enable d15 in CONTROL_PADCONF_GPMC_D15 register */
>>>+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xAC)) |= 0x00000018;
>>>+	/* Enable d14 - d13 in CONTROL_PADCONF_GPMC_D13 register */
>>>+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xA8)) |= 0x00180018;
>>>+	/* Enable d12 - d11 in CONTROL_PADCONF_GPMC_D11 register */
>>>+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xA4)) |= 0x00180018;
>>>+	/* Enable d10 - d9 in CONTROL_PADCONF_GPMC_D9 register */
>>>+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0xA0)) |= 0x00180018;
>>>+	/* Enable d8 - d7 in CONTROL_PADCONF_GPMC_D7 register */
>>>+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0x9C)) |= 0x00180018;
>>>+	/* Enable d6 - d5 in CONTROL_PADCONF_GPMC_D5 register */
>>>+	(*(volatile int *)(OMAP34XX_CTRL_BASE + 0x98)) |= 0x00180018;
> 
> 
> And please use accessor functions / macros to access the registers.
> Access through volatile pointers is considered a Bad Thing (TM).

Sorry for not mentioning this earlier, but you don't have to comment on

a) readx/writex accessor functions / macros
b) hardcoded values vs. speaking macros

These are known issues of OMAP3 patch set I will fix step by step. 
Once we send the "final" OMAP3 patch set to the mailing list, if I 
missed something, then you are welcome to comment on it, though ;)

Thanks for your review and best regards

Dirk

  parent reply	other threads:[~2008-11-10 19:28 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-02 18:37 [U-Boot] [PATCH 07/13 v5] ARM: OMAP3: Add NAND support dirk.behme at googlemail.com
2008-11-02 18:38 ` [U-Boot] [PATCH 08/13 v5] ARM: OMAP3: Add MMC support dirk.behme at googlemail.com
2008-11-02 18:38   ` [U-Boot] [PATCH 09/13 v5] ARM: OMAP3: Add I2C support dirk.behme at googlemail.com
2008-11-02 18:38     ` [U-Boot] [PATCH 10/13 v5] ARM: OMAP3: Add BeagleBoard dirk.behme at googlemail.com
2008-11-02 18:39       ` [U-Boot] [PATCH 11/13 v5] ARM: OMAP3: Add EVM board dirk.behme at googlemail.com
2008-11-02 18:39         ` [U-Boot] [PATCH 12/13 v5] ARM: OMAP3: Add Overo board dirk.behme at googlemail.com
2008-11-02 18:40           ` [U-Boot] [PATCH 13/13 v5] ARM: OMAP3: Add Beagle, EVM and Overo configuration and README dirk.behme at googlemail.com
2008-11-09 16:01             ` Jean-Christophe PLAGNIOL-VILLARD
2008-11-09 15:05           ` [U-Boot] [PATCH 12/13 v5] ARM: OMAP3: Add Overo board Jean-Christophe PLAGNIOL-VILLARD
2008-11-09 19:44             ` Wolfgang Denk
2008-11-09 15:03         ` [U-Boot] [PATCH 11/13 v5] ARM: OMAP3: Add EVM board Jean-Christophe PLAGNIOL-VILLARD
2008-11-09 19:43           ` Wolfgang Denk
     [not found]           ` <4917eef4.02a1660a.35ee.72f8SMTPIN_ADDED@mx.google.com>
2008-11-10 19:28             ` Dirk Behme [this message]
2008-11-09 14:57       ` [U-Boot] [PATCH 10/13 v5] ARM: OMAP3: Add BeagleBoard Jean-Christophe PLAGNIOL-VILLARD
2008-11-03  0:18     ` [U-Boot] [PATCH 09/13 v5] ARM: OMAP3: Add I2C support Jean-Christophe PLAGNIOL-VILLARD
2008-11-03 20:27       ` Dirk Behme
2008-11-03 22:55         ` Wolfgang Denk
2008-11-02 23:25   ` [U-Boot] [PATCH 08/13 v5] ARM: OMAP3: Add MMC support Kyungmin Park
2008-11-09 14:33   ` Jean-Christophe PLAGNIOL-VILLARD

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=49188B4E.1010809@googlemail.com \
    --to=dirk.behme@googlemail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox