Quantcast
Channel: Linux Device Hacking
Viewing all articles
Browse latest Browse all 3247

Dockstar HW mod: Trying to add native sata (2 replies)

$
0
0
Hi,

First I must thank the community, specially Bodhi for supporting the project during all this time!

I got a Dockstar about 9 years ago, served me well, however I always wanted to try lifting the cpu and directly interfacing the native sata.
I wanted a small NAS but the USB became too slow for modern networks, so I stopped using it.
Since it's been unused for 2 or 3 years, I decided to try, I had nothing to lose.
I lifted the CPU, cleaned everything and soldered 4 very thin wires to the sata bga pads.
Suprisingly the surgery was successful, it booted fine after reballing the CPU. Everything seems ok.

Some pictures:
https://i.imgur.com/HdcrLPn.jpeg
https://i.imgur.com/uTcusAO.jpeg

But, as I suspected, the sata interface is disabled.
I guess I have to make a custom DTB, or maybe there's another Kirkwood/Pogoplug device that shares the same hw but adding sata support?


This is what I've done so far:

configs/dockstar_defconfig
Add:
 "CONFIG_CMD_IDE=y"

include/configs/dockstar.h
Add/modify:
/*
 * Default environment variables
 */

"devices=usb ide\0"
...
...
/*
 * SATA 
 */
#ifdef CONFIG_MVSATA_IDE
#define CONFIG_SYS_ATA_IDE0_OFFSET	MV_SATA_PORT0_OFFSET
#define CONFIG_SYS_ATA_IDE1_OFFSET	MV_SATA_PORT1_OFFSET
#endif


Tried to compile:

export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabi-
export CC=arm-linux-gnueabi-gcc
make dockstar_defconfig
make

But I get several errors:
arm-linux-gnueabi-ld.bfd: fs/built-in.o: in function `read_symbol':
/home/user/cosas/u-boot-kirkwood/fs/jffs2/mini_inflate.c:129: undefined reference to `pull_bit'
arm-linux-gnueabi-ld.bfd: fs/built-in.o: in function `decompress_huffman':
/home/user/cosas/u-boot-kirkwood/fs/jffs2/mini_inflate.c:159: undefined reference to `pull_bits'
arm-linux-gnueabi-ld.bfd: /home/user/cosas/u-boot-kirkwood/fs/jffs2/mini_inflate.c:170: undefined reference to `pull_bits'
arm-linux-gnueabi-ld.bfd: fs/built-in.o: in function `init_code_tables':
/home/user/cosas/u-boot-kirkwood/fs/jffs2/mini_inflate.c:208: undefined reference to `cramfs_memset'
arm-linux-gnueabi-ld.bfd: /home/user/cosas/u-boot-kirkwood/fs/jffs2/mini_inflate.c:209: undefined reference to `cramfs_memset'
arm-linux-gnueabi-ld.bfd: /home/user/cosas/u-boot-kirkwood/fs/jffs2/mini_inflate.c:210: undefined reference to `cramfs_memset'
arm-linux-gnueabi-ld.bfd: fs/built-in.o: in function `decompress_block':
/home/user/cosas/u-boot-kirkwood/fs/jffs2/mini_inflate.c:360: undefined reference to `pull_bit'
arm-linux-gnueabi-ld.bfd: /home/user/cosas/u-boot-kirkwood/fs/jffs2/mini_inflate.c:361: undefined reference to `pull_bits'
arm-linux-gnueabi-ld.bfd: fs/built-in.o: in function `decompress_none':
/home/user/cosas/u-boot-kirkwood/fs/jffs2/mini_inflate.c:115: undefined reference to `pull_bits'
arm-linux-gnueabi-ld.bfd: fs/built-in.o: in function `decompress_dynamic':
/home/user/cosas/u-boot-kirkwood/fs/jffs2/mini_inflate.c:230: undefined reference to `pull_bits'
arm-linux-gnueabi-ld.bfd: /home/user/cosas/u-boot-kirkwood/fs/jffs2/mini_inflate.c:231: undefined reference to `pull_bits'
arm-linux-gnueabi-ld.bfd: /home/user/cosas/u-boot-kirkwood/fs/jffs2/mini_inflate.c:232: undefined reference to `pull_bits'
arm-linux-gnueabi-ld.bfd: fs/built-in.o:/home/user/cosas/u-boot-kirkwood/fs/jffs2/mini_inflate.c:244: more undefined references to `pull_bits' follow
arm-linux-gnueabi-ld.bfd: fs/built-in.o: in function `decompress_fixed':
/home/user/cosas/u-boot-kirkwood/fs/jffs2/mini_inflate.c:326: undefined reference to `cramfs_memset'
arm-linux-gnueabi-ld.bfd: /home/user/cosas/u-boot-kirkwood/fs/jffs2/mini_inflate.c:327: undefined reference to `cramfs_memset'
arm-linux-gnueabi-ld.bfd: /home/user/cosas/u-boot-kirkwood/fs/jffs2/mini_inflate.c:328: undefined reference to `cramfs_memset'
arm-linux-gnueabi-ld.bfd: /home/user/cosas/u-boot-kirkwood/fs/jffs2/mini_inflate.c:329: undefined reference to `cramfs_memset'
arm-linux-gnueabi-ld.bfd: /home/user/cosas/u-boot-kirkwood/fs/jffs2/mini_inflate.c:330: undefined reference to `cramfs_memset'
arm-linux-gnueabi-ld.bfd: fs/built-in.o:/home/user/cosas/u-boot-kirkwood/fs/jffs2/mini_inflate.c:331: more undefined references to `cramfs_memset' follow

I edited fs/jffs2/mini_inflate.c and replaced inline void with static inline void, that fixed these errors, but got new ones:

Error: You must add new CONFIG options using Kconfig
The following new ad-hoc CONFIG options were detected:
CONFIG_CMD_ENV
CONFIG_SYS_HUSH_PARSER
CONFIG_SYS_NO_FLASH

Added these entries to scripts/config_whitelist.txt and finally, I was able to build u-boot (u-boot and u-boot.bin files were generated).

What eIse do I need to take care of? I'd prefer to avoid bricking it, adding more jtag mess...

The Kernel seems to be generic for all Kirkwood devices, so my thoughts are on:

- arcNumber. Tried other numbers, did nothing, so I guess I definitley need a new DTB to define the hardware changes.
- DTB. Where and how?


By the way, I'm using arm-linux-gnueabi-gcc 9.3.0


Cheers,
David

Viewing all articles
Browse latest Browse all 3247

Trending Articles