mirror of
https://github.com/CTCaer/hekate
synced 2024-12-22 03:11:16 +00:00
bdk: ums: allow real sizes for boot partitions
Since that's eMMC, do not clamp the size to 4MB. That doesn't affect anything other than allowing the host to see the whole physical partition .
This commit is contained in:
parent
927489d2da
commit
a070d2e394
1 changed files with 14 additions and 9 deletions
|
@ -4,7 +4,7 @@
|
||||||
* Copyright (c) 2003-2008 Alan Stern
|
* Copyright (c) 2003-2008 Alan Stern
|
||||||
* Copyright (c) 2009 Samsung Electronics
|
* Copyright (c) 2009 Samsung Electronics
|
||||||
* Author: Michal Nazarewicz <m.nazarewicz@samsung.com>
|
* Author: Michal Nazarewicz <m.nazarewicz@samsung.com>
|
||||||
* Copyright (c) 2019-2023 CTCaer
|
* Copyright (c) 2019-2024 CTCaer
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
* under the terms and conditions of the GNU General Public License,
|
* under the terms and conditions of the GNU General Public License,
|
||||||
|
@ -1842,10 +1842,11 @@ int usb_device_gadget_ums(usb_ctxt_t *usbs)
|
||||||
ums.bulk_ctxt.bulk_out_buf = (u8 *)USB_EP_BULK_OUT_BUF_ADDR;
|
ums.bulk_ctxt.bulk_out_buf = (u8 *)USB_EP_BULK_OUT_BUF_ADDR;
|
||||||
|
|
||||||
// Set LUN parameters.
|
// Set LUN parameters.
|
||||||
ums.lun.ro = usbs->ro;
|
ums.lun.ro = usbs->ro;
|
||||||
ums.lun.type = usbs->type;
|
ums.lun.type = usbs->type;
|
||||||
ums.lun.partition = usbs->partition;
|
ums.lun.partition = usbs->partition;
|
||||||
ums.lun.offset = usbs->offset;
|
ums.lun.num_sectors = usbs->sectors;
|
||||||
|
ums.lun.offset = usbs->offset;
|
||||||
ums.lun.removable = 1; // Always removable to force OSes to use prevent media removal.
|
ums.lun.removable = 1; // Always removable to force OSes to use prevent media removal.
|
||||||
ums.lun.unit_attention_data = SS_RESET_OCCURRED;
|
ums.lun.unit_attention_data = SS_RESET_OCCURRED;
|
||||||
|
|
||||||
|
@ -1898,10 +1899,14 @@ int usb_device_gadget_ums(usb_ctxt_t *usbs)
|
||||||
|
|
||||||
ums.set_text(ums.label, "#C7EA46 Status:# Started UMS");
|
ums.set_text(ums.label, "#C7EA46 Status:# Started UMS");
|
||||||
|
|
||||||
if (usbs->sectors)
|
// If partition sectors are not set get them from hardware.
|
||||||
ums.lun.num_sectors = usbs->sectors;
|
if (!ums.lun.num_sectors)
|
||||||
else
|
{
|
||||||
ums.lun.num_sectors = ums.lun.storage->sec_cnt;
|
if (usbs->type == MMC_EMMC && (ums.lun.partition - 1)) // eMMC BOOT0/1.
|
||||||
|
ums.lun.num_sectors = emmc_storage.ext_csd.boot_mult << 8;
|
||||||
|
else
|
||||||
|
ums.lun.num_sectors = ums.lun.storage->sec_cnt; // eMMC GPP or SD.
|
||||||
|
}
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue