2 * Copyright 2007,2008 Free Software Foundation, Inc.
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #include "memory_map.h"
26 #include "buffer_pool.h"
31 #include "usrp2_eth_packet.h"
33 #include "app_common_v2.h"
34 #include "memcpy_wa.h"
39 #include <usrp2_i2c_addr.h>
44 #define HW_REV_MAJOR 4
45 #define HW_REV_MINOR 0
50 output_regs->ram_page = 1<<10;
52 extram[0] = 0xDEADBEEF;
53 extram[1] = 0xF00D1234;
54 extram[7] = 0x76543210;
56 output_regs->ram_page = 2<<10;
57 extram[7] = 0x55555555;
58 extram[1] = 0xaaaaaaaa;
59 extram[0] = 0xeeeeeeee;
61 output_regs->ram_page = 1<<10;
67 if((i != 0xDEADBEEF)||(j!=0x76543210)||(k!=0xF00D1234)) {
75 output_regs->ram_page = 2<<10;
81 if((i != 0xeeeeeeee)||(j!=0x55555555)||(k!=0xaaaaaaaa)) {
95 puts("FAILED INIT of Card\n");
99 unsigned char buf[512];
100 i = sd_read_block(2048,buf);
102 puts("READ Command Rejected\n");
105 if((buf[0]==0xb8)&&(buf[1]==0x08)&&(buf[2]==0x00)&&(buf[3]==0x50))
108 puts("Read bad data from SD Card\n");
119 putstr("\nFactory Test, Board Rev 4.0\n");
122 unsigned char maj = HW_REV_MAJOR;
123 unsigned char min = HW_REV_MINOR;
124 ok = eeprom_write(I2C_ADDR_MBOARD, MBOARD_REV_MSB, &maj, 1);
125 ok &= eeprom_write(I2C_ADDR_MBOARD, MBOARD_REV_LSB, &min, 1);
127 putstr("\nset_hw_rev\n");
129 printf("OK: set h/w rev to %d.%d\n", HW_REV_MAJOR, HW_REV_MINOR);
131 printf("FAILED to set h/w rev to %d.%d\n", HW_REV_MAJOR, HW_REV_MINOR);
151 print_mac_addr(ethernet_mac_addr()->addr);
154 clocks_mimo_config(MC_WE_LOCK_TO_SMA);
156 while (!clocks_lock_detect()) {
160 puts("Clock Locked\n");