Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PM / devfreq: rockchip-dfi: Add perf support

The DFI is a unit which is suitable for measuring DDR utilization, but
so far it could only be used as an event driver for the DDR frequency
scaling driver. This adds perf support to the DFI driver.

Usage with the 'perf' tool can look like:

perf stat -a -e rockchip_ddr/cycles/,\
rockchip_ddr/read-bytes/,\
rockchip_ddr/write-bytes/,\
rockchip_ddr/bytes/ sleep 1

Performance counter stats for 'system wide':

1582524826 rockchip_ddr/cycles/
1802.25 MB rockchip_ddr/read-bytes/
1793.72 MB rockchip_ddr/write-bytes/
3595.90 MB rockchip_ddr/bytes/

1.014369709 seconds time elapsed

perf support has been tested on a RK3568 and a RK3399, the latter with
dual channel DDR.

Link: https://lore.kernel.org/all/20231019064819.3496740-1-s.hauer@pengutronix.de/
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
[cw00.choi: Fix typo from 'write_acccess' to 'write_access']
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>

authored by

Sascha Hauer and committed by
Chanwoo Choi
4d586b57 2785cc00

+438 -5
+435 -5
drivers/devfreq/event/rockchip-dfi.c
··· 16 16 #include <linux/regmap.h> 17 17 #include <linux/slab.h> 18 18 #include <linux/list.h> 19 + #include <linux/seqlock.h> 19 20 #include <linux/of.h> 20 21 #include <linux/of_device.h> 21 22 #include <linux/bitfield.h> 22 23 #include <linux/bits.h> 24 + #include <linux/perf_event.h> 23 25 24 26 #include <soc/rockchip/rockchip_grf.h> 25 27 #include <soc/rockchip/rk3399_grf.h> ··· 43 41 DDRMON_CTRL_LPDDR4 | \ 44 42 DDRMON_CTRL_LPDDR23) 45 43 44 + #define DDRMON_CH0_WR_NUM 0x20 45 + #define DDRMON_CH0_RD_NUM 0x24 46 46 #define DDRMON_CH0_COUNT_NUM 0x28 47 47 #define DDRMON_CH0_DFI_ACCESS_NUM 0x2c 48 48 #define DDRMON_CH1_COUNT_NUM 0x3c 49 49 #define DDRMON_CH1_DFI_ACCESS_NUM 0x40 50 50 51 + #define PERF_EVENT_CYCLES 0x0 52 + #define PERF_EVENT_READ_BYTES 0x1 53 + #define PERF_EVENT_WRITE_BYTES 0x2 54 + #define PERF_EVENT_READ_BYTES0 0x3 55 + #define PERF_EVENT_WRITE_BYTES0 0x4 56 + #define PERF_EVENT_READ_BYTES1 0x5 57 + #define PERF_EVENT_WRITE_BYTES1 0x6 58 + #define PERF_EVENT_READ_BYTES2 0x7 59 + #define PERF_EVENT_WRITE_BYTES2 0x8 60 + #define PERF_EVENT_READ_BYTES3 0x9 61 + #define PERF_EVENT_WRITE_BYTES3 0xa 62 + #define PERF_EVENT_BYTES 0xb 63 + #define PERF_ACCESS_TYPE_MAX 0xc 64 + 51 65 /** 52 66 * struct dmc_count_channel - structure to hold counter values from the DDR controller 53 67 * @access: Number of read and write accesses 54 68 * @clock_cycles: DDR clock cycles 69 + * @read_access: number of read accesses 70 + * @write_access: number of write accesses 55 71 */ 56 72 struct dmc_count_channel { 57 - u32 access; 58 - u32 clock_cycles; 73 + u64 access; 74 + u64 clock_cycles; 75 + u64 read_access; 76 + u64 write_access; 59 77 }; 60 78 61 79 struct dmc_count { ··· 91 69 struct devfreq_event_dev *edev; 92 70 struct devfreq_event_desc desc; 93 71 struct dmc_count last_event_count; 72 + 73 + struct dmc_count last_perf_count; 74 + struct dmc_count total_count; 75 + seqlock_t count_seqlock; /* protects last_perf_count and total_count */ 76 + 94 77 struct device *dev; 95 78 void __iomem *regs; 96 79 struct regmap *regmap_pmu; ··· 105 78 u32 ddr_type; 106 79 unsigned int channel_mask; 107 80 unsigned int max_channels; 81 + enum cpuhp_state cpuhp_state; 82 + struct hlist_node node; 83 + struct pmu pmu; 84 + struct hrtimer timer; 85 + unsigned int cpu; 86 + int active_events; 87 + int burst_len; 88 + int buswidth[DMC_MAX_CHANNELS]; 108 89 }; 109 90 110 91 static int rockchip_dfi_enable(struct rockchip_dfi *dfi) ··· 181 146 mutex_unlock(&dfi->mutex); 182 147 } 183 148 184 - static void rockchip_dfi_read_counters(struct rockchip_dfi *dfi, struct dmc_count *count) 149 + static void rockchip_dfi_read_counters(struct rockchip_dfi *dfi, struct dmc_count *res) 185 150 { 186 151 u32 i; 187 152 void __iomem *dfi_regs = dfi->regs; ··· 189 154 for (i = 0; i < dfi->max_channels; i++) { 190 155 if (!(dfi->channel_mask & BIT(i))) 191 156 continue; 192 - count->c[i].access = readl_relaxed(dfi_regs + 157 + res->c[i].read_access = readl_relaxed(dfi_regs + 158 + DDRMON_CH0_RD_NUM + i * 20); 159 + res->c[i].write_access = readl_relaxed(dfi_regs + 160 + DDRMON_CH0_WR_NUM + i * 20); 161 + res->c[i].access = readl_relaxed(dfi_regs + 193 162 DDRMON_CH0_DFI_ACCESS_NUM + i * 20); 194 - count->c[i].clock_cycles = readl_relaxed(dfi_regs + 163 + res->c[i].clock_cycles = readl_relaxed(dfi_regs + 195 164 DDRMON_CH0_COUNT_NUM + i * 20); 196 165 } 197 166 } ··· 263 224 .set_event = rockchip_dfi_set_event, 264 225 }; 265 226 227 + #ifdef CONFIG_PERF_EVENTS 228 + 229 + static void rockchip_ddr_perf_counters_add(struct rockchip_dfi *dfi, 230 + const struct dmc_count *now, 231 + struct dmc_count *res) 232 + { 233 + const struct dmc_count *last = &dfi->last_perf_count; 234 + int i; 235 + 236 + for (i = 0; i < dfi->max_channels; i++) { 237 + res->c[i].read_access = dfi->total_count.c[i].read_access + 238 + (u32)(now->c[i].read_access - last->c[i].read_access); 239 + res->c[i].write_access = dfi->total_count.c[i].write_access + 240 + (u32)(now->c[i].write_access - last->c[i].write_access); 241 + res->c[i].access = dfi->total_count.c[i].access + 242 + (u32)(now->c[i].access - last->c[i].access); 243 + res->c[i].clock_cycles = dfi->total_count.c[i].clock_cycles + 244 + (u32)(now->c[i].clock_cycles - last->c[i].clock_cycles); 245 + } 246 + } 247 + 248 + static ssize_t ddr_perf_cpumask_show(struct device *dev, 249 + struct device_attribute *attr, char *buf) 250 + { 251 + struct pmu *pmu = dev_get_drvdata(dev); 252 + struct rockchip_dfi *dfi = container_of(pmu, struct rockchip_dfi, pmu); 253 + 254 + return cpumap_print_to_pagebuf(true, buf, cpumask_of(dfi->cpu)); 255 + } 256 + 257 + static struct device_attribute ddr_perf_cpumask_attr = 258 + __ATTR(cpumask, 0444, ddr_perf_cpumask_show, NULL); 259 + 260 + static struct attribute *ddr_perf_cpumask_attrs[] = { 261 + &ddr_perf_cpumask_attr.attr, 262 + NULL, 263 + }; 264 + 265 + static const struct attribute_group ddr_perf_cpumask_attr_group = { 266 + .attrs = ddr_perf_cpumask_attrs, 267 + }; 268 + 269 + PMU_EVENT_ATTR_STRING(cycles, ddr_pmu_cycles, "event="__stringify(PERF_EVENT_CYCLES)) 270 + 271 + #define DFI_PMU_EVENT_ATTR(_name, _var, _str) \ 272 + PMU_EVENT_ATTR_STRING(_name, _var, _str); \ 273 + PMU_EVENT_ATTR_STRING(_name.unit, _var##_unit, "MB"); \ 274 + PMU_EVENT_ATTR_STRING(_name.scale, _var##_scale, "9.536743164e-07") 275 + 276 + DFI_PMU_EVENT_ATTR(read-bytes0, ddr_pmu_read_bytes0, "event="__stringify(PERF_EVENT_READ_BYTES0)); 277 + DFI_PMU_EVENT_ATTR(write-bytes0, ddr_pmu_write_bytes0, "event="__stringify(PERF_EVENT_WRITE_BYTES0)); 278 + 279 + DFI_PMU_EVENT_ATTR(read-bytes1, ddr_pmu_read_bytes1, "event="__stringify(PERF_EVENT_READ_BYTES1)); 280 + DFI_PMU_EVENT_ATTR(write-bytes1, ddr_pmu_write_bytes1, "event="__stringify(PERF_EVENT_WRITE_BYTES1)); 281 + 282 + DFI_PMU_EVENT_ATTR(read-bytes2, ddr_pmu_read_bytes2, "event="__stringify(PERF_EVENT_READ_BYTES2)); 283 + DFI_PMU_EVENT_ATTR(write-bytes2, ddr_pmu_write_bytes2, "event="__stringify(PERF_EVENT_WRITE_BYTES2)); 284 + 285 + DFI_PMU_EVENT_ATTR(read-bytes3, ddr_pmu_read_bytes3, "event="__stringify(PERF_EVENT_READ_BYTES3)); 286 + DFI_PMU_EVENT_ATTR(write-bytes3, ddr_pmu_write_bytes3, "event="__stringify(PERF_EVENT_WRITE_BYTES3)); 287 + 288 + DFI_PMU_EVENT_ATTR(read-bytes, ddr_pmu_read_bytes, "event="__stringify(PERF_EVENT_READ_BYTES)); 289 + DFI_PMU_EVENT_ATTR(write-bytes, ddr_pmu_write_bytes, "event="__stringify(PERF_EVENT_WRITE_BYTES)); 290 + 291 + DFI_PMU_EVENT_ATTR(bytes, ddr_pmu_bytes, "event="__stringify(PERF_EVENT_BYTES)); 292 + 293 + #define DFI_ATTR_MB(_name) \ 294 + &_name.attr.attr, \ 295 + &_name##_unit.attr.attr, \ 296 + &_name##_scale.attr.attr 297 + 298 + static struct attribute *ddr_perf_events_attrs[] = { 299 + &ddr_pmu_cycles.attr.attr, 300 + DFI_ATTR_MB(ddr_pmu_read_bytes), 301 + DFI_ATTR_MB(ddr_pmu_write_bytes), 302 + DFI_ATTR_MB(ddr_pmu_read_bytes0), 303 + DFI_ATTR_MB(ddr_pmu_write_bytes0), 304 + DFI_ATTR_MB(ddr_pmu_read_bytes1), 305 + DFI_ATTR_MB(ddr_pmu_write_bytes1), 306 + DFI_ATTR_MB(ddr_pmu_read_bytes2), 307 + DFI_ATTR_MB(ddr_pmu_write_bytes2), 308 + DFI_ATTR_MB(ddr_pmu_read_bytes3), 309 + DFI_ATTR_MB(ddr_pmu_write_bytes3), 310 + DFI_ATTR_MB(ddr_pmu_bytes), 311 + NULL, 312 + }; 313 + 314 + static const struct attribute_group ddr_perf_events_attr_group = { 315 + .name = "events", 316 + .attrs = ddr_perf_events_attrs, 317 + }; 318 + 319 + PMU_FORMAT_ATTR(event, "config:0-7"); 320 + 321 + static struct attribute *ddr_perf_format_attrs[] = { 322 + &format_attr_event.attr, 323 + NULL, 324 + }; 325 + 326 + static const struct attribute_group ddr_perf_format_attr_group = { 327 + .name = "format", 328 + .attrs = ddr_perf_format_attrs, 329 + }; 330 + 331 + static const struct attribute_group *attr_groups[] = { 332 + &ddr_perf_events_attr_group, 333 + &ddr_perf_cpumask_attr_group, 334 + &ddr_perf_format_attr_group, 335 + NULL, 336 + }; 337 + 338 + static int rockchip_ddr_perf_event_init(struct perf_event *event) 339 + { 340 + struct rockchip_dfi *dfi = container_of(event->pmu, struct rockchip_dfi, pmu); 341 + 342 + if (event->attr.type != event->pmu->type) 343 + return -ENOENT; 344 + 345 + if (event->attach_state & PERF_ATTACH_TASK) 346 + return -EINVAL; 347 + 348 + if (event->cpu < 0) { 349 + dev_warn(dfi->dev, "Can't provide per-task data!\n"); 350 + return -EINVAL; 351 + } 352 + 353 + return 0; 354 + } 355 + 356 + static u64 rockchip_ddr_perf_event_get_count(struct perf_event *event) 357 + { 358 + struct rockchip_dfi *dfi = container_of(event->pmu, struct rockchip_dfi, pmu); 359 + int blen = dfi->burst_len; 360 + struct dmc_count total, now; 361 + unsigned int seq; 362 + u64 count = 0; 363 + int i; 364 + 365 + rockchip_dfi_read_counters(dfi, &now); 366 + 367 + do { 368 + seq = read_seqbegin(&dfi->count_seqlock); 369 + rockchip_ddr_perf_counters_add(dfi, &now, &total); 370 + } while (read_seqretry(&dfi->count_seqlock, seq)); 371 + 372 + switch (event->attr.config) { 373 + case PERF_EVENT_CYCLES: 374 + count = total.c[0].clock_cycles; 375 + break; 376 + case PERF_EVENT_READ_BYTES: 377 + for (i = 0; i < dfi->max_channels; i++) 378 + count += total.c[i].read_access * blen * dfi->buswidth[i]; 379 + break; 380 + case PERF_EVENT_WRITE_BYTES: 381 + for (i = 0; i < dfi->max_channels; i++) 382 + count += total.c[i].write_access * blen * dfi->buswidth[i]; 383 + break; 384 + case PERF_EVENT_READ_BYTES0: 385 + count = total.c[0].read_access * blen * dfi->buswidth[0]; 386 + break; 387 + case PERF_EVENT_WRITE_BYTES0: 388 + count = total.c[0].write_access * blen * dfi->buswidth[0]; 389 + break; 390 + case PERF_EVENT_READ_BYTES1: 391 + count = total.c[1].read_access * blen * dfi->buswidth[1]; 392 + break; 393 + case PERF_EVENT_WRITE_BYTES1: 394 + count = total.c[1].write_access * blen * dfi->buswidth[1]; 395 + break; 396 + case PERF_EVENT_READ_BYTES2: 397 + count = total.c[2].read_access * blen * dfi->buswidth[2]; 398 + break; 399 + case PERF_EVENT_WRITE_BYTES2: 400 + count = total.c[2].write_access * blen * dfi->buswidth[2]; 401 + break; 402 + case PERF_EVENT_READ_BYTES3: 403 + count = total.c[3].read_access * blen * dfi->buswidth[3]; 404 + break; 405 + case PERF_EVENT_WRITE_BYTES3: 406 + count = total.c[3].write_access * blen * dfi->buswidth[3]; 407 + break; 408 + case PERF_EVENT_BYTES: 409 + for (i = 0; i < dfi->max_channels; i++) 410 + count += total.c[i].access * blen * dfi->buswidth[i]; 411 + break; 412 + } 413 + 414 + return count; 415 + } 416 + 417 + static void rockchip_ddr_perf_event_update(struct perf_event *event) 418 + { 419 + u64 now; 420 + s64 prev; 421 + 422 + if (event->attr.config >= PERF_ACCESS_TYPE_MAX) 423 + return; 424 + 425 + now = rockchip_ddr_perf_event_get_count(event); 426 + prev = local64_xchg(&event->hw.prev_count, now); 427 + local64_add(now - prev, &event->count); 428 + } 429 + 430 + static void rockchip_ddr_perf_event_start(struct perf_event *event, int flags) 431 + { 432 + u64 now = rockchip_ddr_perf_event_get_count(event); 433 + 434 + local64_set(&event->hw.prev_count, now); 435 + } 436 + 437 + static int rockchip_ddr_perf_event_add(struct perf_event *event, int flags) 438 + { 439 + struct rockchip_dfi *dfi = container_of(event->pmu, struct rockchip_dfi, pmu); 440 + 441 + dfi->active_events++; 442 + 443 + if (dfi->active_events == 1) { 444 + dfi->total_count = (struct dmc_count){}; 445 + rockchip_dfi_read_counters(dfi, &dfi->last_perf_count); 446 + hrtimer_start(&dfi->timer, ns_to_ktime(NSEC_PER_SEC), HRTIMER_MODE_REL); 447 + } 448 + 449 + if (flags & PERF_EF_START) 450 + rockchip_ddr_perf_event_start(event, flags); 451 + 452 + return 0; 453 + } 454 + 455 + static void rockchip_ddr_perf_event_stop(struct perf_event *event, int flags) 456 + { 457 + rockchip_ddr_perf_event_update(event); 458 + } 459 + 460 + static void rockchip_ddr_perf_event_del(struct perf_event *event, int flags) 461 + { 462 + struct rockchip_dfi *dfi = container_of(event->pmu, struct rockchip_dfi, pmu); 463 + 464 + rockchip_ddr_perf_event_stop(event, PERF_EF_UPDATE); 465 + 466 + dfi->active_events--; 467 + 468 + if (dfi->active_events == 0) 469 + hrtimer_cancel(&dfi->timer); 470 + } 471 + 472 + static enum hrtimer_restart rockchip_dfi_timer(struct hrtimer *timer) 473 + { 474 + struct rockchip_dfi *dfi = container_of(timer, struct rockchip_dfi, timer); 475 + struct dmc_count now, total; 476 + 477 + rockchip_dfi_read_counters(dfi, &now); 478 + 479 + write_seqlock(&dfi->count_seqlock); 480 + 481 + rockchip_ddr_perf_counters_add(dfi, &now, &total); 482 + dfi->total_count = total; 483 + dfi->last_perf_count = now; 484 + 485 + write_sequnlock(&dfi->count_seqlock); 486 + 487 + hrtimer_forward_now(&dfi->timer, ns_to_ktime(NSEC_PER_SEC)); 488 + 489 + return HRTIMER_RESTART; 490 + }; 491 + 492 + static int ddr_perf_offline_cpu(unsigned int cpu, struct hlist_node *node) 493 + { 494 + struct rockchip_dfi *dfi = hlist_entry_safe(node, struct rockchip_dfi, node); 495 + int target; 496 + 497 + if (cpu != dfi->cpu) 498 + return 0; 499 + 500 + target = cpumask_any_but(cpu_online_mask, cpu); 501 + if (target >= nr_cpu_ids) 502 + return 0; 503 + 504 + perf_pmu_migrate_context(&dfi->pmu, cpu, target); 505 + dfi->cpu = target; 506 + 507 + return 0; 508 + } 509 + 510 + static void rockchip_ddr_cpuhp_remove_state(void *data) 511 + { 512 + struct rockchip_dfi *dfi = data; 513 + 514 + cpuhp_remove_multi_state(dfi->cpuhp_state); 515 + 516 + rockchip_dfi_disable(dfi); 517 + } 518 + 519 + static void rockchip_ddr_cpuhp_remove_instance(void *data) 520 + { 521 + struct rockchip_dfi *dfi = data; 522 + 523 + cpuhp_state_remove_instance_nocalls(dfi->cpuhp_state, &dfi->node); 524 + } 525 + 526 + static void rockchip_ddr_perf_remove(void *data) 527 + { 528 + struct rockchip_dfi *dfi = data; 529 + 530 + perf_pmu_unregister(&dfi->pmu); 531 + } 532 + 533 + static int rockchip_ddr_perf_init(struct rockchip_dfi *dfi) 534 + { 535 + struct pmu *pmu = &dfi->pmu; 536 + int ret; 537 + 538 + seqlock_init(&dfi->count_seqlock); 539 + 540 + pmu->module = THIS_MODULE; 541 + pmu->capabilities = PERF_PMU_CAP_NO_EXCLUDE; 542 + pmu->task_ctx_nr = perf_invalid_context; 543 + pmu->attr_groups = attr_groups; 544 + pmu->event_init = rockchip_ddr_perf_event_init; 545 + pmu->add = rockchip_ddr_perf_event_add; 546 + pmu->del = rockchip_ddr_perf_event_del; 547 + pmu->start = rockchip_ddr_perf_event_start; 548 + pmu->stop = rockchip_ddr_perf_event_stop; 549 + pmu->read = rockchip_ddr_perf_event_update; 550 + 551 + dfi->cpu = raw_smp_processor_id(); 552 + 553 + ret = cpuhp_setup_state_multi(CPUHP_AP_ONLINE_DYN, 554 + "rockchip_ddr_perf_pmu", 555 + NULL, 556 + ddr_perf_offline_cpu); 557 + 558 + if (ret < 0) { 559 + dev_err(dfi->dev, "cpuhp_setup_state_multi failed: %d\n", ret); 560 + return ret; 561 + } 562 + 563 + dfi->cpuhp_state = ret; 564 + 565 + rockchip_dfi_enable(dfi); 566 + 567 + ret = devm_add_action_or_reset(dfi->dev, rockchip_ddr_cpuhp_remove_state, dfi); 568 + if (ret) 569 + return ret; 570 + 571 + ret = cpuhp_state_add_instance_nocalls(dfi->cpuhp_state, &dfi->node); 572 + if (ret) { 573 + dev_err(dfi->dev, "Error %d registering hotplug\n", ret); 574 + return ret; 575 + } 576 + 577 + ret = devm_add_action_or_reset(dfi->dev, rockchip_ddr_cpuhp_remove_instance, dfi); 578 + if (ret) 579 + return ret; 580 + 581 + hrtimer_init(&dfi->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 582 + dfi->timer.function = rockchip_dfi_timer; 583 + 584 + switch (dfi->ddr_type) { 585 + case ROCKCHIP_DDRTYPE_LPDDR2: 586 + case ROCKCHIP_DDRTYPE_LPDDR3: 587 + dfi->burst_len = 8; 588 + break; 589 + case ROCKCHIP_DDRTYPE_LPDDR4: 590 + case ROCKCHIP_DDRTYPE_LPDDR4X: 591 + dfi->burst_len = 16; 592 + break; 593 + } 594 + 595 + ret = perf_pmu_register(pmu, "rockchip_ddr", -1); 596 + if (ret) 597 + return ret; 598 + 599 + return devm_add_action_or_reset(dfi->dev, rockchip_ddr_perf_remove, dfi); 600 + } 601 + #else 602 + static int rockchip_ddr_perf_init(struct rockchip_dfi *dfi) 603 + { 604 + return 0; 605 + } 606 + #endif 607 + 266 608 static int rk3399_dfi_init(struct rockchip_dfi *dfi) 267 609 { 268 610 struct regmap *regmap_pmu = dfi->regmap_pmu; ··· 660 240 661 241 dfi->channel_mask = GENMASK(1, 0); 662 242 dfi->max_channels = 2; 243 + 244 + dfi->buswidth[0] = FIELD_GET(RK3399_PMUGRF_OS_REG2_BW_CH0, val) == 0 ? 4 : 2; 245 + dfi->buswidth[1] = FIELD_GET(RK3399_PMUGRF_OS_REG2_BW_CH1, val) == 0 ? 4 : 2; 663 246 664 247 return 0; 665 248 }; ··· 687 264 688 265 dfi->channel_mask = BIT(0); 689 266 dfi->max_channels = 1; 267 + 268 + dfi->buswidth[0] = FIELD_GET(RK3568_PMUGRF_OS_REG2_BW_CH0, reg2) == 0 ? 4 : 2; 690 269 691 270 return 0; 692 271 }; ··· 750 325 return PTR_ERR(dfi->edev); 751 326 } 752 327 328 + ret = rockchip_ddr_perf_init(dfi); 329 + if (ret) 330 + return ret; 331 + 753 332 platform_set_drvdata(pdev, dfi); 754 333 755 334 return 0; ··· 764 335 .driver = { 765 336 .name = "rockchip-dfi", 766 337 .of_match_table = rockchip_dfi_id_match, 338 + .suppress_bind_attrs = true, 767 339 }, 768 340 }; 769 341 module_platform_driver(rockchip_dfi_driver);
+2
include/soc/rockchip/rk3399_grf.h
··· 12 12 /* PMU GRF Registers */ 13 13 #define RK3399_PMUGRF_OS_REG2 0x308 14 14 #define RK3399_PMUGRF_OS_REG2_DDRTYPE GENMASK(15, 13) 15 + #define RK3399_PMUGRF_OS_REG2_BW_CH0 GENMASK(3, 2) 16 + #define RK3399_PMUGRF_OS_REG2_BW_CH1 GENMASK(19, 18) 15 17 16 18 #endif
+1
include/soc/rockchip/rk3568_grf.h
··· 4 4 5 5 #define RK3568_PMUGRF_OS_REG2 0x208 6 6 #define RK3568_PMUGRF_OS_REG2_DRAMTYPE_INFO GENMASK(15, 13) 7 + #define RK3568_PMUGRF_OS_REG2_BW_CH0 GENMASK(3, 2) 7 8 8 9 #define RK3568_PMUGRF_OS_REG3 0x20c 9 10 #define RK3568_PMUGRF_OS_REG3_DRAMTYPE_INFO_V3 GENMASK(13, 12)