PowerPC L2-Cache Sram

芯片手册:http://m4udit.dinauz.org/P2020RM_rev0.pdf

PowerPC体系结构Freescale架构系列芯片可以将l2_cache配置成l2_cache与sram结合的策略来使用,在内核中是以设备的方式来驱动l2cache_sram。驱动定义在arch/powerpc/platforms/85xx/Kconfig中,配置项FSL_85XX_CACHE_SRAM,核心代码为fsl_85xx_l2ctlr.cfsl_85xx_cache_sram.c,均在arch/powerpc/sysdev路径下,主要结构定义在头文件arch/powerpc/sysdev/fsl_85xx_cache_ctlr.h中。

模块注册:

static __init int mpc85xx_l2ctlr_of_init(void)
{
    return platform_driver_register(&mpc85xx_l2ctlr_of_platform_driver);
}

static void __exit mpc85xx_l2ctlr_of_exit(void)
{
    platform_driver_unregister(&mpc85xx_l2ctlr_of_platform_driver);
}

/* 模块出口和入口 */
subsys_initcall(mpc85xx_l2ctlr_of_init);
module_exit(mpc85xx_l2ctlr_of_exit);

L2-Cache Sram驱动的注册过程如下:

mpc85xx_l2ctlr_of_probe
platform_drv_probe
driver_probe_device
__driver_attach
bus_for_each_dev
bus_add_driver
driver_register
do_one_initcall
kernel_init_freeable
kernel_init
ret_from_kernel_thread

实际上为Linux内核中驱动通用的注册逻辑,此处为platform设备驱动注册。

驱动定义:

static struct platform_driver mpc85xx_l2ctlr_of_platform_driver = {
	.driver	= {
		.name		= "fsl-l2ctlr",
		.of_match_table	= mpc85xx_l2ctlr_of_match,
	},
	.probe		= mpc85xx_l2ctlr_of_probe,
	.remove		= mpc85xx_l2ctlr_of_remove,
};

其中有一项为兼容性列表,其定义如下:

static const struct of_device_i
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值