wowo
    @linuxxx:抱歉啊,当初觉得设备模型比较通用,就没有太在意版本,应该是3.10左右的。
    Linux设备模型(6)_Bus  发表时间:2016-10-14 17:24
    linuxxx
    想问下wowo,Linux设备模型这个系列代码分析是基于哪个内核版本
    Linux设备模型(6)_Bus  发表时间:2016-10-14 16:46
    wowo
    @驴肉火烧:已添加,用户名:驴肉火烧 ,密码:123321 尽快登录改密码哦,最好把邮箱信息也补充一下~~ 多谢分享哦:-)
    留言板  发表时间:2016-10-14 13:17
    驴肉火烧
    @linuxer:好啊,就这个名字吧,驴肉火烧很好吃哦,哈哈
    留言板  发表时间:2016-10-14 12:30
    wowo
    @麦兜要努力:我觉得,代码是为了兼容OF enable(DTS场景)和disable(传统的mach场景)两种使用方式,不会共存。 你可以按照这个思路,查找一下代码,找到支持或者驳斥这个观点的证据(重点关注CONFIG_OF等和device tree有关的配置项)。
    Device Tree(三):代码分析  发表时间:2016-10-14 11:43
    麦兜要努力
    楼主您好: 刚开始接触Linux driver,目前在学习dw dma的部分。无意中发现了楼主的文章,看了关于device tree和platform相关的部分,解决了一些platform_device和platorm_driver的疑惑,不过还是有些问题卡住了,想请教一下: 在引入device tree之前要静态定义platform_device struct,注册device,然后定义platform_driver struct,注册driver,进行match,执行probe。引入device tree之后,最终通过of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL)系统生成platform_device并注册到系统中。就我目前看的dw dma部分,一开始subsys_initcall(dw_init)->dw_init->platform_driver_register(&dw_driver),看到: static struct platform_driver dw_driver = { .probe = dw_probe, .remove = dw_remove, .shutdown = dw_shutdown, .driver = { .name = DRV_NAME, .pm = &dw_dev_pm_ops, .of_match_table = of_match_ptr(dw_dma_of_id_table), .acpi_match_table = ACPI_PTR(dw_dma_acpi_id_table), }, }; #define DRV_NAME "dw_dmac" #ifdef CONFIG_OF static const struct of_device_id dw_dma_of_id_table[] = { { .compatible = "snps,dma-spear1340" }, {} }; MODULE_DEVICE_TABLE(of, dw_dma_of_id_table); #endif 根据这个snps,dma-spear1340,找到spear13xx.dtsi文件。 可以在dts里面看到: ahb { #address-cells = <1>; #size-cells = <1>; compatible = "simple-bus"; ranges = <0x50000000 0x50000000 0x10000000 0x80000000 0x80000000 0x20000000 0xb0000000 0xb0000000 0x22000000 0xd8000000 0xd8000000 0x01000000 0xe0000000 0xe0000000 0x10000000>; sdhci@b3000000 { compatible = "st,sdhci-spear"; reg = <0xb3000000 0x100>; interrupts = <0 28 0x4>; status = "disabled"; }; cf@b2800000 { compatible = "arasan,cf-spear1340"; reg = <0xb2800000 0x1000>; interrupts = <0 29 0x4>; status = "disabled"; dmas = <&dwdma0 0 0 0 0>; dma-names = "data"; }; dwdma0: dma@ea800000 { compatible = "snps,dma-spear1340"; reg = <0xea800000 0x1000>; interrupts = <0 19 0x4>; status = "disabled"; dma-channels = <8>; #dma-cells = <3>; dma-requests = <32>; chan_allocation_order = <1>; chan_priority = <1>; block_size = <0xfff>; dma-masters = <2>; data_width = <3 3 0 0>; }; dma@eb000000 { compatible = "snps,dma-spear1340"; reg = <0xeb000000 0x1000>; interrupts = <0 59 0x4>; status = "disabled"; dma-requests = <32>; dma-channels = <8>; dma-masters = <2>; #dma-cells = <3>; chan_allocation_order = <1>; chan_priority = <1>; block_size = <0xfff>; data_width = <3 3 0 0>; }; ..... 疑问: 在spear1340c.里面看到: static void __init spear1340_dt_init(void) { of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); platform_device_register_simple("spear-cpufreq", -1, NULL, 0); } static const char * const spear1340_dt_board_compat[] = { "st,spear1340", "st,spear1340-evb", NULL, }; DT_MACHINE_START(SPEAR1340_DT, "ST SPEAr1340 SoC with Flattened Device Tree") .smp = smp_ops(spear13xx_smp_ops), .map_io = spear13xx_map_io, .init_time = spear13xx_timer_init, .init_machine = spear1340_dt_init, .restart = spear_restart, .dt_compat = spear1340_dt_board_compat, MACHINE_END 那这边有调用of_platform_populate,那dma node是在platform bus下面的,应该是有被创建了platform_device了吧?但是我根据 .name = "dw_dmac",我又找到了关于dw_dmac0_device的静态定义: static struct dw_dma_platform_data dw_dmac0_data = { .nr_channels = 3, .block_size = 4095U, .nr_masters = 2, .data_width = { 2, 2, 0, 0 }, }; static struct resource dw_dmac0_resource[] = { PBMEM(0xff200000), IRQ(2), }; DEFINE_DEV_DATA(dw_dmac, 0); DEV_CLK(hclk, dw_dmac0, hsb, 10); #define DEFINE_DEV_DATA(_name, _id) \ static u64 _name##_id##_dma_mask = DMA_BIT_MASK(32); \ static struct platform_device _name##_id##_device = { \ .name = #_name, \ .id = _id, \ .dev = { \ .dma_mask = &_name##_id##_dma_mask, \ .platform_data = &_name##_id##_data, \ .coherent_dma_mask = DMA_BIT_MASK(32), \ }, \ .resource = _name##_id##_resource, \ .num_resources = ARRAY_SIZE(_name##_id##_resource), \ } 以及dw_dmac0_device注册: static int __init system_device_init(void) { platform_device_register(&at32_pm0_device); platform_device_register(&at32_intc0_device); platform_device_register(&at32ap700x_rtc0_device); platform_device_register(&at32_wdt0_device); platform_device_register(&at32_eic0_device); platform_device_register(&smc0_device); platform_device_register(&pdc_device); platform_device_register(&dw_dmac0_device); platform_device_register(&at32_tcb0_device); platform_device_register(&at32_tcb1_device); platform_device_register(&pio0_device); platform_device_register(&pio1_device); platform_device_register(&pio2_device); platform_device_register(&pio3_device); platform_device_register(&pio4_device); return 0; } 那究竟这个platform_device,究竟是在of_platform_populate里面去创建和注册的,通过snps,dma-spear1340去匹配?还是说在platform_device_register(&dw_dmac0_device)这边静态定义并被注册,通过name dw_dmac去匹配?为什么会既存在于dts里面,又静态去定义呢,会不会冲突呢?而且有两个同样compatible string的dma,只是address不同,那应该是根据设备号id去区分,在静态定义的时候可以设置为0和1,但是在of_platform_populate里面的of_device_add,初始值是-1,那有两个同样的设备,这个id它会做什么样的变化呢? 希望能得到楼主的解答,感谢!
    Device Tree(三):代码分析  发表时间:2016-10-14 09:52
    bigchris
    @wpch315:如果是wfi 做clk gating的情况,是us的反应,power gating的反应时间一般都是100us级,如果power gating的范围比较大的话,时间会更长,这个与clk与power上电的稳定时间相关,还有就是如果有cache flush的话,其时间占比也非常大。
    留言板  发表时间:2016-10-13 18:52
    wowo
    @lenli:使得,一次传输。 都没有错,255是Data channel上的PDU;31是广播channel的PDU(可参考http://www.wowotech.net/bluetooth/ble_broadcast.html)。
    蓝牙协议分析(7)_BLE连接有关的技术分析  发表时间:2016-10-13 18:12
    wowo
    @bigchris:多谢提醒,学习了:-)
    Linux CPU core的电源管理(3)_cpu ops  发表时间:2016-10-13 18:10
    lenli
    窝窝 Length,有效数据的长度(Payload+MIC),只有8-bits,因此Link Layer所能传输的最大数据是255 bytes(有MIC的话是251bytes) 你说的一次最多可以传输251字节,蓝牙手册Vol 6, Part B 2.4小节 说的是最多27+4=31字节。 这个是我没有理解正确,还是你这里说错了
    蓝牙协议分析(7)_BLE连接有关的技术分析  发表时间:2016-10-13 17:37

共7862条372/787上一页 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 下一页
Copyright @ 2013-2015 蜗窝科技 All rights reserved. Powered by emlog