Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions arch/arm64/boot/dts/apple/t6050-k114c.dts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
/* kboot fills the N1's factory addresses from /chosen through these */
wifi0 = &n1_alpha;
bluetooth0 = &n1_beta;
sio = &sio;
};
};

Expand Down Expand Up @@ -388,16 +389,6 @@
};
};

/*
* The MagSafe 3 port's PD controller (ADT hpm5, port-type 0x11). It has no USB data
* path, so it gets no connector node; tipd registers a Type-C port and a power supply
* for it. Its ADT features-supported is <3>, "Power In" only: no liquid detection.
*/
hpm5: usb-pd@8 {
compatible = "apple,sn201202x";
reg = <0x8 SPMI_USID>;
apple,no-liquid-detection;
};
};

&atc1_phy_mbox {
Expand Down Expand Up @@ -581,3 +572,10 @@
<&ps_atc2_cio_usb>, <&ps_atc2_cio_auss>, <&ps_atc2_pcie>;
apple,pcie-tunnel = <&acio2_pcie_tunnel>;
};

/* Keep J716c's unqualified sleep description disabled. */
#include "t6050-j716c-sleep.dtsi"

&hpm5 {
status = "okay";
};
2 changes: 0 additions & 2 deletions drivers/soc/apple/sleep-t6050.h
Original file line number Diff line number Diff line change
Expand Up @@ -3737,7 +3737,6 @@ static const struct apple_sleep_soc t6050_sleep_soc = {
.smc_policy = &t6050_smc_policy,
.early_context = true,
.own_wake = true,
.machine = "apple,j714s",
/* The interrupt mask every SPMI bus has through the sleep, as on T8140 and T8132 */
.spmi_notify_sleep = 0x2000001,
.boot_mpidr = 0x040000,
Expand Down Expand Up @@ -3869,7 +3868,6 @@ static const struct apple_sleep_soc t6050_j716c_sleep_soc = {
.pmp_unstarted = true,
.clusters_down_first = true,
.lower_venc0 = true,
.machine = "apple,j716c",
.spmi_notify_sleep = 0x2000001,
.boot_mpidr = 0x040000,
.cpu_count = 18,
Expand Down
6 changes: 2 additions & 4 deletions drivers/soc/apple/sleep-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ static void apple_sleep_test_unavailable(struct kunit *test)
KUNIT_EXPECT_EQ(test, apple_sleep_profile_validate(&incomplete), -EINVAL);
}

/* The J716c runs the J714s's steps: only its map, inventory, board and PMP differ. */
/* The J716c shares the J714s steps; its map, inventory and PMP differ. */
static void apple_sleep_test_j716c_full(struct kunit *test)
{
const struct apple_sleep_soc *max = &t6050_j716c_sleep_soc, *pro = &t6050_sleep_soc;
Expand All @@ -296,7 +296,6 @@ static void apple_sleep_test_j716c_full(struct kunit *test)
KUNIT_ASSERT_NOT_NULL(test, state);
KUNIT_EXPECT_EQ(test, apple_sleep_profile_validate(max), 0);
KUNIT_EXPECT_PTR_EQ(test, max->unavailable_reason, NULL);
KUNIT_EXPECT_STREQ(test, max->machine, "apple,j716c");
KUNIT_EXPECT_PTR_EQ(test, max->regions, &t6050_j716c_region_profile);
KUNIT_EXPECT_EQ(test, sleep_region_validate(max->regions), 0);
KUNIT_EXPECT_EQ(test, max->regions->ntables, pro->regions->ntables);
Expand Down Expand Up @@ -334,13 +333,12 @@ static void apple_sleep_test_j716c_full(struct kunit *test)
KUNIT_EXPECT_TRUE(test, apple_sleep_t6050_full(state));
}

/* The J714s's profile is as it was: its own map, its inventory, a PMP that runs. */
/* The J714s uses its own map and inventory, with a running PMP. */
static void apple_sleep_test_j714s_unchanged(struct kunit *test)
{
const struct apple_sleep_soc *pro = &t6050_sleep_soc;

KUNIT_EXPECT_PTR_EQ(test, pro->unavailable_reason, NULL);
KUNIT_EXPECT_STREQ(test, pro->machine, "apple,j714s");
KUNIT_EXPECT_PTR_EQ(test, pro->ops, &t6050_sleep_ops);
KUNIT_EXPECT_TRUE(test, pro->ops->map_regs == t6050_sleep_map_regs);
KUNIT_EXPECT_PTR_EQ(test, pro->regions, &t6050_region_profile);
Expand Down
9 changes: 4 additions & 5 deletions drivers/soc/apple/sleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,6 @@ struct apple_sleep_soc {
unsigned int cpu_clusters;
unsigned int cpu_cores_per_cluster;
bool (*cpu_valid)(u64 mpidr);
const char *machine;
u64 boot_mpidr;
unsigned int cpu_count;
struct apple_sleep_domains ps;
Expand Down Expand Up @@ -1893,10 +1892,10 @@ static int apple_sleep_validate_cpu_topology(struct apple_sleep *s)
soc->cpu_cores_per_cluster > 32)
return dev_err_probe(s->dev, -EINVAL, "invalid CPU-start geometry\n");

if (soc->machine && (!of_machine_is_compatible(soc->machine) ||
cpu_logical_map(0) != soc->boot_mpidr ||
num_possible_cpus() != soc->cpu_count))
return dev_err_probe(s->dev, -EINVAL, "unsupported board/CPU inventory\n");
if ((soc->boot_mpidr || soc->cpu_count) &&
(cpu_logical_map(0) != soc->boot_mpidr ||
num_possible_cpus() != soc->cpu_count))
return dev_err_probe(s->dev, -EINVAL, "unsupported CPU inventory\n");

index = of_property_match_string(np, "reg-names", "cpu-start");
if (index < 0)
Expand Down
Loading