Latest Post
[Android ICS] 04. Exynos 4210 S5PV310 Mango310 Mac Address 설정 방법

(S5PV310 Mango310) MAC Address 설정 Porting Guide


## U-boot
“common/main.c” 추가
{
   char boot_cmd[100];
   char *peth = getenv ("ethaddr");
   char *boorargs_char=getenv ("bootargs");
   sprintf(boot_cmd, "%s ethaddr=%s", boorargs_char, peth);
   setenv("bootargs", boot_cmd);
}



u-boot 다시 Write 했습니다.
[root@HP-note-jji image]# fastboot flash bl2 bl1ah
sending 'bl2' (16 KB)...
OKAY [  0.012s]
writing 'bl2'...
OKAY [  0.034s]
finished. total time: 0.047s
[root@HP-note-jji image]# fastboot flash bootloader u-boot.bin
sending 'bootloader' (327 KB)...
OKAY [  0.058s]
writing 'bootloader'...
OKAY [  0.692s]
finished. total time: 0.749s


Booting
uboot에서 아무키나 누르고, 아래와 같이 설정 합니다.


Mango310 # setenv ethaddr 04:32:F4:FE:AD:9A
Mango310 # setenv bootargs "console=ttySAC1,115200n8 androidboot.console=ttySAC1"
Mango310 # saveenv

리셋

Mango310 # print
baudrate=115200
bootargs=console=ttySAC1,115200n8 androidboot.console=ttySAC1 ethaddr=04:32:F4:FE:AD:9A
bootcmd=movi read kernel 0 40008000;movi read rootfs 0 41a00000 100000;bootm 40008000 41a00000
bootdelay=3
ethact=smc911x-0
ethaddr=04:32:F4:FE:AD:9A
gatewayip=192.168.0.1
ipaddr=192.168.0.20
netmask=255.255.255.0
serverip=192.168.0.10

확인  있다.

이제 커널을 수정 보자


“driver/net/smsc911x.c” 파일

static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
..
//CRZ begin
memcpy(dev->dev_addr, config->dev_addr, 6);    /* CRZ  crazyboy */
printk("CRZ User MAC address: %pM\n", config->dev_addr);
//CRZ end
/* Check if mac address has been specified when bringing interface up */
if (is_valid_ether_addr(dev->dev_addr)) {
smsc911x_set_hw_mac_address(pdata, dev->dev_addr);
SMSC_TRACE(pdata, probe,
  "MAC Address is specified by configuration");
} else if (is_valid_ether_addr(pdata->config.mac)) {
memcpy(dev->dev_addr, pdata->config.mac, 6);
SMSC_TRACE(pdata, probe,
  "MAC Address specified by platform data");
} else {




“include/linux/smsc911x.h”

/* platform_device configuration data, should be assigned to
* the platform_device's dev.platform_data */
struct smsc911x_platform_config {
unsigned int irq_polarity;
unsigned int irq_type;
unsigned int flags;
unsigned int shift;
phy_interface_t phy_interface;
unsigned char mac[6];//EEPROM
unsigned char dev_addr[6];  /*CRZ  by crazyboy */
};




“arch/arm/mach-exynos/mach-smdkv310.c” 파일

static struct smsc911x_platform_config smsc9215_config = {
.irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
.irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
.flags = SMSC911X_USE_16BIT | SMSC911X_FORCE_INTERNAL_PHY,
.phy_interface = PHY_INTERFACE_MODE_MII,
.mac = {0x00, 0x80, 0x00, 0x23, 0x45, 0x67},
};

static struct platform_device smdkv310_smsc911x = {
.name = "smsc911x",
.id = -1,
.num_resources = ARRAY_SIZE(smdkv310_smsc911x_resources),
.resource = smdkv310_smsc911x_resources,
.dev = {
.platform_data = &smsc9215_config,
},
};
//CRZ Begin
/* need to get the ether addr from armboot */
static int __init ethaddr_setup(char *line)
{
       char *ep;
       int i;

       /* there should really be routines to do this stuff */
// Changed by CRZ. icanjji. 2011.0420
       for (i = 0; i < 6; i++) {
               smsc9215_config.dev_addr[i] = line ? simple_strtoul(line, &ep, 16) : 0;
               if (line)
                       line = (*ep) ? ep+1 : ep;
       }
       printk("User MAC address: %pM\n", smsc9215_config.dev_addr);
       return 0;
}
__setup("ethaddr=", ethaddr_setup);
//CRZ end




컴파일 하여 확인 결과 이상없이 동작합니다.

shell@android:/ # netcfg
lo       UP                                   127.0.0.1/8   0x00000049 00:00:00:00:00:00
eth0     DOWN                                   0.0.0.0/0   0x00001002 04:32:f4:fe:ad:9a
sit0     DOWN                                   0.0.0.0/0   0x00000080 00:00:00:00:00:00
ip6tnl0  DOWN                                   0.0.0.0/0   0x00000080 00:00:00:00:00:00
mlan0    UP                               192.168.3.104/24  0x00001043 00:22:58:6b:8c:8a
uap0     DOWN                                   0.0.0.0/0   0x00001002 00:22:58:6b:8c:8a
wfd0     DOWN                                   0.0.0.0/0   0x00001002 00:22:58:6b:8c:8a
Comments 0
:    :    :
이름 / 2014-11-20 / ★★★☆☆ [수정 / 삭제]

내용

Recent Comments
일방통행  |  ★★★★★
ISE 14.7 virtualbox를 설치했는데, ,iMPACT가 인식을 못하는데, 어케해야하나요?
min  |  ★★★★☆
These are the only Drives available to write images to: # major minor size name 1: 8 0 512805384 sda 2: 8 16 15558144 sdb Enter Device Number or n to exit: 2 Invalid selection! 왜 이런 오류가 나는 걸까요?
dino  |  ★★☆☆☆
NAND Scrub실행 후 에러가 나타납니다/ 조치방법을 알려주세요 에러내용 crz nand_erase_opts erase.addr=0x0, opt->offset=0x0, erase_ieng minfo_erases=0x20000 .....진행후 s3c-nand:ecc uncorrectable error detected---4개발생합니다 빠른 회신부탁드립니다 연락처:010-3752-6251 강희진
bluewind  |  ★★★★★
안녕하세요..구입했는데..회로도 부탁드립니다. percephy@naver.com 입니다.
조형철  |  ★★★★★
상기 Backlight 관련 회로를 구할 수 있을까요?
hwang  |  ★★★★★
구입한지 조금 됬는데 회로도 부탁합니다. rubens7777@paran.com 입니다.