public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [Resend RFC PATCH v1 0/3] GPT over MTD
@ 2016-11-22 13:24 Patrick Delaunay
  2016-11-22 13:24 ` [U-Boot] [Resend RFC PATCH v1 1/3] add support of GPT partitioning " Patrick Delaunay
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Patrick Delaunay @ 2016-11-22 13:24 UTC (permalink / raw)
  To: u-boot


I have a request to support GPT over MTD to be able to have dynamic
MTD informations without u-Boot environment(CONFIG_ENV_IS_NOWHERE
is a other requirement of my project).

The idea is to use the GPT header to save partitioning information directly
in flash device (NOR or NAND), then the MTD variables are rebuild from
these GPT partitions and can be used by DISTRO to search bootable binary.

I make a first prototyping for this request but I want ask you if this
feature is acceptable for u-boot and if this patches, after some update
and cleanups, would be merged in u-boot mainline.
Do you see already some blocking points ?

- added code is under a new CONFIG : CONFIG_EFI_PARTITION_MTD
- for implementation details, see doc/README.gpt.mtd

TODO:
- split patch between core impact (disk/part_efi.c)
  and command update
- full support for modified command
  (today I limit the support for the command used by DISTRO macro)
- DISTRO macro update for automatic boot on GPT bootable partition
  found in MTD devices

the current level is tested manually on sandbox with :

> make O=sandbox
> sandbox/u-boot -d sandbox/arch/sandbox/dts/test.dtb

=> sf probe
SF: Detected M25P16 with page size 256 Bytes, erase size 64 KiB, total 2 MiB

=> setenv nor_part "name=part1,size=64KiB;name=part2,size=128KiB;\
   name=boot,type=linux,bootable,size=512KiB"
=> gpt write nor 0 $nor_part
Writing GPT: success!

=> part list nor 0
Part	Start LBA	End LBA		Name
	Attributes
	Type GUID
	Partition GUID
  1	0x00000080	0x000000ff	"part1"
	attrs:	0x0000000000000000
	type:	ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
	type:	data
	guid:	d117f98e-6f2c-0040-00b2-331a19f91cb2
  2	0x00000100	0x000001ff	"part2"
	attrs:	0x0000000000000000
	type:	ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
	type:	data
	guid:	25718777-d0ad-0000-8060-02cb591c9737
  3	0x00000200	0x000005ff	"boot"
	attrs:	0x0000000000000004
	type:	0fc63daf-8483-4772-8e79-3d69d8477de4
	type:	linux
	guid:	8a4bb8b4-e304-0040-0036-aff5c9c495b1

=> setenv mtdids "nor0=nor0"
=> setenv mtdparts "mtdparts="
=> mtdparts gpt nor0
=> mtdparts
device nor0 <nor0>, # parts = 3
 #: name		size		offset		mask_flags
 0: part1               0x00010000	0x00010000	0
 1: part2               0x00020000	0x00020000	0
 2: boot                0x00080000	0x00040000	0

active partition: nor0,0 - (part1) 0x00010000 @ 0x00010000

defaults:
mtdids  : none
mtdparts: none

=> part list nor 0 -bootable nor_boot_part
=> printenv nor_boot_part
nor_boot_part=3



Patrick Delaunay (3):
  add support of GPT partitioning over MTD
  uuid: remove dependency with io.h
  sandbox: GPT over MTD test

 Kconfig                   |  12 ++
 cmd/gpt.c                 |  98 +++++++--
 cmd/mtdparts.c            | 103 ++++++++-
 cmd/part.c                |  48 ++++-
 configs/sandbox_defconfig |   2 +
 disk/part_efi.c           | 526 +++++++++++++++++++++++++++++++++++++++++-----
 doc/README.gpt.mtd        | 189 +++++++++++++++++
 include/configs/sandbox.h |   7 +
 include/part.h            |  13 +-
 include/uuid.h            |   1 +
 lib/uuid.c                |  46 +++-
 11 files changed, 959 insertions(+), 86 deletions(-)
 create mode 100644 doc/README.gpt.mtd

-- 
1.9.1

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2016-11-30 10:45 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-22 13:24 [U-Boot] [Resend RFC PATCH v1 0/3] GPT over MTD Patrick Delaunay
2016-11-22 13:24 ` [U-Boot] [Resend RFC PATCH v1 1/3] add support of GPT partitioning " Patrick Delaunay
2016-11-24  2:20   ` Simon Glass
2016-11-24 10:27     ` Patrick DELAUNAY
2016-11-27 17:02       ` Simon Glass
2016-11-28 15:06         ` Patrick DELAUNAY
2016-11-30 10:45         ` Patrick DELAUNAY
2016-11-22 13:24 ` [U-Boot] [Resend RFC PATCH v1 2/3] uuid: remove dependency with io.h Patrick Delaunay
2016-11-22 13:24 ` [U-Boot] [Resend RFC PATCH v1 3/3] sandbox: GPT over MTD test Patrick Delaunay
2016-11-22 14:57 ` [U-Boot] [Resend RFC PATCH v1 0/3] GPT over MTD Ladislav Michl
2016-11-24 14:14   ` Patrick DELAUNAY
2016-11-25 12:21     ` Ladislav Michl
2016-11-28 15:02       ` Patrick DELAUNAY

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox