Rockbox

Tasklist

FS#10189 - Samsung YH- 820, 920, 925 Port

Attached to Project: Rockbox
Opened by Jens Erdmann (pyro_maniac) - Tuesday, 05 May 2009, 09:41 GMT
Last edited by Rafaël Carré (funman) - Tuesday, 26 May 2009, 18:48 GMT
Task Type Patches
Category Operating System/Drivers
Status Closed
Assigned To No-one
Operating System Another
Severity Low
Priority Normal
Reported Version Version 3.2
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

This is a patch by lowlight with some fixes by kugel and me.

There are still some issues:

- no sound
- statusbar is not on the top
- on YH-920: - bootloader doen't work ( checksum seems to be wrong )
- LCD glitches on the top
This task depends upon

Closed by  Rafaël Carré (funman)
Tuesday, 26 May 2009, 18:48 GMT
Reason for closing:  Accepted
Additional comments about closing:  committed by low_light
Comment by Jens Erdmann (pyro_maniac) - Tuesday, 05 May 2009, 13:04 GMT
- Insert usb irq handler ( made by lowlight )
- update revision
Comment by Mark Arigo (lowlight) - Tuesday, 05 May 2009, 13:57 GMT
I plan to commit my tree as-is as soon as I find time. It works and has some changes not here. If you are making changes, please break them out separate from the original patch, I don't have the time to sync & test the whole thing again. Thanks.

I made a quick, unsuccessful attempt to get the audio driver working. While I think the audio driver is ok, it doesn't seem to be communicating with the codec chip correctly.

