Project

General

Profile

SciphoneDreamG2 » History » Version 10

steve-m, 02/19/2016 10:49 PM
add how-to for loading u-boot with our loader

1 1 laforge
= Sciphone Dream G2 =
2
3
The Sciphone Dream G2 is a [wiki:MT6235] based phone running UI software to mimic the look+feel of Android.
4
5
There is currently an u-boot and Linux port for the MT6235 underway, the primary development platform is the Sciphone G2.
6
7
OsmocomBB does not yet support any Mediatek chipsets, so this phone is not supported by OsmocomBB.  Nonetheless, we
8
expect to have support for it at some point in the future.
9
10 3 laforge
More information on the hardware of the device can be found at [http://en.qi-hardware.com/wiki/Sciphone_Dream_G2]
11 2 steve-m
== Serial Cable ==
12
13
You can make a serial cable by sacrificing the headset that comes with the phone, by swapping the pins inside the connector.
14
15
Serial pinout:
16
17 9 laforge
||Pin||signal||comment||
18 2 steve-m
||1||GND||
19
||2||GND||
20 9 laforge
||5||Rx||(From PC to Phone)||
21
||7||Tx||(From Phone to PC)||
22 2 steve-m
23
[[Image(sciphone_serial.jpg,20%)]]
24
25 1 laforge
== JTAG ==
26
27
The JTAG port of the MT6235 is accessible on the phone PCB, see the attached picture.
28 5 steve-m
You can use [http://openocd.berlios.de/web/ OpenOCD] along with the attached configuration file ([raw-attachment:openocd_mt6235.cfg]) for debugging.
29 4 steve-m
30 6 laforge
[[Image(scig2_front.JPG,20%)]]
31
[[Image(scig2_jtag.jpg,20%)]]
32
33 4 steve-m
== Serial Bootloader == 
34
35 5 steve-m
Like all Mediatek MT62xx !SoCs, the phone uses the [wiki:MTKRomloader].
36 6 laforge
37 10 steve-m
For executing U-Boot and Linux using the MTK romloader, proceed as follows:
38
39
 * clone osmocom-bb.git and checkout the branch 'steve-m/loader-sciphone'
40
 * compile the code, connect the phone and run osmocon:
41
   {{{
42
$ ./osmocon -p /dev/ttyUSB1 -m mtk ../../target/firmware/board/mt62xx/loader.mtkram.bin
43
   }}}
44
 * press and '''hold''' the powerbutton of the phone, until the loading has finished and you see the following:
45
   {{{
46
[...]
47
Received branch address ack, code should run now
48
49
Running on mt62xx in environment mtkram
50
HW_CODE = 0x6235
51
   }}}
52
53
'''Uploading U-Boot'''
54
 * '''don't''' terminate osmocon and execute:
55
 {{{
56
$ ./osmoload memload 0x500000 u-boot.bin
57
$ ./osmoload jump 0x500000
58
 }}}
59
60
 * now terminate osmocon and open a serial terminal of your choice (115200-8N1)
61
 * see below for loading Linux with U-Boot
62
63 6 laforge
== U-Boot ==
64
65
Port of U-Boot for Sciphone G2 can be found at [http://git.osmocom.org/gitweb?p=uboot-mt623x.git;a=summary U-Boot]
66
67
Building U-Boot:
68
69
{{{
70
export CROSS_COMPILE=arm-linux-gnueabi-
71
make sciphone_g2_config
72
make
73
}}}
74
75
== Linux kernel ==
76
77
Port of Linux kernel for Sciphone G2 can be found at [http://git.osmocom.org/gitweb?p=linux-mt623x.git;a=summary Linux kernel]
78
79
Building Linux:
80
81
{{{
82
export CROSS_COMPILE=arm-linux-gnueabi-
83 7 laforge
make ARCH=arm sciphone_g2_defconfig
84 6 laforge
make ARCH=arm uImage
85
}}}
86
87 8 laforge
== Building initramfs file system ==
88
89
The easiest way to have file system in Linux kernel is to build [http://www.kernel.org/doc/Documentation/filesystems/ramfs-rootfs-initramfs.txt Initramfs image].[[BR]]
90
91
You need to download [http://www.busybox.net/ Busybox], configure it and build it.
92
93
{{{
94
export CROSS_COMPILE=arm-linux-gnueabi-
95
make menuconfig
96
make
97
}}}
98
99
Additional to that you'll need to create console device in already built filesystem.
100
101
{{{
102
sudo mknod dev/console c 5 1
103
}}}
104
105
Now you can create CPIO archive:
106
107
{{{
108
find . | cpio -o -H newc > rootfs.cpio
109
}}}
110
111
Next step is to point to Linux kernel where initramfs image is located.[[BR]]
112
113
In menuconfig of Linux kernel you should modify following option:
114
115
{{{
116
CONFIG_INITRAMFS_SOURCE=<path_to_cpio>
117
General setup -> Initial RAM filesystem and RAM disk -> Initramfs source file(s)
118
}}}
119
120
After these steps Linux kernel image will have initramfs built in.[[BR]]
121
122
'''Important note:''' Initramfs ignores 'init=' variable given in kernel boot parameters list. It always executes /init command at startup and you can't change it. Check if you have /init in your file system (BusyBox has /linuxrc by default, so just change its name to init).
123
Every time you change initramfs file system you have to rebuild also Linux kernel.[[BR]]
124
125
To unpack CPIO archive you can use following command:
126
127
{{{
128
cpio -i -d -H newc -F <path_to_cpio_archive> --no-absolute-filenames
129
}}}
130
131 6 laforge
== Reading data files in U-Boot ==
132
133
'''NAND'''
134
135 7 laforge
Following command will read 256 bytes from NAND address 0 at address 0x800000.
136 6 laforge
137
{{{
138 7 laforge
nand read 0x800000 0 0x100
139 6 laforge
}}}
140
141
'''Serial'''
142
143 7 laforge
Following command will read data at address 0x800000 from serial at baudrate 115200 (using kermit protocol).
144 6 laforge
145
{{{
146 7 laforge
loadb 0x800000 115200
147 6 laforge
}}}
148
149
'''SD/MMC'''
150
151 7 laforge
Following command will read uImage file at address 0x800000 from MMC card.
152 6 laforge
153
{{{
154 7 laforge
fatload mmc 0 0x800000 uImage
155 6 laforge
}}}
Add picture from clipboard (Maximum size: 48.8 MB)