1. 08 Sep, 2009 2 commits
    • Rajashekhara, Sudhakar's avatar
      TI DaVinci EMAC: delay DaVinci EMAC initialization · fdd723f7
      Rajashekhara, Sudhakar authored
      TI DaVinci EMAC: delay DaVinci EMAC initialization
      
      On TI's DA850/OMAP-L138 EVM, MAC address is stored in SPI
      flash which is accessed using MTD interface.
      
      This patch delays the initialization of DaVinci EMAC driver
      by changing module_init to late_initcall. This helps SPI and
      MTD drivers to get initialized before EMAC thereby enabling
      EMAC driver to read the MAC address while booting and use it.
      
      Tested with NFS on DM644x, DM6467, DA830/OMAP-L137 and
      DA850/OMAP-L138 EVMs.
      Signed-off-by: default avatarSudhakar Rajashekhara <sudhakar.raj@ti.com>
      Reviewed-by: default avatarChaithrika U S <chaithrika@ti.com>
      Signed-off-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fdd723f7
    • Sudhakar Rajashekhara's avatar
      Implement memory accessor interface in the MTD layer which enables the · b9255c04
      Sudhakar Rajashekhara authored
      Implement memory accessor interface in the MTD layer which enables the
      kernel to access flash data.
      
      This patch adds two new members to the mtd_partition structure, a function
      handler which will be called during setup of the partition and an argument
      to be passed to this setup function.
      
      Example:
      +static struct mtd_partition spi_flash_partitions[] = {
      +       [0] = {
      +               .name       = "U-Boot",
      +               .offset     = 0,
      +               .size       = SZ_256K,
      +               .mask_flags = MTD_WRITEABLE,
      +       },
      +       [1] = {
      +               .name       = "U-Boot Environment",
      +               .offset     = MTDPART_OFS_NXTBLK,
      +               .size       = SZ_64K,
      +               .mask_flags = MTD_WRITEABLE,
      +       },
      +       [2] = {
      +               .name       = "Linux",
      +               .offset     = MTDPART_OFS_NXTBLK,
      +               .size       = SZ_7M,
      +               .mask_flags = 0,
      +       },
      +       [3] = {
      +               .name       = "MAC Address",
      +               .offset     = MTDPART_OFS_NXTBLK,
      +               .size       = SZ_64K,
      +               .mask_flags = 0,
      +               .setup      = davinci_get_mac_addr,
      +               .context    = (void *)0,
      +       },
      +};
      
      The davinci_get_mac_addr function reads the MAC address from
      offset ZERO of last MTD partition.
      Signed-off-by: default avatarSudhakar Rajashekhara <sudhakar.raj@ti.com>
      Cc: David Brownell <david-b@pacbell.net>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      b9255c04
  2. 26 Aug, 2009 38 commits