160-cmdline-hack.patch 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. --- a/arch/mips/cavium-octeon/setup.c
  2. +++ b/arch/mips/cavium-octeon/setup.c
  3. @@ -611,6 +611,35 @@ void octeon_user_io_init(void)
  4. write_c0_derraddr1(0);
  5. }
  6. +#ifdef CONFIG_IMAGE_CMDLINE_HACK
  7. +extern char __image_cmdline[];
  8. +
  9. +static int __init octeon_use_image_cmdline(void)
  10. +{
  11. + char *p = __image_cmdline;
  12. + int replace = 0;
  13. +
  14. + if (*p == '-') {
  15. + replace = 1;
  16. + p++;
  17. + }
  18. +
  19. + if (*p == '\0')
  20. + return 0;
  21. +
  22. + if (replace) {
  23. + strlcpy(arcs_cmdline, p, sizeof(arcs_cmdline));
  24. + } else {
  25. + strlcat(arcs_cmdline, " ", sizeof(arcs_cmdline));
  26. + strlcat(arcs_cmdline, p, sizeof(arcs_cmdline));
  27. + }
  28. +
  29. + return 1;
  30. +}
  31. +#else
  32. +static inline int octeon_use_image_cmdline(void) { return 0; }
  33. +#endif
  34. +
  35. /**
  36. * Early entry point for arch setup
  37. */
  38. @@ -842,6 +871,8 @@ void __init prom_init(void)
  39. }
  40. }
  41. + octeon_use_image_cmdline();
  42. +
  43. if (strstr(arcs_cmdline, "console=") == NULL) {
  44. #ifdef CONFIG_CAVIUM_OCTEON_2ND_KERNEL
  45. strcat(arcs_cmdline, " console=ttyS0,115200");