From 88da7c2f361794c2ae21cc787adce07606fbc04d Mon Sep 17 00:00:00 2001 From: Amit Mahajan Date: Thu, 26 Nov 2009 11:52:10 +0530 Subject: [PATCH] Timer devices removed, based on PAGE granularity mappings. --- config/cml/container_ruleset.template | 59 ++------------------------- conts/baremetal/baremetal5/main.c | 2 +- src/generic/resource.c | 2 +- src/platform/pb926/platform.c | 24 +---------- 4 files changed, 6 insertions(+), 81 deletions(-) diff --git a/config/cml/container_ruleset.template b/config/cml/container_ruleset.template index d37da7e..0a03f4d 100644 --- a/config/cml/container_ruleset.template +++ b/config/cml/container_ruleset.template @@ -220,23 +220,17 @@ symbols cont%(cn)d_device_uart1 'Container %(cn)d UART1 Menu' cont%(cn)d_device_uart2 'Container %(cn)d UART2 Menu' cont%(cn)d_device_uart3 'Container %(cn)d UART3 Menu' -cont%(cn)d_device_timer1 'Container %(cn)d TIMER1 Menu' -cont%(cn)d_device_timer2 'Container %(cn)d TIMER2 Menu' -cont%(cn)d_device_timer3 'Container %(cn)d TIMER3 Menu' +cont%(cn)d_device_timer1 'Container %(cn)d TIMER23 Menu' CONT%(cn)d_CAP_UART1_DEVICE_USE 'Container %(cn)d UART1 Enable' CONT%(cn)d_CAP_UART2_DEVICE_USE 'Container %(cn)d UART2 Enable' CONT%(cn)d_CAP_UART3_DEVICE_USE 'Container %(cn)d UART3 Enable' -CONT%(cn)d_CAP_TIMER1_DEVICE_USE 'Container %(cn)d TIMER1 Enable' -CONT%(cn)d_CAP_TIMER2_DEVICE_USE 'Container %(cn)d TIMER2 Enable' -CONT%(cn)d_CAP_TIMER3_DEVICE_USE 'Container %(cn)d TIMER3 Enable' +CONT%(cn)d_CAP_TIMER1_DEVICE_USE 'Container %(cn)d TIMER23 Enable' default CONT%(cn)d_CAP_UART1_DEVICE_USE from n default CONT%(cn)d_CAP_UART2_DEVICE_USE from n default CONT%(cn)d_CAP_UART3_DEVICE_USE from n default CONT%(cn)d_CAP_TIMER1_DEVICE_USE from n -default CONT%(cn)d_CAP_TIMER2_DEVICE_USE from n -default CONT%(cn)d_CAP_TIMER3_DEVICE_USE from n # Note: We are suppressing the menu not symbol here, as in future # we will add new parameters to menu, so suprpressing each symbol @@ -321,46 +315,6 @@ when CONT3_CAP_TIMER1_DEVICE_USE == y suppress cont1_device_timer1 cont2_device_timer1 -when CONT0_CAP_TIMER2_DEVICE_USE == y suppress - cont1_device_timer2 - cont2_device_timer2 - cont3_device_timer2 - -when CONT1_CAP_TIMER2_DEVICE_USE == y suppress - cont0_device_timer2 - cont2_device_timer2 - cont3_device_timer2 - -when CONT2_CAP_TIMER2_DEVICE_USE == y suppress - cont0_device_timer2 - cont1_device_timer2 - cont3_device_timer2 - -when CONT3_CAP_TIMER2_DEVICE_USE == y suppress - cont0_device_timer2 - cont1_device_timer2 - cont2_device_timer2 - -when CONT0_CAP_TIMER3_DEVICE_USE == y suppress - cont1_device_timer3 - cont2_device_timer3 - cont3_device_timer3 - -when CONT1_CAP_TIMER3_DEVICE_USE == y suppress - cont0_device_timer3 - cont2_device_timer3 - cont3_device_timer3 - -when CONT2_CAP_TIMER3_DEVICE_USE == y suppress - cont0_device_timer3 - cont1_device_timer3 - cont3_device_timer3 - -when CONT3_CAP_TIMER3_DEVICE_USE == y suppress - cont0_device_timer3 - cont1_device_timer3 - cont2_device_timer3 - menu cont%(cn)d_device_uart1 CONT%(cn)d_CAP_UART1_DEVICE_USE @@ -373,19 +327,12 @@ menu cont%(cn)d_device_uart3 menu cont%(cn)d_device_timer1 CONT%(cn)d_CAP_TIMER1_DEVICE_USE -menu cont%(cn)d_device_timer2 - CONT%(cn)d_CAP_TIMER2_DEVICE_USE - -menu cont%(cn)d_device_timer3 - CONT%(cn)d_CAP_TIMER3_DEVICE_USE - menu cont%(cn)d_device_list cont%(cn)d_device_uart1 cont%(cn)d_device_uart2 cont%(cn)d_device_uart3 cont%(cn)d_device_timer1 - cont%(cn)d_device_timer2 - cont%(cn)d_device_timer3 + # # Settings for Custom Capabilities # diff --git a/conts/baremetal/baremetal5/main.c b/conts/baremetal/baremetal5/main.c index bb743f2..ad4c44f 100644 --- a/conts/baremetal/baremetal5/main.c +++ b/conts/baremetal/baremetal5/main.c @@ -18,7 +18,7 @@ /* Frequency of timer in MHz */ #define TIMER_FREQUENCY 1 -#define TIMERS_TOTAL 3 +#define TIMERS_TOTAL 1 static struct capability caparray[32]; static int total_caps = 0; diff --git a/src/generic/resource.c b/src/generic/resource.c index 6b3fe4a..be6e2ff 100644 --- a/src/generic/resource.c +++ b/src/generic/resource.c @@ -343,7 +343,7 @@ int memcap_request_device(struct cap_list *cap_list, devcap->start = cap->start; devcap->end = cap->end; devcap->size = cap->size; - + /* Unlink only. This is boot memory */ list_remove(&cap->list); return 0; diff --git a/src/platform/pb926/platform.c b/src/platform/pb926/platform.c index d6422d6..b242767 100644 --- a/src/platform/pb926/platform.c +++ b/src/platform/pb926/platform.c @@ -58,8 +58,7 @@ int platform_setup_device_caps(struct kernel_resources *kres) /* Setup timer1 capability as free */ timer[1] = alloc_bootmem(sizeof(*timer[1]), 0); - timer[1]->start = - __pfn(PB926_TIMER01_BASE + PLATFORM_TIMER_REL_OFFSET); + timer[1]->start = __pfn(PB926_TIMER23_BASE); timer[1]->end = timer[1]->start + 1; timer[1]->size = timer[1]->end - timer[1]->start; cap_set_devtype(timer[1], CAP_DEVTYPE_TIMER); @@ -67,27 +66,6 @@ int platform_setup_device_caps(struct kernel_resources *kres) link_init(&timer[1]->list); cap_list_insert(timer[1], &kres->devmem_free); - /* Setup timer2 capability as free */ - timer[2] = alloc_bootmem(sizeof(*timer[2]), 0); - timer[2]->start = __pfn(PB926_TIMER23_BASE); - timer[2]->end = timer[2]->start + 1; - timer[2]->size = timer[2]->end - timer[2]->start; - cap_set_devtype(timer[2], CAP_DEVTYPE_TIMER); - cap_set_devnum(timer[2], 2); - link_init(&timer[2]->list); - cap_list_insert(timer[2], &kres->devmem_free); - - /* Setup timer3 capability as free */ - timer[3] = alloc_bootmem(sizeof(*timer[3]), 0); - timer[3]->start = - __pfn(PB926_TIMER23_BASE + PLATFORM_TIMER_REL_OFFSET); - timer[3]->end = timer[3]->start + 1; - timer[3]->size = timer[3]->end - timer[3]->start; - cap_set_devtype(timer[3], CAP_DEVTYPE_TIMER); - cap_set_devnum(timer[3], 3); - link_init(&timer[3]->list); - cap_list_insert(timer[3], &kres->devmem_free); - return 0; }