Move custom GPIO init, after relocation.
This commit is contained in:
parent
1cc0c74c2e
commit
1f46311394
|
@ -233,6 +233,7 @@ int parse_config(char* env, int max_args, void *regs, int *reg_count,
|
||||||
tok1 = strsep(&tmp_str1, "/");
|
tok1 = strsep(&tmp_str1, "/");
|
||||||
}
|
}
|
||||||
*reg_count = item_count1;
|
*reg_count = item_count1;
|
||||||
|
free(tmp_item);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -245,7 +246,7 @@ void apply_config(struct reg_conf *regs, int reg_count)
|
||||||
ar7240_reg_wr(regs[i].addr, ((ar7240_reg_rd(regs[i].addr)|regs[i].set_mask)&(~regs[i].clear_mask)));
|
ar7240_reg_wr(regs[i].addr, ((ar7240_reg_rd(regs[i].addr)|regs[i].set_mask)&(~regs[i].clear_mask)));
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
printf("Reg: %x is not in valid GPIO range\n");
|
printf("Reg: %x is not in valid GPIO range\n", regs[i].addr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -381,6 +382,17 @@ void ar7240_gpio_leds_off(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Call after relocation
|
||||||
|
void custom_gpio_init(void)
|
||||||
|
{
|
||||||
|
//init GPIO, LED and button config
|
||||||
|
gpio_env_init(0); // custom GPIO init, turns on all LEDs
|
||||||
|
gpio_env_init(1); //LEDs
|
||||||
|
gpio_env_init(2); //BUTTONs
|
||||||
|
udelay(100 * 1000); // 100ms delay
|
||||||
|
ar7240_gpio_leds_off();
|
||||||
|
}
|
||||||
|
|
||||||
void show_activity(int arg)
|
void show_activity(int arg)
|
||||||
{
|
{
|
||||||
uint32_t time = 0;
|
uint32_t time = 0;
|
||||||
|
@ -433,16 +445,8 @@ ar7240_mem_config(void)
|
||||||
|
|
||||||
ar7240_usb_initial_config();
|
ar7240_usb_initial_config();
|
||||||
ar7240_usb_otp_config();
|
ar7240_usb_otp_config();
|
||||||
|
|
||||||
//hornet_ddr_tap_init();
|
//hornet_ddr_tap_init();
|
||||||
|
|
||||||
gpio_env_init(0); // custom GPIO init, turns on all LEDs
|
|
||||||
gpio_env_init(1); //LEDs
|
|
||||||
gpio_env_init(2); //BUTTONs
|
|
||||||
|
|
||||||
udelay(100 * 1000); // 100ms delay
|
|
||||||
ar7240_gpio_leds_off();
|
|
||||||
|
|
||||||
return (ar7240_ddr_find_size());
|
return (ar7240_ddr_find_size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -395,9 +395,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
|
||||||
env_relocate();
|
env_relocate();
|
||||||
|
|
||||||
#ifdef CONFIG_MACH_HORNET
|
#ifdef CONFIG_MACH_HORNET
|
||||||
//reinit LED and button config after relocation
|
custom_gpio_init();
|
||||||
gpio_env_init(1); //LEDs
|
|
||||||
gpio_env_init(2); //BUTTONs
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* board MAC address */
|
/* board MAC address */
|
||||||
|
|
Loading…
Reference in New Issue