mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 2/3] Add DMO RealQ7 board support
Date: Fri, 8 Mar 2013 15:48:43 +0100	[thread overview]
Message-ID: <20130308144843.GF32347@game.jcrosoft.org> (raw)
In-Reply-To: <20130308130727.GD1906@pengutronix.de>

On 14:07 Fri 08 Mar     , Sascha Hauer wrote:
> On Fri, Mar 08, 2013 at 01:51:38PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > +
> > > +static void mmd_write_reg(struct phy_device *dev, int device, int reg, int val)
> > > +{
> > > +	phy_write(dev, 0x0d, device);
> > > +	phy_write(dev, 0x0e, reg);
> > > +	phy_write(dev, 0x0d, (1 << 14) | device);
> > > +	phy_write(dev, 0x0e, val);
> > > +}
> > > +
> > > +static void mx6_rgmii_rework(struct phy_device *dev)
> > > +{
> > > +	/*
> > > +	 * min rx data delay, max rx/tx clock delay,
> > > +	 * min rx/tx control delay
> > > +	 */
> > > +	mmd_write_reg(dev, 2, 4, 0);
> > > +	mmd_write_reg(dev, 2, 5, 0);
> > > +	mmd_write_reg(dev, 2, 8, 0x003ff);
> > > +}
> > > +
> > > +static struct fec_platform_data fec_info = {
> > > +	.xcv_type = RGMII,
> > > +	.phy_init = mx6_rgmii_rework,
> > > +	.phy_addr = -1,
> > use phy_fix_up as done on sama5d3xek
> > 
> > the phy_init need do be dropped now
> > > +};
> > > +
> > > +static void realq7_enet_init(void)
> > > +{
> > > +	mxc_iomux_v3_setup_multiple_pads(realq7_pads_gpio, ARRAY_SIZE(realq7_pads_gpio));
> > > +	gpio_direction_output(RQ7_GPIO_ENET_PHYADD2, 0);
> > > +	gpio_direction_output(RQ7_GPIO_ENET_MODE0, 1);
> > > +	gpio_direction_output(RQ7_GPIO_ENET_MODE1, 1);
> > > +	gpio_direction_output(RQ7_GPIO_ENET_MODE2, 1);
> > > +	gpio_direction_output(RQ7_GPIO_ENET_MODE3, 1);
> > > +	gpio_direction_output(RQ7_GPIO_ENET_EN_CLK125, 1);
> > > +
> > > +	gpio_direction_output(25, 0);
> > > +	mdelay(50);
> > > +
> > > +	gpio_direction_output(25, 1);
> > > +	mdelay(50);
> > > +
> > > +	mxc_iomux_v3_setup_multiple_pads(realq7_pads_enet, ARRAY_SIZE(realq7_pads_enet));
> > > +
> > > +	imx6_add_fec(&fec_info);
> > > +}
> > > +
> > > +static int realq7_mem_init(void)
> > > +{
> > > +	arm_add_mem_device("ram0", 0x10000000, SZ_2G);
> > > +
> > > +	return 0;
> > > +}
> > > +mem_initcall(realq7_mem_init);
> > > +
> > > +static int realq7_spi_cs[] = { IMX_GPIO_NR(1, 12), };
> > > +
> > > +static struct spi_imx_master realq7_spi_0_data = {
> > > +	.chipselect = realq7_spi_cs,
> > > +	.num_chipselect = ARRAY_SIZE(realq7_spi_cs),
> > > +};
> > > +
> > > +static const struct spi_board_info realq7_spi_board_info[] = {
> > > +	{
> > > +		.name = "m25p80",
> > > +		.max_speed_hz = 40000000,
> > > +		.bus_num = 4,
> > > +		.chip_select = 0,
> > > +	}
> > > +};
> > > +
> > > +static struct esdhc_platform_data realq7_emmc_data = {
> > > +	.cd_type = ESDHC_CD_PERMANENT,
> > > +	.caps = MMC_MODE_8BIT,
> > > +	.devname = "emmc",
> > > +};
> > we was discussion of symlink on devfs my idea was to use it here instead of
> > the devname
> 
> The sysfs symlink support alone does not fix this. Who should create the
> link?

yes I was thinking the mci core create the symlink

> 
> > > +
> > > +	armlinux_set_bootparams((void *)0x10000100);
> > > +	armlinux_set_architecture(3769);
> > why a magic instead of a macro?
> 
> Can be dropped. It's devicetree only, so we don't need an architecture
> id. I doubt there is one even registered.
> 
> Sascha
> 
> > > +++ b/arch/arm/boards/dmo-mx6-realq7/env/init/hostname
> > > @@ -0,0 +1,8 @@
> > > +#!/bin/sh
> > > +
> > > +if [ "$1" = menu ]; then
> > > +	init-menu-add-entry "$0" "hostname"
> > > +	exit
> > > +fi
> > > +
> > > +global.hostname=realq7
> > in config-board?
> 
> ok.
> 
> > > +
> > > +	.boot_data.start	= APP_DEST,
> > > +	.boot_data.size		= 192 * 1024,
> > barebox_image_size
> 
> ok. This btw will not work with CONFIG_RELOCATABLE as is since the
> linker cannot generate this value then.
why?

otherwise we need to update it via ld as done in the kernel as example
> 
> > > +	reg32_write(0x021e80a4, 0x0000047f);
> > > +	reg32_write(0x021e80a8, 0x0000c34f);
> > > +	reg32_write(0x021e8080, 0x00000001);
> > can we have not all of those magic?
> 
> No, I won't do the decoding now. This time can be invested better.
> 
> Sascha
> 
> -- 
> Pengutronix e.K.                           |                             |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2013-03-08 15:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-08 12:08 [PATCH] Add DataModul Realq7 " Sascha Hauer
2013-03-08 12:08 ` [PATCH 1/3] ARM i.MX6: Add mmdc calibration support Sascha Hauer
2013-03-08 12:17   ` Alexander Shiyan
2013-03-08 14:00     ` Sascha Hauer
2013-03-08 12:46   ` Jean-Christophe PLAGNIOL-VILLARD
2013-03-08 12:08 ` [PATCH 2/3] Add DMO RealQ7 board support Sascha Hauer
2013-03-08 12:51   ` Jean-Christophe PLAGNIOL-VILLARD
2013-03-08 13:07     ` Sascha Hauer
2013-03-08 14:48       ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2013-03-08 15:06         ` Sascha Hauer
2013-03-08 15:46           ` Jean-Christophe PLAGNIOL-VILLARD
2013-03-08 16:23             ` Jean-Christophe PLAGNIOL-VILLARD
2013-03-09 19:03             ` Sascha Hauer
2013-03-08 12:08 ` [PATCH 3/3] Add DMO RealQ7 defconfig Sascha Hauer

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=20130308144843.GF32347@game.jcrosoft.org \
    --to=plagnioj@jcrosoft.com \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.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