• Status Closed
  • Percent Complete
  • 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 pyro_maniac - 2009-05-05
Last edited by funman - 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  funman
2009-05-26 18:48
Reason for closing:  Accepted
Additional comments about closing:   Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407

committed by low_light

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

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.

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?

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.

I wonder if this would work on the YP models.

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

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)

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.

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

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?

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

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

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.

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_INIT2 &= ~0×800;

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.

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

Here’s what the rom bootloader does to init the IDE:

set cpu freq to 76 MHz

outl(0xC0000000, 0x600060C4);
IDE0_CFG |= 0×80000000;
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.

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.

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 mentions a MK2004GAL (perhaps 2004 or 2006 are manufacturing year).

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

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.

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.

Rockbox USB works fine on both my 820 and 925.

I would greatly appreciate if you can add USB HID key-maps for these platforms (see  FS#10218 ), provided HAVE_USBSTACK is defined.

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

USB does not work on my yh925. However, I got the 925 GS, if that makes a difference.

Here’s the dmesg output:

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.

funman is taking a look at that.

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


Available keyboard shortcuts


Task Details

Task Editing