Project

General

Profile

SciphoneDreamG2 » History » Version 11

steve-m, 02/19/2016 10:49 PM
typo

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