-
-
Notifications
You must be signed in to change notification settings - Fork 273
kboot_atc: Add t8122 tunables #555
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -100,6 +100,48 @@ static const struct adt_tunable_info atc_tunables[] = { | |
| {"tunable_CIO_LN1_AUSPMA_RX_EQ", "apple,tunable-lane1-cio", 0x11000, 0x1000, true}, | ||
| }; | ||
|
|
||
| static const struct adt_tunable_info atc_tunables_t8122[] = { | ||
| {"tunable_ATC0AXI2AF", "apple,tunable-axi2af", 0x0, 0x4000, true}, | ||
| {"tunable_ATC_FABRIC", "apple,tunable-common-b", 0x44000, 0x4000, true}, | ||
|
|
||
| {"tunable_CIO3PLL_CORE", "apple,tunable-common-b", 0x2a00, 0x200, true}, | ||
| {"tunable_CIO3PLL_TOP", "apple,tunable-common-b", 0x2800, 0x200, true}, | ||
| {"tunable_ACIOPHY_LANE_USBC0", "apple,tunable-common-b", 0x5000, 0x1000, true}, | ||
| {"tunable_ACIOPHY_PLL_TOP", "apple,tunable-common-b", 0x1000, 0x4000, true}, | ||
| {"tunable_ACIOPHY_TOP", "apple,tunable-common-b", 0x0, 0x4000, true}, | ||
|
|
||
| {"tunable_AUSCMN_DIG", "apple,tunable-common-b", 0x800, 0x200, true}, | ||
| {"tunable_AUSPLL_CORE", "apple,tunable-common-b", 0x2200, 0x4000, true}, | ||
| //{"tunable_AUX_SHM", "apple,tunable-common-b", 0x0, 0x0, true}, // TODO: offset? | ||
| {"tunable_AUX_TOP", "apple,tunable-common-b", 0x16000, 0x4000, true}, | ||
| {"tunable_AUSCMN_SHM", "apple,tunable-common-b", 0xa00, 0x200, true}, | ||
| {"tunable_CLKMON_CFG", "apple,tunable-common-b", 0x2600, 0x100, false}, | ||
|
|
||
| {"tunable_LN0_RX_TOP_USB_DFLT", "apple,tunable-lane0-usb", 0x9000, 0x1000, true}, | ||
| //{"tunable_LN0_RX_TOP_USB_EQA", "apple,tunable-lane0-usb", 0x0, 0x1000, true}, // TODO: offset? | ||
| {"tunable_LN0_RX_EQ_USB_EQA", "apple,tunable-lane0-usb", 0xa000, 0x1000, true}, | ||
| {"tunable_LN0_RX_SHM_USB_DFLT", "apple,tunable-lane0-usb", 0xb000, 0x1000, true}, | ||
| {"tunable_LN0_TX_TOP_USB_DFLT", "apple,tunable-lane0-usb", 0xc000, 0x1000, true}, | ||
| {"tunable_LN0_TX_SHM_USB_DFLT", "apple,tunable-lane0-usb", 0xd000, 0x1000, true}, | ||
| {"tunable_LN0_RX_TOP_CIO_DFLT", "apple,tunable-lane0-cio", 0x9000, 0x1000, true}, | ||
| {"tunable_LN0_RX_EQ_CIO_EQA", "apple,tunable-lane0-cio", 0xa000, 0x1000, true}, | ||
| {"tunable_LN0_RX_SHM_CIO_DFLT", "apple,tunable-lane0-cio", 0xb000, 0x1000, true}, | ||
| {"tunable_LN0_TX_TOP_CIO_DFLT", "apple,tunable-lane0-cio", 0xc000, 0x1000, true}, | ||
| {"tunable_LN0_TX_SHM_CIO_DFLT", "apple,tunable-lane0-cio", 0xd000, 0x1000, true}, | ||
|
|
||
| {"tunable_LN1_RX_TOP_USB_DFLT", "apple,tunable-lane1-usb", 0x10000, 0x1000, true}, | ||
| //{"tunable_LN1_RX_TOP_USB_EQA", "apple,tunable-lane1-usb", 0x0, 0x1000, true}, // TODO: offset? | ||
| {"tunable_LN1_RX_EQ_USB_EQA", "apple,tunable-lane1-usb", 0x11000, 0x1000, true}, | ||
| {"tunable_LN1_RX_SHM_USB_DFLT", "apple,tunable-lane1-usb", 0x12000, 0x1000, true}, | ||
| {"tunable_LN1_TX_TOP_USB_DFLT", "apple,tunable-lane1-usb", 0x13000, 0x1000, true}, | ||
| {"tunable_LN1_TX_SHM_USB_DFLT", "apple,tunable-lane1-usb", 0x14000, 0x1000, true}, | ||
| {"tunable_LN1_RX_TOP_CIO_DFLT", "apple,tunable-lane1-cio", 0x10000, 0x1000, true}, | ||
| {"tunable_LN1_RX_EQ_CIO_EQA", "apple,tunable-lane1-cio", 0x11000, 0x1000, true}, | ||
| {"tunable_LN1_RX_SHM_CIO_DFLT", "apple,tunable-lane1-cio", 0x12000, 0x1000, true}, | ||
| {"tunable_LN1_TX_TOP_CIO_DFLT", "apple,tunable-lane1-cio", 0x13000, 0x1000, true}, | ||
| {"tunable_LN1_TX_SHM_CIO_DFLT", "apple,tunable-lane1-cio", 0x14000, 0x1000, true}, | ||
| }; | ||
|
|
||
| static const struct atc_fuse_info atc_fuses_t8103_port0[] = { | ||
| {0x23d2bc434, 9, 6, CIO3PLL_DCO_NCTRL, CIO3PLL_DCO_COARSEBIN_EFUSE0}, | ||
| {0x23d2bc434, 15, 6, CIO3PLL_DCO_NCTRL, CIO3PLL_DCO_COARSEBIN_EFUSE1}, | ||
|
|
@@ -235,6 +277,7 @@ static const struct atc_fuse_info atc_fuses_t8112_port1[] = { | |
| // Order "atc-phy" compatibles in reverse chronologically order to deal with mutliple compatible | ||
| // strings in ADT atc-phy nodes. | ||
| static const struct atc_fuse_hw atc_fuses[] = { | ||
| {"atc-phy,t8122", -1, NULL, 0}, | ||
| {"atc-phy,t6020", -1, NULL, 0}, | ||
| {"atc-phy,t8112", 0, atc_fuses_t8112_port0, ARRAY_SIZE(atc_fuses_t8112_port0)}, | ||
| {"atc-phy,t8112", 1, atc_fuses_t8112_port1, ARRAY_SIZE(atc_fuses_t8112_port1)}, | ||
|
|
@@ -374,6 +417,8 @@ static int dt_append_atc_tunable(void *dt, int adt_node, int fdt_node, | |
| static void dt_copy_atc_tunables(void *dt, const char *adt_path, const char *dt_alias, int port) | ||
| { | ||
| int ret; | ||
| const struct adt_tunable_info *tunables; | ||
| size_t tunable_count; | ||
|
|
||
| int adt_node = adt_path_offset(adt, adt_path); | ||
| if (adt_node < 0) | ||
|
|
@@ -398,8 +443,16 @@ static void dt_copy_atc_tunables(void *dt, const char *adt_path, const char *dt_ | |
| goto cleanup; | ||
| } | ||
|
|
||
| for (size_t i = 0; i < sizeof(atc_tunables) / sizeof(*atc_tunables); ++i) { | ||
| ret = dt_append_atc_tunable(dt, adt_node, fdt_node, &atc_tunables[i]); | ||
| if (adt_is_compatible_at(adt, adt_node, "atc-phy,t8122", 0)) { | ||
| tunables = &atc_tunables_t8122[0]; | ||
| tunable_count = sizeof(atc_tunables_t8122) / sizeof(*atc_tunables_t8122); | ||
|
Member
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. nit: this could use |
||
| } else { | ||
| tunables = &atc_tunables[0]; | ||
| tunable_count = sizeof(atc_tunables) / sizeof(*atc_tunables); | ||
| } | ||
|
|
||
| for (size_t i = 0; i < tunable_count; ++i) { | ||
| ret = dt_append_atc_tunable(dt, adt_node, fdt_node, &tunables[i]); | ||
| if (ret) | ||
| goto cleanup; | ||
| } | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I wonder if we want to copy the approach for
atc_fusesbut I guess we can still refactor once we add support for t603x or t814x. One possible issue is that the DT compaitbles probably won't allow this.