mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: christian.buettner@rafi.de
To: barebox@lists.infradead.org
Subject: boot init code depending on i2c eeprom value
Date: Fri, 3 Aug 2012 10:06:28 +0200	[thread overview]
Message-ID: <OF95E0712B.359A103D-ONC1257A4F.002B3A1C-C1257A4F.002C899A@o0802.rafi.inhouse> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1287 bytes --]

Hi all,

i need to set the pin-mux of the board init code depending on an ID coming 
from 
an i2C EEPROM of the board.
Is it possible to do something like this:


...

//Using the e.g. the postcore_initcall phase to init i2C
static int
ecuv6_postcore_init(void)
{
        //Set I2C EEPROM (24C32R) PIN MUX
        mxc_iomux_v3_setup_multiple_pads(i2c_eeprom_pads, 
ARRAY_SIZE(i2c_eeprom_pads));
        imx53_add_i2c2(NULL);
        return 0;
}
postcore_initcall(ecuv6_postcore_init);

//In the console_initcall phase, i2C should be probed to read ID
static int
ecuv6_console_init(void)
{
        imx53_init_lowlevel(0);
        ecuv6_set_system_serial();
 
        //get_bb_pcb_number reads data from 
        char bb_ID;
        bb_ID = get_i2c_ID();

        //Set Pinmux depending on i2C result
        if(bb_ID = 0xAB) {
                mxc_iomux_v3_setup_multiple_pads(AB_pads, ARRAY_SIZE(
AB_pads));
        }
        else if(bb_ID = 0xCD) {
                mxc_iomux_v3_setup_multiple_pads(CD_pads, ARRAY_SIZE(
CD_pads));
        }
 
        imx53_add_uart0();

        return 0;
}
console_initcall(ecuv6_console_init);

...


Actually this is not working. The i2c_imx:i2c_imx_probe(..) function gets 
called later.
Is there a way or concept to do something like this?

christian

[-- Attachment #1.2: Type: text/html, Size: 4500 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

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

             reply	other threads:[~2012-08-03  8:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-03  8:06 christian.buettner [this message]
2012-08-03 12:20 ` Marc Reilly
2012-08-03 13:21 ` Sascha Hauer
2012-08-07 13:54   ` Antwort: " christian.buettner

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=OF95E0712B.359A103D-ONC1257A4F.002B3A1C-C1257A4F.002C899A@o0802.rafi.inhouse \
    --to=christian.buettner@rafi.de \
    --cc=barebox@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox