Rockbox

  • Status Closed
  • Percent Complete
    100%
  • Task Type Patches
  • Category Operating System/Drivers
  • Assigned To No-one
  • Operating System Another
  • Severity Low
  • Priority Very Low
  • Reported Version Version 3.2
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by Jens Erdmann - 2009-05-05
Last edited by Rafaël Carré - 2009-05-26

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

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 )

  1. LCD glitches on the top
Closed by  Rafaël Carré
2009-05-26 18:48
Reason for closing:  Accepted
Additional comments about closing:  

committed by low_light

Jens Erdmann commented on 2009-05-05 13:04

- Insert usb irq handler ( made by lowlight )
- update revision

Mark Arigo commented on 2009-05-05 13:57

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.

Jens Erdmann commented on 2009-05-05 14:36

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?

Jens Erdmann commented on 2009-05-06 13:47

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.

Mattitiah Curtis commented on 2009-05-07 21:06

I wonder if this would work on the YP models.

Jens Erdmann commented on 2009-05-07 21:33

Can you test it? I don’t have such device or know anybody who has.

Mattitiah Curtis commented on 2009-05-07 23:38

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)

Jens Erdmann commented on 2009-05-08 08:47

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.

Jens Erdmann commented on 2009-05-12 19:39

- 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.

Rafaël Carré commented on 2009-05-14 09:34

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?

Rafaël Carré commented on 2009-05-14 16:21

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

Jens Erdmann commented on 2009-05-14 19:35

that fixes the wrong lines but the statusbar is still on the buttom. is this an other issue?

Mark Arigo commented on 2009-05-14 20:30

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 &= ~0×800;
GPIOF_ENABLE |= 0×4;
GPIOF_OUTPUT_VAL &= ~0×4;
GPIOF_OUTPUT_EN |= 0×4;
DEV_RS |= DEV_IDE0;
nop;
DEV_RS &= ~DEV_IDE0;

Rafaël Carré commented on 2009-05-15 12:39

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.

Rafaël Carré commented on 2009-05-15 16:37

“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 ?

Mark Arigo commented on 2009-05-15 17:10

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 |= 0×80000000;
udelay(25);
IDE0_CFG &= ~0×80000000;
IDE0_CFG |= 0×30000000 udelay(2000);

IDE0_PRI_TIMING0 = 0×2294; /* 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.

Mark Arigo commented on 2009-05-15 17:19

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 |= 0×800000;

Perhaps that is the offending interrupt.

Rafaël Carré commented on 2009-05-15 17:28

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).

Rafaël Carré commented on 2009-05-15 17:33

You’re right : “CPU_INT_DIS = 0×800000;” is enough for ATA to work fine!

I believe CPU_INT_DIS = (1«IDE_IRQ) /*== 0×800000*/in ata_device_init() would be more correct

Mark Arigo commented on 2009-05-21 04:10

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.

Mark Arigo commented on 2009-05-21 04:50

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.

Tomer Shalev commented on 2009-05-21 05:25
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!

Rafaël Carré commented on 2009-05-21 10:49

usb vendor id / usb product id for my yh920 : 0x04e8/0×5022

Thomas Martitz commented on 2009-05-21 12:22

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

Jens Erdmann commented on 2009-05-25 23:46

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.

Thomas Martitz commented on 2009-05-25 23:47

funman is taking a look at that.

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

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing