/* * Copyright (C) 2010 Tobias Klauser * Copyright (C) 2010 chysun2000@gmail.com * * This file is part of nios2sim-ng. * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. */ #include #include "nios2sim-ng.h" #include "device.h" #include "uart.h" #include "jtag_uart.h" static struct device *devices[] = { &uart_core, &jtag_uart_core, }; #define DEVICES_COUNT ARRAY_SIZE(devices) int device_init_all(void) { unsigned int i; int ret = 0; for (i = 0; i < DEVICES_COUNT; i++) { struct device *dev = devices[i]; if (dev->init == NULL) continue; ret = dev->init(dev); if (ret) { err("Failed to initialize device '%s'\n", dev->name); break; } vinfo("%s at 0x%08x\n", dev->name, dev->base); } return ret; }