Skip to contentSkip to conversation

uncompress.h cleanup and DT support

RFC PATCH New Zoltan Devai 4 participants 9 messages Oct 23, 2011

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 uncompress.h cleanup and DT support

Hi,

Originally, I just wanted to get rid of arch_decomp_* in all the uncompress.h files, that were mostly empty. But then, I couldn't stop. Which may also mean I have gone too far.

Plase consider all this as RFC, it's mostly not even compile-tested. If you think it's worth to follow-up, I'm happy to do it.

What this series does:
- Remove all instances of arch_decomp_wdog

- Restructure the decompression code just a bit,
to separate the UART-printing stuff

- Introduce a low-level serial driver of the style "check a reg if there's space for a TX char", "output char", "wait for flush reg"

- Add init functions for the two common UARTs:
8250 and the amba.
This finally gets rid of that dozen re-implementations that all use different register access methods and register defines, but do the same.

- Some basic style cleanup

- Allow the uncompress UART definitions to be overridden by a device tree description.
This would allow the removal of all the
"if machine_is_xxx, serial base is 123" lookup tables.

Remarks:
- Just to see how it works out, I converted most of the arches/machines to use the ucuart driver.
I didn't convert any Samsung machines, because the code is just too convoluted for me to dive into now.
- The overall patch is above 100K, so I didn't want to post it here.
It's available here:
git://github.com/zdevai/linux.git uncompress-h

- Overall diffstat below.

Comments welcome.

Cheers,
Zoltan

 arch/arm/Kconfig                                   |    9 +
 arch/arm/boot/compressed/Makefile                  |    9 +-
 arch/arm/boot/compressed/decompress.c              |   78 ++++--
 arch/arm/boot/compressed/head.S                    |    8 +
 arch/arm/boot/compressed/misc.c                    |  154 -----------
 arch/arm/boot/compressed/print.c                   |  290 ++++++++++++++++++++
 arch/arm/mach-at91/include/mach/uncompress.h       |   62 +----
 arch/arm/mach-bcmring/include/mach/uncompress.h    |   47 +---
 arch/arm/mach-clps711x/include/mach/uncompress.h   |   49 +---
 arch/arm/mach-cns3xxx/include/mach/uncompress.h    |   49 +---
 arch/arm/mach-davinci/include/mach/uncompress.h    |   24 +--
 arch/arm/mach-dove/include/mach/uncompress.h       |   30 +--
 arch/arm/mach-ebsa110/include/mach/uncompress.h    |   40 +---
 arch/arm/mach-ep93xx/include/mach/uncompress.h     |   49 +---
 arch/arm/mach-exynos4/include/mach/uncompress.h    |   15 +-
 arch/arm/mach-footbridge/include/mach/uncompress.h |   34 +--
 arch/arm/mach-gemini/include/mach/uncompress.h     |   41 +---
 arch/arm/mach-h720x/include/mach/uncompress.h      |   39 +--
 arch/arm/mach-integrator/include/mach/uncompress.h |   49 +---
 arch/arm/mach-iop13xx/include/mach/uncompress.h    |   26 +--
 arch/arm/mach-iop32x/include/mach/uncompress.h     |   37 +--
 arch/arm/mach-iop33x/include/mach/uncompress.h     |   34 +--
 arch/arm/mach-ixp2000/include/mach/uncompress.h    |   48 +---
 arch/arm/mach-ixp23xx/include/mach/uncompress.h    |   33 +--
 arch/arm/mach-ixp4xx/include/mach/uncompress.h     |   44 +---
 arch/arm/mach-kirkwood/include/mach/uncompress.h   |   40 +---
 arch/arm/mach-ks8695/include/mach/uncompress.h     |   32 +--
 arch/arm/mach-lpc32xx/include/mach/uncompress.h    |   57 +----
 arch/arm/mach-mmp/include/mach/uncompress.h        |   38 +---
 arch/arm/mach-msm/include/mach/uncompress.h        |   45 +---
 arch/arm/mach-mv78xx0/include/mach/uncompress.h    |   40 +---
 arch/arm/mach-mxs/include/mach/uncompress.h        |   63 +----
 arch/arm/mach-netx/include/mach/uncompress.h       |   73 +-----
 arch/arm/mach-nomadik/include/mach/uncompress.h    |   58 +----
 arch/arm/mach-omap1/include/mach/uncompress.h      |    4 -
 arch/arm/mach-omap2/include/mach/uncompress.h      |    4 -
 arch/arm/mach-orion5x/include/mach/uncompress.h    |   48 +---
 arch/arm/mach-picoxcell/include/mach/uncompress.h  |   18 +-
 arch/arm/mach-pnx4008/include/mach/uncompress.h    |   43 +---
 arch/arm/mach-prima2/include/mach/uncompress.h     |   41 +---
 arch/arm/mach-pxa/include/mach/uncompress.h        |   77 +-----
 arch/arm/mach-realview/include/mach/uncompress.h   |   70 +----
 arch/arm/mach-rpc/include/mach/uncompress.h        |    9 +-
 arch/arm/mach-s3c2410/include/mach/uncompress.h    |    2 +
 arch/arm/mach-s3c64xx/include/mach/uncompress.h    |   18 +-
 arch/arm/mach-s5p64x0/include/mach/uncompress.h    |   39 +---
 arch/arm/mach-s5pc100/include/mach/uncompress.h    |    6 +-
 arch/arm/mach-s5pv210/include/mach/uncompress.h    |   17 +-
 arch/arm/mach-sa1100/include/mach/uncompress.h     |   62 ++---
 arch/arm/mach-shark/include/mach/uncompress.h      |   52 +----
 arch/arm/mach-shmobile/include/mach/uncompress.h   |   17 +-
 arch/arm/mach-spear3xx/include/mach/uncompress.h   |   18 --
 arch/arm/mach-spear6xx/include/mach/uncompress.h   |   18 --
 arch/arm/mach-tegra/include/mach/uncompress.h      |   62 +----
 arch/arm/mach-u300/include/mach/uncompress.h       |   45 +---
 arch/arm/mach-ux500/include/mach/uncompress.h      |   54 +----
 arch/arm/mach-versatile/include/mach/uncompress.h  |   45 +---
 arch/arm/mach-vexpress/include/mach/uncompress.h   |   51 +----
 arch/arm/mach-vt8500/include/mach/uncompress.h     |   40 +---
 arch/arm/mach-w90x900/include/mach/uncompress.h    |   47 +---
 arch/arm/mach-zynq/include/mach/uncompress.h       |   53 +---
 arch/arm/plat-mxc/include/mach/uncompress.h        |   37 +--
 arch/arm/plat-omap/include/plat/uncompress.h       |   45 +---
 arch/arm/plat-samsung/Kconfig                      |    8 -
 arch/arm/plat-samsung/include/plat/uncompress.h    |   35 +---
 arch/arm/plat-spear/include/plat/uncompress.h      |   43 +---
 arch/arm/plat-tcc/include/mach/uncompress.h        |   33 +--
 67 files changed, 671 insertions(+), 2234 deletions(-)