pyro_maniac: Since you are the only one with a 920, perhaps can try to track down the bootloader and lcd problems. The statusbar on the bottom is probably because the lcd is rotated and we are not accounting for the change in origin.
Comment by Jens Erdmann (pyro_maniac) - Tuesday, 05 May 2009, 14:36 GMT
The problem on the LCD and the statusbar on bottom seem to be the same issue. kugel send me your fix for the YH-925 lcd but i am not sure how to apply it. I belive that this fix could work on the YH-920 as you thought before, too. Can you introduce me into that fix and let me test it?
Comment by Jens Erdmann (pyro_maniac) - Wednesday, 06 May 2009, 13:47 GMT
The bootloader can't load neither the rockbox firmware nor the original firmware on the YH-920. On rockbox loading happens nothing and loading the OF raises a currupt firmware message and shuting down.
Comment by Mattitiah Curtis (motionman95) - Thursday, 07 May 2009, 21:06 GMT
I wonder if this would work on the YP models.
Comment by Jens Erdmann (pyro_maniac) - Thursday, 07 May 2009, 21:33 GMT
Can you test it? I don't have such device or know anybody who has.
Comment by Mattitiah Curtis (motionman95) - Thursday, 07 May 2009, 23:38 GMT
I would, but I'm afraid that it would break the player, because the mp3 player is my mother's. (It's a Samsung YP-S3)
Comment by Jens Erdmann (pyro_maniac) - Friday, 08 May 2009, 08:47 GMT
If you are unsure start with hardware research first and make a forum thread and a port wiki. The newport wiki may helps you. But this is not the right place for it i think.
Comment by Jens Erdmann (pyro_maniac) - Tuesday, 12 May 2009, 19:39 GMT
- fix lcd problem on the yh-925 (by lowlight)

this fix may work on the yh-920 display problems, too. But i didn't understand it enough yet.
Comment by Rafaël Carré (funman) - Thursday, 14 May 2009, 09:34 GMT
The YH920 bootloader has a problem with ATA storage.
I replaced SET_REG macro in ata-target.h by "#define SET_REG(reg,val) do { reg = (val); int __x = 200000;while(__x--);} while(0)" and the storage is initialized, partitions mounted, rockbox.mi4 found, but loading fails (too slow?).

I let the YH920 run 8 hours+ but it still showed "loading rockbox" on the screen.

Perhaps there is a status bit to check when setting some registers?
Comment by Rafaël Carré (funman) - Thursday, 14 May 2009, 16:21 GMT
I found the problem with LCD driver on YH920 : in lcd_update_rect() in the copy loop, the variable x is used instead of x0.

lcd_write_reg(LCD_CNTL_COLUMN, x0);
addr = &lcd_framebuffer[y][x0];

fixes the problem
Comment by Jens Erdmann (pyro_maniac) - Thursday, 14 May 2009, 19:35 GMT
that fixes the wrong lines but the statusbar is still on the buttom. is this an other issue?
Comment by Mark Arigo (lowlight) - Thursday, 14 May 2009, 20:30 GMT
As I mentioned above, the LCD is probably rotated so that (0,0) is not the upper, left corner as we are assuming. This is what was wrong with the 925 when the statusbar showed on the bottom. I'm just a guessing, try changing the default drawing mode to what is now the "flipped" mode (lcd_set_flip), and map the x,y coordinates to the lower, right corner.

I still don't understand how the normal build works but the bootloader build doesn't work.

@funman
Here's how the OF inits the IDE controller. Usually this usually already done by the rom bootloader, so I'm not sure why it would need to be redone.
outl(0xC0000000, 0x600060C4); /* unknown reg, probably a clock src */
DEV_EN |= DEV_IDE0;
DEV_INIT2 &= ~0x800;
GPIOF_ENABLE |= 0x4;
GPIOF_OUTPUT_VAL &= ~0x4;
GPIOF_OUTPUT_EN |= 0x4;
DEV_RS |= DEV_IDE0;
nop;
DEV_RS &= ~DEV_IDE0;
Comment by Rafaël Carré (funman) - Friday, 15 May 2009, 12:39 GMT
I added this code in ata_device_init() , prior to existing code, but there is no effect.

It is weird that rockbox.mi4 can access disk, I tried to call set_cpu_frequency() without effect.

I'll try to look at "#ifndef BOOTLOADER" code to see if some extra initialization is required.
Comment by Rafaël Carré (funman) - Friday, 15 May 2009, 16:37 GMT
"CPU_INT_DIS = -1;" in system_init() (system-pp502x.c) makes bootloader working (OF & rockbox loads OK and at reasonable speed).

Is there a reason why all this init (since "disable all irqs") is not made in the PP bootloaders ?
Comment by Mark Arigo (lowlight) - Friday, 15 May 2009, 17:10 GMT
funman:
Here's what the rom bootloader does to init the IDE:

set cpu freq to 76 MHz

DEV_EN |= DEV_IDE0;
outl(0xC0000000, 0x600060C4);
DEV_RS |= DEV_IDE0;
udelay(25);
DEV_RS &= ~DEV_IDE0;
IDE0_CFG |= 0x80000000;
udelay(25);
IDE0_CFG &= ~0x80000000;
IDE0_CFG |= 0x30000000
udelay(2000);

IDE0_PRI_TIMING0 = 0x2294; /* based on 76 MHz */


The YH925 has a very similar setup (although I didn't verify the ide timing) and the Rockbox bootloader works perfectly. The 925 hard drive is a Toshiba MK2006GAL.
Comment by Mark Arigo (lowlight) - Friday, 15 May 2009, 17:19 GMT
funman:
I was a little late on my comment. In addition to the above, the rom bootloader also enables an interrupt before the IDE init.
CPU_INT_EN |= 0x800000;

Perhaps that is the offending interrupt.
Comment by Rafaël Carré (funman) - Friday, 15 May 2009, 17:28 GMT
Perhaps CPU_INT_DIS is changed after IDE initialization, and then left in a harmful state, before it is reset by FW_YH920.mi4 , but the code from rom bootloader is not needed for IDE transfers to work.

Do you want to post your patch with sound (even in a bad state), so I can try to get FM radio working ? (the TEA5767 already has a driver so only I2C is missing).

About USB : kugel reported that USB isn't working on his YH925, and on my YH920 : the usb screen shows in rockbox and dmesg says "hub 1-0:1.0: unable to enumerate USB device on port 6" ; while USB works fine when using a stock H10 build "though rockbox things it's connected all the time (wrong GPIO pin)".
Did you test on YH820 only ?

My YH920 has the same hard disk than your YH925 , while http://www.rockbox.org/twiki/bin/view/Main/SamsungYH920 mentions a MK2004GAL (perhaps 2004 or 2006 are manufacturing year).
Comment by Rafaël Carré (funman) - Friday, 15 May 2009, 17:33 GMT
You're right : "CPU_INT_DIS = 0x800000;" is enough for ATA to work fine!

I believe CPU_INT_DIS = (1<<IDE_IRQ) /*== 0x800000*/in ata_device_init() would be more correct
Comment by Mark Arigo (lowlight) - Thursday, 21 May 2009, 04:10 GMT
Can someone post the 920 usb product and vendor id's.

Rockbox USB works fine on both my 820 and 925.

I'm finishing up some real work this week and hope to fix a few remaining things and commit by this weekend.
Comment by Mark Arigo (lowlight) - Thursday, 21 May 2009, 04:50 GMT
Can someone post the 920 usb product and vendor id's.

Rockbox USB works fine on both my 820 and 925.

I'm finishing up some real work this week and hope to fix a few remaining things and commit by this weekend.
Comment by Tomer Shalev (tomers) - Thursday, 21 May 2009, 05:25 GMT
> Rockbox USB works fine on both my 820 and 925.

Mark,
I would greatly appreciate if you can add USB HID key-maps for these platforms (see  FS#10218 ), provided HAVE_USBSTACK is defined.
Thanks!
Comment by Rafaël Carré (funman) - Thursday, 21 May 2009, 10:49 GMT
usb vendor id / usb product id for my yh920 : 0x04e8/0x5022
Comment by Thomas Martitz (kugel.) - Thursday, 21 May 2009, 12:22 GMT
USB does not work on my yh925. However, I got the 925 GS, if that makes a difference.

Here's the dmesg output: http://pastie.org/485266
Comment by Jens Erdmann (pyro_maniac) - Monday, 25 May 2009, 23:46 GMT
I tested r21087 and the bootloader works on the YH-920 now.
But the system seems to freeze on pressing pause in playback. Sound didn't work either.
Comment by Thomas Martitz (kugel.) - Monday, 25 May 2009, 23:47 GMT
funman is taking a look at that.

USB, audio works fine. RTC and contrast setting too after enabling it in config-yh925.h.

Loading...