1*7ac2fe2dSIlya Yanok /* 2*7ac2fe2dSIlya Yanok * (C) Copyright 2000-2004 3*7ac2fe2dSIlya Yanok * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4*7ac2fe2dSIlya Yanok * 5*7ac2fe2dSIlya Yanok * (C) Copyright 2012 6*7ac2fe2dSIlya Yanok * Ilya Yanok <ilya.yanok@gmail.com> 7*7ac2fe2dSIlya Yanok * 8*7ac2fe2dSIlya Yanok * See file CREDITS for list of people who contributed to this 9*7ac2fe2dSIlya Yanok * project. 10*7ac2fe2dSIlya Yanok * 11*7ac2fe2dSIlya Yanok * This program is free software; you can redistribute it and/or 12*7ac2fe2dSIlya Yanok * modify it under the terms of the GNU General Public License as 13*7ac2fe2dSIlya Yanok * published by the Free Software Foundation; either version 2 of 14*7ac2fe2dSIlya Yanok * the License, or (at your option) any later version. 15*7ac2fe2dSIlya Yanok * 16*7ac2fe2dSIlya Yanok * This program is distributed in the hope that it will be useful, 17*7ac2fe2dSIlya Yanok * but WITHOUT ANY WARRANTY; without even the implied warranty of 18*7ac2fe2dSIlya Yanok * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19*7ac2fe2dSIlya Yanok * GNU General Public License for more details. 20*7ac2fe2dSIlya Yanok * 21*7ac2fe2dSIlya Yanok * You should have received a copy of the GNU General Public License 22*7ac2fe2dSIlya Yanok * along with this program; if not, write to the Free Software 23*7ac2fe2dSIlya Yanok * Foundation, Inc. 24*7ac2fe2dSIlya Yanok */ 25*7ac2fe2dSIlya Yanok #include <common.h> 26*7ac2fe2dSIlya Yanok #include <spl.h> 27*7ac2fe2dSIlya Yanok #include <net.h> 28*7ac2fe2dSIlya Yanok 29*7ac2fe2dSIlya Yanok DECLARE_GLOBAL_DATA_PTR; 30*7ac2fe2dSIlya Yanok 31*7ac2fe2dSIlya Yanok void spl_net_load_image(const char *device) 32*7ac2fe2dSIlya Yanok { 33*7ac2fe2dSIlya Yanok int rv; 34*7ac2fe2dSIlya Yanok 35*7ac2fe2dSIlya Yanok env_init(); 36*7ac2fe2dSIlya Yanok env_relocate(); 37*7ac2fe2dSIlya Yanok setenv("autoload", "yes"); 38*7ac2fe2dSIlya Yanok load_addr = CONFIG_SYS_TEXT_BASE - sizeof(struct image_header); 39*7ac2fe2dSIlya Yanok rv = eth_initialize(gd->bd); 40*7ac2fe2dSIlya Yanok if (rv == 0) { 41*7ac2fe2dSIlya Yanok printf("No Ethernet devices found\n"); 42*7ac2fe2dSIlya Yanok hang(); 43*7ac2fe2dSIlya Yanok } 44*7ac2fe2dSIlya Yanok if (device) 45*7ac2fe2dSIlya Yanok setenv("ethact", device); 46*7ac2fe2dSIlya Yanok rv = NetLoop(BOOTP); 47*7ac2fe2dSIlya Yanok if (rv < 0) { 48*7ac2fe2dSIlya Yanok printf("Problem booting with BOOTP\n"); 49*7ac2fe2dSIlya Yanok hang(); 50*7ac2fe2dSIlya Yanok } 51*7ac2fe2dSIlya Yanok spl_parse_image_header((struct image_header *)load_addr); 52*7ac2fe2dSIlya Yanok } 53