#1 lore raw

RFC PATCH 1/1 uncompress.h cleanup and DT support

Quoted 2 lines · Zoltan Devai

Plase consider all this as RFC, it's mostly not even compile-tested. If you think it's worth to follow-up, I'm happy to do it.

Is the patch available?

Has this been tested with ZBOOT_ROM?

Thanks.

#2 lore raw

RFC PATCH 1/1 uncompress.h cleanup and DT support

2011/10/23 Russell King - ARM Linux <[email protected]>:

Quoted 5 lines · Zoltan Devai
Quoted 2 lines

Plase consider all this as RFC, it's mostly not even compile-tested. If you think it's worth to follow-up, I'm happy to do it.

Is the patch available?

git://github.com/zdevai/linux.git uncompress-h

Quoted 1 line

Has this been tested with ZBOOT_ROM?

Not yet, but I don't see a reason why this would break it.

Zoltan

#3 lore raw

RFC PATCH 1/1 uncompress.h cleanup and DT support

Quoted 7 lines · Zoltan Devai

2011/10/23 Russell King - ARM Linux <[email protected]>:

Quoted 5 lines · Zoltan Devai
Quoted 2 lines

Plase consider all this as RFC, it's mostly not even compile-tested. If you think it's worth to follow-up, I'm happy to do it.

Is the patch available?

git://github.com/zdevai/linux.git uncompress-h

I'd rather not pull your tree just to look at the patch. Is it available somewhere else?

Quoted 2 lines
Quoted 1 line

Has this been tested with ZBOOT_ROM?

Not yet, but I don't see a reason why this would break it.

Please try building it with ZBOOT_ROM enabled.

#4 lore raw

RFC PATCH 1/1 uncompress.h cleanup and DT support

Quoted 11 lines · Russell King - ARM Linux
Quoted 7 lines · Zoltan Devai

2011/10/23 Russell King - ARM Linux <[email protected]>:

Quoted 5 lines · Zoltan Devai
Quoted 2 lines

Plase consider all this as RFC, it's mostly not even compile-tested. If you think it's worth to follow-up, I'm happy to do it.

Is the patch available?

git://github.com/zdevai/linux.git uncompress-h

I'd rather not pull your tree just to look at the patch. Is it available somewhere else?

It's not hard to look at it and no need to pull, just do:

git fetch git://github.com/zdevai/linux.git uncompress-h git log -p ..FETCH_HEAD

(Of course you get the objects of the branch into your object-db but that shouldn't matter much.)

Obviously this doesn't give a good opportunity to comment the patch. It's just to satisfy your curiosity.

Just from a quick glance commit 77bf042c54650ecb39a0e6d79de827d3157cf817 is not OK. For example it changes the license terms
of arch/arm/mach-at91/include/mach/uncompress.h from GPLv2+ to GPLv2 and removes a copyright. Ditto for some other files.

In commit dbd13d823641694c633c01e8e33e21eb76a1aad2 git played tricks on you and removed a line like

	#define ARCH_HAVE_DECOMP_SETUP

because it thought it's a comment that shouldn't go into the log. Note that this isn't very multi-SoC friendly.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#5 lore raw

RFC PATCH 1/1 uncompress.h cleanup and DT support

Quoted 8 lines · Uwe Kleine-K?nig
Quoted 7 lines · Russell King - ARM Linux
Quoted 6 lines · Zoltan Devai

2011/10/23 Russell King - ARM Linux <[email protected]>:

Quoted 5 lines · Zoltan Devai
Quoted 2 lines

Plase consider all this as RFC, it's mostly not even compile-tested. If you think it's worth to follow-up, I'm happy to do it.

Is the patch available?

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

git://github.com/zdevai/linux.git uncompress-h

I'd rather not pull your tree just to look at the patch. Is it available somewhere else?

It's not hard to look at it and no need to pull, just do:

git fetch git://github.com/zdevai/linux.git uncompress-h git log -p ..FETCH_HEAD

.1 We do reviews in patch form on mailing lists, not from commits inside
git trees.

.2 I don't even want to pull the objects into my tree - that's a waste of
bandwidth just to _read_ the patch, and risks pulling in a lot more depending on the parents of the commit.

So, please stick to patch form. If it's too large for the mailing list, please split the patch up into a logical sequence of steps as individual patches. Only then provide a gitweb URL if that's not possible.

If the diffstat at the start of this thread reflects a single patch then it's doing too much as one change.

#6 lore raw

RFC PATCH 1/1 uncompress.h cleanup and DT support

In reply to Russell King - ARM Linux

2011/10/23 Russell King - ARM Linux <[email protected]>:

Quoted 11 lines · Zoltan Devai
Quoted 7 lines

2011/10/23 Russell King - ARM Linux <[email protected]>:

Quoted 5 lines · Zoltan Devai
Quoted 2 lines

Plase consider all this as RFC, it's mostly not even compile-tested. If you think it's worth to follow-up, I'm happy to do it.

Is the patch available?

git://github.com/zdevai/linux.git uncompress-h

I'd rather not pull your tree just to look at the patch. ?Is it available somewhere else?

Submitted as patches.
I tried to make the whole series bisectable, which is why it contains some extra steps, and didn't want to spam everybody's inbox with this noise.

Quoted 3 lines
Quoted 2 lines
Quoted 1 line

Has this been tested with ZBOOT_ROM?

Not yet, but I don't see a reason why this would break it.

Please try building it with ZBOOT_ROM enabled.

I did build it, which worked.
Problem is, I don't have a machine which could actually do ZBOOT_ROM, so I can't test it that way.
(I could execute the image from RAM, but I assume that's not a good test scenario)

Z

#7 lore raw

RFC PATCH 1/1 uncompress.h cleanup and DT support

In reply to Zoltan Devai
Quoted 5 lines · Zoltan Devai

Hi,

Originally, I just wanted to get rid of arch_decomp_* in all the uncompress.h files, that were mostly empty. But then, I couldn't stop. Which may also mean I have gone too far.

on small SoC arm926 the kernel may more time that the watchdog refreshing so the kernel will never have enough time to decompress

and on some platform the watchdog can be configured only one (AT91 as example)

Best Regards,
J.

#8 lore raw

RFC PATCH 1/1 uncompress.h cleanup and DT support

2011/10/23 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>:

Quoted 8 lines · Zoltan Devai
Quoted 5 lines

Hi,

Originally, I just wanted to get rid of arch_decomp_* in all the uncompress.h files, that were mostly empty. But then, I couldn't stop. Which may also mean I have gone too far.

on small SoC arm926 the kernel may more time that the watchdog refreshing so the kernel will never have enough time to decompress

Sure, but:
- only Samsung was using it (with optional Kconfig)
- the feature wasn't working since ARM moved to use the decompress_* libs instead of inflate.c (2.6.33)

Carrying around a 95% empty definition, that does nothing even when not empty, doesn't make sense.
If someone needs a decomp_wdog, he needs to re-implement it from scratch, using the new decompressor libraries.

Z