-
Notifications
You must be signed in to change notification settings - Fork 7
Lemans spinor bringup #132
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
base: qcom-next
Are you sure you want to change the base?
Changes from all commits
71f6390
7573efb
18f6844
264ecc7
633d03e
0016d5a
74d436c
569f39a
2e81d96
7eaa8b9
eaf151b
ab00fc9
2dc4dbb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,7 +36,7 @@ | |
| }; | ||
|
|
||
| &gcc { | ||
| bootph-all; /* Enable GCC for SPL */ | ||
| bootph-all; | ||
| }; | ||
|
|
||
| /* RPMH clock controller - required by GCC */ | ||
|
|
@@ -56,6 +56,13 @@ | |
|
|
||
| &tlmm { | ||
| bootph-all; /* Make TLMM GPIO controller available in SPL */ | ||
|
|
||
| qup_spi21_default: qup-spi21-state { | ||
| pins = "gpio13", "gpio14", "gpio15", "gpio16"; | ||
| function = "sail_top"; | ||
| drive-strength = <2>; | ||
| bias-disable; | ||
| }; | ||
| }; | ||
|
|
||
| /* Enter Qualcomm EDL/download mode via "reset -edl". */ | ||
|
|
@@ -64,3 +71,26 @@ | |
| mode-edl = <0x80000000 0x00000001>; | ||
| }; | ||
| }; | ||
|
|
||
| &{/aliases} { | ||
| spi0 = &spi21; | ||
| }; | ||
|
|
||
| &qupv3_id_3 { | ||
| bootph-all; | ||
| status = "okay"; | ||
| }; | ||
|
|
||
| &spi21 { | ||
| assigned-clocks = <&gcc GCC_QUPV3_WRAP3_S0_CLK>; | ||
| assigned-clock-rates = <48000000>; | ||
| status = "okay"; | ||
|
|
||
| flash@0 { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Community expects these to be in Linux DTS itself. They may not accept. Community goal is to discard the override DT itself and handle stuff minimally using dt fixup |
||
| compatible = "jedec,spi-nor"; | ||
| reg = <0>; | ||
| spi-max-frequency = <48000000>; | ||
| spi-tx-bus-width = <1>; | ||
| spi-rx-bus-width = <1>; | ||
| }; | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -125,6 +125,66 @@ static lbaint_t fb_block_sparse_reserve(struct sparse_storage *info, | |
| return blkcnt; | ||
| } | ||
|
|
||
| /** | ||
| * block_interface_override - runtime-set block interface name, empty if unset | ||
| */ | ||
| static char block_interface_override[16]; | ||
| /** | ||
| * block_device_override - runtime-set block device number, -1 if unset | ||
| */ | ||
| static int block_device_override = -1; | ||
|
|
||
| /** | ||
| * fb_block_interface() - Resolve the block interface name to use | ||
| * | ||
| * Returns the runtime override set via fastboot_block_set_target() if one | ||
| * is active, otherwise falls back to the build-time config default. | ||
| */ | ||
| static const char *fb_block_interface(void) | ||
| { | ||
| if (!IS_ENABLED(CONFIG_FASTBOOT_FLASH_BLOCK)) | ||
| return NULL; | ||
|
|
||
| if (block_interface_override[0]) | ||
| return block_interface_override; | ||
|
|
||
| return config_opt_enabled(CONFIG_FASTBOOT_FLASH_BLOCK, | ||
| CONFIG_FASTBOOT_FLASH_BLOCK_INTERFACE_NAME, NULL); | ||
| } | ||
|
Comment on lines
+144
to
+153
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the |
||
|
|
||
| /** | ||
| * fb_block_device() - Resolve the block device number to use | ||
| * | ||
| * Returns the runtime override set via fastboot_block_set_target() if one | ||
| * is active, otherwise falls back to the build-time config default. | ||
| */ | ||
| static int fb_block_device(void) | ||
| { | ||
| if (!IS_ENABLED(CONFIG_FASTBOOT_FLASH_BLOCK)) | ||
| return -1; | ||
|
|
||
| if (block_device_override >= 0) | ||
| return block_device_override; | ||
|
|
||
| return config_opt_enabled(CONFIG_FASTBOOT_FLASH_BLOCK, | ||
| CONFIG_FASTBOOT_FLASH_BLOCK_DEVICE_ID, -1); | ||
| } | ||
|
Comment on lines
+162
to
+171
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the |
||
|
|
||
| int fastboot_block_set_target(const char *interface, int device) | ||
| { | ||
| if (interface) { | ||
| if (strlen(interface) >= sizeof(block_interface_override)) | ||
| return -EINVAL; | ||
| strlcpy(block_interface_override, interface, | ||
| sizeof(block_interface_override)); | ||
| } | ||
|
|
||
| if (device >= 0) | ||
| block_device_override = device; | ||
|
|
||
| return 0; | ||
| } | ||
|
|
||
| /** | ||
| * parse_device_partition() - Parse and validate device:partition format | ||
| * @part_name: Input string in format "N:partition" or "partition" | ||
|
|
@@ -140,8 +200,7 @@ static int parse_device_partition(const char *part_name, int *device, | |
| { | ||
| const char *colon_pos; | ||
|
|
||
| *device = config_opt_enabled(CONFIG_FASTBOOT_FLASH_BLOCK, | ||
| CONFIG_FASTBOOT_FLASH_BLOCK_DEVICE_ID, -1); | ||
| *device = fb_block_device(); | ||
|
|
||
| /* Check for colon in partition name */ | ||
| colon_pos = strchr(part_name, ':'); | ||
|
|
@@ -190,9 +249,7 @@ int fastboot_block_get_part_info(const char *part_name, | |
| char *response) | ||
| { | ||
| int ret; | ||
| const char *interface = config_opt_enabled(CONFIG_FASTBOOT_FLASH_BLOCK, | ||
| CONFIG_FASTBOOT_FLASH_BLOCK_INTERFACE_NAME, | ||
| NULL); | ||
| const char *interface = fb_block_interface(); | ||
| int device; | ||
| const char *partition_name; | ||
|
|
||
|
|
@@ -385,9 +442,7 @@ void fastboot_block_flash_write(const char *part_name, void *download_buffer, | |
| #if CONFIG_IS_ENABLED(EFI_PARTITION) | ||
| if (is_partition_table_name(part_name, CONFIG_FASTBOOT_GPT_NAME)) { | ||
| int device; | ||
| const char *interface = config_opt_enabled(CONFIG_FASTBOOT_FLASH_BLOCK, | ||
| CONFIG_FASTBOOT_FLASH_BLOCK_INTERFACE_NAME, | ||
| NULL); | ||
| const char *interface = fb_block_interface(); | ||
|
|
||
| parse_device_partition(part_name, &device, NULL); | ||
| fastboot_flash_gpt_partition_table(interface, device, | ||
|
|
@@ -399,9 +454,7 @@ void fastboot_block_flash_write(const char *part_name, void *download_buffer, | |
| #if CONFIG_IS_ENABLED(DOS_PARTITION) | ||
| if (is_partition_table_name(part_name, CONFIG_FASTBOOT_MBR_NAME)) { | ||
| int device; | ||
| const char *interface = config_opt_enabled(CONFIG_FASTBOOT_FLASH_BLOCK, | ||
| CONFIG_FASTBOOT_FLASH_BLOCK_INTERFACE_NAME, | ||
| NULL); | ||
| const char *interface = fb_block_interface(); | ||
|
|
||
| parse_device_partition(part_name, &device, NULL); | ||
| fastboot_flash_mbr_partition_table(interface, device, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Community expects these to be in Linux DTS itself. They may not accept. Community goal is to discard the override DT itself and handle stuff minimally using dt fixup