Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Ritmix RZX-50 and RZX-27 #12

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

SiarheiVolkau
Copy link
Contributor

RZX-50 - JZ4755 based handheld with 64Mb SDRAM
RZX-27 - JZ4725b based handheld with 32Mb SDRAM

These patches allows to initialize SDRAM and load & execute OpenDingux as well as original firmwares.

Also these patches unify firmware header creation and MMC boot order.

The firmware headers are separated to NAND headers and MMC headers.

In contrast to JZ4760/70 JZ4725 have slightly different "MSPL" header.

For JZ4760+ header structure is:

  • MBR (512 bytes)
  • MSPL header (4 bytes)
  • entry point
  • rest of binary

For JZ4725b it is:

  • MSPL header (4b)
  • entry point
  • MBR (aligned to 512b boundary)
  • rest of binary

JZ4755 have no specific header, but entry point is at beginning of firmware:

  • entry point
  • MBR (aligned to 512b boundary)
  • rest of binary

So, for those 2 SoCs UBIBoot header also includes space for MBR into binary: -DHAVE_MBR option.

Regarding MMC boot order, MMC_ID and MMC_ID2 are replaced by
MMC_IDS and MMC_BLKIDS arrays

  • the first defines SoCs MSC(x) in boot order.
  • the second defines which /dev/mmcblk(y) corresponds the MSC(x) in MMC_IDS.

…x-27/50

NAND and MMC headers might be different on same SoCs. Go split them.
Catches unknown Header:SoC situations.
Add MMC header variants for JZ4725b and JZ4755 for further patches to
support Ritmix handhelds.

Signed-off-by: Siarhei Volkau <lis8215@gmail.com>
Replaces MMC_ID/MMC_ID2 by MMC_IDS array, boot process will try all MMCs
in order.
To properly map SoC's MSC ids to Linux's block devices MMC_BLKIDS array
is used, each entry in MMC_IDS shall have entry in MMC_BLKIDS.

Signed-off-by: Siarhei Volkau <lis8215@gmail.com>
Signed-off-by: Siarhei Volkau <lis8215@gmail.com>
Signed-off-by: Siarhei Volkau <lis8215@gmail.com>
Support Ritmix boards at the moment.

Signed-off-by: Siarhei Volkau <lis8215@gmail.com>
@pcercuei
Copy link
Owner

pcercuei commented Dec 6, 2022

Ah, sorry! I missed your PR!

@pcercuei
Copy link
Owner

pcercuei commented Dec 6, 2022

I reworked your MMC refactor, please have a look: 7728d2d

For your RZX-27 and RXZ-50 boards, I'm annoyed that a lot of code is duplicated (PLL init code, memory init code). This code is SoC-specific and not board-specific, so it should be common to these two.

If the code ends up similar to what's already in board-lepus.c (although the SoC is different), then it would be a good idea to share as much code as possible.

@SiarheiVolkau
Copy link
Contributor Author

Hi @pcercuei ,

I reworked your MMC refactor

Looks good, but it missed one important thing for me - easy changing the boot order: its useful during development to boot from external MMC first and fall back to internal then and finally try original firmware on the internal MMC slot. Also this algo is applicable for normal usage, what do you think?

it would be a good idea to share as much code as possible

Indeed, although these two are closer to rs90 than to lepus, I'll try to unify PLL and SDRAM initialization for all three in next round.

missed your PR!

Please have a look at my other activities: 1, 2.

@pcercuei
Copy link
Owner

@SiarheiVolkau with your original MMC refactor commit ubiboot would "try all MMCs in order", I did not change that.

We could make it try to boot from external SDs first, yes, I think it makes sense.

@SiarheiVolkau
Copy link
Contributor Author

with your original MMC refactor commit ubiboot would "try all MMCs in order", I did not change that.

But you don't use the MMC_BLKIDS which is crucial to that feature.
Imagine, we're changing boot order to { 2, 0 } to boot from external first, but the root parameter passed to the kernel will be mmcblk0p1 for MSC2 and mmcblk1p1 for MSC0, which is completely incorrect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants