summaryrefslogtreecommitdiffstats
path: root/Documentation/boards/mips/max9331.rst
blob: f09dabc2da15aa492a114dc7b4c2a7a1d94d295d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
OKUD MAX9331
==============

The USELESS Board seems useless

  * Atheros ar9331 SoC(MIPS24Kc, 400MHz, 32bit);
  * 64 MiB SDRAM;
  * 16 MiB NOR type SPI Flash Memory;
  * 3.3V TTL UART;
  * 4 GiB USB Nand Flash Disk;
  * 3 RJ45 Ports;
  *   IEEE 802.11b/g;
  * 3 User LEDs;
  * 1 GPIO Button;

The useless board always shiped with the lastest barebox and kernel. OpenWRT
is supported too.

Perparing Hardware
------------------

solder the board in the back, use a TTL dongle connect to JP1.

::

	TP2 -- TP3
	TP1 -- TP4

	+--|PWR|---|wan|---|lan1|---|lan2|-----|ANT|---+
	|                                              |
	|                                              |
	|                                              |
	|                                              |
	|                                              |
	|                          TP2                 |
	|                           O  O TP1           |
	|      TP3                                     |
	|       O                                      |
	| TP4 O                                        |
	|     o o o                                    |
	+----------------------------------------------+
	    Tx Rx GND


Running barebox
---------------

Barebox can be program to the board with:

 * run by u-boot from tftp server
 * run barebox from RAM or burn to flash by barebox
 * run from spi flash

Barebox can be started from U-Boot using tftp.
To convert barebox.bin to u-boot uImage format:

.. code-block:: sh

  $ mkimage -A mips -O linux -T kernel -C none -a a0060000 -e a0060000 -n 'Barebox uImage' -d images/barebox-okud-max9331.img uImage
  $ cp uImage /var/lib/tftpboot

connect your board to your tftp-server network via Ethernet.
next, setup network on MAX9331 and run:

.. code-block:: console

  hornet> set ipaddr 192.168.31.17
  hornet> set serverip 192.168.31.40
  hornet> tftpboot 0x81000000 uImage

run from ram:

.. code-block:: console

  hornet> bootm 0x81000000

or burn to flash, replace the 0x40000 to your uImage real size,

.. code-block:: console

  hornet> erase 0x9f020000 +0x40000
  hornet> cp.b 0x81000000 0x9f020000 0x40000
  hornet> reset

if your board preinstalled with barebox:

run barebox from ram by barebox

copy the image to tftp server folder

.. code-block:: sh

  $ cp images/barebox-okud-max9331.img /var/lib/tftpboot/none-barebox-max9331

enable dhcp service on the network

.. code-block:: console

   global net.server=10.1.1.72
   boot bnet

if you want to make it valid next boot

.. code-block:: console

   nv net.server=10.1.1.72
   boot bnet

update barebox by barebox

.. code-block:: console

   barebox_update /mnt/tftp/none-barebox-max9331

run from spi flash

max9331 has 16MiB spi flash on board, layout is like this

.. code-block:: text

   | boot0 | ... | barebox | ... | art |

by default, the barebox bootloader is not located in the begginning of flash,
instead we have a so called program boot0, it is a very simple program,
it jump to 0x9f020000 where the first instruction of barebox.
This is usefull when debug with jtag or choosing different bootloaders.
or even boot kernel without bootloader.

.. code-block:: assembly

 lui  ra, 0x9f02
 jr   ra
 nop

 b    .
 nop

Links
-----

See also

  * http://www.eeboard.com/wp-content/uploads/downloads/2013/08/AR9331.pdf
  * http://squonk42.github.io/TL-WR703N/