/* * Milkymist SoC (Software) * Copyright (C) 2007, 2008, 2009, 2011 Sebastien Bourdeauducq * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 3 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include #include #include #include static const struct board_desc boards[1] = { { .id = 0x4D31, /* M1 */ .name = "Milkymist One", .ethernet_phyadr = 1 }, }; const struct board_desc *get_board_desc_id(unsigned short int id) { unsigned int i; for(i=0;i> 28; *minor = (id & 0x0f000000) >> 24; *subminor = (id & 0x00f00000) >> 20; *rc = (id & 0x000f0000) >> 16; } void get_soc_version_formatted(char *version) { unsigned int major, minor, subminor, rc; get_soc_version(&major, &minor, &subminor, &rc); version += sprintf(version, "%u.%u", major, minor); if(subminor != 0) version += sprintf(version, ".%u", subminor); if(rc != 0) sprintf(version, "RC%u", rc); }