int __init ram_console_early_init(void) { if (ram_console_early_init_done) { printk(KERN_INFO "ram_console_early_init: already initialized, bailing out\n"); return 0; } ram_console_early_init_done = true; #else static int __init ram_console_early_init(void) { #endif return ram_console_init((struct ram_console_buffer *) CONFIG_ANDROID_RAM_CONSOLE_EARLY_ADDR, CONFIG_ANDROID_RAM_CONSOLE_EARLY_SIZE, ram_console_old_log_init_buffer); } #else static int ram_console_driver_probe(struct platform_device *pdev) { struct resource *res = pdev->resource; size_t start; size_t buffer_size; void *buffer; if (res == NULL || pdev->num_resources != 1 || !(res->flags & IORESOURCE_MEM)) { printk(KERN_ERR "ram_console: invalid resource, %p %d flags " "%lx\n", res, pdev->num_resources, res ? res->flags : 0); return -ENXIO; } buffer_size = res->end - res->start + 1; start = res->start; printk(KERN_INFO "ram_console: got buffer at %zx, size %zx\n", start, buffer_size); buffer = ioremap(res->start, buffer_size); if (buffer == NULL) { printk(KERN_ERR "ram_console: failed to map memory\n"); return -ENOMEM; } return ram_console_init(buffer, buffer_size, NULL/* allocate */); } static struct platform_driver ram_console_driver = { .probe = ram_console_driver_probe, .driver = { .name = "ram_console", }, }; static int __init ram_console_module_init(void) { int err; err = platform_driver_register(&ram_console_driver); return err; }
static int __init ram_console_early_init(void) { return ram_console_init((struct ram_console_buffer *) CONFIG_ANDROID_RAM_CONSOLE_EARLY_ADDR, CONFIG_ANDROID_RAM_CONSOLE_EARLY_SIZE, ram_console_old_log_init_buffer); }
static int ram_console_driver_probe(struct platform_device *pdev) { struct resource *res = pdev->resource; size_t start; size_t buffer_size; void *buffer; const char *bootinfo = NULL; struct ram_console_platform_data *pdata = pdev->dev.platform_data; if (res == NULL || pdev->num_resources != 1 || !(res->flags & IORESOURCE_MEM)) { printk(KERN_ERR "ram_console: invalid resource, %p %d flags " "%lx\n", res, pdev->num_resources, res ? res->flags : 0); return -ENXIO; } buffer_size = res->end - res->start + 1; start = res->start; printk(KERN_INFO "ram_console: got buffer at %zx, size %zx\n", start, buffer_size); buffer = ioremap(res->start, buffer_size); if (buffer == NULL) { printk(KERN_ERR "ram_console: failed to map memory\n"); return -ENOMEM; } if (pdata) bootinfo = pdata->bootinfo; return ram_console_init(buffer, buffer_size, bootinfo, NULL/* allocate */); }
static int __init ram_console_early_init(void) { return ram_console_init((struct ram_console_buffer *) 0,0, NULL, 0); }
static int ram_console_driver_probe(struct platform_device *pdev) { struct resource *res = pdev->resource; size_t start; size_t buffer_size; void *buffer; #if defined(CONFIG_MACH_JANICE) char *start_addr; #endif if (res == NULL || pdev->num_resources != 1 || !(res->flags & IORESOURCE_MEM)) { printk(KERN_ERR "ram_console: invalid resource, %p %d flags " "%lx\n", res, pdev->num_resources, res ? res->flags : 0); return -ENXIO; } buffer_size = res->end - res->start + 1; start = res->start; printk(KERN_INFO "ram_console: got buffer at %zx, size %zx\n", start, buffer_size); buffer = ioremap(res->start, buffer_size); if (buffer == NULL) { printk(KERN_ERR "ram_console: failed to map memory\n"); return -ENOMEM; } #if defined(CONFIG_MACH_JANICE) start_addr = buffer + buffer_size - LDI_MTP_LENGTH; memcpy(mtp_data_from_boot , start_addr , LDI_MTP_LENGTH); #endif return ram_console_init(buffer, buffer_size, NULL/* allocate */); }
static int __init ram_console_early_init(void) { struct ram_console_buffer *bufp = NULL; size_t buffer_size = 0; #if defined(CONFIG_MTK_RAM_CONSOLE_USING_SRAM) #ifdef CONFIG_OF mem_desc_t sram = {0}; if (of_scan_flat_dt(dt_get_ram_console, &sram)) { if (sram.start == 0) { sram.start = CONFIG_MTK_RAM_CONSOLE_ADDR; sram.size = CONFIG_MTK_RAM_CONSOLE_SIZE; } bufp = ioremap(sram.start, sram.size); ram_console_buffer_pa = sram.start; if (bufp) buffer_size = sram.size; else { pr_err("ram_console: ioremap failed, [0x%x, 0x%x]\n", sram.start, sram.size); return 0; } /*check if pl/lk use dram*/ struct ram_console_buffer *bufp_dram = NULL; bufp_dram = remap_lowmem(CONFIG_MTK_RAM_CONSOLE_DRAM_ADDR, CONFIG_MTK_RAM_CONSOLE_DRAM_SIZE); if (bufp_dram->sig == REBOOT_REASON_SIG) { pr_err("ram_console: kernel use sram, but pl/lk use dram.\n"); memcpy(bufp, bufp_dram, sizeof(struct ram_console_buffer)); bufp_dram->sig = 0; } } else { return 0; } #else bufp = (struct ram_console_buffer *)CONFIG_MTK_RAM_CONSOLE_ADDR; buffer_size = CONFIG_MTK_RAM_CONSOLE_SIZE; /*check if pl/lk use dram*/ struct ram_console_buffer *bufp_dram = NULL; bufp_dram = remap_lowmem(CONFIG_MTK_RAM_CONSOLE_DRAM_ADDR, CONFIG_MTK_RAM_CONSOLE_DRAM_SIZE); if (bufp_dram->sig == REBOOT_REASON_SIG) { pr_err("ram_console: kernel use sram, but pl/lk use dram.\n"); memcpy(bufp, bufp_dram, sizeof(struct ram_console_buffer)); bufp_dram->sig = 0; } #endif #elif defined(CONFIG_MTK_RAM_CONSOLE_USING_DRAM) bufp = remap_lowmem(CONFIG_MTK_RAM_CONSOLE_DRAM_ADDR, CONFIG_MTK_RAM_CONSOLE_DRAM_SIZE); ram_console_buffer_pa = CONFIG_MTK_RAM_CONSOLE_DRAM_ADDR; if (bufp == NULL) { pr_err("ram_console: ioremap failed\n"); return 0; } buffer_size = CONFIG_MTK_RAM_CONSOLE_DRAM_SIZE; #else return 0; #endif pr_err("ram_console: buffer start: 0x%p, size: 0x%zx\n", bufp, buffer_size); mtk_cpu_num = num_present_cpus(); return ram_console_init(bufp, buffer_size); }
static int __init ram_console_early_init(void) { printk(KERN_ERR "ram_console: start: 0x%x, size: %d\r\n", CONFIG_MTK_RAM_CONSOLE_ADDR, CONFIG_MTK_RAM_CONSOLE_SIZE); mtk_cpu_num = num_present_cpus(); return ram_console_init((struct ram_console_buffer *) CONFIG_MTK_RAM_CONSOLE_ADDR, CONFIG_MTK_RAM_CONSOLE_SIZE); }
static int __init ram_console_early_init(void) { printk(KERN_INFO "ram_console: start: 0x%x, size: %d\r\n", CONFIG_ANDROID_RAM_CONSOLE_EARLY_ADDR, CONFIG_ANDROID_RAM_CONSOLE_EARLY_SIZE); return ram_console_init((struct ram_console_buffer *) CONFIG_ANDROID_RAM_CONSOLE_EARLY_ADDR, CONFIG_ANDROID_RAM_CONSOLE_EARLY_SIZE, NULL, ram_console_old_log_init_buffer); }
static int ram_console_driver_probe(struct platform_device *pdev) { struct resource *res = pdev->resource; size_t start; size_t buffer_size; void *buffer; const char *bootinfo = NULL; struct ram_console_platform_data *pdata = pdev->dev.platform_data; #ifdef CONFIG_DEBUG_BLDR_LOG if (bldr_log_start && bldr_log_size) { bldr_log = ioremap(bldr_log_start, bldr_log_size); if (bldr_log == NULL) { printk(KERN_ERR "[K] hboot log: failed to map memory\n"); return -ENOMEM; } printk(KERN_INFO "[K] hboot log buffer: got buffer at %lx, size %lx\n", bldr_log_start, bldr_log_size); } #endif #ifdef CONFIG_DEBUG_LAST_BLDR_LOG if (last_bldr_log_start && last_bldr_log_size) { last_bldr_log = ioremap(last_bldr_log_start, last_bldr_log_size); if (last_bldr_log == NULL) { printk(KERN_ERR "[K] last hboot log: failed to map memory\n"); return -ENOMEM; } printk(KERN_INFO "[K] last hboot log buffer: got buffer at %lx, size %lx\n", last_bldr_log_start, last_bldr_log_size); } #endif if (res == NULL || pdev->num_resources != 1 || !(res->flags & IORESOURCE_MEM)) { printk(KERN_ERR "[K] ram_console: invalid resource, %p %d flags " "%lx\n", res, pdev->num_resources, res ? res->flags : 0); return -ENXIO; } buffer_size = res->end - res->start + 1; start = res->start; printk(KERN_INFO "[K] ram_console: got buffer at %zx, size %zx\n", start, buffer_size); buffer = ioremap(res->start, buffer_size); if (buffer == NULL) { printk(KERN_ERR "[K] ram_console: failed to map memory\n"); return -ENOMEM; } if (pdata) bootinfo = pdata->bootinfo; return ram_console_init(buffer, buffer_size, bootinfo, NULL); }
static int ram_console_driver_probe(struct platform_device *pdev) { struct resource *res = pdev->resource; size_t start; size_t buffer_size; void *buffer; if (res == NULL || pdev->num_resources != 1 || !(res->flags & IORESOURCE_MEM)) { printk(KERN_ERR "ram_console: invalid resource, %p %d flags " "%lx\n", res, pdev->num_resources, res ? res->flags : 0); return -ENXIO; } buffer_size = res->end - res->start + 1; start = res->start; printk(KERN_INFO "ram_console: got buffer at %zx, size %zx\n", start, buffer_size); //LGE_CHNAGE_S [email protected] from [email protected] #if defined (CONFIG_STAR_REBOOT_MONITOR) || defined (CONFIG_BSSQ_REBOOT_MONITOR) buffer = ioremap(res->start, (buffer_size+RAM_RESERVED_SIZE)); #else buffer = ioremap(res->start, buffer_size); #endif //LGE_CHNAGE_E [email protected] from [email protected] if (buffer == NULL) { printk(KERN_ERR "ram_console: failed to map memory\n"); return -ENOMEM; } //LGE_CHNAGE_S [email protected] from [email protected] #if defined (CONFIG_STAR_REBOOT_MONITOR) || defined (CONFIG_BSSQ_REBOOT_MONITOR) #ifndef CONFIG_CM_BOOTLOADER_COMPAT reserved_buffer = buffer + buffer_size; #else /* Force the reserved_buffer to be at its old (Froyo/GB) location for reboot to work with the older bootloader */ reserved_buffer = ioremap(0x17f80000, RAM_RESERVED_SIZE); #endif printk ("ram console: ram_console virtual addr = 0x%x \n", buffer); printk ("ram console: reserved_buffer virtual = 0x%x \n", reserved_buffer); printk ("ram console: reserved_buffer physical= 0x%x \n", start+buffer_size); #endif //LGE_CHNAGE_E [email protected] from [email protected] return ram_console_init(buffer, buffer_size, NULL/* allocate */); }
static int ram_console_driver_probe(struct platform_device *pdev) { struct resource *res = pdev->resource; size_t start; size_t buffer_size; void *buffer; const char *bootinfo = NULL; struct ram_console_platform_data *pdata = pdev->dev.platform_data; if (res == NULL || pdev->num_resources != 1 || !(res->flags & IORESOURCE_MEM)) { printk(KERN_ERR "ram_console: invalid resource, %p %d flags " "%lx\n", res, pdev->num_resources, res ? res->flags : 0); return -ENXIO; } buffer_size = res->end - res->start + 1; start = res->start; printk(KERN_INFO "ram_console: got buffer at %zx, size %zx\n", start, buffer_size); #if defined (CONFIG_REBOOT_MONITOR) buffer = ioremap(res->start, (buffer_size+RAM_RESERVED_SIZE)); #else buffer = ioremap(res->start, buffer_size); #endif if (buffer == NULL) { printk(KERN_ERR "ram_console: failed to map memory\n"); return -ENOMEM; } if (pdata) bootinfo = pdata->bootinfo; #if defined (CONFIG_REBOOT_MONITOR) reserved_buffer = buffer + buffer_size; printk ("ram console: ram_console virtual addr = 0x%x \n", buffer); printk ("ram console: reserved_buffer virtual = 0x%x \n", reserved_buffer); printk ("ram console: reserved_buffer physical= 0x%x \n", start+buffer_size); #endif return ram_console_init(buffer, buffer_size, bootinfo, NULL/* allocate */); }
static int __init ram_console_early_init(void) { struct ram_console_buffer *bufp = NULL; size_t buffer_size = 0; #if defined(CONFIG_MTK_RAM_CONSOLE_USING_SRAM) bufp = (struct ram_console_buffer *)CONFIG_MTK_RAM_CONSOLE_ADDR; buffer_size = CONFIG_MTK_RAM_CONSOLE_SIZE; #elif defined(CONFIG_MTK_RAM_CONSOLE_USING_DRAM) bufp = remap_lowmem(CONFIG_MTK_RAM_CONSOLE_DRAM_ADDR, CONFIG_MTK_RAM_CONSOLE_DRAM_SIZE); if (bufp == NULL) { pr_err("ioremap failed, no ram console available\n"); return 0; } buffer_size = CONFIG_MTK_RAM_CONSOLE_DRAM_SIZE; #else return 0; #endif pr_err("%s: start: 0x%p, size: %d\n", __func__, bufp, buffer_size); mtk_cpu_num = num_present_cpus(); return ram_console_init(bufp, buffer_size); }