Commit Graph

255 Commits

Author SHA1 Message Date
Alex Kiernan 310695f3d2 UPSTREAM: spl: disk: usb: Add dependencies to sprintf/strto*
If SPL serial support is disabled nothing brings in sprintf, snprintf
or simple_strtoul:

  env/built-in.o: In function `regex_callback':
  env/attr.c:128: undefined reference to `sprintf'
  disk/built-in.o: In function `blk_get_device_by_str':
  disk/part.c:386: undefined reference to `simple_strtoul'
  disk/part.c:395: undefined reference to `simple_strtoul'
  disk/built-in.o: In function `blk_get_device_part_str':
  disk/part.c:522: undefined reference to `simple_strtoul'
  disk/built-in.o: In function `part_set_generic_name':
  disk/part.c:704: undefined reference to `sprintf'
  drivers/built-in.o: In function `init_peripheral_ep':
  drivers/usb/musb-new/musb_gadget.c:1826: undefined reference to `sprintf'
  drivers/built-in.o: In function `musb_core_init':
  drivers/usb/musb-new/musb_core.c:1451: undefined reference to `snprintf'

Add those dependencies here.

Change-Id: I3512dc53bc93a556aee250d98d1a5977d9e2a537
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit ab9e12f651d9211aa0d3c9b9e579c38bd8704054)
2020-01-07 17:24:49 +08:00
Joseph Chen bd4d909bda disk: part: auto append android a/b slot suffix when query partition
This patch takes over the responsibility of slot suffix appending from
developer to framework on querying partition, it makes slot suffix
invisible for developers.

Change-Id: I33e1e8f6611232c4797d68b7b844a70db88a3eb8
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-11-04 15:43:46 +08:00
Joseph Chen e6c4e3fbd5 disk: efi: ignore error message when signature is 0
Since the patch "3bdef7e gpt: return 1 directly when test the mbr sector"
always treats partition type as GPT, the error message is always printed
which may make developers miss understand.

Change-Id: I8be6cf5027ff4b61549b83132492d41d2b352ecd
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-10-22 16:42:22 +08:00
Jason Zhu 3bdef7e642 gpt: return 1 directly when test the mbr sector
In sd-update card, we use RKPARM partition in bootloader to load
firmware, and use MS-DOS partition in recovery to update system.
Now, we want to use gpt in bootloader and abandon the RKPARM
partition. So in new sd-update card, we write the MS-DOS partition
table and gpt to sd card. Then we must return 1 directly when test
the mbr sector otherwise the gpt is unavailable.

Change-Id: I994a0cb86e7829c6edadfe357cbf51ad00b65cec
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-09-16 15:30:38 +08:00
Jason Zhu 6e54cbfe00 disk: fix compile error when enable part efi in spl build
TEST:
./make.sh rk3308

CONFIG:
CONFIG_SPL_EFI_PARTITION
CONFIG_SPL_LIBDISK_SUPPORT

Error message:
disk/part_efi.c:1219:11: error: ‘part_test_efi’ undeclared here
(not in a function) .test  = part_test_efi,
disk/part_efi.c:1182:12: error: ‘is_pte_valid’ defined but not
used [-Werror=unused-function] static int is_pte_valid(gpt_entry * pte)
......

Change-Id: I231511eb54d998151aadff68f19db7ee8127f122
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-07-29 15:35:17 +08:00
Joseph Chen 059ed03284 disk: rkparm: fix get partition issue
Without this patch, it always returns the last partition when
"idx" is larger than the last partititon.

Change-Id: I1d126861327c02cab7dd8cc00dd0800651f7da3c
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-25 15:36:34 +08:00
Joseph Chen 6a20f1c71f disk: rkparm: check return value only when do initialization
Change-Id: Id2f9e6a7c5843e5d277a70797c4a3a2768230c14
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-25 08:31:09 +08:00
Jason Zhu 02445819f5 disk: part: support mtd block part
Change-Id: I1f34cca448e007cc734042121a9f31dcea96fc41
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-06-18 18:00:45 +08:00
Jason Zhu e65f23e90c disk: rkparam: fix get disk part size error
The disk part size is defined as number of blocks in partition rather
than bytes.So delete "<< 9".

Change-Id: I4428e5965c6456fcc69fb601d18a97fc48210617
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-04-10 14:43:52 +08:00
Jason Zhu 340f659492 gpt: open repair gpt depend on CONFIG_RKIMG_BOOTLOADER
Change-Id: I80323655e5bd7dc37af7df0693cb0611d7c8402a
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2019-01-09 09:58:09 +08:00
Jason Zhu f70f0bfd86 gpt: repair the gpt table when head or backup gpt table is invalid
There is some gpt table errors when use open source tools to download
gpt table or is destroyed by other procedure.
Such as:
1.Get error storage size.
2.Download the gpt table in the error place.
3.The gpt table is destroyed by other procedure.

So test the gpt table is correct or not firstly. If the gpt table header is
error, update the correct gpt table. If the last partition size error in
the gpt table entry, get the size of current storage by dev_desc and update
the last partition size.

Change-Id: I0ef91a0f8462eca52924d17c5aaefcdae602267d
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
2018-12-24 17:23:14 +08:00
Joseph Chen df2027612e disk: part: add interface to get partition type
Change-Id: I69894f5e4ce03909a8290e941d8808593d027080
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-11-29 20:40:09 +08:00
Joseph Chen c7e2486eb2 disk: rkparam: support get partition info from atags
- for some platform without storage, pre-loader passes partition info by atags.
- search order: mmc/nand -> atags

Change-Id: Ie2699e217999e4772168c96de3b16c084241891e
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-09-17 09:32:28 +08:00
Kever Yang 1b4602e039 gpt: free gpt_pte memory before we get a new one
The memory leak will happen if there is a dev access switch, fix it
by free the memory before we get a new one.

Change-Id: I5d11609ab5b6cc37f2812d901f2427a1c83fd3a4
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-09-11 09:52:20 +08:00
Kever Yang 8fc4f04087 part: rkparm: update message don't print by default
The print "invalid parameter" is confused, make it clear to show this is
a warning from RKPARM partition table.

Change-Id: I1381dd6e60d963f1f233d08c8527495b6ca6101c
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-09-10 11:16:25 +08:00
Joseph Chen 19f6a16924 part: rkparm: add RKPARAM_ENTRY_NUMBERS definition
rkparam shouldn't depends on GPT partition.

Change-Id: Ifc235c4166facadfc2fe0eb6b08ce7fd8850738b
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-08-07 14:30:59 +08:00
Dingqiang Lin 4c0421560d disk: part: add SPI Flash blk_desc print
1.Add SPI Flash blk_desc print;
2.Remove RKSFC print which is unused.

Change-Id: I5ef3b6936dd57cd01490176bc8877159cedadccc
Signed-off-by: Dingqiang Lin <jon.lin@rock-chips.com>
2018-07-31 14:51:32 +08:00
Joseph Chen 8f0cd0fbde disk: rkparm: use env_update_filter() to append cmdline
Change-Id: I4b5024adc4b2d176f1ffa25677323ba17a1d061f
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-07-14 17:23:30 +08:00
Kever Yang f91f3b3427 rockchip: part: rkpram: update size for the last partition
The last partition with size '-' use all remain size.

Change-Id: Id91302d89927ac01c1975c8798c59543314689cd
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-06-13 14:51:20 +08:00
Kever Yang 49f41c7b1e part: efi: fix error pointer for buffer pte
Set to NULL after the pointer is free.

Change-Id: I7fd703984514295bc9e5eea34808e0ac941bdb30
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-06-01 17:39:46 +08:00
Kever Yang bad3fe2d02 part: rkparm: update part table if device change
Do not re-use the partition table for 'mmc 1' from the partition
table of 'mmc 0', update the table if the device number changed.

Change-Id: I03b8509749d079ded6a0e0a87929be21732399fb
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-05-25 17:08:14 +08:00
Dingqiang Lin ae20a02c8e disk: part: add rksfc description print
Change-Id: I61fb8817fba3d4ddf799a17abb504c4e37c796d3
Signed-off-by: Dingqiang Lin <jon.lin@rock-chips.com>
2018-05-11 11:08:38 +08:00
Kever Yang a7de8a5ca7 part: rkparm: fix issue when find the last part
The 'next' will be NULL if next ',' is not found, and access to
'*next' will end with "Synchronous Abort" in 64 bit system because
the memory space is reserved for Trust area.

Change-Id: Id8ee9d6f7815977d7c5996d67a3b72feb74d00cf
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-05-03 10:10:17 +08:00
Kever Yang 877f3f47b5 rockchip: part_rkparm: fix issue when parameter not valid
If the param has no data, the cmdline is NULL, and system get abort:
"Synchronous Abort" handler, esr 0x96000010

Change-Id: Ia52594073287d55a7fd0b35b66d87ffe7f880fea
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-04-27 18:20:53 +08:00
Kever Yang db8cda52f5 part_efi: update part_get_info_efi() to reuse part info
We use part_get_info_by_name to get partition, this will read MBR, GPT
header and GPT entry every time, optimize to read only once.

Change-Id: I4d6c508311f7cc661aa991b3c61460a2b8d63fac
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-02-25 15:11:38 +08:00
Kever Yang f9bf27e6a5 disk: part: add error handle for get partition fail
System may fail to get partition table, return directly in this case.

Change-Id: Ib61f800302aee23fbc362d0d68a5f42ab353a2f0
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-02-10 16:46:16 +08:00
Joseph Chen b7090c0ffd disk: part_rkparm: use env_delete() to delete initrd for cmdline
delete unused "initrd=0x...,0x...", this for compatible
with legacy parameter.txt.

Change-Id: I9eb79578196ae4537b65e57a2776fdf0225de488
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-01-31 18:13:53 +08:00
Joseph Chen 736ece61eb Revert "disk: part_rkparm: add initrd fixup for cmdline"
This reverts commit 8fb96674f6.

Change-Id: I10c3ec88d8f21677cfdee8f766afd9272064964d
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-01-31 18:13:53 +08:00
Joseph Chen 8fb96674f6 disk: part_rkparm: add initrd fixup for cmdline
remove unused "initrd=0x...,0x...", this for compatible
with legacy parameter.txt.

Change-Id: I7d9c5708a6b183479ac5980a90067cff8f0872de
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-01-24 18:17:14 +08:00
Kever Yang 282f89a3b6 rockchip: param: reverve 4MB for emmc
Need to reserver first 4MB for EMMC while use the addr directly for NAND.

Change-Id: I5c6309e41a9c287388cb6c0ff7ba5b1ef9ff29bf
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2018-01-22 17:33:49 +08:00
Maxime Ripard 00ac81b92d UPSTREAM: part: efi: Add default number of partition entries for sunxi
The SPL must be located at 8kB (16 sectors) offset. That's right in the
middle of the GPT, so we need to define a smaller amount of partitions to
accomodate for that location.

Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Change-Id: I7932a388389b15237bed18321606f034a47534a3
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 5dc0256d1210cb38ba11b22a8eb2ccc101460963)
2018-01-17 15:27:28 +08:00
Maxime Ripard 025e2e5af2 UPSTREAM: part: efi: Add a Kconfig option for the number of partition entries
On some SoCs, the SPL needs to be located right in the middle of the GPT
partition entries.

One way to work around that is to create partition entries for a smaller
number of partitions to accomodate with where the SPL will be. Create a
Kconfig option to allow to do that.

Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Change-Id: Ic06f18722c0a835829042540f1f7a4364924624d
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 4ce521977f79a883f9c47984ef675c4b2267b7ad)
2018-01-17 15:27:28 +08:00
Lukasz Majewski 32fba03389 UPSTREAM: gpt: Use cache aligned buffers for gpt_h and gpt_e
Before this patch one could receive following errors when executing
"gpt write" command on machine with cache enabled:

display5 factory > gpt write mmc ${mmcdev} ${partitions}
Writing GPT:
CACHE: Misaligned operation at range [4ef8f7f0, 4ef8f9f0]
CACHE: Misaligned operation at range [4ef8f9f8, 4ef939f8]
CACHE: Misaligned operation at range [4ef8f9f8, 4ef939f8]
CACHE: Misaligned operation at range [4ef8f7f0, 4ef8f9f0]
success!

To alleviate this problem - the calloc()s have been replaced with
malloc_cache_aligned() and memset().

After those changes the buffers are properly aligned (with both start
address and size) to SoC cache line.

Change-Id: I13782d942b327d3941de6446b2cbc49a3d7901dc
Signed-off-by: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit bb021013ba1ea4f7ade55ed932ab9d807e8a09ea)
2018-01-17 15:27:28 +08:00
Patrick Delaunay c326c43cc5 UPSTREAM: disk: efi: correct the overlap check on GPT header and PTE
the partition starting at 0x4400 is refused with overlap error:
  $> gpt write mmc 0 "name=test,start=0x4400,size=0"
  Writing GPT: Partition overlap
  error!

even if the 0x4400 is the first available offset for LBA35 with default
value:
- MBR=LBA1
- GPT header=LBA2
- PTE= 32 LBAs (128 entry), 3 to 34

And the command to have one partition for all the disk failed also :
  $> gpt write mmc 0 "name=test,size=0"

After the patch :

  $> gpt write mmc 0 "name=test,size=0"
  Writing GPT: success!
  $> part list mmc 0

  Partition Map for MMC device 0  --   Partition Type: EFI

  Part	Start LBA	End LBA		Name
	Attributes
	Type GUID
	Partition GUID
  1	0x00000022	0x01ce9fde	"test"
	attrs:	0x0000000000000000
	type:	ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
	type:	data
	guid:	b4b84b8a-04e3-4000-0036-aff5c9c495b1

And 0x22 = 34 LBA => offset = 0x4400 is accepted as expected

Reviewed-by: Łukasz Majewski <lukma@denx.de>
Tested-by: Stephen Warren <swarren@nvidia.com>
Change-Id: I464741a434f02d960083c4e5a3e443cbe8b6f45b
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit ae0e0228e664f31ac3c6093758ddc85b664e2d08)
2018-01-17 15:27:28 +08:00
Alexander Graf 1b659546cc UPSTREAM: iso: Reduce verbosity on test and info calls
The test and info callbacks into the partition callback struct are
used by the "part list" command on the command line. That command
is used by the distro script.

With verb=1 set, "part list" thus throws a lot of warnings about
partitions it can't find when an upper layer searches for partitions.

So let's reduce verbosity to bring it to the same level of noise
as the other partition targets.

Change-Id: I289d3fe2f1d11b18183b834189463578ba5cab90
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit b16339e254371b2823f48186889775b90b044f7e)
2018-01-17 15:27:28 +08:00
Tom Rini 2ed173003d UPSTREAM: part_efi: In is_gpt_valid() check argument validity before allocation
While this goes somewhat against normal coding style we should ensure
that dev_desc is not NULL before we dereference it in allocation of
legacy_mbr.

Change-Id: Ife52a9f595a429aa265c1fed92099295f80458dc
Reported-by: Coverity (CID: 167292)
Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit b351ccf11ae5616bba183aedb2c433b97123be4f)
2018-01-17 15:27:28 +08:00
Masahiro Yamada 90aa625c9a treewide: replace with error() with pr_err()
U-Boot widely uses error() as a bit noisier variant of printf().

This macro causes name conflict with the following line in
include/linux/compiler-gcc.h:

  # define __compiletime_error(message) __attribute__((error(message)))

This prevents us from using __compiletime_error(), and makes it
difficult to fully sync BUILD_BUG macros with Linux.  (Notice
Linux's BUILD_BUG_ON_MSG is implemented by using compiletime_assert().)

Let's convert error() into now treewide-available pr_err().

Done with the help of Coccinelle, excluing tools/ directory.

The semantic patch I used is as follows:

// <smpl>
@@@@
-error
+pr_err
 (...)
// </smpl>

Change-Id: I921807c1770d36a91e692c48ab477558bb2ed0b8
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Re-run Coccinelle]
Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 9b643e312d528f291966c1f30b0d90bf3b1d43dc)
2018-01-17 15:27:28 +08:00
Rob Clark b3800056b1 UPSTREAM: fs: add fs_readdir()
Needed to support efi file protocol.  The fallback.efi loader wants
to be able to read the contents of the /EFI directory to find an OS
to boot.

Modelled after POSIX opendir()/readdir()/closedir().  Unlike the other
fs APIs, this is stateful (ie. state is held in the FS_DIR "directory
stream"), to avoid re-traversing of the directory structure at each
step.  The directory stream must be released with closedir() when it
is no longer needed.

Change-Id: I5a977a73024ff4646fc3c4f7c49993de0b5b6256
Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Łukasz Majewski <lukma@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 4bbcc965f995564870ca02606137e60e873e0a1f)
2018-01-16 18:16:48 +08:00
Peter Jones e9aba36569 UPSTREAM: part: extract MBR signature from partitions
EFI client programs need the signature information from the partition
table to determine the disk a partition is on, so we need to fill that
in here.

Change-Id: I27b62e383a2003e82e5424859bc9574d3b2190a2
Signed-off-by: Peter Jones <pjones@redhat.com>
[separated from efi_loader part, and fixed build-errors for non-
 CONFIG_EFI_PARTITION case]
Signed-off-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit ff98cb90514d9b787ddc097c203ac8db2941efe1)
2018-01-16 18:16:48 +08:00
Joseph Chen 1225f03eaa rockchip: fix blk_dread return value check error
blk_dread returns negtive error code or blocks number
that read successfully.

Change-Id: I0f2afe98cfb64fe8e83a065fa64b91481856f5be
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-12-28 15:23:35 +08:00
Kever Yang 5ecf0ee53b disk: part: use common api to lookup part driver
Do not need to scan disk every time when we get part info
by name.

Change-Id: Id79a3a9065731815567055329a2f7f80b3c8c9d4
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2017-12-14 14:42:09 +08:00
Kever Yang 067b22ddca disk: part: scan the disk if the part_type is unknow
We can get the new part table when we write a new partition table to
a blank disk with this patch, or else we have to reset the board
to get new partition table.

Change-Id: If6688149a4a3ae9d6f5731757a1b5831494a9152
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2017-12-14 14:42:08 +08:00
Kever Yang 82198b5ccd disk: part_rockchip: add new partition type for rockchip parameter
Rockchip parameter parameter is a partition type like cmdline partition,
widely used in rockchip legacy system.

Change-Id: I107748733c4cfed22f3a2ef8716033211eafdf7c
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2017-12-08 18:13:25 +08:00
Weiwen Chen 271551c99a part: efi: add check gpt alternate_lba attribute
Change-Id: I00b4dc9fe0c75ed57110682a3dc0b3fbaa3cbcc7
Signed-off-by: Weiwen Chen <cww@rock-chips.com>
2017-11-20 10:29:57 +08:00
Zhaoyifeng 441217e374 drivers: rknand: add nand flash drivers for Rockchip SoC
This patch add the nand flash support for Rockchip Soc(RK3128, RK3126x,
RK3188, Rk3229 etc).

Change-Id: I35ea09f0714b303b247a97ed13cc6e0e56675a0e
Signed-off-by: Yifeng Zhao <zyf@rock-chips.com>
2017-10-20 08:59:10 +08:00
Bin Meng 337e3b897d part: mac: Suppress the error message after reading ddb
Change to use 'debug' to output the error message if it fails to
read the driver descriptor block.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-09-07 10:44:33 -04:00
Heinrich Schuchardt 5eae466ea1 disk: part: fix typo
%s/Desriptor/Descriptor/g

Fix lines over 80 characters with said typo.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2017-09-03 15:30:32 -04:00
Maxime Ripard 79c5912e8d part: efi: Disable overlap check
The current code checks that no partitions overlap with the GPT partition
table using the offset of the first LBA usable for that partition.

This works fine, unless you have a partition entry that is further away
than it usually is and you want to create partitions in the gap between the
GPT header and the GPT partition entries, for example to reflash a
bootloader that needs to be set there.

Rework the test to something a bit smarter that checks whether a partition
would overlap with either the GPT header or the partition entries, no
matter where it is on the disk.

Partitions that do not have a start LBA specified will still start at the
first LBA usable set in the GPT header, to avoid weird behaviours.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2017-09-03 11:04:51 -04:00
Maxime Ripard 47d7ee47ba part: efi: make gpt_fill_pte take the device descriptor
The gpt_fill_pte will need to access the device block size. Let's pass the
device descriptor as an argument.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2017-09-03 11:04:51 -04:00
Maxime Ripard 5276e8b62d part: efi: rework the partition start and size in gpt_fill_pte
The start variable is only used inside a loop, and is never affected inside
it, so it's a purely local variable.

In the same way the partition size is accessed several times, so we can
store it in a variable.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2017-09-03 11:04:48 -04:00