linux-stable/arch/mips/cavium-octeon/flash_setup.c
Randy Dunlap 64c888ce33 mips: clean up kernel-doc in cavium-octeon/*.c
Convert function comments to kernel-doc notation to remove
kernel-doc warnings in arch/mips/cavium-octeon/*.c.
Also clean up the comments in a few places.

   arch/mips/cavium-octeon/flash_setup.c:66: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
    * Module/ driver initialization.
--
   arch/mips/cavium-octeon/setup.c:308: warning: expecting prototype for Return non zero if we are currently running in the Octeon simulator(). Prototype was for octeon_is_simulation() instead
   arch/mips/cavium-octeon/setup.c:314: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
    * Return true if Octeon is in PCI Host mode. This means
   arch/mips/cavium-octeon/setup.c:334: warning: expecting prototype for Get the clock rate of Octeon(). Prototype was for octeon_get_clock_rate() instead
   arch/mips/cavium-octeon/setup.c:351: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
    * Write to the LCD display connected to the bootbus. This display
   arch/mips/cavium-octeon/setup.c:380: warning: expecting prototype for Return the console uart passed by the bootloader(). Prototype was for octeon_get_boot_uart() instead
   arch/mips/cavium-octeon/setup.c:386: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
    * Get the coremask Linux was booted on.
   arch/mips/cavium-octeon/setup.c:399: warning: expecting prototype for Check the hardware BIST results for a CPU(). Prototype was for octeon_check_cpu_bist() instead
   arch/mips/cavium-octeon/setup.c:432: warning: expecting prototype for Reboot Octeon(). Prototype was for octeon_restart() instead
   arch/mips/cavium-octeon/setup.c:452: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
    * Permanently stop a core.
   arch/mips/cavium-octeon/setup.c:475: warning: expecting prototype for Halt the system(). Prototype was for octeon_halt() instead
   arch/mips/cavium-octeon/setup.c:520: warning: expecting prototype for Return a string representing the system type(). Prototype was for octeon_board_type_string() instead
   arch/mips/cavium-octeon/setup.c:661: warning: expecting prototype for Early entry point for arch setup(). Prototype was for prom_init() instead
--
   arch/mips/cavium-octeon/smp.c💯 warning: Function parameter or member 'cpu' not described in 'octeon_send_ipi_single'
   arch/mips/cavium-octeon/smp.c💯 warning: Function parameter or member 'action' not described in 'octeon_send_ipi_single'
   arch/mips/cavium-octeon/smp.c💯 warning: expecting prototype for Cause the function described by call_data to be executed on the passed(). Prototype was for octeon_send_ipi_single() instead
   arch/mips/cavium-octeon/smp.c:119: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
    * Detect available CPUs, populate cpu_possible_mask
   arch/mips/cavium-octeon/smp.c:210: warning: Function parameter or member 'cpu' not described in 'octeon_boot_secondary'
   arch/mips/cavium-octeon/smp.c:210: warning: Function parameter or member 'idle' not described in 'octeon_boot_secondary'
   arch/mips/cavium-octeon/smp.c:210: warning: expecting prototype for Firmware CPU startup hook(). Prototype was for octeon_boot_secondary() instead
   arch/mips/cavium-octeon/smp.c:236: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
    * After we've done initial boot, this function is called to allow the
   arch/mips/cavium-octeon/smp.c:258: warning: Function parameter or member 'max_cpus' not described in 'octeon_prepare_cpus'
   arch/mips/cavium-octeon/smp.c:258: warning: expecting prototype for Callout to firmware before smp_init(). Prototype was for octeon_prepare_cpus() instead
   arch/mips/cavium-octeon/smp.c:276: warning: expecting prototype for Last chance for the board code to finish SMP initialization before(). Prototype was for octeon_smp_finish() instead

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
Cc: Aditya Srivastava <yashsri421@gmail.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: linux-mips@vger.kernel.org
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2021-07-28 11:22:21 +02:00

143 lines
3.6 KiB
C

/*
* Octeon Bootbus flash setup
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 2007, 2008 Cavium Networks
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/semaphore.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/map.h>
#include <linux/of_platform.h>
#include <linux/mtd/partitions.h>
#include <asm/octeon/octeon.h>
static struct map_info flash_map;
static struct mtd_info *mymtd;
static const char *part_probe_types[] = {
"cmdlinepart",
#ifdef CONFIG_MTD_REDBOOT_PARTS
"RedBoot",
#endif
NULL
};
static map_word octeon_flash_map_read(struct map_info *map, unsigned long ofs)
{
map_word r;
down(&octeon_bootbus_sem);
r = inline_map_read(map, ofs);
up(&octeon_bootbus_sem);
return r;
}
static void octeon_flash_map_write(struct map_info *map, const map_word datum,
unsigned long ofs)
{
down(&octeon_bootbus_sem);
inline_map_write(map, datum, ofs);
up(&octeon_bootbus_sem);
}
static void octeon_flash_map_copy_from(struct map_info *map, void *to,
unsigned long from, ssize_t len)
{
down(&octeon_bootbus_sem);
inline_map_copy_from(map, to, from, len);
up(&octeon_bootbus_sem);
}
static void octeon_flash_map_copy_to(struct map_info *map, unsigned long to,
const void *from, ssize_t len)
{
down(&octeon_bootbus_sem);
inline_map_copy_to(map, to, from, len);
up(&octeon_bootbus_sem);
}
/*
* Module/ driver initialization.
*
* Returns Zero on success
*/
static int octeon_flash_probe(struct platform_device *pdev)
{
union cvmx_mio_boot_reg_cfgx region_cfg;
u32 cs;
int r;
struct device_node *np = pdev->dev.of_node;
r = of_property_read_u32(np, "reg", &cs);
if (r)
return r;
/*
* Read the bootbus region 0 setup to determine the base
* address of the flash.
*/
region_cfg.u64 = cvmx_read_csr(CVMX_MIO_BOOT_REG_CFGX(cs));
if (region_cfg.s.en) {
/*
* The bootloader always takes the flash and sets its
* address so the entire flash fits below
* 0x1fc00000. This way the flash aliases to
* 0x1fc00000 for booting. Software can access the
* full flash at the true address, while core boot can
* access 4MB.
*/
/* Use this name so old part lines work */
flash_map.name = "phys_mapped_flash";
flash_map.phys = region_cfg.s.base << 16;
flash_map.size = 0x1fc00000 - flash_map.phys;
/* 8-bit bus (0 + 1) or 16-bit bus (1 + 1) */
flash_map.bankwidth = region_cfg.s.width + 1;
flash_map.virt = ioremap(flash_map.phys, flash_map.size);
pr_notice("Bootbus flash: Setting flash for %luMB flash at "
"0x%08llx\n", flash_map.size >> 20, flash_map.phys);
WARN_ON(!map_bankwidth_supported(flash_map.bankwidth));
flash_map.read = octeon_flash_map_read;
flash_map.write = octeon_flash_map_write;
flash_map.copy_from = octeon_flash_map_copy_from;
flash_map.copy_to = octeon_flash_map_copy_to;
mymtd = do_map_probe("cfi_probe", &flash_map);
if (mymtd) {
mymtd->owner = THIS_MODULE;
mtd_device_parse_register(mymtd, part_probe_types,
NULL, NULL, 0);
} else {
pr_err("Failed to register MTD device for flash\n");
}
}
return 0;
}
static const struct of_device_id of_flash_match[] = {
{
.compatible = "cfi-flash",
},
{ },
};
MODULE_DEVICE_TABLE(of, of_flash_match);
static struct platform_driver of_flash_driver = {
.driver = {
.name = "octeon-of-flash",
.of_match_table = of_flash_match,
},
.probe = octeon_flash_probe,
};
static int octeon_flash_init(void)
{
return platform_driver_register(&of_flash_driver);
}
late_initcall(octeon_flash_init);
MODULE_LICENSE("GPL");