How to pass ethernet address to linux kernel ethernet driver: Difference between revisions

From RidgeRun Developer Wiki
(Created page with '= TI Davinci Ethernet driver = == Passing fixed Ethernet MAC address == Run cd $DEVDIR make config and set the Kernel Configuration -> Extra kernel arguments to davinci_e...')
 
No edit summary
Line 14: Line 14:
== Using u-boot ethaddr value for fixed Ethernet MAC address ==
== Using u-boot ethaddr value for fixed Ethernet MAC address ==


Run
Modify installer (in installer/u-boot-installer/methods/attached_board), around like 973 to add the ethernet address to the kernel command line.


  cd $DEVDIR
  $BOOTCMD = "setenv bootargs ${bootargs} davinci_emac.ethaddr=${ethaddr} ; nboot $CONFIG_INSTALLER_LOAD_ADDRS 0 \\\${kerneloffset}";
make config
 
and set the Kernel Configuration -> Extra kernel arguments to
 
davinci_emac.ethaddr="$$\{ethaddr}"
 
=== Notes ===
 
There are two levels of substitutions, first the one used by the build system, basically line 172 from $DEVDIR/fs/Makefile:
 
    $(V) echo -n " $(CONFIG_BSP_EXTRA_BOOT_ARGS) ">>$(CMDLINEFILE)
 
The value in bspconfig will be stored as follows:
 
    $ cat bsp/mach/bspconfig | grep EXTRA_BOOT
    CONFIG_BSP_EXTRA_BOOT_ARGS="davinci_emac.ethaddr=\"$$\\{ethaddr}\""
 
Running 'make cmdline' at the root of the $DEVDIR, creates the $DEVDIR/imaes/cmdline file
 
    $ cat images/cmdline
    vpfe_capture.cont_bufsize=0 console=ttyS0,115200n8  dm365_imp.oper_mode=0  vpfe_capture.interface=1  mem=68M rootfstype=jffs2 root=/dev/mtdblock2  davinci_emac.ethaddr="$\{ethaddr}"
 
There is a backslash there, but it will be understood as desired by the installer and have the correct effect of passing the mac address from u-boot to the kernel.


[[Category:Whitepaper]]
[[Category:Whitepaper]]

Revision as of 18:55, 17 September 2012

TI Davinci Ethernet driver

Passing fixed Ethernet MAC address

Run

cd $DEVDIR
make config

and set the Kernel Configuration -> Extra kernel arguments to

davinci_emac.ethaddr=40:61:86:e9:82:12

Using u-boot ethaddr value for fixed Ethernet MAC address

Modify installer (in installer/u-boot-installer/methods/attached_board), around like 973 to add the ethernet address to the kernel command line.

$BOOTCMD = "setenv bootargs ${bootargs} davinci_emac.ethaddr=${ethaddr} ; nboot $CONFIG_INSTALLER_LOAD_ADDRS 0 \\\${kerneloffset}";