26 #include <linux/device.h>
27 #include <linux/kernel.h>
29 #include <linux/resource.h>
35 #include <linux/module.h>
45 #ifdef CONFIG_BOOTLOADER_DRIVER
46 #include <asm/mach-powertv/kbldr.h>
48 #include <asm/bootinfo.h>
50 #define BOOTLDRFAMILY(byte1, byte0) (((byte1) << 8) | (byte0))
55 static void pmem_setup_resource(
void);
85 .name =
"ASIC Resource",
98 #define FORCEFAMILY_PARAM "forcefamily"
105 static __init int check_forcefamily(
unsigned char forced_family[2])
109 forced_family[0] =
'\0';
110 forced_family[1] =
'\0';
115 if (p && (p !=
cmdline) && (*(p - 1) !=
' '))
121 if (*p ==
'\0' || *(p + 1) ==
'\0' ||
122 (*(p + 2) !=
'\0' && *(p + 2) !=
' '))
124 "characters long, ignoring value\n");
127 forced_family[0] = *
p;
128 forced_family[1] = *(p + 1);
144 unsigned char forced_family[2];
145 unsigned short bootldr_family;
147 if (check_forcefamily(forced_family) == 0)
152 #ifdef CONFIG_BOOTLOADER_DRIVER
153 bootldr_family = (
unsigned short) kbldr_GetSWFamily();
155 #if defined(CONFIG_BOOTLOADER_FAMILY)
157 CONFIG_BOOTLOADER_FAMILY[0],
158 CONFIG_BOOTLOADER_FAMILY[1]);
160 #error "Unknown Bootloader Family"
165 pr_info(
"Bootloader Family = 0x%04X\n", bootldr_family);
167 switch (bootldr_family) {
229 static void __init set_register_map(
unsigned long phys_base,
243 platform_set_family();
255 pr_info(
"Platform: 1500/Vz Class E - "
256 "CALLIOPE, NON_DVR_CAPABLE\n");
259 pr_info(
"Platform: 1500/Vz Class F - "
260 "CALLIOPE, NON_DVR_CAPABLE\n");
263 pr_info(
"Platform: 1500/RNG100 - CALLIOPE, "
264 "NON_DVR_CAPABLE\n");
275 pr_info(
"Platform: 4500 - ZEUS, NON_DVR_CAPABLE\n");
280 unsigned int chipversion = 0;
292 chipversion |=
asic_read(chipver2) << 16;
302 pr_info(
"Platform: 4600 - %s, NON_DVR_CAPABLE, "
303 "chipversion=0x%08X\n",
314 pr_info(
"Platform: Vz Class A - CRONUS, NON_DVR_CAPABLE\n");
325 pr_info(
"Platform: 8500/RNG200 - ZEUS, DVR_CAPABLE\n");
336 pr_info(
"Platform: 8600/Vz Class B - CRONUS, "
346 pr_info(
"Platform: 8700 - GAIA, DVR_CAPABLE\n");
350 pr_crit(
"Platform: UNKNOWN PLATFORM\n");
393 pmem_setup_resource();
396 for (i = 0; gp_resources[
i].
flags != 0; i++) {
397 int size = resource_size(&gp_resources[i]);
398 if ((gp_resources[i].
start != 0) &&
402 total += resource_size(&gp_resources[i]);
403 pr_info(
"reserve resource %s at %08x (%u bytes)\n",
404 gp_resources[i].
name, gp_resources[i].start,
405 resource_size(&gp_resources[i]));
410 for (i = 0; gp_resources[
i].
flags != 0; i++) {
411 int size = resource_size(&gp_resources[i]);
412 if ((gp_resources[i].
start == 0) &&
417 pr_err(
"Unable to allocate bootmem pages "
418 "for %s\n", gp_resources[i].
name);
423 gp_resources[
i].
end =
424 gp_resources[
i].
start + size - 1;
426 pr_info(
"allocate resource %s at %08x "
428 gp_resources[i].name,
429 gp_resources[i].
start, size);
434 pr_info(
"Total Platform driver memory allocation: 0x%08x\n", total);
437 for (i = 0; gp_resources[
i].
flags != 0; i++) {
438 if ((gp_resources[i].
start != 0) &&
440 pr_info(
"reserved platform resource %s at %08x\n",
441 gp_resources[i].
name, gp_resources[i].
start);
453 static int __init early_param_pmemaddr(
char *
p)
462 static int __init early_param_pmemlen(
char *p)
478 static void __init pmem_setup_resource(
void)
483 if (resource && pmemaddr && pmemlen) {
487 resource->
end = resource->
start + pmemlen - 1;
489 pr_info(
"persistent memory: start=0x%x end=0x%x\n",
513 for (i = 0; gp_resources[
i].
flags != 0; i++) {
514 if (
strcmp(gp_resources[i].name, name) == 0)
515 return &gp_resources[
i];