温柔海洋
    @wowo:你的early_ioremap是得到setup_arch阶段才可以用,还有一种方法是setup_arch->pageinit->device_iomap->具体machine的map_io调用时,建立一些针对soc所有外设的静态映射表。一旦建立起来后,用IO_ADDRESS宏也可以方便地对外设寄存器进行操作(拉GPIO电平,配置串口clock,寄存器)。 这种提前建立好静态映射的方法,和你的文章中的early_ioremap起的作用效果是否相同?都是映射建立好后,就可以随心所欲操作外设了? 还有这两种方法都是要在setup_arch阶段最后建立页表时才能发挥作用,如果要在更靠前面的地方打印信息的话,是否就不能不借助CONFIG_DEBUG_LL对应的那个汇编代码串口收发指令来工作了啊?
    X-012-KERNEL-serial early console的移植  发表时间:2016-10-09 09:14
    wowo
    @温柔海洋:是的,以前arm早期的打印,是在一个叫做debug.S的汇编代码里面弄的,后来printk.c也加过一个early console,不过是比较晚才能用。 对arm64平台来说,利用early_ioremap+earlycon,在setup_arch时候就能用了。 至于early_ioremap的原理,请参考这篇文章: http://www.wowotech.net/memory_management/fixmap.html
    X-012-KERNEL-serial early console的移植  发表时间:2016-10-08 18:12
    wowo
    @温柔海洋:earlycon是一个比较新的东西,具体是哪个版本加进来的,我没有看. 至于early_ioremap,因该很早之前就有了.
    X-012-KERNEL-serial early console的移植  发表时间:2016-10-08 18:09
    温柔海洋
    再问个问题,我这边飞思卡尔imx6内核中又找到一个early_console的实现,没有通过CONFIG_DEBUG_LL来完成串口的寄存器级别收发,而是通过ioremap,enable_clk等内核API来完成的。但是这个early console 的初始化,竟然放在了start_kernel里面比较靠后的time_init 里面。这样的话,这个脱离汇编代码的early console实现,也不是个真正的早期串口console。 你的early_ioremap 比较不错,有了它,应该在start_kernel里面很早位置处(比如在page_init之前,是否可以?),就可以操作控制外设了。能大概讲下它和fixmap结合起来时,到底具体是怎么实现的啊。 page_init里面会调用具体机器的map_io,建立device 的静态映射。之后也可以通过IO_ADDRESS直接访问外设寄存器,我好奇的是你的early_ioremap如果依赖fixmap的话,并且也能在setup_arch-> page_init这些函数之前被成功被调用发挥作用的话,究竟实现思路是什么。
    X-012-KERNEL-serial early console的移植  发表时间:2016-10-08 17:51
    温柔海洋
    问下,我的kernel版本是3.0.35,里面搜early_ioremap,搜到的都是ia64和x86平台的,arm平台没有实现这个函数。 还有我的这个版本内核early_prink的实现,最终通过CONFIG_DEBUG_LL对应的debug.S 里面的几个汇编函数来实现串口寄存器级别的发送字符操作过程,你文章中的early printk的实现应该和CONFIG_DEBUG_LL没有任何关系。 是不是高版本的Linux内核 早期串口输出字符已经完全脱离了CONFIG_DEBUG_LL?而且高版本的也有arm平台的early_ioremap的实现,可以让早期串口输出可以放在start_kernel里面的任何位置?
    X-012-KERNEL-serial early console的移植  发表时间:2016-10-08 17:32
    温柔海洋
    非常好的文章,赞一个
    X-012-KERNEL-serial early console的移植  发表时间:2016-10-08 14:54
    linuxer
    @andreaji:这里的回复不能画图,所以我在http://www.wowotech.net/forum/viewtopic.php?pid=448#p448回复了你,请参考。
    Linux时间子系统之(五):POSIX Clock  发表时间:2016-10-08 11:30
    linuxer
    @fomalhaut:多谢指正
    Linux内存模型  发表时间:2016-10-07 18:48
    fomalhaut
    PFN(page frame number),而不是FPN?
    Linux内存模型  发表时间:2016-10-07 16:20
    andreaji
    只要struct posix_clock包括了cdev成员,struct posix_clock_operations中的owner以及struct posix_clock中的kref应该没有存在的必要了。 ===================================================================================== 您好 linuxer,请教一个问题: 我在读 linux-3.19.y 版本的 driver/ptp/ptp_clock.c 时看到使用 ptp clock 模块使用 posix_clock_register 注册 posix clock 时 posix_clock_operations 结构体 ptp_clock_ops 的 owner 设置为 THIS_MODULE(我理解这个 THIS_MODULE 为 ptp clock 模块) static struct posix_clock_operations ptp_clock_ops = { .owner = THIS_MODULE, ... ... }; 进入 posix_clock_register 函数时将 posix_clock -> cdev.owner 也设置为 ptp_clock_ops.owner int posix_clock_register(struct posix_clock *clk, dev_t devid) { ... ... cdev_init(&clk->cdev, &posix_clock_file_operations); clk->cdev.owner = clk->ops.owner; ... ... } 可是在 posix-clock.c 中 file_operations 结构体 posix_clock_file_operations(也就是上面 cdev_init 函数中传入的 file_operations 结构体)的 owner 被设置为 THIS_MODULE,这个 THIS_MODULE 指的是什么?如果指的是 posix-clock 的话,会不会又矛盾? 请教一下 linuxer 对于这样的设计,您是怎么看?
    Linux时间子系统之(五):POSIX Clock  发表时间:2016-10-07 14:14

共7906条381/791上一页 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 372 373 374 375 376 377 378 379 380 381382 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 788 789 790 791 下一页
Copyright @ 2013-2015 蜗窝科技 All rights reserved. Powered by emlog